-
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 6 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 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 { IPToken } from "../../src/IPToken.sol"; | ||
| import { Tokenizer } from "../../src/Tokenizer.sol"; | ||
| import { WrappedIPToken } from "../../src/WrappedIPToken.sol"; | ||
| import "forge-std/Script.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,40 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8; | ||
|
|
||
| /// @title IP Token Metadata Structure | ||
| /// @notice Metadata associated with an IP Token, linking it to its originating IPNFT | ||
| struct Metadata { | ||
| /// @notice The ID of the IPNFT that this IP token is derived from | ||
| uint256 ipnftId; | ||
| /// @notice The original owner of the IPNFT at the time of token creation | ||
| address originalOwner; | ||
| /// @notice IPFS CID of the agreement governing this IP token | ||
| string agreementCid; | ||
| } | ||
|
|
||
| /// @title IP Token Interface | ||
| /// @notice Interface for IP tokens that represent fractionalized intellectual property rights | ||
| /// @dev IP tokens are created from IPNFTs and represent transferable shares of IP ownership | ||
| interface IIPToken { | ||
| /// @notice Returns the total amount of tokens that have ever been issued | ||
| /// @dev This may differ from current supply due to potential burning mechanisms | ||
| /// @return The total number of tokens issued since contract deployment | ||
| function totalIssued() external view returns (uint256); | ||
|
|
||
| /// @notice Returns the metadata associated with this IP token | ||
| /// @return The metadata struct containing IPNFT ID, original owner, and agreement CID | ||
| function metadata() external view returns (Metadata memory); | ||
|
|
||
| /// @notice Issues new tokens to a specified address | ||
| /// @param to The address to receive the newly issued tokens | ||
| /// @param amount The number of tokens to issue | ||
| function issue(address to, uint256 amount) external; | ||
|
|
||
| /// @notice Returns or sets the maximum supply cap for this token | ||
| /// @dev Implementation may vary - could be a getter or setter depending on context | ||
| function cap() external; | ||
|
|
||
| /// @notice Returns the URI for token metadata (typically IPFS) | ||
| /// @return The URI string pointing to token metadata | ||
| function uri() external view returns (string memory); | ||
| } | ||
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.