Seilor

Kryptonite is an open-source Decentralized Autonomous Organization (DAO) project. It is governed by individuals worldwide who hold its governance token, SEILOR. Through a governance system that includes Executive Voting and Governance Polling, SEILOR holders can influence the protocol's direction. The SEILOR token is the native token of the kryptonite Protocol, providing essential functionalities such as staking, governance, minting, and liquidator rewards. SEILOR is an ERC-20 governance token with a maximum supply of 100,000,000. SEILOR holders manage the kryptonite Protocol and oversee the financial risks associated with kUSD to ensure stability, transparency, and efficiency. The voting weight of SEILOR is proportional to the amount staked by a voter in the voting contract. In other words, the more SEILOR tokens locked in the contract, the greater the voter's decision-making power.

Config

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct SeilorConfig {
    pub max_supply: u128,
    pub fund: Addr,
    pub gov: Addr,
    pub distribute: Addr,
    pub new_gov: Option<Addr>,
    pub cross_chain_swap_contract: Option<Addr>,
}

* = optional

InitMsg

InstantiateMsg

#[cw_serde]
pub struct InstantiateMsg {
    pub cw20_init_msg: Cw20InstantiateMsg,
    pub max_supply: u128,
    // default msg.sender
    pub gov: Option<Addr>,
}
{
  "cw20_init_msg": {
    "name": "Kryptonite",
    "symbol": "SEILOR",
    "decimals": 6,
    "initial_balances": [],
    "mint": null,
    "marketing": null
  },
  "max_supply": "1000000000000000",
  "gov": null
}

* = optional

ExecuteMsg

UpdateConfig

Updates the configuration of the contract. Can only be issued by the owner.

#[cw_serde]
pub enum ExecuteMsg {
    UpdateConfig {
        seilor_fund: Option<Addr>,
        gov: Option<Addr>,
        seilor_distribute: Option<Addr>,
    }
}
{
  "update_config": {
    "seilor_fund": null,
    "gov": null,
    "seilor_distribute": null
  }
}

Mint

Only with the "mintable" extension. If authorized, creates amount new tokens and adds to the recipient balance.

#[cw_serde]
pub enum ExecuteMsg {
    Mint {
        recipient: String,
        amount: Uint128
    }
}
{
  "mint": {
    "recipient": "sei...",
    "amount": "100000000000000000000000000"
  }
}

Burn

Burn is a base message to destroy tokens forever

#[cw_serde]
pub enum ExecuteMsg {
    Burn {
        amount: Uint128
    }
}
{
  "burn": {
    "amount": "100000000000000000000000000"
  }
}

Transfer

Transfer is a base message to move tokens to another account without triggering actions

#[cw_serde]
pub enum ExecuteMsg {
    Transfer {
        recipient: String,
        amount: Uint128
    }
}
{
  "transfer": {
    "recipient": "sei...",
    "amount": "100000000000000000000000000"
  }
}

Send

Send is a base message to transfer tokens to a contract and trigger an action on the receiving contract.

#[cw_serde]
pub enum ExecuteMsg {
    Send {
        contract: String,
        amount: Uint128,
        msg: Binary
    }
}
{
  "send": {
    "contract": "sei...",
    "amount": "100000000000000000000000000",
    "msg": "eyJh..."
  }
}

IncreaseAllowance

Only with "approval" extension. Allows spender to access an additional amount tokens from the owner's (env.sender) account. If expires is Some(), overwrites current allowance expiration with this one.

#[cw_serde]
pub enum ExecuteMsg {
    IncreaseAllowance {
        spender: String,
        amount: Uint128,
        expires: Option<Expiration>
    }
}
{
  "increase_allowance": {
    "spender": "sei...",
    "amount": "100000000000000000000000000",
    "expires": null
  }
}

* = optional

DecreaseAllowance

Only with "approval" extension. Lowers the spender's access of tokens from the owner's (env.sender) account by amount. If expires is Some(), overwrites current allowance expiration with this one.

#[cw_serde]
pub enum ExecuteMsg {
    DecreaseAllowance {
        spender: String,
        amount: Uint128,
        expires: Option<Expiration>
    }
}
{
  "decrease_allowance": {
    "spender": "sei...",
    "amount": "100000000000000000000000000",
    "expires": null
  }
}

