Skip to content

Remove the ProxyAccountDeployer and replace with a generic deployer contract #22

@yahgwai

Description

@yahgwai

Taken from the #14

You may want to do this in a different ticket, but I think you can get rid of this contract altogether
and just use a standard create2 deployer like this: https://eips.ethereum.org/EIPS/eip-2470

I think that contract is available at the same address on all networks. If it isnt the deploy transaction is available on the EIP so you can deploy it anywhere.

Using a standard deployer will also allow you to get rid of the deployContract method on the ProxyAccount and the Relayhub, instead a user can just use forward to call the deployer contract.

@stonecoldpat
stonecoldpat 5 days ago •
Author Member
we can move this to a new ticket.

although i feel there is 1 issue. Let's say the user wants to deploy several contracts in a single transaction (like we do with any.sender).

Anyone could front-run the transaction and create just one of them. That would make the user's transaction fail potentially (since 1 out of N contracts already existed). It may have some security implications for the .init() methods in that case.

That isn't possible currently since only the signer can authorise CREATE2 via their proxy contract - so the contract address is reserved for them. There is a subtle issue though; the signer must use NONCE replay protection - to ensure all contracts are deployed in order, and even then we need a batch() method.

If they use MultiNonce or Bitflip - then an attacker can take any of the meta-transactions and forward them out of order. This is probably a good argument for the ProxyAccount to have a batch() method - to make sure all deployed contracts + init() methods are executed in a single transaction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions