1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
use cosmwasm_schema::{cw_serde, QueryResponses};
use cosmwasm_std::{Addr, Uint128};
#[cw_serde]
pub struct InstantiateMsg {
pub owner: String,
#[serde(default)]
pub admins: Vec<String>,
pub gas_denom: String,
}
#[cw_serde]
pub enum ExecuteMsg {
/// Create grant with fixed amount for a contract.
/// Executor: owner or admin.
Grant {
grantee_contract: String,
amount: Uint128,
/// Bypassing can be enabled in case when grant was revoked, but some coins are left in grant.
/// When creating a new grant with bypass enabled be very careful not to clash with other grants.
#[serde(default)]
bypass_amount_check: bool,
},
/// Revoke grant for a contract. Some coins may be left in fee_granter account.
/// Executor: owner or admin.
Revoke { grantee_contract: String },
/// Transfer coins from fee_granter account.
/// It doesn't have any checks because wasm module doesn't allow Stargate queries.
/// Executor: owner or admin.
TransferCoins {
amount: Uint128,
receiver: Option<String>,
},
/// Executor: owner.
UpdateAdmins {
#[serde(default)]
add: Vec<String>,
#[serde(default)]
remove: Vec<String>,
},
/// ProposeNewOwner creates a proposal to change contract ownership.
/// The validity period for the proposal is set in the `expires_in` variable.
ProposeNewOwner {
/// Newly proposed contract owner
owner: String,
/// The date after which this proposal expires
expires_in: u64,
},
/// DropOwnershipProposal removes the existing offer to change contract ownership.
DropOwnershipProposal {},
/// Used to claim contract ownership.
ClaimOwnership {},
}
#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
#[returns(Config)]
Config {},
#[returns(Vec<GrantResponse>)]
GrantsList {
start_after: Option<String>,
limit: Option<u32>,
},
#[returns(GrantResponse)]
GrantFor { grantee_contract: String },
}
#[cw_serde]
pub struct Config {
pub owner: Addr,
pub admins: Vec<Addr>,
pub gas_denom: String,
}
#[cw_serde]
pub struct GrantResponse {
pub grantee_contract: String,
pub amount: Uint128,
}