# 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

```rust
#[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>,
}
```

<table><thead><tr><th width="263">Key</th><th width="124">Type</th><th>Description</th></tr></thead><tbody><tr><td>max_supply</td><td>u128</td><td>SEILOR token max supply</td></tr><tr><td>fund</td><td>Addr</td><td>The address of  <a href="broken-reference">fund</a></td></tr><tr><td>gov</td><td>Addr</td><td>The address of the governance contract</td></tr><tr><td>distribute</td><td>Addr</td><td>The address of <a href="broken-reference">distribute</a></td></tr><tr><td>new_gov*</td><td>Addr</td><td>The address of the new governance contract</td></tr><tr><td>cross_chain_swap_contract*</td><td>Addr</td><td>The address of the cross chain swap contract</td></tr></tbody></table>

\* = optional

## InitMsg

### InstantiateMsg&#x20;

```rust
#[cw_serde]
pub struct InstantiateMsg {
    pub cw20_init_msg: Cw20InstantiateMsg,
    pub max_supply: u128,
    // default msg.sender
    pub gov: Option<Addr>,
}
```

```json
{
  "cw20_init_msg": {
    "name": "Kryptonite",
    "symbol": "SEILOR",
    "decimals": 6,
    "initial_balances": [],
    "mint": null,
    "marketing": null
  },
  "max_supply": "1000000000000000",
  "gov": null
}
```

<table><thead><tr><th width="172">Key</th><th width="203">Type</th><th>Description</th></tr></thead><tbody><tr><td>cw20_init_msg</td><td>Cw20InstantiateMsg</td><td>The cw20 initialization message structure based on the cw20_base library</td></tr><tr><td>max_supply</td><td>u128</td><td>SEILOR token max supply</td></tr><tr><td>gov*</td><td>Addr</td><td>The address of the governance contract</td></tr></tbody></table>

\* = optional

## ExecuteMsg

### UpdateConfig

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

```rust
#[cw_serde]
pub enum ExecuteMsg {
    UpdateConfig {
        seilor_fund: Option<Addr>,
        gov: Option<Addr>,
        seilor_distribute: Option<Addr>,
    }
}
```

```json
{
  "update_config": {
    "seilor_fund": null,
    "gov": null,
    "seilor_distribute": null
  }
}
```

<table><thead><tr><th width="184">Key</th><th width="140">Type</th><th>Description</th></tr></thead><tbody><tr><td>seilor_fund*</td><td>Addr</td><td>The address of  <a href="broken-reference">fund</a></td></tr><tr><td>gov*</td><td>Addr</td><td>The address of the new governance contract</td></tr><tr><td>seilor_distribute*</td><td>Addr</td><td>The address of <a href="broken-reference">distribute</a></td></tr></tbody></table>

### Mint&#x20;

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

```rust
#[cw_serde]
pub enum ExecuteMsg {
    Mint {
        recipient: String,
        amount: Uint128
    }
}
```

```json
{
  "mint": {
    "recipient": "sei...",
    "amount": "100000000000000000000000000"
  }
}
```

<table><thead><tr><th width="171">Key</th><th width="187">Type</th><th>Description</th></tr></thead><tbody><tr><td>recipient</td><td>String</td><td>Recipient's address</td></tr><tr><td>amount</td><td>Uint128</td><td>Amount to be minted</td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

### Burn&#x20;

Burn is a base message to destroy tokens forever

```rust
#[cw_serde]
pub enum ExecuteMsg {
    Burn {
        amount: Uint128
    }
}
```

```json
{
  "burn": {
    "amount": "100000000000000000000000000"
  }
}
```

<table><thead><tr><th width="166">Key</th><th width="183">Type</th><th>Description</th></tr></thead><tbody><tr><td>amount</td><td>Uint128</td><td>Amount to be burned</td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

### Transfer

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

```rust
#[cw_serde]
pub enum ExecuteMsg {
    Transfer {
        recipient: String,
        amount: Uint128
    }
}
```

