Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Gateway release 4 and the official ERC-4337 and Permit2 interfaces

IntentGatewayV2 now lands proxies at `VERSION` 4. Release 4 is the implementation that binds solver
selection to the EntryPoint v0.9 UserOperation. Storage is the same as at 3.

`migrate()` takes a proxy from 3 to 4 and writes nothing else. It takes no arguments and runs only
on a proxy exactly one version behind. The v2 path, which moved the relayer slot and set the owner,
is gone, because every live proxy is already at 3. `IIntentGatewayV2` in `@hyperbridge/core` no
longer declares `migrate`.

Governance upgrades a gateway with `execute_on_gateway` carrying
`upgradeToAndCall(newImpl, migrate())`. `intentGatewayUpgradeInitialization` in
`evm/script/IntentGatewayScript.sol` builds that init data for a proxy at 3, and empty init data for
one already at 4. Upgrades no longer read `GATEWAY_OWNER`.

The gateway also exposes `entrypoint()`, the EntryPoint v0.9 address whose
`getCurrentUserOpHash()` gates a selected fill.

`fillOrder` checks each leg's shape just before filling that leg, not all legs up front. A bad later
leg still reverts the whole fill.

The SDK's `SUPPORTED_INTENTS_VERSION` is 4. An SDK on 3 refuses a gateway once it is upgraded, and
this SDK refuses one that is not, so the SDK release and the gateway upgrades ship together. On testnet chains the SDK also accepts
release 3, because the testnet gateways already run the release-4 solver selection but still report
3. The SDK releases as `@hyperbridge/sdk` 3.0.0, a major version because it refuses every mainnet
release-3 gateway.

The SDK's mainnet chain config points `SolverAccount` at
`0xaAd062555800a97Af062795189e32a3CBd045612` on Ethereum, BSC, Arbitrum, Base, Polygon and
Polkadot Hub. On the first five, `EntryPoint` moves to v0.9
(`0x433709009B8330FDa32311DF1C2AFA402eD8D009`), the EntryPoint the new account validates against.
Polkadot Hub has no EntryPoint deployed. Optimism, Gnosis and Soneium keep their previous values,
since their gateways are not upgraded. Simplex reads both addresses from this config.

The indexer lists the new account first and `0x77c3394CA5881A74f18139AC87D0c11F8Faa90cC` second on
its five mainnet chains, so solvers keep counting while they re-delegate.
`0xd5535d4DeB17F050e52B6efda2fDe00435f39279` is no longer listed.

BRIDGE (`0x5b0c50fDd52ECC0d4c682c441eaBaD41FfDEABBB`) is a supported token on BSC and Polygon
mainnet:

- The SDK's chain config lists it under `assets`, with 18 decimals and OpenZeppelin's storage layout
(`balanceSlot` 0, `allowanceSlot` 1).
- Simplex ships `BRIDGE` as a registry symbol, so `[[pairs]]` can name it without an `[assets]`
entry and the setup wizard declares any orderbook market in it.
- The indexer tracks solver inventory in it. It is a `yieldVaults` key with no vaults, so
`SolverInventory` holds the wallet balance only. A solver already tracked on either chain gets its
BRIDGE row at its next daily reconciliation.

`evm/` now takes interfaces from their official packages instead of declaring its own:

- `@account-abstraction/contracts@0.9.0-rc.1` for the EntryPoint (`IEntryPoint`, `IStakeManager`).
- `@uniswap/permit2` from `github:Uniswap/permit2#cc56ad0` for `ISignatureTransfer` and
`IAllowanceTransfer`. Permit2's Solidity is not published to npm.

SimplexPaymaster keeps OpenZeppelin's `IEntryPoint`, which its `PaymasterERC20` base requires. Its
v0.8 calls are explicit casts on the `ENTRYPOINT_V08` address, and `getDepositInfo`, which
OpenZeppelin's interface lacks, goes through the package's `IStakeManager`.

