What Is The Abstract Platform?
The Abstract platform provides a combination of CosmWasm-oriented products.
- On-chain smart-contract infrastructure (Abstract SDK)
- Development tooling (cw-orchestrator)
- Front-end libraries (Abstract.js)
Our products are designed to be composable, allowing developers to re-use the components they need to build their applications. While Abstract aims to simplify the development experience, it functions as a powerful tool, enabling you to innovate with less effort.
In this page you are introduced to the Abstract platform and its components. You can skip the introduction and go straight to the Getting Started guide if you’re already familiar with the platform.
The Abstract SDK
The Abstract SDK is a modular smart-contract framework designed to enhance the development of decentralized applications. The SDK is built on top of CosmWasm: a battle-tested WASM-based smart-contract framework, written in Rust. The Abstract SDK is comprised of two main components:
Abstract Accounts
An Abstract Account is a smart-contract wallet developed by Abstract. That means that the smart-contract is capable of holding tokens and interacting with other smart-contracts. The contract’s ownership structure is customizable to fit the needs of users or applications. It is designed to be highly programmable, allowing developers to build and distribute complex applications on top of it.
Abstract Apps
Abstract Apps are smart-contracts that add functionality to an Abstract Account. Here’s a small snippet of code to give you an idea of how an App is created with the Abstract SDK:
#![allow(unused)] fn main() { pub const COUNTER_APP: CounterApp = CounterApp::new(COUNTER_ID, APP_VERSION, None) .with_instantiate(handlers::instantiate) .with_execute(handlers::execute) .with_query(handlers::query) .with_sudo(handlers::sudo) .with_receive(handlers::receive) .with_replies(&[(1u64, handlers::reply)]) .with_migrate(handlers::migrate); }
The code above defines an Abstract App. This app can be installed on any Abstract Account through the Abstract App store, allowing developers to monetize their code.
The customizable handlers that are used in the builder are functions similar to the native CosmWasm entry-point functions. They expose an additional App object which, via the abstract-sdk
, empowers you to execute intricate multi-contract transactions with minimum code. Importantly, this simplification does not limit the contract’s programmability. Instead, it provides a balance of efficient coding and comprehensive control over inter-contract interactions.
Already familiar with cw-orchestrator? Skip to the SDK’s introduction page.
Cw-Orchestrator
cw-orchestrator is a smart-contract scripting library that simplifies smart-contract interactions. It allows you to re-use code between testing and deployments and acts as our primary tool in making Abstract’s infrastructure highly available.
Here’s a snippet that sets up the complete Abstract SDK framework on a cw-multi-test environment, and deploys the previously shown App contract to the framework.
#![allow(unused)] fn main() { // Create a sender and instantiate the mock environment let sender = Addr::unchecked("sender"); let mock = Mock::new(&sender); // Construct the counter interface (a wrapper around the contract's entry points) let contract = CounterApp::new(COUNTER_ID, mock.clone()); // Deploy Abstract to the mock let abstr_deployment = Abstract::deploy_on(mock, Empty{})?; // Create a new account to install the app onto let account = abstr_deployment .account_factory .create_default_account(GovernanceDetails::Monarchy { monarch: sender.to_string(), })?; // Claim the namespace so app can be deployed abstr_deployment .version_control .claim_namespace(1, "my-namespace".to_string())?; // Deploy the app! contract.deploy(APP_VERSION.parse()?)?; }
Using cw-orchestrator for your smart-contract interactions reduces your testing/deployment overhead and improves both the code’s readability and maintainability.
Abstract.js
Abstract.js is the Javascript package for interacting with the on-chain Abstract framework. More documentation will be added soon.