github.com/status-im/status-go@v1.1.0/contracts/ierc20/ierc20.sol (about) 1 // SPDX-License-Identifier: MIT 2 3 pragma solidity ^0.4.24; 4 5 /** 6 * @dev Interface of the ERC20 standard as defined in the EIP. 7 */ 8 interface IERC20 { 9 function name() external view returns (string memory); 10 11 function symbol() external view returns (string memory); 12 13 function decimals() external view returns (uint8); 14 15 /** 16 * @dev Returns the amount of tokens in existence. 17 */ 18 function totalSupply() external view returns (uint256); 19 20 /** 21 * @dev Returns the amount of tokens owned by `account`. 22 */ 23 function balanceOf(address account) external view returns (uint256); 24 25 /** 26 * @dev Moves `amount` tokens from the caller's account to `recipient`. 27 * 28 * Returns a boolean value indicating whether the operation succeeded. 29 * 30 * Emits a {Transfer} event. 31 */ 32 function transfer(address recipient, uint256 amount) 33 external 34 returns (bool); 35 36 /** 37 * @dev Returns the remaining number of tokens that `spender` will be 38 * allowed to spend on behalf of `owner` through {transferFrom}. This is 39 * zero by default. 40 * 41 * This value changes when {approve} or {transferFrom} are called. 42 */ 43 function allowance(address owner, address spender) 44 external 45 view 46 returns (uint256); 47 48 /** 49 * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. 50 * 51 * Returns a boolean value indicating whether the operation succeeded. 52 * 53 * IMPORTANT: Beware that changing an allowance with this method brings the risk 54 * that someone may use both the old and the new allowance by unfortunate 55 * transaction ordering. One possible solution to mitigate this race 56 * condition is to first reduce the spender's allowance to 0 and set the 57 * desired value afterwards: 58 * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 59 * 60 * Emits an {Approval} event. 61 */ 62 function approve(address spender, uint256 amount) external returns (bool); 63 64 /** 65 * @dev Moves `amount` tokens from `sender` to `recipient` using the 66 * allowance mechanism. `amount` is then deducted from the caller's 67 * allowance. 68 * 69 * Returns a boolean value indicating whether the operation succeeded. 70 * 71 * Emits a {Transfer} event. 72 */ 73 function transferFrom( 74 address sender, 75 address recipient, 76 uint256 amount 77 ) external returns (bool); 78 79 /** 80 * @dev Emitted when `value` tokens are moved from one account (`from`) to 81 * another (`to`). 82 * 83 * Note that `value` may be zero. 84 */ 85 event Transfer(address indexed from, address indexed to, uint256 value); 86 87 /** 88 * @dev Emitted when the allowance of a `spender` for an `owner` is set by 89 * a call to {approve}. `value` is the new allowance. 90 */ 91 event Approval( 92 address indexed owner, 93 address indexed spender, 94 uint256 value 95 ); 96 }