```json
{
  "transfer": {
    "recipient": "sei...",
    "amount": "100000000000000000000000000"
  }
}
```

<table><thead><tr><th width="171">Key</th><th width="187">Type</th><th>Description</th></tr></thead><tbody><tr><td>recipient</td><td>String</td><td>Recipient's address</td></tr><tr><td>amount</td><td>Uint128</td><td>Amount to be transfered</td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

### Send

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

```rust
#[cw_serde]
pub enum ExecuteMsg {
    Send {
        contract: String,
        amount: Uint128,
        msg: Binary
    }
}
```

```json
{
  "send": {
    "contract": "sei...",
    "amount": "100000000000000000000000000",
    "msg": "eyJh..."
  }
}
```

<table><thead><tr><th width="173">Key</th><th width="141">Type</th><th>Description</th></tr></thead><tbody><tr><td>contract</td><td>String</td><td>The contract to be trigger on action</td></tr><tr><td>amount</td><td>Uint128</td><td>Amount to be transfered</td></tr><tr><td>msg</td><td>Binary</td><td>Message to be sent</td></tr></tbody></table>

### IncreaseAllowance&#x20;

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.

```rust
#[cw_serde]
pub enum ExecuteMsg {
    IncreaseAllowance {
        spender: String,
        amount: Uint128,
        expires: Option<Expiration>
    }
}
```

```json
{
  "increase_allowance": {
    "spender": "sei...",
    "amount": "100000000000000000000000000",
    "expires": null
  }
}
```

<table><thead><tr><th width="181">Key</th><th width="208">Type</th><th>Description</th></tr></thead><tbody><tr><td>spender</td><td>String</td><td>The spender's address</td></tr><tr><td>amount</td><td>Uint128</td><td>Amount to increase for allowance</td></tr><tr><td>expires*</td><td>Expiration</td><td>Expiration time</td></tr></tbody></table>

\* = optional

### DecreaseAllowance&#x20;

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.

```rust
#[cw_serde]
pub enum ExecuteMsg {
    DecreaseAllowance {
        spender: String,
        amount: Uint128,
        expires: Option<Expiration>
    }
}
```

```json
{
  "decrease_allowance": {
    "spender": "sei...",
    "amount": "100000000000000000000000000",
    "expires": null
  }
}
```

<table><thead><tr><th width="171">Key</th><th width="190">Type</th><th>Description</th></tr></thead><tbody><tr><td>spender</td><td></td><td>The spender's address</td></tr><tr><td>amount</td><td></td><td>Amount to decrease for allowance</td></tr><tr><td>expires*</td><td></td><td>Expiration time</td></tr></tbody></table>

\* = optional

### TransferFrom

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

```rust
#[cw_serde]
pub enum ExecuteMsg {
    TransferFrom {
        owner: String,
        recipient: String,
        amount: Uint128
    }
}
```

```json
{
  "transfer_from": {
    "owner": "sei...",
    "recipient": "sei...",
    "amount": "100000000000000000000000000"
  }
}
```

<table><thead><tr><th width="186">Key</th><th width="211">Type</th><th>Description</th></tr></thead><tbody><tr><td>owner</td><td>String</td><td>The owner's address</td></tr><tr><td>recipient</td><td>String</td><td>The address of recipient</td></tr><tr><td>amount</td><td>Uint128</td><td>Amount to be transfered</td></tr></tbody></table>

### SendFrom

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

```rust
#[cw_serde]
pub enum ExecuteMsg {
    SendFrom {
        owner: String,
        contract: String,
        amount: Uint128,
        msg: Binary
    }
}
```

```json
{
  "send_from": {
    "owner": "sei...",
    "contract": "sei...",
    "amount": "100000000000000000000000000",
    "msg": "eyJh..."
  }
}
```

<table><thead><tr><th width="172">Key</th><th width="194">Type</th><th>Description</th></tr></thead><tbody><tr><td>owner</td><td>String</td><td>The owner's address</td></tr><tr><td>contract</td><td>String</td><td>The contract to be trigger on action</td></tr><tr><td>amount</td><td>Uint128</td><td>Amount to be sent</td></tr><tr><td>msg</td><td>Binary</td><td>Message to be sent</td></tr></tbody></table>

