Skip to content

Commit 6982c76

Browse files
authored
Merge pull request #20 from public-awesome/tasiov/stargaze-fair-burn/v1.1
Stargaze Fair Burn v1.1.0
2 parents d5f7be6 + 0523fc3 commit 6982c76

24 files changed

+672
-521
lines changed

Cargo.lock

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/fair-burn/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "stargaze-fair-burn"
3-
version = "1.0.4"
3+
version = "1.1.0"
44
authors = ["Tasio Victoria <[email protected]>"]
55
description = "Stargaze Fair Burn"
66
documentation = "https://docs.rs/stargaze-fair-burn"
@@ -42,6 +42,7 @@ sg-std = { workspace = true }
4242
schemars = { workspace = true }
4343
serde = { workspace = true }
4444
thiserror = { workspace = true }
45+
semver = { workspace = true }
4546

4647
[dev-dependencies]
4748
cw-multi-test = { workspace = true }

contracts/fair-burn/schema/stargaze-fair-burn.json

+48-29
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
{
22
"contract_name": "stargaze-fair-burn",
3-
"contract_version": "1.0.4",
3+
"contract_version": "1.1.0",
44
"idl_version": "1.0.0",
55
"instantiate": {
66
"$schema": "http://json-schema.org/draft-07/schema#",
77
"title": "InstantiateMsg",
88
"type": "object",
99
"required": [
10-
"fee_bps"
10+
"fee_bps",
11+
"fee_manager"
1112
],
1213
"properties": {
1314
"fee_bps": {
1415
"description": "The percentage of funds to be burned, represented as basis points",
1516
"type": "integer",
1617
"format": "uint64",
1718
"minimum": 0.0
19+
},
20+
"fee_manager": {
21+
"description": "The address to send fees to if the funds are not in STARS",
22+
"type": "string"
1823
}
1924
},
2025
"additionalProperties": false
@@ -53,42 +58,72 @@
5358
{
5459
"type": "object",
5560
"required": [
56-
"contract_version"
61+
"config"
5762
],
5863
"properties": {
59-
"contract_version": {
64+
"config": {
6065
"type": "object",
6166
"additionalProperties": false
6267
}
6368
},
6469
"additionalProperties": false
65-
},
70+
}
71+
]
72+
},
73+
"migrate": null,
74+
"sudo": {
75+
"$schema": "http://json-schema.org/draft-07/schema#",
76+
"title": "SudoMsg",
77+
"oneOf": [
6678
{
6779
"type": "object",
6880
"required": [
69-
"config"
81+
"update_config"
7082
],
7183
"properties": {
72-
"config": {
84+
"update_config": {
7385
"type": "object",
86+
"properties": {
87+
"fee_bps": {
88+
"type": [
89+
"integer",
90+
"null"
91+
],
92+
"format": "uint64",
93+
"minimum": 0.0
94+
},
95+
"fee_manager": {
96+
"type": [
97+
"string",
98+
"null"
99+
]
100+
}
101+
},
74102
"additionalProperties": false
75103
}
76104
},
77105
"additionalProperties": false
78106
}
79107
]
80108
},
81-
"migrate": null,
82-
"sudo": null,
83109
"responses": {
84110
"config": {
85111
"$schema": "http://json-schema.org/draft-07/schema#",
86112
"title": "Config",
87113
"type": "object",
88114
"required": [
115+
"fee_manager",
89116
"fee_percent"
90117
],
91118
"properties": {
119+
"fee_manager": {
120+
"description": "The address to send fees to if the funds are not in STARS",
121+
"allOf": [
122+
{
123+
"$ref": "#/definitions/Addr"
124+
}
125+
]
126+
},
92127
"fee_percent": {
93128
"description": "The percentage of funds to be burned",
94129
"allOf": [
@@ -100,31 +135,15 @@
100135
},
101136
"additionalProperties": false,
102137
"definitions": {
138+
"Addr": {
139+
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
140+
"type": "string"
141+
},
103142
"Decimal": {
104143
"description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)",
105144
"type": "string"
106145
}
107146
}
108-
},
109-
"contract_version": {
110-
"$schema": "http://json-schema.org/draft-07/schema#",
111-
"title": "ContractVersion",
112-
"type": "object",
113-
"required": [
114-
"contract",
115-
"version"
116-
],
117-
"properties": {
118-
"contract": {
119-
"description": "contract is the crate name of the implementing contract, eg. `crate:cw20-base` we will use other prefixes for other languages, and their standard global namespacing",
120-
"type": "string"
121-
},
122-
"version": {
123-
"description": "version is any string that this implementation knows. It may be simple counter \"1\", \"2\". or semantic version on release tags \"v0.7.0\", or some custom feature flag list. the only code that needs to understand the version parsing is code that knows how to migrate from the given contract (and is tied to it's implementation somehow)",
124-
"type": "string"
125-
}
126-
},
127-
"additionalProperties": false
128147
}
129148
}
130149
}

contracts/fair-burn/src/bin/schema.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use stargaze_fair_burn::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};
1+
use stargaze_fair_burn::msg::{ExecuteMsg, InstantiateMsg, QueryMsg, SudoMsg};
22

33
use cosmwasm_schema::write_api;
44

@@ -7,5 +7,6 @@ fn main() {
77
instantiate: InstantiateMsg,
88
execute: ExecuteMsg,
99
query: QueryMsg,
10+
sudo: SudoMsg,
1011
}
1112
}

contracts/fair-burn/src/constants.rs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pub const CONTRACT_NAME: &str = "crates.io:stargaze-fair-burn";
2+
pub const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");

0 commit comments

Comments
 (0)