No-Code Intents Builder
Overview
Building Blocks
Inputs and Outputs
Cloning
Grouping
Simulation
Assets
Build-in plugins that implement asset based actions and information
Ether
Native coin actions such as transferring and converting to/from a wrapped token
Native coin balance of any address
Transferring and converting native coins available on account assets Transferring and converting directly from wallet is available on blockchains that support EIP-3074
Token
ERC20 standard interfaces for actions (transfer, approve, etc.) and information (balance of, allowance, etc.)
NFT
ERC721 and ERC1155 standards interfaces for actions (transfer from, approve, etc.) and information (balance of, owner of, etc.)
Tools
Build-in plugins for extension contracts that extends the functionality of the system
Math
Math extension allows to execute math operations such as addition, subtraction, etc. Math extension is decimal-aware, making it perfectly for doing math operations on token value. For example, 3 USDC (6 decimals) + 5 DAI (18 decimals) will automatically convert the highest decimal and result in number 8 with 18 decimals in this case. Math extension supports converting the results to a desired decimals.
When using the extension output as a token, we must define the output decimal to match tokens decimals.
Validator
Validator extension allows to compare various type of values. When using tokens amount as values, validation extension automatically matches the decimals. For example, 3 USDC (6 decimals) will considered higher than 2 DAI (18 decimals), although the value on the blockchain level is lower (6,000,000 vs 2,000,000,000,000,000,000)
Validator supports: token amounts, numbers, addresses and hashes.
Secure Storage
Secure storage extension allows to store and retrieve values on-chain. Supported values type are numbers, addresses, strings or hashes There are two types of storage: Account level and Intent level.
Account level storage keeps data associated with the account that can be updated by the account on any intent or direct transaction.
Account level storage is recommended for use cases where different intents are needed to perform a single task
Intent level storage keeps data associated with a single intent. Data can be updated only within the specific intent.
Intent level storage is recommended for use cases where there is a need to keep information about intent execution values or in combination with the recurrency feature
Batch
Solver box is replaced with any set of calls by the solver at execution. It opens up a lot of possibilities such as reverse flash loans, p2p swaps, etc.
Intents with solver box inside are gas free, so make sure to send the transaction fee directly to the solver by using the "solver address" global.
Always put validators after the solver box, to make sure you're getting the desired outcome
Protocols
Aave
Compound
Curve
Uniswap
Bridges
cBridge
Oracles
Chainlink
System
Global
Global variables holds blockchain values that are connected to the running native transaction.
Available values: block timestamp, block number, gas price, miner address, solver address and intent hash
Variables
Set of values that can be set by the solver at the execution of the intent
Supports up to 16 variables per intent
Functions
Low level function that runs as part of intent execution without the need to call external contracts
Compute and Compute hash
Low level math operators such as +, -, *, /, etc.
Validate and Validate numbers
Low level comparison operators such as >, <, =, etc.
Functions gas consumption is minimal compared to calling external contract that provides the same functionality
Flow Control
Every intent starts with a "start" box that is connected to the first call to activate. Every intent call can succeed or fail. If calls "success" or "failed" are connected to another call, this later will be activated accordingly. If "success" is not connected, intent will stop execution on call success. If "failed" is not connected, intent won't be executed if call fail.
To override the default behavior "End" and "Revert" endpoints can be used.
Contract's interface can be imported to the system and used as any other built-in plugin. When entering contract address, the system will try to retrieve all available functions from the public block explorer.
If you're working on a private contract, you can use a custom ABI.
Last updated