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

Update gas snapshots and optimize loop in EphemeralStorageLens #13

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
PCSV3PoolLensTest:testFuzz_GetPositions(int24,int24) (runs: 17, μ: 1274402, ~: 1320751)
PCSV3PoolLensTest:test_GetPopulatedTicksInRange() (gas: 495259)
PCSV3PoolLensTest:test_GetPositions() (gas: 1231579)
PCSV3PoolLensTest:test_GetSlots() (gas: 148865)
PCSV3PoolLensTest:test_GetTickBitmap() (gas: 3140056)
PCSV3PositionLensTest:testFuzz_GetPosition(uint256) (runs: 17, μ: 263786, ~: 262928)
PCSV3PositionLensTest:test_AllPositions() (gas: 17634985)
PCSV3PositionLensTest:test_GetFeesOwed() (gas: 2770490)
PCSV3PositionLensTest:test_GetPositions() (gas: 1075793)
PCSV3PositionLensTest:test_GetTotalAmounts() (gas: 2774508)
PCSV3StorageLensTest:testFuzz_extsload(bytes32) (runs: 257, μ: 33505, ~: 33635)
PCSV3StorageLensTest:test_extsload() (gas: 63395)
PCSV3TickLensTest:test_GetPopulatedTicksInRange() (gas: 726747)
PoolLensTest:testFuzz_GetPositions(int24,int24) (runs: 17, μ: 1272927, ~: 1302846)
PoolLensTest:test_GetPopulatedTicksInRange() (gas: 4194371)
PoolLensTest:test_GetPositions() (gas: 1015456)
PoolLensTest:test_GetSlots() (gas: 3455641)
PoolLensTest:test_GetTickBitmap() (gas: 3155317)
PositionLensTest:testFuzz_GetPosition(uint256) (runs: 17, μ: 260687, ~: 260219)
PositionLensTest:test_AllPositions() (gas: 1027910)
PositionLensTest:test_GetFeesOwed() (gas: 2424302)
PositionLensTest:test_GetPositions() (gas: 839875)
PositionLensTest:test_GetTotalAmounts() (gas: 2436715)
StorageLensTest:testFuzz_extsload(bytes32) (runs: 17, μ: 33500, ~: 33635)
StorageLensTest:test_extsload() (gas: 63395)
TickLensTest:test_GetPopulatedTicksInRange() (gas: 10322483)
PCSV3PoolLensTest:testFuzz_GetPositions(int24,int24) (runs: 17, μ: 1392200, ~: 1437447)
PCSV3PoolLensTest:test_GetPopulatedTicksInRange() (gas: 524480)
PCSV3PoolLensTest:test_GetPositions() (gas: 1348279)
PCSV3PoolLensTest:test_GetSlots() (gas: 151189)
PCSV3PoolLensTest:test_GetTickBitmap() (gas: 3370484)
PCSV3PositionLensTest:testFuzz_GetPosition(uint256) (runs: 17, μ: 274996, ~: 275218)
PCSV3PositionLensTest:test_AllPositions() (gas: 19719373)
PCSV3PositionLensTest:test_GetFeesOwed() (gas: 2791103)
PCSV3PositionLensTest:test_GetPositions() (gas: 1176049)
PCSV3PositionLensTest:test_GetTotalAmounts() (gas: 2794460)
PCSV3StorageLensTest:testFuzz_extsload(bytes32) (runs: 257, μ: 33810, ~: 33944)
PCSV3StorageLensTest:test_extsload() (gas: 66675)
PCSV3TickLensTest:test_GetPopulatedTicksInRange() (gas: 793601)
PoolLensTest:testFuzz_GetPositions(int24,int24) (runs: 17, μ: 1389477, ~: 1419421)
PoolLensTest:test_GetPopulatedTicksInRange() (gas: 4524074)
PoolLensTest:test_GetPositions() (gas: 1132031)
PoolLensTest:test_GetSlots() (gas: 3695636)
PoolLensTest:test_GetTickBitmap() (gas: 3385051)
PositionLensTest:testFuzz_GetPosition(uint256) (runs: 17, μ: 271318, ~: 272509)
PositionLensTest:test_AllPositions() (gas: 1137940)
PositionLensTest:test_GetFeesOwed() (gas: 2444915)
PositionLensTest:test_GetPositions() (gas: 940131)
PositionLensTest:test_GetTotalAmounts() (gas: 2456667)
StorageLensTest:testFuzz_extsload(bytes32) (runs: 17, μ: 33820, ~: 33944)
StorageLensTest:test_extsload() (gas: 66675)
TickLensTest:test_GetPopulatedTicksInRange() (gas: 11472791)
4 changes: 1 addition & 3 deletions contracts/EphemeralStorageLens.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ contract EphemeralStorageLens {
let calldataptr := slots.offset
// prettier-ignore
for { } 1 { } {
if eq(memptr, end) {
break
}
mstore(memptr, sload(calldataload(calldataptr)))
memptr := add(memptr, 0x20)
calldataptr := add(calldataptr, 0x20)
if iszero(lt(memptr, end)) { break }
}
return(0, end)
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aperture-lens",
"version": "1.0.0",
"version": "1.0.1",
"description": "Contains ephemeral lens contracts that can be called without deployment and their interfaces in various Web3 libraries.",
"author": "Aperture Finance <engineering@aperture.finance>",
"license": "Apache-2.0",
Expand Down Expand Up @@ -42,8 +42,8 @@
"test:hardhat": "hardhat test",
"snapshot": "forge snapshot --isolate",
"snapshot:diff": "forge snapshot --diff --isolate",
"prettier": "prettier -c {contracts,test}/**/*.sol ./**/*.ts",
"prettier:fix": "prettier -w {contracts,test}/**/*.sol ./**/*.ts",
"prettier": "prettier -c contracts/{*,**/*}.sol test/**/*.sol ./**/*.ts",
"prettier:fix": "prettier -w contracts/{*,**/*}.sol test/**/*.sol ./**/*.ts",
"typechain": "hardhat typechain"
},
"dependencies": {
Expand Down
Loading