-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add interfaces * Add doc comments for core contracts * Add doc comments for modules
- Loading branch information
Showing
17 changed files
with
549 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,60 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.20; | ||
|
||
import {TokenF} from "../core/TokenF.sol"; | ||
import {ITokenF} from "./ITokenF.sol"; | ||
import {IKYCComplianceView} from "./IKYCComplianceView.sol"; | ||
|
||
interface IKYCCompliance { | ||
/** | ||
* @notice `KYCCompliance` contract is used to manage KYC Compliance modules. | ||
* It performs storage, addition of new KYC modules and deletion of existing KYC modules. | ||
* | ||
* It also implements the `isKYCed` hook, which in turn is called by the `TokenF` contract. | ||
* | ||
* All actions for module management can only be done by users who have a special role. | ||
* In the basic version of `TokenF` this role is the Agent role. | ||
* | ||
* It is possible to override the role that is required to configure the module list. | ||
* | ||
* Also this contract is used as a facet in the `TokenF` contract. | ||
*/ | ||
interface IKYCCompliance is IKYCComplianceView { | ||
/** | ||
* @notice Function is required to add new KYC modules to a `KYCCompliance` contract. | ||
* | ||
* If you try to add a module that already exists in the list of KYC modules, | ||
* the transaction will fail with an error - `SetHelper: element already exists`. | ||
* | ||
* This function in the basic `TokenF` implementation can only be called by users who have Agent role. | ||
* | ||
* An internal function `_KYCComplianceRole` is used to retrieve the role that is used in the validation, | ||
* which can be overridden if you want to use a role other than Agent. | ||
* | ||
* @param kycModules_ The array of KYC modules to add | ||
*/ | ||
function addKYCModules(address[] memory kycModules_) external; | ||
|
||
/** | ||
* @notice Function is required to remove existing KYC modules from the list in the `KYCCompliance` contract. | ||
* | ||
* If you try to delete a module that is not in the list of KYC modules, | ||
* the transaction will fail with an error - `SetHelper: no such element`. | ||
* | ||
* This function in the basic `TokenF` implementation can only be called by users who have the Agent role. | ||
* | ||
* An internal function `_KYCComplianceRole` is used to retrieve the role that is used in the validation, | ||
* which can be overridden if you want to use a role other than Agent. | ||
* | ||
* @param kycModules_ The array with KYC modules to remove | ||
*/ | ||
function removeKYCModules(address[] memory kycModules_) external; | ||
|
||
function isKYCed(TokenF.Context calldata ctx_) external view returns (bool); | ||
/** | ||
* @notice Function that is used to verify that all required KYC rules that have been added to `KYCCompliance` are met. | ||
* | ||
* The entire transaction context is passed to the checker, giving modules full information for further checks. | ||
* | ||
* @param ctx_ The context of the transaction | ||
* @return true if the passed context satisfies the checks on all modules | ||
*/ | ||
function isKYCed(ITokenF.Context calldata ctx_) external view returns (bool); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.20; | ||
|
||
/** | ||
* @notice `IKYCComplianceView` interface stores all view functions that are in the `KYCCompliance` contract | ||
*/ | ||
interface IKYCComplianceView { | ||
/** | ||
* @notice Function to get the total number of KYC modules, | ||
* that are currently added to the list of `KYCCompliance` contract modules | ||
* | ||
* @return Total number of all KYC modules in the `KYCCompliance` contract | ||
*/ | ||
function getKYCModulesCount() external view returns (uint256); | ||
|
||
/** | ||
* @notice Function to get the address list of all KYC modules, | ||
* that are currently added to the list of `KYCCompliance` contract modules | ||
* | ||
* @return Array of addresses of all KYC modules in the `KYCCompliance` contract | ||
*/ | ||
function getKYCModules() external view returns (address[] memory); | ||
} |
Oops, something went wrong.