Skip to main content

IERC20

Hierarchy​

  • MRC20Wrapper

    ↳ IERC20

Implements​

  • Serializable

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• new IERC20(origin?): IERC20

Parameters​

NameType
originAddress

Returns​

IERC20

Overrides​

MRC20Wrapper.constructor

Defined in​

assembly/interfaces/IERC20.ts:21

Properties​

_origin​

• _origin: Address

Inherited from​

MRC20Wrapper._origin

Defined in​

node_modules/@massalabs/sc-standards/assembly/contracts/MRC20/wrapper.ts:26

Methods​

allowance​

▸ allowance(ownerAccount, spenderAccount): u256

Returns the allowance set on the owner's account for the spender.

Parameters​

NameType
ownerAccountAddress
spenderAccountAddress

Returns​

u256

Inherited from​

MRC20Wrapper.allowance

Defined in​

node_modules/@massalabs/sc-standards/assembly/contracts/MRC20/wrapper.ts:138


balanceOf​

▸ balanceOf(account): u256

Returns the balance of an account.

Parameters​

NameType
accountAddress

Returns​

u256

Inherited from​

MRC20Wrapper.balanceOf

Defined in​

node_modules/@massalabs/sc-standards/assembly/contracts/MRC20/wrapper.ts:110


burn​

▸ burn(nbTokens): void

Burn nbTokens on the caller address

Coins is left to zero as this function does not need storage entry creation.

Parameters​

NameType
nbTokensu256

Returns​

void

Inherited from​

MRC20Wrapper.burn

Defined in​

node_modules/@massalabs/sc-standards/assembly/contracts/MRC20/wrapper.ts:236


decimals​

▸ decimals(): u8

Returns​

u8

Overrides​

MRC20Wrapper.decimals

Defined in​

assembly/interfaces/IERC20.ts:25


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. Coins is left to zero as this function does not need storage entry creation.

Parameters​

NameType
spenderAccountAddress
nbTokensu256

Returns​

void

Inherited from​

MRC20Wrapper.decreaseAllowance

Defined in​

node_modules/@massalabs/sc-standards/assembly/contracts/MRC20/wrapper.ts:182


deserialize​

▸ deserialize(data, offset): Result<i32>

Parameters​

NameType
dataStaticArray<u8>
offseti32

Returns​

Result<i32>

Implementation of​

Serializable.deserialize

Defined in​

assembly/interfaces/IERC20.ts:72


equals​

▸ equals(other): bool

Parameters​

NameType
otherIERC20

Returns​

bool

Defined in​

assembly/interfaces/IERC20.ts:82


increaseAllowance​

▸ increaseAllowance(spenderAccount, nbTokens, coins?): 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​

NameTypeDefault value
spenderAccountAddressundefined
nbTokensu256undefined
coinsu640

Returns​

void

Inherited from​

MRC20Wrapper.increaseAllowance

Defined in​

node_modules/@massalabs/sc-standards/assembly/contracts/MRC20/wrapper.ts:159


init​

▸ init(name, symbol, decimals, supply, coins?): void

Initializes the smart contract.

Parameters​

NameTypeDefault valueDescription
namestringundefinedName of the token.
symbolstringundefinedSymbol of the token.
decimalsu8undefinedNumber of decimals of the token.
supplyu256undefinedInitial supply of the token.
coinsu640Number of coins to send to the smart contract.

Returns​

void

Inherited from​

MRC20Wrapper.init

Defined in​

node_modules/@massalabs/sc-standards/assembly/contracts/MRC20/wrapper.ts:46


mint​

▸ mint(toAccount, nbTokens, coins?): void

Mint an amount of nbTokens tokens from to the toAccount address .

Parameters​

NameTypeDefault value
toAccountAddressundefined
nbTokensu256undefined
coinsu640

Returns​

void

Inherited from​

MRC20Wrapper.mint

Defined in​

node_modules/@massalabs/sc-standards/assembly/contracts/MRC20/wrapper.ts:225


name​

▸ name(): string

Returns the name of the token.

Returns​

string

name of the token.

Inherited from​

MRC20Wrapper.name

Defined in​

node_modules/@massalabs/sc-standards/assembly/contracts/MRC20/wrapper.ts:72


notEqual​

▸ notEqual(other): bool

Parameters​

NameType
otherIERC20

Returns​

bool

Defined in​

assembly/interfaces/IERC20.ts:78


received​

▸ received(reserve, fees): u256

Returns the amount of token received by the pair

Parameters​

NameTypeDescription
reserveu256The total reserve of token
feesu256The total fees of token

Returns​

u256

  • The amount received by the pair

Defined in​

assembly/interfaces/IERC20.ts:38


serialize​

▸ serialize(): StaticArray<u8>

Returns​

StaticArray<u8>

Implementation of​

Serializable.serialize

Defined in​

assembly/interfaces/IERC20.ts:68


symbol​

▸ symbol(): string

Returns the symbol of the token.

Returns​

string

token symbol.

Inherited from​

MRC20Wrapper.symbol

Defined in​

node_modules/@massalabs/sc-standards/assembly/contracts/MRC20/wrapper.ts:80


totalSupply​

▸ totalSupply(): u256

Returns the total token supply.

The number of tokens that were initially minted.

Returns​

u256

number of minted tokens.

Inherited from​

MRC20Wrapper.totalSupply

Defined in​

node_modules/@massalabs/sc-standards/assembly/contracts/MRC20/wrapper.ts:101


transfer​

▸ transfer(toAccount, nbTokens, coins?): void

Parameters​

NameTypeDefault value
toAccountAddressundefined
nbTokensu256undefined
coinsu640

Returns​

void

Overrides​

MRC20Wrapper.transfer

Defined in​

assembly/interfaces/IERC20.ts:44


transferFrom​

▸ transferFrom(ownerAccount, recipientAccount, nbTokens, coins?): void

Parameters​

NameTypeDefault value
ownerAccountAddressundefined
recipientAccountAddressundefined
nbTokensu256undefined
coinsu640

Returns​

void

Overrides​

MRC20Wrapper.transferFrom

Defined in​

assembly/interfaces/IERC20.ts:54


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​

MRC20Wrapper.version

Defined in​

node_modules/@massalabs/sc-standards/assembly/contracts/MRC20/wrapper.ts:63