Open ChiTimesChi opened 1 year ago
@ChiTimesChi i face same problem. But I have more wide issue so could you please dm me in Telegram? https://t.me/msmobile
Same problem, moving from an old Brownie project onto Foundry.
hmm, this indeed fails because the settings violate a scrypt check:
maybe exported blocksize (r) and parallelism factor (p) are switched, defaults are r=8,p=1
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (d4f626b 2023-08-09T00:21:28.739489228Z)
What command(s) is the bug in?
forge create; forge script
Operating System
Linux
Describe the bug
forge script
as well asforge create
doesn't seem to work with keystores exported/generated by brownie. This is quite unfortunate, as there's no option to export a keystore usingcast wallet
and a custom private key, at least until https://github.com/foundry-rs/foundry/pull/5551 is implemented.Generating a Brownie keystore
First, import any private key into Brownie and export a keystore. We'll be using a known private key for this.
$ brownie accounts new ones
1111111111111111111111111111111111111111111111111111111111111111
ones
.SUCCESS: A new account '0x19E7E376E7C213B7E7e7e46cc70A5dD086DAff2A' has been generated with the id 'ones'
$ brownie accounts export ones ./ones.json
This should get you the keystore with the "encrypted" "private" key.Pasting the resulting
ones.json
as isDeploying using brownie keystore
Now, try using this keystore. Obviously, don't send any funds to this address, we're only interested in whether the keystore could be decrypted.
Clone any Foundry-based repo. I usually use minimalistic Multicall3 repo: https://github.com/mds1/multicall/
Try deploying anything using this keystore:
Deploying using cast wallet keystore
Compare this to using the keystore for a random address, generated by
cast wallet new .
This one is protected by not a secure password by any meansripped
.Pasting the resulting
ripped.json
as isIn this case keystore is successfully decrypted:
Deploying using brownie keystore with address field removed
You may have noticed that brownie keystore json file has as extra address field, but the error remains even if you rip it out.
Pasting the resulting
onesCleared.json
as isThe very same error happens