abstract_cw20/
msg.rs

1use crate::logo::Logo;
2use cosmwasm_schema::cw_serde;
3use cosmwasm_std::{Binary, Uint128};
4use cw_utils::Expiration;
5
6#[cw_serde]
7#[derive(cw_orch::ExecuteFns)]
8pub enum Cw20ExecuteMsg {
9    /// Transfer is a base message to move tokens to another account without triggering actions
10    Transfer { recipient: String, amount: Uint128 },
11    /// Burn is a base message to destroy tokens forever
12    Burn { amount: Uint128 },
13    /// Send is a base message to transfer tokens to a contract and trigger an action
14    /// on the receiving contract.
15    Send {
16        contract: String,
17        amount: Uint128,
18        msg: Binary,
19    },
20    /// Only with "approval" extension. Allows spender to access an additional amount tokens
21    /// from the owner's (env.sender) account. If expires is Some(), overwrites current allowance
22    /// expiration with this one.
23    IncreaseAllowance {
24        spender: String,
25        amount: Uint128,
26        expires: Option<Expiration>,
27    },
28    /// Only with "approval" extension. Lowers the spender's access of tokens
29    /// from the owner's (env.sender) account by amount. If expires is Some(), overwrites current
30    /// allowance expiration with this one.
31    DecreaseAllowance {
32        spender: String,
33        amount: Uint128,
34        expires: Option<Expiration>,
35    },
36    /// Only with "approval" extension. Transfers amount tokens from owner -> recipient
37    /// if `env.sender` has sufficient pre-approval.
38    TransferFrom {
39        owner: String,
40        recipient: String,
41        amount: Uint128,
42    },
43    /// Only with "approval" extension. Sends amount tokens from owner -> contract
44    /// if `env.sender` has sufficient pre-approval.
45    SendFrom {
46        owner: String,
47        contract: String,
48        amount: Uint128,
49        msg: Binary,
50    },
51    /// Only with "approval" extension. Destroys tokens forever
52    BurnFrom { owner: String, amount: Uint128 },
53    /// Only with the "mintable" extension. If authorized, creates amount new tokens
54    /// and adds to the recipient balance.
55    Mint { recipient: String, amount: Uint128 },
56    /// Only with the "mintable" extension. The current minter may set
57    /// a new minter. Setting the minter to None will remove the
58    /// token's minter forever.
59    UpdateMinter { new_minter: Option<String> },
60    /// Only with the "marketing" extension. If authorized, updates marketing metadata.
61    /// Setting None/null for any of these will leave it unchanged.
62    /// Setting Some("") will clear this field on the contract storage
63    UpdateMarketing {
64        /// A URL pointing to the project behind this token.
65        project: Option<String>,
66        /// A longer description of the token and it's utility. Designed for tooltips or such
67        description: Option<String>,
68        /// The address (if any) who can update this data structure
69        marketing: Option<String>,
70    },
71    /// If set as the "marketing" role on the contract, upload a new URL, SVG, or PNG for the token
72    UploadLogo(Logo),
73}