Is there a literature on how to deploy multiple contracts at once?
I am using truffle, trufflehdwalletprovider and Infura end-point.
I implement the attached code snippet to deploy a single contract. What to add, if I want to deploy multiple contracts?
Dec 25, 2020, 6:12 AM
You can add multiple deployer function in the deploy contract script for truffle
Dec 25, 2020, 6:46 AM
Thanks mate.
Allow me to add little depth to the context. I am implementing access control for my contracts. I am considering the following approach,
1] Create an AccessControl.sol contract with CRUD functions for roles, inclusive of role registry[save roles in storage] & role-check[to check if a role exists or not].
2] Create a contract specific solidity file. Eg: TokenAccess.sol contains the roles[such as admin, minter, pauser, burner] specified in the token contract. This contract is AccessControl, that keeps a copy of the roles specific to the token contract. This contract will be deployed in chain in the migration file.
3] Token contract[Token.sol], that inherits the TokenAccess.sol
Now, in web3, i can create a contract instance for the token contract, and fetch its abi. How do i do the same for AccessControl.sol & TokenAccess.sol, so that I can perform CRUD on those contracts?
Thanks a lot.
Allow me to add little depth to the context. I am implementing access control for my contracts. I am considering the following approach,
1] Create an AccessControl.sol contract with CRUD functions for roles, inclusive of role registry[save roles in storage] & role-check[to check if a role exists or not].
2] Create a contract specific solidity file. Eg: TokenAccess.sol contains the roles[such as admin, minter, pauser, burner] specified in the token contract. This contract is AccessControl, that keeps a copy of the roles specific to the token contract. This contract will be deployed in chain in the migration file.
3] Token contract[Token.sol], that inherits the TokenAccess.sol
Now, in web3, i can create a contract instance for the token contract, and fetch its abi. How do i do the same for AccessControl.sol & TokenAccess.sol, so that I can perform CRUD on those contracts?
Thanks a lot.
Dec 25, 2020, 7:07 AM
Why can't you do the same for tokenaccess and accesscontrol? Also if those contracts are comparatively small, merge them. Would be much easier to work with
Dec 25, 2020, 7:26 AM