Content
@
0 reply
0 recast
2 reactions
Greg
@greg
Having issues deploying a smart contract, could use some help I'm using the default hardhat private key and running my deploy script with `--network localhost`. I have a custom nonce so I can deploy to a vanity address When I run the script, I get an error from the local node: "Nonce too high. Expected nonce to be 0 but got 36938. Note that transactions can't be queued when automining." My understanding is that I should be able to use any nonce, even if the previous ones haven't been used. The script is only sending 1 transaction, so no queueing as the error suggests. Any ideas what is happening / how to work around it?
4 replies
3 recasts
14 reactions
Stephan
@stephancill
Account nonces are sequential. Are you sure the nonce isn’t associated with something else?
1 reply
1 recast
3 reactions
Greg
@greg
Hmm my understanding was that technically nonces don’t have to be used sequentially, just uniquely But i could very well be wrong
2 replies
0 recast
0 reaction
Stephan
@stephancill
are you using CREATE for the vanity address? it's hard to control the nonce here because like i said the account nonce is sequential. if you use CREATE2 you have control over a salt param which you can easily set https://docs.openzeppelin.com/cli/2.8/deploying-with-create2#create2
1 reply
0 recast
0 reaction
Greg
@greg
yea, im generating a private key that will deploy a contract to a vanity address. works just fine but definitely finicky I looked at create2 but found it confusing. will try again. ty!
1 reply
0 recast
1 reaction