### BurnFrom

Only with "approval" extension. Destroys tokens forever.

```rust
#[cw_serde]
pub enum ExecuteMsg {
    BurnFrom {
        owner: String,
        amount: Uint128
    }
}
```

```json
{
  "burn_from": {
    "owner": "sei...",
    "amount": "100000000000000000000000000"
  }
}
```

<table><thead><tr><th width="182">Key</th><th width="188">Type</th><th>Description</th></tr></thead><tbody><tr><td>owner</td><td>String</td><td>The owner's address</td></tr><tr><td>amount</td><td>Uint128</td><td>Amount to be burned</td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

### 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.

```rust
#[cw_serde]
pub enum ExecuteMsg {
    UpdateMinter {
        minter: Option<String>
    }
}
```

```json
{
  "update_minter": {
    "minter": null
  }
}
```

<table><thead><tr><th width="178">Key</th><th width="213">Type</th><th>Description</th></tr></thead><tbody><tr><td>minter*</td><td>String</td><td>The new miner's address</td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

\* = 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

```rust
#[cw_serde]
pub enum ExecuteMsg {
    UpdateMarketing {
        project: Option<String>,
        description: Option<String>,
        marketing: Option<String>,
    }
}
```

```json
{
  "update_marketing": {
    "project": null,
    "description": null,
    "marketing": null
  }
}
```

<table><thead><tr><th width="176">Key</th><th width="158">Type</th><th>Description</th></tr></thead><tbody><tr><td>project*</td><td>String</td><td>Project name</td></tr><tr><td>description*</td><td>String</td><td>Project description</td></tr><tr><td>marketing*</td><td>String</td><td>Marketing URL</td></tr></tbody></table>

\* = optional

### UploadLogo&#x20;

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

```rust
#[cw_serde]
pub enum ExecuteMsg {
    UploadLogo {
        logo: String
    }
}
```

```json
{
  "upload_logo": {
    "logo": "https://..."
  }
}
```

<table><thead><tr><th width="168">Key</th><th width="189">Type</th><th>Description</th></tr></thead><tbody><tr><td>logo</td><td>String</td><td>Logo URL</td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

## QueryMsg

### SeilorConfig&#x20;

Gets the SEILOR contract configuration.

```rust
#[cw_serde]
pub enum QueryMsg {
    SeilorConfig {}
}
```

```
{
  "seilor_config": {}
}
```

### SeilorConfigResponse&#x20;

```rust
#[cw_serde]
pub struct SeilorConfigResponse {
    pub max_supply: u128,
    pub fund: Addr,
    pub distribute: Addr,
    pub gov: Addr,
}
```

```json
{
  "max_supply": "1000000000000000000000000000",
  "seilor_fund": "sei...",
  "seilor_distribute": "sei...",
  "gov": "sei..."
}
```

<table><thead><tr><th width="181">Key</th><th width="145">Valu</th><th>Description</th></tr></thead><tbody><tr><td>max_supply</td><td>u128</td><td>SEILOR token max supply</td></tr><tr><td>fund</td><td>Addr</td><td>The address of  <a href="broken-reference">fund</a></td></tr><tr><td>distribute</td><td>Addr</td><td>The address of <a href="broken-reference">distribute</a></td></tr><tr><td>gov</td><td>Addr</td><td>The address of the governance contract</td></tr></tbody></table>

### Balance

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

```rust
#[cw_serde]
pub enum QueryMsg {
    Balance {
        address: String
    }
}
```

```json
{
  "balance": {
    "address": "sei..."
  }
}
```

<table><thead><tr><th width="181">Key</th><th width="172">Type</th><th>Description</th></tr></thead><tbody><tr><td>address</td><td>String</td><td>The user's address</td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

### BalanceResponse

```rust
#[cw_serde]
pub struct BalanceResponse {
    pub balance: Uint128,
}
```

