Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document vm.derive #452

Closed
onbjerg opened this issue Jul 14, 2022 · 6 comments
Closed

Document vm.derive #452

onbjerg opened this issue Jul 14, 2022 · 6 comments
Labels
A-forge Area: forge A-reference Area: reference good first issue Good for newcomers T-new Type: new docs

Comments

@onbjerg
Copy link
Member

onbjerg commented Jul 14, 2022

See foundry-rs/foundry#2299

@onbjerg onbjerg added good first issue Good for newcomers A-forge Area: forge A-reference Area: reference T-new Type: new docs labels Jul 14, 2022
@onbjerg onbjerg assigned onbjerg and unassigned onbjerg Jul 14, 2022
@Elyx0
Copy link

Elyx0 commented Aug 10, 2022

Am I missing something about the usage?

source .env && forge script script/EOADeploy.s.sol:Deploy --fork-url http://localhost:8545 --broadcast

        uint256 deployerPrivateKey = vm.deriveKey(vm.envString("TESTNET_MNEMONIC"), 0);
 
        vm.startBroadcast(vm.addr(deployerPrivateKey));
Finding wallets for all the necessary addresses...

Transactions saved to: broadcast/EOADeploy.s.sol/80001/run-latest.json

Error:
No associated wallet for addresses: {0x1ba0f96b...4938cf70}. Unlocked wallets: []
error Command failed with exit code 1.

@onbjerg
Copy link
Member Author

onbjerg commented Aug 10, 2022

You still need to pass in the mnemonic separately to forge script so it knows the private key of the wallet when it has to sign transactions

@Elyx0
Copy link

Elyx0 commented Aug 11, 2022

It kinda defeats the purpose of self-aware scripting from env

@onbjerg
Copy link
Member Author

onbjerg commented Aug 11, 2022

This is not the place to discuss the feature itself, this is only for docs

@devanoneth
Copy link
Contributor

@Elyx0 have you started discussing it somewhere else? FYI, I am also working on a remember cheatcode which will allow you to actually add the private key to Foundry's wallet. I have not had the chance to finish it yet, but once I do I'll update docs to explain the intended usage.

@devanoneth
Copy link
Contributor

devanoneth commented Sep 5, 2022

@Elyx0 rememberKey landed in foundry-rs/foundry#3047. I'll have docs in the book soon but you can play around with it once the next nightly lands in about 2 hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-forge Area: forge A-reference Area: reference good first issue Good for newcomers T-new Type: new docs
Projects
Status: Done
Development

No branches or pull requests

3 participants