Skip to content

[evm, sdk, simplex]: add SimplexPaymaster#768

Draft
royvardhan wants to merge 6 commits intomainfrom
roy/simplex-paymaster
Draft

[evm, sdk, simplex]: add SimplexPaymaster#768
royvardhan wants to merge 6 commits intomainfrom
roy/simplex-paymaster

Conversation

@royvardhan
Copy link
Copy Markdown
Collaborator

@royvardhan royvardhan commented Apr 10, 2026

Contract: Added SimplexPaymaster.sol — onchain ERC-4337 v0.8 paymaster accepting USDC/USDT via Chainlink oracles, with PERMIT and APPROVE modes.

Deployment: Added DeploySimplexPaymaster.s.sol and paymaster config entries to config.mainnet.toml.

SDK: Abstracted paymaster module (src/services/paymaster/) with unified buildPaymasterAndData() entry point. Prefers Circle Paymaster (USDC permit) where available and filler has USDC balance, falls back to SimplexPaymaster (USDC/USDT, permit or capped approval).

Simplex: DelegationService now delegates via bundler UserOp with paymaster paying gas — solver needs zero native tokens. Supports Pimlico, Alchemy, and generic bundler gas pricing. Falls back to direct tx. ContractInteractionService approval scoped to exact required amount instead of maxUint256.

Comment thread evm/src/utils/SimplexPaymaster.sol Outdated
Comment thread evm/src/utils/SimplexPaymaster.sol
Comment thread sdk/packages/simplex/src/services/DelegationService.ts Outdated
@Wizdave97
Copy link
Copy Markdown
Member

@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

@royvardhan royvardhan requested a review from Wizdave97 April 11, 2026 15:55
Copy link
Copy Markdown
Member

@Wizdave97 Wizdave97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@royvardhan have we changed all the infinite approvals in simplex to per order approvals instead?

@royvardhan
Copy link
Copy Markdown
Collaborator Author

@royvardhan have we changed all the infinite approvals in simplex to per order approvals instead?

Yes.

@seunlanlege
Copy link
Copy Markdown
Member

I'm not sure i like the fact that we're using chainlink? can't we get a twap/vwap from uniswap?

@royvardhan
Copy link
Copy Markdown
Collaborator Author

I'm not sure i like the fact that we're using chainlink? can't we get a twap/vwap from uniswap?

Chainlink aggregates prices off-chain from multiple independent sources rather than relying on a single DEX pool, making it significantly harder to manipulate. It's also more gas-efficient and eliminates the need to find and track high-liquidity pools for reliable pricing.

Comment thread evm/src/utils/SimplexPaymaster.sol
Comment thread evm/src/utils/SimplexPaymaster.sol
Comment thread evm/src/utils/SimplexPaymaster.sol
@seunlanlege
Copy link
Copy Markdown
Member

Looking more at this PR it appears it still doesn't support USDT, since USDT doesn't have EIP-2612. I think we should pause work on this pending we have a solution that supports USDT otherwise circle's paymaster is still the best choice, no additional infra overhead

@seunlanlege seunlanlege marked this pull request as draft April 15, 2026 14:32
@seunlanlege
Copy link
Copy Markdown
Member

Can we split out

DelegationService now delegates via bundler UserOp with paymaster paying gas — solver needs zero native tokens.

To a different PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants