Values

Get address, get duration and get constant on Values

Ethereum
Ethereum
Base
Base
Scripting · Values

Ready to run on Base

Every plan starts from its givens: an address, a token, a constant, a duration, the state of the chain at this exact block. Getting the givens right is most of correctness, and onchain the givens are unforgiving, because a wrong constant or a stale gas assumption executes exactly as written.

A plug pins those givens once and references them everywhere. The canonical constants of onchain math are available by name rather than typed from memory: the largest integer the EVM holds, the WAD and RAY scales fixed point protocols price in, the basis point denominator, zero and one. An address or a token is declared a single time and flows through every step that needs it. A duration written in human units, minutes or days or weeks or months, resolves to the seconds every contract actually counts in. And the live chain is readable in place: the current block number, the current base fee, the identity of the execution itself.

A plan that only acts while gas is below the ceiling you set, and simply waits otherwise. A step armed at a specific block height. A deadline expressed as three days rather than as a hand computed number that was wrong once and cost real money. There are no magic numbers in a plan built this way, and no magic numbers means no four in the morning discovery of the one that was off by a digit.

More plugs on Base

Bridge from Base · 6 plugs

How to get address, get duration and get constant on Values

  • Holds an address as a named value that later steps reference.

    Reach for it to give an address a single source of truth in a plug, so changing it in one place updates every transfer, approval, or balance read that uses it.

  • Converts a count of time units into seconds.

    Reach for it to build a deadline offset from the current timestamp, to compare an elapsed delta against a required interval, or to size a cooldown for a stored timestamp check.

  • Holds a well-known constant as a named value: max uint256, WAD, RAY, basis points, one, or zero.

    Reach for it to state a bound or a sentinel, such as max uint256 as an unlimited amount or zero as an empty floor, rather than to hand a calculation a scale it already reconciles for you.

  • Holds a token as a named value that later steps reference.

    Reach for it to give a strategy one place to change its asset, so every swap, deposit, and balance read follows the same token.

  • Returns the base fee of the block this plug executes in, in wei.

    Reach for it to gate execution on a maximum fee with a predicate, so a scheduled plug waits for a cheap block, or to compute a gas cost against a strategy's expected profit.

  • Returns the number of the block this plug executes in.

    Reach for it to stamp a stored record, to key storage by block, or to require a minimum number of blocks has passed since a stored earlier value.

  • Returns the unique identifier of this plug bundle.

    Reach for it to scope storage to this plug by coiling it into a map key, or to combine with another value into a key that no other plug can collide with.

Posts · 11