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

Getting nonce has already been used with deterministicDeployment #544

Open
leopaul36 opened this issue Apr 28, 2024 · 6 comments
Open

Getting nonce has already been used with deterministicDeployment #544

leopaul36 opened this issue Apr 28, 2024 · 6 comments

Comments

@leopaul36
Copy link

leopaul36 commented Apr 28, 2024

Hello,

I am trying to deploy safe-contracts which uses deterministicDeployment in its scripts on an Avalanche Subnet EVM.

The deployment fails at stage deploying create2 deployer contract with the following stack trace:

$ C:\Users\leo\dev\gnosis-safe\safe-smart-account\node_modules\.bin\hardhat --network dexalotTestnet deploy
Nothing to compile
sending eth to create2 contract deployer address (0x3fab184622dc19b6109349b94811493bf2a45362) (tx: 0x67dcc04a0943ec80a34f4d3eadb6a5e257d60035af3af4754e
564866f25b1708)...
deploying create2 deployer contract (at 0x4e59b44847b379578588920ca78fbf26c0b4956c) using deterministic deployment (https://github.com/Arachnid/determi
nistic-deployment-proxy)An unexpected error occurred:

Error: ERROR processing C:\Users\leo\dev\gnosis-safe\safe-smart-account\src\deploy\deploy_accessors.ts:
Error: nonce has already been used (error={"name":"ProviderError","code":-32000,"_isProviderError":true}, method="sendTransaction", transaction="0xf8a5
8085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0360160008160208237803582823
4f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a0222222222222222222222222222222222222
2222222222222222222222222222", code=NONCE_EXPIRED, version=providers/5.4.5)
    at Logger.makeError (C:\Users\leo\dev\gnosis-safe\safe-smart-account\node_modules\hardhat-deploy\node_modules\@ethersproject\logger\src.ts\index.
ts:225:28)

It is worth mentioning that a previous attempt at deploying the contracts failed on the network on which I want to deploy the Safe contracts (see transaction) so indeed, the deployer address' 0x3fab184622dc19b6109349b94811493bf2a45362 nonce 0 has already been used.

Is there a way to setup the nonce using deterministicDeployment?

Thanks

@wighawag
Copy link
Owner

That's a weird one, It means the blockchain you are trying to deploy do not support the factory used by hardhat-deploy

You can configure a different factory : https://github.com/wighawag/hardhat-deploy?tab=readme-ov-file#4-deterministicdeployment-ability-to-specify-a-deployment-factory

@leopaul36
Copy link
Author

@wighawag after investigating more, I came across this issue which is really similar: safe-global/safe-singleton-factory#408

So it turns out that the 1st attempt at deployer contract creation failed because the deployer address 0x3fab184622dc19b6109349b94811493bf2a45362 was not allowed to create smart contract on this chain.

Now that nonce 0 has been used, I guess we're a bit stuck here...

@wighawag
Copy link
Owner

yes, you would need a different factory

@executionreverted
Copy link

i had same issue. forgot to allow my contract. now nonce 0 is gone. maybe a simple feature can be added to plugin to check if a chain has IAllowList precompile (means its avax l1) and check it has right to deploy first?

@executionreverted
Copy link

is there a way to disable deterministic deployment, or is there an easy way to create new factory parameters for deterministicDeployment

@wighawag
Copy link
Owner

@executionreverted see this comment : #544 (comment)

you can setup your own deterministic deployment parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants