ExecuteMsg

Enum ExecuteMsg 

Source
pub enum ExecuteMsg {
Show 19 variants UpdateConfig { keeper_addr: Option<Addr>, unbond_config: Option<UnbondConfig>, }, SetCustomUnbondConfig { lp_token: Addr, unbond_config: UnbondConfig, }, UnsetCustomUnbondConfig { lp_token: Addr, }, CreateRewardSchedule { lp_token: Addr, title: String, actual_creator: Option<Addr>, start_block_time: u64, end_block_time: u64, }, AllowLpToken { lp_token: Addr, }, RemoveLpToken { lp_token: Addr, }, AllowRewardCw20Token { addr: Addr, }, RemoveRewardCw20Token { addr: Addr, }, Receive(Cw20ReceiveMsg), Bond { lp_token: Addr, amount: Uint128, }, Unbond { lp_token: Addr, amount: Option<Uint128>, }, InstantUnbond { lp_token: Addr, amount: Uint128, }, Unlock { lp_token: Addr, }, InstantUnlock { lp_token: Addr, token_locks: Vec<TokenLock>, }, Withdraw { lp_token: Addr, }, ClaimUnallocatedReward { reward_schedule_id: u64, }, ProposeNewOwner { owner: Addr, expires_in: u64, }, ClaimOwnership {}, DropOwnershipProposal {},
}

Variants§

§

UpdateConfig

Allows an admin to update config params

Fields

§keeper_addr: Option<Addr>
§unbond_config: Option<UnbondConfig>
§

SetCustomUnbondConfig

Add custom unbdond config for a given LP token

Fields

§lp_token: Addr
§unbond_config: UnbondConfig
§

UnsetCustomUnbondConfig

Unset custom unbdond config for a given LP token

Fields

§lp_token: Addr
§

CreateRewardSchedule

Creates a new reward schedule for rewarding LP token holders a specific asset. Asset is distributed linearly over the duration of the reward schedule. This entry point is strictly meant for proposing reward schedules with native tokens. For proposing reward schedules with CW20 tokens, CW20 transfer with CreateRewardSchedule HookMsg is used. Only owner can create a reward schedule proposal.

Fields

§lp_token: Addr
§title: String
§actual_creator: Option<Addr>

The user on whose behalf the reward schedule might be being created by the owner This is particularly useful for the Gov admin scenario where a user proposes a reward schedule on the chain governance and the gov admin actually creates the reward schedule for the user

§start_block_time: u64
§end_block_time: u64
§

AllowLpToken

Allows an admin to allow a new LP token to be rewarded This is needed to prevent spam related to adding new reward schedules for random LP tokens

Fields

§lp_token: Addr
§

RemoveLpToken

. Allows an admin to remove an LP token from being rewarded. Existing reward schedules for the LP token will still be valid.

Fields

§lp_token: Addr
§

AllowRewardCw20Token

Add reward CW20 token to the list of allowed reward tokens

Fields

§addr: Addr
§

RemoveRewardCw20Token

Remove reward CW20 token from the list of allowed reward tokens

Fields

§addr: Addr
§

Receive(Cw20ReceiveMsg)

Allows the contract to receive CW20 tokens. The contract can receive CW20 tokens from LP tokens for staking and CW20 assets to be used as rewards.

§

Bond

Allows to bond LP tokens to the contract. Bonded tokens are eligible to receive rewards.

Fields

§lp_token: Addr
§amount: Uint128
§

Unbond

Allows to unbond LP tokens from the contract. After unbonding, the tokens are still locked for a locking period. During this period, the tokens are not eligible to receive rewards. After the locking period, the tokens can be withdrawn.

Fields

§lp_token: Addr
§amount: Option<Uint128>
§

InstantUnbond

Instantly unbonds LP tokens from the contract. No locking period is applied. The tokens are withdrawn from the contract and sent to the user. An Instant Unbonding fee is applicable to the amount being unbonded. The fee is calculated as a percentage of the amount being unbonded and sent to the protocol treasury.

Fields

§lp_token: Addr
§amount: Uint128
§

Unlock

Unlocks the tokens which are locked for a locking period. After unlocking, the tokens are withdrawn from the contract and sent to the user.

Fields

§lp_token: Addr
§

InstantUnlock

Instant unlock is a extension of instant unbonding feature which allows to insantly unbond tokens which are in a locked state post normal unbonding. This is useful when a user mistakenly unbonded the tokens instead of instant unbonding or if a black swan event occurs and the user has the LP tokens in a locked state after unbonding.

Fields

§lp_token: Addr
§token_locks: Vec<TokenLock>

Altought it is use possible to index or something similar to calculate this, it would lead to problems with order of transaction execution, thus it is better to pass the full lock explicitly.

§

Withdraw

Allows to withdraw unbonded rewards for a specific LP token. The rewards are sent to the user’s address.

Fields

§lp_token: Addr
§

ClaimUnallocatedReward

Allows a reward schedule creator to claim back amount that was not allocated to anyone since no token were bonded. This can only be claimed after reward schedule expiry

Fields

§reward_schedule_id: u64
§

ProposeNewOwner

Allows the owner to transfer ownership to a new address. Ownership transfer is done in two steps:

  1. The owner proposes a new owner.
  2. The new owner accepts the ownership. The proposal expires after a certain period of time within which the new owner must accept the ownership.

Fields

§owner: Addr
§expires_in: u64
§

ClaimOwnership

Allows the new owner to accept ownership.

§

DropOwnershipProposal

Allows the owner to drop the ownership transfer proposal.

Trait Implementations§

Source§

impl Clone for ExecuteMsg

Source§

fn clone(&self) -> ExecuteMsg

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExecuteMsg

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ExecuteMsg

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for ExecuteMsg

Source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for ExecuteMsg

Source§

fn eq(&self, other: &ExecuteMsg) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ExecuteMsg

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ExecuteMsg

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,