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

Revisit EIP1167 for IPNFT Tokenization #149

Merged
merged 18 commits into from
Jan 17, 2024
Merged

Revisit EIP1167 for IPNFT Tokenization #149

merged 18 commits into from
Jan 17, 2024

Conversation

@polus-arcticus polus-arcticus self-assigned this Jan 8, 2024
Copy link

openzeppelin-code bot commented Jan 8, 2024

WIP: Revisit EIP1167 for IPNFT Tokenization

Generated at commit: 00cb25aa2df1af390d12e3ef6d1590849ac7f401

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
0
0
0
12
37
49
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector


vm.startPrank(mainnetOwner); // Owner address on mainnet
tokenizer11 = Tokenizer11(mainnetTokenizer);
tokenizer11.upgradeTo(address(new Tokenizer()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's a little dangerous here is that the Tokenizer's IPToken implementation is undefined between these two transactions. I'm wondering if upgradeToAndCall might help (calling the setIPTokenImplementation during the upgrade step)

@polus-arcticus polus-arcticus marked this pull request as ready for review January 10, 2024 14:18
@polus-arcticus polus-arcticus changed the title WIP: Revisit EIP1167 for IPNFT Tokenization Revisit EIP1167 for IPNFT Tokenization Jan 10, 2024
@elmariachi111 elmariachi111 force-pushed the feature/eip-1167 branch 3 times, most recently from d7582cf to fb6c882 Compare January 10, 2024 17:26
@elmariachi111 elmariachi111 force-pushed the feature/eip-1167 branch 2 times, most recently from dd56cac to ab49b7e Compare January 16, 2024 12:01
@@ -27,12 +27,18 @@ contract Tokenizer is UUPSUpgradeable, OwnableUpgradeable {
string symbol
);

event IPTokenUpgraded(
address indexed oldAddress,
address indexed newAddress
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could include version number for brevity

tokenizer = Tokenizer(address(new ERC1967Proxy(address(new Tokenizer()), "")));
tokenizer.initialize(ipnft, blindPermissioner);
tokenizer.setIPTokenImplementation(address(ipToken));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be placed inside the initialise function as well

/**
* @dev called after an upgrade to reinitialize a new permissioner impl. This is 4 for görli compatibility
* @param _permissioner the new TermsPermissioner
*/
function reinit(IPermissioner _permissioner) public onlyOwner reinitializer(4) {
function reinit(IPermissioner _permissioner) public onlyOwner reinitializer(5) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needed to be bumped one to set the blind permissioner

polus-arcticus and others added 15 commits January 17, 2024 16:59
fixes old tests
configures gh env vars to run the tests
cleans up some comments, tokenizer version bump
hardhat test command
add in ignore comment
* adds a setter for the permissioner
* uses contracts instead of addresses
* adds a address(0) check to setters

Signed-off-by: stadolf <stefan@molecule.to>

---------

Signed-off-by: stadolf <stefan@molecule.to>
readded ignore comment
settable permissioners / revert reinit (#150)

* adds a setter for the permissioner
* uses contracts instead of addresses
* adds a address(0) check to setters

Signed-off-by: stadolf <stefan@molecule.to>

---------

Signed-off-by: stadolf <stefan@molecule.to>
mocks it by code injection instead

Signed-off-by: stadolf <stefan@molecule.to>
pseudo code for upgrade
minimal changes to upgradetokenizer
natspec / whitespace updates

Signed-off-by: stadolf <stefan@molecule.to>
impl in readme
more README :)

Signed-off-by: stadolf <stefan@molecule.to>
updates new addresses

Signed-off-by: stadolf <stefan@molecule.to>
elmariachi111 and others added 3 commits January 17, 2024 17:00
Signed-off-by: stadolf <stefan@molecule.to>
strips down unnecessary initialization code
reinits real permissioner on crowdsale test again

Signed-off-by: stadolf <stefan@molecule.to>
new mainnet iptoken impl address

Signed-off-by: stadolf <stefan@molecule.to>
@elmariachi111 elmariachi111 merged commit 9362140 into main Jan 17, 2024
1 check passed
@elmariachi111 elmariachi111 deleted the feature/eip-1167 branch January 17, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants