AxelarExecutableInterface

Trait AxelarExecutableInterface 

Source
pub trait AxelarExecutableInterface {
    // Required methods
    fn gateway(env: &Env) -> Address;
    fn execute(
        env: Env,
        source_chain: String,
        message_id: String,
        source_address: String,
        payload: Bytes,
    );

    // Provided method
    fn validate(
        env: Env,
        source_chain: String,
        message_id: String,
        source_address: String,
        payload: Bytes,
    ) { ... }
}
Expand description

Interface for an Axelar Executable app.

Required Methods§

Source

fn gateway(env: &Env) -> Address

Return the trusted gateway contract id.

Source

fn execute( env: Env, source_chain: String, message_id: String, source_address: String, payload: Bytes, )

Execute a cross-chain contract call with the given payload. This function must validate that the contract call is received from the trusted gateway.

Provided Methods§

Source

fn validate( env: Env, source_chain: String, message_id: String, source_address: String, payload: Bytes, )

Validate if a gateway has approved a contract call. This should be called from an implementation of execute before executing custom app logic. This method doesn’t get exposed from the contract, as Soroban SDK’s contractimpl macro ignores default trait methods.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§