#[cfg(not(feature = "scrt"))]
std::compile_error!("Fadroma only currently supports Secret Network so the \"scrt\" feature must be enabled.");
#[cfg(feature = "scrt")]
pub use secret_cosmwasm_std as cosmwasm_std;
pub use schemars;
pub use serde;
pub mod bin_serde;
pub mod core;
#[cfg(feature = "scrt")]
pub mod scrt;
pub mod tokens;
pub use fadroma_dsl as dsl;
pub mod killswitch;
pub mod admin;
#[cfg(feature = "crypto")]
pub mod crypto;
pub mod storage;
#[cfg(all(feature = "ensemble", not(target_arch = "wasm32")))]
pub mod ensemble;
pub mod prelude {
pub type UsuallyOk = cosmwasm_std::StdResult<()>;
pub type Eventually<V> = cosmwasm_std::StdResult<Option<V>>;
pub use crate::core::*;
pub use crate::bin_serde::{FadromaSerialize, FadromaDeserialize};
pub use crate::cosmwasm_std::{self, *};
#[cfg(feature = "scrt")]
pub use crate::scrt::{ResponseExt, to_cosmos_msg, space_pad, BLOCK_SIZE};
pub use crate::tokens::*;
pub use schemars::{self, JsonSchema};
pub use crate::storage::{
self, Key, Namespace, CompositeKey, StaticKey, FixedSegmentSizeKey,
TypedKey, TypedKey2, TypedKey3, TypedKey4, SingleItem, ItemSpace
};
#[cfg(feature = "vk")]
pub use crate::scrt::vk::{ViewingKey, ViewingKeyHashed};
#[cfg(feature = "permit")]
pub use crate::scrt::permit::{Permission, Permit};
}
#[macro_export]
macro_rules! entrypoint {
(@init $($init:ident)::+) => {
#[no_mangle]
extern "C" fn instantiate(env_ptr: u32, info_ptr: u32, msg_ptr: u32) -> u32 {
$crate::cosmwasm_std::do_instantiate(&super::$($init)::+, env_ptr, info_ptr, msg_ptr)
}
};
(@execute $($execute:ident)::+) => {
#[no_mangle]
extern "C" fn execute(env_ptr: u32, info_ptr: u32, msg_ptr: u32) -> u32 {
$crate::cosmwasm_std::do_execute(&super::$($execute)::+, env_ptr, info_ptr, msg_ptr)
}
};
(@query $($query:ident)::+) => {
#[no_mangle]
extern "C" fn query(env_ptr: u32, msg_ptr: u32) -> u32 {
$crate::cosmwasm_std::do_query(&super::$($query)::+, env_ptr, msg_ptr)
}
};
(@reply $($reply:ident)::+) => {
#[no_mangle]
extern "C" fn reply(env_ptr: u32, msg_ptr: u32) -> u32 {
$crate::cosmwasm_std::do_reply(&super::$($reply)::+, env_ptr, msg_ptr)
}
};
(@wasm_mod $($contents:tt)*) => {
#[cfg(target_arch = "wasm32")]
mod wasm {
$($contents)*
}
};
(
init: $($init:ident)::+,
execute: $($execute:ident)::+,
query: $($query:ident)::+
$(, reply: $($reply:ident)::+)?
) => {
$crate::entrypoint! {
@wasm_mod
$crate::entrypoint!(@init $($init)::+);
$crate::entrypoint!(@execute $($execute)::+);
$crate::entrypoint!(@query $($query)::+);
$($crate::entrypoint!(@reply $($reply)::+);)?
}
};
}