Conversation
| function _executePermit(PackedUserOperation calldata userOp) internal { | ||
| bytes calldata data = userOp.paymasterData(); | ||
| // Minimum length: 1 + 20 + 32 + 32 + 1 + 32 + 32 = 150 | ||
| require(data.length >= 150, "SimplexPaymaster: permit data too short"); |
There was a problem hiding this comment.
Can't we just use equalto?
| require(data.length >= 150, "SimplexPaymaster: permit data too short"); | |
| require(data.length == 150, "SimplexPaymaster: permit data too short"); |
|
|
||
| // ── Oracle helpers ─────────────────────────────────────────────── | ||
|
|
||
| /// @dev Fetch price from a Chainlink feed, normalized to 8 decimals. |
There was a problem hiding this comment.
Why normalize 8 instead of 18 decimals
There was a problem hiding this comment.
The oracle already returns the price in 8 decimals.
There was a problem hiding this comment.
I think 18 decimals is better since we'll still have to do some math with native token gas
| const paymasterAndData = packPaymasterAndData(pm) | ||
|
|
||
| // 3. Get gas prices from bundler | ||
| const gasPriceResult = await this.sendBundlerRpc<{ |
There was a problem hiding this comment.
This would fail when they use the alchemy bundler which is now our default bundler
There was a problem hiding this comment.
It should support both alchemy and pimlico
|
@royvardhan let's default to the circle paymaster when it's available and when the user has USDC balance. Our custom paymaster should only be used in cases where there's no circle paymaster or the user |
Contract: Added
SimplexPaymaster.sol— onchain ERC-4337 v0.8 paymaster accepting USDC/USDT via Chainlink oracles, with PERMIT and APPROVE modes. Deployed on Base and BSC for testing.Deployment: Added
DeploySimplexPaymaster.s.soland paymaster config entries toconfig.mainnet.toml.SDK: Replaced Circle paymaster with self-contained
buildPaymasterData()— auto-selects token by balance, auto-detects permit support, falls back to capped approval for non-permit tokens (BSC).Simplex:
DelegationServicenow delegates via bundlerUserOpwith paymaster paying gas — solver needs zero native tokens. Falls back to direct tx.