Astral Assembly
Overview
The Assembly contract allows xASTRO holders as well as Initial Astroport Builders to post and vote on new on-chain proposals that can execute arbitrary logic.
Links
- Contract Address: terra1k9j8rcyk87v5jvfla2m9wp200azegjz0eshl7n2pwv852a7ssceqsnn7pq
- Testnet Address: terra195m6n5xq4rkjy47fn5y3s08tfmj3ryknj55jqvgq2y55zul9myzsgy06hk
- Contract Repo: https://github.com/astroport-fi/astroport-governance/tree/main/contracts/assembly
- contract.rs: https://github.com/astroport-fi/astroport-governance/blob/main/contracts/assembly/src/contract.rs
- assembly.rs: https://github.com/astroport-fi/astroport-governance/blob/main/packages/astroport-governance/src/assembly.rs
- Tests: https://github.com/astroport-fi/astroport-governance/tree/main/contracts/assembly/tests
InstantiateMsg
Instantiate the contract with proposal parameter limitations and the xASTRO and builder unlock contract addresses.
Params | Type | Description |
---|---|---|
xastro_token_addr | String | Address of xASTRO token |
builder_unlock_addr | String | Address of the builder unlock contract |
proposal_voting_period | u64 | Proposal voting period |
proposal_effective_delay | u64 | Proposal effective delay |
proposal_expiration_period | u64 | Proposal expiration period |
proposal_required_deposit | Uint128 | Proposal required deposit |
proposal_required_quorum | String | Proposal required quorum |
proposal_required_threshold | String | Proposal required threshold |
whitelisted_links | Vec<String> | Whitelisted links |
ExecuteMsg
receive
Receive a new on-chain proposal.
Params | Type | Description |
---|---|---|
receive | Cw20ReceiveMsg | CW20 receive message |
cast_vote
Casts a vote for an active proposal.
Params | Type | Description |
---|---|---|
proposal_id | u64 | Proposal identifier |
vote | ProposalVoteOption | Vote option |
ProposalVoteOption
This structure describes a proposal vote.
Variants | Description |
---|---|
For | Vote for proposal |
Against | Vote against proposal |
end_proposal
Ends an expired proposal.
Params | Type | Description |
---|---|---|
proposal_id | u64 | Proposal identifier |
check_messages
Check messages execution.
Params | Type | Description |
---|---|---|
messages | Vec<ProposalMessage> | Messages |
ProposalMessage
This structure describes a proposal message.
Params | Type | Description |
---|---|---|
order | Uint64 | Order of execution of the message |
msg | CosmosMsg | Execution message |
check_messages_passed
The last endpoint which is executed only if all proposal messages have been passed.
execute_proposal
Executes a sucessful proposal.
remove_completed_proposal
Removes a completed proposal from the proposal list.
update_config
Update contract parameters. Only the Assembly is allowed to update its own parameters.
UpdateConfig
This structure stores the params used when updating the main Assembly contract params.
Params | Type | Description |
---|---|---|
xastro_token_addr | Option<String> | xASTRO token address |
vxastro_token_addr | Option<String> | vxASTRO token address |
voting_escrow_delegator_addr | Option<String> | Voting Escrow delegator address |
builder_unlock_addr | Option<String> | Builder unlock contract address |
proposal_voting_period | Option<u64> | Proposal voting period |
proposal_effective_delay | Option<u64> | Proposal effective delay |
proposal_expiration_period | Option<u64> | Proposal expiration period |
proposal_required_deposit | Option<u128> | Proposal required deposit |
proposal_required_quorum | Option<String> | Proposal required quorum |
proposal_required_threshold | Option<String> | Proposal required threshold |
whitelist_remove | Option<String> | Links to remove from whitelist |
whitelist_add | Option<String> | Links to add to whitelist |
Cw20HookMsg
submit_proposal
Submit a new proposal in the Assembly.
You should execute this message inside the xASTRO token contract.
Params | Type | Description |
---|---|---|
send | Cw20ExecuteMsg | CW20 receive message |
In send.msg
, you may encode this JSON string into base64 encoding.
Params | Type | Description |
---|---|---|
title | String | Proposal title |
description | String | Description for proposal |
link | Option<String> | Link for proposal |
messages | Option<Vec<ProposalMessage>> | Proposal messages |
ibc_channel | Option<String> | If the proposal should be executed on a remote chain, this field should specify the governance channel |
QueryMsg
config
Queries Astral Assembly parameters.
Config
(response)
Params | Type | Description |
---|---|---|
xastro_token_addr | Addr | xASTRO token address |
vxastro_token_addr | Option<Addr> | vxASTRO token address |
voting_escrow_delegator_addr | Option<Addr> | Voting Escrow delegator address |
builder_unlock_addr | Addr | Builder unlock contract address |
proposal_voting_period | u64 | Proposal voting period |
proposal_effective_delay | u64 | Proposal effective delay |
proposal_expiration_period | u64 | Proposal expiration period |
proposal_required_deposit | Uint128 | Proposal required deposit |
proposal_required_quorum | Decimal | Proposal required quorum |
proposal_required_threshold | Decimal | Proposal required threshold |
whitelisted_links | Vec<String> | Whitelisted links |
proposals
Queries the current proposal list.
Params | Type | Description |
---|---|---|
start | Option<u64> | Id from which to start querying |
limit | Option<u32> | The amount of proposals to return |
ProposalListResponse
This structure describes a proposal list response.
Params | Type | Description |
---|---|---|
proposal_count | Uint64 | The amount of proposals returned |
proposal_list | Vec<ProposalResponse> | The list of proposals that are returned |
ProposalResponse
This structure describes a proposal response.
Params | Type | Description |
---|---|---|
proposal_id | Uint64 | Unique proposal ID |
submitter | Addr | The address of the proposal submitter |
status | ProposalStatus | Status of the proposal |
for_power | Uint128 | For power of proposal |
against_power | Uint128 | Against power of proposal |
start_block | u64 | Start block of proposal |
start_time | u64 | Start time of proposal |
end_block | u64 | End block of proposal |
delayed_end_block | u64 | Delayed end block of proposal |
expiration_block | u64 | Expiration block of proposal |
title | String | Proposal title |
description | String | Proposal description |
link | Option<String> | Proposal link |
messages | Option<Vec<ProposalMessage>> | Proposal messages |
deposit_amount | Uint128 | Amount of xASTRO deposited in order to post the proposal |
ProposalStatus
This enum describes available statuses/states for a Proposal.
Variants | Description |
---|---|
Active | Proposal is currently active |
Passed | Proposal passed |
Rejected | Proposal rejected |
Executed | Proposal executed |
Expired | Proposal expired |
proposal
Queries information about a specific proposal.
Params | Type | Description |
---|---|---|
proposal_id | Option<u64> | Id from which to start querying |
Returns ProposalResponse
proposal_voters
Queries list of voters of specified proposal.
Params | Type | Description |
---|---|---|
proposal_id | u64 | Proposal unique id |
vote_option | ProposalVoteOption | Proposal vote option |
start | Option<u64> | Id from which to start querying |
limit | Option<u32> | The amount of proposals to return |
Returns a vector that contains objects of type Addr
proposal_votes
Queries information about the votes cast on a proposal.
Params | Type | Description |
---|---|---|
proposal_id | u64 | Proposal unique id |
ProposalVotesResponse
This structure describes a proposal vote response.
Params | Type | Description |
---|---|---|
proposal_id | u64 | Proposal identifier |
for_power | Uint128 | Total amount of for votes for a proposal |
against_power | Uint128 | Total amount of against votes for a proposal |
user_voting_power
Queries user voting power for a specific proposal.
Params | Type | Description |
---|---|---|
user | String | User address |
proposal_id | u64 | Proposal unique id |
Returns Uint128
total_voting_power
Queries total voting power for a specific proposal.
Params | Type | Description |
---|---|---|
proposal_id | u64 | Proposal unique id |
Returns Uint128