From 2fb1dd8c2477c895e5cd24ac96b678638d863dda Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Mon, 3 Mar 2025 10:48:44 +0100 Subject: [PATCH 1/3] update interfaces, update fmt --- foundry.toml | 20 +- src/interfaces/IERC1155.sol | 83 +++++--- src/interfaces/IERC165.sol | 14 +- src/interfaces/IERC20.sol | 66 ++++--- src/interfaces/IERC4626.sol | 28 +-- src/interfaces/IERC6909.sol | 36 ++-- src/interfaces/IERC721.sol | 165 ++++++++-------- src/interfaces/IERC7540.sol | 151 ++++++-------- src/interfaces/IERC7575.sol | 347 +++++++++++++++------------------ src/interfaces/IMulticall3.sol | 42 ++++ 10 files changed, 492 insertions(+), 460 deletions(-) diff --git a/foundry.toml b/foundry.toml index 62ca21a6e..368d01091 100644 --- a/foundry.toml +++ b/foundry.toml @@ -15,9 +15,17 @@ needs_undefined_env_var = "${UNDEFINED_RPC_URL_PLACEHOLDER}" line_length = 120 tab_width = 4 bracket_spacing = false -int_types = 'long' -multiline_func_header = 'attributes_first' -quote_style = 'double' -number_underscore = 'preserve' -single_line_statement_blocks = 'preserve' -ignore = ["src/console.sol", "src/console2.sol"] \ No newline at end of file +int_types = "long" +multiline_func_header = "attributes_first" +quote_style = "double" +number_underscore = "preserve" +hex_underscore = "remove" +single_line_statement_blocks = "preserve" +override_spacing = false +wrap_comments = false +ignore = [ + "src/console.sol", + "src/console2.sol", +] +contract_new_lines = false +sort_imports = false \ No newline at end of file diff --git a/src/interfaces/IERC1155.sol b/src/interfaces/IERC1155.sol index ffc82984a..c25b06b76 100644 --- a/src/interfaces/IERC1155.sol +++ b/src/interfaces/IERC1155.sol @@ -3,17 +3,20 @@ pragma solidity >=0.6.2; import {IERC165} from "./IERC165.sol"; -/// @title ERC-1155 Multi Token Standard -/// @dev See https://eips.ethereum.org/EIPS/eip-1155 -/// Note: The ERC-165 identifier for this interface is 0xd9b67a26. +/// @title ERC-1155: Multi Token Standard +/// @dev SEE: https://eips.ethereum.org/EIPS/eip-1155 +/// NOTE: The ERC-165 identifier for this interface is 0xd9b67a26. interface IERC1155 is IERC165 { /// @dev - /// - Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). - /// - The `_operator` argument MUST be the address of an account/contract that is approved to make the transfer (SHOULD be msg.sender). + /// - Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value + /// transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). + /// - The `_operator` argument MUST be the address of an account/contract that is approved to make the transfer + /// (SHOULD be msg.sender). /// - The `_from` argument MUST be the address of the holder whose balance is decreased. /// - The `_to` argument MUST be the address of the recipient whose balance is increased. /// - The `_id` argument MUST be the token type being transferred. - /// - The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the recipient balance is increased by. + /// - The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the + /// recipient balance is increased by. /// - When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). /// - When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). event TransferSingle( @@ -21,53 +24,73 @@ interface IERC1155 is IERC165 { ); /// @dev - /// - Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). - /// - The `_operator` argument MUST be the address of an account/contract that is approved to make the transfer (SHOULD be msg.sender). + /// - Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value + /// transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). + /// - The `_operator` argument MUST be the address of an account/contract that is approved to make the transfer + /// (SHOULD be msg.sender). /// - The `_from` argument MUST be the address of the holder whose balance is decreased. /// - The `_to` argument MUST be the address of the recipient whose balance is increased. /// - The `_ids` argument MUST be the list of tokens being transferred. - /// - The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified in _ids) the holder balance is decreased by and match what the recipient balance is increased by. + /// - The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified + /// in _ids) the holder balance is decreased by and match what the recipient balance is increased by. /// - When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). /// - When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). event TransferBatch( address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values ); - /// @dev MUST emit when approval for a second party/operator address to manage all tokens for an owner address is enabled or disabled (absence of an event assumes disabled). + /// @dev + /// - MUST emit when approval for a second party/operator address to manage all tokens for an owner address is + /// enabled or disabled (absence of an event assumes disabled). event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); - /// @dev MUST emit when the URI is updated for a token ID. URIs are defined in RFC 3986. - /// The URI MUST point to a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema". + /// @dev + /// - MUST emit when the URI is updated for a token ID. URIs are defined in RFC 3986. + /// - The URI MUST point to a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema". event URI(string _value, uint256 indexed _id); - /// @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call). - /// @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). - /// - MUST revert if `_to` is the zero address. - /// - MUST revert if balance of holder for token `_id` is lower than the `_value` sent. - /// - MUST revert on any other error. - /// - MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard). - /// - After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). + /// @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with + /// safety call). /// @param _from Source address /// @param _to Target address /// @param _id ID of the token type /// @param _value Transfer amount - /// @param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to` - function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external; - - /// @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call). - /// @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). + /// @param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on + /// `_to` + /// @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" + /// section of the standard). /// - MUST revert if `_to` is the zero address. - /// - MUST revert if length of `_ids` is not the same as length of `_values`. - /// - MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient. + /// - MUST revert if balance of holder for token `_id` is lower than the `_value` sent. /// - MUST revert on any other error. - /// - MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard). - /// - Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc). - /// - After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). + /// - MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the + /// standard). + /// - After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > + /// 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of + /// the standard). + function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external; + + /// @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with + /// safety call). /// @param _from Source address /// @param _to Target address /// @param _ids IDs of each token type (order and length must match _values array) /// @param _values Transfer amounts per token type (order and length must match _ids array) - /// @param _data Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to` + /// @param _data Additional data with no specified format, MUST be sent unaltered in call to the + /// `ERC1155TokenReceiver` hook(s) on `_to` + /// @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" + /// section of the standard). + /// - MUST revert if `_to` is the zero address. + /// - MUST revert if length of `_ids` is not the same as length of `_values`. + /// - MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective + /// amount(s) in `_values` sent to the recipient. + /// - MUST revert on any other error. + /// - MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see + /// "Safe Transfer Rules" section of the standard). + /// - Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before + /// _ids[1]/_values[1], etc). + /// - After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a + /// smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` + /// and act appropriately (see "Safe Transfer Rules" section of the standard). function safeBatchTransferFrom( address _from, address _to, diff --git a/src/interfaces/IERC165.sol b/src/interfaces/IERC165.sol index 9af4bf800..1ca835a23 100644 --- a/src/interfaces/IERC165.sol +++ b/src/interfaces/IERC165.sol @@ -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); } diff --git a/src/interfaces/IERC20.sol b/src/interfaces/IERC20.sol index ba40806c3..888793c4b 100644 --- a/src/interfaces/IERC20.sol +++ b/src/interfaces/IERC20.sol @@ -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); } diff --git a/src/interfaces/IERC4626.sol b/src/interfaces/IERC4626.sol index c645a0fec..f63afaec4 100644 --- a/src/interfaces/IERC4626.sol +++ b/src/interfaces/IERC4626.sol @@ -3,16 +3,22 @@ pragma solidity >=0.6.2; import {IERC20} from "./IERC20.sol"; -/// @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in -/// https://eips.ethereum.org/EIPS/eip-4626 +/// @title ERC-4626: Tokenized Vaults +/// @dev SEE: https://eips.ethereum.org/EIPS/eip-4626 interface IERC4626 is IERC20 { + /// @notice The `sender` has exchanged `assets` for `shares`, and transferred those `shares` to `owner`. + /// - MUST be emitted when tokens are deposited into the Vault via the mint and deposit methods. event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares); + /// @notice The `sender` has exchanged `shares`, owned by `owner`, for `assets`, and transferred those `assets` to + /// `receiver`. + /// - MUST be emitted when shares are withdrawn from the Vault in `redeem` or `withdraw` methods. event Withdraw( address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares ); - /// @notice Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing. + /// @notice Returns the address of the underlying token used for the Vault for accounting, depositing, and + /// withdrawing. /// @dev /// - MUST be an ERC-20 token contract. /// - MUST NOT revert. @@ -25,8 +31,8 @@ interface IERC4626 is IERC20 { /// - MUST NOT revert. function totalAssets() external view returns (uint256 totalManagedAssets); - /// @notice Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal - /// scenario where all the conditions are met. + /// @notice Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an + /// ideal scenario where all the conditions are met. /// @dev /// - MUST NOT be inclusive of any fees that are charged against assets in the Vault. /// - MUST NOT show any variations depending on the caller. @@ -38,8 +44,8 @@ interface IERC4626 is IERC20 { /// from. function convertToShares(uint256 assets) external view returns (uint256 shares); - /// @notice Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal - /// scenario where all the conditions are met. + /// @notice Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an + /// ideal scenario where all the conditions are met. /// @dev /// - MUST NOT be inclusive of any fees that are charged against assets in the Vault. /// - MUST NOT show any variations depending on the caller. @@ -51,16 +57,16 @@ interface IERC4626 is IERC20 { /// from. function convertToAssets(uint256 shares) external view returns (uint256 assets); - /// @notice Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver, - /// through a deposit call. + /// @notice Returns the maximum amount of the underlying asset that can be deposited into the Vault for the + /// receiver, through a deposit call. /// @dev /// - MUST return a limited value if receiver is subject to some deposit limit. /// - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited. /// - MUST NOT revert. function maxDeposit(address receiver) external view returns (uint256 maxAssets); - /// @notice Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given - /// current on-chain conditions. + /// @notice Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, + /// given current on-chain conditions. /// @dev /// - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit /// call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called diff --git a/src/interfaces/IERC6909.sol b/src/interfaces/IERC6909.sol index 6e11cb460..ef58762ca 100644 --- a/src/interfaces/IERC6909.sol +++ b/src/interfaces/IERC6909.sol @@ -3,70 +3,70 @@ pragma solidity >=0.6.2; import {IERC165} from "./IERC165.sol"; -/// @dev Required interface of an ERC-6909 compliant contract, as defined in -/// https://eips.ethereum.org/EIPS/eip-6909 +/// @title ERC-6909: Minimal Multi-Token Interface +/// @dev SEE: https://eips.ethereum.org/EIPS/eip-6909 interface IERC6909 is IERC165 { - /// @dev Emitted when the allowance of a `spender` for an `owner` is set for a token of type `id`. + /// @notice Emitted when the allowance of a `spender` for an `owner` is set for a token of type `id`. event Approval(address indexed owner, address indexed spender, uint256 indexed id, uint256 amount); - /// @dev Emitted when `owner` grants or revokes operator status for a `spender`. + /// @notice Emitted when `owner` grants or revokes operator status for a `spender`. event OperatorSet(address indexed owner, address indexed spender, bool approved); - /// @dev Emitted when `amount` tokens of type `id` are moved from `sender` to `receiver` initiated by `caller`. + /// @notice Emitted when `amount` tokens of type `id` are moved from `sender` to `receiver` initiated by `caller`. event Transfer( address caller, address indexed sender, address indexed receiver, uint256 indexed id, uint256 amount ); - ///@dev Returns the amount of tokens of type `id` owned by `owner`. + /// @notice Returns the amount of tokens of type `id` owned by `owner`. function balanceOf(address owner, uint256 id) external view returns (uint256); - /// @dev Returns the amount of tokens of type `id` that `spender` is allowed to spend on behalf of `owner`. + /// @notice Returns the amount of tokens of type `id` that `spender` is allowed to spend on behalf of `owner`. /// NOTE: Does not include operator allowances. function allowance(address owner, address spender, uint256 id) external view returns (uint256); - /// @dev Returns true if `spender` is set as an operator for `owner`. + /// @notice Returns true if `spender` is set as an operator for `owner`. function isOperator(address owner, address spender) external view returns (bool); - /// @dev Sets an approval to `spender` for `amount` tokens of type `id` from the caller's tokens. + /// @notice Sets an approval to `spender` for `amount` tokens of type `id` from the caller's tokens. /// Must return true. function approve(address spender, uint256 id, uint256 amount) external returns (bool); - /// @dev Grants or revokes unlimited transfer permission of any token id to `spender` for the caller's tokens. + /// @notice Grants or revokes unlimited transfer permission of any token id to `spender` for the caller's tokens. /// Must return true. function setOperator(address spender, bool approved) external returns (bool); - /// @dev Transfers `amount` of token type `id` from the caller's account to `receiver`. + /// @notice Transfers `amount` of token type `id` from the caller's account to `receiver`. /// Must return true. function transfer(address receiver, uint256 id, uint256 amount) external returns (bool); - /// @dev Transfers `amount` of token type `id` from `sender` to `receiver`. + /// @notice Transfers `amount` of token type `id` from `sender` to `receiver`. /// Must return true. function transferFrom(address sender, address receiver, uint256 id, uint256 amount) external returns (bool); } /// @dev Optional extension of {IERC6909} that adds metadata functions. interface IERC6909Metadata is IERC6909 { - /// @dev Returns the name of the token of type `id`. + /// @notice Returns the name of the token of type `id`. function name(uint256 id) external view returns (string memory); - /// @dev Returns the ticker symbol of the token of type `id`. + /// @notice Returns the ticker symbol of the token of type `id`. function symbol(uint256 id) external view returns (string memory); - /// @dev Returns the number of decimals for the token of type `id`. + /// @notice Returns the number of decimals for the token of type `id`. function decimals(uint256 id) external view returns (uint8); } /// @dev Optional extension of {IERC6909} that adds content URI functions. interface IERC6909ContentURI is IERC6909 { - /// @dev Returns URI for the contract. + /// @notice Returns URI for the contract. function contractURI() external view returns (string memory); - /// @dev Returns the URI for the token of type `id`. + /// @notice Returns the URI for the token of type `id`. function tokenURI(uint256 id) external view returns (string memory); } /// @dev Optional extension of {IERC6909} that adds a token supply function. interface IERC6909TokenSupply is IERC6909 { - /// @dev Returns the total supply of the token of type `id`. + /// @notice Returns the total supply of the token of type `id`. function totalSupply(uint256 id) external view returns (uint256); } diff --git a/src/interfaces/IERC721.sol b/src/interfaces/IERC721.sol index 21a4a94de..e6508c5da 100644 --- a/src/interfaces/IERC721.sol +++ b/src/interfaces/IERC721.sol @@ -3,118 +3,118 @@ pragma solidity >=0.6.2; import {IERC165} from "./IERC165.sol"; -/// @title ERC-721 Non-Fungible Token Standard -/// @dev See https://eips.ethereum.org/EIPS/eip-721 -/// Note: the ERC-165 identifier for this interface is 0x80ac58cd. +/// @title ERC-721: Non-Fungible Token Standard +/// @dev SEE: https://eips.ethereum.org/EIPS/eip-721 +/// NOTE: the ERC-165 identifier for this interface is 0x80ac58cd. interface IERC721 is IERC165 { - /// @dev This emits when ownership of any NFT changes by any mechanism. - /// This event emits when NFTs are created (`from` == 0) and destroyed - /// (`to` == 0). Exception: during contract creation, any number of NFTs - /// may be created and assigned without emitting Transfer. At the time of - /// any transfer, the approved address for that NFT (if any) is reset to none. + /// @notice Emitted when ownership of an NFT changes by any mechanism. + /// @dev This event is emitted when NFTs are created (`from == address(0)`) and destroyed (`to == address(0)`). + /// During contract creation, multiple NFTs may be assigned without emitting `Transfer`. + /// When a transfer occurs, the approved address for that NFT (if any) is reset to `address(0)`. event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId); - /// @dev This emits when the approved address for an NFT is changed or - /// reaffirmed. The zero address indicates there is no approved address. - /// When a Transfer event emits, this also indicates that the approved - /// address for that NFT (if any) is reset to none. + /// @notice Emitted when the approved address for an NFT is changed or reaffirmed. + /// @dev The zero address (`address(0)`) indicates there is no approved address. + /// When a `Transfer` event is emitted, this also resets the approved address for that NFT (if any) to `address(0)`. event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId); - /// @dev This emits when an operator is enabled or disabled for an owner. - /// The operator can manage all NFTs of the owner. + /// @notice Emitted when an operator is enabled or disabled for an owner. + /// @dev The operator is granted permission to manage all NFTs of the owner. event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); - /// @notice Count all NFTs assigned to an owner + /// @notice Count all NFTs assigned to an owner. + /// @param _owner An address for whom to query the balance. + /// @return The number of NFTs owned by `_owner`, possibly zero. /// @dev NFTs assigned to the zero address are considered invalid, and this /// function throws for queries about the zero address. - /// @param _owner An address for whom to query the balance - /// @return The number of NFTs owned by `_owner`, possibly zero function balanceOf(address _owner) external view returns (uint256); - /// @notice Find the owner of an NFT + /// @notice Find the owner of an NFT. + /// @param _tokenId The identifier for an NFT. + /// @return The address of the owner of the NFT. /// @dev NFTs assigned to zero address are considered invalid, and queries /// about them do throw. - /// @param _tokenId The identifier for an NFT - /// @return The address of the owner of the NFT function ownerOf(uint256 _tokenId) external view returns (address); - /// @notice Transfers the ownership of an NFT from one address to another address - /// @dev Throws unless `msg.sender` is the current owner, an authorized - /// operator, or the approved address for this NFT. Throws if `_from` is - /// not the current owner. Throws if `_to` is the zero address. Throws if - /// `_tokenId` is not a valid NFT. When transfer is complete, this function + /// @notice Transfers the ownership of an NFT from one address to another address. + /// @param _from The current owner of the NFT. + /// @param _to The new owner. + /// @param _tokenId The NFT to transfer. + /// @param data Additional data with no specified format, sent in call to `_to`. + /// @dev + /// - Throws unless `msg.sender` is the current owner, an authorized + /// operator, or the approved address for this NFT. + /// - Throws if `_from` is not the current owner. + /// - Throws if `_to` is the zero address. + /// - Throws if `_tokenId` is not a valid NFT. + /// When transfer is complete, this function /// checks if `_to` is a smart contract (code size > 0). If so, it calls /// `onERC721Received` on `_to` and throws if the return value is not /// `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`. - /// @param _from The current owner of the NFT - /// @param _to The new owner - /// @param _tokenId The NFT to transfer - /// @param data Additional data with no specified format, sent in call to `_to` function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata data) external payable; - /// @notice Transfers the ownership of an NFT from one address to another address + /// @notice Transfers the ownership of an NFT from one address to another address. + /// @param _from The current owner of the NFT. + /// @param _to The new owner. + /// @param _tokenId The NFT to transfer. /// @dev This works identically to the other function with an extra data parameter, /// except this function just sets data to "". - /// @param _from The current owner of the NFT - /// @param _to The new owner - /// @param _tokenId The NFT to transfer function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable; /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE - /// THEY MAY BE PERMANENTLY LOST - /// @dev Throws unless `msg.sender` is the current owner, an authorized - /// operator, or the approved address for this NFT. Throws if `_from` is - /// not the current owner. Throws if `_to` is the zero address. Throws if - /// `_tokenId` is not a valid NFT. - /// @param _from The current owner of the NFT - /// @param _to The new owner - /// @param _tokenId The NFT to transfer + /// THEY MAY BE PERMANENTLY LOST. + /// @param _from The current owner of the NFT. + /// @param _to The new owner. + /// @param _tokenId The NFT to transfer. + /// @dev + /// - Throws unless `msg.sender` is the current owner, an authorized + /// operator, or the approved address for this NFT. + /// - Throws if `_from` is not the current owner. + /// - Throws if `_to` is the zero address. + /// - Throws if `_tokenId` is not a valid NFT. function transferFrom(address _from, address _to, uint256 _tokenId) external payable; - /// @notice Change or reaffirm the approved address for an NFT - /// @dev The zero address indicates there is no approved address. - /// Throws unless `msg.sender` is the current NFT owner, or an authorized - /// operator of the current owner. - /// @param _approved The new approved NFT controller - /// @param _tokenId The NFT to approve + /// @notice Change or reaffirm the approved address for an NFT. + /// @param _approved The new approved NFT controller. + /// @param _tokenId The NFT to approve. + /// @dev + /// - The zero address indicates there is no approved address. + /// - Throws unless `msg.sender` is the current NFT owner, or an authorized operator of the current owner. function approve(address _approved, uint256 _tokenId) external payable; - /// @notice Enable or disable approval for a third party ("operator") to manage - /// all of `msg.sender`'s assets - /// @dev Emits the ApprovalForAll event. The contract MUST allow - /// multiple operators per owner. - /// @param _operator Address to add to the set of authorized operators - /// @param _approved True if the operator is approved, false to revoke approval + /// @notice Enable or disable approval for a third party ("operator") to manage all of `msg.sender`'s assets. + /// @param _operator Address to add to the set of authorized operators. + /// @param _approved True if the operator is approved, false to revoke approval. + /// @dev Emits the ApprovalForAll event. The contract MUST allow multiple operators per owner. function setApprovalForAll(address _operator, bool _approved) external; - /// @notice Get the approved address for a single NFT + /// @notice Get the approved address for a single NFT. + /// @param _tokenId The NFT to find the approved address for. + /// @return The approved address for this NFT, or the zero address if there is none. /// @dev Throws if `_tokenId` is not a valid NFT. - /// @param _tokenId The NFT to find the approved address for - /// @return The approved address for this NFT, or the zero address if there is none function getApproved(uint256 _tokenId) external view returns (address); - /// @notice Query if an address is an authorized operator for another address - /// @param _owner The address that owns the NFTs - /// @param _operator The address that acts on behalf of the owner - /// @return True if `_operator` is an approved operator for `_owner`, false otherwise + /// @notice Query if an address is an authorized operator for another address. + /// @param _owner The address that owns the NFTs. + /// @param _operator The address that acts on behalf of the owner. + /// @return True if `_operator` is an approved operator for `_owner`, false otherwise. function isApprovedForAll(address _owner, address _operator) external view returns (bool); } /// @dev Note: the ERC-165 identifier for this interface is 0x150b7a02. interface IERC721TokenReceiver { /// @notice Handle the receipt of an NFT + /// @param _operator The address which called `safeTransferFrom` function. + /// @param _from The address which previously owned the token. + /// @param _tokenId The NFT identifier which is being transferred. + /// @param _data Additional data with no specified format. + /// @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` unless throwing. /// @dev The ERC721 smart contract calls this function on the recipient /// after a `transfer`. This function MAY throw to revert and reject the /// transfer. Return of other than the magic value MUST result in the /// transaction being reverted. - /// Note: the contract address is always the message sender. - /// @param _operator The address which called `safeTransferFrom` function - /// @param _from The address which previously owned the token - /// @param _tokenId The NFT identifier which is being transferred - /// @param _data Additional data with no specified format - /// @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` - /// unless throwing + /// NOTE: the contract address is always the message sender. function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) external returns (bytes4); @@ -122,12 +122,12 @@ interface IERC721TokenReceiver { /// @title ERC-721 Non-Fungible Token Standard, optional metadata extension /// @dev See https://eips.ethereum.org/EIPS/eip-721 -/// Note: the ERC-165 identifier for this interface is 0x5b5e139f. +/// NOTE: the ERC-165 identifier for this interface is 0x5b5e139f. interface IERC721Metadata is IERC721 { - /// @notice A descriptive name for a collection of NFTs in this contract + /// @notice A descriptive name for a collection of NFTs in this contract. function name() external view returns (string memory _name); - /// @notice An abbreviated name for NFTs in this contract + /// @notice An abbreviated name for NFTs in this contract. function symbol() external view returns (string memory _symbol); /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. @@ -139,26 +139,23 @@ interface IERC721Metadata is IERC721 { /// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension /// @dev See https://eips.ethereum.org/EIPS/eip-721 -/// Note: the ERC-165 identifier for this interface is 0x780e9d63. +/// NOTE: the ERC-165 identifier for this interface is 0x780e9d63. interface IERC721Enumerable is IERC721 { - /// @notice Count NFTs tracked by this contract + /// @notice Count NFTs tracked by this contract. /// @return A count of valid NFTs tracked by this contract, where each one of - /// them has an assigned and queryable owner not equal to the zero address + /// them has an assigned and queryable owner not equal to the zero address. function totalSupply() external view returns (uint256); - /// @notice Enumerate valid NFTs + /// @notice Enumerate valid NFTs. + /// @param _index A counter less than `totalSupply()`. + /// @return The token identifier for the `_index`th NFT, (sort order not specified). /// @dev Throws if `_index` >= `totalSupply()`. - /// @param _index A counter less than `totalSupply()` - /// @return The token identifier for the `_index`th NFT, - /// (sort order not specified) function tokenByIndex(uint256 _index) external view returns (uint256); - /// @notice Enumerate NFTs assigned to an owner - /// @dev Throws if `_index` >= `balanceOf(_owner)` or if - /// `_owner` is the zero address, representing invalid NFTs. - /// @param _owner An address where we are interested in NFTs owned by them - /// @param _index A counter less than `balanceOf(_owner)` - /// @return The token identifier for the `_index`th NFT assigned to `_owner`, - /// (sort order not specified) + /// @notice Enumerate NFTs assigned to an owner. + /// @param _owner An address where we are interested in NFTs owned by them. + /// @param _index A counter less than `balanceOf(_owner)`. + /// @return The token identifier for the `_index`th NFT assigned to `_owner` (sort order not specified) + /// @dev Throws if `_index` >= `balanceOf(_owner)` or if `_owner` is the zero address, representing invalid NFTs. function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256); } diff --git a/src/interfaces/IERC7540.sol b/src/interfaces/IERC7540.sol index 91a38ca35..24832df40 100644 --- a/src/interfaces/IERC7540.sol +++ b/src/interfaces/IERC7540.sol @@ -6,31 +6,22 @@ import {IERC7575} from "./IERC7575.sol"; /// @dev Interface of the base operator logic of ERC7540, as defined in /// https://eips.ethereum.org/EIPS/eip-7540 interface IERC7540Operator { - /** - * @dev The event emitted when an operator is set. - * - * @param controller The address of the controller. - * @param operator The address of the operator. - * @param approved The approval status. - */ + /// @notice The event emitted when an operator is set. + /// @param controller The address of the controller. + /// @param operator The address of the operator. + /// @param approved The approval status. event OperatorSet(address indexed controller, address indexed operator, bool approved); - /** - * @dev Sets or removes an operator for the caller. - * - * @param operator The address of the operator. - * @param approved The approval status. - * @return Whether the call was executed successfully or not - */ + /// @notice Sets or removes an operator for the caller. + /// @param operator The address of the operator. + /// @param approved The approval status. + /// @return Whether the call was executed successfully or not. function setOperator(address operator, bool approved) external returns (bool); - /** - * @dev Returns `true` if the `operator` is approved as an operator for an `controller`. - * - * @param controller The address of the controller. - * @param operator The address of the operator. - * @return status The approval status - */ + /// @notice Returns `true` if the `operator` is approved as an operator for an `controller`. + /// @param controller The address of the controller. + /// @param operator The address of the operator. + /// @return status The approval status. function isOperator(address controller, address operator) external view returns (bool status); } @@ -40,61 +31,49 @@ interface IERC7540Deposit is IERC7540Operator { event DepositRequest( address indexed controller, address indexed owner, uint256 indexed requestId, address sender, uint256 assets ); - /** - * @dev Transfers assets from sender into the Vault and submits a Request for asynchronous deposit. - * - * - MUST support ERC-20 approve / transferFrom on asset as a deposit Request flow. - * - MUST revert if all of assets cannot be requested for deposit. - * - owner MUST be msg.sender unless some unspecified explicit approval is given by the caller, - * approval of ERC-20 tokens from owner to sender is NOT enough. - * - * @param assets the amount of deposit assets to transfer from owner - * @param controller the controller of the request who will be able to operate the request - * @param owner the source of the deposit assets - * - * NOTE: most implementations will require pre-approval of the Vault with the Vault's underlying asset token. - */ + /// @notice Transfers assets from sender into the Vault and submits a Request for asynchronous deposit. + /// @param assets the amount of deposit assets to transfer from owner + /// @param controller the controller of the request who will be able to operate the request + /// @param owner the source of the deposit assets + /// @dev + /// - MUST support ERC-20 approve / transferFrom on asset as a deposit Request flow. + /// - MUST revert if all of assets cannot be requested for deposit. + /// - owner MUST be msg.sender unless some unspecified explicit approval is given by the caller, + /// approval of ERC-20 tokens from owner to sender is NOT enough. + /// NOTE: most implementations will require pre-approval of the Vault with the Vault's underlying asset token. function requestDeposit(uint256 assets, address controller, address owner) external returns (uint256 requestId); - /** - * @dev Returns the amount of requested assets in Pending state. - * - * - MUST NOT include any assets in Claimable state for deposit or mint. - * - MUST NOT show any variations depending on the caller. - * - MUST NOT revert unless due to integer overflow caused by an unreasonably large input. - */ + /// @notice Returns the amount of requested assets in Pending state. + /// @dev + /// - MUST NOT include any assets in Claimable state for deposit or mint. + /// - MUST NOT show any variations depending on the caller. + /// - MUST NOT revert unless due to integer overflow caused by an unreasonably large input. function pendingDepositRequest(uint256 requestId, address controller) external view returns (uint256 pendingAssets); - /** - * @dev Returns the amount of requested assets in Claimable state for the controller to deposit or mint. - * - * - MUST NOT include any assets in Pending state. - * - MUST NOT show any variations depending on the caller. - * - MUST NOT revert unless due to integer overflow caused by an unreasonably large input. - */ + /// @notice Returns the amount of requested assets in Claimable state for the controller to deposit or mint. + /// @dev + /// - MUST NOT include any assets in Pending state. + /// - MUST NOT show any variations depending on the caller. + /// - MUST NOT revert unless due to integer overflow caused by an unreasonably large input. function claimableDepositRequest(uint256 requestId, address controller) external view returns (uint256 claimableAssets); - /** - * @dev Mints shares Vault shares to receiver by claiming the Request of the controller. - * - * - MUST emit the Deposit event. - * - controller MUST equal msg.sender unless the controller has approved the msg.sender as an operator. - */ + /// @notice Mints shares Vault shares to receiver by claiming the Request of the controller. + /// @dev + /// - MUST emit the Deposit event. + /// - controller MUST equal msg.sender unless the controller has approved the msg.sender as an operator. function deposit(uint256 assets, address receiver, address controller) external returns (uint256 shares); - /** - * @dev Mints exactly shares Vault shares to receiver by claiming the Request of the controller. - * - * - MUST emit the Deposit event. - * - controller MUST equal msg.sender unless the controller has approved the msg.sender as an operator. - */ + /// @notice Mints exactly shares Vault shares to receiver by claiming the Request of the controller. + /// @dev + /// - MUST emit the Deposit event. + /// - controller MUST equal msg.sender unless the controller has approved the msg.sender as an operator. function mint(uint256 shares, address receiver, address controller) external returns (uint256 assets); } @@ -105,46 +84,38 @@ interface IERC7540Redeem is IERC7540Operator { address indexed controller, address indexed owner, uint256 indexed requestId, address sender, uint256 assets ); - /** - * @dev Assumes control of shares from sender into the Vault and submits a Request for asynchronous redeem. - * - * - MUST support a redeem Request flow where the control of shares is taken from sender directly - * where msg.sender has ERC-20 approval over the shares of owner. - * - MUST revert if all of shares cannot be requested for redeem. - * - * @param shares the amount of shares to be redeemed to transfer from owner - * @param controller the controller of the request who will be able to operate the request - * @param owner the source of the shares to be redeemed - * - * NOTE: most implementations will require pre-approval of the Vault with the Vault's share token. - */ + /// @notice Assumes control of shares from sender into the Vault and submits a Request for asynchronous redeem. + /// @param shares the amount of shares to be redeemed to transfer from owner + /// @param controller the controller of the request who will be able to operate the request + /// @param owner the source of the shares to be redeemed + /// @dev + /// - MUST support a redeem Request flow where the control of shares is taken from sender directly + /// where msg.sender has ERC-20 approval over the shares of owner. + /// - MUST revert if all of shares cannot be requested for redeem. + /// NOTE: most implementations will require pre-approval of the Vault with the Vault's share token. function requestRedeem(uint256 shares, address controller, address owner) external returns (uint256 requestId); - /** - * @dev Returns the amount of requested shares in Pending state. - * - * - MUST NOT include any shares in Claimable state for redeem or withdraw. - * - MUST NOT show any variations depending on the caller. - * - MUST NOT revert unless due to integer overflow caused by an unreasonably large input. - */ + /// @notice Returns the amount of requested shares in Pending state. + /// @dev + /// - MUST NOT include any shares in Claimable state for redeem or withdraw. + /// - MUST NOT show any variations depending on the caller. + /// - MUST NOT revert unless due to integer overflow caused by an unreasonably large input. function pendingRedeemRequest(uint256 requestId, address controller) external view returns (uint256 pendingShares); - /** - * @dev Returns the amount of requested shares in Claimable state for the controller to redeem or withdraw. - * - * - MUST NOT include any shares in Pending state for redeem or withdraw. - * - MUST NOT show any variations depending on the caller. - * - MUST NOT revert unless due to integer overflow caused by an unreasonably large input. - */ + /// @notice Returns the amount of requested shares in Claimable state for the controller to redeem or withdraw. + /// @dev + /// - MUST NOT include any shares in Pending state for redeem or withdraw. + /// - MUST NOT show any variations depending on the caller. + /// - MUST NOT revert unless due to integer overflow caused by an unreasonably large input. function claimableRedeemRequest(uint256 requestId, address controller) external view returns (uint256 claimableShares); } -/// @dev Interface of the fully asynchronous Vault interface of ERC7540, as defined in -/// https://eips.ethereum.org/EIPS/eip-7540 +/// @title ERC-7540: Asynchronous ERC-4626 Tokenized Vaults +/// @dev SEE: https://eips.ethereum.org/EIPS/eip-7540 interface IERC7540 is IERC7540Deposit, IERC7540Redeem, IERC7575 {} diff --git a/src/interfaces/IERC7575.sol b/src/interfaces/IERC7575.sol index 207e3e7fe..0c8a9f505 100644 --- a/src/interfaces/IERC7575.sol +++ b/src/interfaces/IERC7575.sol @@ -3,239 +3,206 @@ pragma solidity >=0.6.2; import {IERC165} from "./IERC165.sol"; -/// @dev Interface of the ERC7575 "Multi-Asset ERC-4626 Vaults", as defined in -/// https://eips.ethereum.org/EIPS/eip-7575 +/// @title ERC-7575: Multi-Asset ERC-4626 Vaults +/// @dev SEE: https://eips.ethereum.org/EIPS/eip-7575 interface IERC7575 is IERC165 { event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares); + event Withdraw( address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares ); - /** - * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing. - * - * - MUST be an ERC-20 token contract. - * - MUST NOT revert. - */ + /// @notice Returns the address of the underlying token used for the Vault for accounting, depositing, and + /// withdrawing. + /// @dev + /// - MUST be an ERC-20 token contract. + /// - MUST NOT revert. function asset() external view returns (address assetTokenAddress); - /** - * @dev Returns the address of the share token - * - * - MUST be an ERC-20 token contract. - * - MUST NOT revert. - */ + /// @notice Returns the address of the share token + /// @dev + /// - MUST be an ERC-20 token contract. + /// - MUST NOT revert. function share() external view returns (address shareTokenAddress); - /** - * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal - * scenario where all the conditions are met. - * - * - MUST NOT be inclusive of any fees that are charged against assets in the Vault. - * - MUST NOT show any variations depending on the caller. - * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. - * - MUST NOT revert. - * - * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the - * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and - * from. - */ + /// @notice Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an + /// ideal scenario where all the conditions are met. + /// @dev + /// - MUST NOT be inclusive of any fees that are charged against assets in the Vault. + /// - MUST NOT show any variations depending on the caller. + /// - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. + /// - MUST NOT revert. + /// + /// NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the + /// “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and + /// from. function convertToShares(uint256 assets) external view returns (uint256 shares); - /** - * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal - * scenario where all the conditions are met. - * - * - MUST NOT be inclusive of any fees that are charged against assets in the Vault. - * - MUST NOT show any variations depending on the caller. - * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. - * - MUST NOT revert. - * - * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the - * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and - * from. - */ + /// @notice Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an + /// ideal scenario where all the conditions are met. + /// @dev + /// - MUST NOT be inclusive of any fees that are charged against assets in the Vault. + /// - MUST NOT show any variations depending on the caller. + /// - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. + /// - MUST NOT revert. + /// + /// NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the + /// “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and + /// from. function convertToAssets(uint256 shares) external view returns (uint256 assets); - /** - * @dev Returns the total amount of the underlying asset that is “managed” by Vault. - * - * - SHOULD include any compounding that occurs from yield. - * - MUST be inclusive of any fees that are charged against assets in the Vault. - * - MUST NOT revert. - */ + /// @notice Returns the total amount of the underlying asset that is “managed” by Vault. + /// @dev + /// - SHOULD include any compounding that occurs from yield. + /// - MUST be inclusive of any fees that are charged against assets in the Vault. + /// - MUST NOT revert. function totalAssets() external view returns (uint256 totalManagedAssets); - /** - * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver, - * through a deposit call. - * - * - MUST return a limited value if receiver is subject to some deposit limit. - * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited. - * - MUST NOT revert. - */ + /// @notice Returns the maximum amount of the underlying asset that can be deposited into the Vault for the + /// receiver, through a deposit call. + /// @dev + /// - MUST return a limited value if receiver is subject to some deposit limit. + /// - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited. + /// - MUST NOT revert. function maxDeposit(address receiver) external view returns (uint256 maxAssets); - /** - * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given - * current on-chain conditions. - * - * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit - * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called - * in the same transaction. - * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the - * deposit would be accepted, regardless if the user has enough tokens approved, etc. - * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. - * - MUST NOT revert. - * - * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in - * share price or some other type of condition, meaning the depositor will lose assets by depositing. - */ + /// @notice Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, + /// given current on-chain conditions. + /// @dev + /// - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit + /// call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called + /// in the same transaction. + /// - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the + /// deposit would be accepted, regardless if the user has enough tokens approved, etc. + /// - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. + /// - MUST NOT revert. + /// + /// NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in + /// share price or some other type of condition, meaning the depositor will lose assets by depositing. function previewDeposit(uint256 assets) external view returns (uint256 shares); - /** - * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens. - * - * - MUST emit the Deposit event. - * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the - * deposit execution, and are accounted for during deposit. - * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not - * approving enough underlying tokens to the Vault contract, etc). - * - * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. - */ + /// @notice Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens. + /// @dev + /// - MUST emit the Deposit event. + /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the + /// deposit execution, and are accounted for during deposit. + /// - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not + /// approving enough underlying tokens to the Vault contract, etc). + /// + /// NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. function deposit(uint256 assets, address receiver) external returns (uint256 shares); - /** - * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call. - * - MUST return a limited value if receiver is subject to some mint limit. - * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted. - * - MUST NOT revert. - */ + /// @notice Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call. + /// @dev + /// - MUST return a limited value if receiver is subject to some mint limit. + /// - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted. + /// - MUST NOT revert. function maxMint(address receiver) external view returns (uint256 maxShares); - /** - * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given - * current on-chain conditions. - * - * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call - * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the - * same transaction. - * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint - * would be accepted, regardless if the user has enough tokens approved, etc. - * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. - * - MUST NOT revert. - * - * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in - * share price or some other type of condition, meaning the depositor will lose assets by minting. - */ + /// @notice Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given + /// current on-chain conditions. + /// @dev + /// - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call + /// in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the + /// same transaction. + /// - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint + /// would be accepted, regardless if the user has enough tokens approved, etc. + /// - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. + /// - MUST NOT revert. + /// + /// NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in + /// share price or some other type of condition, meaning the depositor will lose assets by minting. function previewMint(uint256 shares) external view returns (uint256 assets); - /** - * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens. - * - * - MUST emit the Deposit event. - * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint - * execution, and are accounted for during mint. - * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not - * approving enough underlying tokens to the Vault contract, etc). - * - * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. - */ + /// @notice Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens. + /// @dev + /// - MUST emit the Deposit event. + /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint + /// execution, and are accounted for during mint. + /// - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not + /// approving enough underlying tokens to the Vault contract, etc). + /// + /// NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. function mint(uint256 shares, address receiver) external returns (uint256 assets); - /** - * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the - * Vault, through a withdraw call. - * - * - MUST return a limited value if owner is subject to some withdrawal limit or timelock. - * - MUST NOT revert. - */ + /// @notice Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the + /// Vault, through a withdraw call. + /// @dev + /// - MUST return a limited value if owner is subject to some withdrawal limit or timelock. + /// - MUST NOT revert. function maxWithdraw(address owner) external view returns (uint256 maxAssets); - /** - * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block, - * given current on-chain conditions. - * - * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw - * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if - * called - * in the same transaction. - * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though - * the withdrawal would be accepted, regardless if the user has enough shares, etc. - * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. - * - MUST NOT revert. - * - * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in - * share price or some other type of condition, meaning the depositor will lose assets by depositing. - */ + /// @notice Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block, + /// given current on-chain conditions. + /// @dev + /// - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw + /// call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if + /// called + /// in the same transaction. + /// - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though + /// the withdrawal would be accepted, regardless if the user has enough shares, etc. + /// - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. + /// - MUST NOT revert. + /// + /// NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in + /// share price or some other type of condition, meaning the depositor will lose assets by depositing. function previewWithdraw(uint256 assets) external view returns (uint256 shares); - /** - * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver. - * - * - MUST emit the Withdraw event. - * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the - * withdraw execution, and are accounted for during withdraw. - * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner - * not having enough shares, etc). - * - * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed. - * Those methods should be performed separately. - */ + /// @notice Burns shares from owner and sends exactly assets of underlying tokens to receiver. + /// @dev + /// - MUST emit the Withdraw event. + /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the + /// withdraw execution, and are accounted for during withdraw. + /// - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner + /// not having enough shares, etc). + /// + /// Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed. + /// Those methods should be performed separately. function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares); - /** - * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault, - * through a redeem call. - * - * - MUST return a limited value if owner is subject to some withdrawal limit or timelock. - * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock. - * - MUST NOT revert. - */ + /// @notice Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault, + /// through a redeem call. + /// @dev + /// - MUST return a limited value if owner is subject to some withdrawal limit or timelock. + /// - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock. + /// - MUST NOT revert. function maxRedeem(address owner) external view returns (uint256 maxShares); - /** - * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block, - * given current on-chain conditions. - * - * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call - * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the - * same transaction. - * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the - * redemption would be accepted, regardless if the user has enough shares, etc. - * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. - * - MUST NOT revert. - * - * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in - * share price or some other type of condition, meaning the depositor will lose assets by redeeming. - */ + /// @notice Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block, + /// given current on-chain conditions. + /// @dev + /// - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call + /// in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the + /// same transaction. + /// - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the + /// redemption would be accepted, regardless if the user has enough shares, etc. + /// - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. + /// - MUST NOT revert. + /// + /// NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in + /// share price or some other type of condition, meaning the depositor will lose assets by redeeming. function previewRedeem(uint256 shares) external view returns (uint256 assets); - /** - * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver. - * - * - MUST emit the Withdraw event. - * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the - * redeem execution, and are accounted for during redeem. - * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner - * not having enough shares, etc). - * - * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed. - * Those methods should be performed separately. - */ + /// @notice Burns exactly shares from owner and sends assets of underlying tokens to receiver. + /// @dev + /// - MUST emit the Withdraw event. + /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the + /// redeem execution, and are accounted for during redeem. + /// - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner + /// not having enough shares, etc). + /// + /// NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed. + /// Those methods should be performed separately. function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets); } -/// @dev Interface of the ERC20 share token, as defined in -/// https://eips.ethereum.org/EIPS/eip-7575 +/// @title ERC-7575: Multi-Asset ERC-4626 Vaults Share +/// @dev SEE: https://eips.ethereum.org/EIPS/eip-7575 interface IERC7575Share is IERC165 { event VaultUpdate(address indexed asset, address vault); - /** - * @dev Returns the address of the Vault for the given asset. - * - * @param asset the ERC-20 token to deposit with into the Vault - */ + /// @notice Returns the address of the Vault for the given asset. + /// + /// @param asset the ERC-20 token to deposit with into the Vault function vault(address asset) external view returns (address); } diff --git a/src/interfaces/IMulticall3.sol b/src/interfaces/IMulticall3.sol index 0d031b71d..036a072bb 100644 --- a/src/interfaces/IMulticall3.sol +++ b/src/interfaces/IMulticall3.sol @@ -3,6 +3,8 @@ pragma solidity >=0.6.2 <0.9.0; pragma experimental ABIEncoderV2; +/// @title Multicall3 +/// @dev SEE: https://github.com/mds1/multicall3/blob/main/src/Multicall3.sol interface IMulticall3 { struct Call { address target; @@ -27,45 +29,85 @@ interface IMulticall3 { bytes returnData; } + /// @notice Backwards-compatible call aggregation with Multicall. + /// @param calls An array of Call structs. + /// @return blockNumber The block number where the calls were executed. + /// @return returnData An array of bytes containing the responses. function aggregate(Call[] calldata calls) external payable returns (uint256 blockNumber, bytes[] memory returnData); + /// @notice Aggregate calls, ensuring each returns success if required. + /// @param calls An array of Call3 structs. + /// @return returnData An array of Result structs. function aggregate3(Call3[] calldata calls) external payable returns (Result[] memory returnData); + /// @notice Aggregate calls with a msg value. + /// @notice Reverts if msg.value is less than the sum of the call values. + /// @param calls An array of Call3Value structs. + /// @return returnData An array of Result structs. function aggregate3Value(Call3Value[] calldata calls) external payable returns (Result[] memory returnData); + /// @notice Backwards-compatible with Multicall2. + /// @notice Aggregate calls and allow failures using tryAggregate. + /// @param calls An array of Call structs. + /// @return blockNumber The block number where the calls were executed. + /// @return blockHash The hash of the block where the calls were executed. + /// @return returnData An array of Result structs. function blockAndAggregate(Call[] calldata calls) external payable returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData); + /// @notice Gets the base fee of the given block. + /// @notice Can revert if the BASEFEE opcode is not implemented by the given chain. function getBasefee() external view returns (uint256 basefee); + /// @notice Returns the block hash for the given block number. + /// @param blockNumber The block number. function getBlockHash(uint256 blockNumber) external view returns (bytes32 blockHash); + /// @notice Returns the block number. function getBlockNumber() external view returns (uint256 blockNumber); + /// @notice Returns the chain id. function getChainId() external view returns (uint256 chainid); + /// @notice Returns the block coinbase. function getCurrentBlockCoinbase() external view returns (address coinbase); + /// @notice Returns the block difficulty. function getCurrentBlockDifficulty() external view returns (uint256 difficulty); + /// @notice Returns the block gas limit. function getCurrentBlockGasLimit() external view returns (uint256 gaslimit); + /// @notice Returns the block timestamp. function getCurrentBlockTimestamp() external view returns (uint256 timestamp); + /// @notice Returns the (ETH) balance of a given address. function getEthBalance(address addr) external view returns (uint256 balance); + /// @notice Returns the block hash of the last block. function getLastBlockHash() external view returns (bytes32 blockHash); + /// @notice Backwards-compatible with Multicall2. + /// @notice Aggregate calls without requiring success. + /// @param requireSuccess If true, require all calls to succeed. + /// @param calls An array of Call structs. + /// @return returnData An array of Result structs. function tryAggregate(bool requireSuccess, Call[] calldata calls) external payable returns (Result[] memory returnData); + /// @notice Backwards-compatible with Multicall2. + /// @notice Aggregate calls and allow failures using tryAggregate. + /// @param calls An array of Call structs. + /// @return blockNumber The block number where the calls were executed. + /// @return blockHash The hash of the block where the calls were executed. + /// @return returnData An array of Result structs. function tryBlockAndAggregate(bool requireSuccess, Call[] calldata calls) external payable From 68745443ab7b6332a0e1001cdf2ec8017d0d6125 Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Mon, 3 Mar 2025 10:52:15 +0100 Subject: [PATCH 2/3] clean up --- src/interfaces/IERC1155.sol | 60 +++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/src/interfaces/IERC1155.sol b/src/interfaces/IERC1155.sol index c25b06b76..2013c0cbb 100644 --- a/src/interfaces/IERC1155.sol +++ b/src/interfaces/IERC1155.sol @@ -51,32 +51,29 @@ interface IERC1155 is IERC165 { /// @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with /// safety call). - /// @param _from Source address - /// @param _to Target address - /// @param _id ID of the token type - /// @param _value Transfer amount - /// @param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on - /// `_to` - /// @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" - /// section of the standard). + /// @param _from Source address. + /// @param _to Target address. + /// @param _id ID of the token type. + /// @param _value Transfer amount. + /// @param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to`. + /// @dev + /// - Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). /// - MUST revert if `_to` is the zero address. /// - MUST revert if balance of holder for token `_id` is lower than the `_value` sent. /// - MUST revert on any other error. /// - MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the /// standard). - /// - After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > - /// 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of - /// the standard). + /// After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). + /// If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external; /// @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with /// safety call). - /// @param _from Source address - /// @param _to Target address - /// @param _ids IDs of each token type (order and length must match _values array) - /// @param _values Transfer amounts per token type (order and length must match _ids array) - /// @param _data Additional data with no specified format, MUST be sent unaltered in call to the - /// `ERC1155TokenReceiver` hook(s) on `_to` + /// @param _from Source address. + /// @param _to Target address. + /// @param _ids IDs of each token type (order and length must match _values array). + /// @param _values Transfer amounts per token type (order and length must match _ids array). + /// @param _data Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to`. /// @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" /// section of the standard). /// - MUST revert if `_to` is the zero address. @@ -88,9 +85,8 @@ interface IERC1155 is IERC165 { /// "Safe Transfer Rules" section of the standard). /// - Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before /// _ids[1]/_values[1], etc). - /// - After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a - /// smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` - /// and act appropriately (see "Safe Transfer Rules" section of the standard). + /// After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). + /// If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). function safeBatchTransferFrom( address _from, address _to, @@ -100,15 +96,15 @@ interface IERC1155 is IERC165 { ) external; /// @notice Get the balance of an account's tokens. - /// @param _owner The address of the token holder - /// @param _id ID of the token - /// @return The _owner's balance of the token type requested + /// @param _owner The address of the token holder. + /// @param _id ID of the token. + /// @return The _owner's balance of the token type requested. function balanceOf(address _owner, uint256 _id) external view returns (uint256); - /// @notice Get the balance of multiple account/token pairs - /// @param _owners The addresses of the token holders - /// @param _ids ID of the tokens - /// @return The _owner's balance of the token types requested (i.e. balance for each (owner, id) pair) + /// @notice Get the balance of multiple account/token pairs. + /// @param _owners The addresses of the token holders. + /// @param _ids ID of the tokens. + /// @return The _owner's balance of the token types requested (i.e. balance for each (owner, id) pair). function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view @@ -116,13 +112,13 @@ interface IERC1155 is IERC165 { /// @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens. /// @dev MUST emit the ApprovalForAll event on success. - /// @param _operator Address to add to the set of authorized operators - /// @param _approved True if the operator is approved, false to revoke approval + /// @param _operator Address to add to the set of authorized operators. + /// @param _approved True if the operator is approved, false to revoke approval. function setApprovalForAll(address _operator, bool _approved) external; /// @notice Queries the approval status of an operator for a given owner. - /// @param _owner The owner of the tokens - /// @param _operator Address of authorized operator - /// @return True if the operator is approved, false if not + /// @param _owner The owner of the tokens. + /// @param _operator Address of authorized operator. + /// @return True if the operator is approved, false if not. function isApprovedForAll(address _owner, address _operator) external view returns (bool); } From af592572f8dcdefcab640fa459e2b38d7e778c54 Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Mon, 3 Mar 2025 10:58:40 +0100 Subject: [PATCH 3/3] document ERC-165 identifier --- src/interfaces/IERC6909.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/src/interfaces/IERC6909.sol b/src/interfaces/IERC6909.sol index ef58762ca..005c3e7d7 100644 --- a/src/interfaces/IERC6909.sol +++ b/src/interfaces/IERC6909.sol @@ -5,6 +5,7 @@ import {IERC165} from "./IERC165.sol"; /// @title ERC-6909: Minimal Multi-Token Interface /// @dev SEE: https://eips.ethereum.org/EIPS/eip-6909 +/// NOTE: The ERC-165 identifier for this interface is 0x0f632fb3. interface IERC6909 is IERC165 { /// @notice Emitted when the allowance of a `spender` for an `owner` is set for a token of type `id`. event Approval(address indexed owner, address indexed spender, uint256 indexed id, uint256 amount);