ERC20Coin
The ERC20 contract for a Iota coin.
Approval
event Approval(address tokenOwner, address spender, uint256 tokens)
Emitted when the allowance of a spender for an owner is set.
Parameters
| Name | Type | Description | 
|---|
| tokenOwner | address | The owner of the tokens. | 
| spender | address | The address allowed to spend the tokens. | 
| tokens | uint256 | The amount of tokens allowed to be spent. | 
Transfer
event Transfer(address from, address to, uint256 tokens)
Emitted when tokens are transferred from one address to another.
Parameters
| Name | Type | Description | 
|---|
| from | address | The address tokens are transferred from. | 
| to | address | The address tokens are transferred to. | 
| tokens | uint256 | The amount of tokens transferred. | 
name
function name() public view returns (string)
Returns the name of the native token.
Return Values
| Name | Type | Description | 
|---|
| [0] | string | The name of the token. | 
symbol
function symbol() public view returns (string)
Returns the ticker symbol of the native token.
Return Values
| Name | Type | Description | 
|---|
| [0] | string | The ticker symbol of the token. | 
decimals
function decimals() public view returns (uint8)
Returns the number of decimals used for the native token.
Return Values
| Name | Type | Description | 
|---|
| [0] | uint8 | The number of decimals. | 
totalSupply
function totalSupply() public view virtual returns (uint256)
Returns the total supply of the native token.
Return Values
| Name | Type | Description | 
|---|
| [0] | uint256 | The total supply of the token. | 
balanceOf
function balanceOf(address tokenOwner) public view returns (uint256)
Returns the balance of a token owner.
Parameters
| Name | Type | Description | 
|---|
| tokenOwner | address | The address of the token owner. | 
Return Values
| Name | Type | Description | 
|---|
| [0] | uint256 | The balance of the token owner. | 
transfer
function transfer(address receiver, uint256 numTokens) public returns (bool)
Transfers tokens from the sender's address to the receiver's address.
Parameters
| Name | Type | Description | 
|---|
| receiver | address | The address to transfer tokens to. | 
| numTokens | uint256 | The amount of tokens to transfer. | 
Return Values
| Name | Type | Description | 
|---|
| [0] | bool | true. | 
approve
function approve(address delegate, uint256 numTokens) public returns (bool)
Sets the allowance of a spender to spend tokens on behalf of the owner.
Parameters
| Name | Type | Description | 
|---|
| delegate | address | The address allowed to spend the tokens. | 
| numTokens | uint256 | The amount of tokens allowed to be spent. | 
Return Values
| Name | Type | Description | 
|---|
| [0] | bool | true. | 
allowance
function allowance(address owner, address delegate) public view returns (uint256)
Returns the amount of tokens that the spender is allowed to spend on behalf of the owner.
Parameters
| Name | Type | Description | 
|---|
| owner | address | The address of the token owner. | 
| delegate | address | The address of the spender. | 
Return Values
| Name | Type | Description | 
|---|
| [0] | uint256 | The amount of tokens the spender is allowed to spend. | 
transferFrom
function transferFrom(address owner, address buyer, uint256 numTokens) public returns (bool)
Transfers tokens from one address to another on behalf of a token owner.
Parameters
| Name | Type | Description | 
|---|
| owner | address | The address from which tokens are transferred. | 
| buyer | address | The address to which tokens are transferred. | 
| numTokens | uint256 | The amount of tokens to transfer. | 
Return Values
| Name | Type | Description | 
|---|
| [0] | bool | A boolean indicating whether the transfer was successful or not. |