I was trying to deploy a contract to a deterministic address using Nicks method. This works fine on Rinkeby and all the Ethereum-Testnets that I tried. However, it doesn't work on Mumbai and probably not on Polygon either. The following error message pops up:

Error: Returned error: only replay-protected (EIP-155) transactions allowed over RPC

Other posts indicate that people have encountered the same problem. The answers suggest to include the chain-id to conform to EIP-155, but I must not include the chainId for the simple reason that Nick's method relies on a deterministic chain-independent transaction hash.

Is there a way to bypass this problem. The reply by @Badr Bellaj on this this thread seems to suggest that one can pass an option, but this probably refers to the geth option for the ethereum node and not to a transaction option for a JSON-RPC call.

It seems that I have to switch to the CREATE2 opcode, as this post suggests? But is there no way to create the contract with the same address across all chains from an EOA directly anymore?

  • 1
    At this stage, there is no solution to this problem, other than using an EOA to deploy the contract at the same address which requires safeguarding the private key and it's risky and centralized. OR you need to use nick's method but the limitation would be that some network or nodes of the network doesn't support unprotected tx, or you could fall into the problem of gasPrice being higher than the hardcoded gasPrice in the raw tx. I am seeing the only way to solve this is with the link of EIP to standardize a precompile CREATE2 factory contract. Jan 23, 2023 at 13:59
  • Dear @YamenMerhi, thanks a lot for your reply. My understanding and implementation of Nicks method is that one creates a valid pre-EIP-155 transaction, whose sender is some reverse-engineered account that we do not have a private key for. However, funding that account allows the transaction to be mined. If I remember correctly (its been 8 months) the EOA comes only into action by funding that account. One cannot use the EOA directly, because the transaction message will be different for each chain (because of the chainId). So there is no method that requires the safeguarding of the EOA.
    – Marlo
    Jan 25, 2023 at 11:43
  • You misunderstood me, I completely understand Nick's method, and I acknowledge the limitation where not all network support tx with no chainId, so I am mentioning the normal way of creating a contract at the same address, which requires having the same nonce on all chains, but this one requires safeguarding the private key of the EOA to deploy from, to not mess up with the nonce. Check this section of article Jan 26, 2023 at 13:54


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.