# Integration and Implementation

### 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.sol`contract 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&#x20;

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.

{% hint style="info" %}
The process for integrating the Molecule Protocol into an smart contract should be implemented at the time of deployment&#x20;
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.moleculeprotocol.io/integration-and-implementation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
