Integration and Implementation

Provides instructions on how to add the Molecule Protocol to your own smart contract code, including importing the necessary contracts, initialising the Molecule contract, and using Molecule Protocol

Adding the Molecule Protocol to Your Smart Contract

To add the Molecule Protocol to your smart contract, the first step is to import the required Molecule Protocol smart contracts, which includes the MoleculeController.solcontract for General AML, Or custom smart contracts that verified service providers published . Once imported, the Molecule contract needs to be initialised within your code by creating an instance of the Molecule contract and utilizing the check() function available in the MoleculeController.sol contract. With the Molecule contract integrated, the Molecule Protocol functions can be used within your smart contract code. These functions enable you to create a customized AllowList, perform on-chain compliance checks, and more.

Molecule Protocol users have the flexibility to create their own core MoleculeController.sol smart contract by leveraging the Molecule smart contract template, and custom Logic Contracts by using the Logic smart contract templates provided by the protocol. The custom Logic smart contracts can be integrated into their own custom MoleculeController.sol core smart contract. Once integrated, they can import their own MoleculeController.sol core smart contract into their app smart contract or code, and create custom access logic or custom checks within their app smart contract or code. This approach provides a high degree of flexibility and customization to users of the Molecule Protocol.

It's worth noting that utilising the Molecule Protocol will result in additional gas fees for your smart contract transactions, as each function call requires additional gas fees to be paid. Nevertheless, the advantages of using the Molecule Protocol, such as increased security and compliance, could outweigh the additional gas expenses.

Integrating Molecule General AML Smart contract into a user smart contract

In conclusion, integrating the Molecule Protocol into your smart contract necessitates importing the necessary contracts, initialising the Molecule contract, and utilizing the Molecule Protocol functions within your own code.

The process for integrating the Molecule Protocol into an smart contract should be implemented at the time of deployment

Last updated