* = optional

TransferFrom

Only with "approval" extension. Transfers amount tokens from owner -> recipient if env.sender has sufficient pre-approval.

#[cw_serde]
pub enum ExecuteMsg {
    TransferFrom {
        owner: String,
        recipient: String,
        amount: Uint128
    }
}
{
  "transfer_from": {
    "owner": "sei...",
    "recipient": "sei...",
    "amount": "100000000000000000000000000"
  }
}

SendFrom

Only with "approval" extension. Sends amount tokens from owner -> contract if env.sender has sufficient pre-approval.

#[cw_serde]
pub enum ExecuteMsg {
    SendFrom {
        owner: String,
        contract: String,
        amount: Uint128,
        msg: Binary
    }
}
{
  "send_from": {
    "owner": "sei...",
    "contract": "sei...",
    "amount": "100000000000000000000000000",
    "msg": "eyJh..."
  }
}

BurnFrom

Only with "approval" extension. Destroys tokens forever.

#[cw_serde]
pub enum ExecuteMsg {
    BurnFrom {
        owner: String,
        amount: Uint128
    }
}
{
  "burn_from": {
    "owner": "sei...",
    "amount": "100000000000000000000000000"
  }
}

UpdateMinter

Only with the "mintable" extension. The current minter may set a new minter. Setting the minter to None will remove the token's minter forever.

#[cw_serde]
pub enum ExecuteMsg {
    UpdateMinter {
        minter: Option<String>
    }
}
{
  "update_minter": {
    "minter": null
  }
}

* = optional

UpdateMarketing

Only with the "marketing" extension. If authorized, updates marketing metadata. Setting None/null for any of these will leave it unchanged. Setting Some("") will clear this field on the contract storage

#[cw_serde]
pub enum ExecuteMsg {
    UpdateMarketing {
        project: Option<String>,
        description: Option<String>,
        marketing: Option<String>,
    }
}
{
  "update_marketing": {
    "project": null,
    "description": null,
    "marketing": null
  }
}

* = optional

If set as the "marketing" role on the contract, upload a new URL, SVG, or PNG for the token

#[cw_serde]
pub enum ExecuteMsg {
    UploadLogo {
        logo: String
    }
}
{
  "upload_logo": {
    "logo": "https://..."
  }
}

QueryMsg

SeilorConfig

Gets the SEILOR contract configuration.

#[cw_serde]
pub enum QueryMsg {
    SeilorConfig {}
}
{
  "seilor_config": {}
}

SeilorConfigResponse

#[cw_serde]
pub struct SeilorConfigResponse {
    pub max_supply: u128,
    pub fund: Addr,
    pub distribute: Addr,
    pub gov: Addr,
}
{
  "max_supply": "1000000000000000000000000000",
  "seilor_fund": "sei...",
  "seilor_distribute": "sei...",
  "gov": "sei..."
}

Balance

Returns the current balance of the given address, 0 if unset. Return type: BalanceResponse.

#[cw_serde]
pub enum QueryMsg {
    Balance {
        address: String
    }
}
{
  "balance": {
    "address": "sei..."
  }
}

BalanceResponse

#[cw_serde]
pub struct BalanceResponse {
    pub balance: Uint128,
}
{
  "balance": "100000000000000000000000000"
}

TokenInfo

Returns metadata on the contract - name, decimals, supply, etc. Return type: TokenInfoResponse

#[cw_serde]
pub enum QueryMsg {
    TokenInfo {}
}
{
  "token_info": {}
}

TokenInfoResponse

#[cw_serde]
pub struct TokenInfoResponse {
    pub name: String,
    pub symbol: String,
    pub decimals: u8,
    pub total_supply: Uint128,
}
{
  "name": "SEILOR",
  "symbol": "SEILOR",
  "decimals": 18,
  "total_supply": "100000000000000000000000000"
}

Allowance

Only with "allowance" extension. Returns how much spender can use from owner account, 0 if unset. Return type: AllowanceResponse.

#[cw_serde]
pub enum QueryMsg {
    Allowance {
        owner: String,
        spender: String
    }
}
{
  "allowance": {
    "owner": "sei...",
    "spender": "sei..."
  }
}

AllowanceResponse

