Skip to content

Instantly share code, notes, and snippets.

@dallasjohnson
Created September 18, 2018 16:29
Show Gist options
  • Save dallasjohnson/f38923672da55ab22f467300408f4fa3 to your computer and use it in GitHub Desktop.
Save dallasjohnson/f38923672da55ab22f467300408f4fa3 to your computer and use it in GitHub Desktop.
output from `cleos -u "http://dev.cryptolions.io:18888" get abi dacelections`
{
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name": "member",
"base": "",
"fields": [{
"name": "sender",
"type": "name"
}, {
"name": "agreedterms",
"type": "string"
}]
}, {
"name": "earlyelect",
"base": "",
"fields": [{
"name": "earlyelect",
"type": "bool"
}]
}, {
"name": "void",
"base": "",
"fields": []
}, {
"name": "pay",
"base": "",
"fields": [{
"name": "key",
"type": "int64"
}, {
"name": "receiver",
"type": "name"
}, {
"name": "quantity",
"type": "asset"
}, {
"name": "memo",
"type": "string"
}]
}, {
"name": "firecust",
"base": "",
"fields": [{
"name": "cust",
"type": "int64"
}]
}, {
"name": "resigncust",
"base": "",
"fields": [{
"name": "cust",
"type": "int64"
}]
}, {
"name": "tempstake",
"base": "",
"fields": [{
"name": "sender",
"type": "name"
}, {
"name": "quantity",
"type": "asset"
}, {
"name": "memo",
"type": "string"
}]
}, {
"name": "candidate",
"base": "",
"fields": [{
"name": "candidate_name",
"type": "name"
}, {
"name": "requestedpay",
"type": "asset"
}, {
"name": "locked_tokens",
"type": "asset"
}, {
"name": "total_votes",
"type": "int64"
}, {
"name": "is_active",
"type": "uint8"
}, {
"name": "custodian_end_time_stamp",
"type": "uint32"
}]
}, {
"name": "custodian",
"base": "",
"fields": [{
"name": "cust_name",
"type": "name"
}, {
"name": "requestedpay",
"type": "asset"
}, {
"name": "total_votes",
"type": "int64"
}]
}, {
"name": "vote",
"base": "",
"fields": [{
"name": "voter",
"type": "name"
}, {
"name": "proxy",
"type": "name"
}, {
"name": "candidates",
"type": "name[]"
}]
}, {
"name": "updateconfig",
"base": "",
"fields": [{
"name": "lockupasset",
"type": "asset"
}, {
"name": "maxvotes",
"type": "uint8"
}, {
"name": "numelected",
"type": "uint8"
}, {
"name": "periodlength",
"type": "uint32"
}, {
"name": "authaccount",
"type": "name"
}, {
"name": "initial_vote_quorum_percent",
"type": "uint32"
}, {
"name": "vote_quorum_percent",
"type": "uint32"
}, {
"name": "auth_threshold_high",
"type": "uint8"
}, {
"name": "auth_threshold_mid",
"type": "uint8"
}, {
"name": "auth_threshold_low",
"type": "uint8"
}, {
"name": "lockup_release_time_delay",
"type": "uint32"
}, {
"name": "requested_pay_max",
"type": "asset"
}]
}, {
"name": "nominatecand",
"base": "",
"fields": [{
"name": "cand",
"type": "name"
}, {
"name": "requestedpay",
"type": "asset"
}]
}, {
"name": "withdrawcand",
"base": "",
"fields": [{
"name": "cand",
"type": "name"
}]
}, {
"name": "firecand",
"base": "",
"fields": [{
"name": "cand",
"type": "name"
}, {
"name": "lockupStake",
"type": "uint8"
}]
}, {
"name": "updatebio",
"base": "",
"fields": [{
"name": "cand",
"type": "name"
}, {
"name": "bio",
"type": "string"
}]
}, {
"name": "storeprofile",
"base": "",
"fields": [{
"name": "cand",
"type": "name"
}, {
"name": "profile",
"type": "string"
}]
}, {
"name": "updatereqpay",
"base": "",
"fields": [{
"name": "cand",
"type": "name"
}, {
"name": "requestedpay",
"type": "asset"
}]
}, {
"name": "votecust",
"base": "",
"fields": [{
"name": "voter",
"type": "name"
}, {
"name": "newvotes",
"type": "name[]"
}]
}, {
"name": "voteproxy",
"base": "",
"fields": [{
"name": "voter",
"type": "name"
}, {
"name": "proxy",
"type": "name"
}]
}, {
"name": "newperiod",
"base": "",
"fields": [{
"name": "message",
"type": "string"
}, {
"name": "earlyelect",
"type": "bool"
}]
}, {
"name": "claimpay",
"base": "",
"fields": [{
"name": "claimer",
"type": "name"
}, {
"name": "payid",
"type": "uint64"
}]
}, {
"name": "paypending",
"base": "",
"fields": [{
"name": "message",
"type": "string"
}]
}, {
"name": "contractstate",
"base": "",
"fields": [{
"name": "lastperiodtime",
"type": "uint32"
}, {
"name": "total_weight_of_votes",
"type": "int64"
}, {
"name": "total_votes_on_candidates",
"type": "int64"
}, {
"name": "number_active_candidates",
"type": "uint32"
}, {
"name": "met_initial_votes_threshold",
"type": "uint8"
}]
}],
"actions": [{
"name": "stprofile",
"type": "storeprofile",
"ricardian_contract": "An authenticated action to update the user's profile. ##Warning: This action will store the content on the chain in the history logs and the data cannot be deleted later so therefore should only store a unidentifiable hash of content rather than human readable content. "
}, {
"name": "stprofileuns",
"type": "storeprofile",
"ricardian_contract": "An authenticated action to update the user's profile. ##Warning: This action will store the content on the chain in the history logs and the data cannot be deleted later."
}, {
"name": "firecust",
"type": "firecust",
"ricardian_contract": "Remove an elected custodian. This action must be run by the by elected custodians and the outcome should remove the elected custodian and lock up their tokens until the delay period has passed so the tokens can be claimed with the unstake action."
}, {
"name": "resigncust",
"type": "resigncust",
"ricardian_contract": "Remove an elected custodian. This action must be run by the resigning custodian and the outcome should remove the elected custodian and lock up their tokens until the delay period has passed so the tokens can be claimed with the unstake action."
}, {
"name": "firecand",
"type": "firecand",
"ricardian_contract": "Sets a candidate inactive so they will be excluded from the next election round. This action must be run by the by elected custodians and has the additional option to lock up the candidate's tokens until a delay period has passed based on the delay set in the config. Then the tokens can be claimed with the unstake action. If the option passed is false and there is an existing lockup delay on the tokens this lockup will continue to be active until the lock up time has passed."
}, {
"name": "unstake",
"type": "withdrawcand",
"ricardian_contract": "Returns staked tokens back to the candidate if the user is no longer an active candidate and there is no delay set on the candidate the staked tokens will be returned to the candidate."
}, {
"name": "migrate",
"type": "void",
"ricardian_contract": ""
}, {
"name": "allocatecust",
"type": "earlyelect",
"ricardian_contract": ""
}, {
"name": "updateconfig",
"type": "updateconfig",
"ricardian_contract": "## ACTION: updateconfig\n**PARAMETERS:**\n\n__lockupasset__ is an asset to be locked up as part of the nominating process for a custodian passed to the action in the format: \"10.0000 EOSDAC\". default value: \"10.0000 EOSDAC\"\n\n__maxvotes__ is a integer to configure the maximum number of allowed votes for a nominated member in any single voting action. The default value is 5.\n\n__numelected__ is a integer to configure the number of candidates that will be elected as custodians of the dac. default value is 12.\n\n**INTENT:** The intent of {{ updateconfig }} is update the configuration for the running contract of selected parameters without needing change the source code. This requires a privilaged account.\n\n**TERM:** The action lasts for the duration of the processing of the contract."
}, {
"name": "nominatecand",
"type": "nominatecand",
"ricardian_contract": "## ACTION: regcadidate\n**PARAMETERS:**\n\n__cand__ is an account_name parameter for the nominating candidate.\n\n__bio__ is a string representing a bio for candidate. This could be an IPFS hash.\n\n__requestedpay__ is an asset requested by the candidate as pay for being an elected custodian. It should be passed to the action in the format: \"10.0000 EOSDAC\".\n\n**INTENT:** The intent of {{ regcadidate }} is to nominate a candidate for becoming an elected custodian. The action ensures the user has agreed to the latest terms and conditions and has the correct authorization of the {{ cand }} to perform the action. Then the an amount of tokens will be transferred from the {{ cand }} account to this contract as specified in the config for the contract. Upon success the user will be added to the list of candidates and will eligible for election.\n\n**TERM:** The action lasts for the duration of the processing of the contract."
}, {
"name": "withdrawcand",
"type": "withdrawcand",
"ricardian_contract": "## ACTION: withdrawcand\n**PARAMETERS:**\n\n__cand__ is an account_name parameter for the nominating candidate.\n\n**INTENT:** The intent of {{ withdrawcand }} is to withdraw a candidate for becoming an elected custodian. The action ensures the {{ cand }} account is currently nominated. On success the amount of tokens that was locked up via the {{ nominatecand }} action will be added to a list of pending transactions to transfer back to the {{ cand }} account. The actual transfer would be performed by a seperate action due to the auth requirement for sending funds from the contract's account.\n\n**TERM:** The action lasts for the duration of the processing of the contract."
}, {
"name": "updatebio",
"type": "updatebio",
"ricardian_contract": "## ACTION: updatebio\n**PARAMETERS:**\n\n__cand__ is an account_name parameter for the nominating candidate.\n\n__bio__ is a string representing a bio for candidate. This could be an IPFS hash.\n\n**INTENT:** The intent of {{ updatebio }} is to allow a candidate update their bio information after they have nominated. The action ensures the user has agreed to the latest terms and conditions, has the correct authorization of the {{ cand }} to perform the action and is already nominated as a candidate. Then the bio information for the candidate will be updated leaving all other data of the candidate unchanged.\n\n**TERM:** The action lasts for the duration of the processing of the contract."
}, {
"name": "updatereqpay",
"type": "updatereqpay",
"ricardian_contract": "## ACTION: updatereqpay\n**PARAMETERS:**\n\n__cand__ is an account_name parameter for the nominating candidate.\n\n__requestedpay__ is an asset requested by the candidate as pay for being an elected custodian. It should be passed to the action in the format: \"10.0000 EOSDAC\".\n\n**INTENT:** The intent of {{ updatereqpay }} is to allow a candidate update their requested pay after they have nominated. The action ensures the user has agreed to the latest terms and conditions, has the correct authorization of the {{ cand }} to perform the action and is already nominated as a candidate. Then the {{ pendingreqpay }} field is updated on the candidate until the next time {{ newperiod }} is run. At the time {{ newperiod }} is called the {{ pendingreqpay }} is tranferred to {{ requestedpay }}. This 2 step process is to ensure that a custodian cannot change their requested pay after a voter has elected but before the election period has closed (as signalled by calling {{ newperiod }}) which would effect the amount of pay a custodian would receive. All other data of the candidate should remain unchanged.\n\n**TERM:** The action lasts for the duration of the processing of the contract."
}, {
"name": "votecust",
"type": "votecust",
"ricardian_contract": "## ACTION: votecust\n**PARAMETERS:**\n\n__voter__ is an account_name parameter for the {{ voter }} member.\n\n__newvotes__ is an array of nominated candidates account names that the voter intends to vote for with a maximum number of votes as configured by the contract.\n\n**INTENT:** The intent of {{ votecust }} is to vote candidates that may become custodians after the next call to {{ newperiod }}. The action ensures the user has agreed to the latest terms and conditions and has the correct authorization of the {{ voter }} to place or change an active vote. Upon success this action will either update an existing vote with a new set of candidates or create a new active vote for the {{ voter }} for candidates eligible for election. This action will replace an existing vote for a proxy for {{ voter }} if one exists."
}, {
"name": "voteproxy",
"type": "voteproxy",
"ricardian_contract": "## ACTION: voteproxy\n**PARAMETERS:**\n\n__voter__ is an account_name parameter for the {{ voter }} member.\n\n__proxy__ is an account name that the voter intends to vote for with a maximum number of votes as configured by the contract.\n\n**INTENT:** The intent of {{ voteproxy }} is to vote another single voter account that may vote with {{ voters }} weight for custodians as a proxy. The action ensures the {{ voter }} has agreed to the latest terms and conditions and has the correct authorization of the {{ voter }} to place or change an active vote. Upon success this action will either update an existing {{ proxy }} vote or create a new active vote for {{ proxy }}. This action will replace an existing vote for a custodians as created by the votecust action if one exists. This action will fail if {{ voter }} attempts to vote for a user who is already voting for a proxy or if they attempt to proxy vote for themselves."
}, {
"name": "newperiod",
"type": "newperiod",
"ricardian_contract": "## ACTION: newperiod\n**PARAMETERS:**\n\n__message__ is string used only for logging in the blockchain history and serves no purpose in the action contract logic.\n\n**INTENT:** The intent of {{ newperiod }} is to signal the end of one election period and commence the next. It performs several actions:\n\n1. Calculate the mean `requestedpay` of all the currently elected custodians.\n2. Distribute the median pay amount to all the currently elected custodians. This is achieved by adding a record to the `pendingpay` table with the custodian and the amount payable in preparation for a contract authorised action to transfer all the pending payments for custodians and recently unnominated candidates (from the `withdrawcand` action).\n3. Clears the existing vote counts for each voter and custodian in the current period in preparation for the tallying of votes for the next period.\n4. tally the votes based each voter's EOSDAC balance at the time `newperiod` is called. This is captured on the `weight` field for each vote. The same is also added to a chosen proxy if they have an active proxy vote.\n5. The vote `weight` for each vote is added to the `total_votes` field for each candidate resulting in the total votes being collated.\n6. The top `numelected` candidates based on the value of their `total_votes` has their `is_custodian` field set to true and the rest are set to false.\n7. The `pendingreqpay` field value for each candidate is moved to the `requestedpay` field. This ensures the `pendingreqpay` field can be used for election campaiging for the next period while the `requestedpay` field can be used at the closing of the current period for pay calculations. \n "
}, {
"name": "paypending",
"type": "paypending",
"ricardian_contract": "## ACTION: paypending\n**PARAMETERS:**\n\n__message__ is string used only for logging in the blockchain history and serves no purpose in the action contract logic.\n\n**INTENT:** The intent of {{ paypending }} is to pay all the pending payment amounts to members. The list of payees would populated from the `newperiod` calculation and the candidates who have unnominated and are due to have their staked tokens returned to them. This list is collected in the `pendingpay` table. This action pays each pending payee via an inline transfer on the `eosdactoken` contract and then removes the pending payment record from the `pending_pay` table. The active auth of this contract is required to complet the action."
}, {
"name": "claimpay",
"type": "claimpay",
"ricardian_contract": "## ACTION: claimpay\n**PARAMETERS:**\n\n__claimer__ account claiming the pay. This account must match the destination account for which the claim is for.\n\n**INTENT:** The intent of {{ claimpay }} is to allow an account to claim pending payment amounts due to the account. The pay claim they are claiming needs to be visible in the `pendingpay` table. transfers to the claimer via an inline transfer on the `eosdactoken` contract and then removes the pending payment record from the `pending_pay` table. The active auth of this claimer is required to complete this action."
}],
"tables": [{
"name": "members",
"index_type": "i64",
"key_names": [
"sender"
],
"key_types": [
"name"
],
"type": "member"
}, {
"name": "candidates",
"index_type": "i64",
"key_names": [
"bycandidate",
"byvotes",
"byvotesrank",
"bypendingpay"
],
"key_types": [
"name",
"int64",
"int64",
"int64"
],
"type": "candidate"
}, {
"name": "custodians",
"index_type": "i64",
"key_names": [
"cust_name"
],
"key_types": [
"name"
],
"type": "custodian"
}, {
"name": "votes",
"index_type": "i64",
"key_names": [
"voter"
],
"key_types": [
"name"
],
"type": "vote"
}, {
"name": "pendingpay",
"index_type": "i64",
"key_names": [
"key"
],
"key_types": [
"name"
],
"type": "pay"
}, {
"name": "pendingstake",
"index_type": "i64",
"key_names": [
"sender"
],
"key_types": [
"name"
],
"type": "tempstake"
}, {
"name": "config",
"index_type": "i64",
"key_names": [
"config"
],
"key_types": [
"name"
],
"type": "updateconfig"
}, {
"name": "state",
"index_type": "i64",
"key_names": [
"state"
],
"key_types": [
"name"
],
"type": "contractstate"
}],
"ricardian_clauses": [{
"id": "entire_agreement",
"body": "## ENTIRE AGREEMENT.\nThis contract contains the entire agreement of the parties, for all described actions, and there are no other promises or conditions in any other agreement whether oral or written concerning the subject matter of this Contract. This contract supersedes any prior written or oral agreements between the parties. "
}, {
"id": "binding_constitution",
"body": "## BINDING CONSTITUTION:\nAll the the action descibed in this contract are subject to the EOSDAC consitution as held at http://eosdac.io . This includes, but is not limited to membership terms and condiutions, dispute resolution and severability."
}],
"error_messages": [],
"abi_extensions": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment