<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abstract Contact on Medium]]></title>
        <description><![CDATA[Stories by Abstract Contact on Medium]]></description>
        <link>https://medium.com/@abstractmoney?source=rss-89a4742fe643------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*yqEeTLKeKM4VgLVqDbDJ9g.png</url>
            <title>Stories by Abstract Contact on Medium</title>
            <link>https://medium.com/@abstractmoney?source=rss-89a4742fe643------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 19 May 2026 05:24:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abstractmoney/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[A High-Level Overview of Abstract Money, Interchain App Platform]]></title>
            <link>https://medium.com/abstract-money/a-high-level-overview-of-abstract-moneys-interchain-app-platform-d30813c7a1b4?source=rss-89a4742fe643------2</link>
            <guid isPermaLink="false">https://medium.com/p/d30813c7a1b4</guid>
            <category><![CDATA[cosmwasm]]></category>
            <category><![CDATA[cosmos]]></category>
            <category><![CDATA[ibc]]></category>
            <category><![CDATA[chain-abstraction]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <dc:creator><![CDATA[Abstract Contact]]></dc:creator>
            <pubDate>Tue, 05 Mar 2024 01:10:04 GMT</pubDate>
            <atom:updated>2024-08-26T19:20:46.402Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>TL;DR: Abstract Money is a vertically-integrated application platform focused on unifying multi-chain development and interaction.</em></blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FyYTB9kVcy6Y%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyYTB9kVcy6Y&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FyYTB9kVcy6Y%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6e846fc3a1e5f37d4926199844bf23e/href">https://medium.com/media/e6e846fc3a1e5f37d4926199844bf23e/href</a></iframe><p>Abstract’s goal is to enable developers to <strong>build more powerful interchain dApps</strong> through collaboration, convention, and modularity. We provide a <strong>full-stack CosmWasm development experience</strong>, including smart-contract, middleware, and frontend tooling. The Abstract SDK <strong>streamlines the development of interchain applications</strong> with a powerful and easy-to-use <strong>modular application framework</strong> whose capabilities are fully realized via account-abstraction and our on-chain application infrastructure.</p><blockquote><em>To learn more about our framework and our full developer vision, please check out our </em><a href="https://docs.abstract.money"><em>official documentation</em></a><em>.</em></blockquote><h3>Introduction</h3><p>The Cosmos SDK changes the game for blockchain-based applications. It allows for scalable development and deployment of application-specific chains by providing a well-defined framework emphasizing modularity. The “appchains” coincide with the <strong>fat application thesis</strong>, which states that the value lies in the applications themselves rather than in a shared, fat protocol like Ethereum or Solana. IBC enables interoperability between these appchains, and CosmWasm allows for the programmability of cross-chain interactions through a secure and efficient smart-contract environment. “inter-chain”</p><h3>The Problem</h3><p>It is <strong>difficult and slow to build CosmWasm applications</strong>. Teams <strong>start from scratch</strong>, and <strong>waste valuable time integrating primitives</strong> such as DEXes, money markets, oracles, and other DeFi building blocks. The fat app thesis encourages teams to drive value to their applications, consequently creating an environment of <strong>siloed development</strong>. This lack of inter-team collaboration <strong>hinders innovation and experimentation</strong>, and is partially why the CosmWasm ecosystem is relatively immature compared to the Ethereum and Solana ecosystems.</p><p>Secondly, while CosmWasm application updates (“migrations”) don’t require a replacement binary like chain upgrades, <strong>updates remain highly manual and dangerous</strong>, especially when multiple contracts are involved. This leaves user funds and team reputations at risk.</p><p>Finally, developing a cross-chain application <strong>requires deep prerequisite knowledge of IBC</strong>, proper handling of callbacks, error cases, and knowledge of interchain smart-contract security. Even for an experienced IBC developer, cross-chain interactions require new IBC ports, as well as channel and asset identification on both sides.</p><h3>The Solution</h3><p>We bring the modularity and scalability of the Cosmos SDK to CosmWasm applications with the Abstract SDK, our interchain application framework. The Abstract SDK is designed for organizations and individual developers to build composable, distributed applications in a <strong>fast, secure, and cost-effective manner</strong>. We place an emphasis on <strong>standardization and composability</strong>, congruent with well-studied smart-contract design patterns such as <a href="https://eips.ethereum.org/EIPS/eip-2535">Ethereum’s Diamond Proxy Pattern (EIP-2535)</a> and Web2 microservices and customized to the extensive capabilities of CosmWasm.</p><p>The foundation for every Abstract application is an <strong>Abstract Account, a smart-contract wallet</strong>. Modules, the smart-contracts built using the SDK, isolate shared logic and <em>extend</em> the functionality of the Account. This transforms it into an application. Module version management is performed via a permissioned on-chain module registry, allowing for <strong>dynamic application upgrades</strong> with protections against incorrect migrations. <strong>Inter-team collaboration is incentivized</strong> because modules can be monetized, providing sustainable income for developers and rewarding continued maintenance. Complex logic can be imported rather than rewritten.</p><p>The Abstract SDK provides easily-understandable <strong>abstractions for local and cross-chain interactions over IBC</strong>. Via an <strong>on-chain name service</strong>, assets, chains, and other resources can be referenced by name, rather than their complex identifiers. Abstract Accounts (and applications) can create and execute upon multi-hop interchain outposts developed specifically for chain-abstracted protocols and wallets.</p><h3>Why?</h3><blockquote><em>Read about Abstract’s origins </em><a href="https://paragraph.xyz/@adair/abstract-money-origins"><em>here</em></a><em>.</em></blockquote><p>Our goal is to help realize the ideal of full user sovereignty in ushering in the next generation of interoperable applications. The interchain becomes ubiquitous not only via technical superiority, but via a thriving developer ↔ user economy, the most important multi-sided market in Web3.</p><p>Our team consists of 7 highly experienced Web3 software engineers, and both our founders are technical. Abstract’s tooling has been in development for over 2 years.</p><p>Abstract’s framework and on-chain infrastructure is <a href="https://github.com/AbstractSDK/abstract">open-source</a>, chain-agnostic to any CosmWasm-enabled chain, and allows control of and interoperability with any chain connected to IBC.</p><h3>Abstract’s Interchain CosmWasm Tooling</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F8hxx7LN5H2g%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D8hxx7LN5H2g&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F8hxx7LN5H2g%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d04a108c51303a30b809501fda428b7/href">https://medium.com/media/6d04a108c51303a30b809501fda428b7/href</a></iframe><p>Below we’ll go over the different components of the Abstract stack, servicing interchain developers.</p><h3>Features TL;DR:</h3><p><strong>Production-Ready</strong></p><ul><li>Abstract Account: <em>Multi-chain smart-contract wallet</em></li><li>Version Control: <em>On-chain module registry with version management</em></li><li>Name Service: <em>On-chain name service for assets, contracts, addresses, chains (channels), and DEX pairs</em></li><li>Abstract SDK: <em>Modular CosmWasm application framework</em></li><li>Console: <em>Developer interface for managing Accounts, applications, and modules</em></li><li>API: <em>GraphQL API for quick contract queries and indexed information</em></li><li>Interchain Abstract Accounts: <em>Cross-chain smart-contract accounts</em></li></ul><p><strong>Pre-Release</strong></p><ul><li>Abstract.js: <em>Typescript SDK for use alongside the Abstract SDK</em></li><li>EVM Interchain Accounts: <em>Control and interact with any EVM chain</em></li></ul><h3>Abstract Accounts</h3><blockquote><em>Read more about Abstract Accounts </em><a href="https://docs.abstract.money/3_framework/3_architecture.html"><em>here</em></a><em>.</em></blockquote><p>Abstract’s application architecture is centered around our smart-contract wallet, coined an Abstract Account. This serves as a secure vault for asset management and provides a base upon which modules can be installed, creating an application. Applications can be installed <em>upon Accounts</em> via sub-accounts. The Account is also responsible for cross-chain communications, handling creation of and communication with interchain Accounts.</p><p>This enables Account owners to “self-host” their applications on fully sovereign smart-contracts. This follows the natural evolution of decentralized finance (DeFi) to a new era of personalized, sovereign finance, which we’re coining MyFi.</p><h3>Modules</h3><blockquote><em>Read more about Abstract modules </em><a href="https://docs.abstract.money/3_framework/5_modules.html"><em>here</em></a><em>.</em></blockquote><p>A <em>module</em> in Abstract is a smart-contract that can be installed on an Abstract Account to extend its capabilities. Modules can be installed, removed, and configured by the Account’s owner, allowing for a high degree of customization. Additionally, modules can take on dependencies on other modules and securely interact with each other.</p><p><strong>App modules</strong> are instantiated and owned by one Account.</p><ul><li>Ex: ETF module allows the owner to manage the Account as an ETF. The module handles value calculation for deposits and withdrawals, and the owner manages the allocation.</li></ul><p><strong>Adapter modules</strong> serve as standard interfaces that facilitate communication between Accounts and various external services. They adapt a service to an interface.</p><ul><li>DEX Adapter: Provides a standard interface for performing actions on DEXes.</li><li>CW-Staking Adapter Provides a standard interface for interacting with LP positions across Cosmos.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g5k7GisHQWPXSGgV.png" /><figcaption><em>An example message sent to the Dex adapter. Notice the “dex” field and asset names, which are described further below in Abstract Name Service.</em></figcaption></figure><p><strong>Integrations</strong></p><p>Developers using the Abstract SDK can interact with the following services via standardized interface through Abstract’s adapter modules within minutes:</p><ul><li><a href="https://osmosis.zone/">Osmosis</a></li><li><a href="https://kujira.network/">Kujira</a></li><li><a href="https://astroport.fi/">Astroport</a></li><li><a href="https://dex.wynddao.com/">Wyndex</a></li><li><a href="https://astrovault.io/">Astrovault</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oMH4lXqd1g0B945c.png" /><figcaption><em>Two Abstract Accounts each have sovereign ETF modules, which can call the shared DEX adapter module, calling to dexes across IBC.</em></figcaption></figure><h3>Module Registry (On-Chain)</h3><blockquote><em>See the </em><a href="https://console.abstract.money/modules"><em>live module registry</em></a><em> or read more on the </em><a href="https://docs.abstract.money/5_platform/2_version_control.html?highlight=version%20cont#version-control"><em>Version Control docs</em></a><em>.</em></blockquote><p>On-chain registry of versioned contracts to their code ids and metadata. Allows developers to register and monetize their modules.</p><ul><li>abstract:dex:0.20.0 =&gt; juno...xxx</li><li>abstract:etf:0.3.0 =&gt; 205</li></ul><p>This “package registry” is one of the most important components in enabling truly composable apps. All Abstract Apps can pull updates from the modules registry, allowing applications to be dynamically updated with the Account owner retaining full sovereignty.</p><h3>Abstract Name Service (On-chain)</h3><blockquote><em>See the </em><a href="https://console.abstract.money/ans"><em>live name service</em></a><em> or read more on the </em><a href="https://docs.abstract.money/5_platform/1_ans.html"><em>ANS docs</em></a><em>.</em></blockquote><p>The ANS is a smart contract that stores the following data:</p><p><strong>Assets</strong>: The most relevant assets on the local blockchain.</p><ul><li>osmosis&gt;osmo on Osmosis =&gt; uosmo</li><li>osmosis&gt;osmo on Juno =&gt; ibc/...XYZ</li><li>juno&gt;dao on Juno =&gt; juno...xxx</li><li>juno&gt;dao on Osmosis =&gt; ibc/...YZA</li><li>berachain&gt;bera on Berachain =&gt; 0xAul...E3a</li><li>berachain&gt;bera on Union =&gt; factory/union...nkz</li></ul><p><strong>Contracts</strong>: Contracts related to certain protocols or applications that could be dynamically resolved. This could be used to store the address for an asset-pair for a dex.</p><ul><li>croncat/factory on Osmosis =&gt; osmo...xxx</li><li>berachain&gt;bex/crocsw on Osmosis =&gt; 0x9...osu</li></ul><p><strong>Channels</strong>: IBC channel data to map a protocol + destination chain to a channel id. This allows for dynamic IBC transfers without having to know the channel id beforehand.</p><ul><li>osmosis on Neutron =&gt; channel-5</li></ul><p><strong>Pools: </strong>Essential liquidity pools for DeFi protocols, mapping ANS-ID to pool-id or contract.</p><ul><li>astroport/neutron&gt;ntrn,osmosis&gt;osmo on Neutron =&gt; neutron...ua5</li><li>berachain&gt;bex/berachain&gt;bera,union&gt;uno on Union =&gt; 0xYo...b7a</li></ul><h3>Abstract SDK (Framework)</h3><blockquote><em>Read more about the SDK via its </em><a href="https://docs.abstract.money/4_get_started/1_index.html"><em>technical documentation</em></a><em> and </em><a href="https://docs.abstract.money/4_get_started/2_installation.html"><em>get started by building an app</em></a><em>!</em></blockquote><p>The Abstract SDK itself is the Rust-based CosmWasm framework with which developers write and test application modules. Applications using the SDK work seamlessly with the on-chain infrastructure. It provides common abstractions via traits for maximum ease-of-use and modularity.</p><p>All Abstract modules are easily testable using <a href="https://orchestrator.abstract.money/">cw-orchestrator</a> with out-of-the-box abstractions for Abstract Accounts and all other on-chain infrastructure.</p><p><strong>IBC Capabilities</strong></p><p>Abstract Accounts can create single- and multi-hop outposts on IBC-enabled chains, enabling cross-chain applications. Our on-chain IBC abstractions ensure that all actions are authenticated and relayed to the proper destinations, and allow for single-chain management of complex multi-chain infrastructure.</p><p><strong>Typescript + React Developer SDK (Pre-Release)</strong></p><p><a href="https://github.com/AbstractSDK/abstract.js">Abstract.JS</a> provides comprehensive means for interacting with applications built using the Abstract SDK. It is also provider-agnostic, meaning that developers can use either Graz or Cosmos Kit in their frontend development. The design patterns used by Abstract.js are largely based on high-quality Ethereum packages such as <a href="https://github.com/wevm/wagmi">wagmi</a> and <a href="https://github.com/wevm/viem">viem</a>. It additionally provides code-generation plugins for <a href="https://github.com/CosmWasm/ts-codegen">ts-codegen</a> for readable clients.</p><p><strong>EVM IBC (Pre-release)</strong></p><p>We enable control and interaction with EVM-based chains with our proprietary implementation for interchain accounts on EVM via <a href="https://union.build">Union</a>, one of our core partners. This gives the EVM ecosystem unfettered access to the Interchain and visa-versa, enabling the development of advanced cross-chain liqudity orchestration, application protocols, and even cross-chain SAFEs.</p><h3>Application Console</h3><blockquote><em>Feel free to check out the </em><a href="https://console.abstract.money/"><em>mainnet</em></a><em> and </em><a href="https://testnet.abstract.money/"><em>testnet</em></a><em> Consoles, both of which are currently live.</em></blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FfQ9hCNP_69g&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfQ9hCNP_69g&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FfQ9hCNP_69g%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7cc53bfa5e702cd71a846797280a7a83/href">https://medium.com/media/7cc53bfa5e702cd71a846797280a7a83/href</a></iframe><p>The developer console allows teams to manage their applications built using Abstract. It provides GUIs for all on-chain infrastructure and Abstract Accounts. It also serves as the marketplace upon which devs can list and monetize their modules as described earlier.</p><h3>Abstract API</h3><blockquote><em>Query the API </em><a href="https://api.abstract.money"><em>here</em></a><em>.</em></blockquote><p>A chain-agnostic GraphQL API for accessing all of Abstract from anywhere. Supports custom configurations for any CosmWasm network with Abstract.</p><h3>Case Studies</h3><h3>XION</h3><blockquote><em>Mint an NFT on Neutron directly from XION </em><a href="https://xion.abstract.money/"><em>here</em></a><em>! This demonstration walks you through each step of the process, though all actions can be fully abstracted away in practice.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-nsoDWIoRmvqZ38Ms9Z5kg.jpeg" /></figure><p><a href="https://xion.burnt.com/">XION</a> is consumer-oriented chain focused on eliminating the complexities of Web3 interaction through “generalized abstraction,” offering users the ability to interact with apps and liquidity on any chain.</p><p>XION uses Abstract’s <a href="https://docs.abstract.money/3_framework/8_ibc.html">ICAAs</a> to enable chain abstraction and for full control and programmability of any chain over IBC. We’ve had over 160K Abstract Accounts and over 400K transactions executed using Abstract’s infrastructure in just a few weeks of release.</p><h3>FortyTwo Finance</h3><p><a href="https://fortytwo.money">FortyTwo</a> is the interchain’s DeFi yield aggregator. It offers a single interface where users can manage their yield positions and understand their portfolios spread across any IBC-enabled chain.</p><p>One of FortyTwo’s primary products is a dex-agnostic autocompounder, which achieves maximum yield on pools across IBC. This leverages Abstract’s DEX and Staking adapters and scales to any pair on any dex on any chain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oWW7X4RbcUXL3Qp1.png" /><figcaption>Architecture of FortyTwo Money’s autocompounder, a chain-agnostic, dex-agnostic, pair-agnostic yield maximizer built on Abstract.</figcaption></figure><p>Abstract makes developing single- and multi-chain applications easy. Developers should be able to focus on their business logic, and not the bulls**t. Users should be able to focus on the application, and not care the tech. Both of these ideals are realized through Abstract’s comprehensive interchain platform, all-the-while abstracting away the complexities of multi-chain development and interaction.</p><h3>Additional Resources</h3><p><strong>Abstract Money Chain Abstraction</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F5biJAkm3FoA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D5biJAkm3FoA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F5biJAkm3FoA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/66dc26b4197663cfd35517cf25c786ed/href">https://medium.com/media/66dc26b4197663cfd35517cf25c786ed/href</a></iframe><h3>Acknowledgementns</h3><p>We wish to give thanks to the open-source community and the many teams that we’ve worked with in improving the Abstract SDK to make the development experience as amazing as possible, including (but not limited to):</p><ul><li><a href="https://confio.gmbh/">Confio</a></li><li><a href="https://fortytwo.money">FortyTwo</a></li><li><a href="https://yieldmos.com">Yieldmos</a></li><li><a href="https://daodao.zone">DaoDao</a></li><li><a href="https://cosmology.tech">Cosmology</a></li><li><a href="https://xion.burnt.com">Xion</a></li></ul><p><a href="https://github.com/AbstractSDK/abstract/blob/main/framework/CHANGELOG.md">Abstract Changelog</a></p><p><a href="https://discord.com/invite/uch3Tq3aym">Get in touch!</a></p><p><a href="https://twitter.com/AbstractSDK">Follow Us on Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d30813c7a1b4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/abstract-money/a-high-level-overview-of-abstract-moneys-interchain-app-platform-d30813c7a1b4">A High-Level Overview of Abstract Money, Interchain App Platform</a> was originally published in <a href="https://medium.com/abstract-money">Abstract Money</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying and scripting your smart contract using BOOT]]></title>
            <link>https://medium.com/abstract-money/deploying-and-scripting-your-smart-contract-using-boot-5d4ffd05c860?source=rss-89a4742fe643------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d4ffd05c860</guid>
            <category><![CDATA[cosmos]]></category>
            <category><![CDATA[cosmwasm]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[rust]]></category>
            <dc:creator><![CDATA[Abstract Contact]]></dc:creator>
            <pubDate>Mon, 28 Nov 2022 18:30:27 GMT</pubDate>
            <atom:updated>2022-12-08T18:07:37.552Z</atom:updated>
            <content:encoded><![CDATA[<p>Once you have written your CosmWasm smart contract, you are probably ready to start writing integration tests or deploy it to a live network. Doing this through frontend interfaces such as <a href="https://cosmwasm.tools/">CosmWasm Tools</a> can work, but is certainly not a good long term solution. Executing this through the CLI is an even more time-consuming and menial process.</p><p><a href="https://github.com/Abstract-OS/BOOT">BOOT</a> (by Abstract) simplifies all of this by providing a type-safe library and a standard way of deploying and interacting with your CosmWasm smart contracts.</p><h3>Getting Started</h3><p>The following sections detail setting up a library for interfaces and a separate package for the scriptsso that publishing the contract interfaces is easy.</p><h4>Contract Interface Library</h4><p>To get started with BOOT, create a new folder anywhere (though we often do it alongside our contracts in the same repository) called interfaces by running:</p><pre>cargo init --lib interfaces</pre><p>Following this example, the file structure will now look like:</p><pre>.<br>├── Cargo.toml<br>├── contracts<br>│   ├── Cargo.toml<br>│   └── src<br>│       ├── contract.rs<br>│       └── ...<br>└── interfaces<br>    ├── Cargo.toml<br>    └── src<br>        └── lib.rs</pre><blockquote><em>If your cargo project is a workspace, be sure to add </em><em>interfaces to the [workspace].members array at the workspace root.</em></blockquote><p>Install <a href="https://crates.io/crates/boot-core">boot-core</a></p><pre>cd interfaces<br>cargo add boot-core<br>cargo add --path ../contracts</pre><p>Then add any other dependencies, which should look similar to the following:</p><pre>[dependencies]<br>boot-core = &quot;0.1.3&quot; # latest version as of writing this article<br>my-contract = { path = &quot;../contracts&quot; }<br># common<br>cosmwasm-std = &quot;1.1&quot;<br>serde = { version = &quot;1.0.103&quot;, default-features = false, features = [&quot;derive&quot;] }</pre><h4>Defining Contract Interfaces</h4><p>The contract interface is what your scripts will be interacting with to deploy and manage the deployed instance of your contract. It provides accessible methods for interfacing with the contract entry points and can maintain state between script runs based on the deployment configuration.</p><p>First, create a new file in the src directory of the interfaces package, and add it to the library declaration file:</p><pre>touch src/my-contract.rs<br>echo &#39;pub mod my_contract;&#39; &gt;&gt; src/lib.rs</pre><p>In your new contract file, define a struct for your contract interface and provide the [Instantiate|Execute|Query|Migrate]Msgs to the boot_contractmacro, which will generate fully-typed instantiate, execute, query, and migrate methods.</p><pre>use boot_core::prelude::boot_contract;<br>use my_contract::{InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg};<br><br>#[boot_contract(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)]<br>pub struct MyContract&lt;Chain&gt;;</pre><blockquote><em>The generic “&lt;Chain&gt;” argument is to help the rust-analyzer with type analysis because sometimes the macro-expansion engine does not fully understand generically typed macros.</em></blockquote><blockquote><em>If your entry point Msgs have any generic arguments, pull them out into newtypes before passing into the macro.</em></blockquote><p>Next, you’ll want to define the constructor for the struct defined above. In the following example:</p><pre>use boot_core::prelude::{BootEnvironment, Contract};<br><br>// ...<br><br>impl&lt;Chain: BootEnvironment&gt; MyContract&lt;Chain&gt; {<br>    /// Construct a new instance of MyContract<br>    /// * `contract_id` - what your contract should be called in local state (*not* on-chain)<br>    /// * `chain` - the chain to deploy to<br>    pub fn new(contract_id: &amp;str, chain: &amp;Chain) -&gt; Self {<br>        let crate_path = env!(&quot;CARGO_MANIFEST_DIR&quot;);<br>        // This can be the absolute path of the file like it is below<br>        // or it can simply be the name of the contract file like &quot;my-contract&quot;,<br>        // and the path of that file set via WASM_DIR env variable<br>        let wasm_path = &quot;../../target/wasm32-unknown-unknown/release/my-contract.wasm&quot;;<br>        Self(<br>            Contract::new(contract_id, chain)<br>                .with_wasm_path(wasm_path),<br>        )<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KSisG10eVEzCieQ6MsiKxQ.png" /></figure><p>Notice that we build the Contract instance with_wasm_path, where we provide the contract name. This contract name will be used to search the artifacts directory (set by ARTIFACTS_DIR env variable) for the .wasm file of your contract. Alternatively you can specify a path to the released wasm after running RUSTFLAGS=’-C link-arg=-s’ cargo wasm . See the <a href="https://docs.cosmwasm.com/docs/1.0/getting-started/compile-contract/">CosmWasm documentation on compiling your contract</a> for more information.</p><h3>Script</h3><p>Now that we have the interface written for our contract, we can start writing scripts to deploy and interact with it.</p><h3>Setup</h3><p>Like before, we’re going to setup a new folder for our scripts. This time, we’ll call it scripts and initialize it as a binary crate:</p><pre>cargo init --bin scripts</pre><blockquote><em>If your cargo project is a workspace, be sure to add </em><em>scripts to the [workspace].members array at the workspace root.</em></blockquote><p>Your scripts will have basically the same dependencies as your contract interfaces, but with a few additions:</p><pre>cargo add --path ../interfaces</pre><p>and also add the anyhow and dotenv crates:</p><pre>cargo add anyhow dotenv log</pre><h3>Env Configuration</h3><p>The dotenv crate will allow us to load environment variables from a .env file. This is useful for setting up the chain configuration for your scripts.</p><pre># .env<br># info, debug, trace<br>RUST_LOG=info<br><br># where the contract wasms are located<br>ARTIFACTS_DIR=&quot;../artifacts&quot;<br><br># where to store the output state data<br>DAEMON_STATE_PATH=&quot;./daemon_state.json&quot;<br><br># Mnemonics of the account that will be used to sign transactions<br>LOCAL_MNEMONIC=&quot;&quot;<br>TEST_MNEMONIC=&quot;&quot;<br>MAIN_MNEMONIC=&quot;&quot;</pre><p>IMPORTANT: Make sure to exclude the .env file in your gitignore.</p><h3>Main Function</h3><p>Now that we have our dependencies setup, we can start writing our script. Either create a new file in the src directory of the scripts/src package, or use the main.rs file that was created by default.</p><p>This function is mostly just boilerplate, so you can copy and paste it into your new script file. It will just call your function and give you nicer error traces:</p><pre>fn main() {<br>    dotenv().ok();<br>    env_logger::init();<br><br>    use dotenv::dotenv;<br>    if let Err(ref err) = deploy_contract() {<br>        log::error!(&quot;{}&quot;, err);<br>        err.chain()<br>            .skip(1)<br>            .for_each(|cause| log::error!(&quot;because: {}&quot;, cause));<br>::std::process::exit(1);<br>    }<br>}</pre><h3>Deployment Function</h3><p>First, we’ll define a function that will deploy our contract to the chain. This function will setup the environment (connecting to the chain), deploy the contract, and return a Result with the contract address.</p><pre>// scripts/src/my_contract.rs<br>use anyhow::Result;<br>use boot_core::networks;<br>use boot_core::prelude::{instantiate_daemon_env, NetworkInfo};<br>// Traits for contract deployment<br>use boot_core::interface::*;<br>use interfaces::my_contract::MyContract;<br><br>// Select the chain to deploy to<br>const NETWORK: NetworkInfo = networks::juno::UNI_5;<br>const CONTRACT_NAME: &amp;str = &quot;my-contract&quot;;<br><br>pub fn deploy_contract() -&gt; anyhow::Result&lt;String&gt; {<br>    // Setup the environment<br>    let (_, _sender, chain) = instantiate_daemon_env(network)?;<br><br>    // Create a new instance of your contract interface<br>    let contract = MyContract::new(CONTRACT_NAME, &amp;chain);<br>    // Upload your contract<br>    contract.upload()?;<br><br>    // Instantiate your contract<br>    let init_msg = InstantiateMsg {<br>        // ...<br>    };<br>    // The second argument is the admin, the third is any coins to send with the init message<br>    contract.instantiate(init_msg, None, None)?;<br><br>    // Load and return the contract address<br>    let contract_addr = contract.address()?;<br>    Ok(contract_addr)<br>}</pre><h3>Additional Scripts</h3><p>So you have your contract deployed, but what now? You can write additional scripts to interact with your contract. For example, you can write a script to query the contract state, or to execute a contract method.</p><p>Here’s an example of a script that queries the contract state:</p><pre>// scripts/src/my_contract.rs<br>// use ...<br>use my_contract::{QueryMsg};<br>// ...<br><br>pub fn query_contract() -&gt; Result&lt;()&gt; {<br>    // Setup the environment<br>    let (_, _sender, chain) = instantiate_daemon_env(NETWORK)?;<br><br>    let contract = MyContract::new(CONTRACT_NAME, &amp;chain);<br>    // Load the contract address (this will use the address set from the previous deploy script)<br>    let contract_addr = contract.address();<br>    // Query the contract<br>    let res = contract.query(QueryMsg::Balance {<br>      address: contract_addr,<br>    })?;<br>    // Print the result<br>    println!(&quot;{:?}&quot;, res);<br>    Ok(())<br>}</pre><p>And one that executes a contract method:</p><pre>// scripts/src/my_contract.rs<br>// use ...<br>use my_contract::{ExecuteMsg};<br>// ...<br><br>pub fn execute_contract() -&gt; Result&lt;()&gt; {<br>    // Setup the environment<br>    let (_, _sender, chain) = instantiate_daemon_env(NETWORK)?;<br><br>    <br>    let contract = MyContract::new(CONTRACT_NAME, &amp;chain);<br>    let contract_addr = contract.address();<br><br>    // Execute a contract method<br>    let res = contract.execute(ExecuteMsg::UpdateBalance {<br>      address: contract_addr,<br>      balance: Uint128::from(1000000u128),<br>    })?;<br>    // Print the result<br>    println!(&quot;{:?}&quot;, res);<br>    Ok(())<br>}</pre><h4>Refinement</h4><p>You can also refine your contract interface to make it easier to use. For example, you can create a function that will execute a specific contract method and return the result, instead of having to call contract.execute and contract.query separately.</p><pre>// interfaces/src/my_contract.rs<br>// Import the boot traits<br>use boot_core::interface::*;<br>// ...<br><br><br>impl&lt;Chain: BootEnvironment&gt; MyContract&lt;Chain&gt; {<br>    pub fn new(contract_id: &amp;str, chain: &amp;Chain) -&gt; Self {<br>      // ...<br>    }<br>    <br>    /// Query the balance of an address<br>    /// `address` - the address to query<br>    pub fn balance(&amp;self, address: Addr) -&gt; Result&lt;BalanceResponse&gt; {<br>        let balance_query = QueryMsg::Balance { address };<br>        self.query(balance_query)<br>    }<br>    <br>    /// Update the balance of an address<br>    /// `address` - the address to update<br>    /// `balance` - the new balance<br>    pub fn update_balance(&amp;self, address: Addr, balance: Uint128) -&gt; Result&lt;ExecuteResult&gt; {<br>        let update_balance_msg = ExecuteMsg::UpdateBalance {<br>            address,<br>            balance,<br>        };<br>        self.execute(update_balance_msg)<br>    }<br>}</pre><h3>References</h3><ul><li><a href="https://crates.io/crates/boot-core">Boot Core</a></li><li><a href="https://crates.io/crates/boot-cw-plus">Boot Cw-plus</a></li><li><a href="https://crates.io/crates/abstract-boot">Abstract Contract Interfaces</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d4ffd05c860" width="1" height="1" alt=""><hr><p><a href="https://medium.com/abstract-money/deploying-and-scripting-your-smart-contract-using-boot-5d4ffd05c860">Deploying and scripting your smart contract using BOOT</a> was originally published in <a href="https://medium.com/abstract-money">Abstract Money</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Abstract — How to create your own App Module]]></title>
            <link>https://medium.com/abstract-money/getting-started-with-abstract-how-to-create-your-own-app-module-5ddd644534f3?source=rss-89a4742fe643------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ddd644534f3</guid>
            <category><![CDATA[cosmwasm]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[cosmos]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <dc:creator><![CDATA[Abstract Contact]]></dc:creator>
            <pubDate>Fri, 18 Nov 2022 04:38:50 GMT</pubDate>
            <atom:updated>2023-03-29T14:42:21.994Z</atom:updated>
            <content:encoded><![CDATA[<h3>Getting Started with Abstract — How to create a Modular App (outdated)</h3><p><em>Note: this article is outdated and will be updated shortly.</em></p><p>This guide will walk you through the steps to create a CosmWasm smart-contract module using Abstract. You will be able to leverage other modules, interact with OSes, and deploy your contract all from one repository.</p><h3>Overview</h3><h3>Scaffold Generation</h3><p>Open a terminal window and run the following command to generate the <a href="https://github.com/Abstract-OS/app-template">scaffold app</a> on your machine:</p><blockquote><em>If you don’t yet have it installed you can install it with </em><em>cargo install cargo-generate</em></blockquote><pre>cargo generate gh:Abstract-OS/app-module-template \<br>               --branch template \<br>               --name &lt;module-name&gt;</pre><p>The above will clone the template repository into <em>&lt;module-name&gt;</em> which will be the name of your Abstract module.</p><blockquote><em>All message structs will be prefixed with this module name as well. Ex: </em><em>ModuleNameInstantiateMsg. This is to differentiate from the actual </em><em>InstantiateMsg (the true entry point) imported from </em><em>abstract_os.</em></blockquote><p>This name will also be the base name for most module-specific variables in the app. From here-on-out, the examples in this guide will be using “balancer”. This name will be the base name for most app-specific variables in the app as mentioned above.</p><h3>Project Structure</h3><p>Open the <em>module-name</em> folder, where you will find the following folders:</p><ul><li>contracts: your CosmWasm smart contracts</li><li>interfaces: Rust deployment interfaces for your smart contracts</li><li>scripts: scripts for deploying your module to Abstract Version Control and for writing tests</li></ul><p>Now that you have a fresh template, you are ready to start writing your module.</p><pre>cargo fmt # cleanup any template residuals<br>cargo build</pre><h3>Contract Structure</h3><blockquote><em>All the following files are referenced from </em><em>contracts/src directory. If you’ve ever written a CosmWasm smart contract before, this should be pretty standard aside from the </em>contract.rs<em> entry point.</em></blockquote><h4>msg.rs</h4><p>Message declarations for your module. Here you will find the entry-point msg declarations as well as their responses.</p><h4>error.rs</h4><p>Human-readable error declarations for the module.</p><h4>state.rs</h4><p>The actual state stored on-chain for your smart-contract. Item and Map are both from the <a href="https://github.com/CosmWasm/cw-storage-plus">cw-storage-plus</a> library, which provides powerful storage abstractions.</p><blockquote><em>Commonly-used state like the </em><em>Admin and </em><em>Contract Version are already provided natively by the Abstract-SDK and exposed to your handlers (details below 👀)</em></blockquote><h4>contract.rs</h4><p>This file serves as the overall entry point into your module. Abstract provides a wrapper around the <a href="https://docs.cosmwasm.com/docs/1.0/smart-contracts/entry-points/">CosmWasm entry points</a>, and exposes their configuration to you through the AppContract type. Your module-specific types for error, messages, and receive are then all encapsulated into a single new type: &lt;ModuleName&gt;App.</p><pre>pub type BalancerApp = AppContract&lt;<br>    BalancerError,<br>    BalancerExecuteMsg,<br>    BalancerInstantiateMsg,<br>    BalancerQueryMsg,<br>    BalancerMigrateMsg,<br>&gt;;</pre><p>Further down, we can see that our APP is an instance of this &lt;ModuleName&gt;App which declares each of the handlers for instantiate, query, execute, migrate, and replies.</p><pre>const APP: BalancerApp = BalApp::new(MODULE_NAME, MODULE_VERSION)<br>    .with_instantiate(handlers::instantiate_handler)<br>    .with_query(handlers::query_handler)<br>    .with_execute(handlers::execute_handler)<br>    .with_migrate(handlers::migrate_handler)<br>    .with_replies(&amp;[(EXAMPLE_REPLY_ID, handlers::example_reply_handler)])<br>    .with_dependencies(&amp;[EXCHANGE]);</pre><p>The dependencies specify which modules your users need to have installed in their OS to interact with the module. By default, the template declares the abstract:dex module as a dependency.</p><p>Finally, a Rust macro takes the type and const declaration of your app to export the actual CosmWasm entry points from your contract.</p><pre>export_endpoints!(APP, BalancerApp);</pre><h4>handlers</h4><p>All of the handlers for the messages sent to your contract (declared in msg.rs) are held within the handlers directory, and the appropriate messages can be handled via match statement.</p><p>Below is the ExecuteMsg handler for Equilibrium’s balancer module.</p><pre>pub fn execute_handler(<br>    deps: DepsMut,<br>    _env: Env,<br>    info: MessageInfo,<br>    balancer: BalancerApp,<br>    msg: BalancerExecuteMsg,<br>) -&gt; BalancerResult {<br>    match msg {<br>        BalancerExecuteMsg::Rebalance {} =&gt; rebalance(deps, info, balancer),<br>        BalancerExecuteMsg::UpdateAssetWeights { to_add, to_remove } =&gt; {<br>            update_asset_weights(deps, info, balancer, to_add, to_remove)<br>        }<br>        BalancerExecuteMsg::UpdateConfig { deviation, dex } =&gt; {<br>            update_config(deps, info, balancer, deviation, dex)<br>    }<br>}</pre><p>The &lt;ModuleName&gt;App acts as an adapter between your contract and the Abstract SDK, exposing Abstract Name System, other module functionality, asset value calculation, and much more. Read more in the <a href="https://docs.abstract.money">Abstract docs</a>.</p><h3>Deployment</h3><h3>Interfaces</h3><p>Within interfaces is a template.rs file that declares the deployment interface for your module. By default, the new function should be enough to deploy the contract but you can add additional functions to perform more advanced actions. See <a href="https://crates.io/crates/abstract-boot">abstract-boot</a> for more examples.</p><h3>Scripts</h3><p>To make your module available for other OSes to install on a local, Testnet, or Mainnet network, you can deploy your module directly from the template repo.</p><h4>1. Configure Deployment Env</h4><p>Rename the example env</p><pre># in the root<br>mv .env.example .env</pre><p>Configure the variables (this example uses uni-5 Juno testnet)</p><pre># human-readable name of the chain<br>CHAIN=&quot;juno&quot;<br># name of the deployment to be exported <br>DEPLOYMENT=&quot;v0.0.1&quot;<br># &quot;local&quot; | &quot;testnet&quot; | &quot;mainnet&quot;<br>NETWORK=&quot;testnet&quot; <br><br># Mnemonic of the account that will be used to deploy the contracts (admin)  <br>TEST_MNEMONIC=&quot;&quot;<br># Abstract version control address for app deployment  <br>VERSION_CONTROL_ADDRESS=junoxxx</pre><blockquote><em>The Abstract version control address can be found on </em><a href="https://beta.abstract.money/deployments"><em>https://beta.abstract.money/deployments</em></a><em> (check our discord for when it is available)</em></blockquote><h4>2. Configure the Deployment Network</h4><p>In src/bin/deploy_app.rs, configure the network to instantiate the daemon to be UNI_5 for Juno testnet or JUNO_1 for Juno mainnet. Other available networks are exported from boot_core (<a href="https://docs.rs/boot-core/latest/boot_core/networks/index.html">docs</a>).</p><pre>use boot_core::{instantiate_daemon_env, networks::juno::{JUNO_DAEMON, UNI_5, JUNO_1}};<br><br>pub fn deploy_app() -&gt; anyhow::Result&lt;()&gt; {<br>    let network = UNI_5;<br>    //...<br>}</pre><h4>3. Deploy to Version Control</h4><p>Run the following command:</p><pre>cargo deploy</pre><p>…and your module will be registered to Abstract Version Control. You can verify this by going to <a href="https://beta.abstract.money/ans">https://beta.abstract.money/</a>ans (soon) and checking the registered modules.</p><h3>Need help?</h3><p>Connect with us on <a href="https://discord.gg/uch3Tq3aym">Discord</a>! We’d be happy to help you with any questions, feedback, or suggestions.</p><h3>References</h3><ul><li><a href="https://docs.cosmwasm.com/docs/1.0/">Introduction | CosmWasm Documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ddd644534f3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/abstract-money/getting-started-with-abstract-how-to-create-your-own-app-module-5ddd644534f3">Getting Started with Abstract — How to create your own App Module</a> was originally published in <a href="https://medium.com/abstract-money">Abstract Money</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>