Struct Contract

Source
pub struct Contract { /* private fields */ }

Implementations§

Source§

impl Contract

Source

pub fn ensure_auth_predecessor_id(&self) -> AccountId

Source

pub fn add_public_key_and_emit_event( &mut self, account_id: &AccountIdRef, public_key: PublicKey, )

Source

pub fn remove_public_key_and_emit_event( &mut self, account_id: &AccountIdRef, public_key: PublicKey, )

Source§

impl Contract

Source

pub const STATE_INIT_GAS: Gas

Covers StateInit (NEP-616) cost when deterministic account doesn’t exist yet. Only accounts for deploying via Global Contract ref (NEP-591) with <770B storage which doesn’t require storage staking.

Source

pub fn do_auth_call(signer_id: AccountId, auth_call: AuthCall) -> Promise

Source§

impl Contract

Source

pub fn auth_call_callback_gas(auth_call: &AuthCall) -> Option<Gas>

Computes the static gas assigned to the do_auth_call callback.

Source§

impl Contract

Source

pub fn ft_resolve_deposit( &mut self, receiver_id: AccountId, contract_id: AccountId, amount: U128, ) -> PromiseOrValue<U128>

Source§

impl Contract

Source

pub fn do_native_withdraw(withdraw: NativeWithdraw) -> Promise

Source§

impl Contract

Source

pub fn do_storage_deposit(storage_deposit: StorageDeposit) -> Promise

Source§

impl Contract

Source

pub fn do_ft_withdraw(withdraw: FtWithdraw) -> Promise

Source§

impl Contract

Source

pub fn nft_resolve_deposit( &mut self, receiver_id: AccountId, contract_id: AccountId, nft_token_id: TokenId, ) -> PromiseOrValue<bool>

Source§

impl Contract

Source

pub fn do_nft_withdraw(withdraw: NftWithdraw) -> Promise

Source§

impl Contract

Source

pub fn mt_resolve_deposit( &mut self, receiver_id: AccountId, contract_id: AccountId, tokens: Vec<TokenId>, amounts: Vec<U128>, ) -> PromiseOrValue<Vec<U128>>

Source§

impl Contract

Source

pub fn do_mt_withdraw(withdraw: MtWithdraw) -> Promise

Source§

impl Contract

Source

