Skip to main content

ERC20BaseTokens

ERC20BaseTokens

The ERC20 contract directly mapped to the L1 base token.

Approval

event Approval(address tokenOwner, address spender, uint256 tokens)

_Emitted when the approval of tokens is granted by a token owner to a spender.

This event indicates that the token owner has approved the spender to transfer a certain amount of tokens on their behalf._

Parameters

NameTypeDescription
tokenOwneraddressThe address of the token owner who granted the approval.
spenderaddressThe address of the spender who is granted the approval.
tokensuint256The amount of tokens approved for transfer.

Transfer

event Transfer(address from, address to, uint256 tokens)

_Emitted when tokens are transferred from one address to another.

This event indicates that a certain amount of tokens has been transferred from one address to another._

Parameters

NameTypeDescription
fromaddressThe address from which the tokens are transferred.
toaddressThe address to which the tokens are transferred.
tokensuint256The amount of tokens transferred.

name

function name() public view returns (string)

Returns the name of the base token.

Return Values

NameTypeDescription
[0]stringThe name of the base token.

symbol

function symbol() public view returns (string)

Returns the symbol of the base token.

Return Values

NameTypeDescription
[0]stringThe symbol of the base token.

decimals

function decimals() public view returns (uint8)

Returns the number of decimals used by the base token.

Return Values

NameTypeDescription
[0]uint8The number of decimals used by the base token.

totalSupply

function totalSupply() public view returns (uint256)

Returns the total supply of the base token.

Return Values

NameTypeDescription
[0]uint256The total supply of the base token.

balanceOf

function balanceOf(address tokenOwner) public view returns (uint256)

Returns the balance of the specified token owner.

Parameters

NameTypeDescription
tokenOwneraddressThe address of the token owner.

Return Values

NameTypeDescription
[0]uint256The balance of the token owner.

transfer

function transfer(address receiver, uint256 numTokens) public returns (bool)

Transfers tokens from the caller's account to the specified receiver.

Parameters

NameTypeDescription
receiveraddressThe address of the receiver.
numTokensuint256The number of tokens to transfer.

Return Values

NameTypeDescription
[0]booltrue.

approve

function approve(address delegate, uint256 numTokens) public returns (bool)

Sets the allowance of delegate over the caller's tokens.

Parameters

NameTypeDescription
delegateaddressThe address of the delegate.
numTokensuint256The number of tokens to allow.

Return Values

NameTypeDescription
[0]booltrue.

allowance

function allowance(address owner, address delegate) public view returns (uint256)

Returns the allowance of the specified owner for the specified delegate.

Parameters

NameTypeDescription
owneraddressThe address of the owner.
delegateaddressThe address of the delegate.

Return Values

NameTypeDescription
[0]uint256The allowance of the owner for the delegate.

transferFrom

function transferFrom(address owner, address buyer, uint256 numTokens) public returns (bool)

Transfers tokens from the specified owner's account to the specified buyer.

Parameters

NameTypeDescription
owneraddressThe address of the owner.
buyeraddressThe address of the buyer.
numTokensuint256The number of tokens to transfer.

Return Values

NameTypeDescription
[0]booltrue.

__erc20BaseTokens

contract ERC20BaseTokens __erc20BaseTokens