The Community Contract holds the funds of the Community Pool, which can be spent through a governance poll.
InstantiateMsg
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
pub admins: Vec<String>,
pub managing_token: String,
}
{
"admins":["terra1...",...],
"managing_token": "VKR",
"terraswap_router": "terra1...",
"campaign_deposit_fee_burn_ratio": 50,
"campaign_deposit_fee_recipient": "terra1..."
}
ExecuteMsg
Receive
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
Receive {
amount: Uint128,
sender: Addr,
msg: Option<Binary>,
}
}
{
"receive": {
"amount": "10000000",
"sender": "terra1...",
"msg": "eyAiZXhlY3V0ZV9tc2ciOiAiYmxhaCBibGFoIiB9"
}
}
Amount of tokens received
Base64-encoded JSON of receive hook
* = optional
UpdateConfig
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
UpdateConfig {
admins: Option<Vec<String>>,
},
}
{
"spend": {
"admins":["terra1...",...],
"terraswap_router": "terra1...",
"campaign_deposit_fee_burn_ratio": 50,
"campaign_deposit_fee_recipient": "terra1...",
}
}
* = optional
IncreaseAllowance
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
IncreaseAllowance {
address: String,
amount: Uint128,
},
}
{
"increase_allownace": {
"address": "terra1...",
"amount" : 1000000
}
}
Wallet address of allowance campaign
DecreaseAllowance
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
DecreaseAllowance {
address: String,
amount: Option<Uint128>,
},
}
{
"decrease_allownace": {
"address": "terra1...",
"amount" : 1000000
}
}
Wallet address of allowance campaign
Amount of decrease (None = Total)
* = optional
Transfer
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
Transfer {
recipient: String,
amount: Uint128,
},
}
{
"transfer": {
"recipient": "terra1...",
"amount": 1000
}
}
Address to receive payment
QueryMsg
Config
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Config {}
}
Response
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct ContractConfigResponse {
pub admins: Vec<String>,
pub managing_token: String,
}
{
"config_response": {
"admins":["terra1...",...],
"managing_token": "VKR",
}
}
Balance
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Balance {}
}
Response
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct BalanceResponse {
pub total_balance: Uint128,
pub allowance_amount: Uint128,
pub free_balance: Uint128,
}
{
"balance_response": {
"total_balance": 100,
"allowance_amount": 1000,
"fee_balance": 1,
}
}
Unauthorized or freely transferable number
Allowance
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Allowance {
address: String,
}
}
{
"allowance": {
"address" : "terra1..."
}
}
Wallet address of allowance campaign
Response
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct AllowanceResponse {
pub address: String,
pub allowed_amount: Uint128,
pub remain_amount: Uint128,
}
{
"allowance_response": {
"address":"terra...",
"allowed_amount": 10000,
"remain_amount": 5000,
}
}
Wallet address of allowance campaign
Allowances
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Allowances {
start_after: Option<String>,
limit: Option<u32>,
order_by: Option<OrderBy>,
},
}
{
"allowances": {
"start_after" : "terra1...",
"limit" : 10000,
"order_by" : "",
}
}
Wallet address to start query at
Maximum number of query entries
*=optional
Response
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct AllowancesResponse {
pub allowances: Vec<AllowanceResponse>,
}
{
"allowances_response": {
"allowances":[
{
"address":"terra...",
"allowed_amount": 10000,
"remain_amount": 5000,
}...
]
}
}