Deploy to Sepolia Infura Foundry: Solidity Scripting
Deploy to Sepolia Infura Foundry: Solidity Scripting
Loading saved threads...
currenthandle · External communityPost link
External question — Ethereum Stack Exchange
Author: currenthandle
Original post: https://ethereum.stackexchange.com/questions/147121
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
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?
Quote
Report
donoso.eth · External communityPost link
External answer — Ethereum Stack Exchange
Author: donoso.eth
Original post: https://ethereum.stackexchange.com/a/147127
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
Have you tried without the --verify argument, I think when deploy with scripting you need to run
forge verify
in a separate command.
Hope it helps!
Quote
Report
Yan Digilov · External communityPost link
External answer — Ethereum Stack Exchange
Author: Yan Digilov
Original post: https://ethereum.stackexchange.com/a/168509
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
If you are using --private-key you should not need to use vm.startBroadcast(PRIVATEKEY). Try it with only vm.startBroadcast() and see if that changes the error.
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External answer — Ethereum Stack Exchange Author: donoso.eth Source score (net votes, not local likes): 0 Original post: https://ethereum.stackexchange.com/a/147127 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. Have you tried without the --verify argument, I think when deploy with scripting you need to run forge verify in a separate command. Hope it helps!
Checking account access…