From a6adb37190aa789c21b7c014e89a6da238895889 Mon Sep 17 00:00:00 2001 From: Griff Green Date: Sat, 9 Dec 2017 18:24:47 -0500 Subject: [PATCH] A few more comments --- contracts/LiquidPledging.sol | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/contracts/LiquidPledging.sol b/contracts/LiquidPledging.sol index 53351bc..6d6045e 100644 --- a/contracts/LiquidPledging.sol +++ b/contracts/LiquidPledging.sol @@ -193,7 +193,7 @@ contract LiquidPledging is LiquidPledgingBase { /// @notice Authorizes a payment be made from the `vault` can be used by the /// Giver to veto a pre-committed donation from a Delegate to an /// intendedProject - /// @param idPledge Id of the pledge that wants to be withdrawn. + /// @param idPledge Id of the pledge that is to be redeemed into ether /// @param amount Quantity of ether (in wei) to be authorized function withdraw(uint64 idPledge, uint amount) { idPledge = normalizePledge(idPledge); // Updates pledge info @@ -216,9 +216,10 @@ contract LiquidPledging is LiquidPledgingBase { vault.authorizePayment(bytes32(idNewPledge), owner.addr, amount); } - /// @notice Method called by the vault to confirm a payment. - /// @param idPledge Id of the pledge that wants to be withdrawn. - /// @param amount Quantity of ether (in wei) to be withdrawn + /// @notice `onlyVault` Confirms a withdraw request changing the PledgeState + /// from Paying to Paid + /// @param idPledge Id of the pledge that is to be withdrawn + /// @param amount Quantity of ether (in wei) to be withdrawn function confirmPayment(uint64 idPledge, uint amount) onlyVault { Pledge storage p = findPledge(idPledge); @@ -236,9 +237,10 @@ contract LiquidPledging is LiquidPledgingBase { doTransfer(idPledge, idNewPledge, amount); } - /// @notice Method called by the vault to cancel a payment. - /// @param idPledge Id of the pledge that wants to be canceled for withdraw. - /// @param amount Quantity of ether (in wei) to be rolled back + /// @notice `onlyVault` Cancels a withdraw request, changing the PledgeState + /// from Paying back to Pledged + /// @param idPledge Id of the pledge that's withdraw is to be canceled + /// @param amount Quantity of ether (in wei) to be canceled function cancelPayment(uint64 idPledge, uint amount) onlyVault { Pledge storage p = findPledge(idPledge); @@ -259,8 +261,8 @@ contract LiquidPledging is LiquidPledgingBase { doTransfer(idPledge, oldPledge, amount); } - /// @notice Method called to cancel this project. - /// @param idProject Id of the projct that wants to be canceled. + /// @notice Changes the `project.canceled` flag to `true`; cannot be undone + /// @param idProject Id of the project that is to be canceled function cancelProject(uint64 idProject) { PledgeAdmin storage project = findAdmin(idProject); checkAdminOwner(project); @@ -269,9 +271,11 @@ contract LiquidPledging is LiquidPledgingBase { CancelProject(idProject); } - /// @notice Method called to cancel specific pledge. - /// @param idPledge Id of the pledge that should be canceled. - /// @param amount Quantity of Ether that wants to be rolled back. + /// @notice Transfers `amount` in `idPledge` back to the `oldPledge` that + /// that sent it there in the first place, a Ctrl-z + /// @param idPledge Id of the pledge that is to be canceled + /// @param amount Quantity of ether (in wei) to be transfered to the + /// `oldPledge` function cancelPledge(uint64 idPledge, uint amount) { idPledge = normalizePledge(idPledge);