Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V4.1.0 #165

Merged
merged 36 commits into from
Nov 10, 2023
Merged

V4.1.0 #165

merged 36 commits into from
Nov 10, 2023

Conversation

Joachim-Lebrun
Copy link
Collaborator

@Joachim-Lebrun Joachim-Lebrun commented Sep 14, 2023

[4.1.0]

Breaking Changes

  • TREXFactory Constructor: Now requires the address of the Identity Factory.
    • Reason: The Identity Factory is used to deploy ONCHAINIDs for tokens.

Added

  • Compliance Modules:

    • Introduced Supply Limit Module: Restricts minting tokens beyond a specified limit.
    • Introduced Time Transfers Limits: Prevents holders from transferring tokens beyond a set limit within a specified timeframe.
    • Introduced Max Balance Module: Ensures an individual holder doesn't exceed a certain percentage of the total supply.
    • Added two exchange-specific modules:
      • Time Exchange Limits: Limits token transfers on trusted exchanges within a set timeframe.
      • Monthly Exchange Limits: Restricts the amount of tokens that can be transferred on trusted exchanges each month.
    • Introduced Transfer Fees : Collects fees from transfers (issuers determine fee rates).
  • IModule Enhancement:

    • Added a new function: function name() external pure returns (string memory _name);. This mandates all compliance modules to declare a constant variable, e.g., function name() public pure returns (string memory _name) { return "CountryRestrictModule"; }.
    • New function isPlugAndPlay: Added to the IModule interface. This function, function isPlugAndPlay() external pure returns (bool), indicates whether a compliance module can be bound without presetting. It is now mandatory for all compliance modules to declare this function.
    • New function canComplianceBind: Also added to the IModule interface. Compliance modules must implement function canComplianceBind(address _compliance) external view returns (bool), which checks if presetting is required before binding a compliance module.
  • TREXFactory Enhancements:

    • New function setIdFactory: Sets the Identity Factory responsible for deploying token ONCHAINIDs.
    • New function getIdFactory: Retrieves the address of the associated Identity Factory.
  • TREXGateway Contract:

    • Deployed as a central interface for the TREX ecosystem, facilitating various crucial operations:
      • Factory Management: Manages the Factory contract address, enabling updates and ownership transfers.
      • Public Deployment Control: Toggles the ability for public entities to deploy TREX contracts, enhancing security and flexibility.
      • Fee Management: Sets and adjusts deployment fee details, including amount, token type, and collector address, and enables or disables fee requirements.
      • Deployer Management: Adds or removes approved deployers and applies fee discounts, including batch operations for efficiency. Ensures streamlined deployment processes for TREX contracts.
      • Suite Deployment: Directly deploys TREX suites of contracts using provided token and claim details, with support for batch deployments. Incorporates fee collection and deployment status checks for each deployment, emphasizing security and compliance.
      • Status and Fee Queries: Provides functions to retrieve current public deployment status, Factory contract address, deployment fee details, and deployment fee status.
      • Fee Calculation: Dynamically calculates deployment fees for deployers, considering applicable discounts.
  • DvATransferManager Contract:

    • Introduced the DvATransferManager contract to streamline the process of internal fund transfers needing multi-party intermediate approvals.
      • Token owners define the transfer authorization criteria, including recipient approval, agent approval, and potential additional approvers.
      • Investors submit transfer requests.
      • Approvers are empowered to either sanction or reject these requests.
      • Transfers are executed only upon receiving unanimous approval from all designated approvers.

Updates

Smart Contract Enhancements

  • TREXFactory:

    • Modified the deployTREXSuite function to now auto-deploy a Token ONCHAINID if it's not already available (i.e., if the onchainid address in _tokenDetails is the zero address).
  • ModularCompliance:

    • Updated the addModule function to invoke the new isPlugAndPlay and canComplianceBind functions, ensuring compatibility checks before binding any compliance module.

Code Quality Improvements

  • Enhanced the GitHub Actions workflow by adding TypeScript linting (lint:ts) for test files, ensuring higher code quality and adherence to coding standards.
  • Executed a comprehensive linting pass on all test files, addressing and resolving any linting issues. This ensures a consistent code style and improved readability across the test suite.
  • Updated the push_checking.yml GitHub Actions workflow to include automatic TypeScript linting checks on pull requests. This addition enforces coding standards and helps maintain high-quality code submissions from all contributors.

mplelis and others added 3 commits September 14, 2023 11:10
* Supply limit module

* Fix lint

* Update test/compliances/module-supply-limit.test.ts

Co-authored-by: Nakasar <[email protected]>

* Fix tests

* Add reference in index.js

---------

Co-authored-by: Mihalis <Mihalis>
Co-authored-by: Nakasar <[email protected]>
* ✨(TTL) Create contract

* ➕ (TTLM) add module contract

* ✅(TTL) Create basic test

* ✅(TTL) Create basic test

* ✨ (TTLM) add functions

* Update TimeTransfersLimitsModule and add new tests

* (TTL) Implement module check and transfer action functions

* Move getIdentity function from AbstractModule to module itself

* Remove .only from time transfer limits test

Co-authored-by: Nakasar <[email protected]>

* Move bindToken call to time transfer limits tests

* Use storage variables to reduce gas

* Add TimeTransferLimitsModule to index.js

* (TLM) Update time transfers limits docs

---------

Co-authored-by: kevin.thizy <[email protected]>
Co-authored-by: joachimlebrun <[email protected]>
Co-authored-by: Mihalis <Mihalis>
* (EML) Add exchange monthly limits compliance module

* (EML) Use storage variables to reduce gas

* (TEL) Add time exchange limits module

* Update exchange limits modules as Ownable

* Update docs of the exchange limit modules

---------

Co-authored-by: Joachim <[email protected]>
* Update CHANGELOG.md

* Update package.json

* Update package-lock.json
Nakasar
Nakasar previously approved these changes Sep 14, 2023
@Joachim-Lebrun
Copy link
Collaborator Author

looks good, do we wait to add more modules to merge to main ?

Joachim-Lebrun and others added 2 commits September 19, 2023 12:15
 - implement MaxBalance Module
 - Test MaxBalance Module for full module coverage
 - Add Documentation for MaxBalance Module on docs.tokeny.com

------------

Co-authored-by: ali.arbak <[email protected]>
@Joachim-Lebrun
Copy link
Collaborator Author

I merged the MaxBalance module too fast, still some changes to make on it.
there is no limitation on the call to preset ID balances

* ✨(modules) Add name to modules

* Update CHANGELOG.md

* ✨(modules) Add name to modules

* ✨(modules) Add name to modules

* ✨(modules) Add name to modules

* ✨(modules) Add name to modules

* ✨(module) Add name to maxBalance
@Joachim-Lebrun Joachim-Lebrun added the enhancement New feature or request label Sep 19, 2023
aliarbak and others added 7 commits October 3, 2023 10:01
* Add plug & play functions to compliance modules

* Call plug & play functions before binding a module with modular compliance

* Add preset completed function to max balance module
* (TFM) Add transfer fees module

* Remove describe.only from unit tests

* Update set fees function

* Add is plug and play function
* ✨ () add typescript lint check on push

* 🚨 () fix ts lint

* 📝 (CHANGELOG) Code Quality Improvements
@Nakasar
Copy link
Contributor

Nakasar commented Nov 10, 2023

🚀

@Joachim-Lebrun Joachim-Lebrun merged commit 840500c into main Nov 10, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants