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

NDEV-2505: Code review suggestions #254

Merged

Conversation

andreisilviudragnea
Copy link

No description provided.

@andreisilviudragnea andreisilviudragnea added the fullTestSuite Run OZ tests and part of dapps tests label Jan 11, 2024
@neonlabstech
Copy link

Dapps report

Cost report for "Uniswap V3" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Token approve 0.00228896 0.0039659932332736 9 1 1164480 1144480 98.28
NonfungiblePositionManager - Mint position 0.02730384 0.0473083167387744 4 28 30739120 13651920 44.41
NonfungiblePositionManager - Increase liquidity 0.00044 0.0007623711304 23 23 4364240 220000 5.04
NonfungiblePositionManager - Decrease Liquidity 0.00139808 0.0024223996136128 17 1 4274240 699040 16.35
NonfungiblePositionManager - Collect Fees 0.00455792 0.0078938849845504 20 1 3497360 2278960 65.16
NonfungiblePositionManager - Burn Liquidity Position 2e-05 3.4633651400000006e-05 15 1 3954560 10000 0.25
Direct swap 2e-05 3.4633651400000006e-05 17 1 1328400 10000 0.75
Burn transaction 0.00047936 0.0008300993567552001 11 1 739040 239680 32.43
Collect transaction 0.00228896 0.0039637521354272 12 1 1633840 1144480 70.05

Cost report for "Aave" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Token mint 0.00228896 0.0039637521354272 9 1 1164480 1144480 98.28
Token approve 0.00228896 0.0039637521354272 9 1 1164480 1144480 98.28
Deposit to lending pool 0.0077856 0.013482187816992 4 5 4761840 3892800 81.75
Borrow from lending pool 0.00508792 0.0088121686602704 4 30 3737360 2543960 68.07
Repay 0.00049 0.0008486695237999999 4 27 2586800 245000 9.47
Flashloan 0.00501792 0.008690930156870402 4 28 7360480 2508960 34.09
Withdraw 7e-05 0.0001212385034 4 5 1857760 35000 1.88
Liquidation 0.00335896 0.0058166837236552004 4 57 4940000 1679480 34.0

Cost report for "Saddle Finance" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Add liquidity 0.00229896 0.0039752496036792005 3 2 3181920 1149480 36.13
Swap DAI -> USDC 2e-05 3.4658731400000005e-05 21 1 1797760 10000 0.56
Swap USDC -> DAI 2e-05 3.4640837600000006e-05 21 1 1797760 10000 0.56
Remove liquidity 2e-05 3.4640837600000006e-05 23 1 1937440 10000 0.52
Add liquidity in 3 Tokens 0.00278896 0.0048305955216448 4 30 4220640 1394480 33.04
Swap DAI -> USDC 3 pool 2e-05 3.46536132e-05 21 1 1807760 10000 0.55
Swap USDC -> USDT 3 pool 2e-05 3.46536132e-05 21 1 1807760 10000 0.55
Swap USDC -> DAI 3 pool 2e-05 3.45567652e-05 21 1 1807760 10000 0.55
Remove liquidity 3 pool 3e-05 5.18487138e-05 3 2 2646480 15000 0.57
Add liquidity in metapool 0.00285896 0.004942958066051199 3 31 3271920 1429480 43.69
Swap SUSD -> LP metapool 2e-05 3.4591803000000005e-05 22 1 1807760 10000 0.55
Swap USDC -> SUSD metapool 0.00103 0.0017816659016000002 4 53 3775520 515000 13.64
Swap DAI -> USDT metapool 0.00056 0.0009695664104 4 30 3086160 280000 9.07
Remove liquidity in Metapool 2e-05 3.4626924800000004e-05 23 1 1937440 10000 0.52

@mickvangelderen mickvangelderen merged commit 4402348 into NDEV-2505-fix-extcodehash Jan 12, 2024
8 checks passed
mickvangelderen pushed a commit that referenced this pull request Jan 12, 2024
* Remove unused AccountStorage::code_hash method

* Replace Buffer::buffer_is_empty with [T]::is_empty

* Rename from_address to address (consistent with trait)

* Rename buffer to code

* Inline data_account_exists method

* Remove TODOs

* Reformat

* Add test_keccak_hash_empty_slice

* Add Buffer::is_empty tests

* Use early return to simplify code flow
mickvangelderen added a commit that referenced this pull request Jan 17, 2024
* Fix EXTHASHCODE

* NDEV-2505: Code review suggestions (#254)

* Remove unused AccountStorage::code_hash method

* Replace Buffer::buffer_is_empty with [T]::is_empty

* Rename from_address to address (consistent with trait)

* Rename buffer to code

* Inline data_account_exists method

* Remove TODOs

* Reformat

* Add test_keccak_hash_empty_slice

* Add Buffer::is_empty tests

* Use early return to simplify code flow

* Move `Database` convenience functions to extension trait

Added `DatabaseExt` which implements functions that can be implemented
in terms of `Database`.

* Update comments and naming

* Add tests

* Address comment

* Refactor unit tests

* Replace maybe_async::test with tokio::test

The maybe_async::test predicate does not work with `cargo test-sbf`
right now anyway.

* Fix typo

---------

Co-authored-by: Andrei Silviu Dragnea <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fullTestSuite Run OZ tests and part of dapps tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants