System Overview

Intro

Foresight is our transaction pre-sign API.

By leveraging our smart contract deciphering system, we can provide insights on what an unsigned transaction is about to do, before it gets executed.

In broad terms, the Foresight API offers three types of endpoints.

Endpoint Namespaces

Preview

In these endpoints, we perform a full simulation of the transaction in an offline fork of the chain, and then proceed to enrich it with our translation layer. This allows us to produce a "classified object", very similar to the classified object that our Translate API would return, but for a transaction that hasn't actually happened. For example, "This transaction will claim 200 USDC in rewards".

Unlike other simulation solutions, this endpoint provides a fully enriched description with the actual meaning of the transaction, in addition to reporting any asset transfers that will take place.

We offer this both for regular transactions and for ERC-4337 userOps.

Screen

Screen is like Preview, but with more advanced security features.

In addition to returning an enriched simulation of the unsigned transaction / userOp, it will also screen the addresses and tokens involved for security risks. Optionally, it can also screen the origin URL for the transaction.

These endpoints aggregate various security lists and repositories, and display a clear warning to the user whenever they're about to interact with a malicious contract, address, sanctioned or known bad actor.

To see some samples of Screen in action, check out this guide.

Describe

These are lighter-weight (cheaper to run) endpoints which given an unsigned transaction object, will return an English description of what is about to happen. For example, "Add to a liquidity pool" or "Claim rewards".

Implementation Notes

For all endpoints, the input is an unsigned transaction object, which is modeled after the standard Ethers object used by most EVM browser/mobile wallet implementations.

All endpoints are also capable of deciphering complex functions (multicalls, multisig calls, etc) and ERC-4337 transactions.