Cyfrin / foundry-smart-contract-lottery-cu

47 stars 38 forks source link

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

Closed Psik628 closed 7 months ago

Psik628 commented 1 year ago

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
blagoichelovek commented 1 year ago

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

shrutic11 commented 1 year ago

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
Parth-Sharma-tonchi commented 1 year ago

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.

PatrickAlphaC commented 7 months ago

Great fixes all!

Parth-Sharma-tonchi commented 7 months ago

I appreciate your work. You are amazing because you come back for your students.

On Thu, 15 Feb 2024 at 07:15, Patrick Collins @.***> wrote:

Great fixes all!

— Reply to this email directly, view it on GitHub https://github.com/Cyfrin/foundry-smart-contract-lottery-f23/issues/18#issuecomment-1945232979, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4OUJNBF6P2KZGVENYWIYELYTVSETAVCNFSM6AAAAAA2OQLB5SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBVGIZTEOJXHE . You are receiving this because you commented.Message ID: @.*** com>