Transfers Restrict Module
Designed to enforce transfer restrictions exclusively to whitelisted addresses, this module ensures that tokens can only be sent to approved destinations. This capability is crucial for scenarios where token transfers need to be routed through intermediary contracts for additional off-chain verifications or other compliance checks, even if the recipient address belongs to an eligible investor. It enhances control over token circulation, aligning with specific compliance or operational strategies.
How Does It Work?
- Compliance contracts set the allowed user addresses.
- The mint/transfer transaction is blocked if the investor address is not allowed.
Events
ComplianceBound
This event is emitted when the compliance contract is bound to the module
the event is emitted by 'bindCompliance'
_compliance
is the address of the compliance contract being bound
event ComplianceBound(
address indexed _compliance
);
ComplianceUnbound
This event is emitted when the compliance contract is unbound from the module
the event is emitted by 'unbindCompliance'
_compliance
is the address of the compliance contract being unbound
event ComplianceUnbound(
address indexed _compliance
);
UserAllowed
This event is emitted when a user is allowed to transfer
the event is emitted by 'allowUser' and 'batchAllowUsers'
_compliance
is the compliance contract address
_userAddress
is the allowed user address
event UserAllowed(
address _compliance,
address _userAddress
);
UserDisallowed
This event is emitted when a user is disallowed to transfer
the event is emitted by 'disallowUser' and 'batchAllowUsers'
_compliance
is the compliance contract address
_userAddress
is the disallowed user address
event UserDisallowed(
address _compliance,
address _userAddress
);
Functions
bindCompliance
Binds the module to a compliance contract. Once the module is bound, the compliance contract can interact with the module.
parameter 1: _compliance
the address of the compliance contract
emits a ComplianceBound
event
This function can be called ONLY by the compliance contract itself (_compliance), through the addModule function, which calls bindCompliance the module cannot be already bound to the compliance.
function bindCompliance(
address _compliance
) external;
unbindCompliance
Unbinds the module from a compliance contract. Once the module is unbound, the compliance contract cannot interact with the module anymore.
parameter 1: _compliance
the address of the compliance contract.
emits a ComplianceUnbound
event
This function can be called ONLY by the compliance contract itself (_compliance), removeModule function, which calls unbindCompliance.
function unbindCompliance(
address _compliance
) external;
isComplianceBound
Getter for compliance binding status on module
parameter 1: _compliance
the address of the compliance contract
returns TRUE if the compliance is bound to the module, FALSE otherwise
function isComplianceBound(
address _compliance
) external view returns (bool);
allowUser
Allows a user address for transfer
This function can only be called by the owner of the Compliance smart contract
parameter 1: _userAddress
the address of the user
emits a UserAllowed
event
function allowUser(
address _userAddress
) external;
batchAllowUsers
Allows multiple user addresses for transfer
This function can only be called by the owner of the Compliance smart contract
parameter 1: _userAddresses
the array of user addresses
emits a UserAllowed
event
function batchAllowUsers(
address[] memory _userAddresses
) external;
disallowUser
Disallows a user address for transfer
This function can only be called by the owner of the Compliance smart contract
parameter 1: _userAddress
the address of the user
emits a UserDisallowed
event
function disallowUser(
address _userAddress
) external;
batchDisallowUsers
Disallows multiple user addresses for transfer
This function can only be called by the owner of the Compliance smart contract
parameter 1: _userAddresses
the array of user addresses
emits a UserDisallowed
event
function batchDisallowUsers(
address[] memory _userAddresses
) external;
moduleCheck
The compliance check on the module for a specific transaction on a specific compliance contract. This function is used to check if the transfer is allowed by the module.
parameter 1: _from
the address of the transfer sender
parameter 2: _to
the address of the transfer receiver
parameter 3: _value
the amount of tokens sent
parameter 4: _compliance
the address of the compliance contract concerned by the transfer action
Returns TRUE if the module allows the transfer, FALSE otherwise
function moduleCheck(
address _from,
address _to,
uint256 _value,
address _compliance
) external view;
moduleTransferAction
The action performed on the module during a transfer action. It increases the transfer counters. This function is not implemented in this contract.
parameter 1: _from
the address of the transfer sender
parameter 2: _to
the address of the transfer receiver
parameter 3: _value
the amount of tokens sent
This function can be called only on a compliance contract that is bound to the module
function moduleTransferAction(
address _from,
address _to,
uint256 _value
) external;
moduleMintAction
The action performed on the module during a mint action. This function is used to update variables of the module upon minting if it is required. This function is not implemented in this contract.
parameter 1: _to
the address used for minting
parameter 2: _value
the amount of tokens minted
This function can be called only on a compliance contract that is bound to the module
function moduleMintAction(
address _to,
uint256 _value
) external;
moduleBurnAction
The action performed on the module during a burn action. This function is used to update variables of the module upon burning if it is required. This function is not implemented in this contract.
parameter 1: _from
the address on which tokens are burnt
parameter 2: _value
the amount of tokens burnt
This function can be called only on a compliance contract that is bound to the module
function moduleBurnAction(
address _from,
uint256 _value
) external;
upgradeTo (UUPS)
Upgrade the implementation of the proxy to newImplementation
parameter 1: newImplementation
the address of the new implementation contract.
This function can only be called by the proxy contract.
function upgradeTo(address newImplementation) public;
Updated 14 days ago