Reference

JavaScript engine

One module for the site, the CLI and the tests.

src/engine/octopus-engine.mjs runs in the browser and in Node. It depends only on ethers v6.

FunctionReturns
newArms(n)n fresh wallets { address, privateKey }
executeDigest(chainId, wallet, calls, nonce, deadline)bytes32, identical to the contract's
prepareArm({ privateKey, chainId, impl, calls, deadline, nonce?, authNonce? })A job with its signature and its signed EIP-7702 authorization
jobTuple(arm), fireData(arms, atomic)Calldata pieces
fire(sponsor, octopus, arms, { atomic })Sends ONE type-4 transaction, returns the receipt
designatorOf(impl)The 23-byte marker
call.curveBuy(quoteIn, minOut, recipient)Calldata for a launchpad curve buy

The digest function matches Foundry's output byte for byte, checked in the tests. src/engine/octopus-sim.mjs applies the contract rules to an in-memory ledger for the playground. It is a teaching and testing tool, not a replacement for the contracts.