@@ -7,57 +7,66 @@ pragma solidity ^0.8.20;
77/// @dev Interface of the ERC-20 standard as defined in the ERC.
88///
99interface IERC20 {
10- /// @dev Emitted when `value` tokens are moved from one account (`from`) to
11- /// another (`to`).
12- ///
13- /// Note that `value` may be zero.
10+ /// @dev Emitted when `value` tokens are moved from one account (`from`) to
11+ /// another (`to`).
12+ ///
13+ /// Note that `value` may be zero.
1414 event Transfer (address indexed from , address indexed to , uint256 value );
1515
16- /// @dev Emitted when the allowance of a `spender` for an `owner` is set by
17- /// a call to {approve}. `value` is the new allowance.
16+ /// @dev Emitted when the allowance of a `spender` for an `owner` is set by
17+ /// a call to {approve}. `value` is the new allowance.
1818 event Approval (address indexed owner , address indexed spender , uint256 value );
1919
20- /// @dev Returns the value of tokens in existence.
20+ /// @dev Returns the name of the token.
21+ function name () external view returns (string memory );
22+
23+ /// @dev Returns the symbol of the token.
24+ function symbol () external view returns (string memory );
25+
26+ /// @dev Returns the decimals places of the token.
27+ function decimals () external view returns (uint8 );
28+
29+ /// @dev Returns the value of tokens in existence.
2130 function totalSupply () external view returns (uint256 );
2231
23- /// @dev Returns the value of tokens owned by `account`.
32+ /// @dev Returns the value of tokens owned by `account`.
2433 function balanceOf (address account ) external view returns (uint256 );
2534
26- /// @dev Moves a `value` amount of tokens from the caller's account to `to`.
27- ///
28- /// Returns a boolean value indicating whether the operation succeeded.
29- ///
30- /// Emits a {Transfer} event.
35+ /// @dev Moves a `value` amount of tokens from the caller's account to `to`.
36+ ///
37+ /// Returns a boolean value indicating whether the operation succeeded.
38+ ///
39+ /// Emits a {Transfer} event.
3140 function transfer (address to , uint256 value ) external returns (bool );
3241
33- /// @dev Returns the remaining number of tokens that `spender` will be
34- /// allowed to spend on behalf of `owner` through {transferFrom}. This is
35- /// zero by default.
36- ///
37- /// This value changes when {approve} or {transferFrom} are called.
42+ /// @dev Returns the remaining number of tokens that `spender` will be
43+ /// allowed to spend on behalf of `owner` through {transferFrom}. This is
44+ /// zero by default.
45+ ///
46+ /// This value changes when {approve} or {transferFrom} are called.
3847 function allowance (address owner , address spender ) external view returns (uint256 );
3948
40- /// @dev Sets a `value` amount of tokens as the allowance of `spender` over the
41- /// caller's tokens.
42- ///
43- /// Returns a boolean value indicating whether the operation succeeded.
44- ///
45- /// IMPORTANT: Beware that changing an allowance with this method brings the risk
46- /// that someone may use both the old and the new allowance by unfortunate
47- /// transaction ordering. One possible solution to mitigate this race
48- /// condition is to first reduce the spender's allowance to 0 and set the
49- /// desired value afterwards:
50- /// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
51- ///
52- /// Emits an {Approval} event.
49+ /// @dev Sets a `value` amount of tokens as the allowance of `spender` over the
50+ /// caller's tokens.
51+ ///
52+ /// Returns a boolean value indicating whether the operation succeeded.
53+ ///
54+ /// IMPORTANT: Beware that changing an allowance with this method brings the risk
55+ /// that someone may use both the old and the new allowance by unfortunate
56+ /// transaction ordering. One possible solution to mitigate this race
57+ /// condition is to first reduce the spender's allowance to 0 and set the
58+ /// desired value afterwards:
59+ /// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
60+ ///
61+ /// Emits an {Approval} event.
5362 function approve (address spender , uint256 value ) external returns (bool );
5463
55- /// @dev Moves a `value` amount of tokens from `from` to `to` using the
56- /// allowance mechanism. `value` is then deducted from the caller's
57- /// allowance.
58- ///
59- /// Returns a boolean value indicating whether the operation succeeded.
60- ///
61- /// Emits a {Transfer} event.
64+ /// @dev Moves a `value` amount of tokens from `from` to `to` using the
65+ /// allowance mechanism. `value` is then deducted from the caller's
66+ /// allowance.
67+ ///
68+ /// Returns a boolean value indicating whether the operation succeeded.
69+ ///
70+ /// Emits a {Transfer} event.
6271 function transferFrom (address from , address to , uint256 value ) external returns (bool );
6372}
0 commit comments