Skip to content

Commit

Permalink
Improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rya-sge committed Aug 12, 2024
1 parent 8999da8 commit 8ba25e7
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 6 deletions.
3 changes: 3 additions & 0 deletions contracts/CMTAT_PROXY.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ pragma solidity ^0.8.20;

import "./modules/CMTAT_BASE.sol";

/**
* @title CMTAT version for a proxy deployment (Transparent or Beacon proxy)
*/
contract CMTAT_PROXY is CMTAT_BASE {
/**
* @notice Contract version for the deployment with a proxy
Expand Down
4 changes: 4 additions & 0 deletions contracts/CMTAT_PROXY_UUPS.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
pragma solidity ^0.8.20;
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "./modules/CMTAT_BASE.sol";

/**
* @title CMTAT version for a proxy deployment with UUPS proxy
*/
contract CMTAT_PROXY_UUPS is CMTAT_BASE, UUPSUpgradeable {
bytes32 public constant PROXY_UPGRADE_ROLE = keccak256("PROXY_UPGRADE_ROLE");
/**
Expand Down
3 changes: 3 additions & 0 deletions contracts/CMTAT_STANDALONE.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ pragma solidity ^0.8.20;

import "./modules/CMTAT_BASE.sol";

/**
* @title CMTAT version for a standalone deployment (without proxy)
*/
contract CMTAT_STANDALONE is CMTAT_BASE {
/**
* @notice Contract version for standalone deployment
Expand Down
2 changes: 1 addition & 1 deletion contracts/modules/internal/base/SnapshotModuleBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import "../../../libraries/Errors.sol";
* Useful to take a snapshot of token holder balance and total supply at a specific time
* Inspired by Openzeppelin - ERC20Snapshot but use the time as Id instead of a counter.
* Contrary to OpenZeppelin, the function _getCurrentSnapshotId is not available
because overriding this function can break the contract.
* because overriding this function can break the contract.
*/

abstract contract SnapshotModuleBase is Initializable {
Expand Down
1 change: 1 addition & 0 deletions contracts/modules/wrapper/core/BaseModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pragma solidity ^0.8.20;
// required OZ imports here
import "../../security/AuthorizationModule.sol";
import "../../../libraries/Errors.sol";

abstract contract BaseModule is AuthorizationModule {
/* ============ State Variables ============ */
/**
Expand Down
8 changes: 8 additions & 0 deletions contracts/modules/wrapper/core/ERC20BaseModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ pragma solidity ^0.8.20;
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "../../../libraries/Errors.sol";

/**
* @title ERC20Base module
* @dev
*
* Contains ERC-20 base functions and extension
* Inherits from ERC-20
*
*/
abstract contract ERC20BaseModule is ERC20Upgradeable {
/* ============ Events ============ */
/**
Expand Down
7 changes: 7 additions & 0 deletions contracts/modules/wrapper/core/ERC20BurnModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ pragma solidity ^0.8.20;
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "../../security/AuthorizationModule.sol";
import "../../../interfaces/ICCIPToken.sol";

/**
* @title ERC20Burn module.
* @dev
*
* Contains all burn functions, inherits from ERC-20
*/
abstract contract ERC20BurnModule is ERC20Upgradeable, ICCIPBurnFromERC20, AuthorizationModule {
/* ============ State Variables ============ */
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
Expand Down
7 changes: 7 additions & 0 deletions contracts/modules/wrapper/core/ERC20MintModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ pragma solidity ^0.8.20;
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "../../security/AuthorizationModule.sol";
import "../../../interfaces/ICCIPToken.sol";

/**
* @title ERC20Mint module.
* @dev
*
* Contains all mint functions, inherits from ERC-20
*/
abstract contract ERC20MintModule is ERC20Upgradeable, ICCIPMintERC20, AuthorizationModule {
/* ============ State Variables ============ */
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
Expand Down
3 changes: 2 additions & 1 deletion contracts/modules/wrapper/core/EnforcementModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import "../../security/AuthorizationModule.sol";
import "../../internal/EnforcementModuleInternal.sol";

/**
* @dev Enforcement module.
* @title Enforcement module.
* @dev
*
* Allows the issuer to freeze transfers from a given address
*/
Expand Down
5 changes: 3 additions & 2 deletions contracts/modules/wrapper/core/PauseModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
import "../../security/AuthorizationModule.sol";

/**
*
* @dev Put in pause or deactivate the contract
* @title Pause Module
* @dev
* Put in pause or deactivate the contract
* The issuer must be able to “pause” the smart contract,
* to prevent execution of transactions on the distributed ledger until the issuer puts an end to the pause.
*
Expand Down
6 changes: 6 additions & 0 deletions contracts/modules/wrapper/extensions/DebtModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import "../../security/AuthorizationModule.sol";
import "../../../libraries/Errors.sol";
import "../../../interfaces/engine/IDebtEngine.sol";

/**
* @title Debt module
* @dev
*
* Retrieve debt and creditEvents information from a debtEngine
*/
abstract contract DebtModule is AuthorizationModule, IDebtEngine {
/* ============ State Variables ============ */
bytes32 public constant DEBT_ROLE = keccak256("DEBT_ROLE");
Expand Down
9 changes: 9 additions & 0 deletions contracts/modules/wrapper/extensions/DocumentModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ pragma solidity ^0.8.20;
import "../../security/AuthorizationModule.sol";
import "../../../libraries/Errors.sol";
import "../../../interfaces/engine/draft-IERC1643.sol";


/**
* @title Document module
* @dev
*
* Retrieve documents from a documentEngine
*/

abstract contract DocumentModule is AuthorizationModule, IERC1643 {
/* ============ Events ============ */
/**
Expand Down
3 changes: 2 additions & 1 deletion contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import "../../security/AuthorizationModule.sol";
import "../../internal/ERC20SnapshotModuleInternal.sol";

/**
* @dev Snapshot module.
* @title Snapshot module
* @dev
*
* Useful to take a snapshot of token holder balance and total supply at a specific time
*/
Expand Down
3 changes: 2 additions & 1 deletion contracts/modules/wrapper/extensions/MetaTxModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pragma solidity ^0.8.20;
import "@openzeppelin/contracts-upgradeable/metatx/ERC2771ContextUpgradeable.sol";

/**
* @dev Meta transaction (gasless) module.
* @title Meta transaction (gasless) module.
* @dev
*
* Useful for to provide UX where the user does not pay gas for token exchange
* To follow OpenZeppelin, this contract does not implement the functions init & init_unchained.
Expand Down

0 comments on commit 8ba25e7

Please sign in to comment.