ERC20Burnable
Constructor
new ERC20Burnable(config: IContractConfig);
Param | Type | Description |
---|---|---|
config | IContractConfig |
Properties
address
Returns
Type: Address
Methods
burn(args)
Destroys a value
amount of tokens from the caller's balance.
Parameters
Name Type Description args IERC20BurnableBurnParams The parameters to be passed into burn
function of the ERC20 contract.Examples
const balance = await erc20.balanceOf(myAddress); // return 200000n
const tx = await erc20.burn({
// value is in lower units. (see ERC20.decimals)
value: erc20.toLowerUnits(10)
}).execute();
// wait for 3 confirmations
await tx.waitForReceipt(3);
// check balance again
const newBalance = await erc20.balanceOf(myAddress); // return 100000nReturns a
ContractOperation
instance.Type: ContractOperation
burnFrom(args)
Destroys a value
amount of tokens from account
, deducting from the caller's allowance.
info
The caller must have allowance for accounts
's tokens of at least value
.
Parameters
Name Type Description args IERC20BurnableBurnFromParams The parameters to be passed into burnFrom
function of the ERC20 contract.Examples
const balance = await erc20.balanceOf(accountAddress); // return 200000n
// value is in lower units. (see ERC20.decimals)
const tx = await erc20.burnFrom({
account: accountAddress,
value: erc20.toLowerUnits(10)
}).execute(); // burn 10 tokens
// wait for 3 confirmations
await tx.waitForReceipt(3);
// check balance again
const newBalance = await erc20.balanceOf(accountAddress); // return 100000nReturns a
ContractOperation
instance.Type: ContractOperation