0

I'm working on deploying a factory contract which in turn has a function to deploy a three-contract ecosystem. One of those contracts also has a library contract with it.

Factory.sol
A.sol
B.sol
C.sol
Library_C.sol

I'm using the scaffold-eth repo from Austin Griffith, which ships with Buidler. I'm trying to figure out how to deploy this ecosystem using Buidler.

I can alter /packages/buidler/scripts/deploy.js to not do an auto-deploy on everything all at once, and deploy Factory.sol manually. (I don't need the other contracts deployed yet anyway.) The thing is, Factory doesn't deploy out of the constructor - it has a deployEcosystem function.

I see that Buidler has an Ethers plugin. That made me think that I could maybe deploy the Factory, then use Ethers to hit the deployEcosystem function, but I'm not all that sure that will work, since I can't figure out where a signer or gas would come from. I was looking at an Etherlime script that deploys the same suite of contracts, and I see that it has a function which can do this:

const deployer = new etherlime.JSONRPCPrivateKeyDeployer(
        secret, 
        RPC, 
        defaultConfigs
    );

Which I assume will then charge gas to this account. Does Buidler have anything similar?

If I have to use Ethers to do this, how do I tell Ethers to unlock an account from the dev chain in a script and use it as the deployer?

Alternatively, is there something else I should be doing in order to deploy the ecosystem?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.