Cyfrin / foundry-smart-contract-lottery-cu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a value is required for '--fork-url <URL>' but none was supplied

Psik628 opened this issue · comments

When I ran this code from terminal I got this error.

Can someone please help? Thanks!

forge script script/Interactions.s.sol:FundSubscription --rpc-url $SEPOLIA_RPC_URL --private-key $PRIVATE_KEY --broadcast

the error message:

a value is required for '--fork-url <URL>' but none was supplied

Check your .env again, myabe there you will find an error

commented

if you ever see this error, it means you are using a variable in your command. Your .env should always have the variables and their values that you are using in the command.

please run the following and it should work

source .env
forge script script/Interactions.s.sol:FundSubscription --rpc-url $SEPOLIA_RPC_URL --private-key $PRIVATE_KEY --broadcast

If you use source .env in your command line. you won't get this error again. Check echo $SEPOLIA_RPC_URL on the command line and it will get a RPC URL.

Great fixes all!