Expand description
Start here. use fadroma::prelude::*
to get the essentials for
writing smart contracts with Fadroma.
Re-exports
pub use crate::core::*;
pub use crate::scrt::cosmwasm_std;
pub use schemars;
pub use crate::math::*;
pub use crate::snip20_client::ISnip20;
pub use crate::response::*;
pub use crate::vk::ViewingKey;
pub use crate::permit::Permit;
pub use crate::permit::Permission;
pub use crate::composability::Composable;
Modules
Generate JSON Schema documents from Rust code
Serde
Macros
This macro generates the boilerplate required to call into the contract-specific logic from the entry-points to the Wasm module.
This macro is very similar to the create_entry_points
macro, except it also requires the migrate
method:
Structs
DelegationsResponse is data format returned from StakingRequest::AllDelegations query
Binary is a wrapper around Vec
BondedDenomResponse is data format returned from StakingRequest::BondedDenom query
Bonded Ratio response
A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0
Delegation is basic (cheap to query) data about a delegation
An empty struct that serves as a placeholder in different places, such as contracts that don’t set a custom message.
Holds all external dependencies of the contract. Designed to allow easy dependency injection at runtime. This cannot be copied or cloned since it would behave differently for mock storages and a bridge storage in the VM.
FullDelegation is all the info on the delegation, some (like accumulated_reward and can_redelegate) is expensive to query
Inflation response
ProposalsResponse is data format returned from GovQuery::Proposals query
Rewards response
UnbondingDelegationsResponse is data format returned from StakingRequest::UnbondingDelegations query
ValidatorsResponse is data format returned from StakingRequest::Validators query
Enums
Structured error type for init, handle and query.
SystemError is used for errors inside the VM and is API friendly (i.e. serializable).
Constants
Traits
Api are callbacks to system functions defined outside of the wasm modules. This is a trait to allow Mocks in the test code.
A type which can be described as a JSON Schema document.
ReadonlyStorage is access to the contracts persistent data store
Functions
has_coins returns true if the list of coins has at least the required amount
Load something from the storage.
A shorthand to produce a log attribute
Load the value of a namespaced key.
Remove the value of a namespaced key from the storage.
Save something to the storage under a namespaced key.
A shorthand to produce a plaintext log attribute
Remove something from the storage.
Save something to the storage.
Take a Vecblock_size
,
using spaces at the end.
Type Definitions
Alias for StdResult<Option<V>>
.
KV is a Key-Value pair, returned from our iterators
A short-hand alias for the two-level query result (1. accessing the contract, 2. executing query in the contract)
The return type for init, handle and query. Since the error type cannot be serialized to JSON, this is only available within the contract and its unit tests.
Alias for StdResult<()>
.