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
  • UpdateConfig
  • Spend
  • AddDistributor
  • RemoveDistributor
  • QueryMsg
  • Config
  • ConfigResponse

Was this helpful?

  1. Smart Contracts
  2. Anchor Token (ANC)

Distributor

Config

Key

Type

Description

gov_contract

CanonicalAddr

Contract address of Gov

anchor_token

CanonicalAddr

Contract address of ANC token

whitelist

Vec<CanonicalAddr>

List of addresses permissioned to spend ANC in Distributor

spend_limit

Uint128

Maximum amount of ANC spendable per spend event

InstantiateMsg

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
    pub gov_contract: String,   // anchor gov contract
    pub anchor_token: String,   // anchor token address
    pub whitelist: Vec<String>, // whitelisted contract addresses allowed to spend from distributor 
    pub spend_limit: Uint128,      // spend limit per each `spend` request
}
{
  "gov_contract": "terra1...", 
  "anchor_token": "terra1...", 
  "whitelist": [
    "terra1...", 
    "terra1...", 
    "terra1..." 
  ], 
  "spend_limit": "100000000"
}

Key

Type

Description

gov_contract

String

Contract address of Gov

anchor_token

String

Contract address of ANC token

whitelist

Vec<String>

List of addresses permissioned to spend ANC in Distributor

spend_limit

Uint128

Maximum amount of ANC spendable per spend event

ExecuteMsg

UpdateConfig

Updates the Distributor contract configuration. Can only be issued by the Gov contract.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg { 
    UpdateConfig {
        spend_limit: Option<Uint128>, 
    }
}
{
  "update_config": {
    "spend_limit": "100000000" 
  }
}

Key

Type

Description

spend_limit*

Uint128

Maximum amount of ANC spendable per spend event

* = optional

Spend

Spends ANC in Distributor. Can only be issued by whitelisted addresses.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg { 
    Spend {
        recipient: String, 
        amount: Uint128, 
    }
}
{
  "spend": {
    "recipient": "terra1...", 
    "amount": "100000000" 
  }
}

Key

Type

Description

recipient

String

Recipient address of ANC spend

amount

Uint128

ANC amount to receive

AddDistributor

Adds a new ANC distribution contract to the whitelist. Can only be issued by the Gov contract.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg { 
    AddDistributor {
        distributor: String, 
    }
}
{
  "add_distributor": {
    "distributor": "terra1..." 
  }
}

Key

Type

Description

distributor

String

Contract address of ANC distribution contract to add

RemoveDistributor

Removes a ANC distribution contract from the whitelist. Can only be issued by the Gov contract.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg { 
    RemoveDistributor {
        distributor: String, 
    }
}
{
  "remove_distributor": {
    "distributor": "terra1..." 
  }
}

Key

Type

Description

distributor

String

Contract address of ANC distribution contract to remove

QueryMsg

Config

Gets the Distributor contract configuration.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Config {}
}
{
  "config": {}
}

Key

Type

Description

ConfigResponse

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct ConfigResponse {
    pub gov_contract: String,
    pub anchor_token: String,
    pub whitelist: Vec<String>,
    pub spend_limit: Uint128,
}
{
  "gov_contract": "terra1...", 
  "anchor_token": "terra1...", 
  "whitelist": [
    "terra1...", 
    "terra1...", 
    "terra1..." 
  ], 
  "spend_limit": "100000000"
}

Key

Type

Description

gov_contract

String

Contract address of Gov

anchor_token

String

Contract address of ANC Token

whitelist

Vec<String>

List of addresses permissioned to spend ANC in Distributor

spend_limit

Uint128

Maximum amount of ANC spendable per spend event

PreviousCollectorNextEthAnchor

Last updated 3 years ago

Was this helpful?