-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: unify interface NatSpec #666
Open
zerosnacks
wants to merge
3
commits into
master
Choose a base branch
from
zerosnacks/chore-unify-interface-natspec
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.6.2; | ||
|
||
/// @title ERC-165: Standard Interface Detection | ||
/// @dev SEE: https://eips.ethereum.org/EIPS/eip-165 | ||
interface IERC165 { | ||
/// @notice Query if a contract implements an interface | ||
/// @param interfaceID The interface identifier, as specified in ERC-165 | ||
/// @dev Interface identification is specified in ERC-165. This function | ||
/// uses less than 30,000 gas. | ||
/// @return `true` if the contract implements `interfaceID` and | ||
/// `interfaceID` is not 0xffffffff, `false` otherwise | ||
/// @notice Checks if the contract implements a specific interface. | ||
/// @param interfaceID The 4-byte identifier of the interface, as specified in ERC-165. | ||
/// @return `true` if the contract implements `interfaceID` and `interfaceID` is not `0xffffffff`, | ||
/// otherwise `false`. | ||
/// @dev The interface identifier (`interfaceID`) is defined in ERC-165. | ||
/// This function should consume less than 30,000 gas. | ||
function supportsInterface(bytes4 interfaceID) external view returns (bool); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,59 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.6.2; | ||
|
||
/// @dev Interface of the ERC20 standard as defined in the EIP. | ||
/// @dev This includes the optional name, symbol, and decimals metadata. | ||
/// @title ERC-20: Token Standard | ||
/// @dev SEE: https://eips.ethereum.org/EIPS/eip-20 | ||
interface IERC20 { | ||
/// @dev Emitted when `value` tokens are moved from one account (`from`) to another (`to`). | ||
/// @notice Emitted when `value` tokens are moved from one account (`from`) to another (`to`). | ||
event Transfer(address indexed from, address indexed to, uint256 value); | ||
|
||
/// @dev Emitted when the allowance of a `spender` for an `owner` is set, where `value` | ||
/// is the new allowance. | ||
/// @notice Emitted when the allowance of a `spender` for an `owner` is set, | ||
/// where `value` is the new allowance. | ||
event Approval(address indexed owner, address indexed spender, uint256 value); | ||
|
||
/// @notice Returns the amount of tokens in existence. | ||
/// @notice Returns the name of the token. | ||
function name() external view returns (string memory); | ||
|
||
/// @notice Returns the symbol of the token. | ||
function symbol() external view returns (string memory); | ||
|
||
/// @notice Returns the number of decimal places used for user representation. | ||
function decimals() external view returns (uint8); | ||
|
||
/// @notice Returns the total supply of tokens in existence. | ||
function totalSupply() external view returns (uint256); | ||
|
||
/// @notice Returns the amount of tokens owned by `account`. | ||
/// @notice Returns the balance of tokens owned by a given `account`. | ||
function balanceOf(address account) external view returns (uint256); | ||
|
||
/// @notice Moves `amount` tokens from the caller's account to `to`. | ||
/// @notice Transfers `amount` tokens from the caller’s account to the `to` address. | ||
/// @param to The recipient address. | ||
/// @param amount The number of tokens to transfer. | ||
/// @return A boolean indicating whether the transfer was successful. | ||
/// @dev Emits a {Transfer} event. | ||
function transfer(address to, uint256 amount) external returns (bool); | ||
|
||
/// @notice Returns the remaining number of tokens that `spender` is allowed | ||
/// to spend on behalf of `owner` | ||
function allowance(address owner, address spender) external view returns (uint256); | ||
|
||
/// @notice Sets `amount` as the allowance of `spender` over the caller's tokens. | ||
/// @dev Be aware of front-running risks: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 | ||
function approve(address spender, uint256 amount) external returns (bool); | ||
|
||
/// @notice Moves `amount` tokens from `from` to `to` using the allowance mechanism. | ||
/// `amount` is then deducted from the caller's allowance. | ||
/// @notice Transfers `amount` tokens from `from` to `to` using the allowance mechanism. | ||
/// The caller must have prior approval for at least `amount` tokens from `from`. | ||
/// The allowance is reduced accordingly. | ||
/// @param from The address holding the tokens. | ||
/// @param to The recipient address. | ||
/// @param amount The number of tokens to transfer. | ||
/// @return A boolean indicating whether the transfer was successful. | ||
/// @dev Emits a {Transfer} event. | ||
function transferFrom(address from, address to, uint256 amount) external returns (bool); | ||
|
||
/// @notice Returns the name of the token. | ||
function name() external view returns (string memory); | ||
|
||
/// @notice Returns the symbol of the token. | ||
function symbol() external view returns (string memory); | ||
/// @notice Approves `spender` to transfer up to `amount` tokens on behalf of the caller. | ||
/// @param spender The address that will be allowed to spend the tokens. | ||
/// @param amount The maximum number of tokens that can be spent. | ||
/// @return A boolean indicating whether the approval was successful. | ||
/// @dev Emits an {Approval} event. Be aware of the allowance front-running attack: | ||
/// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729. | ||
function approve(address spender, uint256 amount) external returns (bool); | ||
|
||
/// @notice Returns the decimals places of the token. | ||
function decimals() external view returns (uint8); | ||
/// @notice Returns the remaining number of tokens that `spender` is allowed to spend on behalf of `owner`. | ||
/// @param owner The owner of the tokens. | ||
/// @param spender The spender who has been approved. | ||
/// @return The number of tokens `spender` can still spend. | ||
function allowance(address owner, address spender) external view returns (uint256); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be indented here and other comments