unshETH - Dependencies
IERC20.sol
This is a Solidity interface file for the ERC20 standard, defined in the Ethereum EIP. It declares the standard functions and events that an ERC20 token contract should implement. The functions include token transfer, allowance setting, and querying total supply and balances.
IERC20
Interface of the ERC20 standard as defined in the EIP.
Transfer
Emitted when value
tokens are moved from one account (from
) to another (to
).
Parameters
- from address: The sender of the tokens.
- to address: The receiver of the tokens.
- value uint256: The amount of tokens transferred.
Approval
Emitted when the allowance of a spender
for an owner
is set by a call to {approve}. value
is the new allowance.
Parameters
- owner address: The owner of the tokens.
- spender address: The spender of the tokens.
- value uint256: The amount of tokens approved.
totalSupply
function totalSupply() external view returns (uint256)
Returns the amount of tokens in existence.
Return Values
- uint256: The total supply of tokens.
balanceOf
function balanceOf(address account) external view returns (uint256)
Returns the amount of tokens owned by account
.
Parameters
- account address: The address of the account.
Return Values
- uint256: The balance of the account.
transfer
function transfer(address to, uint256 amount) external returns (bool)
Moves amount
tokens from the caller's account to to
.
Parameters
- to address: The receiver of the tokens.
- amount uint256: The amount of tokens transferred.
Return Values
- bool: A boolean value indicating whether the operation succeeded.
allowance
function allowance(address owner, address spender) external view returns (uint256)
Returns the remaining number of tokens that spender
will be allowed to spend on behalf of owner
.
Parameters
- owner address: The owner of the tokens.
- spender address: The spender of the tokens.
Return Values
- uint256: The remaining tokens that the spender can spend.
approve
function approve(address spender, uint256 amount) external returns (bool)
Sets amount
as the allowance of spender
over the caller's tokens.
Parameters
- spender address: The spender of the tokens.
- amount uint256: The amount of tokens approved.
Return Values
- bool: A boolean value indicating whether the operation succeeded.
transferFrom
function transferFrom(address from, address to, uint256 amount) external returns (bool)
Moves amount
tokens from from
to to
using the allowance mechanism. amount
is then deducted from the caller's allowance.
Parameters
- from address: The sender of the tokens.
- to address: The receiver of the tokens.
- amount uint256: The amount of tokens transferred.
Return Values
- bool: A boolean value indicating whether the operation succeeded.