This contract is used by the ATR Module and is responsible for managing a whitelist of assets which are permitted to have their transfer rights tokenized.
2. Important links
3. Contract details
Whitelist.sol is written in Solidity version 0.8.15
Features
Keeps a whitelist of approved assets
Keeps a whitelist of approved libraries for delegate calls
Functions
canBeTokenized
Overview
A getter function to see if a certain asset or asset collection is whitelisted to be tokenised. The function returns a boolean.
This function takes one argument supplied by the caller:
addressassetAddress - Address of the asset or asset collection to check
Implementation
function canBeTokenized(address assetAddress) external view returns (bool) {
if (!useWhitelist)
return true;
return isWhitelisted[assetAddress];
}
setUseWhitelist
Overview
A setter function to turn the whitelist on and off. It can be called only by the owner.
This function takes one argument supplied by the owner:
bool_useWhitelist - A boolean to update the useWhitelist flag
Implementation
function setUseWhitelist(bool _useWhitelist) external onlyOwner {
useWhitelist = _useWhitelist;
}
setIsWhitelisted
Overview
A setter function to add or remove an address from the whitelist. It can be called only by the owner.
This function takes two arguments supplied by the owner:
addressassetAddress - Address of the asset being modified
bool_isWhitelisted - Boolean determining the addition or removal from the whitelist
Implementation
function setIsWhitelisted(
address assetAddress,
bool _isWhitelisted
) public onlyOwner {
isWhitelisted[assetAddress] = _isWhitelisted;
}
setIsWhitelistedBatch
Overview
A setter function to add or remove multiple addresses from the whitelist. It can be called only by the owner.
This function takes two arguments supplied by the caller:
address[] calldataassetAddresses - Array of addresses being modified
bool_isWhitelisted - Boolean determining the addition or removal from the whitelist