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

chore: adjust Natspec comments + use mixedCase name for modifier #786

Merged
merged 3 commits into from
Nov 6, 2023

Conversation

CJ42
Copy link
Member

@CJ42 CJ42 commented Nov 3, 2023

No description provided.

@CJ42 CJ42 changed the title chore: adjust Natspec comments + use mixedCase name for modifer chore: adjust Natspec comments + use mixedCase name for modifier Nov 3, 2023
Copy link
Contributor

github-actions bot commented Nov 3, 2023

👋 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 3157537 (0 )
KeyManager 3658355 (0 )
LSP1DelegateUP 1636034 (0 )
LSP7Mintable 2350310 (0 )
LSP8Mintable 2443708 (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 37560 (0 )
Transfer 1 LYX to a UP without data 46253 (0 )
Transfer 1 LYX to an EOA with 256 bytes of data 42233 (24 📈❌)
Transfer 1 LYX to a UP with 256 bytes of data 57162 (0 )
Transfer 0.1 LYX to 3x EOA without data 70862 (0 )
Transfer 0.1 LYX to 3x UP without data 104453 (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 137245 (72 📈❌)

🗄️ setData scenarios

setData scenarios - UP owned by 🔑 EOA ⛽ Gas Usage
Set a 20 bytes long value 49973 (0 )
Set a 60 bytes long value 95295 (0 )
Set a 160 bytes long value 164467 (12 📈❌)
Set a 300 bytes long value 279678 (0 )
Set a 600 bytes long value 484114 (0 )
Change the value of a data key already set 32849 (-12 📉✅)
Remove the value of a data key already set 27335 (0 )
Set 2 data keys of 20 bytes long value 78444 (-12 📉✅)
Set 2 data keys of 100 bytes long value 260620 (12 📈❌)
Set 3 data keys of 20 bytes long value 105174 (0 )
Change the value of three data keys already set of 20 bytes long value 45474 (0 )
Remove the value of three data keys already set 41362 (0 )

🗄️ Tokens scenarios

Tokens scenarios - UP owned by 🔑 EOA ⛽ Gas Usage
Minting a LSP7Token to a UP (No Delegate) from an EOA 92724 (0 )
Minting a LSP7Token to an EOA from an EOA 59377 (0 )
Transferring an LSP7Token from a UP to another UP (No Delegate) 101577 (0 )
Minting a LSP8Token to a UP (No Delegate) from an EOA 159593 (0 )
Minting a LSP8Token to an EOA from an EOA 126247 (0 )
Transferring an LSP8Token from a UP to another UP (No Delegate) 150271 (0 )
UniversalProfile owned by a 🔒📄 LSP6KeyManager

🔀 execute scenarios

execute scenarios 👑 main controller 🛃 restricted controller
LYX transfer --> to an EOA 64337 (0 ) 75288 (0 )
LYX transfer --> to a UP 78488 (0 ) 93385 (0 )
LSP7 token transfer --> to an EOA 116373 (0 ) 131123 (0 )
LSP7 token transfer --> to a UP 249647 (0 ) 264397 (0 )
LSP8 NFT transfer --> to an EOA 180460 (0 ) 195210 (0 )
LSP8 NFT transfer --> to a UP 296936 (0 ) 311686 (0 )

🗄️ setData scenarios

setData scenarios 👑 main controller 🛃 restricted controller
Update Profile details (LSP3Profile Metadata) 67338 (0 ) 77360 (0 )
Add a new controller with permission to SET_DATA + 3x allowed data keys:
AddressPermissions[]
+ AddressPermissions[index]
+ AddressPermissions:Permissions:<controller>
+ AddressPermissions:AllowedERC725YDataKeys:<controller)
209614 (0 ) 219771 (0 )
Update permissions of previous controller. Allow it now to SUPER_SETDATA 52366 (0 ) 55372 (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:
78844 (0 ) 90142 (0 )
Write 5x new LSP12 Issued Assets 67033 (0 ) 101660 (0 )
Update 3x data keys (first 3) 125479 (0 ) 159583 (0 )
Update 3x data keys (middle 3) 105567 (0 ) 143737 (0 )
Update 3x data keys (last 3) 125479 (0 ) 169070 (0 )
Set 2 x new data keys + add 3x new controllers 810459 (0 ) 872259 (0 )

Copy link
Contributor

github-actions bot commented Nov 3, 2023

Changes to gas cost

Generated at commit: 453de28d381ec9b167949a032acead40037aacff, compared to commit: 1f92ca530fb56cf2b626b0feae311d6c4737b8a0

🧾 Summary (10% most significant diffs)

Contract Method Avg (+/-) %
LSP6ExecuteRestrictedController transferLYXToEOA
transferLYXToUP
transferNFTToRandomEOA
transferNFTToRandomUP
transferTokensToRandomEOA
transferTokensToRandomUP
-210 ✅
-350 ✅
-324 ✅
-323 ✅
-308 ✅
-385 ✅
-0.34%
-0.63%
-0.23%
-0.13%
-0.41%
-0.19%
LSP6ExecuteUnrestrictedController transferLYXToEOA
transferLYXToUP
transferNFTToRandomEOA
transferNFTToRandomUP
transferTokensToRandomEOA
transferTokensToRandomUP
-350 ✅
-350 ✅
-352 ✅
-352 ✅
-337 ✅
-421 ✅
-0.56%
-0.61%
-0.25%
-0.14%
-0.45%
-0.21%
LSP6SetDataRestrictedController execute
givePermissionsToController
-197 ✅
-42 ✅
-0.57%
-0.03%
LSP6SetDataUnrestrictedController execute
givePermissionsToController
-197 ✅
-42 ✅
-0.57%
-0.03%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
LSP6ExecuteRestrictedController 3,046,507 (+2,200) transferLYXToEOA
transferLYXToUP
transferNFTToRandomEOA
transferNFTToRandomUP
transferTokensToRandomEOA
transferTokensToRandomUP
62,198 (-210)
55,389 (-350)
143,044 (-324)
248,665 (-323)
75,009 (-308)
205,805 (-385)
-0.34%
-0.63%
-0.23%
-0.13%
-0.41%
-0.19%
62,198 (-210)
55,389 (-350)
143,044 (-324)
248,665 (-323)
75,009 (-308)
205,805 (-385)
-0.34%
-0.63%
-0.23%
-0.13%
-0.41%
-0.19%
62,198 (-210)
55,389 (-350)
143,044 (-324)
248,665 (-323)
75,009 (-308)
205,805 (-385)
-0.34%
-0.63%
-0.23%
-0.13%
-0.41%
-0.19%
62,198 (-210)
55,389 (-350)
143,044 (-324)
248,665 (-323)
75,009 (-308)
205,805 (-385)
-0.34%
-0.63%
-0.23%
-0.13%
-0.41%
-0.19%
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
LSP6ExecuteUnrestrictedController 3,046,507 (+2,200) transferLYXToEOA
transferLYXToUP
transferNFTToRandomEOA
transferNFTToRandomUP
transferTokensToRandomEOA
transferTokensToRandomUP
62,585 (-350)
56,989 (-350)
141,788 (-352)
247,409 (-352)
73,753 (-337)
204,235 (-421)
-0.56%
-0.61%
-0.25%
-0.14%
-0.45%
-0.21%
62,585 (-350)
56,989 (-350)
141,788 (-352)
247,409 (-352)
73,753 (-337)
204,235 (-421)
-0.56%
-0.61%
-0.25%
-0.14%
-0.45%
-0.21%
62,585 (-350)
56,989 (-350)
141,788 (-352)
247,409 (-352)
73,753 (-337)
204,235 (-421)
-0.56%
-0.61%
-0.25%
-0.14%
-0.45%
-0.21%
62,585 (-350)
56,989 (-350)
141,788 (-352)
247,409 (-352)
73,753 (-337)
204,235 (-421)
-0.56%
-0.61%
-0.25%
-0.14%
-0.45%
-0.21%
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
LSP6SetDataRestrictedController 3,034,499 (+2,208) execute
givePermissionsToController
restrictControllerToERC725YKeys
30,328 (-352)
122,644 (-42)
141,430 (-43)
-1.15%
-0.03%
-0.03%
34,317 (-197)
122,644 (-42)
141,430 (-43)
-0.57%
-0.03%
-0.03%
34,317 (-197)
122,644 (-42)
141,430 (-43)
-0.57%
-0.03%
-0.03%
38,306 (-43)
122,644 (-42)
141,430 (-43)
-0.11%
-0.03%
-0.03%
2 (0)
1 (0)
1 (0)
LSP6SetDataUnrestrictedController 3,034,499 (+2,208) execute
givePermissionsToController
restrictControllerToERC725YKeys
30,328 (-352)
128,644 (-42)
149,930 (-43)
-1.15%
-0.03%
-0.03%
34,317 (-197)
128,644 (-42)
149,930 (-43)
-0.57%
-0.03%
-0.03%
34,317 (-197)
128,644 (-42)
149,930 (-43)
-0.57%
-0.03%
-0.03%
38,306 (-43)
128,644 (-42)
149,930 (-43)
-0.11%
-0.03%
-0.03%
2 (0)
1 (0)
1 (0)

@CJ42 CJ42 force-pushed the chore/review branch 3 times, most recently from 80a8d74 to 9a06b57 Compare November 3, 2023 13:49
contracts/LSP6KeyManager/LSP6KeyManagerCore.sol Outdated Show resolved Hide resolved
contracts/LSP6KeyManager/LSP6KeyManagerCore.sol Outdated Show resolved Hide resolved
Comment on lines 1227 to 1229
Update the status from `false` to `true` and checks if
the status is `true` in order to revert the call unless the caller has the `REENTRANCY` permission
Used in the beginning of the [`lsp20VerifyCall`](#`lsp20verifycall`), [`_execute`](#`_execute`) and [`_executeRelayCall`](#`_executerelaycall`) functions, before the methods execution starts.
Copy link
Member

Choose a reason for hiding this comment

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

Suggestions written for contracts/LSP6KeyManager/LSP6KeyManagerCore.sol apply here as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jenea This Markdown document is auto-generated from the Natspec comment in the .sol file.
So updating the .sol file will update automatically this file.

For your info, so that you don't have to review the same twice for any future code review :)

@CJ42 CJ42 merged commit e7ef125 into develop Nov 6, 2023
25 checks passed
@CJ42 CJ42 deleted the chore/review branch November 6, 2023 13:36
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.

4 participants