Astroport
Search…
🏦
Astral Assembly
The place where Astroport tokenholders submit and vote on proposals

1. Overview

The Astral Assembly is Astroport’s version of a DAO (Decentralised Autonomous Organization). The Astral Assembly’s goal is the operation, maintenance, development, and growth of Astroport as a user-governed DeFi commons. xASTRO and vxASTRO holders will have the power to propose and make binding votes on smart contract parameter changes, smart contract upgrades, and treasury disbursements.
The Assembly contract code can be found here.

2. Variables & Functions

Constants

Name
Description
CONTRACT_NAME
The Assembly contract name
CONTRACT_VERSION
The current contract version
DEFAULT_LIMIT
Default amount of proposals to retrieve in a query
MAX_LIMIT
Max amount of proposals to retrieve in a query
MINIMUM_PROPOSAL_REQUIRED_THRESHOLD_PERCENTAGE
Minimum proposal required threshold percentage
MAX_PROPOSAL_REQUIRED_PERCENTAGE
Max proposal required threshold percentage
MINIMUM_DELAY
Minimum amount of blocks between a proposal being marked as successful and the time when it can be executed
MINIMUM_EXPIRATION_PERIOD
Minimum amount of blocks after voting is done and the grace period ends after which a proposal is considered expired
MIN_TITLE_LENGTH
Minimum title length
MAX_TITLE_LENGTH
Maximum title length
MIN_DESC_LENGTH
Minimum description length
MAX_DESC_LENGTH
Maxiumum disription length
MIN_LINK_LENGTH
Minimum link length
MAX_LINK_LENGTH
Maximum link length
CONFIG
Struct that stores general contract params
PROPOSAL_COUNT
Stores the global state for the Assembly contract
PROPOSALS
This is a mapping that contains information about all proposals

Structs

Name
Description
Contains
InstantiateMsg
This structure holds the parameters used for creating an Assembly contract
  • xastro_token_addr - Address of xASTRO token
  • vxastro_token_addr - Address of vxASTRO token
  • builder_unlock_addr - Address of the builder unlock contract
  • proposal_voting_period - Proposal voting period
  • proposal_effective_delay - Proposal effective delay
  • proposal_expiration_period - Proposal expiration period
  • proposal_required_deposit - Proposal required deposit
  • proposal_required_quorum - Proposal required quorum
  • proposal_required_threshold - Proposal required threshold
  • whitelisted_links - Whitelisted links
Config
This structure stores general parameters for the Assembly contract
Same as above
UpdateConfig
This structure sotres the params used when updating the main Assembly contract params
Same as above
Proposal
This structure stores data for a proposal
  • proposal_id - Unique proposal ID
  • submitter - The address of the proposal submitter
  • status - Status of the proposal
  • for_power - For power of proposal
  • against_power - Against power of proposal
  • for_voters - For votes for the proposal
  • against_voters - Against votes for the proposal
  • start_block - Start block of proposal
  • start_time - Start time of proposal
  • end_block - End block of proposal
  • title - Proposal title
  • description - Proposal description
  • link - Proposal link
  • messages - Proposal messages
  • deposit_amount - Amount of xASTRO deposited in order to post the proposal
ProposalMessage
This structure describes a proposal message
  • order - Order of execution of the message
  • msg - Execution message
ProposalVote
This structure describes a proposal vote
  • option - Voted option for the proposal
  • power - Vote power
ProposalVotesResponse
This structure describes a proposal vote response
  • proposal_id - Proposal identifier
  • for_power - Total amount of for votes for a proposal
  • against_power - Total amount of against votes for a proposal
ProposalListResponse
This structure describes proposal list response
  • proposal_count - Prosal count
  • proposal_list - Proposal list

Functions

