Skip to content

Commit

Permalink
Merge branch 'main' into snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
marktoda authored Jun 12, 2023
2 parents b305d04 + c93fc22 commit 60011e6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 30 deletions.
29 changes: 14 additions & 15 deletions .github/ISSUE_TEMPLATE/FEATURE_IMPROVEMENT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@ body:
attributes:
value: |
Please ensure that the feature has not already been requested.
- type: checkboxes
- type: dropdown
attributes:
label: Components
description: What architectural feature or area of code does your idea improve?
options:
- label: Hooks
- label: Singleton
- label: Lock and Call
- label: Delta accounting
- label: 1155 Balances
- label: Pool Actions (swap, modifyPosition, donate, take, settle, mint)
- label: Gas Optimization
- label: General design optimization (improving efficiency, cleanliness, or developer experience)
- label: Documentation
validations:
required: true
label: Component
description: Which area of code does your idea improve?
multiple: true
options:
- Hooks
- Singleton
- Lock and Call
- Delta accounting
- 1155 Balances
- Pool Actions (swap, modifyPosition, donate, take, settle, mint)
- Gas Optimization
- General design optimization (improving efficiency, cleanliness, or developer experience)
- Documentation
- type: textarea
attributes:
label: Describe the suggested feature and problem it solves.
Expand Down
14 changes: 9 additions & 5 deletions contracts/libraries/CurrencyLibrary.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@ library CurrencyLibrary {
Currency public constant NATIVE = Currency.wrap(address(0));

function transfer(Currency currency, address to, uint256 amount) internal {
// implementation from
// https://github.com/Rari-Capital/solmate/blob/3c738133a0c1697096d63d28ef7a8ef298f9af6b/src/utils/SafeTransferLib.sol

bool success;
if (currency.isNative()) {
(bool success,) = to.call{value: amount}("");
assembly {
// Transfer the ETH and store if it succeeded or not.
success := call(gas(), to, amount, 0, 0, 0, 0)
}

if (!success) revert NativeTransferFailed();
} else {
// implementation from
// https://github.com/Rari-Capital/solmate/blob/3c738133a0c1697096d63d28ef7a8ef298f9af6b/src/utils/SafeTransferLib.sol
bool success;

assembly {
// Get a pointer to some free memory.
let freeMemoryPointer := mload(0x40)
Expand Down
18 changes: 9 additions & 9 deletions test/__snapshots__/PoolManager.gas.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -136,63 +136,63 @@ Object {
exports[`PoolManager gas tests Native Tokens #mint above current price add to position existing 1`] = `
Object {
"calldataByteLength": 260,
"gasUsed": 150738,
"gasUsed": 150676,
}
`;

exports[`PoolManager gas tests Native Tokens #mint above current price new position mint first in range 1`] = `
Object {
"calldataByteLength": 260,
"gasUsed": 210480,
"gasUsed": 210419,
}
`;

exports[`PoolManager gas tests Native Tokens #mint above current price second position in same range 1`] = `
Object {
"calldataByteLength": 260,
"gasUsed": 150738,
"gasUsed": 150676,
}
`;

exports[`PoolManager gas tests Native Tokens #mint around current price add to position existing 1`] = `
Object {
"calldataByteLength": 260,
"gasUsed": 202461,
"gasUsed": 202400,
}
`;

exports[`PoolManager gas tests Native Tokens #mint around current price new position mint first in range 1`] = `
Object {
"calldataByteLength": 260,
"gasUsed": 312077,
"gasUsed": 312016,
}
`;

exports[`PoolManager gas tests Native Tokens #mint around current price second position in same range 1`] = `
Object {
"calldataByteLength": 260,
"gasUsed": 202461,
"gasUsed": 202400,
}
`;

exports[`PoolManager gas tests Native Tokens #mint below current price add to position existing 1`] = `
Object {
"calldataByteLength": 260,
"gasUsed": 163874,
"gasUsed": 163812,
}
`;

exports[`PoolManager gas tests Native Tokens #mint below current price new position mint first in range 1`] = `
Object {
"calldataByteLength": 260,
"gasUsed": 291524,
"gasUsed": 291462,
}
`;

exports[`PoolManager gas tests Native Tokens #mint below current price second position in same range 1`] = `
Object {
"calldataByteLength": 260,
"gasUsed": 163874,
"gasUsed": 163812,
}
`;

Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/PoolManager.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`PoolManager bytecode size 1`] = `26364`;
exports[`PoolManager bytecode size 1`] = `26295`;

0 comments on commit 60011e6

Please sign in to comment.