From 2d78a1db2407d229a5b2ba33a1bffe884c2e404a Mon Sep 17 00:00:00 2001
From: Douglas Horn <37677685+DouglasHorn@users.noreply.github.com>
Date: Sun, 30 Oct 2022 02:20:29 -0700
Subject: [PATCH 1/4] Add abandon() function
---
contracts/works/src/works.cpp | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/contracts/works/src/works.cpp b/contracts/works/src/works.cpp
index 2c449d3..6e3ef9e 100644
--- a/contracts/works/src/works.cpp
+++ b/contracts/works/src/works.cpp
@@ -680,6 +680,20 @@ ACTION works::withdraw(name account_name, asset quantity) {
}
+ACTION works::abandon(name account_name, asset quantity) {
+
+ //authenticate
+ require_auth(account_name);
+
+ //validate
+ check(quantity.symbol == TLOS_SYM, "can only abandon TLOS");
+ check(quantity.amount > 0, "can only abandon a positive amount");
+
+ //subtract balance from account
+ sub_balance(account_name, quantity);
+
+}
+
ACTION works::deleteacct(name account_name) {
//authenticate
From 324d26f47ef468bace274770363e5a9ea1e37bf5 Mon Sep 17 00:00:00 2001
From: Douglas Horn <37677685+DouglasHorn@users.noreply.github.com>
Date: Sun, 30 Oct 2022 02:23:02 -0700
Subject: [PATCH 2/4] Update works.hpp
---
contracts/works/include/works.hpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/contracts/works/include/works.hpp b/contracts/works/include/works.hpp
index 1fb3642..e363d56 100644
--- a/contracts/works/include/works.hpp
+++ b/contracts/works/include/works.hpp
@@ -91,6 +91,9 @@ CONTRACT works : public contract {
//withdraw from account balance
ACTION withdraw(name account_name, asset quantity);
+
+ //abandon funds from account balance
+ ACTION abandon(name account_name, asset quantity);
//delete an account
ACTION deleteacct(name account_name);
From 937a72565c0772ff478593a38a53896e35206f95 Mon Sep 17 00:00:00 2001
From: Douglas Horn <37677685+DouglasHorn@users.noreply.github.com>
Date: Sun, 30 Oct 2022 02:28:06 -0700
Subject: [PATCH 3/4] Add Intent verbiage to human language contract
---
contracts/works/resources/works.clauses.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contracts/works/resources/works.clauses.md b/contracts/works/resources/works.clauses.md
index 765b23c..59eb08f 100644
--- a/contracts/works/resources/works.clauses.md
+++ b/contracts/works/resources/works.clauses.md
@@ -1,5 +1,5 @@
Intent
-The intention of the authors and invoker of this smart contract is to ...
+The intention of the authors and invoker of this smart contract is to interact with the Telos Works proposal system by creating, editing, deleting ballots and opening them for voting, voting on proposals, closing completed proposals, providing milestone reports, and claiming, withdrawing or abandoning funds from completed proposals.
Term
This Contract expires at the conclusion of code execution.
@@ -41,4 +41,4 @@ In any action arising hereunder or any separate action pertaining to the validit
The rule requiring construction or interpretation against the drafter is waived. The document shall be deemed as if it were drafted by both parties in a mutual effort."
In Witness Whereof
-IN WITNESS WHEREOF, the parties hereto have caused this Agreement to be executed by themselves or their duly authorized representatives as of the date of execution, and authorized as proven by the cryptographic signature on the transaction that invokes this contract.
\ No newline at end of file
+IN WITNESS WHEREOF, the parties hereto have caused this Agreement to be executed by themselves or their duly authorized representatives as of the date of execution, and authorized as proven by the cryptographic signature on the transaction that invokes this contract.
From fa62b7eb2a43d3678bb8a924813ffa8057b3ad6e Mon Sep 17 00:00:00 2001
From: Douglas Horn <37677685+DouglasHorn@users.noreply.github.com>
Date: Sun, 30 Oct 2022 03:00:31 -0700
Subject: [PATCH 4/4] Update works.contracts.md
---
contracts/works/resources/works.contracts.md | 166 +++++++++++++++----
1 file changed, 130 insertions(+), 36 deletions(-)
diff --git a/contracts/works/resources/works.contracts.md b/contracts/works/resources/works.contracts.md
index 6a2a94b..c6bea31 100644
--- a/contracts/works/resources/works.contracts.md
+++ b/contracts/works/resources/works.contracts.md
@@ -1,152 +1,246 @@
init
---
-spec_version: "0.2.0"
+spec_version: "0.2.1"
+
title: Initialize
-summary: 'Initialize Contract'
+
+summary: 'Initialize Contract: The intent of `init()` function is to set the initial values of parameters for the Telos Works contract.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
setversion
---
-spec_version: "0.2.0"
+spec_version: "0.2.1"
+
title: Set Version
-summary: 'Set Contract Version'
+
+summary: 'Set Contract Version: The intent of the `setversion()` function is to increase the version number of the contract to reflect unique code deployments.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
setadmin
---
-spec_version: "0.2.0"
+
+spec_version: "0.2.1"
+
title: Set Admin
-summary: 'Set Contract Admin'
+
+summary: 'Set Contract Admin: The intent of the `setadmin()` function is to change the contract address that has the rights to administer the Telos Works smart contract.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
setthresh
---
-spec_version: "0.2.0"
+
+spec_version: "0.2.1"
+
title: Set Thresholds
-summary: 'Set Contract Thresholds'
+
+summary: 'Set Contract Thresholds: The intent of the `setthresh()` function is to set the voting thresholds at which ballots shall pass or recieve their deposit back.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
draftprop
---
-spec_version: "0.2.0"
+
+spec_version: "0.2.1"
+
title: Draft Proposal
-summary: 'Draft New Telos Works Proposal'
+
+summary: 'Draft New Telos Works Proposal: The intent of the `draftprop()` function is to submit data for a new proposal prior to opening votin.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
launchprop
---
-spec_version: "0.2.0"
+
+spec_version: "0.2.1"
+
title: Launch Proposal
-summary: 'Launch Proposal'
+
+summary: 'Launch Proposal: The intent of the `launchprop()` function is to open a proposal for voting.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
cancelprop
---
-spec_version: "0.2.0"
+spec_version: "0.2.1"
+
title: Cancel Proposal
-summary: 'Cancel Telos Works Proposal'
+
+summary: 'Cancel Telos Works Proposal: The intent of the `cancelprop()` function is to cancel an existing proposal in whatever stage it may be. This includes proposals that have already been passed. This function will eliminate even a proposal that has passed so that funds will not be accessable.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
deleteprop
---
-spec_version: "0.2.0"
+
+spec_version: "0.2.1"
+
title: Delete Proposal
-summary: 'Delete Telos Works Proposal'
+
+summary: 'Delete Telos Works Proposal: The intent of the deleteprop()` function is to delete a proposal that is not active.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
addmilestone
---
-spec_version: "0.2.0"
+spec_version: "0.2.1"
+
title: Add Milestone
-summary: 'Add Milestone To Proposal'
+
+summary: 'Add Milestone To Proposal: The intent of the `addmilestone()` function is to add a new milestone to an existing proposal.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
rmvmilestone
---
-spec_version: "0.2.0"
+
+spec_version: "0.2.1"
+
title: Remove Milestone
-summary: 'Remove Milestone From Proposal'
+
+summary: 'Remove Milestone From Proposal: The intent of the `rmvmilestone()` function is to remove an existing milestone from a proposal.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
editms
---
-spec_version: "0.2.0"
+
+spec_version: "0.2.1"
+
title: Edit Milestone
-summary: 'Edit Milestone Reuested Funds'
+
+summary: 'Edit Milestone Reuested Funds: The intent of the `editms() function is to edit an existing milestone in a proposal.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
closems
---
-spec_version: "0.2.0"
+
+spec_version: "0.2.1"
+
title: Close Milestone
-summary: 'Close Milestone Voting'
+
+summary: 'Close Milestone Voting: The intent of the `closeme()` function is to finalize a milestone of a proposal following completion of voting. This means calculating all votes and whether the proposal passes both the required threshold and quorum rwquired for passage, and, optionally, broadcasting that result to be written on the blockchain.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
nextms
---
-spec_version: "0.2.0"
+
+spec_version: "0.2.1"
+
title: Start Next Milestone
-summary: 'Start Next Milestone Voting'
+
+summary: 'Start Next Milestone Voting: The intent of the `nextms()` function is to advance a proposal to its next milestone.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
submitreport
---
-spec_version: "0.2.0"
+
+spec_version: "0.2.1"
+
title: Submit Report
-summary: 'Submit Milestone Report'
+
+summary: 'Submit Milestone Report: The intent of the `submitreport() is to submit a report on the results of the most recent milestone., and to unlock claiming of any earned funds.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
claimfunds
---
-spec_version: "0.2.0"
+
+spec_version: "0.2.1"
+
title: Claim Funds
-summary: 'Claim Milestone Funds'
+
+summary: 'Claim Milestone Funds: The intent of the `claimfunds()` function is to transfer the designated amount of funds from the Telos Works contract to the recipient's account for the given proposal.'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
withdraw
---
-spec_version: "0.2.0"
-title: Withdraw
-summary: 'Withdraw Funds'
+
+spec_version: "0.2.1"
+
+title: Withdraw Funds
+
+summary: 'Withdraw Funds: The intent of the `withdraw()` function is to transfer the specified amount of the token asset to the designated account and to reduce the corresponding account's balance in the `accounts` table by the same amount.'
+
+icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
+---
+
+abandon
+
+---
+
+spec_version: "0.2.1"
+
+title: Abandon Funds
+
+summary: 'Abandon Funds: The intent of the `abandon()` function is to reduce the specified account's balance in the `accounts` table by the amount specified without transfering any funds'
+
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
+
---
deleteacct
---
-spec_version: "0.2.0"
+
+spec_version: "0.2.1"
+
title: Delete Account
-summary: 'Delete Telos Works Account'
+
+summary: 'Delete Telos Works Account: The intent of the `deleteact()` function is to remove an account with a zero balance from the `accounts` table.'
icon: https://github.com/Telos-Foundation/images/raw/master/ricardian_assets/eosio.contracts/icons/account.png#3d55a2fc3a5c20b456f5657faf666bc25ffd06f4836c5e8256f741149b0b294f
----
\ No newline at end of file
+
+---