Function
Params
Description
instantiate
(deps: DepsMut, _env: Env, _info: MessageInfo, msg: InstantiateMsg, ) -> Result<Response, ContractError>
Instantiates the Assembly contract
execute
(deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, ContractError>
Exposes all the execute functions available in the contract
receive_cw20
(deps: DepsMut, env: Env, info: MessageInfo, cw20_msg: Cw20ReceiveMsg, ) -> Result<Response, ContractError>
Receives a message of type [Cw20ReceiveMsg] and processes it depending on the received template
submit_proposal
(deps: DepsMut, env: Env, info: MessageInfo, sender: Addr, deposit_amount: Uint128, title: String, description: String, link: Option<String>, messages: Option<Vec<ProposalMessage>>, ) -> Result<Response, ContractError>
Submit a brand new proposal and locks some xASTRO as an anti-spam mechanism.
cast_vote
(deps: DepsMut, env: Env, info: MessageInfo, proposal_id: u64, vote_option: ProposalVoteOption, ) -> Result<Response, ContractError>
Cast a vote on a proposal
end_proposal
(deps: DepsMut, env: Env, _info: MessageInfo, proposal_id: u64, ) -> Result<Response, ContractError>
Ends proposal voting and sets the proposal status
execute_proposal
(deps: DepsMut, env: Env, _info: MessageInfo, proposal_id: u64, ) -> Result<Response, ContractError>
Executes a successful proposal
remove_completed_proposal
(deps: DepsMut, env: Env, _info: MessageInfo, proposal_id: u64, ) -> Result<Response, ContractError>
Removes an expired or rejected proposal from the general proposal list
update_config
(deps: DepsMut, env: Env, info: MessageInfo, updated_config: UpdateConfig, ) -> Result<Response, ContractError>
Updates Assembly contract parameters
query
(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary>
Expose available contract queries
query_config
(deps: Deps) -> StdResult<Config>
Returns the contract configuration stored in the [Config] structure
query_proposals
(deps: Deps, start: Option<u64>, limit: Option<u32>, ) -> StdResult<ProposalListResponse>
Returns the current proposal list
query_proposal
(deps: Deps, proposal_id: u64) -> StdResult<Proposal>
Returns proposal information stored in the [Proposal] structure
query_proposal_votes
(deps: Deps, proposal_id: u64) -> StdResult<ProposalVotesResponse>
Returns proposal votes stored in the [ProposalVotesResponse] structure
calc_voting_power
(deps: Deps, sender: String, proposal: &Proposal) -> StdResult<Uint128>
Calculates an address' voting power at the specified block
calc_total_voting_power_at
(deps: Deps, proposal: &Proposal) -> StdResult<Uint128>
Calculates the total voting power at a specified block (that is relevant for a specific proposal)
migrate
(deps: DepsMut, _env: Env, msg: MigrateMsg) -> Result<Response, ContractError>
Used for the contract migration. Returns a default object of type [Response]

3. Walkthrough

ExecuteMsg

receive
Submit a new on-chain proposal.
1
{
2
"receive": {
3
"sender": "terra...",
4
"amount": "123",
5
"msg": "<base64_encoded_json_string>"
6
}
7
}
Copied!
cast_vote
Casts a vote for an active proposal.
1
{
2
"cast_vote": {
3
"proposal_id": 123,
4
"vote": "for"
5
}
6
}
Copied!
end_proposal
Ends an expired proposal.
1
{
2
"end_proposal": {
3
"proposal_id": 123
4
}
5
}
Copied!
execute_proposal
Executes a proposal.
1
{
2
"execute_proposal": {
3
"proposal_id": 123
4
}
5
}
Copied!
remove_completed_proposal
Removes a completed proposal from the proposal list.
1
{
2
"remove_completed_proposal": {
3
"proposal_id": 123
4
}
5
}
Copied!

Queries

config
Returns Astral Assembly parameters.
JSON
Ex. Response
1
{
2
"config": {}
3
}
Copied!
1
{
2
"xastro_token_addr": "terra1yufp7cv85qrxrx56ulpfgstt2gxz905fgmysq0",
3
"vxastro_token_addr": "terra1pqr02fx4ulc2mzws7xlqh8hpwqx2ls5m4fk62j",
4
"builder_unlock_addr": "terra1hccg0cfrcu0nr4zgt5urmcgam9v88peg9s7h6j",
5
"proposal_voting_period": 1200,
6
"proposal_effective_delay": 300,
7
"proposal_expiration_period": 1800,
8
"proposal_required_deposit": "50000000",
9
"proposal_required_quorum": "0.00000001",
10
"proposal_required_threshold": "0.5"
11
}
Copied!
proposals
Returns the current proposal list.
JSON
Ex. Response
1
{
2
"proposals": {}
3
}
Copied!
1
{
2
"proposal_count": "26",
3
"proposal_list": [
4
{
5
"proposal_id": "2",
6
"submitter": "terra13nwrmpau8h9awt6r7vvesar5qhv5g08dn3ycqw",
7
"status": "Passed",
8
"for_power": "5000000",
9
"against_power": "0",
10
"for_voters": [
11
"terra1svd2teds9k7tszm8tt75nt27ryp0tls2cw6jg7"
12
],
13
"against_voters": [],
14
"start_block": 8374308,
15
"start_time": 1648200952,
16
"end_block": 8375508,
17
"title": "He must be stopped",
18
"description": "'Cause I'm Slim Shady, yes, I'm the real Shady\nAll you other Slim Shadys are just imitating\nSo won't the real Slim Shady please stand up\nPlease stand up, please stand up?\n'Cause I'm Slim Shady, yes, I'm the real Shady\nAll you other Slim Shadys are just imitating\nSo won't the real Slim Shady please stand up\nPlease stand up, please stand up?",
19
"link": "https://slim.shady",
20
"messages": [
21
{
22
"order": "1",
23
"msg": {
24
"bank": {
25
"send": {
26
"to_address": "terra...",
27
"amount": [
28
{
29
"denom": "uluna",
30
"amount": "100"
31
}
32
]
33
}
34
}
35
}
36
}
37
],
38
"deposit_amount": "50000000"
39
},
40
{
41
"proposal_id": "8",
42
"submitter": "terra13nwrmpau8h9awt6r7vvesar5qhv5g08dn3ycqw",
43
"status": "Executed",
44
"for_power": "5000000",
45
"against_power": "0",
46
"for_voters": [
47
"terra1svd2teds9k7tszm8tt75nt27ryp0tls2cw6jg7"
48
],
49
"against_voters": [],
50
"start_block": 8380699,
51
"start_time": 1648244420,
52
"end_block": 8381899,
53
"title": "sdfgkjl;dfsgkhjlfdsjkl;",
54
"description": "afsdjkladsfjkl;dfgs;jkladsfljk;",
55
"link": null,
56
"messages": null,
57
"deposit_amount": "50000000"
58
},
59
{
60
"proposal_id": "10",
61
"submitter": "terra14zees4lwrdds0em258axe7d3lqqj9n4v7saq7e",
62
"status": "Passed",
63
"for_power": "5000000",
64
"against_power": "0",
65
"for_voters": [
66
"terra1jdd392vxlx5u23yvekvvjzuna0gszttgtngfnt"
67
],
68
"against_voters": [],
69
"start_block": 8406648,
70
"start_time": 1648422400,
71
"end_block": 8407848,
72
"title": "AIP-420: Fund the AstroChad",
73
"description": "This is a funding proposal for an epic astrochad",
74
"link": "https://www.google.com",
75
"messages": [
76
{
77
"order": "1",
78
"msg": {
79
"bank": {
80
"send": {
81
"to_address": "terra14zees4lwrdds0em258axe7d3lqqj9n4v7saq7e",
82
"amount": [
83
{
84
"denom": "uluna",
85
"amount": "1"
86
}
87
]
88
}
89
}
90
}
91
}
92
],
93
"deposit_amount": "50000000"
94
},
95
{
96
"proposal_id": "12",
97
"submitter": "terra14zees4lwrdds0em258axe7d3lqqj9n4v7saq7e",
98
"status": "Passed",
99
"for_power": "5000000",
100
"against_power": "0",
101
"for_voters": [
102
"terra1jdd392vxlx5u23yvekvvjzuna0gszttgtngfnt"
103
],
104
"against_voters": [],
105
"start_block": 8406817,
106
"start_time": 1648423535,
107
"end_block": 8408017,
108
"title": "AIP-1234",
109
"description": "Sending funds again",
110
"link": "https://forum.astroport.fi/t/arc-3-lunax-luna-pool-addition-to-astroport-with-dual-incentives/168",
111
"messages": [
112
{
113
"order": "1",
114
"msg": {
115
"bank": {
116
"send": {
117
"to_address": "terra14zees4lwrdds0em258axe7d3lqqj9n4v7saq7e",
118
"amount": [
119
{
120
"denom": "uluna",
121
"amount": "100"
122
}
123
]
124
}
125
}
126
}
127
}
128
],
129
"deposit_amount": "50000000"
130
},
131
{
132
"proposal_id": "16",
133
"submitter": "terra12m4tpexrvrtusnaags7ud6ret6exwhv0q7w3jd",
134
"status": "Passed",
135
"for_power": "134666539",
136
"against_power": "0",
137
"for_voters": [
138
"terra1cddk0ql349au5ygq0jr7wc2k5dyt3acp9csau4"
139
],
140
"against_voters": [],
141
"start_block": 8411592,
142
"start_time": 1648455916,
143
"end_block": 8412792,
144
"title": "Timezones timezones",
145
"description": "bye bye daylight savings",
146
"link": null,
147
"messages": [
148
{
149
"order": "1",
150
"msg": {
151
"bank": {
152
"send": {
153
"to_address": "terra...",
154
"amount": [
155
{
156
"denom": "uluna",
157
"amount": "100"
158
}
159
]
160
}
161
}
162
}
163
}
164
],
165
"deposit_amount": "50000000"
166
},
167
{
168
"proposal_id": "17",
169
"submitter": "terra14zees4lwrdds0em258axe7d3lqqj9n4v7saq7e",
170
"status": "Passed",
171
"for_power": "97333269",
172
"against_power": "0",
173
"for_voters": [
174
"terra1jdd392vxlx5u23yvekvvjzuna0gszttgtngfnt"
175
],
176
"against_voters": [],
177
"start_block": 8413315,
178
"start_time": 1648467816,
179
"end_block": 8414515,
180
"title": "Timezone test",
181
"description": "Timezone test",
182
"link": "https://forum.astroport.fi/t/arc-3-lunax-luna-pool-addition-to-astroport-with-dual-incentives/168",
183
"messages": null,
184
"deposit_amount": "50000000"
185
},
186
{
187
"proposal_id": "19",
188
"submitter": "terra1jdd392vxlx5u23yvekvvjzuna0gszttgtngfnt",
189
"status": "Executed",
190
"for_power": "10302660027",
191
"against_power": "0",
192
"for_voters": [
193
"terra14zees4lwrdds0em258axe7d3lqqj9n4v7saq7e"
194
],
195
"against_voters": [],
196
"start_block": 8418100,
197
"start_time": 1648500827,
198
"end_block": 8419300,
199
"title": "Some title",
200
"description": "Some description",
201
"link": "https://forum.astroport.fi/t/arc-3-lunax-luna-pool-addition-to-astroport-with-dual-incentives/168",
202
"messages": null,
203
"deposit_amount": "50000000"
204
},
205
{
206
"proposal_id": "20",
207
"submitter": "terra14zees4lwrdds0em258axe7d3lqqj9n4v7saq7e",
208
"status": "Executed",
209
"for_power": "47333269",
210
"against_power": "0",
211
"for_voters": [
212
"terra1jdd392vxlx5u23yvekvvjzuna0gszttgtngfnt"
213
],
214
"against_voters": [],
215
"start_block": 8418196,
216
"start_time": 1648501484,
217
"end_block": 8419396,
218
"title": "Some title",
219
"description": "Some description",
220
"link": "https://forum.astroport.fi/t/arc-3-lunax-luna-pool-addition-to-astroport-with-dual-incentives/168",
221
"messages": null,
222
"deposit_amount": "50000000"
223
},
224
{
225
"proposal_id": "22",
226
"submitter": "terra13nwrmpau8h9awt6r7vvesar5qhv5g08dn3ycqw",
227
"status": "Passed",
228
"for_power": "4999999",
229
"against_power": "0",
230
"for_voters": [
231
"terra1w3rfgtysv968twmrwj6wun9epjnyjma8scglxf"
232
],
233
"against_voters": [],
234
"start_block": 8420270,
235
"start_time": 1648515710,
236
"end_block": 8421470,
237
"title": "We should probably do something",
238
"description": "Or possibly, nothing",
239
"link": "www.google.com",
240
"messages": [
241
{
242
"order": "1",
243
"msg": {
244
"wasm": {
245
"execute": {
246
"contract_addr": "factory_contract",
247
"msg": "eyJ1cGRhdGVfY29uZmlnIjp7ImdlbmVyYXRvcl9hZGRyZXNzIjoidGVycmExZ2ptN2Q5bm1ld24yN3F6cnZxeWhkYTh6c2ZsNDBheWE3dHZhdzUifX0=",
248
"funds": [
249
{
250
"denom": "uusd",
251
"amount": "100000"
252
}
253
]
254
}
255
}
256
}
257
},
258
{
259
"order": "2",
260
"msg": {
261
"wasm": {
262
"execute": {
263
"contract_addr": "factory_contract2",
264
"msg": "eyJ1cGRhdGVfY29uZmlnIjp7ImdlbmVyYXRvcl9hZGRyZXNzIjoidGVycmExZ2ptN2Q5bm1ld24yN3F6cnZxeWhkYTh6c2ZsNDBheWE3dHZhdzUifX0=",
265
"funds": [
266
{
267
"denom": "uusd",
268
"amount": "200000"
269
},
270
{
271
"denom": "uusd",
272
"amount": "300000"
273
}
274
]
275
}
276
}
277
}
278
}
279
],
280
"deposit_amount": "50000000"
281
},
282
{
283
"proposal_id": "25",
284
"submitter": "terra14zees4lwrdds0em258axe7d3lqqj9n4v7saq7e",
285
"status": "Executed",
286
"for_power": "97333269",
287
"against_power": "0",
288
"for_voters": [
289
"terra1jdd392vxlx5u23yvekvvjzuna0gszttgtngfnt"
290
],
291
"against_voters": [],
292
"start_block": 8427561,
293
"start_time": 1648566740,
294
"end_block": 8428761,
295
"title": "Some title",
296
"description": "Some description",
297
"link": "https://forum.astroport.fi/t/arc-3-lunax-luna-pool-addition-to-astroport-with-dual-incentives/168",
298
"messages": null,
299
"deposit_amount": "50000000"
300
}
301
]
302
}
Copied!
proposal
Returns information about a specific proposal.
JSON
Ex. Response
1
{
2
"proposal": {
3
"proposal_id": 12
4
}
5
}
Copied!
1
{
2
"proposal_id": "12",
3
"submitter": "terra14zees4lwrdds0em258axe7d3lqqj9n4v7saq7e",
4
"status": "Passed",
5
"for_power": "5000000",
6
"against_power": "0",
7
"for_voters": [
8
"terra1jdd392vxlx5u23yvekvvjzuna0gszttgtngfnt"
9
],
10
"against_voters": [],
11
"start_block": 8406817,
12
"start_time": 1648423535,
13
"end_block": 8408017,
14
"title": "AIP-1234",
15
"description": "Sending funds again",
16
"link": "https://forum.astroport.fi/t/arc-3-lunax-luna-pool-addition-to-astroport-with-dual-incentives/168",
17
"messages": [
18
{
19
"order": "1",
20
"msg": {
21
"bank": {
22
"send": {
23
"to_address": "terra14zees4lwrdds0em258axe7d3lqqj9n4v7saq7e",
24
"amount": [
25
{
26
"denom": "uluna",
27
"amount": "100"
28
}
29
]
30
}
31
}
32
}
33
}
34
],
35
"deposit_amount": "50000000"
36
}
Copied!
proposal_votes
Returns information about the votes cast on a proposal.
JSON
Ex. Response
1
{
2
"proposal_votes": {
3
"proposal_id": 12
4
}
5
}
Copied!
1
{
2
"proposal_id": 12,
3
"for_power": "5000000",
4
"against_power": "0"
5
}
Copied!
user_voting_power
Returns user voting power for a specific proposal.
JSON
Ex. Response
1
{
2
"user_voting_power": {
3
"user": "terra...",
4
"proposal_id": 12
5
}
6
}
Copied!
1
"0"
Copied!

total_voting_power

Returns total voting power for a specific proposal.
JSON
Second Tab
1
{
2
"total_voting_power": {
3
"proposal_id": 123
4
}
5
}
Copied!
1
"0"
Copied!