ERC20
Title: |
ERC20 |
Description: |
Zeppelin Solidity Smart Contract that provides the interface
required to implement an ERC20 compliant token. |
Author: |
Smart Contract Solutions, Inc. |
Solidity Version: |
^0.4.18 |
Relative Path: |
./contracts/supporting/ERC20.sol |
License: |
MIT License |
Current Version: |
1.4.0 |
Original Source: |
ERC20 Source |
1. Imports & Dependencies
The following imports and dependencies exist for the ERC20 Smart Contract:
2. Variables
There are no variables for the ERC20 Smart Contract.
3. Enums
There are no enums for the ERC20 Smart Contract.
4. Events
The following events exist for the ERC20 Smart Contract:
Name |
Description |
Approval |
Event to track when approval is granted to a spender on a given address |
Approval
Event Name: |
Approval |
Description: |
Event to track when approval is granted to a spender on a given address |
Usage
The Approval event has the following usage syntax and arguments:
|
Argument |
Type |
Indexed? |
Details |
1 |
owner |
address |
Yes |
Address that is granting approval |
2 |
spender |
address |
Yes |
Address that has been approved |
3 |
value |
uint256 |
No |
Amount of tokens spender is allowed to spend |
Approval Usage Example
Approval(0x123456789abcdefghijklmnopqrstuvwxyz98765,
0x123456789abcdefghijklmnopqrstuvwxyz12345,
100);
5. Mappings
The are no mappings for the ERC20 Smart Contract.
6. Modifiers
There are no modifiers for the ERC20 Smart Contract.
7. Functions
The following functions exist for the ERC20 Smart Contract:
Name |
Description |
allowance |
Function to get the approved allowance for a transfer of tokens from an
address by a spender address |
approve |
Function to approve a particular allowance to be transferred by that spender
address on the target address |
transferFrom |
Function transfer tokens from an address to another invoked by an authorised
spender address |
allowance
Function Name: |
allowance |
Description: |
Function to get the approved allowance for a transfer of tokens from
an address by a spender address |
Function Type: |
View |
Function Visibility: |
Public |
Function Modifiers: |
N/A |
Return Type: |
uint256 |
Return Details: |
returns the remaining allowance the spender has on the target address |
Code
The code for the allowance function is an interface and it is defined as follows:
allowance 1.4.0 Code
function allowance(address owner, address spender) public view returns (uint256);
Usage
The allowance function has the following usage syntax and arguments:
|
Argument |
Type |
Details |
1 |
owner |
address |
Address that spender has been given an allowance on |
2 |
spender |
address |
Address of the spender |
allowance Usage Example
allowance(0x123456789abcdefghijklmnopqrstuvwxyz98765,
0x123456789abcdefghijklmnopqrstuvwxyz12345);
approve
Function Name: |
approve |
Description: |
Function to approve a spender address to have a particular allowance
to be transferred or spent by that spender address on the target
address |
Function Type: |
View |
Function Visibility: |
N/A |
Function Modifiers: |
N/A |
Return Type: |
bool |
Return Details: |
returns a bool to denote success or failure to approve |
Code
The code for the approve function is an interface and it is defined as follows:
approve 1.4.0 Code
function approve(address spender, uint256 value) public returns (bool);
Usage
The approve function has the following usage syntax and arguments:
|
Argument |
Type |
Details |
1 |
spender |
address |
Address be granted an allowance |
approve Usage Example
approve(0x123456789abcdefghijklmnopqrstuvwxyz98765, 100);
transferFrom
Function Name: |
transferFrom |
Description: |
Function transfer tokens from an address to another invoked by an
authorised spender address |
Function Type: |
N/A |
Function Visibility: |
Public |
Function Modifiers: |
N/A |
Return Type: |
bool |
Return Details: |
returns a bool to denote success or failure to transfer |
Code
The code for the transferFrom function is an interface and it is defined as follows:
transferFrom 1.4.0 Code
function transferFrom(address from, address to, uint256 value) public returns (bool);
Usage
The transferFrom function has the following usage syntax and arguments:
|
Argument |
Type |
Details |
1 |
from |
address |
Address to transfer tokens from |
2 |
to |
address |
Address to send tokens to |
3 |
value |
uint256 |
Amount of tokens to transfer |
transferFrom Usage Example
transferFrom(0x123456789abcdefghijklmnopqrstuvwxyz98765,
0x123456789abcdefghijklmnopqrstuvwxyz54321,
100);