0

I'm trying to deploy my contract with Foundry Solidity Scripting to Infura on the Seoplia test net. But Im getting this weird issue that appears to be related to the Infura API Key (formerly Project ID). I copied the seoplia URL from the Insura dashboard into my .env

❯ forge script script/ICO.s.sol:MyScript --rpc-url $SEPOLIA_RPC_URL --broadcast --verify -vvvv                                                     ─╯
Error: 
(code: -32002, message: rejected due to project ID settings, data: None)

Update

From this starter repo: https://github.com/smartcontractkit/foundry-starter-kit

forge script script/ICO.s.sol:MyScript --rpc-url ${SEPOLIA_RPC_URL} --private-key ${PRIVATE_KEY} --broadcast --verify --etherscan-api-key ${ETHERSCAN_API_KEY} -vvvv

and I'm getting a slightly different output:

[⠒] Compiling...
No files changed, compilation skipped
2023-03-09T08:51:48.418184Z ERROR sharedbackend: Failed to send/recv `basic` err=GetAccount(0x1804c8ab1f12e6bbf3894d4083f33e07309d1f38, 
(code: -32002, message: rejected due to project ID settings, data: None)) address=0x1804c8ab1f12e6bbf3894d4083f33e07309d1f38
Error: 
Failed to get account for 0x1804c8ab1f12e6bbf3894d4083f33e07309d1f38: 0x1804c8ab1f12e6bbf3894d4083f33e07309d1f38

script/ICO.s.sol

//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.17;

import "forge-std/Script.sol";
import "../src/contracts/ICO.sol";

contract MyScript is Script {
    function run() external {
        uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");

        vm.startBroadcast(deployerPrivateKey);

        address treasury = address(this);
        address[] memory approvedSigners = new address[](0);

        approvedSigners[0] = address(this);

        ICO ico = new ICO(treasury, approvedSigners);

        vm.stopBroadcast();
    }
}

Does anyone know what the issue could be?

enter image description here enter image description here

1
  • I was able to get it to work with forge create but it's a terribly long command and I'd prefer to get it working with Solidity scripting: forge create src/contracts/ICO.sol:ICO --verify --etherscan-api-key $ETHERSCAN_API_KEY --rpc-url $SEPOLIA_RPC_URL --private-key $PRIVATE_KEY --constructor-args "0xA247e0BCEb1a503a290e39BE7310C7B2C253fd80" "[]" Mar 9 at 6:53

1 Answer 1

0

Have you tried without the --verify argument, I think when deploy with scripting you need to run forge verifyin a separate command.

Hope it helps!

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.