Exchange Monthly Limits Module

Similar to the Time-Based Exchange Limits module, but with a fixed monthly timeframe. This optimization simplifies the module's logic, offering a gas-efficient solution for monthly transfer volume restrictions to CEXs.

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
);

ExchangeMonthlyLimitUpdated

This event is emitted whenever an exchange monthly limit is updated for the given compliance address
the event is emitted by 'setExchangeMonthlyLimit'
compliance is the compliance contract address
_exchangeID is the ONCHAINID of the exchange
_newExchangeMonthlyLimit is the new monthly limit value

event ExchangeLimitUpdated(
  address indexed compliance, 
	address _exchangeID, 
	uint _newExchangeMonthlyLimit
);

ExchangeIDAdded

This event is emitted whenever an ONCHAINID is tagged as an exchange ID
the event is emitted by 'addExchangeID'
_newExchangeID is the ONCHAINID address of the exchange to add

event ExchangeIDAdded(
  address _newExchangeID
);

ExchangeIDRemoved

This event is emitted whenever an ONCHAINID is untagged as belonging to an exchange
the event is emitted by 'removeExchangeID'
_exchangeID is the ONCHAINID being untagged as an exchange ID

event ExchangeIDRemoved(
  address _exchangeID
);

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);

setExchangeMonthlyLimit

Sets the limit of tokens allowed to be transferred to the given exchange in a given period of time
This function can only be called by a compliance smart contract
parameter 1: _exchangeID The ONCHAINID of the exchange
parameter 2: _newExchangeMonthlyLimit The new monthly limit
emits an ExchangeMonthlyLimitUpdated event

function setExchangeMonthlyLimit(
	address _exchangeID, 
	uint256 _newExchangeMonthlyLimit
) external;

addExchangeID

Tags the ONCHAINID as being an exchange ID
Cannot be called on an address already tagged as being an exchange
This function can only be called by the owner of this module
parameter 1: _exchangeID The ONCHAINID of the exchange
emits an ExchangeIDAdded event

function addExchangeID(
	address _exchangeID
) external;

removeExchangeID

Untags the ONCHAINID as being an exchange ID
Cannot be called on an address not tagged as being an exchange
This function can only be called by the owner of this module
parameter 1: _exchangeID The ONCHAINID of the exchange
emits an ExchangeIDRemoved event

function removeExchangeID(
	address _exchangeID
) external;

getMonthlyCounter

Function for getting exchange counter value for the given exchange and investor ID.
parameter 1: compliance the compliance smart contract address
parameter 2: _exchangeID the ONCHAINID of the exchange
parameter 3: _investorID the ONCHAINID of the investor
Returns the counter limit value of the given _investorID, and exchangeID

function getMonthlyCounter(
	address compliance, 
	address _exchangeID, 
	address _investorID
) external view returns (uint256);

getMonthlyTimer

Function for getting the monthly timer for the given exchange and investor ID.
parameter 1: compliance the compliance smart contract address
parameter 2: _exchangeID the ONCHAINID of the exchange
parameter 3: _investorID the ONCHAINID of the investor
Returns the counter timer of the given _investorID, and exchangeID

function getMonthlyTimer(
	address compliance, 
	address _exchangeID, 
	address _investorID
) public view returns (uint256);

getExchangeMonthlyLimit

Function for getting the exchange limit for the given exchange ID.
parameter 1: compliance the compliance smart contract address
parameter 2: _exchangeID the ONCHAINID of the exchange
Returns the monthly limit of the given exchangeID

function getExchangeMonthlyLimit(
	address compliance, 
	address _exchangeID, 
) public view returns (uint256);

isExchangeID

Function for checking if an ONCHAIN id address is tagged as an exchange.
parameter 1: _exchangeID the ONCHAINID of the exchange
returns TRUE if the address corresponds to an exchange, FALSE otherwise

function isExchangeID(
	address _exchangeID
) public view returns (bool);

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 monthly counter value if the _to is being tagged as an exchange.
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;