Assessment reports>Example String-Passing Solana OApp>Threat Model>Instruction: SetPeerConfig

Instruction: SetPeerConfig

This instruction can be used by the OApp admin to initialize and edit PeerConfig configuration accounts representing an instance of an associated application on a remote chain. Multiple PeerConfig accounts can exist.

The instruction allows to edit one of the following configuration parameters at a time:

  • peer_address: This is the address of the peer contract on the remote chain.

  • enforced_options: This specifies the set of enforced options that are always added to outgoing messages destined to this peer.

Input parameters

pub struct SetPeerConfigParams { pub remote_eid: u32, pub config: PeerConfigParam, } pub enum PeerConfigParam { PeerAddress([u8; 32]), EnforcedOptions { send: Vec, send_and_call: Vec }, }
  • remote_eid: This is the arbitrary ID identifying the remote contract.

  • config: This is the parameter to be configured.

Accounts

  • admin: Authorizes the operation and pays rent for account creation.

    • Signer: Yes.

    • Mutable: Yes.

    • Constraints: Must be the admin configured in the store.

  • peer: Account representing the configuration for the remote contract.

    • Init: Yes, if needed.

    • PDA: Yes, with seeds PEER_SEED, store.key(), and params.remote_eid.

  • store: Account storing the OApp global configuration.

    • PDA: Yes, with seed STORE_SEED.

Zellic © 2025Back to top ↑