-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d47e18
commit c2d52d0
Showing
16 changed files
with
63 additions
and
440 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
pragma solidity ^0.8.26; | ||
|
||
import { ECDSA as ECDSA_solady } from "@solady/src/utils/ECDSA.sol"; | ||
import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; | ||
import { ReentrancyGuardTransient } from "@openzeppelin/contracts/utils/ReentrancyGuardTransient.sol"; | ||
import { IEntryPoint } from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; | ||
import { SignatureCheckerLib } from "@solady/src/utils/SignatureCheckerLib.sol"; | ||
import { PackedUserOperation, UserOperationLib } from "@account-abstraction/contracts/core/UserOperationLib.sol"; | ||
|
@@ -19,14 +19,14 @@ import "@account-abstraction/contracts/core/Helpers.sol"; | |
* @author ShivaanshK<[email protected]> | ||
* @author livingrockrises<[email protected]> | ||
* @notice Token Paymaster for Entry Point v0.7 | ||
* @dev A paymaster that allows user to pay gas fee in ERC20 tokens. The paymaster owner chooses which tokens to | ||
* @dev A paymaster that allows user to pay gas fees in ERC20 tokens. The paymaster owner chooses which tokens to | ||
* accept. The payment manager (usually the owner) first deposits native gas into the EntryPoint. Then, for each | ||
* transaction, it takes the gas fee from the user's ERC20 token balance. The exchange rate between ETH and the token is | ||
* calculated using 1 of three methods: external price source, off-chain oracle, or a TWAP oracle. | ||
*/ | ||
contract BiconomyTokenPaymaster is | ||
BasePaymaster, | ||
ReentrancyGuard, | ||
ReentrancyGuardTransient, | ||
BiconomyTokenPaymasterErrors, | ||
IBiconomyTokenPaymaster | ||
{ | ||
|
@@ -208,7 +208,7 @@ contract BiconomyTokenPaymaster is | |
address feeToken, | ||
address oracleAggregator, | ||
uint256 exchangeRate, | ||
uint32 priceMarkup | ||
uint32 dynamicAdjustment | ||
) | ||
public | ||
view | ||
|
@@ -234,7 +234,7 @@ contract BiconomyTokenPaymaster is | |
feeToken, | ||
oracleAggregator, | ||
exchangeRate, | ||
priceMarkup | ||
dynamicAdjustment | ||
) | ||
); | ||
} | ||
|
@@ -249,7 +249,7 @@ contract BiconomyTokenPaymaster is | |
address feeToken, | ||
address oracleAggregator, | ||
uint256 exchangeRate, | ||
uint32 priceMarkup, | ||
uint32 dynamicAdjustment, | ||
bytes calldata signature | ||
) | ||
{ | ||
|
@@ -260,7 +260,7 @@ contract BiconomyTokenPaymaster is | |
feeToken = address(bytes20(paymasterAndData[PAYMASTER_DATA_OFFSET + 13:PAYMASTER_DATA_OFFSET + 33])); | ||
oracleAggregator = address(bytes20(paymasterAndData[PAYMASTER_DATA_OFFSET + 33:PAYMASTER_DATA_OFFSET + 53])); | ||
exchangeRate = uint256(bytes32(paymasterAndData[PAYMASTER_DATA_OFFSET + 53:PAYMASTER_DATA_OFFSET + 85])); | ||
priceMarkup = uint32(bytes4(paymasterAndData[PAYMASTER_DATA_OFFSET + 85:PAYMASTER_DATA_OFFSET + 89])); | ||
dynamicAdjustment = uint32(bytes4(paymasterAndData[PAYMASTER_DATA_OFFSET + 85:PAYMASTER_DATA_OFFSET + 89])); | ||
signature = paymasterAndData[PAYMASTER_DATA_OFFSET + 89:]; | ||
} | ||
} | ||
|
@@ -289,7 +289,7 @@ contract BiconomyTokenPaymaster is | |
address feeToken, | ||
address oracleAggregator, | ||
uint256 exchangeRate, | ||
uint32 priceMarkup, | ||
uint32 dynamicAdjustment, | ||
bytes calldata signature | ||
) = parsePaymasterAndData(userOp.paymasterAndData); | ||
|
||
|
@@ -300,27 +300,29 @@ contract BiconomyTokenPaymaster is | |
bool validSig = verifyingSigner.isValidSignatureNow( | ||
ECDSA_solady.toEthSignedMessageHash( | ||
getHash( | ||
userOp, priceSource, validUntil, validAfter, feeToken, oracleAggregator, exchangeRate, priceMarkup | ||
userOp, priceSource, validUntil, validAfter, feeToken, oracleAggregator, exchangeRate, dynamicAdjustment | ||
) | ||
), | ||
signature | ||
); | ||
|
||
// Return with SIG_VALIDATION_FAILED instead of reverting | ||
if (!validSig) { | ||
return ("", _packValidationData(true, validUntil, validAfter)); | ||
} | ||
|
||
|
||
} | ||
|
||
/** | ||
* @dev Post-operation handler. | ||
* This method is abstract in BasePaymaster and must be implemented in derived contracts. | ||
* @param mode The mode of the post operation (opSucceeded, opReverted, or postOpReverted). | ||
* @param context The context value returned by validatePaymasterUserOp. | ||
* @param actualGasCost Actual gas used so far (excluding this postOp call). | ||
* @param actualUserOpFeePerGas The gas price this UserOp pays. | ||
*/ | ||
function _postOp( | ||
PostOpMode mode, | ||
PostOpMode, | ||
bytes calldata context, | ||
uint256 actualGasCost, | ||
uint256 actualUserOpFeePerGas | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule account-abstraction
added at
7af70c
Submodule forge-std
updated
10 files
+1 −1 | package.json | |
+4 −0 | src/StdChains.sol | |
+2 −2 | src/StdCheats.sol | |
+1 −1 | src/StdStorage.sol | |
+193 −59 | src/Vm.sol | |
+8 −0 | src/console.sol | |
+693 −4 | src/safeconsole.sol | |
+2 −0 | test/StdChains.t.sol | |
+8 −0 | test/StdStorage.t.sol | |
+2 −2 | test/Vm.t.sol |
Submodule nexus
updated
from ab9616 to b8085a
Submodule nexus.git
deleted from
5d81e5
Submodule openzeppelin-contracts
added at
b73bcb
Submodule v3-core
updated
20 files
+25 −0 | .github/stale.yml | |
+6 −5 | README.md | |
+107 −1 | contracts/interfaces/LICENSE | |
+1 −1 | contracts/libraries/FullMath.sol | |
+107 −1 | contracts/libraries/LICENSE | |
+1 −1 | contracts/libraries/Oracle.sol | |
+1 −1 | contracts/libraries/Position.sol | |
+3 −1 | contracts/libraries/Tick.sol | |
+1 −1 | contracts/libraries/TickMath.sol | |
+21 −0 | hardhat.config.ts | |
+2 −2 | package.json | |
+3 −1 | test/NoDelegateCall.spec.ts | |
+3 −4 | test/Oracle.spec.ts | |
+4 −1 | test/UniswapV3Factory.spec.ts | |
+2 −1 | test/UniswapV3Pool.arbitrage.spec.ts | |
+3 −2 | test/UniswapV3Pool.gas.spec.ts | |
+3 −2 | test/UniswapV3Pool.spec.ts | |
+4 −2 | test/UniswapV3Pool.swaps.spec.ts | |
+5 −2 | test/UniswapV3Router.spec.ts | |
+161 −112 | yarn.lock |
Submodule v3-periphery
updated
18 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/ | ||
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ | ||
@prb/test/=node_modules/@prb/test/ | ||
@nexus/=lib/nexus/ | ||
@forge-std/=lib/forge-std/ | ||
@uniswap/v3-periphery/=lib/v3-periphery | ||
@uniswap/v3-core/=lib/v3-core | ||
@account-abstraction=node_modules/account-abstraction/ | ||
@uniswap/v3-periphery/=lib/v3-periphery/ | ||
@uniswap/v3-core/=lib/v3-core/ | ||
@account-abstraction=lib/account-abstraction/ | ||
account-abstraction=lib/account-abstraction/ | ||
@modulekit/=node_modules/modulekit/src/ | ||
@sentinellist/=node_modules/sentinellist/ | ||
@solady/=node_modules/solady | ||
@solady/=node_modules/solady/ |
Oops, something went wrong.