-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add utils and constants * simplify role val * add context comments for interface ids
- Loading branch information
1 parent
598c232
commit b2624ee
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ mod introspection; | |
mod security; | ||
mod token; | ||
mod tests; | ||
mod utils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mod constants; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// Interface ids | ||
// | ||
|
||
// ERC165 | ||
// See: https://eips.ethereum.org/EIPS/eip-165 | ||
const IERC165_ID: u32 = 0x01ffc9a7_u32; | ||
const INVALID_ID: u32 = 0xffffffff_u32; | ||
|
||
// Account | ||
// See: https://github.com/OpenZeppelin/cairo-contracts/pull/449#discussion_r966242914 | ||
const IACCOUNT_ID: u32 = 0xa66bd575_u32; | ||
|
||
// ERC721 | ||
// See: https://eips.ethereum.org/EIPS/eip-721 | ||
const IERC721_ID: u32 = 0x80ac58cd_u32; | ||
const IERC721_RECEIVER_ID: u32 = 0x150b7a02_u32; | ||
const IERC721_METADATA_ID: u32 = 0x5b5e139f_u32; | ||
const IERC721_ENUMERABLE_ID: u32 = 0x780e9d63_u32; | ||
|
||
// ERC1155 | ||
// See: https://eips.ethereum.org/EIPS/eip-1155 | ||
const IERC1155_ID: u32 = 0xd9b67a26_u32; | ||
const IERC1155_METADATA_ID: u32 = 0x0e89341c_u32; | ||
const IERC1155_RECEIVER_ID: u32 = 0x4e2312e0_u32; | ||
const ON_ERC1155_RECEIVED_SELECTOR: u32 = 0xf23a6e61_u32; | ||
const ON_ERC1155_BATCH_RECEIVED_SELECTOR: u32 = 0xbc197c81_u32; | ||
|
||
// AccessControl | ||
// Calculated from XOR of all function selectors in IAccessControl. | ||
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/IAccessControl.sol | ||
const IACCESSCONTROL_ID: u32 = 0x7965db0b_u32; | ||
|
||
// | ||
// Roles | ||
// | ||
|
||
const DEFAULT_ADMIN_ROLE: felt252 = 0; |