Files
openzeppelin-contracts/contracts/interfaces/draft-IERC6909.sol
github-actions[bot] d183d9b07a Merge release-v5.3 branch (#5632)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <fg@frang.io>
Co-authored-by: Joseph Delong <joseph@delong.me>
Co-authored-by: Arr00 <13561405+arr00@users.noreply.github.com>
Co-authored-by: Renan Souza <renan.rodrigues.souza1@gmail.com>
Co-authored-by: Ernesto García <ernestognw@gmail.com>
Co-authored-by: Voronor <129545215+voronor@users.noreply.github.com>
Co-authored-by: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com>
Co-authored-by: Michalis Kargakis <kargakis@protonmail.com>
Co-authored-by: Bilog WEB3 <155262265+Bilogweb3@users.noreply.github.com>
Co-authored-by: Fallengirl <155266340+Fallengirl@users.noreply.github.com>
Co-authored-by: XxAlex74xX <30472093+XxAlex74xX@users.noreply.github.com>
Co-authored-by: PixelPilot <161360836+PixelPil0t1@users.noreply.github.com>
Co-authored-by: kilavvy <140459108+kilavvy@users.noreply.github.com>
Co-authored-by: Devkuni <155117116+detrina@users.noreply.github.com>
Co-authored-by: Danbo <140512416+dannbbb1@users.noreply.github.com>
Co-authored-by: Ann Wagner <chant_77_swirly@icloud.com>
Co-authored-by: comfsrt <155266597+comfsrt@users.noreply.github.com>
Co-authored-by: Bob <158583129+bouchmann@users.noreply.github.com>
Co-authored-by: JohnBonny <158583902+JohnBonny@users.noreply.github.com>
Co-authored-by: moonman <155266991+moooonman@users.noreply.github.com>
Co-authored-by: kazak <alright-epsilon8h@icloud.com>
Co-authored-by: Wei <ybxerlvqtx@rambler.ru>
Co-authored-by: Maxim Evtush <154841002+maximevtush@users.noreply.github.com>
Co-authored-by: Vitalyr <158586577+Vitaliyr888@users.noreply.github.com>
Co-authored-by: pendrue <158588659+pendrue@users.noreply.github.com>
Co-authored-by: Tronica <wudmytrotest404@gmail.com>
Co-authored-by: emmmm <155267286+eeemmmmmm@users.noreply.github.com>
Co-authored-by: bigbear <155267841+aso20455@users.noreply.github.com>
Co-authored-by: Tomás Andróil <tomasandroil@gmail.com>
Co-authored-by: GooseMatrix <155266802+GooseMatrix@users.noreply.github.com>
Co-authored-by: jasmy <3776356370@qq.com>
Co-authored-by: SITADRITA1 <mrlime2018@gmail.com>
Co-authored-by: Ocenka <testoviydiman1@gmail.com>
2025-04-09 20:47:07 +02:00

126 lines
3.9 KiB
Solidity

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (interfaces/draft-IERC6909.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC-6909 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-6909[ERC].
*/
interface IERC6909 is IERC165 {
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set for a token of type `id`.
* The new allowance is `amount`.
*/
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`.
*/
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`.
*/
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`.
*/
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`.
*
* 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`.
*/
function isOperator(address owner, address spender) external view returns (bool);
/**
* @dev Sets an approval to `spender` for `amount` of tokens of type `id` from the caller's tokens. An `amount` of
* `type(uint256).max` signifies an unlimited approval.
*
* 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.
*
* 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`.
*
* 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`.
*
* 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`.
*/
function name(uint256 id) external view returns (string memory);
/**
* @dev 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`.
*/
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.
*/
function contractURI() external view returns (string memory);
/**
* @dev 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`.
*/
function totalSupply(uint256 id) external view returns (uint256);
}