-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
parse $PRIVATE_KEY as type uint256
: digit 10 is out of range for base 10
#6070
Labels
T-bug
Type: bug
Comments
I understand, the private key needs to be prefixed with '0x'. |
This is not a bug, the private key needs to be prefixed with '0x' |
we'll add a fallback for 0x again shortly and improve error message, #6041 but it's recommended to use 0x prefix if it's hex |
thanks this helped. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (619f3c5 2023-10-20T00:17:29.281153000Z)
What command(s) is the bug in?
forge script script/Counter.s.sol:CounterScript
Operating System
macOS (Apple Silicon)
Describe the bug
I use a script to deploy the contract and write the deployer's private key (a hexadecimal string, 64 bits in length) in the .env environment variable.When executing the script, reade the PRIVATE_KEY and converte it to uint256,
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
An error will be reported,
Failed to parse $PRIVATE_KEY as type
uint256: digit 10 is out of range for base 10
The text was updated successfully, but these errors were encountered: