Tailflow
Skip to article
Browse documentation

Contract lookup · Action

Get contract source

Reads the published source code of a verified contract: every file's path, and the text of as many files as fit, starting with the main contract.

When to use it

Giving an AI step the contract to read before it explains what a transaction did.

At a glance

IntegrationContract lookup
Credits1
ConnectionNone

Settings

addressRequiredAccepts event fields
Contract address. The contract's address, typed or from the event.
chain
Chain. Leave it on the event's chain unless the step should always look at one chain.

What it hands on

Actions run in order, and each one can read what the actions above it produced. This one writes the fields below; a later action reaches them as {{ actions.contract_get_source_1.name }} — the action’s key, then which one it is if you use more than one of the same kind.

name
The contract's name.
compiler
The compiler and its version, such as solc 0.8.26.
files
One entry per source file, each with path, content and truncated. The main contract comes first.
truncated
True when some source text was left out to stay within the limit.
verified
True when the contract's source was found, false when it was not.

Good to know

  • A contract nobody has verified completes with verified set to false and nothing else filled in, rather than failing, so a flow that runs on every transaction carries on. Check verified in a condition before using the rest.
  • At most 32,000 characters of source text are handed on in total. The main contract comes first, then the other files in order of their paths. A file that did not fit is listed with its content cut short or empty and truncated set to true.
  • Every path is listed, up to 200 files, even when its text did not fit.