Skip to content

Commit

Permalink
Use ERC-XXX syntax (#4730)
Browse files Browse the repository at this point in the history
Co-authored-by: Hadrien Croubois <[email protected]>
Co-authored-by: ernestognw <[email protected]>
  • Loading branch information
3 people authored Nov 23, 2023
1 parent bf75bcc commit 7bd2b2a
Show file tree
Hide file tree
Showing 96 changed files with 282 additions and 282 deletions.
2 changes: 1 addition & 1 deletion GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ In addition to the official Solidity Style Guide we have a number of other conve
}
```

Some standards (e.g. ERC20) use present tense, and in those cases the
Some standards (e.g. ERC-20) use present tense, and in those cases the
standard specification is used.

* Interface names should have a capital I prefix.
Expand Down
2 changes: 1 addition & 1 deletion certora/specs/ERC20FlashMint.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "methods/IERC3156FlashLender.spec";
import "methods/IERC3156FlashBorrower.spec";

methods {
// non standard ERC3156 functions
// non standard ERC-3156 functions
function flashFeeReceiver() external returns (address) envfree;

// function summaries below
Expand Down
2 changes: 1 addition & 1 deletion contracts/access/IAccessControl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pragma solidity ^0.8.20;

/**
* @dev External interface of AccessControl declared to support ERC165 detection.
* @dev External interface of AccessControl declared to support ERC-165 detection.
*/
interface IAccessControl {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pragma solidity ^0.8.20;
import {IAccessControl} from "../IAccessControl.sol";

/**
* @dev External interface of AccessControlDefaultAdminRules declared to support ERC165 detection.
* @dev External interface of AccessControlDefaultAdminRules declared to support ERC-165 detection.
*/
interface IAccessControlDefaultAdminRules is IAccessControl {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/access/extensions/IAccessControlEnumerable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pragma solidity ^0.8.20;
import {IAccessControl} from "../IAccessControl.sol";

/**
* @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
* @dev External interface of AccessControlEnumerable declared to support ERC-165 detection.
*/
interface IAccessControlEnumerable is IAccessControl {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/finance/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/

This directory includes primitives for financial systems:

- {VestingWallet} handles the vesting of Ether and ERC20 tokens for a given beneficiary. Custody of multiple tokens can
- {VestingWallet} handles the vesting of Ether and ERC-20 tokens for a given beneficiary. Custody of multiple tokens can
be given to this contract, which will release the token to the beneficiary following a given, customizable, vesting
schedule.
Expand Down
4 changes: 2 additions & 2 deletions contracts/finance/VestingWallet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {Context} from "../utils/Context.sol";
import {Ownable} from "../access/Ownable.sol";

/**
* @dev A vesting wallet is an ownable contract that can receive native currency and ERC20 tokens, and release these
* @dev A vesting wallet is an ownable contract that can receive native currency and ERC-20 tokens, and release these
* assets to the wallet owner, also referred to as "beneficiary", according to a vesting schedule.
*
* Any assets transferred to this contract will follow the vesting schedule as if they were locked from the beginning.
Expand Down Expand Up @@ -94,7 +94,7 @@ contract VestingWallet is Context, Ownable {

/**
* @dev Getter for the amount of releasable `token` tokens. `token` should be the address of an
* IERC20 contract.
* {IERC20} contract.
*/
function releasable(address token) public view virtual returns (uint256) {
return vestedAmount(token, uint64(block.timestamp)) - released(token);
Expand Down
8 changes: 4 additions & 4 deletions contracts/governance/IGovernor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ interface IGovernor is IERC165, IERC6372 {

/**
* @notice module:core
* @dev Name of the governor instance (used in building the ERC712 domain separator).
* @dev Name of the governor instance (used in building the EIP-712 domain separator).
*/
function name() external view returns (string memory);

/**
* @notice module:core
* @dev Version of the governor instance (used in building the ERC712 domain separator). Default: "1"
* @dev Version of the governor instance (used in building the EIP-712 domain separator). Default: "1"
*/
function version() external view returns (string memory);

Expand Down Expand Up @@ -254,7 +254,7 @@ interface IGovernor is IERC165, IERC6372 {
/**
* @notice module:user-config
* @dev Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends
* on the clock (see EIP-6372) this contract uses.
* on the clock (see ERC-6372) this contract uses.
*
* This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a
* proposal starts.
Expand All @@ -267,7 +267,7 @@ interface IGovernor is IERC165, IERC6372 {
/**
* @notice module:user-config
* @dev Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock
* (see EIP-6372) this contract uses.
* (see ERC-6372) this contract uses.
*
* NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting
* duration compared to the voting delay.
Expand Down
6 changes: 3 additions & 3 deletions contracts/governance/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ Other extensions can customize the behavior or interface in multiple ways.

In addition to modules and extensions, the core contract requires a few virtual functions to be implemented to your particular specifications:

* <<Governor-votingDelay-,`votingDelay()`>>: Delay (in EIP-6372 clock) since the proposal is submitted until voting power is fixed and voting starts. This can be used to enforce a delay after a proposal is published for users to buy tokens, or delegate their votes.
* <<Governor-votingPeriod-,`votingPeriod()`>>: Delay (in EIP-6372 clock) since the proposal starts until voting ends.
* <<Governor-quorum-uint256-,`quorum(uint256 timepoint)`>>: Quorum required for a proposal to be successful. This function includes a `timepoint` argument (see EIP-6372) so the quorum can adapt through time, for example, to follow a token's `totalSupply`.
* <<Governor-votingDelay-,`votingDelay()`>>: Delay (in ERC-6372 clock) since the proposal is submitted until voting power is fixed and voting starts. This can be used to enforce a delay after a proposal is published for users to buy tokens, or delegate their votes.
* <<Governor-votingPeriod-,`votingPeriod()`>>: Delay (in ERC-6372 clock) since the proposal starts until voting ends.
* <<Governor-quorum-uint256-,`quorum(uint256 timepoint)`>>: Quorum required for a proposal to be successful. This function includes a `timepoint` argument (see ERC-6372) so the quorum can adapt through time, for example, to follow a token's `totalSupply`.

NOTE: Functions of the `Governor` contract do not include access control. If you want to restrict access, you should add these checks by overloading the particular functions. Among these, {Governor-_cancel} is internal by default, and you will have to expose it (with the right access control mechanism) yourself if this function is needed.

Expand Down
6 changes: 3 additions & 3 deletions contracts/governance/extensions/GovernorVotes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ abstract contract GovernorVotes is Governor {
}

/**
* @dev Clock (as specified in EIP-6372) is set to match the token's clock. Fallback to block numbers if the token
* does not implement EIP-6372.
* @dev Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token
* does not implement ERC-6372.
*/
function clock() public view virtual override returns (uint48) {
try token().clock() returns (uint48 timepoint) {
Expand All @@ -40,7 +40,7 @@ abstract contract GovernorVotes is Governor {
}

/**
* @dev Machine-readable description of the clock as specified in EIP-6372.
* @dev Machine-readable description of the clock as specified in ERC-6372.
*/
// solhint-disable-next-line func-name-mixedcase
function CLOCK_MODE() public view virtual override returns (string memory) {
Expand Down
2 changes: 1 addition & 1 deletion contracts/governance/utils/Votes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ abstract contract Votes is Context, EIP712, Nonces, IERC5805 {
}

/**
* @dev Machine-readable description of the clock as specified in EIP-6372.
* @dev Machine-readable description of the clock as specified in ERC-6372.
*/
// solhint-disable-next-line func-name-mixedcase
function CLOCK_MODE() public view virtual returns (string memory) {
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IERC1271.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pragma solidity ^0.8.20;

/**
* @dev Interface of the ERC1271 standard signature validation method for
* @dev Interface of the ERC-1271 standard signature validation method for
* contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
*/
interface IERC1271 {
Expand Down
6 changes: 3 additions & 3 deletions contracts/interfaces/IERC1363.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";

/**
* @dev Interface of an ERC1363 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1363[EIP].
* @dev Interface of an ERC-1363 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1363[ERC].
*
* Defines a interface for ERC20 tokens that supports executing recipient
* Defines a interface for ERC-20 tokens that supports executing recipient
* code after `transfer` or `transferFrom`, or spender code after `approve`.
*/
interface IERC1363 is IERC165, IERC20 {
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/IERC1363Receiver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ interface IERC1363Receiver {
*/

/**
* @notice Handle the receipt of ERC1363 tokens
* @dev Any ERC1363 smart contract calls this function on the recipient
* @notice Handle the receipt of ERC-1363 tokens
* @dev Any ERC-1363 smart contract calls this function on the recipient
* after a `transfer` or a `transferFrom`. This function MAY throw to revert and reject the
* transfer. Return of other than the magic value MUST result in the
* transaction being reverted.
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/IERC1363Spender.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ interface IERC1363Spender {
*/

/**
* @notice Handle the approval of ERC1363 tokens
* @dev Any ERC1363 smart contract calls this function on the recipient
* @notice Handle the approval of ERC-1363 tokens
* @dev Any ERC-1363 smart contract calls this function on the recipient
* after an `approve`. This function MAY throw to revert and reject the
* approval. Return of other than the magic value MUST result in the
* transaction being reverted.
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/IERC1820Implementer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
pragma solidity ^0.8.20;

/**
* @dev Interface for an ERC1820 implementer, as defined in the
* https://eips.ethereum.org/EIPS/eip-1820#interface-implementation-erc1820implementerinterface[EIP].
* @dev Interface for an ERC-1820 implementer, as defined in the
* https://eips.ethereum.org/EIPS/eip-1820#interface-implementation-erc1820implementerinterface[ERC].
* Used by contracts that will be registered as implementers in the
* {IERC1820Registry}.
*/
Expand Down
20 changes: 10 additions & 10 deletions contracts/interfaces/IERC1820Registry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
pragma solidity ^0.8.20;

/**
* @dev Interface of the global ERC1820 Registry, as defined in the
* https://eips.ethereum.org/EIPS/eip-1820[EIP]. Accounts may register
* @dev Interface of the global ERC-1820 Registry, as defined in the
* https://eips.ethereum.org/EIPS/eip-1820[ERC]. Accounts may register
* implementers for interfaces in this registry, as well as query support.
*
* Implementers may be shared by multiple accounts, and can also implement more
Expand All @@ -15,7 +15,7 @@ pragma solidity ^0.8.20;
*
* {IERC165} interfaces can also be queried via the registry.
*
* For an in-depth explanation and source code analysis, see the EIP text.
* For an in-depth explanation and source code analysis, see the ERC text.
*/
interface IERC1820Registry {
event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer);
Expand Down Expand Up @@ -80,32 +80,32 @@ interface IERC1820Registry {
/**
* @dev Returns the interface hash for an `interfaceName`, as defined in the
* corresponding
* https://eips.ethereum.org/EIPS/eip-1820#interface-name[section of the EIP].
* https://eips.ethereum.org/EIPS/eip-1820#interface-name[section of the ERC].
*/
function interfaceHash(string calldata interfaceName) external pure returns (bytes32);

/**
* @notice Updates the cache with whether the contract implements an ERC165 interface or not.
* @notice Updates the cache with whether the contract implements an ERC-165 interface or not.
* @param account Address of the contract for which to update the cache.
* @param interfaceId ERC165 interface for which to update the cache.
* @param interfaceId ERC-165 interface for which to update the cache.
*/
function updateERC165Cache(address account, bytes4 interfaceId) external;

/**
* @notice Checks whether a contract implements an ERC165 interface or not.
* @notice Checks whether a contract implements an ERC-165 interface or not.
* If the result is not cached a direct lookup on the contract address is performed.
* If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling
* {updateERC165Cache} with the contract address.
* @param account Address of the contract to check.
* @param interfaceId ERC165 interface to check.
* @param interfaceId ERC-165 interface to check.
* @return True if `account` implements `interfaceId`, false otherwise.
*/
function implementsERC165Interface(address account, bytes4 interfaceId) external view returns (bool);

/**
* @notice Checks whether a contract implements an ERC165 interface or not without using or updating the cache.
* @notice Checks whether a contract implements an ERC-165 interface or not without using or updating the cache.
* @param account Address of the contract to check.
* @param interfaceId ERC165 interface to check.
* @param interfaceId ERC-165 interface to check.
* @return True if `account` implements `interfaceId`, false otherwise.
*/
function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IERC3156FlashBorrower.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pragma solidity ^0.8.20;

/**
* @dev Interface of the ERC3156 FlashBorrower, as defined in
* @dev Interface of the ERC-3156 FlashBorrower, as defined in
* https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].
*/
interface IERC3156FlashBorrower {
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IERC3156FlashLender.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pragma solidity ^0.8.20;
import {IERC3156FlashBorrower} from "./IERC3156FlashBorrower.sol";

/**
* @dev Interface of the ERC3156 FlashLender, as defined in
* @dev Interface of the ERC-3156 FlashLender, as defined in
* https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].
*/
interface IERC3156FlashLender {
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IERC4626.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {IERC20} from "../token/ERC20/IERC20.sol";
import {IERC20Metadata} from "../token/ERC20/extensions/IERC20Metadata.sol";

/**
* @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in
* @dev Interface of the ERC-4626 "Tokenized Vault Standard", as defined in
* https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].
*/
interface IERC4626 is IERC20, IERC20Metadata {
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IERC4906.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pragma solidity ^0.8.20;
import {IERC165} from "./IERC165.sol";
import {IERC721} from "./IERC721.sol";

/// @title EIP-721 Metadata Update Extension
/// @title ERC-721 Metadata Update Extension
interface IERC4906 is IERC165, IERC721 {
/// @dev This event emits when the metadata of a token is changed.
/// So that the third-party platforms such as NFT market could
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/IERC777.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
pragma solidity ^0.8.20;

/**
* @dev Interface of the ERC777Token standard as defined in the EIP.
* @dev Interface of the ERC-777 Token standard as defined in the ERC.
*
* This contract uses the
* https://eips.ethereum.org/EIPS/eip-1820[ERC1820 registry standard] to let
* https://eips.ethereum.org/EIPS/eip-1820[ERC-1820 registry standard] to let
* token holders and recipients react to token movements by using setting implementers
* for the associated interfaces in said registry. See {IERC1820Registry} and
* {IERC1820Implementer}.
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/IERC777Recipient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
pragma solidity ^0.8.20;

/**
* @dev Interface of the ERC777TokensRecipient standard as defined in the EIP.
* @dev Interface of the ERC-777 Tokens Recipient standard as defined in the ERC.
*
* Accounts can be notified of {IERC777} tokens being sent to them by having a
* contract implement this interface (contract holders can be their own
* implementer) and registering it on the
* https://eips.ethereum.org/EIPS/eip-1820[ERC1820 global registry].
* https://eips.ethereum.org/EIPS/eip-1820[ERC-1820 global registry].
*
* See {IERC1820Registry} and {IERC1820Implementer}.
*/
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/IERC777Sender.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
pragma solidity ^0.8.20;

/**
* @dev Interface of the ERC777TokensSender standard as defined in the EIP.
* @dev Interface of the ERC-777 Tokens Sender standard as defined in the ERC.
*
* {IERC777} Token holders can be notified of operations performed on their
* tokens by having a contract implement this interface (contract holders can be
* their own implementer) and registering it on the
* https://eips.ethereum.org/EIPS/eip-1820[ERC1820 global registry].
* https://eips.ethereum.org/EIPS/eip-1820[ERC-1820 global registry].
*
* See {IERC1820Registry} and {IERC1820Implementer}.
*/
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/draft-IERC1822.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pragma solidity ^0.8.20;

/**
* @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface IERC1822Proxiable {
Expand Down
14 changes: 7 additions & 7 deletions contracts/interfaces/draft-IERC6093.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
pragma solidity ^0.8.20;

/**
* @dev Standard ERC20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
*/
interface IERC20Errors {
/**
Expand Down Expand Up @@ -49,12 +49,12 @@ interface IERC20Errors {
}

/**
* @dev Standard ERC721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
* @dev Standard ERC-721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
Expand Down Expand Up @@ -107,8 +107,8 @@ interface IERC721Errors {
}

/**
* @dev Standard ERC1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
* @dev Standard ERC-1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
*/
interface IERC1155Errors {
/**
Expand Down
Loading

0 comments on commit 7bd2b2a

Please sign in to comment.