```json
{
  "balance": "100000000000000000000000000"
}
```

<table><thead><tr><th width="186">Key</th><th width="242">Type</th><th>Description</th></tr></thead><tbody><tr><td>balance</td><td>Uint128</td><td>The balance of SEILOR tokens for the queried user's address.</td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

### TokenInfo

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

```rust
#[cw_serde]
pub enum QueryMsg {
    TokenInfo {}
}
```

```json
{
  "token_info": {}
}
```

### TokenInfoResponse

```rust
#[cw_serde]
pub struct TokenInfoResponse {
    pub name: String,
    pub symbol: String,
    pub decimals: u8,
    pub total_supply: Uint128,
}
```

```json
{
  "name": "SEILOR",
  "symbol": "SEILOR",
  "decimals": 18,
  "total_supply": "100000000000000000000000000"
}
```

<table><thead><tr><th width="211">Key</th><th width="191">Type</th><th>Description</th></tr></thead><tbody><tr><td>name</td><td>String</td><td>Name</td></tr><tr><td>symbol</td><td>String</td><td>Symbol</td></tr><tr><td>decimals</td><td>u8</td><td>Decimals</td></tr><tr><td>total_supply</td><td>Uint128</td><td>Total supply</td></tr></tbody></table>

### Allowance&#x20;

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

```rust
#[cw_serde]
pub enum QueryMsg {
    Allowance {
        owner: String,
        spender: String
    }
}
```

```json
{
  "allowance": {
    "owner": "sei...",
    "spender": "sei..."
  }
}
```

<table><thead><tr><th width="195">Key</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>owner</td><td>String</td><td>The owner's address</td></tr><tr><td>spender</td><td>String</td><td>The spender's address</td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

### AllowanceResponse&#x20;

```rust
#[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 {},
}

```

```json
{
  "allowance": "100000000000000000000000000",
  "expires": {
    "at_height": "0",
    "at_time": "0",
    "never": {}
  }
}
```

<table><thead><tr><th width="173">Key</th><th width="210">Type</th><th>Description</th></tr></thead><tbody><tr><td>allowance</td><td>Uint128</td><td>The amount allowed to be spent by spender</td></tr><tr><td>expires</td><td>Expiration</td><td>Expiration time</td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

<table><thead><tr><th width="173">Key</th><th width="213">Type</th><th>Description</th></tr></thead><tbody><tr><td>at_height</td><td>u64</td><td>AtHeight will expire when <code>env.block.height</code> >= height</td></tr><tr><td>at_time</td><td>Timestamp</td><td>AtTime will expire when <code>env.block.time</code> >= time</td></tr><tr><td>never</td><td></td><td>Never will never expire. Used to express the empty variant</td></tr></tbody></table>

### Minter&#x20;

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

```rust
#[cw_serde]
pub enum QueryMsg {
    Minter {}
}
```

```json
{
  "minter": {}
}
```

### MinterResponse

```rust
#[cw_serde]
pub struct MinterResponse {
    pub minter: Addr,
    pub cap: Option<Uint128>,
}
```

```json
{
  "minter": "sei...",
  "cap": "100000000000000000000000000"
}
```

<table><thead><tr><th width="161">Key</th><th width="186">Type</th><th>Description</th></tr></thead><tbody><tr><td>minter</td><td>Addr</td><td>the minter's address</td></tr><tr><td>cap*</td><td>Uint128</td><td>cap is a hard cap on total supply that can be achieved by minting. Note that this refers to total_supply. If None, there is unlimited cap.</td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

\* = optional

### MarketingInfo&#x20;

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

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

```rust
#[cw_serde]
pub enum QueryMsg {
    MarketingInfo {}
}
```

```json
{
  "marketing_info": {}
}
```

### MarketingInfoResponse&#x20;

```rust
#[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>,
}
```

```json
{
  "project": "https://...",
  "description": "Ku...",
  "logo": {
    "url": "logo",
    "embedded": "iVBORw0KGgoAAAANSUhEUgAA..."
  },
  "marketing": "sei..."
}
```

