Skip to main content

BridgeError

Enum BridgeError 

Source
pub enum BridgeError {
Show 43 variants NotInitialized = 1, AlreadyInitialized = 2, InvalidAmount = 3, FeeTooHigh = 4, MismatchedArrays = 5, ContractPaused = 6, AddressBlocked = 7, AddressNotAllowlisted = 8, InsufficientReclaimable = 9, AssetNotWhitelisted = 10, DailyLimitExceeded = 11, DuplicateNonce = 12, TransactionExpired = 13, LoyaltyTokenNotSet = 14, ReplayedNonce = 15, NotRelayer = 16, BelowThreshold = 17, ThresholdExceedsRelayers = 18, TimelockNotFound = 19, TimelockNotMatured = 20, InvalidReleaseTime = 21, Unauthorized = 22, AuthNonceAlreadyUsed = 23, AuthNonceExpired = 24, UpgradeNotScheduled = 25, UpgradeHashMismatch = 26, UpgradeTimelockActive = 27, WithdrawExceedsLimit = 28, Overflow = 29, CommitmentNotFound = 30, CommitmentAlreadyRevealed = 31, CommitmentExpired = 32, CommitmentHashMismatch = 33, CommitmentNotMatured = 34, SlippageExceeded = 35, SwapFailed = 36, MetaTxInvalidSignature = 37, MetaTxExpired = 38, MetaTxNonceAlreadyUsed = 39, ContractDeactivated = 40, DuplicateRelayerSignature = 41, PoolNotWhitelisted = 42, MultiHopNotSupported = 43,
}
Expand description

All error codes that the contract may return.

Every public function that can fail returns Result<_, BridgeError>. Callers should match on these variants to distinguish recoverable from unrecoverable conditions.

Variants§

§

NotInitialized = 1

Contract has not been initialized yet. Call initialize first.

§

AlreadyInitialized = 2

initialize was called on an already-initialized contract.

§

InvalidAmount = 3

A token amount was zero or negative where a positive value is required.

§

FeeTooHigh = 4

The requested fee in basis points exceeds MAX_FEE_BPS (1 000).

§

MismatchedArrays = 5

The targets and amounts arrays passed to batch_fund_c_address have different lengths.

§

ContractPaused = 6

A mutating operation was attempted while the contract is paused.

§

AddressBlocked = 7

The target address has been added to the blocklist.

§

AddressNotAllowlisted = 8

The contract is in allowlist mode and the target address is not allowlisted.

§

InsufficientReclaimable = 9

The requested withdrawal or reclaim amount exceeds the available balance.

§

AssetNotWhitelisted = 10

The asset is not on the whitelist. Add it with add_asset first.

§

DailyLimitExceeded = 11

The source address has exceeded its configured daily transfer limit.

§

DuplicateNonce = 12

The supplied sequential nonce does not match the stored value.

§

TransactionExpired = 13

The transaction deadline has passed.

§

LoyaltyTokenNotSet = 14

No loyalty token has been configured. Call set_loyalty_token first.

§

ReplayedNonce = 15

A cross-chain (chain_id, tx_hash) pair has already been processed.

§

NotRelayer = 16

A signature was supplied by a public key that is not a registered relayer.

§

BelowThreshold = 17

The number of valid relayer signatures is below the required threshold.

§

ThresholdExceedsRelayers = 18

The threshold would exceed the total number of registered relayers.

§

TimelockNotFound = 19

No timelock entry exists for the given ID.

§

TimelockNotMatured = 20

The timelock’s release_time has not been reached yet.

§

InvalidReleaseTime = 21

release_time is in the past, or cliff_time is after release_time.

§

Unauthorized = 22

The caller is not authorized to perform this action (e.g. double-claim).

§

AuthNonceAlreadyUsed = 23

The auth-entry nonce supplied to verify_auth_entry has already been used.

§

AuthNonceExpired = 24

The current ledger sequence is outside the [valid_after, valid_before) window.

§

UpgradeNotScheduled = 25

execute_upgrade was called but no upgrade has been scheduled.

§

UpgradeHashMismatch = 26

The expected_hash passed to execute_upgrade does not match the scheduled hash.

§

UpgradeTimelockActive = 27

The scheduled upgrade’s timelock period has not yet elapsed.

§

WithdrawExceedsLimit = 28

§

Overflow = 29

An arithmetic operation overflowed i128 bounds.

§

CommitmentNotFound = 30

No commitment exists for the given ID.

§

CommitmentAlreadyRevealed = 31

The commitment has already been revealed.

§

CommitmentExpired = 32

The reveal deadline has passed.

§

CommitmentHashMismatch = 33

The revealed amount+nonce does not match the stored hash.

§

CommitmentNotMatured = 34

The minimum delay between commit and reveal has not elapsed.

§

SlippageExceeded = 35

The swap produced fewer target tokens than min_target_amount.

§

SwapFailed = 36

A DEX pool in the swap route returned zero or failed.

§

MetaTxInvalidSignature = 37

The meta-transaction signature is malformed or does not match the expected signer.

§

MetaTxExpired = 38

The meta-transaction deadline has passed (funds not yet submitted on-chain).

§

MetaTxNonceAlreadyUsed = 39

This meta-transaction nonce has already been used; replay prevented.

§

ContractDeactivated = 40

The contract is deactivated (permanently paused/migrated).

§

DuplicateRelayerSignature = 41

The same relayer pubkey appeared more than once in sigs.

§

PoolNotWhitelisted = 42

A pool address in swap_route is not on the swap-pool whitelist.

§

MultiHopNotSupported = 43

swap_route contained more than one hop; multi-hop swaps are not supported.

