-
Notifications
You must be signed in to change notification settings - Fork 10
[IP-527] Bring your own IPT: Tokenizer allows attaching arbitrary ERC20s #173
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
Merged
+1,382
−507
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
df3dcf3
feat(tokenizer): allow erc20 attachment as ipt
0xmme af9f607
feat(tokenizer): add in the local deployment script a script to attac…
nour-karoui e5ee557
chore: forge fmt import order
0xmme af5d4c9
chore: add docs to IIPToken
0xmme 2fec1e1
refactor: shared ipt functions into lib
0xmme b6adf2b
refactor: remove state changing methods from wrappedipt
0xmme 20e8908
chore: update readme
0xmme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
| { | ||
| "lib/ERC721B": { | ||
| "branch": { | ||
| "name": "0.2.1", | ||
| "rev": "254530019373cfb2aa3cb6e975768857f829823d" | ||
| } | ||
| }, | ||
| "lib/forge-std": { | ||
| "rev": "87a2a0afc5fafd6297538a45a52ac19e71a84562" | ||
| }, | ||
| "lib/openzeppelin-contracts": { | ||
| "branch": { | ||
| "name": "release-v4.8", | ||
| "rev": "281550b71c3df9a83e6b80ceefc700852c287570" | ||
| } | ||
| }, | ||
| "lib/openzeppelin-contracts-upgradeable": { | ||
| "rev": "43b82754979c35abcd3ccad7b795754146c62ade" | ||
| }, | ||
| "lib/safe-contracts": { | ||
| "branch": { | ||
| "name": "v1.4.0", | ||
| "rev": "e870f514ad34cd9654c72174d6d4a839e3c6639f" | ||
| } | ||
| }, | ||
| "lib/solidity-base64": { | ||
| "rev": "537095980643f59e9e00b7b76d341bb9da438eaf" | ||
| }, | ||
| "lib/solmate": { | ||
| "branch": { | ||
| "name": "v7", | ||
| "rev": "ed67feda67b24fdeff8ad1032360f0ee6047ba0a" | ||
| } | ||
| }, | ||
| "lib/token-vesting-contract": { | ||
| "rev": "b1f3e05bb6f07bec70d2b7b588d622c06f70ae39" | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,31 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.18; | ||
|
|
||
| import "forge-std/Script.sol"; | ||
| import { Tokenizer } from "../../src/Tokenizer.sol"; | ||
| import { IPToken } from "../../src/IPToken.sol"; | ||
| import { WrappedIPToken } from "../../src/WrappedIPToken.sol"; | ||
| import { console } from "forge-std/console.sol"; | ||
|
|
||
| contract RolloutTokenizerV14 is Script { | ||
| function run() public { | ||
| vm.startBroadcast(); | ||
|
|
||
| // Deploy new implementations | ||
| IPToken ipTokenImplementation = new IPToken(); | ||
| WrappedIPToken wrappedIpTokenImplementation = new WrappedIPToken(); | ||
| Tokenizer newTokenizerImplementation = new Tokenizer(); | ||
|
|
||
| // Prepare upgrade call data using reinit function | ||
| bytes memory upgradeCallData = | ||
| abi.encodeWithSelector(Tokenizer.reinit.selector, address(wrappedIpTokenImplementation), address(ipTokenImplementation)); | ||
|
|
||
| console.log("IPTOKENIMPLEMENTATION=%s", address(ipTokenImplementation)); | ||
| console.log("WRAPPEDTOKENIMPLEMENTATION=%s", address(wrappedIpTokenImplementation)); | ||
| console.log("NEWTOKENIZER=%s", address(newTokenizerImplementation)); | ||
| console.log("UpgradeCallData:"); | ||
| console.logBytes(upgradeCallData); | ||
|
|
||
| vm.stopBroadcast(); | ||
| } | ||
| } |
This file contains hidden or 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,21 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8; | ||
|
|
||
| struct Metadata { | ||
| uint256 ipnftId; | ||
| address originalOwner; | ||
| string agreementCid; | ||
| } | ||
|
|
||
| interface IIPToken { | ||
| /// @notice the amount of tokens that ever have been issued (not necessarily == supply) | ||
| function totalIssued() external view returns (uint256); | ||
| function balanceOf(address account) external view returns (uint256); | ||
| function metadata() external view returns (Metadata memory); | ||
| function issue(address, uint256) external; | ||
| function cap() external; | ||
| function uri() external view returns (string memory); | ||
| function name() external view returns (string memory); | ||
| function symbol() external view returns (string memory); | ||
| function decimals() external view returns (uint8); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.