Skip to content

Commit

Permalink
feat: remove updateRestriction function
Browse files Browse the repository at this point in the history
  • Loading branch information
igorsenych-cw committed May 2, 2024
1 parent b31e270 commit c35a1e6
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 158 deletions.
20 changes: 0 additions & 20 deletions contracts/base/ERC20Restrictable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,6 @@ abstract contract ERC20Restrictable is ERC20Base, IERC20Restrictable {
_purposeAssignments[account] = purposes;
}

/**
* @inheritdoc IERC20Restrictable
*/
function updateRestriction(address account, bytes32 purpose, uint256 balance) external onlyBlocklister {
if (purpose == bytes32(0)) {
revert ZeroPurpose();
}

uint256 oldBalance = _restrictedPurposeBalances[account][purpose];
_restrictedPurposeBalances[account][purpose] = balance;

if (oldBalance > balance) {
_totalRestrictedBalances[account] -= oldBalance - balance;
} else {
_totalRestrictedBalances[account] += balance - oldBalance;
}

emit UpdateRestriction(account, purpose, balance, oldBalance);
}

/**
* @inheritdoc IERC20Restrictable
*/
Expand Down
9 changes: 0 additions & 9 deletions contracts/base/interfaces/IERC20Restrictable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ interface IERC20Restrictable {
*/
function assignedPurposes(address account) external view returns (bytes32[] memory);

/**
* @notice Updates the restriction balance for an account
*
* @param account The account to update restriction for
* @param purpose The restriction purpose
* @param balance The new restricted balance
*/
function updateRestriction(address account, bytes32 purpose, uint256 balance) external;

/**
* @notice Increases the restriction balance for an account
*
Expand Down
Loading

0 comments on commit c35a1e6

Please sign in to comment.