Implementations§

Source§

impl BridgeError

Source

pub const fn spec_xdr() -> [u8; 4292]

Trait Implementations§

Source§

impl Clone for BridgeError

Source§

fn clone(&self) -> BridgeError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for BridgeError

Source§

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

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

impl From<&BridgeError> for Error

Source§

fn from(val: &BridgeError) -> Error

Converts to this type from the input type.
Source§

impl From<&BridgeError> for InvokeError

Source§

fn from(val: &BridgeError) -> InvokeError

Converts to this type from the input type.
Source§

impl From<BridgeError> for Error

Source§

fn from(val: BridgeError) -> Error

Converts to this type from the input type.
Source§

impl From<BridgeError> for InvokeError

Source§

fn from(val: BridgeError) -> InvokeError

Converts to this type from the input type.
Source§

impl PartialEq for BridgeError

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 TryFrom<&Error> for BridgeError

Source§

type Error = Error

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

fn try_from(error: &Error) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<&InvokeError> for BridgeError

Source§

type Error = InvokeError

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

fn try_from(error: &InvokeError) -> Result<Self, InvokeError>

Performs the conversion.
Source§

impl TryFrom<Error> for BridgeError

Source§

type Error = Error

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

fn try_from(error: Error) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<InvokeError> for BridgeError

Source§

type Error = InvokeError

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

fn try_from(error: InvokeError) -> Result<Self, InvokeError>

Performs the conversion.
Source§

impl TryFromVal<Env, BridgeError> for Val

Source§

type Error = ConversionError

Source§

fn try_from_val(env: &Env, val: &BridgeError) -> Result<Self, ConversionError>

Source§

impl TryFromVal<Env, Val> for BridgeError

Source§

type Error = ConversionError

Source§

fn try_from_val(env: &Env, val: &Val) -> Result<Self, ConversionError>

Source§

impl Copy for BridgeError

Source§

impl Eq for BridgeError

Source§

impl StructuralPartialEq for BridgeError

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<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
§

impl<T, C> Compare<&T> for C
where C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

§

fn compare(&self, a: &&T, b: &&T) -> Result<Ordering, <C as Compare<&T>>::Error>

§

impl<T, U, E, C> Compare<(T, U)> for C
where C: Compare<T, Error = E, Error = E> + Compare<U>,

§

type Error = E

§

fn compare( &self, a: &(T, U), b: &(T, U), ) -> Result<Ordering, <C as Compare<(T, U)>>::Error>

§

impl<T, U, V, E, C> Compare<(T, U, V)> for C
where C: Compare<T, Error = E, Error = E, Error = E> + Compare<U> + Compare<V>,

§

type Error = E

§

fn compare( &self, a: &(T, U, V), b: &(T, U, V), ) -> Result<Ordering, <C as Compare<(T, U, V)>>::Error>

§

impl<T, U, V, W, E, C> Compare<(T, U, V, W)> for C
where C: Compare<T, Error = E, Error = E, Error = E, Error = E> + Compare<U> + Compare<V> + Compare<W>,

§

type Error = E

§

fn compare( &self, a: &(T, U, V, W), b: &(T, U, V, W), ) -> Result<Ordering, <C as Compare<(T, U, V, W)>>::Error>

§

impl<T, U, V, W, X, E, C> Compare<(T, U, V, W, X)> for C
where C: Compare<T, Error = E, Error = E, Error = E, Error = E, Error = E> + Compare<U> + Compare<V> + Compare<W> + Compare<X>,

§

type Error = E

§

fn compare( &self, a: &(T, U, V, W, X), b: &(T, U, V, W, X), ) -> Result<Ordering, <C as Compare<(T, U, V, W, X)>>::Error>

§

impl<T, C> Compare<Box<T>> for C
where C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

§

fn compare( &self, a: &Box<T>, b: &Box<T>, ) -> Result<Ordering, <C as Compare<Box<T>>>::Error>

§

impl<T, C> Compare<Option<T>> for C
where C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

§

fn compare( &self, a: &Option<T>, b: &Option<T>, ) -> Result<Ordering, <C as Compare<Option<T>>>::Error>

§

impl<T, C> Compare<Rc<T>> for C
where C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

§

fn compare( &self, a: &Rc<T>, b: &Rc<T>, ) -> Result<Ordering, <C as Compare<Rc<T>>>::Error>

§

impl<T, C> Compare<Vec<T>> for C
where C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

§

fn compare( &self, a: &Vec<T>, b: &Vec<T>, ) -> Result<Ordering, <C as Compare<Vec<T>>>::Error>

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<E, T, U> FromVal<E, T> for U
where E: Env, U: TryFromVal<E, T>,

§

fn from_val(e: &E, v: &T) -> U

§

impl<T> FromXdr for T
where T: TryFromVal<Env, Val>,

§

type Error = <T as TryFromVal<Env, Val>>::Error

§

fn from_xdr(env: &Env, b: &Bytes) -> Result<T, <T as FromXdr>::Error>

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
§

impl<E, T, U> IntoVal<E, T> for U
where E: Env, T: FromVal<E, U>,

§

fn into_val(&self, e: &E) -> T

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
§

impl<T> ToXdr for T
where T: IntoVal<Env, Val>,

§

fn to_xdr(self, env: &Env) -> Bytes

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<E, T, U> TryIntoVal<E, T> for U
where E: Env, T: TryFromVal<E, U>,

§

type Error = <T as TryFromVal<E, U>>::Error

§

fn try_into_val(&self, env: &E) -> Result<T, <U as TryIntoVal<E, T>>::Error>

§

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

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,