This document outlines the usage flow for the smart contracts within the Transaction Processor project.
MultiSig Contract Deployment:
- Compile and deploy the
MultiSig
contract. - During construction, provide an array of owner addresses to be assigned the
SuperAdmin
role.
Adding Members and Roles:
- Use a
SuperAdmin
account to call theaddMember
function on the deployedMultiSig
contract. - Specify the address of the new member and their desired role (
Submitter
,Approver
, orExecutor
). - The transaction requires approval from existing
SuperAdmin
accounts. You will need to call theapprove
function from multipleSuperAdmin
addresses. - Once sufficient approvals are gathered, call the
execute
function from anySuperAdmin
account to finalize the member addition.
ERC20 Contract Deployment and Linking with MultiSig:
- Compile and deploy the desired ERC20 token contract.
- Crucially, during ERC20 contract deployment, set the
MultiSig
contract address as the owner of the ERC20 contract. This ensures the MultiSig contract controls minting operations. - (Optional) If you forget to set the owner during deployment, you can use the ERC20 contract's
transferOwnership
function (assuming it exists) to transfer ownership from the deployer address to theMultiSig
contract address. This requires a separate transaction initiated by aSuperAdmin
account. - From a
SuperAdmin
account, call theaddContract
function on theMultiSig
contract. - Provide the address of the deployed ERC20 contract and the token symbol as arguments.
- Similar to adding members, this action requires approval from multiple
SuperAdmin
accounts. Follow steps 3 and 4 from the "Adding Members and Roles" section.
Forked from @Bary-io