<table><thead><tr><th width="174">Key</th><th width="111">Type</th><th>Description</th></tr></thead><tbody><tr><td>project*</td><td>String</td><td>A URL pointing to the project behind this token.</td></tr><tr><td>description*</td><td>String</td><td>A longer description of the token and it's utility. Designed for tooltips or such</td></tr><tr><td>logo*</td><td>String</td><td>A link to the logo, or a comment there is an on-chain logo stored</td></tr><tr><td>marketing*</td><td>Addr</td><td>The address (if any) who can update this data structure</td></tr></tbody></table>

### DownLoadLogo

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.

```rust
#[cw_serde]
pub enum QueryMsg {
    DownloadLogo {}
}
```

```json
{
  "download_logo": {}
}
```

### DownloadLogoResponse&#x20;

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.

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

```json
{
  "mime_type": "image/png",
  "data": "iVBORw0KGgoAAAANSUhEUgAA..."
}
```

<table><thead><tr><th width="187">Key</th><th width="200">Type</th><th>Description</th></tr></thead><tbody><tr><td>mime_type</td><td>String</td><td>The mime type of the image</td></tr><tr><td>data</td><td>Binary</td><td>The raw bytes of the image</td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

### AllAllowances&#x20;

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

```rust
#[cw_serde]
pub enum QueryMsg {
    AllAllowances {
        owner: String,
        start_after: Option<String>,
        limit: Option<u32>,
    }
}
```

```json
{
  "all_allowances": {
    "owner": "sei...",
    "start_after": "sei...",
    "limit": 10
  }
}
```

<table><thead><tr><th width="181">Key</th><th width="144">Type</th><th>Description</th></tr></thead><tbody><tr><td>owner</td><td>String</td><td>The owner of the allowances</td></tr><tr><td>start_after*</td><td>String</td><td>The address to start after, used for pagination</td></tr><tr><td>limit*</td><td>u32</td><td>The number of allowances to limit the query to</td></tr></tbody></table>

### AllAllowancesResponse

```rust
#[cw_serde]
pub struct AllAllowancesResponse {
    pub allowances: Vec<AllowanceInfo>,
}
```

```json
{
  "allowances": [
    {
      "spender": "sei...",
      "allowance": "100000000000000000000000000",
      "expires": {
        "at_height": "0",
        "at_time": "0",
        "never": {}
      }
    }
  ]
}
```

<table><thead><tr><th width="173">Key</th><th width="220">Type</th><th>Description</th></tr></thead><tbody><tr><td>allowances</td><td>Vec&#x3C;AllowanceInfo></td><td>The list of allowances</td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

### AllowanceInfo&#x20;

```rust
#[cw_serde]
pub struct AllowanceInfo {
    pub spender: Addr,
    pub allowance: Uint128,
    pub expires: Expiration,
}
```

```json
{
  "spender": "sei...",
  "allowance": "100000000000000000000000000",
  "expires": {
    "at_height": "0",
    "at_time": "0",
    "never": {}
  }
}
```

<table><thead><tr><th width="186">Key</th><th width="216">Type</th><th>Description</th></tr></thead><tbody><tr><td>spender</td><td>Addr</td><td>The address of the spender</td></tr><tr><td>allowance</td><td>Uint128</td><td>The amount of tokens the spender is allowed to spend</td></tr><tr><td>expires</td><td>Expiration</td><td>When the allowance expires</td></tr></tbody></table>

### AllAccounts

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

```rust
#[cw_serde]
pub enum QueryMsg {
    AllAccounts {
        start_after: Option<String>,
        limit: Option<u32>,
    }
}
```

```json
{
  "all_accounts": {
    "start_after": "sei...",
    "limit": 10
  }
}
```

<table><thead><tr><th width="177">Key</th><th width="158">Type</th><th>Description</th></tr></thead><tbody><tr><td>start_after*</td><td>String</td><td>The address to start after, used for pagination</td></tr><tr><td>limit*</td><td>u32</td><td>The number of accounts to limit the query to</td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

\* = optional
