IERC20
Hierarchy
TokenWrapper
↳
IERC20
Implements
Serializable
Table of contents
Constructors
Properties
Methods
- allowance
- balanceOf
- burn
- decimals
- decreaseAllowance
- deserialize
- equals
- increaseAllowance
- init
- mint
- name
- notEqual
- received
- serialize
- symbol
- totalSupply
- transfer
- transferFrom
- version
Constructors
constructor
• new IERC20(origin?
): IERC20
Parameters
Name | Type |
---|---|
origin | Address |
Returns
Overrides
TokenWrapper.constructor
Defined in
assembly/interfaces/IERC20.ts:20
Properties
_origin
• _origin: Address
Inherited from
TokenWrapper._origin
Defined in
node_modules/@massalabs/sc-standards/assembly/contracts/FT/wrapper.ts:26
Methods
allowance
▸ allowance(ownerAccount
, spenderAccount
): u256
Returns the allowance set on the owner's account for the spender.
Parameters
Name | Type |
---|---|
ownerAccount | Address |
spenderAccount | Address |
Returns
u256
Inherited from
TokenWrapper.allowance
Defined in
node_modules/@massalabs/sc-standards/assembly/contracts/FT/wrapper.ts:125
balanceOf
▸ balanceOf(account
): u256
Returns the balance of an account.
Parameters
Name | Type |
---|---|
account | Address |
Returns
u256
Inherited from
TokenWrapper.balanceOf
Defined in
node_modules/@massalabs/sc-standards/assembly/contracts/FT/wrapper.ts:103
burn
▸ burn(nbTokens
): void
Burn nbTokens on the caller address
Parameters
Name | Type |
---|---|
nbTokens | u256 |
Returns
void
Inherited from
TokenWrapper.burn
Defined in
node_modules/@massalabs/sc-standards/assembly/contracts/FT/wrapper.ts:213
decimals
▸ decimals(): u8
Returns
u8
Overrides
TokenWrapper.decimals
Defined in
assembly/interfaces/IERC20.ts:29
decreaseAllowance
▸ decreaseAllowance(spenderAccount
, nbTokens
): void
Decreases the allowance of the spender on the owner's account by the given amount.
This function can only be called by the owner.
Parameters
Name | Type |
---|---|
spenderAccount | Address |
nbTokens | u256 |
Returns
void
Inherited from
TokenWrapper.decreaseAllowance
Defined in
node_modules/@massalabs/sc-standards/assembly/contracts/FT/wrapper.ts:163
deserialize
▸ deserialize(data
, offset
): Result
<i32
>
Parameters
Name | Type |
---|---|
data | StaticArray <u8 > |
offset | i32 |
Returns
Result
<i32
>
Implementation of
Serializable.deserialize
Defined in
assembly/interfaces/IERC20.ts:75
equals
▸ equals(other
): bool
Parameters
Name | Type |
---|---|
other | IERC20 |
Returns
bool
Defined in
assembly/interfaces/IERC20.ts:85
increaseAllowance
▸ increaseAllowance(spenderAccount
, nbTokens
): void
Increases the allowance of the spender on the owner's account by the given amount.
This function can only be called by the owner.
Parameters
Name | Type |
---|---|
spenderAccount | Address |
nbTokens | u256 |
Returns
void
Inherited from
TokenWrapper.increaseAllowance
Defined in
node_modules/@massalabs/sc-standards/assembly/contracts/FT/wrapper.ts:145
init
▸ init(name
, symbol
, decimals
, supply
): void
Parameters
Name | Type |
---|---|
name | string |
symbol | string |
decimals | u8 |
supply | u256 |
Returns
void
Overrides
TokenWrapper.init
Defined in
assembly/interfaces/IERC20.ts:24
mint
▸ mint(toAccount
, nbTokens
): void
Mint an amount of nbTokens tokens from to the toAccount address .
Parameters
Name | Type |
---|---|
toAccount | Address |
nbTokens | u256 |
Returns
void
Inherited from
TokenWrapper.mint
Defined in
node_modules/@massalabs/sc-standards/assembly/contracts/FT/wrapper.ts:204
name
▸ name(): string
Returns the name of the token.
Returns
string
name of the token.
Inherited from
TokenWrapper.name
Defined in
node_modules/@massalabs/sc-standards/assembly/contracts/FT/wrapper.ts:65
notEqual
▸ notEqual(other
): bool
Parameters
Name | Type |
---|---|
other | IERC20 |
Returns
bool
Defined in
assembly/interfaces/IERC20.ts:81
received
▸ received(reserve
, fees
): u256
Returns the amount of token received by the pair
Parameters
Name | Type | Description |
---|---|---|
reserve | u256 | The total reserve of token |
fees | u256 | The total fees of token |
Returns
u256
- The amount received by the pair
Defined in
assembly/interfaces/IERC20.ts:42
serialize
▸ serialize(): StaticArray
<u8
>
Returns
StaticArray
<u8
>
Implementation of
Serializable.serialize
Defined in
assembly/interfaces/IERC20.ts:71
symbol
▸ symbol(): string
Returns the symbol of the token.
Returns
string
token symbol.
Inherited from
TokenWrapper.symbol
Defined in
node_modules/@massalabs/sc-standards/assembly/contracts/FT/wrapper.ts:73
totalSupply
▸ totalSupply(): u256
Returns the total token supply.
The number of tokens that were initially minted.
Returns
u256
number of minted tokens.
Inherited from
TokenWrapper.totalSupply
Defined in
node_modules/@massalabs/sc-standards/assembly/contracts/FT/wrapper.ts:94
transfer
▸ transfer(toAccount
, nbTokens
): void
Parameters
Name | Type |
---|---|
toAccount | Address |
nbTokens | u256 |
Returns
void
Overrides
TokenWrapper.transfer
Defined in
assembly/interfaces/IERC20.ts:48
transferFrom
▸ transferFrom(ownerAccount
, recipientAccount
, nbTokens
): void
Parameters
Name | Type |
---|---|
ownerAccount | Address |
recipientAccount | Address |
nbTokens | u256 |
Returns
void
Overrides
TokenWrapper.transferFrom
Defined in
assembly/interfaces/IERC20.ts:58
version
▸ version(): string
Returns the version of the smart contract. This versioning is following the best practices defined in https://semver.org/.
Returns
string
Inherited from
TokenWrapper.version
Defined in
node_modules/@massalabs/sc-standards/assembly/contracts/FT/wrapper.ts:56