Compare two values

Compare two values on Boolean

Ethereum
Ethereum
Base
Base

Reads onchain state

Ready to run on Base

Compares two values with a chosen operator and returns a boolean. The operator can be equal, not equal, greater than, greater or equal, less than, less or equal, and, or or, applied to two numbers or two booleans. Decimals are matched between the operands so a price and a threshold compare correctly. The result is a value, not a branch. Reach for it when a later step needs the boolean itself: feed it into a while loop's condition, store it as a flag, combine several comparisons with and or or, or bubble it as the program's result. Use the predicate instead when the goal is to branch or revert.

Plug lets you combine onchain actions like this one into a single transaction, without writing a smart contract. Use in App opens a new plug with this action already in it.

Dust Guard

plug
boolean
4actions
  1. 1·Take

    Opening the inputs, amount is declared as a caller parameter, its value handed in at execution time as the figure being measured.

  2. 2·Take

    A second parameter, threshold, is taken from the caller when the plug runs, giving the floor the amount is tested against.

  3. 3·Compare two values

    Comparing amount against threshold with a greater than or equal operator, this returns true when the amount sits at or above the threshold.

  4. 4·Predicate

    Requiring that comparison to equal true, execution proceeds only when the amount clears the threshold and reverts otherwise.

Take
Take
Is

More plugs on Base

Dollar-cost average on Base · 4 plugs

Posts · 12

More on Boolean · 4