#[cw_serde]
pub struct AllowanceResponse {
    pub allowance: Uint128,
    pub expires: Expiration,
}

#[cw_serde]
#[derive(Copy)]
pub enum Expiration {
    /// AtHeight will expire when `env.block.height` >= height
    AtHeight(u64),
    /// AtTime will expire when `env.block.time` >= time
    AtTime(Timestamp),
    /// Never will never expire. Used to express the empty variant
    Never {},
}
{
  "allowance": "100000000000000000000000000",
  "expires": {
    "at_height": "0",
    "at_time": "0",
    "never": {}
  }
}

Minter

Only with "mintable" extension. Returns who can mint and the hard cap on maximum tokens after minting. Return type: MinterResponse.

#[cw_serde]
pub enum QueryMsg {
    Minter {}
}
{
  "minter": {}
}

MinterResponse

#[cw_serde]
pub struct MinterResponse {
    pub minter: Addr,
    pub cap: Option<Uint128>,
}
{
  "minter": "sei...",
  "cap": "100000000000000000000000000"
}

* = optional

MarketingInfo

Only with "marketing" extension Returns more metadata on the contract to display in the client:

description, logo, project url, etc. Return type: MarketingInfoResponse.

#[cw_serde]
pub enum QueryMsg {
    MarketingInfo {}
}
{
  "marketing_info": {}
}

MarketingInfoResponse

#[cw_serde]
pub struct MarketingInfoResponse {
    /// A URL pointing to the project behind this token.
    pub project: Option<String>,
    /// A longer description of the token and it's utility. Designed for tooltips or such
    pub description: Option<String>,
    /// A link to the logo, or a comment there is an on-chain logo stored
    pub logo: Option<LogoInfo>,
    /// The address (if any) who can update this data structure
    pub marketing: Option<Addr>,
}
{
  "project": "https://...",
  "description": "Ku...",
  "logo": {
    "url": "logo",
    "embedded": "iVBORw0KGgoAAAANSUhEUgAA..."
  },
  "marketing": "sei..."
}

Only with "marketing" extension Downloads the embedded logo data (if stored on chain). Errors if no logo data stored for this contract. Return type: DownloadLogoResponse.

#[cw_serde]
pub enum QueryMsg {
    DownloadLogo {}
}
{
  "download_logo": {}
}

DownloadLogoResponse

When we download an embedded logo, we get this response type. We expect a SPA to be able to accept this info and display it.

#[cw_serde]
pub struct DownloadLogoResponse {
    /// The mime type of the image
    pub mime_type: String,
    /// The raw bytes of the image
    pub data: Binary,
}
{
  "mime_type": "image/png",
  "data": "iVBORw0KGgoAAAANSUhEUgAA..."
}

AllAllowances

Only with "enumerable" extension (and "allowances") Returns all allowances this owner has approved. Supports pagination. Return type: AllAllowancesResponse.

#[cw_serde]
pub enum QueryMsg {
    AllAllowances {
        owner: String,
        start_after: Option<String>,
        limit: Option<u32>,
    }
}
{
  "all_allowances": {
    "owner": "sei...",
    "start_after": "sei...",
    "limit": 10
  }
}

AllAllowancesResponse

#[cw_serde]
pub struct AllAllowancesResponse {
    pub allowances: Vec<AllowanceInfo>,
}
{
  "allowances": [
    {
      "spender": "sei...",
      "allowance": "100000000000000000000000000",
      "expires": {
        "at_height": "0",
        "at_time": "0",
        "never": {}
      }
    }
  ]
}

AllowanceInfo

#[cw_serde]
pub struct AllowanceInfo {
    pub spender: Addr,
    pub allowance: Uint128,
    pub expires: Expiration,
}
{
  "spender": "sei...",
  "allowance": "100000000000000000000000000",
  "expires": {
    "at_height": "0",
    "at_time": "0",
    "never": {}
  }
}

AllAccounts

Only with "enumerable" extension Returns all accounts that have balances. Supports pagination. Return type: AllAccountsResponse.

#[cw_serde]
pub enum QueryMsg {
    AllAccounts {
        start_after: Option<String>,
        limit: Option<u32>,
    }
}
{
  "all_accounts": {
    "start_after": "sei...",
    "limit": 10
  }
}

* = optional

Last updated