Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EIP-5773: Multi-Resource Token standard #5773

Merged
merged 21 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ee0025a
Propose Multi-Resource Token standard
ThunderDeliverer Oct 10, 2022
758ecdc
Address issues reported by EIP repository's CI
ThunderDeliverer Oct 10, 2022
e3a880b
Fix styling discrepancies in section titles
ThunderDeliverer Oct 10, 2022
365eb1c
Address CI's issues in the preabmle
ThunderDeliverer Oct 10, 2022
69b2ffd
Add discussion URL
ThunderDeliverer Oct 15, 2022
08c0038
Fix discussion URL formatting
ThunderDeliverer Oct 15, 2022
f192cbc
Add the EIP number
ThunderDeliverer Oct 18, 2022
d8622f5
Fix getResourceMeta specification
ThunderDeliverer Oct 21, 2022
897561a
Apply changes based on PR comments
ThunderDeliverer Oct 26, 2022
674cf11
Replace "primitive" with a clearer explanation
ThunderDeliverer Oct 27, 2022
e2bee24
Apply changes based on ECH call #5
ThunderDeliverer Nov 15, 2022
fabcd1b
Address the stylistic issues reported by the CI
ThunderDeliverer Nov 15, 2022
67718ce
Fix a reference to EIP-712
ThunderDeliverer Nov 15, 2022
a9543d8
Minor typo fixes
ThunderDeliverer Nov 15, 2022
1eecc07
Updates `getResourceMetadata` description
steven2308 Nov 15, 2022
4522c8d
Rename MultiResource -> MultiAsset and relicense
ThunderDeliverer Nov 16, 2022
0530684
Fix license identifier & Specification contract title
ThunderDeliverer Nov 18, 2022
b2d3efa
Fix indexes of Rationale questions
ThunderDeliverer Nov 20, 2022
b0f75d9
Minor polishing of the rationale
ThunderDeliverer Nov 21, 2022
3d6c7ec
Update references to assets to use an istead of a in Rationale
ThunderDeliverer Nov 21, 2022
554ceed
Final polishes
ThunderDeliverer Nov 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
503 changes: 503 additions & 0 deletions EIPS/eip-5773.md

Large diffs are not rendered by default.

94 changes: 94 additions & 0 deletions assets/eip-5773/contracts/IMultiResource.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// SPDX-License-Identifier: Apache-2.0
ThunderDeliverer marked this conversation as resolved.
Show resolved Hide resolved

pragma solidity ^0.8.0;

interface IMultiResource {
event ResourceSet(uint64 resourceId);

event ResourceAddedToToken(
uint256 indexed tokenId,
uint64 indexed resourceId,
uint64 indexed overwritesId
);

event ResourceAccepted(
uint256 indexed tokenId,
uint64 indexed resourceId,
uint64 indexed overwritesId
);

event ResourceRejected(uint256 indexed tokenId, uint64 indexed resourceId);

event ResourcePrioritySet(uint256 indexed tokenId);

event ApprovalForResources(
address indexed owner,
address indexed approved,
uint256 indexed tokenId
);

event ApprovalForAllForResources(
address indexed owner,
address indexed operator,
bool approved
);

function acceptResource(
uint256 tokenId,
uint256 index,
uint64 resourceId
) external;

function rejectResource(
uint256 tokenId,
uint256 index,
uint64 resourceId
) external;

function rejectAllResources(uint256 tokenId, uint256 maxRejections)
external;

function setPriority(uint256 tokenId, uint16[] calldata priorities)
external;

function getActiveResources(uint256 tokenId)
external
view
returns (uint64[] memory);

function getPendingResources(uint256 tokenId)
external
view
returns (uint64[] memory);

function getActiveResourcePriorities(uint256 tokenId)
external
view
returns (uint16[] memory);

function getResourceOverwrites(uint256 tokenId, uint64 newResourceId)
external
view
returns (uint64);

function getResourceMetadata(uint256 tokenId, uint64 resourceId)
external
view
returns (string memory);

// Approvals
function approveForResources(address to, uint256 tokenId) external;

function getApprovedForResources(uint256 tokenId)
external
view
returns (address);

function setApprovalForAllForResources(address operator, bool approved)
external;

function isApprovedForAllForResources(address owner, address operator)
external
view
returns (bool);
}
Loading