GithubHelp home page GithubHelp logo

create2 about clone-factory HOT 8 OPEN

optionality avatar optionality commented on June 18, 2024 2
create2

from clone-factory.

Comments (8)

BlinkyStitt avatar BlinkyStitt commented on June 18, 2024

If the factory contract used CREATE2, I think someone could front run a transaction's salt and steal the address. So you'd have to wait for a few confirmations before sending any funds.

from clone-factory.

moodysalem avatar moodysalem commented on June 18, 2024

If the factory contract used CREATE2, I think someone could front run a transaction's salt and steal the address. So you'd have to wait for a few confirmations before sending any funds.

Not true, CREATE2 uses the deployer address in computing the resulting contract address

edit: not sure exactly what situation you are describing

from clone-factory.

BlinkyStitt avatar BlinkyStitt commented on June 18, 2024

from clone-factory.

moodysalem avatar moodysalem commented on June 18, 2024

Oh, I am using a version of the minimal proxy in a library and calling it from a contract.

from clone-factory.

ItsNickBarry avatar ItsNickBarry commented on June 18, 2024

@moodysalem I've published a create2 implementation here: https://github.com/solidstate-network/solidstate-contracts/blob/master/contracts/architecture/factory/MinimalProxyFactory.sol

Note that it's in a pre-release state, and not to be completely trusted. It is also likely to not be as minimal as possible. I still need to test the gas consumption.

from clone-factory.

yarrumretep avatar yarrumretep commented on June 18, 2024

from clone-factory.

PaulRBerg avatar PaulRBerg commented on June 18, 2024

If the factory contract used CREATE2, I think someone could front run a transaction's salt and steal the address.

I think that this issue could be circumvented by hashing the tx.origin with the user-provided salt, and passing the resultant hash as the salt to create2.

Note that it should be tx.origin rather than msg.sender because the issue would not otherwise be mitigated for factory contracts.

from clone-factory.

PaulRBerg avatar PaulRBerg commented on June 18, 2024

Looks like OpenZeppelin added support for CREAT2-enabled minimal proxies in their Clones.sol contract:

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/aefcb3e8aa4ee8da8e2b7022ffe4dcb57fbb0fdf/contracts/proxy/Clones.sol#L42-L51

from clone-factory.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.