Rule engine
Bridge Protocol's rule engine is a library of rules that can be used by the token issuer to control how a token can be transferred or not.
Overview
Rule specifications
function isTransferValid(
address _token, address _from, address _to, uint256 _amount, uint256 _ruleParam)
external view returns (uint256 isValid, uint256 reason);
function beforeTransferHook(
address _token, address _from, address _to, uint256 _amount, uint256 _ruleParam)
external returns (uint256 isValid, address updatedTo, uint256 updatedAmount);
function afterTransferHook(
address _token, address _from, address _to, uint256 _amount, uint256 _ruleParam)
external returns (bool updateDone);Rules library
0 - Global freeze
1 - User freeze
2 - Sender KYC
3 - Recipient KYC
4 - User valid
5 - Hard transfer limit
6 - Soft transfer limit
7 - Maximum transfer amount
8 - Minimum transfer amount
9 - Recipient and sender KYC
10 - Address threshold lock
11 - Recipient attribute valid
Adding new rules
Last updated