Demonstrate a censorship-resistant transaction submission mechanism using Atlas and FastLane Labs infrastructure. This approach:
- Publishes a user's transaction to the network
- Creates a bundle for auction that includes this transaction
- Achieves guaranteed inclusion through FastLane's direct validator connectivity
- Retries failed submissions up to 3 times with 5-second intervals
sequenceDiagram
participant PM as Polymarket
participant FL as FastLane API
participant V as Validator
participant AT as Block
PM->>PM: Create dispute tx
PM->>PM: Create dummy solverOp
PM->>FL: Submit bundle (dispute tx + solverOp)
FL->>FL: Create metacall tx
FL->>V: Submit bundle (opportunities + metacall)
Note over V: Bundle auction & selection
V->>AT: Include dispute tx
V->>AT: Include metacall tx
Note over AT: Metacall included<br/>(no impact on dispute)
-
src/helpers.ts
- Common utilities and setup
- Environment variables and constants
- Network verification
- Atlas bonding functionality
-
src/opportunityTx.ts
- Core transaction customization point for users
- Defines the transaction that needs censorship resistance
- Currently implements a simple transfer, but can be modified for:
- Complex DeFi interactions
- Token transfers
- Contract deployments
- Any other transaction type
-
src/pflBundle.ts
- PFL (Priority Fee Lane) bundle creation and submission
- Solver operation building for auction participation
- DAppControl contract interaction for userOp hashing
- FastLane relay communication for validator connectivity
- Retry mechanism for failed submissions (3 attempts, 5s delay)
-
src/submitDummyBundle.ts
- Main orchestration script demonstrating the flow:
- Verify network and ensure solver has sufficient bond
- Build and sign the user's transaction
- Create a bundle including this transaction
- Submit to FastLane with retries
- Submit to RPC if not already on chain (optional)
- Main orchestration script demonstrating the flow:
-
Install dependencies:
npm install
-
Create a
.env
file with:RPC_URL= # Polygon RPC endpoint OPPORTUNITY_WALLET_PRIVATE_KEY= # Key for the transaction sender SOLVER_WALLET_PRIVATE_KEY= # Key for the bundle submitter
-
Environment:
- Network: Polygon (chainId=137)
- Uses Atlas SDK for transaction handling
- Requires RPC endpoint loaded from .env
- Private keys loaded from .env file
-
Wallet Requirements:
- Solver wallet: 0.5 MATIC minimum for bonding + gas
- Opportunity wallet: Sufficient MATIC for transaction + gas
Contract | Address | Description |
---|---|---|
Atlas | 0x4A394bD4Bc2f4309ac0b75c052b242ba3e0f32e0 |
Main Atlas contract |
PFL-dApp | 0x3e23e4282FcE0cF42DCd0E9bdf39056434E65C1F |
PFL dApp contract |
dAppSigner | 0x96D501A4C52669283980dc5648EEC6437e2E6346 |
dApp signer |