Anchor Protocol
  • Home
  • Security
  • Protocol
    • Overview
    • Bonded Assets (bAssets)
      • Bonded Luna (bLuna)
      • Bonded ETH (bETH)
    • Money Market
      • Deposit Rate Subsidization
    • Loan Liquidation
    • Anchor Token (ANC)
    • Anchor Governance
      • Modify Collateral Attributes
      • Modify Market Parameters
      • Modify Liquidation Parameters
      • Modify ANC Parameters
      • Modify Governance Parameters
      • Modify Borrow Interest
      • Modify ANC Distribution
      • Community Grants
      • Text Proposal
  • User Guide
    • Interchain Transfers
    • WebApp
      • EARN
      • BORROW
      • bASSET [bLUNA]
      • bASSET [bETH]
      • GOVERN
        • ANC - UST LP Staking
        • Anchor Governance Staking
        • Claiming ANC Rewards
        • Creating and voting on proposals
  • EthAnchor
    • EthAnchor
    • EthAnchor Contracts
      • Deployed Contracts
      • Router
      • ConversionPool
      • ExchangeRateFeeder
    • Fees
  • Developers - Earn
    • Anchor Earn SDK
    • Example Usage
    • Appendix
  • xAnchor
    • xAnchor
    • xAnchor Contracts
    • xAnchor Bridge (EVM Chains)
    • xAnchor Terra-side Contracts
      • xAnchor Core
      • xAnchor Wormhole Bridge
      • Address Proxy
  • Developers - Terra
    • Anchor.js
    • AnchorCLI
  • Smart Contracts
    • Deployed Contracts
    • bLuna
      • Hub
      • Reward
      • Rewards Dispatcher
      • Validators Registry
      • Airdrop Registry
      • Tokens: bLuna and stLuna
    • bETH
      • Reward
      • Token
      • Converter
    • Money Market
      • Overseer
      • Market
      • Custody [bLUNA]
      • Custody [bETH]
      • Interest Model
      • Distribution Model
      • Oracle
    • Liquidation
      • Liquidation Contract
      • Liquidation Queue Contract
    • Anchor Token (ANC)
      • Gov
      • Staking
      • Community
      • Collector
      • Distributor
  • Developers - Ethereum [Legacy]
    • EthAnchor
    • EthAnchor Account Contract
    • EthAnchor API
      • Getting Market Information
      • Depositing Stablecoins
      • Redeeming Stablecoins
    • Fees
  • External Resources
    • Anchor WebApp
    • Anchor Protocol GitHub
    • Terra Blockchain
Powered by GitBook
On this page
  • Config
  • InstantiateMsg
  • ExecuteMsg

Was this helpful?

  1. xAnchor
  2. xAnchor Terra-side Contracts

xAnchor Core

The xAnchor Core contract receives messages from the foreign chain (via the xAnchor Bridge), and forwards them to the AddressProxy contract. If needed, it will initialize a copy of the AddressProxy contract for any foreign address that doesn’t have a corresponding proxy contract already deployed.

Config

Key
Type
Description

address_proxy_code_id

u64

The cosmwasm Code ID of the Address Proxy contract WASM

owner

String

Address of contract owner

overseer_address

String

Address of Anchor Overseer Contract

anc_gov_address

String

Address of Anchor Governance Contract

InstantiateMsg

pub struct InstantiateMsg {
    pub address_proxy_code_id: u64,
    pub owner: String,
    pub overseer_address: String,
    pub anc_gov_address: String,
}

ExecuteMsg

pub enum ExecuteMsg {
    InitializeAddressProxy {
        chain_id: u16,
        address: Vec<u8>,
    },
    Receive(Cw20ReceiveMsg),
    /// depositors
    DepositStable {
        sender_chain: u16,
        sender_address: Vec<u8>,
    },
    /// borrowers
    RepayStable {
        sender_chain: u16,
        sender_address: Vec<u8>,
    },

    /// unlock + withdraw collateral (withdraw and unlock on anchor are combined into a single op)
    UnlockCollateral {
        sender_chain: u16,
        sender_address: Vec<u8>,
        asset: Asset,
    },
    BorrowStable {
        sender_chain: u16,
        sender_address: Vec<u8>,
        borrow_amount: Uint256,
    },
    ClaimRewards {
        sender_chain: u16,
        sender_address: Vec<u8>,
    },

    /// stuck assets
    WithdrawAsset {
        sender_chain: u16,
        sender_address: Vec<u8>,
        asset_info: AssetInfo,
    },

    /// support governance
    StakeVotingTokens {
        sender_chain: u16,
        sender_address: Vec<u8>,
        stake_amount: Uint256,
    },
    WithdrawVotingTokens {
        sender_chain: u16,
        sender_address: Vec<u8>,
        unstake_amount: Uint256,
    },
    CastVote {
        sender_chain: u16,
        sender_address: Vec<u8>,
        poll_id: u64,
        vote: VoteOption,
        amount: Uint128,
    },

    /// admin and internal
    AddBridges {
        bridges: Vec<String>,
    },

    UpdateConfig {
        owner: Option<String>,
        address_proxy_code_id: Option<u64>,
    },

    /// internal Only
    ForwardDifferenceAndInitiateBridgeTransfer {
        asset_info: AssetInfo,
        to: String,
    },
}
PreviousxAnchor Terra-side ContractsNextxAnchor Wormhole Bridge

Last updated 3 years ago

Was this helpful?