Skip to content

Commit

Permalink
Separate snapshotModuleInternal in two contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
rya-sge committed Nov 30, 2023
1 parent 5a8e27b commit 0f9109f
Show file tree
Hide file tree
Showing 5 changed files with 459 additions and 418 deletions.
19 changes: 9 additions & 10 deletions contracts/modules/CMTAT_BASE.sol
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ abstract contract CMTAT_BASE is
__Enforcement_init_unchained();
/*
SnapshotModule:
Add this call in case you add the SnapshotModule
Add these two calls in case you add the SnapshotModule
__SnapshotModuleBase_init_unchained();
__ERC20Snapshot_init_unchained();
*/
*/
__Validation_init_unchained(ruleEngine_);

/* Wrapper */
Expand Down Expand Up @@ -174,10 +176,7 @@ abstract contract CMTAT_BASE is

/**
* @dev
* SnapshotModule:
* - override SnapshotModuleInternal if you add the SnapshotModule
* e.g. override(ERC20SnapshotModuleInternal, ERC20Upgradeable)
* - remove the keyword view
*
*/
function _update(
address from,
Expand All @@ -187,13 +186,13 @@ abstract contract CMTAT_BASE is
if (!ValidationModule.validateTransfer(from, to, amount)) {
revert Errors.CMTAT_InvalidTransfer(from, to, amount);
}
ERC20Upgradeable._update(from, to, amount);
// We call the SnapshotModule only if the transfer is valid
/*
SnapshotModule:
Add this call in case you add the SnapshotModule
ERC20SnapshotModuleInternal._update(from, to, amount);
Add this in case you add the SnapshotModule
We call the SnapshotModule only if the transfer is valid
*/
// ERC20SnapshotModuleInternal._snapshotUpdate(from, to);
ERC20Upgradeable._update(from, to, amount);
}

/**
Expand Down
Loading

0 comments on commit 0f9109f

Please sign in to comment.