-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
478 additions
and
387 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
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,5 @@ | ||
{ | ||
"printWidth": 120, | ||
"tabWidth": 4, | ||
"useTabs": true | ||
} |
Submodule openzeppelin-contracts
deleted from
045704
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,35 @@ | ||
{ | ||
"name": "@polytope-labs/erc6160", | ||
"version": "0.1.0", | ||
"description": "Official implementation of the EIP-6160 token standard", | ||
"author": "Polytope Labs <[email protected]>", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/polytope-labs/ERC6160/issues" | ||
}, | ||
"homepage": "https://github.com/polytope-labs/ERC6160#readme", | ||
"directories": { | ||
"lib": "src" | ||
}, | ||
"files": [ | ||
"./interfaces/**/*.sol" | ||
], | ||
"scripts": {}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/polytope-labs/ERC6160.git" | ||
}, | ||
"keywords": [ | ||
"hyperbridge", | ||
"ethereum", | ||
"polkadot", | ||
"interoperability", | ||
"cross-chain", | ||
"bridges" | ||
], | ||
"dependencies": { | ||
"openzeppelin-solidity": "^4.8.1", | ||
"prettier": "^3.3.3", | ||
"prettier-plugin-solidity": "^1.3.1" | ||
} | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
openzeppelin-contracts/=lib/openzeppelin-contracts/ | ||
openzeppelin-contracts/=node_modules/openzeppelin-solidity/ |
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 |
---|---|---|
@@ -1,39 +1,44 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.17; | ||
|
||
import {IERC6160Ext20} from "./interfaces/IERC6160Ext20.sol"; | ||
import {IERC6160Ext721} from "./interfaces/IERC6160Ext721.sol"; | ||
import {IERC6160Ext1155} from "./interfaces/IERC6160Ext1155.sol"; | ||
|
||
contract Calculate { | ||
IERC6160Ext20 ierc6160ext20; | ||
IERC6160Ext721 ierc6160ext721; | ||
IERC6160Ext1155 ierc6160ext1155; | ||
IERC6160Ext20 ierc6160ext20; | ||
IERC6160Ext721 ierc6160ext721; | ||
IERC6160Ext1155 ierc6160ext1155; | ||
|
||
// calculate selector for IERC6160Ext20 | ||
function calculateSelectorIERC6160Ext20() external view returns (bytes4) { | ||
bytes4 selector = ( | ||
ierc6160ext20.hasRole.selector ^ ierc6160ext20.grantRole.selector ^ ierc6160ext20.revokeRole.selector | ||
^ ierc6160ext20.mint.selector ^ ierc6160ext20.burn.selector | ||
); | ||
return selector; | ||
} | ||
// calculate selector for IERC6160Ext20 | ||
function calculateSelectorIERC6160Ext20() external view returns (bytes4) { | ||
bytes4 selector = (ierc6160ext20.hasRole.selector ^ | ||
ierc6160ext20.grantRole.selector ^ | ||
ierc6160ext20.revokeRole.selector ^ | ||
ierc6160ext20.mint.selector ^ | ||
ierc6160ext20.burn.selector); | ||
return selector; | ||
} | ||
|
||
// calculate selector for IERC6160Ext721 | ||
function calculateSelectorIERC6160Ext721() external view returns (bytes4) { | ||
bytes4 selector = ( | ||
ierc6160ext721.hasRole.selector ^ ierc6160ext721.grantRole.selector ^ ierc6160ext721.revokeRole.selector | ||
^ ierc6160ext721.safeMint.selector ^ ierc6160ext721.burn.selector | ||
); | ||
return selector; | ||
} | ||
// calculate selector for IERC6160Ext721 | ||
function calculateSelectorIERC6160Ext721() external view returns (bytes4) { | ||
bytes4 selector = (ierc6160ext721.hasRole.selector ^ | ||
ierc6160ext721.grantRole.selector ^ | ||
ierc6160ext721.revokeRole.selector ^ | ||
ierc6160ext721.safeMint.selector ^ | ||
ierc6160ext721.burn.selector); | ||
return selector; | ||
} | ||
|
||
// calculate selector for IERC6160Ext1155 | ||
function calculateSelectorIERC6160Ext1155() external view returns (bytes4) { | ||
bytes4 selector = ( | ||
ierc6160ext1155.hasRole.selector ^ ierc6160ext1155.grantRole.selector ^ ierc6160ext1155.revokeRole.selector | ||
^ ierc6160ext1155.safeMint.selector ^ ierc6160ext1155.safeMintBatch.selector ^ ierc6160ext1155.burn.selector | ||
^ ierc6160ext1155.burnBatch.selector | ||
); | ||
return selector; | ||
} | ||
// calculate selector for IERC6160Ext1155 | ||
function calculateSelectorIERC6160Ext1155() external view returns (bytes4) { | ||
bytes4 selector = (ierc6160ext1155.hasRole.selector ^ | ||
ierc6160ext1155.grantRole.selector ^ | ||
ierc6160ext1155.revokeRole.selector ^ | ||
ierc6160ext1155.safeMint.selector ^ | ||
ierc6160ext1155.safeMintBatch.selector ^ | ||
ierc6160ext1155.burn.selector ^ | ||
ierc6160ext1155.burnBatch.selector); | ||
return selector; | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.