This guide outlines all the contract actions available on the Trail Voting Platform.
Sets the data in the contract's config singleton.
-
string
trail_version
: the version number of the deployed Trail contract. -
bool
set_defaults
: if true, sets default config values.
cleos push action trailservice setconfig '["v2.0.0-RFC2", true]' -p trailservice
Updates a config fee.
-
name
fee_name
: the name of the fee to update. -
asset
fee_amount
: the new fee amount.
cleos push action trailservice updatefee '["ballot", "35.0000 TLOS"]' -p trailservice
Updates a config time.
-
name
time_name
: the name of the config time to update. -
uint32_t
length
: the length of time in seconds.
cleos push action trailservice updatetime '["balcooldown", 86400]' -p trailservice
Creates a new treasury with the given access method and max supply.
-
name
manager
: the account that will manage the new treasury. -
asset
max_supply
: the maximum number of tokens allowed in circulation at one time. -
name
access
: the access method for acquiring a balance of the treasury's tokens. The list of available access methods can be found in the Treasury Guide.
Required Authority: manager
Required Fee: 1000 TLOS
cleos push action trailservice newtreasury '["youraccount", "2,TEST", "public"]' -p manager
Edits the title, description, and icon of a treasury.
-
symbol
treasury_symbol
: the treasury to change. -
string
title
: the new title. -
string
description
: the new description. -
string
content
: the new content
Required Authority: manager
cleos push action trailservice edittrsinfo '["2,TEST", "New Title", "New Desc", "New Icon"]' -p manager
Toggles a treasury setting on and off.
-
symbol
treasury_symbol
: the treasury to change. -
name
setting_name
: the name of the setting to toggle.
cleos push action trailservice toggle '["2,TEST", "transferable"]' -p manager
Mints new tokens into circulation.
-
name
to
: the account to receive the minted tokens. -
asset
quantity
: the amount of tokens to mint. -
string
memo
: a memo describing the minting event.
cleos push action trailservice mint '["testaccounta", "5.00 TEST", "testing mint"]' -p manager
Transfers a quantity of tokens from one voter to another.
-
name
from
: the account sending the tokens. -
name
to
: the account receiving the tokens. -
asset
quantity
: the quantiy of tokens to transfer. -
string
memo
: a memo describing the transfer.
cleos push action trailservice transfer '["testaccounta", "testaccountb", "5.00 TEST", "test transfer"]' -p testaccounta
Burns a quantity of tokens from the manager's liquid balance. Reduces the circulating supply of tokens.
-
asset
quantity
: the quantity of tokens to burn. -
string
memo
: a memo describing the burn.
cleos push action trailservice burn '["5.00 TEST", "test burn"]' -p manager
Reclaims tokens from a voter to the treasury manager.
-
name
voter
: the name of the account from which to reclaim. -
asset
quantity
: the amount of tokens to reclaim. -
strin
memo
: a memo describing the reclamation.
cleos push action trailservice reclaim '["someaccount", "5.00 TEST", "reclaim memo"]' -p manager
Changes the max supply of a treasury.
-
asset
new_max_supply
: the new max supply to set. -
string
memo
: a memo describing the max supply mutation.
cleos push action trailservice mutatemax '["500.00 TEST", "test mutate max"]' -p manager
Sets a new treasury unlocker. Only the new unlock_account@unlock_authority will be able to unlock the treasury.
-
symbol
treasury_symbol
: the treasury for which to set the new unlocker. -
name
new_unlock_acct
: the name of the new unlocker account. -
name
new_unlock_auth
: the name of the new unlock authority.
Required Authority: treasury.manager
cleos push action trailservice setunlocker '["2,TEST", "someaccount", "active"]' -p unlock_acct@unlock_auth
Locks a treasury, preventing changes to settings.
- symbol
treasury_symbol
: the treasury to lock.
Required Authority: treasury.manager
cleos push action trailservice lock '["2,TEST"]' -p manager
Unlocks a treasury, allowing changes to settings.
- symbol
treasury_symbol
: the treasury to unlock.
Required Authority: unlocker_acct@unlocker_auth
cleos push action trailservice unlock '["2,TEST"]' -p unlock_acct@unlock_auth
Adds funds to a payroll. Funds will be charged from the voter's TLOS balance.
-
name
from
: the voter account sending the funds. -
symbol
treasury_symbol
: the treasury receiving the funds. -
name
payroll_name
: the name of the payroll to receive the funds. -
asset
quantity
: the number of tokens to add to the specified payroll.
cleos push action trailservice addfunds '["testaccounta", "2,TEST", "workers", "50.0000 TLOS"]' -p publisher
Edits the pay rate of a payroll.
-
name
payroll_name
: the name of the payroll to edit. -
symbol
treasury_symbol
: the name of the treasury the payroll belongs to. -
uint32_t
period_length
: the new length of the payroll's pay period in seconds. -
asset
per_period
: the amount of payroll funds to make available for claiming per period.
cleos push action trailservice editpayrate '["workers", "2,TEST", "86400", "50.0000 TLOS"]' -p publisher
Creates a new ballot with the given initial options.
-
name
ballot_name
: the name of the new ballot. -
name
category
: the category of the new ballot. The list of available categories can be found in the Ballot Guide. -
name
publisher
: the name of the account publishing the ballot. -
symbol
treasury_symbol
: the treasury symbol the ballot will use to count votes. -
name
voting_method
: the method of weighting votes. The list of available voting methods can be found in the Ballot Guide. -
vector(name)
initial_options
: a list of initial options to place on the ballot.
Required Fee: 30 TLOS
Required Authority: publisher
cleos push action trailservice newballot '["ballot1", "poll", "testaccounta", "2,TEST", "quadratic", ["opt1", "opt2"]]' -p testaccounta
Edits the title, description, and content of a ballot.
-
name
ballot_name
: the name of the ballot to edit. -
string
title
: the new ballot title. -
string
description
: the new ballot description. -
string
content
: the new ballot content. This is typically an IPFS link or URI to additional information about the ballot.
cleos push action trailservice editdetails '["ballot1", "Ballot 1 Example", "Example Description", "somewebsite.io"]' -p testaccounta
Toggles a ballot setting on or off.
-
name
ballot_name
: the name of the ballot. -
name
setting_name
: the name of the setting to toggle.
cleos push action trailservice togglebal '["ballot1", "lightballot"]' -p testaccounta
Changes the minimum and maximum number of options a single voter can select on a ballot.
-
name
ballot_name
: the name of the ballot to update. -
uint8_t
new_min_options
: the new minimum number of options a voter can select. -
uint8_t
new_max_options
: the new maximum number of options a voter can select.
cleos push action trailservice editminmax '["ballot1", 1, 3]' -p testaccounta
Adds an option to a ballot.
-
name
ballot_name
: the name of the ballot to add an option to. -
name
new_option_name
: the name of the new ballot option.
cleos push action trailservice addoption '["ballot1", "opt3"]' -p testaccounta
Removes an option from a ballot.
-
anme
ballot_name
: the name of the ballot containing the option to remove. -
name
option_name
: the option name to remove.
cleos push action trailservice rmvoption '["ballot1", "opt3"]' -p testaccounta
Opens a ballot for voting and sets the ballot end time. All ballot settings and voting options must be finalized before pushing this action, as they cannot be altered once voting has begun. Ballots can, however, be cancelled by the publisher mid-vote at any time.
-
name
ballot_name
: the name of the ballot to open for voting. -
time_point_sec
end_time
: the time point at which to end voting.
cleos push action trailservice openvoting '["ballot1", "2020-05-22T13:00:00"]' -p testaccounta
Cancels a running ballot.
-
name
ballot_name
: the name of the ballot to cancel. -
string
memo
: a memo describing the cancellation.
cleos push action trailservice cancelballot '["ballot1", "cancellation reason here"]' -p testaccounta
Deletes a ballot.
- name
ballot_name
: the name of the ballot to delete.
cleos push action trailservice deleteballot '["ballot1"]' -p testaccounta
Posts the final results of a light ballot.
-
name
ballot_name
: the name of the ballot to post results to. -
map(name, asset)
light_results
: the final results calcualted off-chain. -
uint32_t
total_voters
: the total number of unique voters who participated on the light ballot.
cleos push action trailservice postresults '["ballot1", [{"opt1": "25.00 TEST"},{"opt2", "15.00 TEST"}], 8]' -p trailservice
Closes voting on a ballot and renders the final results.
-
name
ballot_name
: the name of the ballot to close. -
bool
broadcast
: if true, will inline the broadcast() action with the ballot results and total voters.
cleos push action trailservice closevoting '["ballot1", true]' -p testaccounta
Broadcasts ballot results and notifies the ballot publisher.
-
name
ballot_name
: the name of the ballot being broadcast. -
map(name, asset)
final_results
: the final weighted ballot results. -
uint32_t
total_voters
: the total number of unique voters who participated on the ballot.
Inline from closeballot()
Archives a ballot. A flat fee is charged up front per day of archival.
-
name
ballot_name
: the name of the ballot to archive. -
time_point_sec
archived_until
: the time point at which the ballot can be unarchived.
Daily Fee: 3 TLOS
cleos push action trailservice archive '["ballot1", "2020-09-08T23:41:00"]' -p testaccounta
Unarchives a ballot. If force is true, will unarchive before the unarchival date and forfeit any remaining archival time.
-
name
ballot_name
: the name of the ballot being archived. -
bool
force
: if true, forces the ballot to unarchive. Remaining time on the archival is lost if forced to unarchive.
cleos push action trailservice unarchive '["ballot1", false]' -p testaccounta
Registers a voter to a treasury. If the treasury is non-public then a referral is required.
-
name
voter
: the name of the voter to register. -
symbol
treasury_symbol
: the treasury symbol registering the voter. -
name
OPTIONAL referrer
: an optional referrer. Some treasuries will require a referral in order to access.
cleos push action trailservice regvoter '["testaccountb", "2,TEST", null]' -p testaccountb
Unregisters a voter. Requires liquid and staked amount to be zero.
-
name
voter
: the name of the voter to unregister. -
symbol
treasury_symbol
: the treasury symbol to which the voter is registered.
cleos push action trailservice unregvoter '["testaccountb", "2,TEST"]' -p testaccountb
Casts a vote on a ballot. If a vote already exists, and the ballot allows revoting, the old vote will be rolled back and the new vote applied.
-
name
voter
: the name of the voter casting the vote. -
name
ballot_name
: the name of the ballot receiving the vote. -
vector(name)
options
: a list of options to vote for.
cleos push action trailservice castvote '["testaccountb", "ballot1", ["opt1", "opt2"]]' -p testaccountb
Unvotes all options from a single vote.
-
name
voter
: the name of the voter who cast the vote. -
name
ballot_name
: the name of the ballot for which the vote was cast.
cleos push action trailservice unvoteall '["testaccountb", "ballot1"]' -p testaccountb
Stakes a quantity of tokens to a voter's staked amount from their liquid amount.
-
name
voter
: the name of the voter staking tokens. -
asset
quantity
: the quantity of tokens to stake.
cleos push action trailservice stake '["testaccountb", "5.00 TEST"]' -p testaccountb
Unstakes a quantity of tokens from a voter's staked amount to their liquid amount.
-
name
voter
: the name of the voter unstaking tokens. -
asset
quantity
: the quantity of tokens to unstake.
cleos push action trailservice unstake '["testaccounb", "5.00 TEST"]' -p testaccountb
Rebalances a single vote. If worker name is supplied, credits worker with rebalance work on vote. Subsequent rebalances on the same vote will overwrite the previous work performed.
-
name
voter
: the name of the voter whose vote is being rebalanced. -
name
ballot_name
: the name of the ballot that was voted for. -
name
OPTIONAL worker
: the name of the worker performing the rebalance.
cleos push action trailservice rebalance '["testaccountb", "ballot1", "testaccountc"]' -p testaccountc
Cleans a single expired vote. If worker name is supplied, credits worker with cleanup. If rebalance work was done on the vote, that work is credited to the rebalance worker.
-
name
voter
: the name of the voter whose vote to clean. -
name
ballot_name
: the name of the ballot on the vote to clean up. -
name
OPTIONAL worker
: the name of the worker performing the cleanup.
cleos push action trailservice cleanupvote '["testaccounta", "ballot1", "testaccountb"]' -p testaccountb
Forfeits all unclaimed payments from a single worker.
-
name
worker_name
: the name of the worker to unregister. -
symbol
treasury_symbol
: the treasury symbol from which to forfeit work.
Required Authority: worker_name
cleos push action trailservice forfeitwork '["testaccountb", "2,TEST"]' -p testaccountb
Claims a share of available payroll funds. Payments can be claimed for each treasury where work was performed.
-
name
worker_name
: the name of the worker claiming a payment. -
symbol
treasury_symbol
: the treasury symbol for which work was done.
cleos push action trailservice claimpayment '["testaccountb", "2,TEST"]' -p testaccountb
Withdraws a quantity of tokens from the voter's TLOS balance out of Trail.
-
name
voter
: the voter account to withdraw from. -
asset
quantity
: the amount of TLOS to withdraw.
Required Authority: voter
cleos push action trailservice withdraw '["testaccounta", "5.0000 TLOS"]' -p testaccounta
Registers a new committee and populates it with initial seats.
-
name
committee_name
: the name of the new commitee. -
string
committee_title
: the title of the committee. -
symbol
treasury_symbol
: the treasury symbol that the committee will belong to. -
vector(name)
initial_seats
: a list of initial seat names to add to the committee. -
name
registree
: the name of the account registering the committee and paying the registration fee.
Required Fee: 100 TLOS
Required Authority: registree
cleos push action trailservice regcommittee '["jedicouncil", "Telos Jedi Council", "2,TEST", ["seat1", "seat2"], "testaccountc"]' -p testaccountc
Adds a seat to the committee.
-
name
committee_name
: the name of the committee. -
symbol
treasury_symbol
: the treasury symbol that the committee belongs to. -
name
new_seat_name
: the name of the new seat to add to the committee.
Required Authority: updater_acct@updater_auth
cleos push action trailservice addseat '["jedicouncil", "2,TEST", "seat3"]' -p testaccountc
Removes a seat from a committee.
-
name
committee_name
: the name of the committee. -
symbol
treasury_symbol
: the treasury symbol that the comittee belongs to. -
name
seat_name
: the name of the seat to remove from the committee.
Required Authority: updater_acct@updater_auth
cleos push action trailservice removeseat '["jedicouncil", "2,TEST", "seat3"]' -p testaccountc
Assigns an account name to a seat name.
-
name
committee_name
: the name of the committee. -
symbol
treasury_symbol
: the treasury symbol that the committee belongs to. -
name
seat_name
: the name of the seat being assigned. -
name
seat_holder
: the name of the new seat holder. -
string
memo
: a memo describing the seat assignment.
Required Authority: updater_acct@updater_auth
cleos push action trailservice assignseat '["jedicouncil", "2,TEST", "seat1", "yoda", "first jedi council election"]' -p testaccountc
Sets a new updater account and updater authority. The committee updater is the only account allowed to add, remove, or assign seats, as well as set a new updater or delete the committee.
-
name
committee_name
: the name of the committee. -
symbol
treasury_symbol
: the treasury symbol the committee belongs to. -
name
updater_account
: the new account name required for updating the committee. -
name
updater_auth
: the new authority name required for updating the committee. -
string
memo
: a memo describing the change.
Required Authority: updater_acct@updater_auth
cleos push action trailservice setupdater '["jedicouncil", "2,TEST", "testaccountb", "active", "hand off authority"]' -p testaccountc
Deletes a committee.
-
name
committee_name
: the name of the committee to delete. -
symbol
treasury_symbol
: the treasury symbol that the committee belongs to. -
string
memo
: a memo for describing the committee deletion.
Required Authority: updater_acct@updater_auth
cleos push action trailservice delcommittee '["jedicouncil", "2,TEST", "order 66 executed"]' -p testaccountc