Enso 백서

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 35쪽 중 22쪽

lockchain frameworks. For example, suppose Aave is deployed on Ethereum mainnet and not on Arbitrum. In that case, the state data of Aave on Ethereum mainnet is not shared with Aave on Arbitrum or accessible. Resulting in developers building manual integrations for each blockchain framework, and smart contract. The Enso Network stores all data required for execution, and data fetching for each smart contract on each framework. In the above example for Aave, Aave is represented as an entity in the graph, and the relevant ChainIDs associated to associate the blockchains that Aave is deployed on. Particular data such as function signatures, inputs, outputs, validation, and getters for state validation are added within the Aave entity. The underlying action that within the protocol entity is [identified as an action type](/pages/build/reference/actions), such as: `Lend`, `Borrow`, `Swap`, `NFT`, `Transfer`, `Approve`, `Deposit`, `Repay`, and many more. By having each action type identified, consumption can be easily done, and developers can embed more smart contract types into their applications. For example, an LLM wishing to do data harvesting and analysis across all lending protocols can easily consume the `Lend` action type from the Enso Network. ## Consumption By having a shared network state aware of all information across all blockchain frameworks, developers can now simply express their desired outcome as an `intent` request. An `intent` request does not explicitly need to be for only one use case; it can encompass multiple smart contract interaction types across multiple blockchain frameworks. # Tokenomics Source: https://docs.enso.build/pages/network/token Token utility and usage Enso is the native token used within the Enso network. The Enso token is a critical component of the Enso ecosystem, and the network cannot function without the token. | Property | Value | | - | - | | Ticker | ENSO | | Total token supply(genesis) | 100,000,000 | | Max token supply | 127,339,703 (Initial annual inflation starts at 8% and gradually decays monthly to 0.35468% by year 10, after which inflation ceases) | | Token address(ETH) | [https://etherscan.io/token/0x699F088b5DddcAFB7c4824db5B10B57B37cB0C66](https://etherscan.io/token/0x699F088b5DddcAFB7c4824db5B10B57B37cB0C66) | | Token address(BSC) | [https://bscscan.com/address/0xfeb339236d25d3e415f280189bc7c2fbab6ae9ef](https://bscscan.com/address/0xfeb339236d25d3e415f280189bc7c2fbab6ae9ef) | ## Token Distribution This table illustrates the allocation of ENSO tokens among the different participants within the Enso ecosystem. | Category | Description | Token Allocation (%) | | - | - | - | | Ecosystem | To foster the ecosystem, drive research and development, and ensure the network’s sustainable expansion over time. Including airdrop | 21.59% | | Foundation | To cover operational costs, strengthen governance, and ensure the Enso Foundation’s sustainable development. | 16.605% | | Community Round | Oversubscribed community round conducted on CoinList. | 4% | | Advisor | To two advisors who guided Enso before its founding and have continued their support across its full journey. | 1.5% | | Investors | Investors who have supported Enso since inception. | 31.305% | | Team | To reward the ongoing alignment and long-term contributions of both current and future team members. | 25% | | **Total** | **Total token supply** | 100% | <img alt="33_token_economics.png" /> ## Unlock Schedule ENSO is unlocked according to the schedule depicted below. The schedule illustrates how ENSO will be distributed among different groups, including the Enso ecosystem, Advisors, Community round participants, investors, team, and the Enso Foundation. Investors, team and advisors are subject to a 1-year lockup (cliff). At 1 year, tokens are released linearly, block by block, over 24 months. <img alt="graphic_enso.png" /> ## Key Functionality 1. **Governance**: Enso Token serve as governance token that can be staked (locked in wallet) to participate through voting in the Enso decentralized autonomous organisation (DAO) that governs the further development of the Protocol smart contracts (will be updated through new versions; while the old versions will still exist). The DAO does not host any votes on the allocation of assets to the Enso Token holders or on the amount of assets allocated to them. Further, there will be no staking reward for such staking in order to vote. The voting will require a quorum. If the quorum is reached and the vote is successful, the proposal can be implemented. 2. **Validation**: Enso Tokens need to be staked (locked in wallet) in order to validate action calldata, including Shortcuts, returned by the Protocol and external third parties, by simulating transactions using simulation software, via a proof-of-stake mechanism (Validators) in accordance with the following characteristics (Validation Function): * The Validation Function has the purpose to support the security and operations of the Protocol. * Enso Tokens are staked, i.e. locked by the system within the wallet of the Validator, in order to serve as a collateral ("stake") for ensuring the provision of correct validation of the action calldata, including Shortcuts. 3. **Delegation**: Enso Tokens can be staked for the benefit of a Validator for validating calldata, including Shortcuts, against a share of the Validation Revenue earned by such Validator. # Simulating Transactions Source: https://docs.enso.build/pages/quoter/guides/simulate Simulate any EVM transaction to predict output amounts and gas consumption. The simulate endpoint executes your transaction on a forked EVM state and returns predicted output amounts, gas consumed, and a `simulationId` for subsequent validation. ``` POST https://quoter.api.enso.build/api/v1/simulate ``` To simulate multiple transactions in one request (same `tokenIn`, `tokenOut`, and `amountIn`), use the batch endpoint: ``` POST https://quoter.api.enso.build/api/v1/simulate/batch ``` Pass `transactions` (an array of `TransactionDto`) instead of `transaction`. The response contains a `results` array in the same order — each item has the same shape as a single `/simulate` response, with its own `simulationId` for `/validate`. Up to 5 transactions per request. ```bash theme={null} curl -X POST https://quoter.api.enso.build/api/v1/simulate/batch \ -H "Authorization: Bearer $ENSO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "chainId": 1, "transactions": [ { "data": "0x3593564c...", "value": "1000000000000000000", "to": "0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD", "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" }, { "data": "0x472b43f3...", "value": "1000000000000000000", "to": "0xDef1C0ded9bec7F1a1670819833240f027b25FDF", "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" } ], "tokenIn": ["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"], "tokenOut": ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"], "amountIn": ["1000000000000000000"] }' ``` ## Request Parameters ### Top-level fields | Field | Type | Required | Description | | - | - | - | - | | `chainId` | `number` | Yes | Chain ID (e.g., `1` for Ethereum, `42161` for Arbitrum) | | `transaction` | `TransactionDto` | Yes | The transaction to simulate (see below) | | `tokenIn` | `string[]` | Yes | Input token addresses | | `tokenOut` | `string[]` | Yes | Output token addresses to track | | `amountIn` | `string[]` | Yes | Input amounts in wei (one per `tokenIn`) | | `preSimulationTransactions` | `TransactionDto[]` | No | Setup transactions to run before the main simulation | ### Transaction fields | Field | Type | Required | Description | | - | - | - | - | | `data` | `string` | Yes | Hex-encoded calldata | | `value` | `string` | Yes | Native token value in wei | | `to` | `string` | Yes | Target contract address | | `from` | `string` | Yes | Sender address | | `operationType` | `number` | No | `0` = Call (default), `1` = DelegateCall | | `receiver` | `string` | No | Token receiver address (if different from sender) | | `spender` | `string` | No | Address that needs to be approved on each `tokenIn` to perform simulation | | `executor` | `string` | No | Contract executor address | | `origin` | `string` | No | Original caller address | | `authorityDelegate` | `string` | No | Delegation authority address | | `initCode` | `string` | No | Init code for contract creation | ## Response | Field | Type | Description | | - | - | - | | `simulationId` | `string` | UUID for this simulation. Use with `/validate`. | | `chainId` | `number` | Chain ID the simulation ran on | | `result.status` | `"Success" \| "Error"` | Whether the simulated transaction would succeed | | `result.amountOut` | `string[]` | Predicted output amounts in wei (one per `tokenOut`) | | `result.gas` | `string` | Gas consumed during simulation | | `result.error` | `object` | Error details when `status` is `"Error"` | ## Examples <Tabs> <Tab title="Token Swap"> Simulate a swap from ETH to USDC on Ethereum mainnet. <CodeGroup> ```bash cURL theme={null} curl -X POST https://quoter.api.enso.build/api/v1/simulate \ -H "Authorization: Bearer $ENSO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "chainId": 1, "transaction": { "data": "0x3593564c...", "value": "1000000000000000000", "to": "0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD", "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" }, "tokenIn": ["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"], "tokenOut": ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"], "amountIn": ["1000000000000000000"] }' ``` ```typescript TypeScript theme={null} const simulation = await fetch("https://quoter.api.enso.build/api/v1/simulate", { method: "POST", headers: { "Authorization": `Bearer ${ENSO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ chainId: 1, transaction: { data: "0x3593564c...", value: "1000000000000000000", to: "0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD", from: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", }, tokenIn: ["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"], tokenOut: ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"], amountIn: ["1000000000000000000"], }), }).then((res) => res.json()); ``` </CodeGroup> </Tab> <Tab title="Vault Deposit"> Simulate depositing USDC into a Yearn vault. <CodeGroup> ```bash cURL theme={null} curl -X POST https://quoter.api.enso.build/api/v1/simulate \ -H "Authorization: Bearer $ENSO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "chainId": 1, "transaction": { "data": "0x6e553f65...", "value": "0", "to": "0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE", "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" }, "tokenIn": ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"], "tokenOut": ["0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE"], "amountIn": ["1000000000"] }' ``` ```typescript TypeScript theme={null} const simulation = await fetch("https://quoter.api.enso.build/api/v1/simulate", { method: "POST", headers: { "Authorization": `Bearer ${ENSO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ chainId: 1, transaction: { data: "0x6e553f65...", value: "0", to: "0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE", from: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", }, tokenIn: ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"], tokenOut: ["0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE"], amountIn: ["1000000000"], }), }).then((res) => res.json()); ``` </CodeGroup> </Tab> <Tab title="DelegateCall"> Simulate with `operationType: 1` for smart account (DelegateCall) execution. <CodeGroup> ```bash cURL theme={null} curl -X POST https://quoter.api.enso.build/api/v1/simulate \ -H "Authorization: Bearer $ENSO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "chainId": 1, "transaction": { "data": "0x3593564c...", "value": "0", "to": "0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E", "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "operationType": 1 }, "tokenIn": ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"], "tokenOut": ["0xdAC17F958D2ee523a2206206994597C13D831ec7"], "amountIn": ["1000000000"] }' ``` ```typescript TypeScript theme={null} const simulation = await fetch("https://quoter.api.enso.build/api/v1/simulate", { method: "POST", headers: { "Authorization": `Bearer ${ENSO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ chainId: 1, transaction: { data: "0x3593564c...", value: "0", to: "0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E", from: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", operationType: 1, }, tokenIn: ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"], tokenOut: ["0xdAC17F958D2ee523a2206206994597C13D831ec7"], amountIn: ["1000000000"], }), }).then((res) => res.json()); ``` </CodeGroup> </Tab> </Tabs> ## Handling Simulation Errors When `result.status` is `"Error"`, the `result.error` field contains details about why the transaction would fail. Common causes: * **Contract revert** — The transaction would revert on-chain (e.g., insufficient balance, failed require check) * **Invalid calldata** — The `data` field doesn't match any function signature on the target contract * **Out of gas** — The transaction requires more gas than available ```typescript theme={null} const simulation = await fetch("https://quoter.api.enso.build/api/v1/simulate", { method: "POST", headers: { "Authorization": `Bearer ${ENSO_API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify(request), }).then((res) => res.json()); if (simulation.result.status === "Error") { console.error("Simulation failed:", simulation.result.error); } else { console.log("Predicted output:", simulation.result.amountOut); console.log("Gas estimate:", simulation.result.gas); } ``` See the [Error Handling reference](/pages/quoter/reference/error-handling) for a full list of error types and how to handle them. <div> <p>Updated </p> </div> # Third-Party Transactions Source: https://docs.enso.build/pages/quoter/guides/third-party-transactions Use Quoter with transactions from any source. Quoter is source-agnostic. Any valid EVM transaction calldata can be simulated and validated, regardless of where it came from. ## Supported Sources <CardGroup> <Card title="DEX Aggregators" icon="right-left"> 1inch, 0x Protocol, Paraswap, Odos, KyberSwap, OpenOcean </Card> <Card title="DeFi Protocols" icon="vault"> Aave, Compound, Uniswap, Yearn, Morpho, Maker </Card> <Card title="Custom Contracts" icon="code"> Your own smart contracts, multisig wallets, ERC-4337 UserOps </Card> </CardGroup> ## Example: Custom Contract Interaction Encode a contract call with viem and simulate it with Quoter. <CodeGroup> ```typescript TypeScript theme={null} import { encodeFunctionData, parseAbi } from "viem"; // Step 1: Encode your contract call const data = encodeFunctionData({ abi: parseAbi(["function deposit(uint256 amount, address receiver) returns (uint256)"]), functionName: "deposit", args: [1000000000n, "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"], }); // Step 2: Simulate with Quoter const simulation = await fetch("https://quoter.api.enso.build/api/v1/simulate", { method: "POST", headers: { "Authorization": `Bearer ${ENSO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ chainId: 1, transaction: { data, value: "0", to: "0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE", from: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", }, tokenIn: ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"], tokenOut: ["0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE"], amountIn: ["1000000000"], }), }).then((res) => res.json()); ``` </CodeGroup> ## Mapping Transaction Fields When working with different web3 libraries, here's how to extract the fields Quoter expects: | Quoter Field | viem | ethers.js v6 | web3.js | | - | - | - | - | | `data` | `tx.data` | `tx.data` | `tx.data` | | `to` | `tx.to` | `tx.to` | `tx.to` | | `from` | `tx.from` | `tx.from` | `tx.from` | | `value` | `tx.value.toString()` | `tx.value.toString()` | `tx.value` | <Info> Quoter does not modify your transaction. It only simulates and validates. The transaction you submit on-chain is exactly what you built. </Info> <div> <p>Updated </p> </div> # Validating Transactions Source: https://docs.enso.build/pages/quoter/guides/validate Validate unsigned transactions against prior simulations before signing. The validate endpoint ensures that the unsigned transaction you're about to sign matches exactly what was simulated. Each field is checked independently, so you know precisely what changed if validation fails. ``` POST https://quoter.api.enso.build/api/v1/validate ``` ## Request Parameters | Field | Type | Required | Description | | - | - | - | - | | `simulationId` | `string` (UUID) | Yes | The `simulationId` from a prior `/simulate` call | | `transaction.data` | `string` | Yes | Hex-encoded calldata | | `transaction.to` | `string` | Yes | Target contract address | | `transaction.from` | `string` | Yes | Sender address | | `transaction.value` | `string` | Yes | Native token value in wei | | `transaction.chainId` | `number` | Yes | Chain ID | ## Response | Field | Type | Description | | - | - | - | | `valid` | `boolean` | `true` only when **all** checks pass | | `simulationId` | `string` | The simulation ID validated against | | `checks.chainId` | `boolean` | Chain ID matches | | `checks.data` | `boolean` | Calldata hash matches | | `checks.to` | `boolean` | Target contract address matches | | `checks.from` | `boolean` | Sender address matches | | `checks.value` | `boolean` | Native token value matches | ## Examples ### Successful Validation <CodeGroup> ```bash cURL theme={null} curl -X POST https://quoter.api.enso.build/api/v1/validate \ -H "Authorization: Bearer $ENSO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "simulationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "transaction": { "data": "0x3593564c...", "to": "0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E", "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "value": "1000000000000000000", "chainId": 1 } }' ``` ```typescript TypeScript theme={null} const result = await fetch("https://quoter.api.enso.build/api/v1/validate", { method: "POST", headers: { "Authorization": `Bearer ${ENSO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ simulationId: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", transaction: { data: "0x3593564c...", to: "0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E", from: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", value: "1000000000000000000", chainId: 1, }, }), }).then((res) => res.json()); ``` </CodeGroup> **Response:** ```json theme={null} { "valid": true, "simulationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "checks": { "chainId": true, "data": true, "to": true, "value": true, "from": true } } ``` ### Failed Validation (Tampered Data) If the calldata has been modified since simulation, the `data` check will fail: ```json theme={null} { "valid": false, "simulationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "checks": { "chainId": true, "data": false, "to": true, "value": true, "from": true } } ``` ## Interpreting Failed Checks | Check | When `false` | Likely Cause | | - | - | - | | `data` | Calldata was modified | Transaction payload was tampered with, or a different function/arguments were encoded | | `to` | Target contract changed | The transaction is being sent to a different contract than simulated | | `from` | Sender changed | A different account is submitting the transaction | | `value` | ETH value changed | The native token amount was modified | | `chainId` | Wrong chain | The transaction is targeting a different chain than simulated | <Warning> If any check fails, **do not sign the transaction**. Re-simulate to get a fresh `simulationId`, or in
프로젝트로 돌아가기