a few more

This commit is contained in:
Griff Green 2017-12-09 20:24:39 -05:00 committed by GitHub
parent a6adb37190
commit 88f563915a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 15 deletions

View File

@ -298,19 +298,19 @@ contract LiquidPledging is LiquidPledgingBase {
// efficient (saves gas) than calling these functions in series // efficient (saves gas) than calling these functions in series
/// Bit mask used for dividing pledge amounts in Multi pledge methods /// @dev Bitmask used for dividing pledge amounts in Multi pledge methods
uint constant D64 = 0x10000000000000000; uint constant D64 = 0x10000000000000000;
/// @notice `mTransfer` allows for multiple pledges to be transferred /// @notice Transfers multiple amounts within multiple Pledges in an
/// efficiently /// efficient single call
/// @param idSender ID of the giver, delegate or project admin that is /// @param idSender Id of the Admin that is transferring the amounts from
/// transferring the funds from Pledge to Pledge. This admin must have /// all the Pledges; this admin must have permissions to move the value
/// permissions to move the value /// @param pledgesAmounts An array of Pledge amounts and the idPledges with
/// @param pledgesAmounts An array of pledge amounts and IDs which are extrapolated /// which the amounts are associated; these are extrapolated using the D64
/// using the D64 bitmask /// bitmask
/// @param idReceiver Destination of the value, can be a giver sending /// @param idReceiver Destination of the `pledesAmounts`, can be a Giver or
/// to a giver or a delegate or a delegate to another delegate or a /// Project sending to a Giver, a Delegate or a Project; a Delegate sending
/// project to pre-commit it to that project /// to another Delegate, or a Delegate pre-commiting it to a Project
function mTransfer( function mTransfer(
uint64 idSender, uint64 idSender,
uint[] pledgesAmounts, uint[] pledgesAmounts,
@ -324,10 +324,11 @@ contract LiquidPledging is LiquidPledgingBase {
} }
} }
/// @notice `mWithdraw` allows for multiple pledges to be /// @notice Authorizes multiple amounts within multiple Pledges to be
/// withdrawn efficiently /// withdrawn from the `vault` in an efficient single call
/// @param pledgesAmounts An array of pledge amounts and IDs which are /// @param pledgesAmounts An array of Pledge amounts and the idPledges with
/// extrapolated using the D64 bitmask /// which the amounts are associated; these are extrapolated using the D64
/// bitmask
function mWithdraw(uint[] pledgesAmounts) { function mWithdraw(uint[] pledgesAmounts) {
for (uint i = 0; i < pledgesAmounts.length; i++ ) { for (uint i = 0; i < pledgesAmounts.length; i++ ) {
uint64 idPledge = uint64( pledgesAmounts[i] & (D64-1) ); uint64 idPledge = uint64( pledgesAmounts[i] & (D64-1) );