### Install OpenZeppelin Contracts Source: https://docs.entangle.fi/universal-token-standard/developer-guides/manual-deploy/examples/initial-setup Installs the @openzeppelin/contracts package using npm. This provides secure, audited smart contract components for Ethereum development, often used for standard token implementations. ```bash npm i @openzeppelin/contracts ``` -------------------------------- ### Install Entangle UTS Contracts Source: https://docs.entangle.fi/universal-token-standard/developer-guides/manual-deploy/examples/initial-setup Installs the core @entangle-labs/uts-contracts package using npm. This dependency is crucial for utilizing Entangle's utility smart contract functionalities. ```bash npm i @entangle-labs/uts-contracts ``` -------------------------------- ### Initialize Hardhat Project Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/fetch-data-via-pull-model-payg/evm-smart-contracts Steps to set up a new Hardhat project for Solidity development using yarn. This includes initializing the project, installing Hardhat as a dev dependency, and running the Hardhat initialization command, typically selecting a TypeScript project. ```bash yarn init -y # yarn initialization flow yarn add --dev hardhat yarn hardhat init # Hardhat initialization flow (select TypeScript project) ``` -------------------------------- ### Verify Entangled Installation Source: https://docs.entangle.fi/entangle-interoperable-blockchain/developer-guides/set-up-a-validator-node Verifies the successful installation of the 'entangled' binary by displaying its help message. This confirms that the build process was successful and the binary is accessible. ```shell entangled --help ``` -------------------------------- ### Install Dependencies with npm Source: https://docs.entangle.fi/universal-token-standard/developer-guides/bridge-sdk Installs project dependencies using the Node Package Manager (npm). This command downloads and installs all packages listed in the project's package.json file, ensuring the project has all necessary libraries to run. ```bash npm i ``` -------------------------------- ### Build Entangle Project Source: https://docs.entangle.fi/entangle-interoperable-blockchain/developer-guides/set-up-a-validator-node Compiles the Entangle blockchain project using the 'make install' command. This process builds the necessary binaries for running the node. ```shell make install ``` -------------------------------- ### Install Entangle Package Source: https://docs.entangle.fi/universal-token-standard/developer-guides/manual-deploy/create-a-custom-token Installs the Entangle Labs UTS Contract package using NPM. This is the first step to begin developing custom tokens or connectors. ```bash npm i @entangle-labs/uts-contracts ``` -------------------------------- ### CLUSTER_INFO.json Configuration Example Source: https://docs.entangle.fi/universal-token-standard/developer-guides/token-verification This JSON structure defines the general information and deployment details for a token within the Entangle verification system. It includes token name, symbol, deployment chains, addresses, and entity types. ```json { "General information":{ "TokenName":"Mytoken", "TokenSymbol":"MTK", "DeployedViaFactory": "false", "ChainIDs":[1, 42161] }, "Deployments": [ { "ChainId": 1, "Address": "0x", "Type": "Token", "Decimals": 18 }, { "ChainId": 42161, "Address": "0x", "Type": "Connector", "Decimals": 6 } ] } ``` -------------------------------- ### Initialize Hardhat Project Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/fetch-data-via-push-model/evm-smart-contracts Commands to create a new project directory, initialize it with Yarn, add Hardhat as a dev dependency, and initialize Hardhat with a TypeScript project setup. ```bash mkdir push-consumer && cd push-consumer yarn init -y # Yarn initialization yarn add --dev hardhat yarn hardhat init # Hardhat initialization flow(select TypeScript project) ``` -------------------------------- ### Deploy PullVerifier Contract to Sepolia Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/fetch-data-via-pull-model-payg/evm-smart-contracts Executes the Hardhat Ignition deployment command to deploy the `PullVerifier` contract to the `eth_sepolia` network. This command requires `yarn` and the Hardhat Ignition plugin to be installed. ```bash yarn hardhat ignition deploy ./ignition/modules/PullVerifier.ts --network eth_sepolia ``` -------------------------------- ### Start Entangle Node Source: https://docs.entangle.fi/entangle-interoperable-blockchain/developer-guides/set-up-a-validator-node Starts the Entangle node with the specified chain ID and sets a gas cap for JSON-RPC requests. This command launches the node and begins its synchronization process. ```shell entangled start --chain-id entangle_33033-1 --json-rpc.gas-cap 200000000 ``` -------------------------------- ### Initialize Hardhat Project with Yarn Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/fetch-data-via-pull-model-subscriptions/evm-smart-contracts Commands to initialize a new Hardhat project for Solidity development. This includes initializing a Node.js project with Yarn and installing Hardhat as a development dependency. ```bash yarn init -y # yarn initialization flow yarn add --dev hardhat yarn hardhat init # Hardhat initialization flow(select TypeScript project) ``` -------------------------------- ### Configure Hardhat for Sepolia Network Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/fetch-data-via-pull-model-payg/evm-smart-contracts Modifies the `hardhat.config.ts` file to add the `eth_sepolia` network configuration. This includes the chain ID, RPC URL, and a placeholder for the deployer's private key, enabling deployment to the Sepolia testnet. ```typescript import { HardhatUserConfig } from "hardhat/config"; import "@nomicfoundation/hardhat-toolbox"; const config: HardhatUserConfig = { solidity: "0.8.28", networks: { eth_sepolia: { chainId: 11155111, // or http://127.0.0.1:8545, if you forked it locally url: "https://ethereum-sepolia-rpc.publicnode.com", accounts: [ "0x" ], // TODO: Set deployer private key }, }, }; export default config; ``` -------------------------------- ### Deploy PullVerifier with Hardhat Ignition Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/fetch-data-via-pull-model-payg/evm-smart-contracts A Hardhat Ignition script to deploy the `PullVerifier` smart contract. It specifies the address of the `PullMarketplace` contract on the Sepolia network and instantiates the `PullVerifier` contract with this address. ```typescript import { buildModule } from "@nomicfoundation/hardhat-ignition/modules"; // PullMarketplace address on Eth Sepolia network const PullMarketplaceAddress = "0xC6670092056e7bf56c3149FDE52A187b3e9f2e63"; const PullVerifierModule = buildModule("PullVerifierModule", (m) => { const consumer = m.contract("PullVerifier", [PullMarketplaceAddress ]); return { consumer }; }); export default PullVerifierModule; ``` -------------------------------- ### Expected Hardhat Deployment Output Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/fetch-data-via-pull-model-payg/evm-smart-contracts Illustrates the typical output received after successfully deploying a contract using Hardhat Ignition. It shows the confirmation prompt, deployment progress, and the final deployed contract address on the specified network. ```bash ✔ Confirm deploy to network eth_sepolia (11155111)? … yes Hardhat Ignition 🚀 Resuming existing deployment from ./ignition/deployments/chain-11155111 Deploying [ PullVerifierModule ] Batch #1 Executed PullVerifierModule#PullVerifier [ PullVerifierModule] successfully deployed 🚀 Deployed Addresses PullVerifierModule#PullVerifier - 0xBd0AFEE88B7FcEE6139467700D6f40F13FEDa739 ``` -------------------------------- ### UTSTokenShowcase Constructor Source: https://docs.entangle.fi/universal-token-standard/developer-guides/manual-deploy/examples/uts-token/simple-token Initializes the UTSTokenShowcase contract. It sets up the UTSBase contract, configures the bridging router and chain settings, and mints an initial supply of tokens to the deployer. The constructor also sets the token's name and symbol via the ERC20 base contract and assigns ownership. ```solidity constructor( address _router, uint256[] memory _allowedChainIds, ChainConfig[] memory _chainConfigs ) Ownable(msg.sender) ERC20("UTS Token Showcase", "UTSTS") { __UTSBase_init(address(this), decimals()); _setRouter(_router); _setChainConfig(_allowedChainIds, _chainConfigs); _mint(msg.sender, 1_000_000 * 10 ** decimals()); } ``` -------------------------------- ### Get Minimum Gas Limit for Redeem Function Source: https://docs.entangle.fi/universal-token-standard/developer-guides/estimations Retrieves the amount of gas required to execute the {redeem} function on the destination chain. This function is provided by the UTS Router. ```APIDOC function dstMinGasLimit( uint256 dstChainId ) public view returns(uint64 dstMinGasLimitAmount) Description: Returns the amount of gas required to execute {redeem} function on the destination chain. Parameters: - dstChainId: uint256 - Destination chain Id. Returns: - dstMinGasLimitAmount: uint64 - The amount of gas required to execute {redeem} function on the provided {dstChainId}. ``` -------------------------------- ### Contract Constructor Source: https://docs.entangle.fi/universal-token-standard/developer-guides/manual-deploy/examples/uts-connector/connector-over-native-currency Initializes the UTSConnectorNativeShowcase contract, setting up base contract properties, router, allowed chains, chain configurations, and the native transfer gas limit. ```solidity constructor( address _router, uint256[] memory _allowedChainIds, ChainConfig[] memory _chainConfigs, uint8 _nativeCurrencyDecimals, uint256 _nativeTransferGasLimit ) Ownable(msg.sender) { __UTSBase_init(address(0), _nativeCurrencyDecimals); _setRouter(_router); _setChainConfig(_allowedChainIds, _chainConfigs); NATIVE_TRANSFER_GAS_LIMIT = _nativeTransferGasLimit; } ``` -------------------------------- ### UTSTokenWithLogicShowcase Constructor Source: https://docs.entangle.fi/universal-token-standard/developer-guides/manual-deploy/examples/uts-token/token-with-messages Initializes the UTSTokenWithLogicShowcase contract, setting up UTSBase, Ownable, ERC20 metadata, router, chain configurations, and minting initial tokens. ```solidity constructor( address _router, uint256[] memory _allowedChainIds, ChainConfig[] memory _chainConfigs ) Ownable(msg.sender) ERC20("UTS Token With Logic Showcase", "TWL") { __UTSBase_init(address(this), decimals()); _setRouter(_router); _setChainConfig(_allowedChainIds, _chainConfigs); _mint(msg.sender, 1_000_000 * 10 ** decimals()); } ``` -------------------------------- ### Clone Entangle Blockchain Repository Source: https://docs.entangle.fi/entangle-interoperable-blockchain/developer-guides/set-up-a-validator-node Clones the official Entangle blockchain repository from GitHub and navigates into the project directory. It also checks out the 'main' branch for the latest code. ```shell git clone https://github.com/Entangle-Protocol/entangle-blockchain cd entangle-blockchain git checkout main ``` -------------------------------- ### Add UDF SDK Dependency Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/fetch-data-via-pull-model-subscriptions/evm-smart-contracts Installs the Entangle Labs UDF SDK as a development dependency using Yarn. This SDK is crucial for fetching and encoding data for on-chain usage. ```bash yarn add --dev @entangle-labs/udf-sdk ``` -------------------------------- ### Create consumePrice.ts Script File Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/fetch-data-via-push-model/evm-smart-contracts Creates a new directory named 'scripts' and a TypeScript file named 'consumePrice.ts' within it. This sets up the environment for the backend script to fetch price data. ```bash mkdir scripts && touch ./scripts/consumePrice.ts ``` -------------------------------- ### UTSConnectorMintBurnShowcase Constructor Source: https://docs.entangle.fi/universal-token-standard/developer-guides/manual-deploy/examples/uts-connector/mint-and-burn-connector-scheme Initializes the UTSConnectorMintBurnShowcase contract. It sets up the underlying token, decimals, router address, and allowed chain configurations, while also initializing the Ownable contract and the UTSBase contract. ```solidity constructor( address underlyingToken_, address _router, uint256[] memory _allowedChainIds, ChainConfig[] memory _chainConfigs ) Ownable(msg.sender) { __UTSBase_init(underlyingToken_, IERC20Metadata(underlyingToken_).decimals()); _setRouter(_router); _setChainConfig(_allowedChainIds, _chainConfigs); } ``` -------------------------------- ### Examine Transaction with Cast Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/fetch-data-via-pull-model-payg/evm-smart-contracts Command to inspect the transaction call trace and logs using `cast`, showing emitted events like the latest verified update. This helps in debugging and understanding the on-chain execution. ```bash cast run 0xb66fb4112b7fdf72211c2238b9b0a609a8321e2694ddad9b69ec7dcc953fdb18 -r https://eth-sepolia.public.blastapi.io ``` -------------------------------- ### Example JSON Response Structure Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/custom-data-feeds Illustrates a typical JSON response structure from an external data provider. Parsing pipelines use GJSON syntax to extract specific fields like price, timestamp, and volume from this structure. ```json { "asset": { "price": 1000000000000000000, "timestamp": 1721636387, "volume": 10000000000 } } ``` -------------------------------- ### Contract Interaction: 0xc093...21e::40366475 Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/fetch-data-via-pull-model-payg/evm-smart-contracts Details of a static call made to a specific contract address and function signature. This interaction appears to be a read-only operation within the smart contract execution flow. ```APIDOC 0xc0931aEE1064BD5245fEe76A2d740eab8436621e::40366475(data: bytes) returns (bytes) - Performs a static call to a contract, indicating a read-only operation. - Parameters: - data: Input data for the call, likely encoded. - Returns: The result of the static call, which could be arbitrary data. - Example Usage: 0xc0931aEE1064BD5245fEe76A2d740eab8436621e::40366475(00000000000000000000000000000000000000000000000000000000000000404254432f5553440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a955444646014254432f555344000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000103d081c72d9f475f0bd0000000000000000000000000000000000000000000000000000000067f3bdcf2e2ffc130ee5e218e62e5babe2b2c6d0fa30f07c44b3eb131bf32e8dbda99b1e419e4016c33066e7f736958fb849a20edf1f84ecc71acd6ebe1a822142d7276a1c00000000000000000000000000000000000000000000103d091c76140eff9a150000000000000000000000000000000000000000000000000000000067f3bdcf27ef18a4bb82a9d25c7384e5dc40a992a8f6c85d4099d9f77c2833641e91bef96f8c7f3e4296ad701dbd2d93ed345fde78bcbd6c430b5294b81be0eccce83efa1b00000000000000000000000000000000000000000000103d09c19608a94bf2d10000000000000000000000000000000000000000000000000000000067f3bdcf9240ac502823b0d89ec923abcd895508c38ff00f763332d89a5b5acb292600632af57fc4382aa10b59e95d963dd2f39072ba9133186af6c73b939a1a5b6afd371b0000000000000000000000000000000000000000000000) [staticcall] ``` -------------------------------- ### DeployTokenData Structure and Parameters Source: https://docs.entangle.fi/universal-token-standard/developer-guides/manual-deploy/factory-blueprint-deployment Defines the structure for deployment parameters used by the `deployToken` function. Includes detailed explanations for each field, their types, and constraints. ```APIDOC DeployTokenData: struct DeployTokenData { bytes owner; string name; string symbol; uint8 decimals; uint256 initialSupply; uint256 mintedAmountToOwner; bool pureToken; bool mintable; bool globalBurnable; bool onlyRoleBurnable; bool feeModule; bytes router; uint256[] allowedChainIds; ChainConfig[] chainConfigs; bytes32 salt; } Parameters: owner: Address encoded here will be setted as the owner of the token. name: The name of new token. symbol: The symbol of new token. decimals: The decimals of new token. initialSupply: Token initial supply, that will be minted. mintedAmountToOwner: Token supply, that will be minted to owner (must be less than or equal initialSupply). pureToken: True/false flag is token should be without any extensions (non-mintable, non-burnable, without fee, working by lock/unlock scheme). If true, other flags should be false. mintable: True/false flag is token mintable by owner (owner can mint arbitrary token amount). globalBurnable: True/false flag is token burnable (everyone can burn his tokens). onlyRoleBurnable: True/false flag is token burnable by BURNER_ROLE role only. feeModule: True/false flag is token will supports fee extracting for bridging(currently unsupported, should be false by default). router: UTSRouter address on the deployment chain. allowedChainIds: Array of initial destination chain IDs that token binded to. chainConfigs: Array of ChainConfig structs, initial settings. salt: Salt to deploy new token to specified address, you can specify it, if you want specific address. Notes: - If `PureToken` is set to `true`, then `initialSupply` should be equal or more than `mintedAmountToOwner`. - If `PureToken` is set to `false`, then `initialSupply` should be equal to `mintedAmountToOwner`. ``` -------------------------------- ### Configure URL Template and Parsing Pipelines Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/custom-data-feeds Demonstrates the YAML configuration snippet that integrates the defined URL template and parsing pipelines. This setup connects the data feed with the Entangle UDF for fetching, parsing, and distributing data on-chain. ```yaml urlTemplate: "https://api.binance.com/api/v3/avgPrice?symbol={{.DataKey}}" pipelines: - value: "asset.price" - timestamp: "asset.timestamp" - volume: "asset.volume" ``` -------------------------------- ### Create Entangle Wallet Key Source: https://docs.entangle.fi/entangle-interoperable-blockchain/developer-guides/set-up-a-validator-node Generates a new key pair for your Entangle wallet. It uses the 'file' keyring backend for secure storage and the 'eth_secp256k1' algorithm for key generation. ```shell entangled keys add --keyring-backend file --algo eth_secp256k1 ``` -------------------------------- ### Deploy PushReader Contract Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/fetch-data-via-push-model/evm-smart-contracts Command to deploy the PushReader contract using Hardhat Ignition to the specified network (eth_sepolia). ```bash yarn hardhat ignition deploy ./ignition/modules/PushReader.ts --network eth_sepolia ``` -------------------------------- ### Blockchain Transaction Execution Trace Source: https://docs.entangle.fi/universal-data-feeds/developer-guides/fetch-data-via-pull-model-payg/evm-smart-contracts This entry documents the execution flow of a blockchain transaction. It details contract calls (staticcall, delegatecall), emitted events, and return values, providing a step-by-step breakdown of the transaction's lifecycle and outcome. ```APIDOC Project: /llmstxt/entangle_fi-llms.txt Transaction Execution Trace: ├─ [3642] 0x996520f9717f6141e53D8083168027d7834c172f::55b5190b(7564662d76312e31000000000000000000000000000000000000000000000000000000000000000000000000be524616e96bb4b62cce8034ab6bea8f2505b55a) [staticcall] │ ├─ [3246] 0xA7a8eAAA131dc4D2f70636F5F8796e640B119926::55b5190b(7564662d76312e31000000000000000000000000000000000000000000000000000000000000000000000000be524616e96bb4b62cce8034ab6bea8f2505b55a) [delegatecall] │ │ └─ ← [Return] 0x0000000000000000000000000000000000000000000000000000000000000001 │ └─ ← [Return] 0x0000000000000000000000000000000000000000000000000000000000000001 └─ ← [Return] 0x00000000000000000000000000000000000000000000103d091c76140eff9a150000000000000000000000000000000000000000000000000000000067f3bdcf ├─ emit topic 0: 0xc721ed5888a17a766f8018cb6748b49a685bdec1837b10b49c8c56de9e4d5618 │ data: 0x000000000000000000000000bd0afee88b7fcee6139467700d6f40f13feda7394254432f55534400000000000000000000000000000000000000000000000000 └─ ← [Return] 0x00000000000000000000000000000000000000000000103d091c76140eff9a150000000000000000000000000000000000000000000000000000000067f3bdcf Transaction successfully executed. Gas used: 163365 ```