Transfer management - Restrictions
Read operations
Validate Transfer compliance
This set of methods verifies if a Transfer is possible according to the compliance of a Token. It calls the .isVerified
and the .canTransfer
methods on the Identity Registry to verify the Identity and on the Compliance contract.
const valid = await token.getTransferCompliance({
senderWallet: 'SENDER WALLET ADDRESS',
recipientWallet: 'RECEIVER WALLET ADDRESS',
amount: AMOUNT,
});
Get the number of frozen tokens
Gives you the number of frozen tokens for a particular wallet
const amount = await token.getFrozenAmount('WALLET ADDRESS');
Is contract on pause
Returns whether the contract is on pause or not.
const amount = await token.isPaused();
Write operations
Pause
This method allows pausing the contract, making it impossible to transfer for all holders (except through Forced Transfer)
const tx = await token.pauseToken();
Unpause
This method allows unpausing a previously paused contract, making it possible to transfer for all holders.
const tx = await token.unpauseToken();
Partial Freezing
This method allows for freezing a given amount of tokens to make them unavailable for transfers.
const tx = await token.freezePartialTokens({
address: 'WALLET ADDRESS',
amount: AMOUNT,
});
Unfreeze Partially
This method allows unfreezing a previously frozen amount of tokens to make them available for transfers. It isn't possible to unfreeze more tokens than the amount that has been frozen. In this case, an error is thrown.
const tx = await token.unfreezePartialTokens({
address: 'WALLET ADDRESS',
amount: AMOUNT,
});
Freeze/Unfreeze Address
When setting freeze to true
, it allows freezing a wallet, making it impossible to transfer tokens. When set to false
, it unfreezes the wallet, making it possible to transfer tokens.
const tx = await token.freezeAddress({
wallet: 'WALLET ADDRESS',
freeze: BOOLEAN,
});
Updated 14 days ago