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

⚡️ (#1310) Avoid code duplication #1314

Merged
merged 1 commit into from
Sep 26, 2022
Merged

Conversation

MerlinEgalite
Copy link
Contributor

Pull Request

Issue(s) fixed

This pull request fixes #1310

@MerlinEgalite MerlinEgalite requested a review from a team September 23, 2022 14:27
@MerlinEgalite MerlinEgalite linked an issue Sep 23, 2022 that may be closed by this pull request
@MerlinEgalite MerlinEgalite marked this pull request as ready for review September 23, 2022 14:27
@github-actions
Copy link

Morpho-aave-v3 gas impacts (avalanche-mainnet)

Generated at commit: a5d283d279f18f39968a981bd742b49a4b87223c, compared to commit: cf7efc44e940d71b7862facb940f6ca7dcb8ca5c

🧾 Summary

Contract Method Avg (+/-) %
RewardsManager claimRewards
updateUserAssetAndAccruedRewards
+296 ❌
+238 ❌
+0.61%
+0.79%
Morpho borrow(address,uint256)
borrow(address,uint256,uint256)
claimRewards
liquidate
repay(address,address,uint256)
repay(address,uint256)
supply(address,address,uint256)
supply(address,uint256)
withdraw(address,uint256)
withdraw(address,uint256,address)
+270 ❌
+341 ❌
+248 ❌
+210 ❌
+93 ❌
+126 ❌
+349 ❌
+346 ❌
+47 ❌
-1 ✅
+0.07%
+0.14%
+0.23%
+0.19%
+0.11%
+0.06%
+0.07%
+0.11%
+0.03%
-0.00%
ExitPositionsManager liquidateLogic
repayLogic
withdrawLogic
+210 ❌
+124 ❌
+47 ❌
+0.21%
+0.06%
+0.03%
EntryPositionsManager borrowLogic
supplyLogic
+283 ❌
+345 ❌
+0.08%
+0.11%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
RewardsManager 1,643,684 (-2,407) claimRewards
updateUserAssetAndAccruedRewards
30,994 (-1)
7,226 (-1)
-0.00%
-0.01%
49,079 (+296)
30,275 (+238)
+0.61%
+0.79%
43,546 (+350)
36,337 (+349)
+0.81%
+0.97%
72,611 (+700)
64,651 (+349)
+0.97%
+0.54%
12 (0)
981 (0)
Morpho 3,497,474 (0) borrow(address,uint256)
borrow(address,uint256,uint256)
claimRewards
liquidate
repay(address,address,uint256)
repay(address,uint256)
supply(address,address,uint256)
supply(address,uint256)
withdraw(address,uint256)
withdraw(address,uint256,address)
11,320 (0)
11,009 (0)
5,899 (0)
12,141 (0)
13,470 (0)
14,171 (0)
506,091 (+349)
7,670 (0)
13,412 (0)
103,580 (-1)
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
+0.07%
0.00%
0.00%
-0.00%
375,413 (+270)
240,808 (+341)
109,448 (+248)
108,777 (+210)
87,678 (+93)
227,068 (+126)
506,091 (+349)
304,829 (+346)
177,268 (+47)
103,580 (-1)
+0.07%
+0.14%
+0.23%
+0.19%
+0.11%
+0.06%
+0.07%
+0.11%
+0.03%
-0.00%
276,355 (+349)
232,762 (+350)
115,154 (+350)
14,189 (0)
108,134 (-1)
125,896 (+280)
506,091 (+349)
206,943 (+349)
115,677 (+4)
103,580 (-1)
+0.13%
+0.15%
+0.30%
0.00%
-0.00%
+0.22%
+0.07%
+0.17%
+0.00%
-0.00%
2,098,856 (+741)
498,945 (+350)
177,726 (+700)
345,929 (+560)
141,432 (+280)
2,122,269 (+726)
506,091 (+349)
2,143,709 (+741)
1,707,241 (+461)
103,580 (-1)
+0.04%
+0.07%
+0.40%
+0.16%
+0.20%
+0.03%
+0.07%
+0.03%
+0.03%
-0.00%
199 (0)
41 (0)
14 (0)
16 (0)
3 (0)
62 (0)
2 (0)
420 (0)
80 (0)
1 (0)
ExitPositionsManager 4,238,234 (0) liquidateLogic
repayLogic
withdrawLogic
1,391 (0)
651 (0)
718 (0)
0.00%
0.00%
0.00%
100,072 (+210)
214,774 (+124)
171,203 (+47)
+0.21%
+0.06%
+0.03%
4,730 (0)
118,753 (+280)
106,058 (+280)
0.00%
+0.24%
+0.26%
338,808 (+560)
2,115,127 (+727)
1,700,154 (+461)
+0.17%
+0.03%
+0.03%
16 (0)
65 (0)
81 (0)
EntryPositionsManager 3,044,508 (0) borrowLogic
supplyLogic
484 (0)
731 (0)
0.00%
0.00%
350,533 (+283)
301,336 (+345)
+0.08%
+0.11%
270,087 (+349)
205,367 (+349)
+0.13%
+0.17%
2,095,405 (+741)
2,140,208 (+741)
+0.04%
+0.03%
240 (0)
423 (0)

@MerlinEgalite MerlinEgalite requested a review from a team September 23, 2022 16:06
@MerlinEgalite MerlinEgalite merged commit 44e8796 into dev Sep 26, 2022
@MerlinEgalite MerlinEgalite deleted the refactor/code-duplication branch September 26, 2022 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

L01. Same code for different conditions
4 participants