OpenZeppelin's account bases and the package each declare a `PackedUserOperation` struct, and
Solidity does not convert between them. Tests that send one op to both convert it at the EntryPoint
call with `toEntryPointOp` and `toEntryPointOps` from `evm/tests/foundry/EntryPointOps.sol`.
34 changes: 17 additions & 17 deletions docs/content/developers/evm/contract-addresses/mainnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ ISMP contract addresses for the following networks:
| `TokenGateway (Deprecated)` | [`0xFd413e3AFe560182C4471F4d143A96d3e259B6dE`](https://etherscan.io/address/0xFd413e3AFe560182C4471F4d143A96d3e259B6dE) |
| `CallDispatcher` | [`0xE2C7e576E26E0bE7aC97c6fE925bcDAbD87c4bEd`](https://etherscan.io/address/0xE2C7e576E26E0bE7aC97c6fE925bcDAbD87c4bEd) |
| `IntentGatewayV2` | [`0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716`](https://etherscan.io/address/0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716) |
| `IntentGatewayV2 (Implementation)` | [`0x8E6c939E4915960eDa307c28F1d14840472F2648`](https://etherscan.io/address/0x8E6c939E4915960eDa307c28F1d14840472F2648) |
| `SolverAccount` | [`0x77c3394CA5881A74f18139AC87D0c11F8Faa90cC`](https://etherscan.io/address/0x77c3394CA5881A74f18139AC87D0c11F8Faa90cC) |
| `IntentGatewayV2 (Implementation)` | [`0xF159b72f168bceb982e591176d81ca6568d008Dd`](https://etherscan.io/address/0xF159b72f168bceb982e591176d81ca6568d008Dd) |
| `SolverAccount` | [`0xaAd062555800a97Af062795189e32a3CBd045612`](https://etherscan.io/address/0xaAd062555800a97Af062795189e32a3CBd045612) |
| `SimplexPaymaster` | [`0xD4340d7466e040626383cb9cda9307ba8E081149`](https://etherscan.io/address/0xD4340d7466e040626383cb9cda9307ba8E081149) |
| `SimplexPaymaster (Implementation)` | [`0x58F678b5dA7997C7121621495ECFD8984D525e79`](https://etherscan.io/address/0x58F678b5dA7997C7121621495ECFD8984D525e79) |
| `SimplexPaymaster (Implementation)` | [`0xc2094F7094623fbA8751C58061Dd9Fe26CE5E59a`](https://etherscan.io/address/0xc2094F7094623fbA8751C58061Dd9Fe26CE5E59a) |
| `BandwidthManager` | [`0x6A67533Ce73756FfaB17c05578A5FBBa5d9B2d8d`](https://etherscan.io/address/0x6A67533Ce73756FfaB17c05578A5FBBa5d9B2d8d) |
| `ConsensusStateId` | `ETH0` |
| `StateMachine` | `EVM-1` |
Expand All @@ -42,10 +42,10 @@ ISMP contract addresses for the following networks:
| `TokenGateway (Deprecated)` | [`0xFd413e3AFe560182C4471F4d143A96d3e259B6dE`](https://arbiscan.io/address/0xFd413e3AFe560182C4471F4d143A96d3e259B6dE) |
| `CallDispatcher` | [`0xE2C7e576E26E0bE7aC97c6fE925bcDAbD87c4bEd`](https://arbiscan.io/address/0xE2C7e576E26E0bE7aC97c6fE925bcDAbD87c4bEd) |
| `IntentGatewayV2` | [`0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716`](https://arbiscan.io/address/0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716) |
| `IntentGatewayV2 (Implementation)` | [`0x8E6c939E4915960eDa307c28F1d14840472F2648`](https://arbiscan.io/address/0x8E6c939E4915960eDa307c28F1d14840472F2648) |
| `SolverAccount` | [`0x77c3394CA5881A74f18139AC87D0c11F8Faa90cC`](https://arbiscan.io/address/0x77c3394CA5881A74f18139AC87D0c11F8Faa90cC) |
| `IntentGatewayV2 (Implementation)` | [`0xF159b72f168bceb982e591176d81ca6568d008Dd`](https://arbiscan.io/address/0xF159b72f168bceb982e591176d81ca6568d008Dd) |
| `SolverAccount` | [`0xaAd062555800a97Af062795189e32a3CBd045612`](https://arbiscan.io/address/0xaAd062555800a97Af062795189e32a3CBd045612) |
| `SimplexPaymaster` | [`0x7281Bccb4f0BCE44F3B8542d1fC5e51c2F5fC08C`](https://arbiscan.io/address/0x7281Bccb4f0BCE44F3B8542d1fC5e51c2F5fC08C) |
| `SimplexPaymaster (Implementation)` | [`0x58F678b5dA7997C7121621495ECFD8984D525e79`](https://arbiscan.io/address/0x58F678b5dA7997C7121621495ECFD8984D525e79) |
| `SimplexPaymaster (Implementation)` | [`0xc2094F7094623fbA8751C58061Dd9Fe26CE5E59a`](https://arbiscan.io/address/0xc2094F7094623fbA8751C58061Dd9Fe26CE5E59a) |
| `BandwidthManager` | [`0x6A67533Ce73756FfaB17c05578A5FBBa5d9B2d8d`](https://arbiscan.io/address/0x6A67533Ce73756FfaB17c05578A5FBBa5d9B2d8d) |
| `ConsensusStateId` | Messaging: `ETH0` / Consensus: `ARB0` |
| `StateMachine` | `EVM-42161` |
Expand Down Expand Up @@ -82,10 +82,10 @@ ISMP contract addresses for the following networks:
| `TokenGateway (Deprecated)` | [`0xFd413e3AFe560182C4471F4d143A96d3e259B6dE`](https://basescan.org/address/0xFd413e3AFe560182C4471F4d143A96d3e259B6dE) |
| `CallDispatcher` | [`0xE2C7e576E26E0bE7aC97c6fE925bcDAbD87c4bEd`](https://basescan.org/address/0xE2C7e576E26E0bE7aC97c6fE925bcDAbD87c4bEd) |
| `IntentGatewayV2` | [`0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716`](https://basescan.org/address/0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716) |
| `IntentGatewayV2 (Implementation)` | [`0x8E6c939E4915960eDa307c28F1d14840472F2648`](https://basescan.org/address/0x8E6c939E4915960eDa307c28F1d14840472F2648) |
| `SolverAccount` | [`0x77c3394CA5881A74f18139AC87D0c11F8Faa90cC`](https://basescan.org/address/0x77c3394CA5881A74f18139AC87D0c11F8Faa90cC) |
| `IntentGatewayV2 (Implementation)` | [`0xF159b72f168bceb982e591176d81ca6568d008Dd`](https://basescan.org/address/0xF159b72f168bceb982e591176d81ca6568d008Dd) |
| `SolverAccount` | [`0xaAd062555800a97Af062795189e32a3CBd045612`](https://basescan.org/address/0xaAd062555800a97Af062795189e32a3CBd045612) |
| `SimplexPaymaster` | [`0x15b3B03C870c7ef252029c35A12d3b339F5c8d7f`](https://basescan.org/address/0x15b3B03C870c7ef252029c35A12d3b339F5c8d7f) |
| `SimplexPaymaster (Implementation)` | [`0x58F678b5dA7997C7121621495ECFD8984D525e79`](https://basescan.org/address/0x58F678b5dA7997C7121621495ECFD8984D525e79) |
| `SimplexPaymaster (Implementation)` | [`0xc2094F7094623fbA8751C58061Dd9Fe26CE5E59a`](https://basescan.org/address/0xc2094F7094623fbA8751C58061Dd9Fe26CE5E59a) |
| `BandwidthManager` | [`0x6A67533Ce73756FfaB17c05578A5FBBa5d9B2d8d`](https://basescan.org/address/0x6A67533Ce73756FfaB17c05578A5FBBa5d9B2d8d) |
| `ConsensusStateId` | Messaging: `ETH0` / Consensus: `BASE` |
| `StateMachine` | `EVM-8453` |
Expand All @@ -103,11 +103,11 @@ ISMP contract addresses for the following networks:
| `TokenGateway (Deprecated)` | [`0xFd413e3AFe560182C4471F4d143A96d3e259B6dE`](https://bscscan.com/address/0xFd413e3AFe560182C4471F4d143A96d3e259B6dE) |
| `CallDispatcher` | [`0xE2C7e576E26E0bE7aC97c6fE925bcDAbD87c4bEd`](https://bscscan.com/address/0xE2C7e576E26E0bE7aC97c6fE925bcDAbD87c4bEd) |
| `IntentGatewayV2` | [`0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716`](https://bscscan.com/address/0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716) |
| `IntentGatewayV2 (Implementation)` | [`0x8E6c939E4915960eDa307c28F1d14840472F2648`](https://bscscan.com/address/0x8E6c939E4915960eDa307c28F1d14840472F2648) |
| `SolverAccount` | [`0x77c3394CA5881A74f18139AC87D0c11F8Faa90cC`](https://bscscan.com/address/0x77c3394CA5881A74f18139AC87D0c11F8Faa90cC) |
| `IntentGatewayV2 (Implementation)` | [`0xF159b72f168bceb982e591176d81ca6568d008Dd`](https://bscscan.com/address/0xF159b72f168bceb982e591176d81ca6568d008Dd) |
| `SolverAccount` | [`0xaAd062555800a97Af062795189e32a3CBd045612`](https://bscscan.com/address/0xaAd062555800a97Af062795189e32a3CBd045612) |
| `BridgeToken (BRIDGE)` | [`0x5b0c50fDd52ECC0d4c682c441eaBaD41FfDEABBB`](https://bscscan.com/address/0x5b0c50fDd52ECC0d4c682c441eaBaD41FfDEABBB) |
| `SimplexPaymaster` | [`0xeD02f9f0df8F562B89cC5b25867Ad3C2d61252A9`](https://bscscan.com/address/0xeD02f9f0df8F562B89cC5b25867Ad3C2d61252A9) |
| `SimplexPaymaster (Implementation)` | [`0x58F678b5dA7997C7121621495ECFD8984D525e79`](https://bscscan.com/address/0x58F678b5dA7997C7121621495ECFD8984D525e79) |
| `SimplexPaymaster (Implementation)` | [`0xc2094F7094623fbA8751C58061Dd9Fe26CE5E59a`](https://bscscan.com/address/0xc2094F7094623fbA8751C58061Dd9Fe26CE5E59a) |
| `BandwidthManager` | [`0x6A67533Ce73756FfaB17c05578A5FBBa5d9B2d8d`](https://bscscan.com/address/0x6A67533Ce73756FfaB17c05578A5FBBa5d9B2d8d) |
| `ConsensusStateId` | `BSC0` |
| `StateMachine` | `EVM-56` |
Expand Down Expand Up @@ -170,11 +170,11 @@ ISMP contract addresses for the following networks:
| `TokenGateway (Deprecated)` | [`0x8b536105b6Fae2aE9199f5146D3C57Dfe53b614E`](https://polygonscan.com/address/0x8b536105b6Fae2aE9199f5146D3C57Dfe53b614E) |
| `CallDispatcher` | [`0xE2C7e576E26E0bE7aC97c6fE925bcDAbD87c4bEd`](https://polygonscan.com/address/0xE2C7e576E26E0bE7aC97c6fE925bcDAbD87c4bEd) |
| `IntentGatewayV2` | [`0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716`](https://polygonscan.com/address/0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716) |
| `IntentGatewayV2 (Implementation)` | [`0x8E6c939E4915960eDa307c28F1d14840472F2648`](https://polygonscan.com/address/0x8E6c939E4915960eDa307c28F1d14840472F2648) |
| `SolverAccount` | [`0x77c3394CA5881A74f18139AC87D0c11F8Faa90cC`](https://polygonscan.com/address/0x77c3394CA5881A74f18139AC87D0c11F8Faa90cC) |
| `IntentGatewayV2 (Implementation)` | [`0xF159b72f168bceb982e591176d81ca6568d008Dd`](https://polygonscan.com/address/0xF159b72f168bceb982e591176d81ca6568d008Dd) |
| `SolverAccount` | [`0xaAd062555800a97Af062795189e32a3CBd045612`](https://polygonscan.com/address/0xaAd062555800a97Af062795189e32a3CBd045612) |
| `BridgeToken (BRIDGE)` | [`0x5b0c50fDd52ECC0d4c682c441eaBaD41FfDEABBB`](https://polygonscan.com/address/0x5b0c50fDd52ECC0d4c682c441eaBaD41FfDEABBB) |
| `SimplexPaymaster` | [`0xe99acFe0f5fC4C8ea54A187D8D3b05f136150095`](https://polygonscan.com/address/0xe99acFe0f5fC4C8ea54A187D8D3b05f136150095) |
| `SimplexPaymaster (Implementation)` | [`0x58F678b5dA7997C7121621495ECFD8984D525e79`](https://polygonscan.com/address/0x58F678b5dA7997C7121621495ECFD8984D525e79) |
| `SimplexPaymaster (Implementation)` | [`0xc2094F7094623fbA8751C58061Dd9Fe26CE5E59a`](https://polygonscan.com/address/0xc2094F7094623fbA8751C58061Dd9Fe26CE5E59a) |
| `BandwidthManager` | [`0x6A67533Ce73756FfaB17c05578A5FBBa5d9B2d8d`](https://polygonscan.com/address/0x6A67533Ce73756FfaB17c05578A5FBBa5d9B2d8d) |
| `ConsensusStateId` | `POLY` |
| `StateMachine` | `EVM-137` |
Expand All @@ -190,7 +190,7 @@ ISMP contract addresses for the following networks:
| `FeeToken (USDC)` | [`0x0000053900000000000000000000000001200000`](https://blockscout.polkadot.io/address/0x0000053900000000000000000000000001200000) |
| `CallDispatcher` | [`0xE2C7e576E26E0bE7aC97c6fE925bcDAbD87c4bEd`](https://blockscout.polkadot.io/address/0xE2C7e576E26E0bE7aC97c6fE925bcDAbD87c4bEd) |
| `IntentGatewayV2` | [`0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716`](https://blockscout.polkadot.io/address/0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716) |
| `IntentGatewayV2 (Implementation)` | [`0x8E6c939E4915960eDa307c28F1d14840472F2648`](https://blockscout.polkadot.io/address/0x8E6c939E4915960eDa307c28F1d14840472F2648) |
| `SolverAccount` | [`0x77c3394CA5881A74f18139AC87D0c11F8Faa90cC`](https://blockscout.polkadot.io/address/0x77c3394CA5881A74f18139AC87D0c11F8Faa90cC) |
| `IntentGatewayV2 (Implementation)` | [`0xF159b72f168bceb982e591176d81ca6568d008Dd`](https://blockscout.polkadot.io/address/0xF159b72f168bceb982e591176d81ca6568d008Dd) |
| `SolverAccount` | [`0xaAd062555800a97Af062795189e32a3CBd045612`](https://blockscout.polkadot.io/address/0xaAd062555800a97Af062795189e32a3CBd045612) |
| `BandwidthManager` | [`0x6A67533Ce73756FfaB17c05578A5FBBa5d9B2d8d`](https://blockscout.polkadot.io/address/0x6A67533Ce73756FfaB17c05578A5FBBa5d9B2d8d) |
| `StateMachine` | `EVM-420420419` |
2 changes: 1 addition & 1 deletion docs/content/developers/sdk/api/simplex.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ resolve(symbol: string, chain: string): HexString | null
redefined — repointing one under a running market would silently redirect its fills. `resolve`
returns `null` when the asset is not deployed or not known on that chain.

The registry ships USDC, USDT, DAI, CNGN, USDR, ZARP, EURC, XSGD and TRYB.
The registry ships USDC, USDT, DAI, CNGN, USDR, ZARP, EURC, XSGD, TRYB and BRIDGE.

## WalletController

Expand Down
Loading
Loading