Verona 백서

Verona

원문

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

-money-market/tree/development) ### 15. White Whale - Core Pool Contracts A modular suite of smart contracts implementing the core components of White Whale's Interchain Liquidity Protocol: **Key Modules:** * **Liquidity Hubs:** Serve as centralized points for liquidity aggregation and distribution across chains. * **Flash Loan Vaults:** Provide instant, uncollateralized loans for arbitrage and liquidation opportunities. * **Pool Factory & Router:** Enable the creation and management of liquidity pools, facilitating token swaps and price stabilization. * **Vault Factory & Router:** Manage user deposits and withdrawals, ensuring efficient capital flow within the ecosystem. * **Fee Collector:** Accumulates fees generated from various protocol activities, supporting sustainability and governance. #### Ideal for * **DeFi Developers:** Building cross-chain applications requiring efficient liquidity management. * **Arbitrageurs:** Seeking to exploit price discrepancies across different chains using automated tools. * **Liquidity Providers:** Looking to maximize returns by supplying assets to interchain liquidity pools. 📦 Repository: [white-whale-core](https://github.com/White-Whale-Defi-Platform/white-whale-core) ### 16. Cavern Protocol - Core Contracts A modular set of smart contracts managing the lifecycle of aAssets: * **anchor\_basset\_hub:** Manages the minting and burning of aAssets, tracks bonded LUNA, and handles validator delegation. * **anchor\_basset\_reward:** Distributes staking rewards to aAsset holders. * **anchor\_basset\_token:** Implements the CW20-compliant aAsset token (e.g., aLUNA). * **lido\_terra\_validators\_registry:** Maintains a registry of validators for staking operations. #### Ideal for * **DeFi Developers:** Integrating LSDs into lending, borrowing, or yield farming protocols. * **Stakers:** Seeking liquidity for staked assets without forfeiting rewards. * **DAOs:** Managing treasury assets with staking capabilities. 📦 Repository: [cavern-aAsset-contracts](https://github.com/CavernPerson/cavern-aAsset-contracts/tree/bdf1b81cb37fe9f9f0476b004faad4a9b5939676) ### 17. Eris Protocol - Tokenfactory Contract A modular set of smart contracts implementing the core components of a liquid staking system: * **eris-staking-hub:** Manages the minting and burning of LSD tokens (e.g., ampKUJI) and oversees the bonding of native tokens. * **Integration with fin-multi router:** Utilizes the [fin-multi router](https://github.com/Team-Kujira/fin-multi) for swap routing, ensuring efficient token exchanges within the ecosystem. #### Ideal for * **DeFi Developers:** Building applications that require liquid staking functionalities. * **Stakers:** Seeking to maintain staking rewards while accessing liquidity. * **DAOs:** Integrating staking derivatives into their governance and treasury management strategies. 📦 Repository: [erisprotocol/contracts-tokenfactory](https://github.com/erisprotocol/contracts-tokenfactory) ### 18. Astroport - Concentrated Liquidity Pool A modular suite of CosmWasm smart contracts comprising: * **Factory:** Manages the creation and registry of liquidity pools. * **Pair Contracts:** Implement various AMM algorithms. * **Router:** Enables multi-hop swaps across different pools. * **Oracle:** Calculates Time-Weighted Average Prices (TWAP) for pools. * **Tokenomics Modules:** Manage ASTRO token distribution and staking. #### Ideal for * **DeFi Developers:** Building applications requiring robust AMM functionalities. * **Liquidity Providers:** Seeking to earn yields across diverse pool types. * **Traders:** Looking for efficient and cost-effective token swaps. 📦 Repository: [astroport-fi/astroport-core](https://github.com/astroport-fi/astroport-core) # Integrations Step-by-step guides and tutorials to help you start building on Verona. This section provides hands-on **guides** and **tutorials** for integrating existing contracts or third-party components on Verona. ## **What’s Included** * **Beginner-Friendly Guides** – Essential tutorials for getting started. * **Step-by-Step Tutorials** – Practical examples for building on Verona. * **Advanced Use Cases** – Deeper insights into smart contract customization and integrations. * **Best Practices & Tips** – Optimization techniques for performance and security. # Token Factory When creating tokens on the Verona network, developers have two main options: [**CW20 smart contracts**](https://github.com/CosmWasm/cw-plus/blob/main/packages/cw20/README.md) or the [**Token Factory module**](https://github.com/strangelove-ventures/tokenfactory). While CW20 has been widely used in the Cosmos ecosystem, Token Factory provides a **simpler,** more **efficient,** and **scalable** alternative. ## **CW20 Token Standard** The CW20 token standard is analogous to Ethereum's ERC20 standard and is widely adopted within the Cosmos ecosystem. Implementing a CW20 token involves several key considerations: * **Deployment and Maintenance**: Developers must deploy and instantiate a CW20 contract for the token. This process could require ongoing maintenance, including updates and potential redeployments to address issues or implement enhancements. * **Integration Effort**: Integrating CW20 tokens into other contracts or apps necessitates additional development work to ensure compatibility and seamless interaction. * **IBC (Inter-Blockchain Communication) Compatibility**: Enabling IBC transfers for CW20 tokens requires additional contracts, adding complexity to cross-chain interactions. ## **Token Factory Module** The Token Factory module is a built-in feature of the Verona ecosystem, providing a more streamlined approach to token creation and management. Key features include: * **Permissionless Token Creation**: Any account can create a new native token, similar to the Verona native token managed by the bank module. Tokens are uniquely identified using the format `factory/{creator address}/{subdenom}`, preventing name collisions. * **Administrative Control**: The original creator of a token is granted "admin" privileges, allowing them to: * **Mint**: Issue new tokens to any account. * **Burn**: Remove tokens from circulation from any account. * **Admin Management**: Change the admin, including the option to set it to an empty string (`""`), relinquishing administrative control. ## **Comparison: Token Factory vs. CW20 Tokens** While both methods enable token creation, the Token Factory module offers several advantages over the CW20 standard: * **Simplicity and Efficiency**: Creating and managing tokens via the Token Factory is more straightforward, eliminating the need for deploying and maintaining separate smart contracts for tokens. * **Native Integration**: Tokens created through the Token Factory are natively integrated into the blockchain's bank module, facilitating easier management and interaction within the ecosystem. * **IBC Compatibility**: Token Factory tokens are inherently compatible with IBC, simplifying cross-chain transfers without the need for additional contracts or conversion mechanisms. Here's a detailed comparison between the CW20 token standard and the Token Factory module: | Feature | CW20 Tokens (Smart Contracts) | Token Factory (Native Tokens) | | -------------------------------- | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- | | **Deployment Complexity** | Requires writing, deploying, and maintaining a **separate smart contract** for token creation. | Tokens are created via a simple transaction utilizing the bank module — **no smart contract needed**. | | **Gas Costs** | Every interaction (mint, transfer, burn) requires executing a smart contract, **increasing gas fees**. | Uses **native blockchain functions**, making transactions significantly **cheaper and more efficient**. | | **Security** | Smart contracts can contain **bugs and vulnerabilities**, requiring **audits and ongoing monitoring**. | Tokens are **natively managed** by the blockchain’s bank module, reducing attack vectors and eliminating the need for audits. | | **Integration with apps** | Developers must **manually integrate** the smart contract logic into their app, adding complexity. | Tokens are **supported** by wallets, explorers, and apps using the standard bank module. | | **IBC Compatibility** | Requires an **additional CW20-ICS20 wrapper contract** to enable IBC transfers. | Tokens are **natively IBC-compatible**, allowing **seamless cross-chain transfers** without extra contracts. | | **Upgradeability & Maintenance** | Upgrading requires **deploying a new contract** and migrating balances—**tedious and error-prone**. | No maintenance required—**tokens don’t need upgrades** as they are managed by the bank module. | While the CW20 token standard provides a robust framework for token creation, the Token Factory module offers a more efficient and streamlined alternative, particularly in terms of management simplicity and cross-chain compatibility. # Creating, Minting, and Interacting with a Token Factory Token The **Token Factory module** provides a simple framework for creating and managing **custom native tokens**. It allows users to create, mint, distribute and interact with their own tokens seamlessly. Each token is uniquely tied to its creator’s address and follows the standardized format `factory/{creator address}/{subdenom}.` The module is particularly useful for **developers** and **projects** looking to **issue chain-native assets** without the complexity of deploying custom smart contracts. Regardless of the token’s intended use the **Token Factory** streamlines the entire **lifecycle**, ensuring a secure and scalable approach to token management on the Verona network. ## **Prerequisites** Before proceeding, make sure you have the following: 1. **Verona Daemon (`xiond`) Installed:**\ Ensure that `xiond` is installed on your system. If not, follow the [Setting up your Local Development Environment](/en/build-on-verona/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment#xiond) guide to set it up. 2. **An Active Account:**\ Set up an account using `xiond` by following the [Generate an account](/en/build-on-verona/tools/daemon-cli#generate-an-account) guide. You will use this account to execute transactions. 3. **A Funded Account:**\ You need an account with sufficient **native $VERONA tokens (Previously $XION)** to cover transaction fees. You can obtain testnet tokens through the [**Verona testnet faucet**](/en/build-on-verona/references/testnet-tokens). ## **Creating a Token** {% hint style="info" %} Creating a new Token Factory token requires a **1000 $VERONA fee (Previously $XION)** (on both **Testnet** and **Mainnet**). This fee protects Verona users by: * **Reducing spam** and malicious token creation. * **Encouraging meaningful token projects**, ensuring a higher-quality ecosystem. {% endhint %} To create a new token using the **Token Factory module**, you would execute the following command: ```sh xiond tx tokenfactory create-denom <your-denom> --from <wallet-name> --chain-id <chain-id> --node <node> --gas auto --gas-adjustment <gas-adjustment> --gas-prices <gas-prices> ``` **Parameters:** * `<your-denom>` – The unique token name (e.g., `customtoken`). * `<wallet-name>` – Your configured wallet name in `xiond`. * `<chain-id>` – The chain ID of the Verona network. * `<node>` – The ID or address of the blockchain node you are connecting to. * `--gas auto` – Automatically estimates the gas required for the transaction. * `<gas-adjustment>` – Adjusts the estimated gas amount by **30%** to account for possible variations in actual consumption. * `<gas-prices>` – The fee rate for gas in **uxion** (the smallest unit of Verona). **Example:** ```sh xiond tx tokenfactory create-denom mytoken --from mywallet --chain-id xion-testnet-2 --node https://rpc.xion-testnet-2.burnt.com:443 --gas auto --gas-prices 0.025uxion ``` The following is an example of the initial output: ``` gas estimate: 2091194 auth_info: fee: amount: - amount: "52280" denom: uxion gas_limit: "2091194" granter: "" payer: "" signer_infos: [] tip: null body: extension_options: [] memo: "" messages: - '@type': /osmosis.tokenfactory.v1beta1.MsgCreateDenom sender: xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r subdenom: emp non_critical_extension_options: [] timeout_height: "0" signatures: [] confirm transaction before signing and broadcasting [y/N]: ``` After typing **y** and pressing **Enter**, you may see the following output: ``` code: 0 codespace: "" data: "" events: [] gas_used: "0" gas_wanted: "0" height: "0" info: "" logs: [] raw_log: "" timestamp: "" tx: null txhash: 4AC13595B2E92DD5D9B27111E71B34D598E2C19EFE7865602C3110FDEA3676F3 ``` Upon successful execution, a unique token will be created with a denomination formatted as: ``` factory/<creator-address>/mytoken ``` ## **Querying Token Data** After creating a token, you may want to **verify its metadata** and check its initial state on the blockchain. This can be done using the **denom-metadata query** within the **bank** module, which retrieves essential details about the token, including its base denomination, display name, and symbol. To query the token data, run the following command: ```sh xiond query bank denom-metadata factory/<creator-address>/<denom> --node <rpc-endpoint> ``` **Example:** ```sh xiond query bank denom-metadata factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp --node https://rpc.xion-testnet-2.burnt.com:443 ``` **Example Output:** ```yaml metadata: base: factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp denom_units: - denom: factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp display: factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp name: factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp symbol: factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp ``` **Understanding the Output:** * **`base`** – The full unique identifier of the token. * **`denom_units`** – The denomination structure for different decimal representations. * **`display`** – The default way the token is displayed in applications. * **`name`** – The registered name of the token. * **`symbol`** – The token’s ticker symbol (if set during metadata configuration). ## **Updating Token Metadata** Before minting new tokens, it is important to **configure the token’s metadata** to ensure frontends and apps can properly **query and display token information** and to set the required decimal precision to be used by the token. **Updatable Fields:** * **`ticker-symbol`** – The short symbol representing the token (e.g., `$VERONA`). * **`description`** – A brief description of the token. * **`exponent`** – The decimal precision used for display purposes. To update the token metadata, run the following command: ```sh xiond tx tokenfactory modify-metadata <denom> <ticker-symbol> <description> <exponent> --from <wallet-name> --chain-id <chain-id> --node <node> --gas auto --gas-adjustment <gas-adjustment> --gas-prices <gas-prices> ``` **Example:** ```sh xiond tx tokenfactory modify-metadata factory/xion1xyz.../mytoken MYT "My custom token" 6 --from mywallet --chain-id xion-testnet-2 --node https://rpc.xion-testnet-2.burnt.com:443 --gas auto --gas-adjustment 1.7 --gas-prices 0.025uxion ``` This command updates the metadata for the `mytoken` token, setting: * **Ticker Symbol** → `MYT` * **Description** → `"My custom token"` * **Exponent** → `6` (indicating 6 decimal places for display) The following is an example of the initial output: ``` gas estimate: 68088 auth_info: fee: amount: - amount: "1703" denom: uxion gas_limit: "68088" granter: "" payer: "" signer_infos: [] tip: null body: extension_options: [] memo: "" messages: - '@type': /osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata metadata: base: factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp denom_units: - aliases: - EMP denom: factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp exponent: 0 - aliases: - factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp denom: EMP exponent: 6 description: My custom token display: EMP name: factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp symbol: EMP uri: "" uri_hash: "" sender: xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r non_critical_extension_options: [] timeout_height: "0" signatures: [] confirm transaction before signing and broadcasting [y/N]: ``` After typing **y** and pressing **Enter**, you may see the following output: ``` code: 0 codespace: "" data: "" events: [] gas_used: "0" gas_wanted: "0" height: "0" info: "" logs: [] raw_log: "" timestamp: "" tx: null txhash: 9583BEC1A62884395E466C190B1A5B3DE5EC152D0CE875BCBDE3DD333BB9E0C9 ``` You can then query the metadata to see the updates: ```sh xiond query bank denom-metadata factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp --node https://rpc.xion-testnet-2.burnt.com:443 ``` **Possible Output:** ```yaml metadata: base: factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp denom_units: - aliases: - EMP denom: factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp - aliases: - factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp denom: EMP exponent: 6 description: My custom token display: EMP name: factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp symbol: EMP ``` ## **Minting Tokens** After successfully creating your token, you will notice that no tokens have actually been minted. To establish or increase the token supply, you must explicitly **mint new tokens**. The **minting process** allows you to generate additional tokens under your control, which can then be used within your apps, or distributed to other accounts. To mint tokens, execute the following command: ```sh xiond tx tokenfactory mint <amount><denom> --from <wallet-name> --chain-id <chain-id> --node <node> --gas auto --gas-adjustment <gas-adjustment> --gas-prices <gas-prices> ``` **Parameters:** * `<amount>` – The quantity of tokens to mint. * `<denom>` – The full denomination (including `factory/<creator-address>/<denom>`). * `<wallet-name>` – Your configured wallet name. * `<chain-id>` – The chain ID of the Verona network. * `<node>` – The ID or address of the blockchain node you are connecting to. * `--gas auto` – Automatically estimates the gas required for the transaction. * `<gas-adjustment>` – Adjusts the estimated gas amount by **30%** to account for possible variations in actual consumption. * `<gas-prices>` – The fee rate for gas in **uxion** (the smallest unit of Verona). **Example:** ```sh xiond tx tokenfactory mint 1000000000000factory/xion1xyz.../mytoken --from mywallet --chain-id xion-testnet-2 --node https://rpc.xion-testnet-2.burnt.com:443 --gas auto --gas-adjustment 1.5 --gas-prices 0.025uxion ``` The following is an example of the initial output: ``` gas estimate: 95267 auth_info: fee: amount: - amount: "2382" denom: uxion gas_limit: "95267" granter: "" payer: "" signer_infos: [] tip: null body: extension_options: [] memo: "" messages: - '@type': /osmosis.tokenfactory.v1beta1.MsgMint amount: amount: "1000000000000" denom: factory/xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r/emp mintToAddress: "" sender: xion1ka5gdcv4m7kfzxkllapqdflenwe0fv8ftm357r non_critical_extension_options: [] timeout_height: "0" signatures: [] confirm transaction before signing and broadcasting [y/N]: ``` After typing **y** and pressing **Enter**, you may see the following output: ``` code: 0 codespace: "" data: "" events: [] gas_used: "0" gas_wanted: "0" height: "0" info: "" logs: [] raw_log: "" timestamp: "" tx: null txhash: BDB5A322400076D14C831497407AF1026D6A3DD923EF1E36366C0ED0C3D5ECE1 ``` I
프로젝트로 돌아가기