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

Release 2.4.0 #251

Merged
merged 46 commits into from
May 3, 2024
Merged

Release 2.4.0 #251

merged 46 commits into from
May 3, 2024

Conversation

rya-sge
Copy link
Collaborator

@rya-sge rya-sge commented Dec 1, 2023

Main goals of this release

  • Improve the flexibility of the CMTAT
  • Reduce the actual code size
  • Reduce gas deployment through factory

New architecture for the RuleEngine (Done) #250

  • A new function operateOnTransfer is added and used inside the ValidationModule.
  • Contrary to validateTransfer, operateOnTransfer has to be protected by an access control (if not implemented as view or pure)
  • This function can be used to perform operation which modifies the state of the blockchain (storage) by the RuleEngine.
  • The RuleEngine inherits now from IRuleEngine which contains in its interface the function operateOnTransfer + IERC-1404
  • The function validateTransfer is still available to verify a transfer without performing operation. The behavior is the same than with the previous CMTAT version.
  • Add new interfaces IERC1404EnumCode to only contain restriction code, in order to be used in the RuleEngine

snapshotModule (Done) #256

  • Create an interface ICMTATSnapshot with the main public functions to make easier the calls to a contract with a snapshotModule, for example useful for debt payment.
  • Imported by default again since the whole code can no longer be considered as "audited" now
  • Split the snapshotModuleInternal in two parts : one with the inheritance with ERC-20 and the other part with the base function and does not inherit from ERC-20.
    Thus, if we want to build a snapshotModule with the RuleEngine, we can use the base contract to avoid the inheritance with ERC-20.
  • Add twos functions to reduce number of call when computing debt payment
    --SnapshotInfo to get a user's balance and the total supply
    --SnapshotInfoBatch to get several user's balances and the total supply
    --SnapshotInfoBatch to get several user's balances and the total supply for several different times

ERC20BaseModule (Done)
-- Add a function balanceInfo to get the balance for two addresses and the total supply
Useful to perform transfer restriction based on the user's balance.

AuthorizationEngine #254

  • Add the AuthorizationEngine. With that, it is possible to add supplementary check on the functions grantRole and revokeRolewithout modifying the CMTAT.
  • Remove inheritance with AccessControlDefaultAdminRulesUpgradeable, introduces in the version 2.3.1, from OpenZeppelin since this contract is difficult to manage and increases also the smart contract code size.

BurnModule

  • rename forceBurn and forceBurnBatch toburn and burnBatch
  • Add a function burnFrom with a specific role (useful for bridge) for compatibility with CCIP Ccip #260
  • Add a function burnAndMint to perform a burn/mint operation atomically.

ValidationModule
Create an internal function _validateTransferByModule which performs check with others module (PauseModule & EnforcementModule)

Gas optimization

Other

@rya-sge rya-sge changed the title Dev Release 2.4.0 Dec 1, 2023
@rya-sge rya-sge changed the title Release 2.4.0 Release 2.3.2 Dec 1, 2023
@rya-sge rya-sge changed the title Release 2.3.2 Release 2.4.0 Dec 1, 2023
@rya-sge rya-sge requested a review from veorq May 2, 2024 12:07
@rya-sge rya-sge self-assigned this May 2, 2024
@rya-sge rya-sge merged commit 23a1e59 into master May 3, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant