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

feat: add lsp20 to acceptOwnership #747

Merged
merged 13 commits into from
Oct 17, 2023
Merged

feat: add lsp20 to acceptOwnership #747

merged 13 commits into from
Oct 17, 2023

Conversation

skimaharvey
Copy link
Member

@skimaharvey skimaharvey commented Oct 12, 2023

What does this PR introduce

  • Add lsp20 to acceptOwnership
  • Make _pendingOwner & _renounceOwnershipStartedAt internal
  • Add LSP20 tests to acceptOwnership directly

@github-actions
Copy link
Contributor

👋 Hello
⛽ I am the Gas Bot Reporter. I keep track of the gas costs of common interactions using Universal Profiles 🆙 !
📊 Here is a summary of the gas cost with the code introduced by this PR.

⛽📊 Gas Benchmark Report

Deployment Costs

Deployed contracts ⛽ Deployment cost
UniversalProfile 3029244 (22,039 📈❌)
KeyManager 3473495 (0 )
LSP1DelegateUP 1623792 (0 )
LSP7Mintable 2354082 (0 )
LSP8Mintable 2469323 (0 )

Runtime Costs

UniversalProfile owned by an 🔑 EOA

🔀 execute scenarios

execute scenarios - UP owned by 🔑 EOA ⛽ Gas Usage
Transfer 1 LYX to an EOA without data 37537 (0 )
Transfer 1 LYX to a UP without data 36639 (0 )
Transfer 1 LYX to an EOA with 256 bytes of data 42210 (12 📈❌)
Transfer 1 LYX to a UP with 256 bytes of data 44843 (-24 📉✅)
Transfer 0.1 LYX to 3x EOA without data 70862 (0 )
Transfer 0.1 LYX to 3x UP without data 75680 (0 )
Transfer 0.1 LYX to 3x EOA with 256 bytes of data 84826 (-24 📉✅)
Transfer 0.1 LYX to 3x UPs with 256 bytes of data 100321 (-36 📉✅)

🗄️ setData scenarios

setData scenarios - UP owned by 🔑 EOA ⛽ Gas Usage
Set a 20 bytes long value 49971 (0 )
Set a 60 bytes long value 95293 (0 )
Set a 160 bytes long value 164465 (0 )
Set a 300 bytes long value 279700 (0 )
Set a 600 bytes long value 484100 (-48 📉✅)
Change the value of a data key already set 32859 (0 )
Remove the value of a data key already set 27333 (0 )
Set 2 data keys of 20 bytes long value 78454 (0 )
Set 2 data keys of 100 bytes long value 260594 (-12 📉✅)
Set 3 data keys of 20 bytes long value 105171 (0 )
Change the value of three data keys already set of 20 bytes long value 45471 (0 )
Remove the value of three data keys already set 41360 (0 )

🗄️ Tokens scenarios

Tokens scenarios - UP owned by 🔑 EOA ⛽ Gas Usage
Minting a LSP7Token to a UP (No Delegate) from an EOA 91982 (0 )
Minting a LSP7Token to an EOA from an EOA 59289 (0 )
Transferring an LSP7Token from a UP to another UP (No Delegate) 100092 (0 )
Minting a LSP8Token to a UP (No Delegate) from an EOA 158922 (0 )
Minting a LSP8Token to an EOA from an EOA 126229 (0 )
Transferring an LSP8Token from a UP to another UP (No Delegate) 148899 (0 )
UniversalProfile owned by a 🔒📄 LSP6KeyManager

🔀 execute scenarios

execute scenarios 👑 main controller 🛃 restricted controller
LYX transfer --> to an EOA 66102 (0 ) 76895 (0 )
LYX transfer --> to a UP 67384 (0 ) 79366 (0 )
LSP7 token transfer --> to an EOA 120151 (0 ) 134842 (0 )
LSP7 token transfer --> to a UP 256681 (0 ) 271372 (0 )
LSP8 NFT transfer --> to an EOA 184394 (0 ) 199062 (0 )
LSP8 NFT transfer --> to a UP 304171 (0 ) 318839 (0 )

🗄️ setData scenarios

setData scenarios 👑 main controller 🛃 restricted controller
Update Profile details (LSP3Profile Metadata) 68689 (0 ) 78688 (0 )
Add a new controller with permission to SET_DATA + 3x allowed data keys:
AddressPermissions[]
+ AddressPermissions[index]
+ AddressPermissions:Permissions:<controller>
+ AddressPermissions:AllowedERC725YDataKeys:<controller)
212087 (0 ) 222152 (0 )
Update permissions of previous controller. Allow it now to SUPER_SETDATA 53576 (0 ) 56559 (0 )
Remove a controller:
1. decrease AddressPermissions[] Array length
2. remove the controller address at AddressPermissions[index]
3. set "0x" for the controller permissions under AddressPermissions:Permissions:
80542 (0 ) 91767 (0 )
Write 5x new LSP12 Issued Assets 68242 (0 ) 102846 (0 )
Update 3x data keys (first 3) 127530 (0 ) 161611 (0 )
Update 3x data keys (middle 3) 107618 (0 ) 145765 (0 )
Update 3x data keys (last 3) 127530 (0 ) 171098 (0 )
Set 2 x new data keys + add 3x new controllers 815975 (0 ) 877522 (0 )

@skimaharvey skimaharvey changed the title Lsp20/accept ownership feat: add lsp20 to acceptOwnership Oct 12, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 12, 2023

Changes to gas cost

Generated at commit: 7f638c75ec98280e3f87776d09f0d0099ee8fd82, compared to commit: b8eca3c5696acf85239130ef67edec9e8c134bfa

🧾 Summary (10% most significant diffs)

Contract Method Avg (+/-) %
LSP6ExecuteRestrictedController transferLYXToUP +11,279 ❌ +35.81%
LSP6ExecuteUnrestrictedController transferLYXToUP +10,879 ❌ +32.48%
LSP6SetDataRestrictedController execute +6,081 ❌ +21.31%
LSP6SetDataUnrestrictedController execute +6,081 ❌ +21.31%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
LSP6ExecuteRestrictedController 2,898,727 (+23,036) lsp20VerifyCall
transferLYXToEOA
transferLYXToUP
transferNFTToRandomEOA
transferNFTToRandomUP
transferTokensToRandomEOA
transferTokensToRandomUP
14,657 (-239)
62,528 (+6,363)
42,775 (+11,279)
144,412 (+13,643)
251,112 (+11,798)
74,592 (+900)
206,610 (-2,549)
-1.60%
+11.33%
+35.81%
+10.43%
+4.93%
+1.22%
-1.22%
16,856 (-176)
62,528 (+6,363)
42,775 (+11,279)
144,412 (+13,643)
251,112 (+11,798)
74,592 (+900)
206,610 (-2,549)
-1.03%
+11.33%
+35.81%
+10.43%
+4.93%
+1.22%
-1.22%
17,589 (-156)
62,528 (+6,363)
42,775 (+11,279)
144,412 (+13,643)
251,112 (+11,798)
74,592 (+900)
206,610 (-2,549)
-0.88%
+11.33%
+35.81%
+10.43%
+4.93%
+1.22%
-1.22%
17,589 (-156)
62,528 (+6,363)
42,775 (+11,279)
144,412 (+13,643)
251,112 (+11,798)
74,592 (+900)
206,610 (-2,549)
-0.88%
+11.33%
+35.81%
+10.43%
+4.93%
+1.22%
-1.22%
8 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
LSP6ExecuteUnrestrictedController 2,898,727 (+23,036) lsp20VerifyCall
transferLYXToEOA
transferLYXToUP
transferNFTToRandomEOA
transferNFTToRandomUP
transferTokensToRandomEOA
transferTokensToRandomUP
14,657 (-239)
63,032 (+6,237)
44,375 (+10,879)
143,161 (+13,643)
249,861 (+11,798)
73,340 (+1,212)
205,046 (-2,549)
-1.60%
+10.98%
+32.48%
+10.53%
+4.96%
+1.68%
-1.23%
16,856 (-176)
63,032 (+6,237)
44,375 (+10,879)
143,161 (+13,643)
249,861 (+11,798)
73,340 (+1,212)
205,046 (-2,549)
-1.03%
+10.98%
+32.48%
+10.53%
+4.96%
+1.68%
-1.23%
17,589 (-156)
63,032 (+6,237)
44,375 (+10,879)
143,161 (+13,643)
249,861 (+11,798)
73,340 (+1,212)
205,046 (-2,549)
-0.88%
+10.98%
+32.48%
+10.53%
+4.96%
+1.68%
-1.23%
17,589 (-156)
63,032 (+6,237)
44,375 (+10,879)
143,161 (+13,643)
249,861 (+11,798)
73,340 (+1,212)
205,046 (-2,549)
-0.88%
+10.98%
+32.48%
+10.53%
+4.96%
+1.68%
-1.23%
8 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
LSP6SetDataRestrictedController 2,883,512 (+23,044) execute
givePermissionsToController
restrictControllerToERC725YKeys
30,770 (+12,280)
122,881 (+2,247)
141,590 (+2,706)
+66.41%
+1.86%
+1.95%
34,616 (+6,081)
122,881 (+2,247)
141,590 (+2,706)
+21.31%
+1.86%
+1.95%
34,616 (+6,081)
122,881 (+2,247)
141,590 (+2,706)
+21.31%
+1.86%
+1.95%
38,463 (-118)
122,881 (+2,247)
141,590 (+2,706)
-0.31%
+1.86%
+1.95%
2 (0)
1 (0)
1 (0)
LSP6SetDataUnrestrictedController 2,883,512 (+23,044) execute
givePermissionsToController
restrictControllerToERC725YKeys
30,770 (+12,280)
128,881 (+2,247)
150,090 (+2,706)
+66.41%
+1.77%
+1.84%
34,616 (+6,081)
128,881 (+2,247)
150,090 (+2,706)
+21.31%
+1.77%
+1.84%
34,616 (+6,081)
128,881 (+2,247)
150,090 (+2,706)
+21.31%
+1.77%
+1.84%
38,463 (-118)
128,881 (+2,247)
150,090 (+2,706)
-0.31%
+1.77%
+1.84%
2 (0)
1 (0)
1 (0)

Copy link
Member

@CJ42 CJ42 left a comment

Choose a reason for hiding this comment

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

Added review comments

Copy link
Member Author

@skimaharvey skimaharvey left a comment

Choose a reason for hiding this comment

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

thanks!

@CJ42 CJ42 merged commit 804779a into develop Oct 17, 2023
27 checks passed
@CJ42 CJ42 deleted the lsp20/acceptOwnership branch October 17, 2023 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants