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

refactor: replace magic value with returnedStatus #742

Merged
merged 3 commits into from
Oct 13, 2023
Merged

Conversation

YamenMerhi
Copy link
Member

@YamenMerhi YamenMerhi commented Oct 11, 2023

What does this PR introduce?

♻️ Refactor

  • replace magic value with returnedStatus and success value

PR Checklist

  • Wrote Tests
  • Wrote & Generated Documentation (readme/natspec/dodoc)
  • Ran npm run lint && npm run lint:solidity (solhint)
  • Ran npm run format (prettier)
  • Ran npm run build
  • Ran npm run test

@github-actions
Copy link
Contributor

github-actions bot commented Oct 11, 2023

Changes to gas cost

Generated at commit: 077a083e421d29764986b2f2869ccaa9d57050d0, 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.

Great changes. Just one small review comment

constants.ts Show resolved Hide resolved
contracts/LSP20CallVerification/LSP20CallVerification.sol Outdated Show resolved Hide resolved
@CJ42 CJ42 merged commit 11454e4 into develop Oct 13, 2023
27 checks passed
@CJ42 CJ42 deleted the returnedStatus branch October 13, 2023 11:55
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.

2 participants