-
Notifications
You must be signed in to change notification settings - Fork 51
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
fix: update logic to check against controller permissions when setting its Allowed Calls or ERC725Y Data Keys #734
Conversation
👋 Hello ⛽📊 Gas Benchmark ReportDeployment Costs
Runtime CostsUniversalProfile owned by an 🔑 EOA🔀
|
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 | 42198 (-12 📉✅) |
Transfer 1 LYX to a UP with 256 bytes of data | 44843 (-12 📉✅) |
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 (-12 📉✅) |
Transfer 0.1 LYX to 3x UPs with 256 bytes of data | 100357 (0 ) |
🗄️ 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 (12 📈❌) |
Set a 160 bytes long value | 164453 (0 ) |
Set a 300 bytes long value | 279700 (12 📈❌) |
Set a 600 bytes long value | 484112 (-24 📉✅) |
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 (12 📈❌) |
Set 2 data keys of 100 bytes long value | 260618 (0 ) |
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 | 159126 (0 ) |
Minting a LSP8Token to an EOA from an EOA | 126433 (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 | 60408 (0 ) | 73899 (0 ) |
LYX transfer --> to a UP | 62010 (0 ) | 76988 (0 ) |
LSP7 token transfer --> to an EOA | 117832 (0 ) | 132523 (0 ) |
LSP7 token transfer --> to a UP | 254217 (0 ) | 268908 (0 ) |
LSP8 NFT transfer --> to an EOA | 182075 (0 ) | 196743 (0 ) |
LSP8 NFT transfer --> to a UP | 301707 (0 ) | 316375 (0 ) |
🗄️ setData
scenarios
setData scenarios |
👑 main controller | 🛃 restricted controller |
---|---|---|
Update Profile details (LSP3Profile Metadata) | 68545 (0 ) | 78544 (0 ) |
Add a new controller with permission to SET_DATA + 3x allowed data keys: AddressPermissions[] + AddressPermissions[index] + AddressPermissions:Permissions:<controller> + AddressPermissions:AllowedERC725YDataKeys:<controller ) |
211942 (0 ) | 222007 (425 📈❌) |
Update permissions of previous controller. Allow it now to SUPER_SETDATA |
53432 (0 ) | 56415 (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: |
80426 (0 ) | 91651 (158 📈❌) |
Write 5x new LSP12 Issued Assets | 68098 (0 ) | 102702 (0 ) |
Update 3x data keys (first 3) | 127385 (0 ) | 161466 (0 ) |
Update 3x data keys (middle 3) | 107473 (0 ) | 145620 (0 ) |
Update 3x data keys (last 3) | 127385 (0 ) | 170953 (0 ) |
Set 2 x new data keys + add 3x new controllers | 815830 (0 ) | 877377 (1,278 📈❌) |
Changes to gas cost
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
db9bb0d
to
9114dec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this PR introduce?
🐛 Bug + ♻️ Refactor
This PR solves a small user bug.
When setting the Allowed Calls or Allowed ERC725Y Data Keys of a controller, currently the logic to check if the permission needed to set these values between
ADD_CONTROLLER
orEDIT_PERMISSIONS
is to check against the value for the data key being set. This data key can be:AddressPermissions:AllowedCalls:<controller>
AddressPermissions:AllowedERC725YDataKeys:<controller>
Update this logic to check now if the controller is actually a controller with some permission, by checking under the
AddressPermissions:Permissions:<controller>
instead.PR Checklist
npm run lint
&&npm run lint:solidity
(solhint)npm run format
(prettier)npm run build
npm run test