pub struct PayoutState {
pub op_id: u64,
pub receiver: Address,
pub amount: u128,
pub owner: Address,
pub escrow_shares: u128,
pub burn_shares: u128,
}Expand description
Final step that transfers assets to the receiver and settles the share escrow.
§Transitions
- On success or failure:
Idle.
§Invariant hooks
idle_balancedecreases only on payout success byamount.- On success,
burn_sharesare burned fromescrow_shares; any remainder is refunded. - On failure, all
escrow_sharesare refunded.
Fields§
§op_id: u64§receiver: Address§amount: u128§owner: AddressTrait Implementations§
Source§impl BorshDeserialize for PayoutState
impl BorshDeserialize for PayoutState
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSchema for PayoutState
impl BorshSchema for PayoutState
Source§fn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
Source§fn add_definitions_recursively(
definitions: &mut BTreeMap<Declaration, Definition>,
)
fn add_definitions_recursively( definitions: &mut BTreeMap<Declaration, Definition>, )
Recursively, using DFS, add type definitions required for this type.
Type definition partially explains how to serialize/deserialize a type.
Source§impl BorshSerialize for PayoutState
impl BorshSerialize for PayoutState
Source§impl Clone for PayoutState
impl Clone for PayoutState
Source§fn clone(&self) -> PayoutState
fn clone(&self) -> PayoutState
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PayoutState
impl Debug for PayoutState
Source§impl<'de> Deserialize<'de> for PayoutState
impl<'de> Deserialize<'de> for PayoutState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 From<PayoutState> for OpState
impl From<PayoutState> for OpState
Source§fn from(value: PayoutState) -> Self
fn from(value: PayoutState) -> Self
Converts to this type from the input type.
Source§impl PartialEq for PayoutState
impl PartialEq for PayoutState
Source§impl Serialize for PayoutState
impl Serialize for PayoutState
impl Eq for PayoutState
impl StructuralPartialEq for PayoutState
Auto Trait Implementations§
impl Freeze for PayoutState
impl RefUnwindSafe for PayoutState
impl Send for PayoutState
impl Sync for PayoutState
impl Unpin for PayoutState
impl UnwindSafe for PayoutState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more