10. Lucid Post-Deployment Integration
Last updated
Last updated
After completing the organisation creation flow and deploying all contracts, the final step is to configure minting rights for the Asset Controller. This step involves using the OpenZeppelin AccessControl library to grant the necessary permissions. Below is a step-by-step guide to complete this process:
The AccessControl library from OpenZeppelin is used to manage roles and permissions for smart contract functions. For more details, refer to the .
The grantRole() function is used to assign a specific role to an address. In this context, the role grants the Message Controller contract permission to interact with functions related to minting.
The function syntax is as follows:
grantRole(bytes32 role, address account)
role: The role hash (determined by the project when deploying the contract).
account: The address of the Message Controller contract deployed by Lucid (on the same chain).
When your project deployed the contract, a specific role hash would have been configured for minting permissions. This role hash must be provided as the first argument in the grantRole() function.
Identify the address of the Message Controller contract deployed by Lucid. Ensure this address corresponds to the same chain as the organisation’s deployment.
Call the grantRole() function with the appropriate arguments:
1. Role Hash: Use the specific role hash for minting permissions.
2. Message Controller Address: Provide the address of the Message Controller deployed by Lucid.
grantRole(0x<role-hash>, 0x<message-controller-address>)
Replace <role-hash>
and <message-controller-address>
with the actual values for your project.
After executing the grantRole() function, confirm that the Message Controller has been granted the correct role. This can be verified by calling the hasRole() function:
hasRole(bytes32 role, address account)
Ensure the function returns true for the given role and Message Controller address.
Ensure that the Message Controller address corresponds to the same chain as the Asset Controller deployment.
Be cautious when granting roles to prevent unintended access to critical functions.
This configuration step is crucial to enable seamless interaction with the multi-bridge functionality.
By following these steps, you will successfully add minting rights to the Asset Controller, ensuring proper functionality for your organisation’s setup.