Start

Quickstart

Try it in the browser, then run the proofs, then use the CLI.

1. In the browser (30 seconds)

Open the playground. Pick 8 arms, press Make the arms, Sign, then Fire. Then use the "Try to break it" buttons.

2. Run the site locally

launch.bat          # builds and serves on http://localhost:5890

3. Run the proofs

cd contracts && forge test                 # 16 tests
node --test tests-js/engine.test.mjs        # 9 tests, includes Foundry vectors
node scripts/anvil-e2e.mjs                  # a real type-4 transaction on a local node
node scripts/real-chain-check.mjs           # 8 wallets buy on a live Pons curve, real chain 4663 (simulation)

4. The CLI

set PRIVATE_KEY=0x...                 # the sponsor, never pass keys as arguments
set RPC=https://rpc.mainnet.chain.robinhood.com
node cli/octo.mjs deploy
node cli/octo.mjs arms new --n 8 --out arms.json
node cli/octo.mjs fund --arms arms.json --eth 0.05     # ETH to buy with, nothing for gas
node cli/octo.mjs buy --arms arms.json --curve 0xCURVE --eth 0.05
node cli/octo.mjs revoke --arms arms.json              # undo the delegations
Before real money

The contracts are not audited. Use small amounts, keep the arms file private, and read Limits and risks.

5. From your own code

import * as O from './src/engine/octopus-engine.mjs';

const arms = O.newArms(8);
const prepared = [];
for (const a of arms) {
  const calls = [{ to: CURVE, value: 5n * 10n ** 16n, data: O.call.curveBuy(5n * 10n ** 16n, 0n, a.address) }];
  prepared.push(await O.prepareArm({ privateKey: a.privateKey, chainId: 4663, impl: IMPL, calls, deadline }));
}
await O.fire(sponsorSigner, OCTOPUS, prepared, { atomic: true });   // ONE type-4 transaction