LBToken
Last updated
Last updated
Inherits:
Author: Trader Joe
The LBToken is an implementation of a multi-token. It allows to create multi-ERC20 represented by their ids. Its implementation is really similar to the ERC1155 standard the main difference is that it doesn't do any call to the receiver contract to prevent reentrancy. As it's only for ERC20s, the uri function is not implemented. The contract is made for batch operations.
The mapping from account to token id to account balance.
The mapping from token id to total supply.
Mapping from account to spender approvals.
Modifier to check if the spender is approved for all.
Modifier to check if the address is not zero or the contract itself.
Modifier to check if the length of the arrays are equal.
Returns the name of the token.
Returns
<none>
string
The name of the token.
Returns the symbol of the token, usually a shorter version of the name.
Returns
<none>
string
The symbol of the token.
Returns the total supply of token of type id
.
/**
This is the amount of token of type id
minted minus the amount burned.
Parameters
id
uint256
The token id.
Returns
<none>
uint256
The total supply of that token id.
Returns the amount of tokens of type id
owned by account
.
Parameters
account
address
The address of the owner.
id
uint256
The token id.
Returns
<none>
uint256
The amount of tokens of type id
owned by account
.
Return the balance of multiple (account/id) pairs.
Parameters
accounts
address[]
The addresses of the owners.
ids
uint256[]
The token ids.
Returns
batchBalances
uint256[]
The balance for each (account, id) pair.
Returns true if spender
is approved to transfer owner
's tokens or if spender
is the owner
.
Parameters
owner
address
The address of the owner.
spender
address
The address of the spender.
Returns
<none>
bool
True if spender
is approved to transfer owner
's tokens.
Grants or revokes permission to spender
to transfer the caller's lbTokens, according to approved
.
Parameters
spender
address
The address of the spender.
approved
bool
The boolean value to grant or revoke permission.
Batch transfers amounts
of ids
from from
to to
.
Parameters
from
address
The address of the owner.
to
address
The address of the recipient.
ids
uint256[]
The list of token ids.
amounts
uint256[]
The list of amounts to transfer for each token id in ids
.
Returns true if spender
is approved to transfer owner
's tokens or if spender
is the owner
.
Parameters
owner
address
The address of the owner.
spender
address
The address of the spender.
Returns
<none>
bool
True if spender
is approved to transfer owner
's tokens.
Mint amount
of id
to account
.
The account
must not be the zero address.
The event should be emitted by the contract that inherits this contract.
Parameters
account
address
The address of the owner.
id
uint256
The token id.
amount
uint256
The amount to mint.
Burn amount
of id
from account
.
The account
must not be the zero address.
The event should be emitted by the contract that inherits this contract.
Parameters
account
address
The address of the owner.
id
uint256
The token id.
amount
uint256
The amount to burn.
Batch transfers amounts
of ids
from from
to to
.
The to
must not be the zero address and the ids
and amounts
must have the same length.
Parameters
from
address
The address of the owner.
to
address
The address of the recipient.
ids
uint256[]
The list of token ids.
amounts
uint256[]
The list of amounts to transfer for each token id in ids
.
Grants or revokes permission to spender
to transfer the caller's tokens, according to approved
Parameters
owner
address
The address of the owner
spender
address
The address of the spender
approved
bool
The boolean value to grant or revoke permission
Reverts if the address is the zero address or the contract itself.
Parameters
account
address
The address to check.
Reverts if the length of the arrays are not equal.
Parameters
lengthA
uint256
The length of the first array.
lengthB
uint256
The length of the second array.