Giter Site home page Giter Site logo

Comments (2)

pcaversaccio avatar pcaversaccio commented on June 30, 2024

I see where you are coming from but this can be solved within the contract itself rather by changing the create2deployer contract. The only purpose of the create2deployer is to execute CREATE2 deployments and not to conduct further actions. Whatever you want to do can be achieved via constructor arguments. So for the owner<>msg.sender problem you can for instance do the following:

contract mainContract is Ownable {
    constructor(address owner) {
        _transferOwnership(owner);
    }
    ...
}

This will lead to 2 events emitted during the contract creation transaction (the first owner will be transferred to msg.sender and the second thereafter to the set address in the main constructor). The reason why this can be done is due to the linearization pattern of multiple inheritance in Solidity (see here).

For the AccessControl control case it would look like this:

contract mainContract is AccessControl {
    constructor(address admin) {
        _grantRole(DEFAULT_ADMIN_ROLE, admin);
    }
    ...
}

from create2deployer.

noyyyy avatar noyyyy commented on June 30, 2024

Thanks for your comment!

from create2deployer.

Related Issues (15)

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.