18 releases (9 breaking)

0.21.0 Feb 20, 2024
0.19.2 Oct 19, 2023
0.18.0 Jul 28, 2023
0.13.0 Mar 28, 2023

#351 in Magic Beans

Download history 37/week @ 2023-12-22 7/week @ 2023-12-29 23/week @ 2024-01-05 74/week @ 2024-01-12 122/week @ 2024-01-19 57/week @ 2024-01-26 45/week @ 2024-02-02 28/week @ 2024-02-09 182/week @ 2024-02-16 284/week @ 2024-02-23 195/week @ 2024-03-01 141/week @ 2024-03-08 81/week @ 2024-03-15 191/week @ 2024-03-22 539/week @ 2024-03-29 188/week @ 2024-04-05

1,014 downloads per month
Used in 21 crates (20 directly)

GPL-3.0-or-later

385KB
9K SLoC

Abstract

This package contains everything you need to interact with Abstract contracts.

This package contains:

  • Abstract contract interface messages
  • Abstract contract states
  • Abstract objects (preferably use the re-exported version in Abstract-SDK)

Usage

// Import a contract Exec/Init/Query message
abstract_core::contract::ExecuteMsg
// Import a contract state lay-out
abstract_core::contract::state::STATE
// Import a state object
abstract_core::object::ProxyValue;

Messages

Each interface in individually commented.

States

Each state-layout is also individually covered

Objects

Abstract Objects are used to store information along with helper functions. We provide these as imports so the data can be retrieved externally (using Raw Queries).

If you want to use these objects in your own contracts we suggest using the abstract-sdk package.


lib.rs:

Abstract Account

Abstract Interface is the interface-defining crate to the Abstract smart-contract framework.

Description

This crate provides the key utilities that are required to integrate with or write Abstract contracts.

Messages

All interfacing message structs are defined here so they can be imported.

use abstract_core::manager::ExecuteMsg;

Assets

cw-asset is used for asset-management. If a message requests a String value for an Asset field then you need to provide the human-readable ans_host key. The full list of supported assets and contracts is given here. The contract will handel address retrieval internally.

State

The internal state for each contract is also contained within this crate. This ensures that breaking changes to the internal state are easily spotted. It also allows for tight and low-gas integration between contracts by performing raw queries on these states. A contract's state object can be imported and used like:

use crate::manager::state::ACCOUNT_ID
let account_id = ACCOUNT_ID.query(querier, manager_address).unwrap();

The internally stored objects are also contained within this package in crate::objects.

Names

Abstract contract names are used internally and for version management. They are exported for ease of use:

use abstract_core::PROXY;

Errors

An AbstractError wraps error throws by StdError or AssetError. It is also use in the objects to throw errors.

Dependencies

~4–17MB
~203K SLoC