pub fn resolve_deposit_internal<'a, I>( &mut self, receiver_id: &AccountIdRef, tokens: I, )
where I: IntoIterator<Item = (TokenId, &'a mut u128)>, I::IntoIter: ExactSizeIterator,

Source§

impl Contract

Source

pub fn ext(account_id: AccountId) -> ContractExt

API for calling this contract’s functions in a subsequent execution.

Source

pub fn ext_on(promise: Promise) -> ContractExt

Source§

impl Contract

Source§

impl Contract

Source

pub fn new(config: DefuseConfig) -> Contract

Trait Implementations§

Source§

impl AccessControllable for Contract

Source§

fn acl_storage_prefix() -> &'static [u8]

Returns the storage prefix for collections related to access control. By default b"__acl" is used. Read more
Source§

fn acl_init_super_admin(&mut self, account_id: AccountId) -> bool

Adds account_id as super-admin without checking any permissions in case there are no super-admins. If there is already a super-admin, it has no effect. This function can be used to add a super-admin during contract initialization. Moreover, it may provide a recovery mechanism if (mistakenly) all super-admins have been removed. Read more
Source§

fn acl_add_super_admin(&mut self, account_id: AccountId) -> Option<bool>

Adds account_id as super-admin provided that the predecessor has sufficient permissions, i.e. is a super-admin as defined by [acl_is_super_admin]. To add the first super-admin, [acl_init_super_admin] can be used. Read more
Source§

fn acl_role_variants(&self) -> Vec<&'static str>

Returns the names of all variants of the enum that represents roles. Read more
Source§

fn acl_is_super_admin(&self, account_id: AccountId) -> bool

Returns whether account_id is a super-admin. A super-admin has admin permissions for every role. However, a super-admin is not considered grantee of any role.
Source§

fn acl_revoke_super_admin(&mut self, account_id: AccountId) -> Option<bool>

Revoke super-admin permissions from account_id provided that the predecessor has sufficient permissions, i.e. is a super-admin as defined by [acl_is_super_admin]. This means a super-admin may revoke super-admin permissions from any other super-admin. Read more
Source§

fn acl_transfer_super_admin(&mut self, account_id: AccountId) -> Option<bool>

Transfer super-admin permissions from the predecessor to account_id provided that the predecessor has sufficient permissions, i.e. is a super-admin as defined by [acl_is_super_admin]. This function allows a super-admin to revoke the permission from themselves and add account_id as super-admin. While it is a helper for use cases which require this transfer, it should be noted that AccessControllable allows having more than one super-admin. Read more
Source§

fn acl_add_admin(&mut self, role: String, account_id: AccountId) -> Option<bool>

Makes account_id an admin provided that the predecessor has sufficient permissions, i.e. is an admin as defined by [acl_is_admin]. Read more
Source§

fn acl_is_admin(&self, role: String, account_id: AccountId) -> bool

Returns whether account_id is an admin for role. Super-admins are admins for every role. Read more
Source§

fn acl_revoke_admin( &mut self, role: String, account_id: AccountId, ) -> Option<bool>

Revokes admin permissions for role from account_id provided that the predecessor has sufficient permissions, i.e. is an admin as defined by [acl_is_admin]. This means an admin for role may revoke admin permissions from any other account that is admin for role. Read more
Source§

fn acl_renounce_admin(&mut self, role: String) -> bool

Revokes admin permissions for role from the predecessor. Returns whether the predecessor was an admin for role. Read more
Source§

fn acl_revoke_role( &mut self, role: String, account_id: AccountId, ) -> Option<bool>

Revokes role from account_id provided that the predecessor has sufficient permissions, i.e. is an admin as defined by [acl_is_admin]. Read more
Source§

fn acl_renounce_role(&mut self, role: String) -> bool

Revokes role from the predecessor and returns whether it was a grantee of role. Read more
Source§

fn acl_grant_role( &mut self, role: String, account_id: AccountId, ) -> Option<bool>

Grants role to account_id provided that the predecessor has sufficient permissions, i.e. is an admin as defined by [acl_is_admin]. Read more
Source§

fn acl_has_role(&self, role: String, account_id: AccountId) -> bool

Returns whether account_id has been granted role. Note that adding an account as (super-)admin for role does not make that account a grantee of role. Instead, role has to be granted explicitly.
Source§

fn acl_has_any_role(&self, roles: Vec<String>, account_id: AccountId) -> bool

Returns whether account_id has been granted any of the roles.
Source§

fn acl_get_super_admins(&self, skip: u64, limit: u64) -> Vec<AccountId>

Enables paginated retrieval of super-admins. It returns up to limit super-admins and skips the first skip super-admins.
Source§

fn acl_get_admins(&self, role: String, skip: u64, limit: u64) -> Vec<AccountId>

Enables paginated retrieval of admins of role. It returns up to limit admins and skips the first skip admins.
Source§

fn acl_get_grantees( &self, role: String, skip: u64, limit: u64, ) -> Vec<AccountId>

Enables paginated retrieval of grantees of role. It returns up to limit grantees and skips the first skip grantees.
Source§

fn acl_get_permissioned_accounts(&self) -> PermissionedAccounts

Convenience method that returns all [PermissionedAccounts]. Read more
Source§

impl AccountManager for Contract

Source§

fn has_public_key(&self, account_id: &AccountId, public_key: &PublicKey) -> bool

Check if account has given public key
Source§

fn public_keys_of(&self, account_id: &AccountId) -> HashSet<PublicKey>

Returns set of public keys registered for given account
Source§

fn add_public_key(&mut self, public_key: PublicKey)

Registers or re-activates public_key under the caller account_id. Read more
Source§

fn remove_public_key(&mut self, public_key: PublicKey)

Deactivate public_key from the caller account_id, i.e. this key can’t be used to make any actions unless it’s re-created. Read more
Source§

fn is_nonce_used(&self, account_id: &AccountId, nonce: AsBase64<Nonce>) -> bool

Returns whether given nonce was already used by the account NOTE: nonces are non-sequential and follow permit2 nonce schema.
Source§

fn is_auth_by_predecessor_id_enabled(&self, account_id: &AccountId) -> bool

Returns whether authentication by PREDECESSOR_ID is enabled for given account_id. Read more
Source§

fn disable_auth_by_predecessor_id(&mut self)

Disables authentication by PREDECESSOR_ID for the caller, i.e. PREDECESSOR_ID itself. Read more
Source§

impl BorshDeserialize for Contract

Source§

fn deserialize_reader<__R: Read>(reader: &mut __R) -> 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>

Deserialize this instance from a slice of bytes.
§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

Source§

impl BorshSerialize for Contract

Source§

fn serialize<__W: Write>(&self, writer: &mut __W) -> Result<(), Error>

Source§

impl ContractState for Contract

§

fn state_key() -> &'static [u8]

§

fn state_exists() -> bool

§

fn state_read() -> Option<Self>
where Self: BorshDeserialize,

§

fn state_write(&self) -> bool
where Self: BorshSerialize,

Source§

impl ControllerUpgradable for Contract

Source§

fn upgrade( &mut self, code: Vec<u8>, state_migration_gas: Option<Gas>, ) -> Promise

Requires 1yN attached for security purposes
Source§

fn state_migrate(&mut self)

MUST be #[private]
Source§

impl Default for Contract

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Deref for Contract

Source§

type Target = ContractStorage

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for Contract

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl FeesManager for Contract

Source§

fn set_fee(&mut self, fee: Pips)

Set fees for both token_in and token_out
Source§

fn fee(&self) -> Pips

Source§

fn set_fee_collector(&mut self, fee_collector: AccountId)

Source§

fn fee_collector(&self) -> &AccountId

Source§

impl ForceAccountManager for Contract

Source§

fn is_account_locked(&self, account_id: &AccountId) -> bool

Returns whether the givenaccount_id is locked
Source§

fn force_lock_account(&mut self, account_id: AccountId) -> bool

Locks given account_id from modifying its own state, including token balances. Returns false if the account was already in locked state. Read more
Source§

fn force_unlock_account(&mut self, account_id: &AccountId) -> bool

Unlocks given account_id. Returns false if the account wasn’t in locked state. Read more
Source§

fn force_disable_auth_by_predecessor_ids(&mut self, account_ids: Vec<AccountId>)

Disables authentication by PREDECESSOR_ID for given account ids. Read more
Source§

fn force_enable_auth_by_predecessor_ids(&mut self, account_ids: Vec<AccountId>)

Enables authentication by PREDECESSOR_ID for given account ids. Read more
Source§

fn force_add_public_keys( &mut self, public_keys: HashMap<AccountId, HashSet<PublicKey>>, )

Registers or re-activates public_key under the user account_id. Read more
Source§

fn force_remove_public_keys( &mut self, public_keys: HashMap<AccountId, HashSet<PublicKey>>, )

Deactivate public_key from the user account_id, i.e. this key can’t be used to make any actions unless it’s re-created. Read more
Source§

impl FullAccessKeys for Contract

Source§

fn add_full_access_key(&mut self, public_key: PublicKey) -> Promise

Source§

fn delete_key(&mut self, public_key: PublicKey) -> Promise

Source§

impl FungibleTokenForceWithdrawer for Contract

Source§

fn ft_force_withdraw( &mut self, owner_id: AccountId, token: AccountId, receiver_id: AccountId, amount: U128, memo: Option<String>, msg: Option<String>, ) -> PromiseOrValue<U128>

Source§

impl FungibleTokenReceiver for Contract

Source§

fn ft_on_transfer( &mut self, sender_id: AccountId, amount: U128, msg: String, ) -> PromiseOrValue<U128>

Deposit fungible tokens.

msg contains [AccountId] of the internal recipient. Empty msg means deposit to sender_id

Source§

impl FungibleTokenWithdrawResolver for Contract

Source§

fn ft_resolve_withdraw( &mut self, token: AccountId, sender_id: AccountId, amount: U128, is_call: bool, ) -> U128

Source§

impl FungibleTokenWithdrawer for Contract

Source§

fn ft_withdraw( &mut self, token: AccountId, receiver_id: AccountId, amount: U128, memo: Option<String>, msg: Option<String>, ) -> PromiseOrValue<U128>

Returns number of tokens were successfully withdrawn. Read more
Source§

impl GarbageCollector for Contract

Source§

fn cleanup_nonces(&mut self, nonces: Vec<(AccountId, Vec<AsBase64<Nonce>>)>)

Clears all expired nonces for given accounts by its prefix. Omitting any errors, e.g. if account doesn’t exist or nonces are not expired. NOTE: MUST attach 1 yⓃ for security purposes.
Source§

impl ImtBurner for Contract

Source§

fn imt_burn( &mut self, minter_id: AccountId, tokens: ImtTokens, memo: Option<String>, )

Burn a set of imt tokens, within the intents contract Read more
Source§

impl Intents for Contract

Source§

impl MultiTokenCore for Contract

Source§

fn mt_transfer( &mut self, receiver_id: AccountId, token_id: TokenId, amount: U128, approval: Option<(AccountId, u64)>, memo: Option<String>, )

Source§

fn mt_batch_transfer( &mut self, receiver_id: AccountId, token_ids: Vec<TokenId>, amounts: Vec<U128>, approvals: Option<Vec<Option<(AccountId, u64)>>>, memo: Option<String>, )

Source§

fn mt_transfer_call( &mut self, receiver_id: AccountId, token_id: TokenId, amount: U128, approval: Option<(AccountId, u64)>, memo: Option<String>, msg: String, ) -> PromiseOrValue<Vec<U128>>

Source§

fn mt_batch_transfer_call( &mut self, receiver_id: AccountId, token_ids: Vec<TokenId>, amounts: Vec<U128>, approvals: Option<Vec<Option<(AccountId, u64)>>>, memo: Option<String>, msg: String, ) -> PromiseOrValue<Vec<U128>>

Source§

fn mt_token(&self, token_ids: Vec<TokenId>) -> Vec<Option<Token>>

Source§

fn mt_balance_of(&self, account_id: AccountId, token_id: TokenId) -> U128

Source§

fn mt_batch_balance_of( &self, account_id: AccountId, token_ids: Vec<TokenId>, ) -> Vec<U128>

Source§

fn mt_supply(&self, token_id: TokenId) -> Option<U128>

Source§

fn mt_batch_supply(&self, token_ids: Vec<TokenId>) -> Vec<Option<U128>>

Source§

impl MultiTokenEnumeration for Contract

Source§

fn mt_tokens(&self, from_index: Option<U128>, limit: Option<u32>) -> Vec<Token>

Get a list of all tokens Read more
Source§

fn mt_tokens_for_owner( &self, account_id: AccountId, from_index: Option<U128>, limit: Option<u32>, ) -> Vec<Token>

Get list of all tokens owned by a given account Read more
Source§

impl MultiTokenForcedCore for Contract

Source§

fn mt_force_transfer( &mut self, owner_id: AccountId, receiver_id: AccountId, token_id: TokenId, amount: U128, approval: Option<(AccountId, u64)>, memo: Option<String>, )

Source§

fn mt_force_batch_transfer( &mut self, owner_id: AccountId, receiver_id: AccountId, token_ids: Vec<TokenId>, amounts: Vec<U128>, approvals: Option<Vec<Option<(AccountId, u64)>>>, memo: Option<String>, )

Source§

fn mt_force_transfer_call( &mut self, owner_id: AccountId, receiver_id: AccountId, token_id: TokenId, amount: U128, approval: Option<(AccountId, u64)>, memo: Option<String>, msg: String, ) -> PromiseOrValue<Vec<U128>>

Source§

fn mt_force_batch_transfer_call( &mut self, owner_id: AccountId, receiver_id: AccountId, token_ids: Vec<TokenId>, amounts: Vec<U128>, approvals: Option<Vec<Option<(AccountId, u64)>>>, memo: Option<String>, msg: String, ) -> PromiseOrValue<Vec<U128>>

Source§

impl MultiTokenForcedWithdrawer for Contract

Source§

fn mt_force_withdraw( &mut self, owner_id: AccountId, token: AccountId, receiver_id: AccountId, token_ids: Vec<TokenId>, amounts: Vec<U128>, memo: Option<String>, msg: Option<String>, ) -> PromiseOrValue<Vec<U128>>

Source§

impl MultiTokenReceiver for Contract

Source§

fn mt_on_transfer( &mut self, sender_id: AccountId, previous_owner_ids: Vec<AccountId>, token_ids: Vec<TokenId>, amounts: Vec<U128>, msg: String, ) -> PromiseOrValue<Vec<U128>>

Deposit multi-tokens.

msg contains [AccountId] of the internal recipient. Empty msg means deposit to sender_id

Source§

impl MultiTokenResolver for Contract

Source§

fn mt_resolve_transfer( &mut self, previous_owner_ids: Vec<AccountId>, receiver_id: AccountId, token_ids: Vec<TokenId>, amounts: Vec<U128>, approvals: Option<Vec<Option<Vec<ClearedApproval>>>>, ) -> Vec<U128>

Source§

impl MultiTokenWithdrawResolver for Contract

Source§

fn mt_resolve_withdraw( &mut self, token: AccountId, sender_id: AccountId, token_ids: Vec<TokenId>, amounts: Vec<U128>, is_call: bool, ) -> Vec<U128>

Source§

impl MultiTokenWithdrawer for Contract

Source§

fn mt_withdraw( &mut self, token: AccountId, receiver_id: AccountId, token_ids: Vec<TokenId>, amounts: Vec<U128>, memo: Option<String>, msg: Option<String>, ) -> PromiseOrValue<Vec<U128>>

Returns number of tokens were successfully withdrawn Read more
Source§

impl NonFungibleTokenForceWithdrawer for Contract

Source§

fn nft_force_withdraw( &mut self, owner_id: AccountId, token: AccountId, receiver_id: AccountId, token_id: TokenId, memo: Option<String>, msg: Option<String>, ) -> PromiseOrValue<bool>

Source§

impl NonFungibleTokenReceiver for Contract

Source§

fn nft_on_transfer( &mut self, sender_id: AccountId, previous_owner_id: AccountId, token_id: TokenId, msg: String, ) -> PromiseOrValue<bool>

Deposit non-fungible token.

msg contains [AccountId] of the internal recipient. Empty msg means deposit to sender_id

Source§

impl NonFungibleTokenWithdrawResolver for Contract

Source§

fn nft_resolve_withdraw( &mut self, token: AccountId, sender_id: AccountId, token_id: TokenId, is_call: bool, ) -> bool

Source§

impl NonFungibleTokenWithdrawer for Contract

Source§

fn nft_withdraw( &mut self, token: AccountId, receiver_id: AccountId, token_id: TokenId, memo: Option<String>, msg: Option<String>, ) -> PromiseOrValue<bool>

Returns number of tokens were successfully withdrawn Read more
Source§

impl Pausable for Contract

Source§

fn pa_storage_key(&self) -> &'static [u8]

Returns the key of the storage slot which contains the list of features that are paused. By default b"__PAUSED__" is used. Read more
Source§

fn pa_is_paused(&self, key: String) -> bool

Returns whether feature key is paused.
Source§

fn pa_all_paused(&self) -> Option<HashSet<String>>

Returns all features that are currently paused.
Source§

fn pa_pause_feature(&mut self, key: String) -> bool

Pauses feature key. This method fails if the caller has not been granted one of the access control pause_roles passed to the Pausable plugin. Read more
Source§

fn pa_unpause_feature(&mut self, key: String) -> bool

Unpauses feature key. This method fails if the caller has not been granted one of the access control unpause_roles passed to the Pausable plugin. Read more
Source§

impl RelayerKeys for Contract

Source§

fn add_relayer_key(&mut self, public_key: PublicKey) -> Promise

Adds access key for calling execute_signed_intents with allowance passed as attached deposit via #[payable] NOTE: requires 1yN for security purposes
Source§

fn do_add_relayer_key(&mut self, public_key: PublicKey)

Source§

fn delete_relayer_key(&mut self, public_key: PublicKey) -> Promise

NOTE: requires 1yN for security purposes
Source§

impl SaltManager for Contract

Source§

fn update_current_salt(&mut self) -> Salt

Sets the current salt to a new one, previous salt remains valid. Returns the new current salt.
Source§

fn invalidate_salts(&mut self, salts: Vec<Salt>) -> Salt

Invalidates the provided salt: invalidates provided salt, sets a new one if it was current salt. Returns the current salt.
Source§

fn is_valid_salt(&self, salt: Salt) -> bool

Returns whether the provided salt is valid
Source§

fn current_salt(&self) -> Salt

Returns the current salt
Source§

impl State for Contract

Source§

fn add_public_key( &mut self, account_id: AccountId, public_key: PublicKey, ) -> Result<()>

Source§

fn remove_public_key( &mut self, account_id: AccountId, public_key: PublicKey, ) -> Result<()>

Source§

fn commit_nonce(&mut self, account_id: AccountId, nonce: Nonce) -> Result<()>

Source§

fn cleanup_nonce_by_prefix( &mut self, account_id: &AccountIdRef, prefix: NoncePrefix, ) -> Result<bool>

Source§

fn internal_add_balance( &mut self, owner_id: AccountId, tokens: impl IntoIterator<Item = (TokenId, u128)>, ) -> Result<()>

Source§

fn internal_sub_balance( &mut self, owner_id: &AccountIdRef, tokens: impl IntoIterator<Item = (TokenId, u128)>, ) -> Result<()>

Source§

fn ft_withdraw( &mut self, owner_id: &AccountIdRef, withdraw: FtWithdraw, ) -> Result<()>

Source§

fn nft_withdraw( &mut self, owner_id: &AccountIdRef, withdraw: NftWithdraw, ) -> Result<()>

Source§

fn mt_withdraw( &mut self, owner_id: &AccountIdRef, withdraw: MtWithdraw, ) -> Result<()>

Source§

fn native_withdraw( &mut self, owner_id: &AccountIdRef, withdraw: NativeWithdraw, ) -> Result<()>

Source§

fn notify_on_transfer( &self, sender_id: &AccountIdRef, receiver_id: AccountId, tokens: Amounts, notification: NotifyOnTransfer, )

Source§

fn storage_deposit( &mut self, owner_id: &AccountIdRef, storage_deposit: StorageDeposit, ) -> Result<()>

Source§

fn set_auth_by_predecessor_id( &mut self, account_id: AccountId, enable: bool, ) -> Result<bool>

Sets whether authentication by PREDECESSOR_ID is enabled. Returns whether authentication by PREDECESSOR_ID was enabled before.
Source§

fn auth_call( &mut self, signer_id: &AccountIdRef, auth_call: AuthCall, ) -> Result<()>

Source§

fn mint( &mut self, owner_id: AccountId, tokens: Amounts, memo: Option<String>, ) -> Result<()>

Source§

fn burn( &mut self, owner_id: &AccountIdRef, tokens: Amounts, memo: Option<String>, ) -> Result<()>

Source§

fn internal_apply_deltas( &mut self, owner_id: &AccountIdRef, tokens: impl IntoIterator<Item = (TokenId, i128)>, ) -> Result<(), DefuseError>

Source§

fn imt_mint( &mut self, minter_id: &AccountIdRef, receiver_id: AccountId, tokens: Amounts<BTreeMap<String, u128>>, memo: Option<String>, notification: Option<NotifyOnTransfer>, ) -> Result<(), DefuseError>

Source§

fn imt_burn( &mut self, owner_id: &AccountIdRef, minter_id: &AccountIdRef, tokens: Amounts<BTreeMap<String, u128>>, memo: Option<String>, ) -> Result<(), DefuseError>

Source§

impl StateView for Contract

Source§

fn verifying_contract(&self) -> Cow<'_, AccountIdRef>

Source§

fn wnear_id(&self) -> Cow<'_, AccountIdRef>

Source§

fn fee(&self) -> Pips

Source§

fn fee_collector(&self) -> Cow<'_, AccountIdRef>

Source§

fn has_public_key( &self, account_id: &AccountIdRef, public_key: &PublicKey, ) -> bool

Source§

fn iter_public_keys( &self, account_id: &AccountIdRef, ) -> impl Iterator<Item = PublicKey> + '_

Source§

fn is_nonce_used(&self, account_id: &AccountIdRef, nonce: Nonce) -> bool

Source§

fn balance_of(&self, account_id: &AccountIdRef, token_id: &TokenId) -> u128

Source§

fn is_account_locked(&self, account_id: &AccountIdRef) -> bool

Source§

fn is_auth_by_predecessor_id_enabled(&self, account_id: &AccountIdRef) -> bool

Returns whether authentication by PREDECESSOR_ID is enabled.
Source§

fn is_valid_salt(&self, salt: Salt) -> bool

Returns whether salt in nonce is valid
Source§

fn wnear_token_id(&self) -> TokenId

Source§

fn cached(self) -> CachedState<Self>
where Self: Sized,

Source§

impl Defuse for Contract

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
§

impl<U> As for U

§

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
§

impl<T> BitPackWrapAsExt for T

§

fn wrap_as<As>(&self) -> AsWrap<&Self, As>
where As: BitPackAs<Self> + ?Sized,

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
§

impl<T> CellSerializeWrapAsExt for T

§

fn wrap_as<As>(&self) -> AsWrap<&Self, As>
where As: CellSerializeAs<Self> + ?Sized,

§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<E> PanicError for E

Source§

fn panic_str(&self) -> !
where Self: AsRef<str>,

Source§

fn panic_static_str(self) -> !
where Self: Into<&'static str>,

Source§

fn panic_display(&self) -> !
where Self: Display,

§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more