poseidon-solidity-example/lib/forge-std/src/interfaces/IERC20.sol
lib/forge-std/src/interfaces/IERC20.solRaw
1// SPDX-License-Identifier: MIT
2pragma solidity >=0.6.2;
3
4/// @dev Interface of the ERC20 standard as defined in the EIP.
5/// @dev This includes the optional name, symbol, and decimals metadata.
6interface IERC20 {
7 /// @dev Emitted when `value` tokens are moved from one account (`from`) to another (`to`).
8 event Transfer(address indexed from, address indexed to, uint256 value);
9
10 /// @dev Emitted when the allowance of a `spender` for an `owner` is set, where `value`
11 /// is the new allowance.
12 event Approval(address indexed owner, address indexed spender, uint256 value);
13
14 /// @notice Returns the amount of tokens in existence.
15 function totalSupply() external view returns (uint256);
16
17 /// @notice Returns the amount of tokens owned by `account`.
18 function balanceOf(address account) external view returns (uint256);
19
20 /// @notice Moves `amount` tokens from the caller's account to `to`.
21 function transfer(address to, uint256 amount) external returns (bool);
22
23 /// @notice Returns the remaining number of tokens that `spender` is allowed
24 /// to spend on behalf of `owner`
25 function allowance(address owner, address spender) external view returns (uint256);
26
27 /// @notice Sets `amount` as the allowance of `spender` over the caller's tokens.
28 /// @dev Be aware of front-running risks: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
29 function approve(address spender, uint256 amount) external returns (bool);
30
31 /// @notice Moves `amount` tokens from `from` to `to` using the allowance mechanism.
32 /// `amount` is then deducted from the caller's allowance.
33 function transferFrom(address from, address to, uint256 amount) external returns (bool);
34
35 /// @notice Returns the name of the token.
36 function name() external view returns (string memory);
37
38 /// @notice Returns the symbol of the token.
39 function symbol() external view returns (string memory);
40
41 /// @notice Returns the decimals places of the token.
42 function decimals() external view returns (uint8);
43}