diff --git a/build/ILiquidPledgingPlugin.sol.js b/build/ILiquidPledgingPlugin.sol.js index a11422b..8a62d78 100644 --- a/build/ILiquidPledgingPlugin.sol.js +++ b/build/ILiquidPledgingPlugin.sol.js @@ -1,6 +1,7 @@ /* This is an autogenerated file. DO NOT EDIT MANUALLY */ -exports.ILiquidPledgingPluginAbi = [{"constant":false,"inputs":[{"name":"pledgeManager","type":"uint64"},{"name":"pledgeFrom","type":"uint64"},{"name":"pledgeTo","type":"uint64"},{"name":"context","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"afterTransfer","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"pledgeManager","type":"uint64"},{"name":"pledgeFrom","type":"uint64"},{"name":"pledgeTo","type":"uint64"},{"name":"context","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"beforeTransfer","outputs":[{"name":"maxAllowed","type":"uint256"}],"payable":false,"type":"function"}] +exports.ILiquidPledgingPluginAbi = [{"constant":false,"inputs":[{"name":"pledgeManager","type":"uint64"},{"name":"pledgeFrom","type":"uint64"},{"name":"pledgeTo","type":"uint64"},{"name":"context","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"afterTransfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pledgeManager","type":"uint64"},{"name":"pledgeFrom","type":"uint64"},{"name":"pledgeTo","type":"uint64"},{"name":"context","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"beforeTransfer","outputs":[{"name":"maxAllowed","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}] exports.ILiquidPledgingPluginByteCode = "0x" -exports._solcVersion = "0.4.15+commit.bbb8e64f.Emscripten.clang" -exports._sha256 = "0xdca1f6e8e45033d2b165904df14f39c39500c42395eabcc79e156346438f3259" +exports.ILiquidPledgingPluginRuntimeByteCode = "0x" +exports._solcVersion = "0.4.18+commit.9cf6e910.Emscripten.clang" +exports._sha256 = "0xe5a08624c7acbeabf9625727855abbfade7e864b099c1402d6eb40ca15e4fc5f" diff --git a/build/ILiquidPledgingPlugin_all.sol b/build/ILiquidPledgingPlugin_all.sol index 3b7e74c..9d20f00 100644 --- a/build/ILiquidPledgingPlugin_all.sol +++ b/build/ILiquidPledgingPlugin_all.sol @@ -2,10 +2,36 @@ //File: ./contracts/ILiquidPledgingPlugin.sol pragma solidity ^0.4.11; +/* + Copyright 2017, Jordi Baylina + Contributor: AdriĆ  Massanet + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +/// @dev `ILiquidPledgingPlugin` is the basic interface for any +/// liquid pledging plugin contract ILiquidPledgingPlugin { + /// @notice Plugins are used (much like web hooks) to initiate an action /// upon any donation, delegation, or transfer; this is an optional feature - /// and allows for extreme customization of the contract + /// and allows for extreme customization of the contract. This function + /// implements any action that should be initiated before a transfer. + /// @param pledgeManager The admin or current manager of the pledge + /// @param pledgeFrom This is the Id from which value will be transfered. + /// @param pledgeTo This is the Id that value will be transfered to. /// @param context The situation that is triggering the plugin: /// 0 -> Plugin for the owner transferring pledge to another party /// 1 -> Plugin for the first delegate transferring pledge to another party @@ -18,17 +44,39 @@ contract ILiquidPledgingPlugin { /// 258 -> Plugin for the second delegate receiving pledge to another party /// ... /// 511 -> Plugin for the intendedProject receiving pledge to another party + /// @param amount The amount of value that will be transfered. function beforeTransfer( uint64 pledgeManager, uint64 pledgeFrom, uint64 pledgeTo, uint64 context, - uint amount - ) returns (uint maxAllowed); + uint amount ) returns (uint maxAllowed); + + /// @notice Plugins are used (much like web hooks) to initiate an action + /// upon any donation, delegation, or transfer; this is an optional feature + /// and allows for extreme customization of the contract. This function + /// implements any action that should be initiated after a transfer. + /// @param pledgeManager The admin or current manager of the pledge + /// @param pledgeFrom This is the Id from which value will be transfered. + /// @param pledgeTo This is the Id that value will be transfered to. + /// @param context The situation that is triggering the plugin: + /// 0 -> Plugin for the owner transferring pledge to another party + /// 1 -> Plugin for the first delegate transferring pledge to another party + /// 2 -> Plugin for the second delegate transferring pledge to another party + /// ... + /// 255 -> Plugin for the intendedProject transferring pledge to another party + /// + /// 256 -> Plugin for the owner receiving pledge to another party + /// 257 -> Plugin for the first delegate receiving pledge to another party + /// 258 -> Plugin for the second delegate receiving pledge to another party + /// ... + /// 511 -> Plugin for the intendedProject receiving pledge to another party + /// @param amount The amount of value that will be transfered. function afterTransfer( uint64 pledgeManager, uint64 pledgeFrom, uint64 pledgeTo, uint64 context, - uint amount); + uint amount + ); } diff --git a/build/LiquidPledging.sol.js b/build/LiquidPledging.sol.js index 5717cff..0b5931a 100644 --- a/build/LiquidPledging.sol.js +++ b/build/LiquidPledging.sol.js @@ -1,12 +1,16 @@ /* This is an autogenerated file. DO NOT EDIT MANUALLY */ -exports.ILiquidPledgingPluginAbi = [{"constant":false,"inputs":[{"name":"pledgeManager","type":"uint64"},{"name":"pledgeFrom","type":"uint64"},{"name":"pledgeTo","type":"uint64"},{"name":"context","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"afterTransfer","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"pledgeManager","type":"uint64"},{"name":"pledgeFrom","type":"uint64"},{"name":"pledgeTo","type":"uint64"},{"name":"context","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"beforeTransfer","outputs":[{"name":"maxAllowed","type":"uint256"}],"payable":false,"type":"function"}] +exports.ILiquidPledgingPluginAbi = [{"constant":false,"inputs":[{"name":"pledgeManager","type":"uint64"},{"name":"pledgeFrom","type":"uint64"},{"name":"pledgeTo","type":"uint64"},{"name":"context","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"afterTransfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pledgeManager","type":"uint64"},{"name":"pledgeFrom","type":"uint64"},{"name":"pledgeTo","type":"uint64"},{"name":"context","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"beforeTransfer","outputs":[{"name":"maxAllowed","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}] exports.ILiquidPledgingPluginByteCode = "0x" -exports.LiquidPledgingAbi = [{"constant":true,"inputs":[{"name":"idPledge","type":"uint64"},{"name":"idxDelegate","type":"uint256"}],"name":"getPledgeDelegate","outputs":[{"name":"idDelegate","type":"uint64"},{"name":"addr","type":"address"},{"name":"name","type":"string"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"projectId","type":"uint64"}],"name":"isProjectCanceled","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"numberOfPledges","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idPledge","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"confirmPayment","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"idPledge","type":"uint64"}],"name":"getPledge","outputs":[{"name":"amount","type":"uint256"},{"name":"owner","type":"uint64"},{"name":"nDelegates","type":"uint64"},{"name":"intendedProject","type":"uint64"},{"name":"commitTime","type":"uint64"},{"name":"oldPledge","type":"uint64"},{"name":"paymentState","type":"uint8"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idPledge","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idSender","type":"uint64"},{"name":"idPledge","type":"uint64"},{"name":"amount","type":"uint256"},{"name":"idReceiver","type":"uint64"}],"name":"transfer","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idPledge","type":"uint64"}],"name":"normalizePledge","outputs":[{"name":"","type":"uint64"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addDelegate","outputs":[{"name":"idDelegate","type":"uint64"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"numberOfPledgeAdmins","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"pledgesAmounts","type":"uint256[]"}],"name":"mWithdraw","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"projectAdmin","type":"address"},{"name":"parentProject","type":"uint64"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addProject","outputs":[{"name":"idProject","type":"uint64"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idProject","type":"uint64"}],"name":"cancelProject","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addGiver","outputs":[{"name":"idGiver","type":"uint64"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"pledgesAmounts","type":"uint256[]"}],"name":"mConfirmPayment","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idPledge","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"cancelPledge","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"pledges","type":"uint256[]"}],"name":"mNormalizePledge","outputs":[{"name":"","type":"uint64"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idGiver","type":"uint64"},{"name":"idReceiver","type":"uint64"}],"name":"donate","outputs":[],"payable":true,"type":"function"},{"constant":false,"inputs":[{"name":"idDelegate","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateDelegate","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idSender","type":"uint64"},{"name":"pledgesAmounts","type":"uint256[]"},{"name":"idReceiver","type":"uint64"}],"name":"mTransfer","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idGiver","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateGiver","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idPledge","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"cancelPayment","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"idAdmin","type":"uint64"}],"name":"getPledgeAdmin","outputs":[{"name":"adminType","type":"uint8"},{"name":"addr","type":"address"},{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"parentProject","type":"uint64"},{"name":"canceled","type":"bool"},{"name":"plugin","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"pledgesAmounts","type":"uint256[]"}],"name":"mCancelPayment","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idProject","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateProject","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"vault","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"inputs":[{"name":"_vault","type":"address"}],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"uint64"},{"indexed":true,"name":"to","type":"uint64"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idProject","type":"uint64"}],"name":"CancelProject","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idGiver","type":"uint64"}],"name":"GiverAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idGiver","type":"uint64"}],"name":"GiverUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idDelegate","type":"uint64"}],"name":"DelegateAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idDelegate","type":"uint64"}],"name":"DelegateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idProject","type":"uint64"}],"name":"ProjectAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idAdmin","type":"uint64"}],"name":"ProjectUpdated","type":"event"}] -exports.LiquidPledgingByteCode = "0x606060405234156200001057600080fd5b60405160208062004f6b833981016040528080519150505b805b60016200003881806200006e565b50600162000048600082620000a3565b5060028054600160a060020a031916600160a060020a0383161790555b505b5062000259565b8154818355818115116200009d576005028160050283600052602060002091820191016200009d9190620000d8565b5b505050565b8154818355818115116200009d576004028160040283600052602060002091820191016200009d91906200014c565b5b505050565b6200014991905b8082111562000145578054600160a860020a03191681556000620001076001830182620001be565b62000117600283016000620001be565b506003810180546001608860020a0319169055600481018054600160a060020a0319169055600501620000df565b5090565b90565b6200014991905b808211156200014557600080825560018201805467ffffffffffffffff191690556200018360028301826200020a565b506003810180547fffffffffffffff0000000000000000000000000000000000000000000000000016905560040162000153565b5090565b90565b50805460018160011615610100020316600290046000825580601f10620001e6575062000206565b601f01602090049060005260206000209081019062000206919062000235565b5b50565b50805460008255600301600490049060005260206000209081019062000206919062000235565b5b50565b6200014991905b808211156200014557600081556001016200023c565b5090565b90565b614d0280620002696000396000f300606060405236156101385763ffffffff60e060020a60003504166314e7b1dc811461013d5780632101a6ad146101f75780632a8ec8cc1461022a5780632ee888081461024f5780633f657a461461027357806343387983146102f157806347c5ef431461031557806350f8a8031461034657806352dc7dcc146103815780635503d9ba1461044957806357adafb61461046e57806372116e92146104bf578063796d5654146105975780637f61fa93146105b85780639398f5a214610680578063af9f4563146106d1578063bce0906d146106f5578063bde60ac914610760578063cc19ecf71461077c578063d639cd7314610839578063db7c2314146108a3578063e9c211e214610960578063eba8ba0614610984578063ef3766e414610adc578063f6b24b1c14610b2d578063fbfa77cf14610bea575b600080fd5b341561014857600080fd5b61015f6001604060020a0360043516602435610c19565b6040516001604060020a0384168152600160a060020a038316602082015260606040820181815290820183818151815260200191508051906020019080838360005b838110156101ba5780820151818401525b6020016101a1565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b341561020257600080fd5b6102166001604060020a0360043516610d40565b604051901515815260200160405180910390f35b341561023557600080fd5b61023d610df2565b60405190815260200160405180910390f35b341561025a57600080fd5b6102716001604060020a0360043516602435610dfd565b005b341561027e57600080fd5b6102926001604060020a0360043516610f43565b6040518781526001604060020a038088166020830152868116604083015285811660608301528481166080830152831660a082015260c081018260028111156102d757fe5b60ff16815260200197505050505050505060405180910390f35b34156102fc57600080fd5b6102716001604060020a0360043516602435610fb0565b005b341561032057600080fd5b6102716001604060020a036004358116906024358116906044359060643516611355565b005b341561035157600080fd5b6103656001604060020a0360043516611a12565b6040516001604060020a03909116815260200160405180910390f35b341561038c57600080fd5b61036560046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505083356001604060020a03169360200135600160a060020a03169250611bde915050565b6040516001604060020a03909116815260200160405180910390f35b341561045457600080fd5b61023d611dcf565b60405190815260200160405180910390f35b341561047957600080fd5b6102716004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650611dda95505050505050565b005b34156104ca57600080fd5b61036560046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965050600160a060020a0385358116956001604060020a03602082013581169650604082013516945060600135169150611e4d9050565b6040516001604060020a03909116815260200160405180910390f35b34156105a257600080fd5b6102716001604060020a036004351661227d565b005b34156105c357600080fd5b61036560046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505083356001604060020a03169360200135600160a060020a031692506124da915050565b6040516001604060020a03909116815260200160405180910390f35b341561068b57600080fd5b61027160046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506126ca95505050505050565b005b34156106dc57600080fd5b6102716001604060020a036004351660243561273d565b005b341561070057600080fd5b610365600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061298b95505050505050565b6040516001604060020a03909116815260200160405180910390f35b6102716001604060020a03600435811690602435166129d8565b005b341561078757600080fd5b610271600480356001604060020a03169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505092356001604060020a03169250612d13915050565b005b341561084457600080fd5b610271600480356001604060020a0316906044602480359081019083013580602080820201604051908101604052809392919081815260200183836020028082843750949650505092356001604060020a03169250612e00915050565b005b34156108ae57600080fd5b610271600480356001604060020a03169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505092356001604060020a03169250612e77915050565b005b341561096b57600080fd5b6102716001604060020a0360043516602435612f64565b005b341561098f57600080fd5b6109a36001604060020a036004351661308e565b604051808960028111156109b357fe5b60ff168152600160a060020a0389811660208301526001604060020a038781166080840152861660a083015284151560c0830152831660e08201526101008282038101604083019081529160608101910189818151815260200191508051906020019080838360005b83811015610a355780820151818401525b602001610a1c565b50505050905090810190601f168015610a625780820380516001836020036101000a031916815260200191505b50838103825288818151815260200191508051906020019080838360005b83811015610a995780820151818401525b602001610a80565b50505050905090810190601f168015610ac65780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b3415610ae757600080fd5b610271600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061325495505050505050565b005b3415610b3857600080fd5b610271600480356001604060020a03169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505092356001604060020a031692506132c7915050565b005b3415610bf557600080fd5b610bfd6133b4565b604051600160a060020a03909116815260200160405180910390f35b600080610c246148e1565b600080610c30876133c3565b91508160020160018703815481101515610c4657fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a03169450610c7b8561340c565b90508060000160019054906101000a9004600160a060020a03169350806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d2f5780601f10610d0457610100808354040283529160200191610d2f565b820191906000526020600020905b815481529060010190602001808311610d1257829003601f168201915b505050505092505b50509250925092565b600080610d4c8361340c565b905060005b815460ff166002811115610d6157fe5b1415610d705760009150610dec565b60025b815460ff166002811115610d8357fe5b14610d8a57fe5b6003810154608060020a900460ff1615610da75760019150610dec565b6003810154604060020a90046001604060020a03161515610dcb5760009150610dec565b6003810154610de990604060020a90046001604060020a0316610d40565b91505b50919050565b600054600019015b90565b600254600090819033600160a060020a03908116911614610e1d57600080fd5b610e26846133c3565b915060015b600383015460c060020a900460ff166002811115610e4557fe5b14610e4f57600080fd5b836001604060020a0316610e6285613457565b6001604060020a031614610e7557600080fd5b6001820154600283018054610f2e926001604060020a03169190602080820201604051908101604052809291908181526020018280548015610f0857602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a031681526020019060080190602082600701049283019260010382029150808411610ec55790505b505050506003860154600091508190608060020a90046001604060020a03166002613521565b9050610f3b848285613813565b5b5b50505050565b600080600080600080600080610f58896133c3565b8054600182015460028301546003840154929b506001604060020a039182169a5098508082169750604060020a820481169650608060020a820416945060c060020a900460ff16925090505b50919395979092949650565b6000806000610fbe85611a12565b9450610fc9856133c3565b925060005b600384015460c060020a900460ff166002811115610fe857fe5b14610ff257600080fd5b6001830154611009906001604060020a031661340c565b91506111fe826101006040519081016040528154909190829060ff16600281111561103057fe5b600281111561103b57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111075780601f106110dc57610100808354040283529160200191611107565b820191906000526020600020905b8154815290600101906020018083116110ea57829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111a95780601f1061117e576101008083540402835291602001916111a9565b820191906000526020600020905b81548152906001019060200180831161118c57829003601f168201915b505050918352505060038201546001604060020a038082166020840152604060020a8204166040830152608060020a900460ff1615156060820152600490910154600160a060020a03166080909101526138dd565b60018301546002840180546112b7926001604060020a0316919060208082020160405190810160405280929190818152602001828054801561129157602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a03168152602001906008019060208260070104928301926001038202915080841161124e5790505b505050506003870154600091508190608060020a90046001604060020a03166001613521565b90506112c4858286613813565b6002548254600160a060020a039182169163bb4f28df916001604060020a03851691610100909104168760405160e060020a63ffffffff86160281526004810193909352600160a060020a0390911660248301526044820152606401600060405180830381600087803b151561133957600080fd5b6102c65a03f1151561134a57600080fd5b5050505b5050505050565b600080600080600061136688611a12565b9750611371886133c3565b945061137c8661340c565b93506113878961340c565b925061157c836101006040519081016040528154909190829060ff16600281111561103057fe5b600281111561103b57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111075780601f106110dc57610100808354040283529160200191611107565b820191906000526020600020905b8154815290600101906020018083116110ea57829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111a95780601f1061117e576101008083540402835291602001916111a9565b820191906000526020600020905b81548152906001019060200180831161118c57829003601f168201915b505050918352505060038201546001604060020a038082166020840152604060020a8204166040830152608060020a900460ff1615156060820152600490910154600160a060020a03166080909101526138dd565b60005b600386015460c060020a900460ff16600281111561159957fe5b146115a357600080fd5b60018501546001604060020a038a8116911614156116545760005b845460ff1660028111156115ce57fe5b14156115e4576115df888888613925565b61164c565b60025b845460ff1660028111156115f757fe5b141561160d576115df88888861396b565b61164c565b60015b845460ff16600281111561162057fe5b141561164a5761163888888760020180549050613bca565b97506115df888888613cd6565b61164c565bfe5b5b5b5b611a06565b6117858560e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a031681526020016002820180548060200260200160405190810160405280929190818152602001828054801561171e57602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116116db5790505b505050918352505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff16600281111561177157fe5b600281111561177c57fe5b9052508a613e0a565b6001604060020a039081169250821461164a5760005b845460ff1660028111156117ab57fe5b14156117e25760018501546001604060020a038781169116146117ca57fe5b6117dc88888760020180549050613bca565b50611a06565b60015b845460ff1660028111156117f557fe5b14156119c15761192c8560e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a03168152602001600282018054806020026020016040519081016040528092919081815260200182805480156118c557602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116118825790505b505050918352505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff16600281111561191857fe5b600281111561192357fe5b90525087613e0a565b6001604060020a03908116915081141561196957611638888860018589600201805490500303613bca565b97506115df888888613cd6565b61164c565b8181111561199a57611638888860018589600201805490500303613bca565b97506115df888888613cd6565b61164c565b81811161164c576117dc888860018489600201805490500303613bca565b505b5b5b611a06565b60025b845460ff1660028111156119d457fe5b141561164a576119f1888860018589600201805490500303613bca565b975061164c888888613e71565b611a06565b5bfe5b5b505050505050505050565b600080600080611a21856133c3565b925060005b600384015460c060020a900460ff166002811115611a4057fe5b14611a4d57849350611bd6565b600383015460006001604060020a03909116118015611a8657506003830154604060020a90046001604060020a0316611a846141d3565b115b15611ba4576001830154600284018054611b43926001604060020a03169190602080820201604051908101604052809291908181526020018280548015611b1e57602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a031681526020019060080190602082600701049283019260010382029150808411611adb5790505b505050506003870154600091508190608060020a90046001604060020a031681613521565b6003840154909250611b84906001604060020a03166000604051805910611b675750595b908082528060200260200182016040525b50600080866000613521565b9050611b9585828560000154613813565b809450611ba1856133c3565b92505b611bad85613457565b90506001604060020a0380821690861614611bd157611bd185828560000154613813565b5b8093505b505050919050565b600180549081808201611bf183826148f3565b916000526020600020906005020160005b6101006040519081016040528060015b8152600160a060020a033381166020830152604082018b9052606082018a90526001604060020a0389166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff19166001836002811115611c7257fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051611cb8929160200190614925565b50606082015181600201908051611cd3929160200190614925565b50608082015160038201805467ffffffffffffffff19166001604060020a039290921691909117905560a08201518160030160086101000a8154816001604060020a0302191690836001604060020a0316021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905550506001604060020a0381167f014882843f1e57bd41e0826ad1cd5e6180d4d4f76df8b12edc8b44575322d94e60405160405180910390a25b949350505050565b600154600019015b90565b600080805b8351831015610f3b576001604060020a03848481518110611dfc57fe5b90602001906020020151169150604060020a848481518110611e1a57fe5b90602001906020020151811515611e2d57fe5b049050611e3a8282610fb0565b5b600190920191611ddf565b5b50505050565b6000806001604060020a0385161561208657611e688561340c565b905060025b815460ff166002811115611e7d57fe5b14611e8757600080fd5b601461207c826101006040519081016040528154909190829060ff166002811115611eae57fe5b6002811115611eb957fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611f855780601f10611f5a57610100808354040283529160200191611f85565b820191906000526020600020905b815481529060010190602001808311611f6857829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120275780601f10611ffc57610100808354040283529160200191612027565b820191906000526020600020905b81548152906001019060200180831161200a57829003601f168201915b505050918352505060038201546001604060020a038082166020840152604060020a8204166040830152608060020a900460ff1615156060820152600490910154600160a060020a03166080909101526141d8565b1061208657600080fd5b5b6001805492508280820161209b83826148f3565b916000526020600020906005020160005b6101006040519081016040528060025b8152600160a060020a03808c166020830152604082018e9052606082018d90526001604060020a03808b1660808401528b1660a0830152600060c0830152881660e09091015291905081518154829060ff1916600183600281111561211d57fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051612163929160200190614925565b5060608201518160020190805161217e929160200190614925565b50608082015160038201805467ffffffffffffffff19166001604060020a039290921691909117905560a08201518160030160086101000a8154816001604060020a0302191690836001604060020a0316021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905550506001604060020a0382167fd7db7003e8f35149eda3d3685c2ab151ee561ad34853fdb0f4d7ecb33fff889060405160405180910390a25b509695505050505050565b60006122888261340c565b905061247d816101006040519081016040528154909190829060ff16600281111561103057fe5b600281111561103b57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111075780601f106110dc57610100808354040283529160200191611107565b820191906000526020600020905b8154815290600101906020018083116110ea57829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111a95780601f1061117e576101008083540402835291602001916111a9565b820191906000526020600020905b81548152906001019060200180831161118c57829003601f168201915b505050918352505060038201546001604060020a038082166020840152604060020a8204166040830152608060020a900460ff1615156060820152600490910154600160a060020a03166080909101526138dd565b60038101805470ff000000000000000000000000000000001916608060020a1790556001604060020a0382167f2d65c225503bd4cd245a36c8030073ddd0fb02c23ce540fcd901e74e5006687c60405160405180910390a25b5050565b6001805490818082016124ed83826148f3565b916000526020600020906005020160005b6101006040519081016040528060005b8152600160a060020a033381166020830152604082018b9052606082018a90526001604060020a0389166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff1916600183600281111561256e57fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a03199091161781556040820151816001019080516125b4929160200190614925565b506060820151816002019080516125cf929160200190614925565b50608082015160038201805467ffffffffffffffff19166001604060020a039290921691909117905560a08201518160030160086101000a8154816001604060020a0302191690836001604060020a0316021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905550506001604060020a0381167efc763def3c85dbc7bab43e314ba21264ec158217c45cf1eaf94f5ae15bc2c560405160405180910390a25b949350505050565b600080805b8351831015610f3b576001604060020a038484815181106126ec57fe5b90602001906020020151169150604060020a84848151811061270a57fe5b9060200190602002015181151561271d57fe5b04905061272a8282610dfd565b5b6001909201916126cf565b5b50505050565b60008061274984611a12565b9350612754846133c3565b600181015490925061276e906001604060020a031661340c565b9050612963816101006040519081016040528154909190829060ff16600281111561103057fe5b600281111561103b57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111075780601f106110dc57610100808354040283529160200191611107565b820191906000526020600020905b8154815290600101906020018083116110ea57829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111a95780601f1061117e576101008083540402835291602001916111a9565b820191906000526020600020905b81548152906001019060200180831161118c57829003601f168201915b505050918352505060038201546001604060020a038082166020840152604060020a8204166040830152608060020a900460ff1615156060820152600490910154600160a060020a03166080909101526138dd565b6003820154610f3b908590608060020a90046001604060020a031685613813565b5b50505050565b600080805b83518210156129d0576001604060020a038483815181106129ad57fe5b906020019060200201511690506129c381611a12565b505b600190910190612990565b5b5050919050565b60008080806001604060020a0386161515612a1e57612a1b6020604051908101604052806000815250602060405190810160405260008082526203f480906124da565b95505b612a278661340c565b9350612c1c846101006040519081016040528154909190829060ff16600281111561103057fe5b600281111561103b57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111075780601f106110dc57610100808354040283529160200191611107565b820191906000526020600020905b8154815290600101906020018083116110ea57829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111a95780601f1061117e576101008083540402835291602001916111a9565b820191906000526020600020905b81548152906001019060200180831161118c57829003601f168201915b505050918352505060038201546001604060020a038082166020840152604060020a8204166040830152608060020a900460ff1615156060820152600490910154600160a060020a03166080909101526138dd565b60005b845460ff166002811115612c2f57fe5b14612c3957600080fd5b34925060008311612c4957600080fd5b600254600160a060020a031683156108fc0284604051600060405180830381858888f193505050501515612c7c57600080fd5b612cac866000604051805910612c8f5750595b908082528060200260200182016040525b50600080600080613521565b9150612cb7826133c3565b80548401815590506001604060020a03821660007feef5653f9c567b23a97bcfb111bfa6b076a95be73d85d161b4c57149c77b48018560405190815260200160405180910390a3612d0a86838588611355565b5b505050505050565b6000612d1e8661340c565b905060015b815460ff166002811115612d3357fe5b14612d3d57600080fd5b805433600160a060020a039081166101009092041614612d5c57600080fd5b805461010060a860020a031916610100600160a060020a0387160217815560018101848051612d8f929160200190614925565b5060028101838051612da5929160200190614925565b5060038101805467ffffffffffffffff19166001604060020a038481169190911790915586167f01a3bd608e7be74358498f90bd2ff305f9fdb8e94d76167f40fef03aae56620360405160405180910390a25b505050505050565b600080805b8451831015612d0a576001604060020a03858481518110612e2257fe5b90602001906020020151169150604060020a858481518110612e4057fe5b90602001906020020151811515612e5357fe5b049050612e6286838387611355565b5b600190920191612e05565b5b505050505050565b6000612e828661340c565b905060005b815460ff166002811115612e9757fe5b14612ea157600080fd5b805433600160a060020a039081166101009092041614612ec057600080fd5b805461010060a860020a031916610100600160a060020a0387160217815560018101848051612ef3929160200190614925565b5060028101838051612f09929160200190614925565b5060038101805467ffffffffffffffff19166001604060020a038481169190911790915586167fe8da06f5d4d8fa2ef122c9fc3d5ae15379d95f5b9ebf92a5821b57705600320a60405160405180910390a25b505050505050565b600254600090819033600160a060020a03908116911614612f8457600080fd5b612f8d846133c3565b915060015b600383015460c060020a900460ff166002811115612fac57fe5b14612fb657600080fd5b600182015460028301805461306e926001604060020a0316919060208082020160405190810160405280929190818152602001828054801561304957602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116130065790505b505050506003860154600091508190608060020a90046001604060020a031681613521565b9050610f2e81611a12565b9050610f3b848285613813565b5b5b50505050565b6000806130996148e1565b6130a16148e1565b60008060008060006130b28a61340c565b80546001808301805460ff84169d5061010093849004600160a060020a03169c509394509260029181161590920260001901909116046020601f820181900481020160405190810160405280929190818152602001828054600181600116156101000203166002900480156131685780601f1061313d57610100808354040283529160200191613168565b820191906000526020600020905b81548152906001019060200180831161314b57829003601f168201915b50505050509650806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156132075780601f106131dc57610100808354040283529160200191613207565b820191906000526020600020905b8154815290600101906020018083116131ea57829003601f168201915b50505050600383015460048401549298506001604060020a038082169850604060020a8204169650608060020a900460ff16945050600160a060020a031691505b50919395975091939597565b600080805b8351831015610f3b576001604060020a0384848151811061327657fe5b90602001906020020151169150604060020a84848151811061329457fe5b906020019060200201518115156132a757fe5b0490506132b48282612f64565b5b600190920191613259565b5b50505050565b60006132d28661340c565b905060025b815460ff1660028111156132e757fe5b146132f157600080fd5b805433600160a060020a03908116610100909204161461331057600080fd5b805461010060a860020a031916610100600160a060020a0387160217815560018101848051613343929160200190614925565b5060028101838051613359929160200190614925565b5060038101805467ffffffffffffffff19166001604060020a038481169190911790915586167f035196d5942819024277421e936a2e76840abb7bb5a320924ce0a9826daeba4460405160405180910390a25b505050505050565b600254600160a060020a031681565b600080546001604060020a038316106133db57600080fd5b600080546001604060020a0384169081106133f257fe5b906000526020600020906004020160005b5090505b919050565b6001546000906001604060020a0383161061342657600080fd5b600180546001604060020a03841690811061343d57fe5b906000526020600020906005020160005b5090505b919050565b600080806001604060020a038416151561347457600092506129d0565b61347d846133c3565b6001810154909250613497906001604060020a031661340c565b905060005b815460ff1660028111156134ac57fe5b14156134ba578392506129d0565b60025b815460ff1660028111156134cd57fe5b146134d457fe5b60018201546134eb906001604060020a0316610d40565b15156134f9578392506129d0565b600382015461351790608060020a90046001604060020a0316613457565b92505b5050919050565b600080600088888888888860405160c060020a6001604060020a03881602815260088101868051906020019060200280838360005b8381101561356f5780820151818401525b602001613556565b50505050905001856001604060020a03166001604060020a031660c060020a028152600801846001604060020a03166001604060020a031660c060020a028152600801836001604060020a03166001604060020a031660c060020a0281526008018260028111156135dc57fe5b60ff167f010000000000000000000000000000000000000000000000000000000000000002815260010196505050505050506040519081900390206000818152600360205260408120549193506001604060020a03909116915081111561364557809250613807565b5060008054828252600360205260408220805467ffffffffffffffff19166001604060020a0383161790558154909190600181016136838382614a23565b916000526020600020906004020160005b60e060405190810160405280600081526020018d6001604060020a031681526020018c81526020018b6001604060020a031681526020018a6001604060020a03168152602001896001604060020a031681526020018860028111156136f557fe5b905291905081518155602082015160018201805467ffffffffffffffff19166001604060020a0392909216919091179055604082015181600201908051613740929160200190614a55565b50606082015160038201805467ffffffffffffffff19166001604060020a039290921691909117905560808201518160030160086101000a8154816001604060020a0302191690836001604060020a0316021790555060a08201518160030160106101000a8154816001604060020a0302191690836001604060020a0316021790555060c082015160038201805478ff000000000000000000000000000000000000000000000000191660c060020a8360028111156137fb57fe5b02179055505050508092505b50509695505050505050565b6000806000613825600187878761441a565b9250846001604060020a0316866001604060020a0316141561384657612d0a565b82151561385257612d0a565b61385b866133c3565b9150613866856133c3565b82549091508390101561387857600080fd5b815483900382558054830181556001604060020a038086169087167feef5653f9c567b23a97bcfb111bfa6b076a95be73d85d161b4c57149c77b48018560405190815260200160405180910390a36138d3600087878661441a565b505b505050505050565b8060200151600160a060020a031633600160a060020a0316148061391657508060e00151600160a060020a031633600160a060020a0316145b151561392157600080fd5b5b50565b6000610f2e826000604051805910612c8f5750595b908082528060200260200182016040525b50600080600080613521565b9050610f3b848285613813565b5b50505050565b6000806000613979866133c3565b92506014613aad8460e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a0316815260200160028201805480602002602001604051908101604052809291908181526020018280548015613a4757602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a031681526020019060080190602082600701049283019260010382029150808411613a045790505b505050918352505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff166002811115613a9a57fe5b6002811115613aa557fe5b905250614442565b10613ab757600080fd5b613ac084610d40565b15613aca57600080fd5b6001830154600284018054613b82926001604060020a03169190602080820201604051908101604052809291908181526020018280548015611b1e57602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a031681526020019060080190602082600701049283019260010382029150808411611adb5790505b505050506003870154600091508190608060020a90046001604060020a031681613521565b9150613bb4846000604051805910611b675750595b908082528060200260200182016040525b50600080866000613521565b9050612d0a868287613813565b5b505050505050565b600080613bd56148e1565b600080613be1886133c3565b6002810154909450869003604051805910613bf95750595b908082528060200260200182016040525b509250600091505b6002840154869003821015613c8a5760028401805483908110613c3157fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a0316838381518110613c6757fe5b6001604060020a039092166020928302909101909101525b600190910190613c12565b60018401546003850154613cba916001604060020a039081169186916000918291608060020a9091041681613521565b9050613cc7888289613813565b8094505b505050509392505050565b6000613ce06148e1565b600080613cec876133c3565b600281015490945060149010613d0157600080fd5b6002840154600101604051805910613d165750595b908082528060200260200182016040525b509250600091505b6002840154821015613da45760028401805483908110613d4b57fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a0316838381518110613d8157fe5b6001604060020a039092166020928302909101909101525b600190910190613d2f565b60028401548590849081518110613db757fe5b6001604060020a039283166020918202909201015260018501546003860154613df3929182169186916000918291608060020a90041681613521565b90506138d3878288613813565b5b50505050505050565b6000805b836040015151811015613e5f57826001604060020a031684604001518281518110613e3557fe5b906020019060200201516001604060020a03161415613e5657809150613e6a565b5b600101613e0e565b6001604060020a0391505b5092915050565b600080613e7d856133c3565b91506014613fb18360e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a0316815260200160028201805480602002602001604051908101604052809291908181526020018280548015613a4757602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a031681526020019060080190602082600701049283019260010382029150808411613a045790505b505050918352505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff166002811115613a9a57fe5b6002811115613aa557fe5b905250614442565b10613fbb57600080fd5b613fc483610d40565b15613fce57600080fd5b60018201546002830180546141be926001604060020a0316919060208082020160405190810160405280929190818152602001828054801561406157602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a03168152602001906008019060208260070104928301926001038202915080841161401e5790505b5050505050856141978660e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a031681526020016002820180548060200260200160405190810160405280929190818152602001828054801561413157602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116140ee5790505b505050918352505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff16600281111561418457fe5b600281111561418f57fe5b9052506145ad565b61419f6141d3565b6003880154910190608060020a90046001604060020a03166000613521565b905061134e858286613813565b5b5050505050565b425b90565b60008060025b835160028111156141eb57fe5b146141f257fe5b8260a001516001604060020a0316151561420f5760019150610dec565b61421c8360a0015161340c565b9050610de9816101006040519081016040528154909190829060ff166002811115611eae57fe5b6002811115611eb957fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611f855780601f10611f5a57610100808354040283529160200191611f85565b820191906000526020600020905b815481529060010190602001808311611f6857829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120275780601f10611ffc57610100808354040283529160200191612027565b820191906000526020600020905b81548152906001019060200180831161200a57829003601f168201915b505050918352505060038201546001604060020a038082166020840152604060020a8204166040830152608060020a900460ff1615156060820152600490910154600160a060020a03166080909101526141d8565b91505b50919050565b806144288585808685614640565b90506144378584868685614640565b90505b949350505050565b6000808260a001516001604060020a031615156144625760009150610dec565b61446f8360a001516133c3565b90506145a18160e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a0316815260200160028201805480602002602001604051908101604052809291908181526020018280548015613a4757602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a031681526020019060080190602082600701049283019260010382029150808411613a045790505b505050918352505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff166002811115613a9a57fe5b6002811115613aa557fe5b905250614442565b60010191505b50919050565b60008060006145bf846020015161340c565b60038101546001604060020a031693509150600090505b8360400151518110156129d057614605846040015182815181106145f657fe5b9060200190602002015161340c565b60038101549092506001604060020a03168390111561462f5760038201546001604060020a031692505b5b6001016145d6565b5b5050919050565b600080600080866001604060020a0316886001604060020a0316146146675761010061466a565b60005b61ffff16925084935061467c886133c3565b600181015490925061469c908a906001604060020a031689898789614761565b9350600090505b60028201546001604060020a03821610156147195761470e8983600201836001604060020a03168154811015156146d657fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a0316898985880160010189614761565b93505b6001016146a3565b600382015460006001604060020a039091161115614754576003820154614751908a906001604060020a0316898960ff880189614761565b93505b5b50505095945050505050565b8060008061476e8861340c565b6004810154909150600160a060020a03161580159061478d5750600083115b15613807578815614848576004810154600160a060020a031663d4edf5e5898989898960006040516020015260405160e060020a63ffffffff88160281526001604060020a039586166004820152938516602485015291841660448401529092166064820152608481019190915260a401602060405180830381600087803b151561481757600080fd5b6102c65a03f1151561482857600080fd5b50505060405180519250508282111561484057600080fd5b819250613807565b6004810154600160a060020a031663ad1483c3898989898960405160e060020a63ffffffff88160281526001604060020a039586166004820152938516602485015291841660448401529092166064820152608481019190915260a401600060405180830381600087803b15156148be57600080fd5b6102c65a03f115156148cf57600080fd5b5050505b5b5b50509695505050505050565b60206040519081016040526000815290565b81548183558181151161491f5760050281600502836000526020600020918201910161491f9190614b1f565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061496657805160ff1916838001178555614993565b82800160010185558215614993579182015b82811115614993578251825591602001919060010190614978565b5b506149a0929150614bb1565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061496657805160ff1916838001178555614993565b82800160010185558215614993579182015b82811115614993578251825591602001919060010190614978565b5b506149a0929150614bb1565b5090565b81548183558181151161491f5760040281600402836000526020600020918201910161491f9190614bd2565b5b505050565b82805482825590600052602060002090600301600490048101928215614afd5791602002820160005b83821115614ac857835183826101000a8154816001604060020a0302191690836001604060020a031602179055509260200192600801602081600701049283019260010302614a7e565b8015614afb5782816101000a8154906001604060020a030219169055600801602081600701049283019260010302614ac8565b505b506149a0929150614c39565b5090565b60206040519081016040526000815290565b610dfa91905b808211156149a057805474ffffffffffffffffffffffffffffffffffffffffff191681556000614b586001830182614c65565b614b66600283016000614c65565b5060038101805470ffffffffffffffffffffffffffffffffff1916905560048101805473ffffffffffffffffffffffffffffffffffffffff19169055600501614b25565b5090565b90565b610dfa91905b808211156149a05760008155600101614bb7565b5090565b90565b610dfa91905b808211156149a057600080825560018201805467ffffffffffffffff19169055614c056002830182614cad565b5060038101805478ffffffffffffffffffffffffffffffffffffffffffffffffff19169055600401614bd8565b5090565b90565b610dfa91905b808211156149a057805467ffffffffffffffff19168155600101614c3f565b5090565b90565b50805460018160011615610100020316600290046000825580601f10614c8b5750613921565b601f0160209004906000526020600020908101906139219190614bb1565b5b50565b5080546000825560030160049004906000526020600020908101906139219190614bb1565b5b505600a165627a7a723058202c436915f1bd792a6b40b5d1db7f01634d3820158d9a722453660e07b6fba7850029" -exports.LiquidPledgingBaseAbi = [{"constant":true,"inputs":[{"name":"idPledge","type":"uint64"},{"name":"idxDelegate","type":"uint256"}],"name":"getPledgeDelegate","outputs":[{"name":"idDelegate","type":"uint64"},{"name":"addr","type":"address"},{"name":"name","type":"string"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"projectId","type":"uint64"}],"name":"isProjectCanceled","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"numberOfPledges","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"idPledge","type":"uint64"}],"name":"getPledge","outputs":[{"name":"amount","type":"uint256"},{"name":"owner","type":"uint64"},{"name":"nDelegates","type":"uint64"},{"name":"intendedProject","type":"uint64"},{"name":"commitTime","type":"uint64"},{"name":"oldPledge","type":"uint64"},{"name":"paymentState","type":"uint8"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addDelegate","outputs":[{"name":"idDelegate","type":"uint64"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"numberOfPledgeAdmins","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"projectAdmin","type":"address"},{"name":"parentProject","type":"uint64"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addProject","outputs":[{"name":"idProject","type":"uint64"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addGiver","outputs":[{"name":"idGiver","type":"uint64"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idDelegate","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateDelegate","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idGiver","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateGiver","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"idAdmin","type":"uint64"}],"name":"getPledgeAdmin","outputs":[{"name":"adminType","type":"uint8"},{"name":"addr","type":"address"},{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"parentProject","type":"uint64"},{"name":"canceled","type":"bool"},{"name":"plugin","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idProject","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateProject","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"vault","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"inputs":[{"name":"_vault","type":"address"}],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idGiver","type":"uint64"}],"name":"GiverAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idGiver","type":"uint64"}],"name":"GiverUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idDelegate","type":"uint64"}],"name":"DelegateAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idDelegate","type":"uint64"}],"name":"DelegateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idProject","type":"uint64"}],"name":"ProjectAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idAdmin","type":"uint64"}],"name":"ProjectUpdated","type":"event"}] -exports.LiquidPledgingBaseByteCode = "0x606060405234156200001057600080fd5b60405160208062001fb4833981016040528080519150505b60016200003681806200006a565b506001620000466000826200009f565b5060028054600160a060020a031916600160a060020a0383161790555b5062000255565b8154818355818115116200009957600502816005028360005260206000209182019101620000999190620000d4565b5b505050565b815481835581811511620000995760040281600402836000526020600020918201910162000099919062000148565b5b505050565b6200014591905b8082111562000141578054600160a860020a03191681556000620001036001830182620001ba565b62000113600283016000620001ba565b506003810180546001608860020a0319169055600481018054600160a060020a0319169055600501620000db565b5090565b90565b6200014591905b808211156200014157600080825560018201805467ffffffffffffffff191690556200017f600283018262000206565b506003810180547fffffffffffffff000000000000000000000000000000000000000000000000001690556004016200014f565b5090565b90565b50805460018160011615610100020316600290046000825580601f10620001e2575062000202565b601f01602090049060005260206000209081019062000202919062000231565b5b50565b50805460008255600301600490049060005260206000209081019062000202919062000231565b5b50565b6200014591905b8082111562000141576000815560010162000238565b5090565b90565b611d4f80620002656000396000f300606060405236156100c25763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166314e7b1dc81146100c75780632101a6ad146101835780632a8ec8cc146101b75780633f657a46146101dc57806352dc7dcc1461025c5780635503d9ba1461032657806372116e921461034b5780637f61fa9314610425578063cc19ecf7146104ef578063db7c2314146105ae578063eba8ba061461066d578063f6b24b1c146107c7578063fbfa77cf14610886575b600080fd5b34156100d257600080fd5b6100ea67ffffffffffffffff600435166024356108b5565b60405167ffffffffffffffff84168152600160a060020a038316602082015260606040820181815290820183818151815260200191508051906020019080838360005b838110156101465780820151818401525b60200161012d565b50505050905090810190601f1680156101735780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b341561018e57600080fd5b6101a367ffffffffffffffff600435166109dd565b604051901515815260200160405180910390f35b34156101c257600080fd5b6101ca610a9b565b60405190815260200160405180910390f35b34156101e757600080fd5b6101fc67ffffffffffffffff60043516610aa6565b60405187815267ffffffffffffffff8088166020830152868116604083015285811660608301528481166080830152831660a082015260c0810182600281111561024257fe5b60ff16815260200197505050505050505060405180910390f35b341561026757600080fd5b61030960046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050833567ffffffffffffffff169360200135600160a060020a03169250610b2e915050565b60405167ffffffffffffffff909116815260200160405180910390f35b341561033157600080fd5b6101ca610d24565b60405190815260200160405180910390f35b341561035657600080fd5b61030960046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965050600160a060020a03853581169567ffffffffffffffff602082013581169650604082013516945060600135169150610d2f9050565b60405167ffffffffffffffff909116815260200160405180910390f35b341561043057600080fd5b61030960046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050833567ffffffffffffffff169360200135600160a060020a0316925061116b915050565b60405167ffffffffffffffff909116815260200160405180910390f35b34156104fa57600080fd5b6105ac6004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff169250611360915050565b005b34156105b957600080fd5b6105ac6004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff16925061144e915050565b005b341561067857600080fd5b61068d67ffffffffffffffff6004351661153c565b6040518089600281111561069d57fe5b60ff168152600160a060020a03898116602083015267ffffffffffffffff8781166080840152861660a083015284151560c0830152831660e08201526101008282038101604083019081529160608101910189818151815260200191508051906020019080838360005b838110156107205780820151818401525b602001610707565b50505050905090810190601f16801561074d5780820380516001836020036101000a031916815260200191505b50838103825288818151815260200191508051906020019080838360005b838110156107845780820151818401525b60200161076b565b50505050905090810190601f1680156107b15780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b34156107d257600080fd5b6105ac6004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff169250611708915050565b005b341561089157600080fd5b6108996117f6565b604051600160a060020a03909116815260200160405180910390f35b6000806108c0611ae6565b6000806108cc87611805565b915081600201600187038154811015156108e257fe5b90600052602060002090600491828204019190066008025b9054906101000a900467ffffffffffffffff16945061091885611850565b90508060000160019054906101000a9004600160a060020a03169350806001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109cc5780601f106109a1576101008083540402835291602001916109cc565b820191906000526020600020905b8154815290600101906020018083116109af57829003601f168201915b505050505092505b50509250925092565b6000806109e983611850565b905060005b815460ff1660028111156109fe57fe5b1415610a0d5760009150610a95565b60025b815460ff166002811115610a2057fe5b14610a2757fe5b6003810154608060020a900460ff1615610a445760019150610a95565b600381015468010000000000000000900467ffffffffffffffff161515610a6e5760009150610a95565b6003810154610a929068010000000000000000900467ffffffffffffffff166109dd565b91505b50919050565b600054600019015b90565b600080600080600080600080610abb89611805565b8054600182015460028301546003840154929b5067ffffffffffffffff9182169a509850808216975068010000000000000000820481169650608060020a82041694507801000000000000000000000000000000000000000000000000900460ff16925090505b50919395979092949650565b600180549081808201610b418382611af8565b916000526020600020906005020160005b6101006040519081016040528060015b8152600160a060020a033381166020830152604082018b9052606082018a905267ffffffffffffffff89166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff19166001836002811115610bc357fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051610c09929160200190611b2a565b50606082015181600201908051610c24929160200190611b2a565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff81167f014882843f1e57bd41e0826ad1cd5e6180d4d4f76df8b12edc8b44575322d94e60405160405180910390a25b949350505050565b600154600019015b90565b60008067ffffffffffffffff851615610f6f57610d4b85611850565b905060025b815460ff166002811115610d6057fe5b14610d6a57600080fd5b6014610f65826101006040519081016040528154909190829060ff166002811115610d9157fe5b6002811115610d9c57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e685780601f10610e3d57610100808354040283529160200191610e68565b820191906000526020600020905b815481529060010190602001808311610e4b57829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f0a5780601f10610edf57610100808354040283529160200191610f0a565b820191906000526020600020905b815481529060010190602001808311610eed57829003601f168201915b5050509183525050600382015467ffffffffffffffff8082166020840152680100000000000000008204166040830152608060020a900460ff1615156060820152600490910154600160a060020a031660809091015261189d565b10610f6f57600080fd5b5b60018054925082808201610f848382611af8565b916000526020600020906005020160005b6101006040519081016040528060025b8152600160a060020a03808c166020830152604082018e9052606082018d905267ffffffffffffffff808b1660808401528b1660a0830152600060c0830152881660e09091015291905081518154829060ff1916600183600281111561100757fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a031990911617815560408201518160010190805161104d929160200190611b2a565b50606082015181600201908051611068929160200190611b2a565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff82167fd7db7003e8f35149eda3d3685c2ab151ee561ad34853fdb0f4d7ecb33fff889060405160405180910390a25b509695505050505050565b60018054908180820161117e8382611af8565b916000526020600020906005020160005b6101006040519081016040528060005b8152600160a060020a033381166020830152604082018b9052606082018a905267ffffffffffffffff89166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff1916600183600281111561120057fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051611246929160200190611b2a565b50606082015181600201908051611261929160200190611b2a565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff81167efc763def3c85dbc7bab43e314ba21264ec158217c45cf1eaf94f5ae15bc2c560405160405180910390a25b949350505050565b600061136b86611850565b905060015b815460ff16600281111561138057fe5b1461138a57600080fd5b805433600160a060020a0390811661010090920416146113a957600080fd5b805461010060a860020a031916610100600160a060020a03871602178155600181018480516113dc929160200190611b2a565b50600281018380516113f2929160200190611b2a565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167f01a3bd608e7be74358498f90bd2ff305f9fdb8e94d76167f40fef03aae56620360405160405180910390a25b505050505050565b600061145986611850565b905060005b815460ff16600281111561146e57fe5b1461147857600080fd5b805433600160a060020a03908116610100909204161461149757600080fd5b805461010060a860020a031916610100600160a060020a03871602178155600181018480516114ca929160200190611b2a565b50600281018380516114e0929160200190611b2a565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167fe8da06f5d4d8fa2ef122c9fc3d5ae15379d95f5b9ebf92a5821b57705600320a60405160405180910390a25b505050505050565b600080611547611ae6565b61154f611ae6565b60008060008060006115608a611850565b80546001808301805460ff84169d5061010093849004600160a060020a03169c509394509260029181161590920260001901909116046020601f820181900481020160405190810160405280929190818152602001828054600181600116156101000203166002900480156116165780601f106115eb57610100808354040283529160200191611616565b820191906000526020600020905b8154815290600101906020018083116115f957829003601f168201915b50505050509650806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116b55780601f1061168a576101008083540402835291602001916116b5565b820191906000526020600020905b81548152906001019060200180831161169857829003601f168201915b505050506003830154600484015492985067ffffffffffffffff8082169850680100000000000000008204169650608060020a900460ff16945050600160a060020a031691505b50919395975091939597565b600061171386611850565b905060025b815460ff16600281111561172857fe5b1461173257600080fd5b805433600160a060020a03908116610100909204161461175157600080fd5b805461010060a860020a031916610100600160a060020a0387160217815560018101848051611784929160200190611b2a565b506002810183805161179a929160200190611b2a565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167f035196d5942819024277421e936a2e76840abb7bb5a320924ce0a9826daeba4460405160405180910390a25b505050505050565b600254600160a060020a031681565b6000805467ffffffffffffffff83161061181e57600080fd5b6000805467ffffffffffffffff841690811061183657fe5b906000526020600020906004020160005b5090505b919050565b60015460009067ffffffffffffffff83161061186b57600080fd5b6001805467ffffffffffffffff841690811061188357fe5b906000526020600020906005020160005b5090505b919050565b60008060025b835160028111156118b057fe5b146118b757fe5b8260a0015167ffffffffffffffff1615156118d55760019150610a95565b6118e28360a00151611850565b9050610a92816101006040519081016040528154909190829060ff166002811115610d9157fe5b6002811115610d9c57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e685780601f10610e3d57610100808354040283529160200191610e68565b820191906000526020600020905b815481529060010190602001808311610e4b57829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f0a5780601f10610edf57610100808354040283529160200191610f0a565b820191906000526020600020905b815481529060010190602001808311610eed57829003601f168201915b5050509183525050600382015467ffffffffffffffff8082166020840152680100000000000000008204166040830152608060020a900460ff1615156060820152600490910154600160a060020a031660809091015261189d565b91505b50919050565b60206040519081016040526000815290565b815481835581811511611b2457600502816005028360005260206000209182019101611b249190611c28565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611b6b57805160ff1916838001178555611b98565b82800160010185558215611b98579182015b82811115611b98578251825591602001919060010190611b7d565b5b50611ba5929150611cba565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611b6b57805160ff1916838001178555611b98565b82800160010185558215611b98579182015b82811115611b98578251825591602001919060010190611b7d565b5b50611ba5929150611cba565b5090565b610aa391905b80821115611ba557805474ffffffffffffffffffffffffffffffffffffffffff191681556000611c616001830182611cdb565b611c6f600283016000611cdb565b5060038101805470ffffffffffffffffffffffffffffffffff1916905560048101805473ffffffffffffffffffffffffffffffffffffffff19169055600501611c2e565b5090565b90565b610aa391905b80821115611ba55760008155600101611cc0565b5090565b90565b50805460018160011615610100020316600290046000825580601f10611d015750611d1f565b601f016020900490600052602060002090810190611d1f9190611cba565b5b505600a165627a7a72305820a55ae68922ba313e34ff78d19cf73d0f517bf9c973505ad242c28d16f46005600029" -exports.VaultAbi = [{"constant":false,"inputs":[{"name":"_ref","type":"bytes32"},{"name":"_dest","type":"address"},{"name":"_amount","type":"uint256"}],"name":"authorizePayment","outputs":[],"payable":false,"type":"function"},{"payable":true,"type":"fallback"}] -exports.VaultByteCode = "0x" -exports._solcVersion = "0.4.15+commit.bbb8e64f.Emscripten.clang" -exports._sha256 = "0x3719452f967025bd63183ec6e8e365cbb4558eb6426dba7749a47ab2d8ba80e0" +exports.ILiquidPledgingPluginRuntimeByteCode = "0x" +exports.LPVaultAbi = [{"constant":false,"inputs":[{"name":"_ref","type":"bytes32"},{"name":"_dest","type":"address"},{"name":"_amount","type":"uint256"}],"name":"authorizePayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"}] +exports.LPVaultByteCode = "0x" +exports.LPVaultRuntimeByteCode = "0x" +exports.LiquidPledgingAbi = [{"constant":true,"inputs":[{"name":"idPledge","type":"uint64"},{"name":"_idxDelegate","type":"uint256"}],"name":"getPledgeDelegate","outputs":[{"name":"idxDelegate","type":"uint64"},{"name":"addr","type":"address"},{"name":"name","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"projectId","type":"uint64"}],"name":"isProjectCanceled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"numberOfPledges","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"idPledge","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"confirmPayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"idPledge","type":"uint64"}],"name":"getPledge","outputs":[{"name":"amount","type":"uint256"},{"name":"owner","type":"uint64"},{"name":"nDelegates","type":"uint64"},{"name":"intendedProject","type":"uint64"},{"name":"commitTime","type":"uint64"},{"name":"oldPledge","type":"uint64"},{"name":"paymentState","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"idPledge","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"idSender","type":"uint64"},{"name":"idPledge","type":"uint64"},{"name":"amount","type":"uint256"},{"name":"idReceiver","type":"uint64"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"idPledge","type":"uint64"}],"name":"normalizePledge","outputs":[{"name":"","type":"uint64"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addDelegate","outputs":[{"name":"idxDelegate","type":"uint64"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"numberOfPledgeAdmins","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"pledgesAmounts","type":"uint256[]"}],"name":"mWithdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"projectAdmin","type":"address"},{"name":"parentProject","type":"uint64"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addProject","outputs":[{"name":"idProject","type":"uint64"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"idProject","type":"uint64"}],"name":"cancelProject","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addGiver","outputs":[{"name":"idGiver","type":"uint64"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pledgesAmounts","type":"uint256[]"}],"name":"mConfirmPayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"idPledge","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"cancelPledge","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pledges","type":"uint256[]"}],"name":"mNormalizePledge","outputs":[{"name":"","type":"uint64"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"idGiver","type":"uint64"},{"name":"idReceiver","type":"uint64"}],"name":"donate","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"idxDelegate","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateDelegate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"idSender","type":"uint64"},{"name":"pledgesAmounts","type":"uint256[]"},{"name":"idReceiver","type":"uint64"}],"name":"mTransfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"idGiver","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateGiver","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"idPledge","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"cancelPayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"idAdmin","type":"uint64"}],"name":"getPledgeAdmin","outputs":[{"name":"adminType","type":"uint8"},{"name":"addr","type":"address"},{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"parentProject","type":"uint64"},{"name":"canceled","type":"bool"},{"name":"plugin","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"pledgesAmounts","type":"uint256[]"}],"name":"mCancelPayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"idProject","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateProject","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"vault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_vault","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"uint64"},{"indexed":true,"name":"to","type":"uint64"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idProject","type":"uint64"}],"name":"CancelProject","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idGiver","type":"uint64"}],"name":"GiverAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idGiver","type":"uint64"}],"name":"GiverUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idxDelegate","type":"uint64"}],"name":"DelegateAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idxDelegate","type":"uint64"}],"name":"DelegateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idProject","type":"uint64"}],"name":"ProjectAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idAdmin","type":"uint64"}],"name":"ProjectUpdated","type":"event"}] +exports.LiquidPledgingByteCode = "0x606060405234156200001057600080fd5b6040516020806200432583398101604052808051915081905060016200003781806200006f565b50600162000047600082620000a3565b5060028054600160a060020a031916600160a060020a0392909216919091179055506200023b565b8154818355818115116200009e576005028160050283600052602060002091820191016200009e9190620000d2565b505050565b8154818355818115116200009e576004028160040283600052602060002091820191016200009e919062000146565b6200014391905b808211156200013f578054600160a860020a03191681556000620001016001830182620001b1565b62000111600283016000620001b1565b506003810180546001608860020a0319169055600481018054600160a060020a0319169055600501620000d9565b5090565b90565b6200014391905b808211156200013f57600080825560018201805467ffffffffffffffff191690556200017d6002830182620001fc565b506003810180547fffffffffffffff000000000000000000000000000000000000000000000000001690556004016200014d565b50805460018160011615610100020316600290046000825580601f10620001d95750620001f9565b601f016020900490600052602060002090810190620001f991906200021e565b50565b508054600082556003016004900490600052602060002090810190620001f991905b6200014391905b808211156200013f576000815560010162000225565b6140da806200024b6000396000f30060606040526004361061013a5763ffffffff60e060020a60003504166314e7b1dc811461013f5780632101a6ad146101f85780632a8ec8cc1461022b5780632ee88808146102505780633f657a461461027457806343387983146102f257806347c5ef431461031457806350f8a8031461034357806352dc7dcc1461037e5780635503d9ba1461042a57806357adafb61461043d57806372116e921461048c578063796d5654146105485780637f61fa93146105675780639398f5a214610613578063af9f456314610662578063bce0906d14610684578063bde60ac9146106d3578063cc19ecf7146106ed578063d639cd73146107a8578063db7c231414610810578063e9c211e2146108cb578063eba8ba06146108ed578063ef3766e414610a43578063f6b24b1c14610a92578063fbfa77cf14610b4d575b600080fd5b341561014a57600080fd5b6101616001604060020a0360043516602435610b7c565b6040516001604060020a0384168152600160a060020a038316602082015260606040820181815290820183818151815260200191508051906020019080838360005b838110156101bb5780820151838201526020016101a3565b50505050905090810190601f1680156101e85780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b341561020357600080fd5b6102176001604060020a0360043516610ca1565b604051901515815260200160405180910390f35b341561023657600080fd5b61023e610d51565b60405190815260200160405180910390f35b341561025b57600080fd5b6102726001604060020a0360043516602435610d5c565b005b341561027f57600080fd5b6102936001604060020a0360043516610e9f565b6040518781526001604060020a038088166020830152868116604083015285811660608301528481166080830152831660a082015260c081018260028111156102d857fe5b60ff16815260200197505050505050505060405180910390f35b34156102fd57600080fd5b6102726001604060020a0360043516602435610f04565b341561031f57600080fd5b6102726001604060020a0360043581169060243581169060443590606435166112a7565b341561034e57600080fd5b6103626001604060020a036004351661174c565b6040516001604060020a03909116815260200160405180910390f35b341561038957600080fd5b61036260046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505083356001604060020a03169360200135600160a060020a03169250611915915050565b341561043557600080fd5b61023e611b03565b341561044857600080fd5b6102726004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650611b0d95505050505050565b341561049757600080fd5b61036260046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965050600160a060020a0385358116956001604060020a03602082013581169650604082013516945060600135169150611b789050565b341561055357600080fd5b6102726001604060020a0360043516611fa3565b341561057257600080fd5b61036260046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505083356001604060020a03169360200135600160a060020a03169250612031915050565b341561061e57600080fd5b610272600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061221e95505050505050565b341561066d57600080fd5b6102726001604060020a0360043516602435612289565b341561068f57600080fd5b610362600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061230295505050505050565b6102726001604060020a036004358116906024351661234d565b34156106f857600080fd5b610272600480356001604060020a03169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505092356001604060020a031692506124b7915050565b34156107b357600080fd5b610272600480356001604060020a0316906044602480359081019083013580602080820201604051908101604052809392919081815260200183836020028082843750949650505092356001604060020a031692506125a2915050565b341561081b57600080fd5b610272600480356001604060020a03169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505092356001604060020a0316925061260f915050565b34156108d657600080fd5b6102726001604060020a03600435166024356126fa565b34156108f857600080fd5b61090c6001604060020a036004351661280e565b6040518089600281111561091c57fe5b60ff168152600160a060020a0389811660208301526001604060020a038781166080840152861660a083015284151560c0830152831660e08201526101008282038101604083019081529160608101910189818151815260200191508051906020019080838360005b8381101561099d578082015183820152602001610985565b50505050905090810190601f1680156109ca5780820380516001836020036101000a031916815260200191505b50838103825288818151815260200191508051906020019080838360005b83811015610a005780820151838201526020016109e8565b50505050905090810190601f168015610a2d5780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b3415610a4e57600080fd5b61027260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506129d395505050505050565b3415610a9d57600080fd5b610272600480356001604060020a03169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505092356001604060020a03169250612a3e915050565b3415610b5857600080fd5b610b60612b29565b604051600160a060020a03909116815260200160405180910390f35b600080610b87613d7a565b600080610b9387612b38565b91508160020160018703815481101515610ba957fe5b90600052602060002090600491828204019190066008029054906101000a90046001604060020a03169450610bdd85612b7c565b90508060000160019054906101000a9004600160a060020a03169350806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c915780601f10610c6657610100808354040283529160200191610c91565b820191906000526020600020905b815481529060010190602001808311610c7457829003601f168201915b5050505050925050509250925092565b600080610cad83612b7c565b90506000815460ff166002811115610cc157fe5b1415610cd05760009150610d4b565b6002815460ff166002811115610ce257fe5b14610ce957fe5b6003810154608060020a900460ff1615610d065760019150610d4b565b6003810154604060020a90046001604060020a03161515610d2a5760009150610d4b565b6003810154610d4890604060020a90046001604060020a0316610ca1565b91505b50919050565b600054600019015b90565b600254600090819033600160a060020a03908116911614610d7c57600080fd5b610d8584612b38565b91506001600383015460c060020a900460ff166002811115610da357fe5b14610dad57600080fd5b836001604060020a0316610dc085612bc2565b6001604060020a031614610dd357600080fd5b6001820154600283018054610e8c926001604060020a03169190602080820201604051908101604052809291908181526020018280548015610e6657602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a031681526020019060080190602082600701049283019260010382029150808411610e235790505b505050506003860154600091508190608060020a90046001604060020a03166002612c88565b9050610e99848285612f78565b50505050565b600080600080600080600080610eb489612b38565b805460018201546002830154600390930154919c6001604060020a039182169c50929a508082169950604060020a820481169850608060020a820416965060c060020a900460ff16945092505050565b6000806000610f128561174c565b9450610f1d85612b38565b92506000600384015460c060020a900460ff166002811115610f3b57fe5b14610f4557600080fd5b6001830154610f5c906001604060020a0316612b7c565b9150611151826101006040519081016040528154909190829060ff166002811115610f8357fe5b6002811115610f8e57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561105a5780601f1061102f5761010080835404028352916020019161105a565b820191906000526020600020905b81548152906001019060200180831161103d57829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110fc5780601f106110d1576101008083540402835291602001916110fc565b820191906000526020600020905b8154815290600101906020018083116110df57829003601f168201915b505050918352505060038201546001604060020a038082166020840152604060020a8204166040830152608060020a900460ff1615156060820152600490910154600160a060020a0316608090910152613041565b600183015460028401805461120a926001604060020a031691906020808202016040519081016040528092919081815260200182805480156111e457602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116111a15790505b505050506003870154600091508190608060020a90046001604060020a03166001612c88565b9050611217858286612f78565b6002548254600160a060020a039182169163bb4f28df916001604060020a03851691610100909104168760405160e060020a63ffffffff86160281526004810193909352600160a060020a0390911660248301526044820152606401600060405180830381600087803b151561128c57600080fd5b6102c65a03f1151561129d57600080fd5b5050505050505050565b60008060008060006112b88861174c565b97506112c388612b38565b94506112ce86612b7c565b93506112d989612b7c565b9250611300836101006040519081016040528154909190829060ff166002811115610f8357fe5b6000600386015460c060020a900460ff16600281111561131c57fe5b1461132657600080fd5b60018501546001604060020a038a8116911614156113c7576000845460ff16600281111561135057fe5b141561136657611361888888613088565b6113c2565b6002845460ff16600281111561137857fe5b1415611389576113618888886130b8565b6001845460ff16600281111561139b57fe5b14156113c0576113b3888887600201805490506132e1565b97506113618888886133e6565bfe5b611741565b6114f88560e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a031681526020016002820180548060200260200160405190810160405280929190818152602001828054801561149157602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a03168152602001906008019060208260070104928301926001038202915080841161144e5790505b505050918352505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff1660028111156114e457fe5b60028111156114ef57fe5b9052508a61350d565b6001604060020a03908116925082146113c0576000845460ff16600281111561151d57fe5b14156115545760018501546001604060020a0387811691161461153c57fe5b61154e888887600201805490506132e1565b50611741565b6001845460ff16600281111561156657fe5b14156117055761169d8560e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a031681526020016002820180548060200260200160405190810160405280929190818152602001828054801561163657602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116115f35790505b505050918352505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff16600281111561168957fe5b600281111561169457fe5b9052508761350d565b6001604060020a0390811691508114156116c8576113b38888600185896002018054905003036132e1565b818111156116e7576113b38888600185896002018054905003036132e1565b8181116113c25761154e8888600184896002018054905003036132e1565b6002845460ff16600281111561171757fe5b14156113c0576117348888600185896002018054905003036132e1565b97506113c2888888613573565b505050505050505050565b60008060008061175b85612b38565b92506000600384015460c060020a900460ff16600281111561177957fe5b146117865784935061190d565b600383015460006001604060020a039091161180156117bf57506003830154604060020a90046001604060020a03166117bd613896565b115b156118dc57600183015460028401805461187c926001604060020a0316919060208082020160405190810160405280929190818152602001828054801561185757602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116118145790505b505050506003870154600091508190608060020a90046001604060020a031681612c88565b60038401549092506118bc906001604060020a031660006040518059106118a05750595b9080825280602002602001820160405250600080866000612c88565b90506118cd85828560000154612f78565b8094506118d985612b38565b92505b6118e585612bc2565b90506001604060020a03808216908616146119095761190985828560000154612f78565b8093505b505050919050565b6001805490818082016119288382613d8c565b916000526020600020906005020160006101006040519081016040528060018152600160a060020a033381166020830152604082018b9052606082018a90526001604060020a0389166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff191660018360028111156119a757fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a03199091161781556040820151816001019080516119ed929160200190613dbd565b50606082015181600201908051611a08929160200190613dbd565b50608082015160038201805467ffffffffffffffff19166001604060020a039290921691909117905560a08201518160030160086101000a8154816001604060020a0302191690836001604060020a0316021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905550506001604060020a0381167f014882843f1e57bd41e0826ad1cd5e6180d4d4f76df8b12edc8b44575322d94e60405160405180910390a2949350505050565b6001546000190190565b600080805b8351831015610e99576001604060020a03848481518110611b2f57fe5b90602001906020020151169150604060020a848481518110611b4d57fe5b90602001906020020151811515611b6057fe5b049050611b6d8282610f04565b600190920191611b12565b6000806001604060020a03851615611db057611b9385612b7c565b90506002815460ff166002811115611ba757fe5b14611bb157600080fd5b6014611da6826101006040519081016040528154909190829060ff166002811115611bd857fe5b6002811115611be357fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611caf5780601f10611c8457610100808354040283529160200191611caf565b820191906000526020600020905b815481529060010190602001808311611c9257829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611d515780601f10611d2657610100808354040283529160200191611d51565b820191906000526020600020905b815481529060010190602001808311611d3457829003601f168201915b505050918352505060038201546001604060020a038082166020840152604060020a8204166040830152608060020a900460ff1615156060820152600490910154600160a060020a031660809091015261389a565b10611db057600080fd5b60018054925082808201611dc48382613d8c565b916000526020600020906005020160006101006040519081016040528060028152600160a060020a03808c166020830152604082018e9052606082018d90526001604060020a03808b1660808401528b1660a0830152600060c0830152881660e09091015291905081518154829060ff19166001836002811115611e4457fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051611e8a929160200190613dbd565b50606082015181600201908051611ea5929160200190613dbd565b50608082015160038201805467ffffffffffffffff19166001604060020a039290921691909117905560a08201518160030160086101000a8154816001604060020a0302191690836001604060020a0316021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905550506001604060020a0382167fd7db7003e8f35149eda3d3685c2ab151ee561ad34853fdb0f4d7ecb33fff889060405160405180910390a2509695505050505050565b6000611fae82612b7c565b9050611fd5816101006040519081016040528154909190829060ff166002811115610f8357fe5b60038101805470ff000000000000000000000000000000001916608060020a1790556001604060020a0382167f2d65c225503bd4cd245a36c8030073ddd0fb02c23ce540fcd901e74e5006687c60405160405180910390a25050565b6001805490818082016120448382613d8c565b916000526020600020906005020160006101006040519081016040528060008152600160a060020a033381166020830152604082018b9052606082018a90526001604060020a0389166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff191660018360028111156120c357fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051612109929160200190613dbd565b50606082015181600201908051612124929160200190613dbd565b50608082015160038201805467ffffffffffffffff19166001604060020a039290921691909117905560a08201518160030160086101000a8154816001604060020a0302191690836001604060020a0316021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905550506001604060020a0381167efc763def3c85dbc7bab43e314ba21264ec158217c45cf1eaf94f5ae15bc2c560405160405180910390a2949350505050565b600080805b8351831015610e99576001604060020a0384848151811061224057fe5b90602001906020020151169150604060020a84848151811061225e57fe5b9060200190602002015181151561227157fe5b04905061227e8282610d5c565b600190920191612223565b6000806122958461174c565b93506122a084612b38565b60018101549092506122ba906001604060020a0316612b7c565b90506122e1816101006040519081016040528154909190829060ff166002811115610f8357fe5b6003820154610e99908590608060020a90046001604060020a031685612f78565b600080805b8351821015612346576001604060020a0384838151811061232457fe5b9060200190602002015116905061233a8161174c565b50600190910190612307565b5050919050565b60008080806001604060020a0386161515612393576123906020604051908101604052806000815250602060405190810160405260008082526203f48090612031565b95505b61239c86612b7c565b93506123c3846101006040519081016040528154909190829060ff166002811115610f8357fe5b6000845460ff1660028111156123d557fe5b146123df57600080fd5b349250600083116123ef57600080fd5b600254600160a060020a031683156108fc0284604051600060405180830381858888f19350505050151561242257600080fd5b6124518660006040518059106124355750595b9080825280602002602001820160405250600080600080612c88565b915061245c82612b38565b80548401815590506001604060020a03821660007feef5653f9c567b23a97bcfb111bfa6b076a95be73d85d161b4c57149c77b48018560405190815260200160405180910390a36124af868385886112a7565b505050505050565b60006124c286612b7c565b90506001815460ff1660028111156124d657fe5b146124e057600080fd5b805433600160a060020a0390811661010090920416146124ff57600080fd5b805461010060a860020a031916610100600160a060020a0387160217815560018101848051612532929160200190613dbd565b5060028101838051612548929160200190613dbd565b5060038101805467ffffffffffffffff19166001604060020a038481169190911790915586167f01a3bd608e7be74358498f90bd2ff305f9fdb8e94d76167f40fef03aae56620360405160405180910390a2505050505050565b600080805b84518310156124af576001604060020a038584815181106125c457fe5b90602001906020020151169150604060020a8584815181106125e257fe5b906020019060200201518115156125f557fe5b049050612604868383876112a7565b6001909201916125a7565b600061261a86612b7c565b90506000815460ff16600281111561262e57fe5b1461263857600080fd5b805433600160a060020a03908116610100909204161461265757600080fd5b805461010060a860020a031916610100600160a060020a038716021781556001810184805161268a929160200190613dbd565b50600281018380516126a0929160200190613dbd565b5060038101805467ffffffffffffffff19166001604060020a038481169190911790915586167fe8da06f5d4d8fa2ef122c9fc3d5ae15379d95f5b9ebf92a5821b57705600320a60405160405180910390a2505050505050565b600254600090819033600160a060020a0390811691161461271a57600080fd5b61272384612b38565b91506001600383015460c060020a900460ff16600281111561274157fe5b1461274b57600080fd5b6001820154600283018054612803926001604060020a031691906020808202016040519081016040528092919081815260200182805480156127de57602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a03168152602001906008019060208260070104928301926001038202915080841161279b5790505b505050506003860154600091508190608060020a90046001604060020a031681612c88565b9050610e8c8161174c565b600080612819613d7a565b612821613d7a565b60008060008060006128328a612b7c565b80546001808301805460ff84169d5061010093849004600160a060020a03169c509394509260029181161590920260001901909116046020601f820181900481020160405190810160405280929190818152602001828054600181600116156101000203166002900480156128e85780601f106128bd576101008083540402835291602001916128e8565b820191906000526020600020905b8154815290600101906020018083116128cb57829003601f168201915b50505050509650806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156129875780601f1061295c57610100808354040283529160200191612987565b820191906000526020600020905b81548152906001019060200180831161296a57829003601f168201915b5050505060038301546004909301549a9c999b50979990986001604060020a038084169950604060020a8404169750608060020a90920460ff169550600160a060020a03169350915050565b600080805b8351831015610e99576001604060020a038484815181106129f557fe5b90602001906020020151169150604060020a848481518110612a1357fe5b90602001906020020151811515612a2657fe5b049050612a3382826126fa565b6001909201916129d8565b6000612a4986612b7c565b90506002815460ff166002811115612a5d57fe5b14612a6757600080fd5b805433600160a060020a039081166101009092041614612a8657600080fd5b805461010060a860020a031916610100600160a060020a0387160217815560018101848051612ab9929160200190613dbd565b5060028101838051612acf929160200190613dbd565b5060038101805467ffffffffffffffff19166001604060020a038481169190911790915586167f035196d5942819024277421e936a2e76840abb7bb5a320924ce0a9826daeba4460405160405180910390a2505050505050565b600254600160a060020a031681565b600080546001604060020a03831610612b5057600080fd5b600080546001604060020a038416908110612b6757fe5b90600052602060002090600402019050919050565b6001546000906001604060020a03831610612b9657600080fd5b600180546001604060020a038416908110612bad57fe5b90600052602060002090600502019050919050565b600080806001604060020a0384161515612bdf5760009250612346565b612be884612b38565b6001810154909250612c02906001604060020a0316612b7c565b90506000815460ff166002811115612c1657fe5b1415612c2457839250612346565b6002815460ff166002811115612c3657fe5b14612c3d57fe5b6001820154612c54906001604060020a0316610ca1565b1515612c6257839250612346565b6003820154612c8090608060020a90046001604060020a0316612bc2565b949350505050565b600080600088888888888860405160c060020a6001604060020a03881602815260088101868051906020019060200280838360005b83811015612cd5578082015183820152602001612cbd565b50505050905001856001604060020a03166001604060020a031660c060020a028152600801846001604060020a03166001604060020a031660c060020a028152600801836001604060020a03166001604060020a031660c060020a028152600801826002811115612d4257fe5b60ff167f010000000000000000000000000000000000000000000000000000000000000002815260010196505050505050506040519081900390206000818152600360205260408120549193506001604060020a039091169150811115612dab57809250612f6c565b5060008054828252600360205260408220805467ffffffffffffffff19166001604060020a038316179055815490919060018101612de98382613e3b565b9160005260206000209060040201600060e060405190810160405280600081526020018d6001604060020a031681526020018c81526020018b6001604060020a031681526020018a6001604060020a03168152602001896001604060020a03168152602001886002811115612e5a57fe5b905291905081518155602082015160018201805467ffffffffffffffff19166001604060020a0392909216919091179055604082015181600201908051612ea5929160200190613e67565b50606082015160038201805467ffffffffffffffff19166001604060020a039290921691909117905560808201518160030160086101000a8154816001604060020a0302191690836001604060020a0316021790555060a08201518160030160106101000a8154816001604060020a0302191690836001604060020a0316021790555060c082015160038201805478ff000000000000000000000000000000000000000000000000191660c060020a836002811115612f6057fe5b02179055505050508092505b50509695505050505050565b6000806000612f8a6001878787613904565b9250846001604060020a0316866001604060020a03161415612fab576124af565b821515612fb7576124af565b612fc086612b38565b9150612fcb85612b38565b825490915083901015612fdd57600080fd5b815483900382558054830181556001604060020a038086169087167feef5653f9c567b23a97bcfb111bfa6b076a95be73d85d161b4c57149c77b48018560405190815260200160405180910390a36130386000878786613904565b50505050505050565b8060200151600160a060020a031633600160a060020a0316148061307a57508060e00151600160a060020a031633600160a060020a0316145b151561308557600080fd5b50565b6000610e8c8260006040518059106124355750599080825280602002602001820160405250600080600080612c88565b60008060006130c686612b38565b925060146131fa8460e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a031681526020016002820180548060200260200160405190810160405280929190818152602001828054801561319457602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116131515790505b505050918352505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff1660028111156131e757fe5b60028111156131f257fe5b90525061392a565b1061320457600080fd5b61320d84610ca1565b1561321757600080fd5b60018301546002840180546132a4926001604060020a0316919060208082020160405190810160405280929190818152602001828054801561185757600091825260209182902080546001604060020a031684529082028301929091600891018084116118145750505050600388015460009250829150608060020a90046001604060020a031681612c88565b91506132d48460006040518059106118a05750599080825280602002602001820160405250600080866000612c88565b90506124af868287612f78565b6000806132ec613d7a565b6000806132f888612b38565b60028101549094508690036040518059106133105750595b90808252806020026020018201604052509250600091505b600284015486900382101561339e576002840180548390811061334757fe5b90600052602060002090600491828204019190066008029054906101000a90046001604060020a031683838151811061337c57fe5b6001604060020a03909216602092830290910190910152600190910190613328565b600184015460038501546133ce916001604060020a039081169186916000918291608060020a9091041681612c88565b90506133db888289612f78565b979650505050505050565b60006133f0613d7a565b6000806133fc87612b38565b60028101549094506014901061341157600080fd5b60028401546001016040518059106134265750595b90808252806020026020018201604052509250600091505b60028401548210156134b1576002840180548390811061345a57fe5b90600052602060002090600491828204019190066008029054906101000a90046001604060020a031683838151811061348f57fe5b6001604060020a0390921660209283029091019091015260019091019061343e565b600284015485908490815181106134c457fe5b6001604060020a039283166020918202909201015260018501546003860154613500929182169186916000918291608060020a90041681612c88565b9050613038878288612f78565b6000805b83604001515181101561356157826001604060020a03168460400151828151811061353857fe5b906020019060200201516001604060020a031614156135595780915061356c565b600101613511565b6001604060020a0391505b5092915050565b60008061357f85612b38565b915060146136758360e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a031681526020016002820180548060200260200160405190810160405280929190818152602001828054801561319457600091825260209182902080546001604060020a031684529082028301929091600891018084116131515750505092845250505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff1660028111156131e757fe5b1061367f57600080fd5b61368883610ca1565b1561369257600080fd5b6001820154600283018054613882926001604060020a0316919060208082020160405190810160405280929190818152602001828054801561372557602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116136e25790505b50505050508561385b8660e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a03168152602001600282018054806020026020016040519081016040528092919081815260200182805480156137f557602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116137b25790505b505050918352505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff16600281111561384857fe5b600281111561385357fe5b905250613a55565b613863613896565b6003880154910190608060020a90046001604060020a03166000612c88565b905061388f858286612f78565b5050505050565b4290565b6000806002835160028111156138ac57fe5b146138b357fe5b8260a001516001604060020a031615156138d05760019150610d4b565b6138dd8360a00151612b7c565b9050610d48816101006040519081016040528154909190829060ff166002811115611bd857fe5b806139128585808685613adf565b90506139218584868685613adf565b95945050505050565b6000808260a001516001604060020a0316151561394a5760009150610d4b565b6139578360a00151612b38565b9050613a4b8160e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a031681526020016002820180548060200260200160405190810160405280929190818152602001828054801561319457600091825260209182902080546001604060020a031684529082028301929091600891018084116131515750505092845250505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff1660028111156131e757fe5b6001019392505050565b6000806000613a678460200151612b7c565b60038101546001604060020a031693509150600090505b83604001515181101561234657613aad84604001518281518110613a9e57fe5b90602001906020020151612b7c565b60038101549092506001604060020a031683901115613ad75760038201546001604060020a031692505b600101613a7e565b600080600080866001604060020a0316886001604060020a031614613b0657610100613b09565b60005b61ffff169250849350613b1b88612b38565b6001810154909250613b3b908a906001604060020a031689898789613bfd565b9350600090505b60028201546001604060020a0382161015613bb657613bac8983600201836001604060020a0316815481101515613b7557fe5b90600052602060002090600491828204019190066008029054906101000a90046001604060020a0316898985880160010189613bfd565b9350600101613b42565b600382015460006001604060020a039091161115613bf1576003820154613bee908a906001604060020a0316898960ff880189613bfd565b93505b50505095945050505050565b80600080613c0a88612b7c565b6004810154909150600160a060020a031615801590613c295750600083115b15612f6c578815613ce4576004810154600160a060020a031663d4edf5e5898989898960006040516020015260405160e060020a63ffffffff88160281526001604060020a039586166004820152938516602485015291841660448401529092166064820152608481019190915260a401602060405180830381600087803b1515613cb357600080fd5b6102c65a03f11515613cc457600080fd5b505050604051805192505082821115613cdc57600080fd5b819250612f6c565b6004810154600160a060020a031663ad1483c3898989898960405160e060020a63ffffffff88160281526001604060020a039586166004820152938516602485015291841660448401529092166064820152608481019190915260a401600060405180830381600087803b1515613d5a57600080fd5b6102c65a03f11515613d6b57600080fd5b50505050509695505050505050565b60206040519081016040526000815290565b815481835581811511613db857600502816005028360005260206000209182019101613db89190613f1b565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613dfe57805160ff1916838001178555613e2b565b82800160010185558215613e2b579182015b82811115613e2b578251825591602001919060010190613e10565b50613e37929150613fa6565b5090565b815481835581811511613db857600402816004028360005260206000209182019101613db89190613fc0565b82805482825590600052602060002090600301600490048101928215613f0f5791602002820160005b83821115613eda57835183826101000a8154816001604060020a0302191690836001604060020a031602179055509260200192600801602081600701049283019260010302613e90565b8015613f0d5782816101000a8154906001604060020a030219169055600801602081600701049283019260010302613eda565b505b50613e37929150614020565b610d5991905b80821115613e3757805474ffffffffffffffffffffffffffffffffffffffffff191681556000613f546001830182614045565b613f62600283016000614045565b5060038101805470ffffffffffffffffffffffffffffffffff1916905560048101805473ffffffffffffffffffffffffffffffffffffffff19169055600501613f21565b610d5991905b80821115613e375760008155600101613fac565b610d5991905b80821115613e3757600080825560018201805467ffffffffffffffff19169055613ff36002830182614089565b5060038101805478ffffffffffffffffffffffffffffffffffffffffffffffffff19169055600401613fc6565b610d5991905b80821115613e3757805467ffffffffffffffff19168155600101614026565b50805460018160011615610100020316600290046000825580601f1061406b5750613085565b601f0160209004906000526020600020908101906130859190613fa6565b5080546000825560030160049004906000526020600020908101906130859190613fa65600a165627a7a72305820b7e4762d3d29183e2b3ff0fa894718f417f1b4e9cd156b774a679dad3afacf670029" +exports.LiquidPledgingRuntimeByteCode = "0x60606040526004361061013a5763ffffffff60e060020a60003504166314e7b1dc811461013f5780632101a6ad146101f85780632a8ec8cc1461022b5780632ee88808146102505780633f657a461461027457806343387983146102f257806347c5ef431461031457806350f8a8031461034357806352dc7dcc1461037e5780635503d9ba1461042a57806357adafb61461043d57806372116e921461048c578063796d5654146105485780637f61fa93146105675780639398f5a214610613578063af9f456314610662578063bce0906d14610684578063bde60ac9146106d3578063cc19ecf7146106ed578063d639cd73146107a8578063db7c231414610810578063e9c211e2146108cb578063eba8ba06146108ed578063ef3766e414610a43578063f6b24b1c14610a92578063fbfa77cf14610b4d575b600080fd5b341561014a57600080fd5b6101616001604060020a0360043516602435610b7c565b6040516001604060020a0384168152600160a060020a038316602082015260606040820181815290820183818151815260200191508051906020019080838360005b838110156101bb5780820151838201526020016101a3565b50505050905090810190601f1680156101e85780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b341561020357600080fd5b6102176001604060020a0360043516610ca1565b604051901515815260200160405180910390f35b341561023657600080fd5b61023e610d51565b60405190815260200160405180910390f35b341561025b57600080fd5b6102726001604060020a0360043516602435610d5c565b005b341561027f57600080fd5b6102936001604060020a0360043516610e9f565b6040518781526001604060020a038088166020830152868116604083015285811660608301528481166080830152831660a082015260c081018260028111156102d857fe5b60ff16815260200197505050505050505060405180910390f35b34156102fd57600080fd5b6102726001604060020a0360043516602435610f04565b341561031f57600080fd5b6102726001604060020a0360043581169060243581169060443590606435166112a7565b341561034e57600080fd5b6103626001604060020a036004351661174c565b6040516001604060020a03909116815260200160405180910390f35b341561038957600080fd5b61036260046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505083356001604060020a03169360200135600160a060020a03169250611915915050565b341561043557600080fd5b61023e611b03565b341561044857600080fd5b6102726004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650611b0d95505050505050565b341561049757600080fd5b61036260046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965050600160a060020a0385358116956001604060020a03602082013581169650604082013516945060600135169150611b789050565b341561055357600080fd5b6102726001604060020a0360043516611fa3565b341561057257600080fd5b61036260046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505083356001604060020a03169360200135600160a060020a03169250612031915050565b341561061e57600080fd5b610272600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061221e95505050505050565b341561066d57600080fd5b6102726001604060020a0360043516602435612289565b341561068f57600080fd5b610362600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061230295505050505050565b6102726001604060020a036004358116906024351661234d565b34156106f857600080fd5b610272600480356001604060020a03169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505092356001604060020a031692506124b7915050565b34156107b357600080fd5b610272600480356001604060020a0316906044602480359081019083013580602080820201604051908101604052809392919081815260200183836020028082843750949650505092356001604060020a031692506125a2915050565b341561081b57600080fd5b610272600480356001604060020a03169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505092356001604060020a0316925061260f915050565b34156108d657600080fd5b6102726001604060020a03600435166024356126fa565b34156108f857600080fd5b61090c6001604060020a036004351661280e565b6040518089600281111561091c57fe5b60ff168152600160a060020a0389811660208301526001604060020a038781166080840152861660a083015284151560c0830152831660e08201526101008282038101604083019081529160608101910189818151815260200191508051906020019080838360005b8381101561099d578082015183820152602001610985565b50505050905090810190601f1680156109ca5780820380516001836020036101000a031916815260200191505b50838103825288818151815260200191508051906020019080838360005b83811015610a005780820151838201526020016109e8565b50505050905090810190601f168015610a2d5780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b3415610a4e57600080fd5b61027260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506129d395505050505050565b3415610a9d57600080fd5b610272600480356001604060020a03169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505092356001604060020a03169250612a3e915050565b3415610b5857600080fd5b610b60612b29565b604051600160a060020a03909116815260200160405180910390f35b600080610b87613d7a565b600080610b9387612b38565b91508160020160018703815481101515610ba957fe5b90600052602060002090600491828204019190066008029054906101000a90046001604060020a03169450610bdd85612b7c565b90508060000160019054906101000a9004600160a060020a03169350806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c915780601f10610c6657610100808354040283529160200191610c91565b820191906000526020600020905b815481529060010190602001808311610c7457829003601f168201915b5050505050925050509250925092565b600080610cad83612b7c565b90506000815460ff166002811115610cc157fe5b1415610cd05760009150610d4b565b6002815460ff166002811115610ce257fe5b14610ce957fe5b6003810154608060020a900460ff1615610d065760019150610d4b565b6003810154604060020a90046001604060020a03161515610d2a5760009150610d4b565b6003810154610d4890604060020a90046001604060020a0316610ca1565b91505b50919050565b600054600019015b90565b600254600090819033600160a060020a03908116911614610d7c57600080fd5b610d8584612b38565b91506001600383015460c060020a900460ff166002811115610da357fe5b14610dad57600080fd5b836001604060020a0316610dc085612bc2565b6001604060020a031614610dd357600080fd5b6001820154600283018054610e8c926001604060020a03169190602080820201604051908101604052809291908181526020018280548015610e6657602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a031681526020019060080190602082600701049283019260010382029150808411610e235790505b505050506003860154600091508190608060020a90046001604060020a03166002612c88565b9050610e99848285612f78565b50505050565b600080600080600080600080610eb489612b38565b805460018201546002830154600390930154919c6001604060020a039182169c50929a508082169950604060020a820481169850608060020a820416965060c060020a900460ff16945092505050565b6000806000610f128561174c565b9450610f1d85612b38565b92506000600384015460c060020a900460ff166002811115610f3b57fe5b14610f4557600080fd5b6001830154610f5c906001604060020a0316612b7c565b9150611151826101006040519081016040528154909190829060ff166002811115610f8357fe5b6002811115610f8e57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561105a5780601f1061102f5761010080835404028352916020019161105a565b820191906000526020600020905b81548152906001019060200180831161103d57829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110fc5780601f106110d1576101008083540402835291602001916110fc565b820191906000526020600020905b8154815290600101906020018083116110df57829003601f168201915b505050918352505060038201546001604060020a038082166020840152604060020a8204166040830152608060020a900460ff1615156060820152600490910154600160a060020a0316608090910152613041565b600183015460028401805461120a926001604060020a031691906020808202016040519081016040528092919081815260200182805480156111e457602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116111a15790505b505050506003870154600091508190608060020a90046001604060020a03166001612c88565b9050611217858286612f78565b6002548254600160a060020a039182169163bb4f28df916001604060020a03851691610100909104168760405160e060020a63ffffffff86160281526004810193909352600160a060020a0390911660248301526044820152606401600060405180830381600087803b151561128c57600080fd5b6102c65a03f1151561129d57600080fd5b5050505050505050565b60008060008060006112b88861174c565b97506112c388612b38565b94506112ce86612b7c565b93506112d989612b7c565b9250611300836101006040519081016040528154909190829060ff166002811115610f8357fe5b6000600386015460c060020a900460ff16600281111561131c57fe5b1461132657600080fd5b60018501546001604060020a038a8116911614156113c7576000845460ff16600281111561135057fe5b141561136657611361888888613088565b6113c2565b6002845460ff16600281111561137857fe5b1415611389576113618888886130b8565b6001845460ff16600281111561139b57fe5b14156113c0576113b3888887600201805490506132e1565b97506113618888886133e6565bfe5b611741565b6114f88560e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a031681526020016002820180548060200260200160405190810160405280929190818152602001828054801561149157602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a03168152602001906008019060208260070104928301926001038202915080841161144e5790505b505050918352505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff1660028111156114e457fe5b60028111156114ef57fe5b9052508a61350d565b6001604060020a03908116925082146113c0576000845460ff16600281111561151d57fe5b14156115545760018501546001604060020a0387811691161461153c57fe5b61154e888887600201805490506132e1565b50611741565b6001845460ff16600281111561156657fe5b14156117055761169d8560e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a031681526020016002820180548060200260200160405190810160405280929190818152602001828054801561163657602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116115f35790505b505050918352505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff16600281111561168957fe5b600281111561169457fe5b9052508761350d565b6001604060020a0390811691508114156116c8576113b38888600185896002018054905003036132e1565b818111156116e7576113b38888600185896002018054905003036132e1565b8181116113c25761154e8888600184896002018054905003036132e1565b6002845460ff16600281111561171757fe5b14156113c0576117348888600185896002018054905003036132e1565b97506113c2888888613573565b505050505050505050565b60008060008061175b85612b38565b92506000600384015460c060020a900460ff16600281111561177957fe5b146117865784935061190d565b600383015460006001604060020a039091161180156117bf57506003830154604060020a90046001604060020a03166117bd613896565b115b156118dc57600183015460028401805461187c926001604060020a0316919060208082020160405190810160405280929190818152602001828054801561185757602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116118145790505b505050506003870154600091508190608060020a90046001604060020a031681612c88565b60038401549092506118bc906001604060020a031660006040518059106118a05750595b9080825280602002602001820160405250600080866000612c88565b90506118cd85828560000154612f78565b8094506118d985612b38565b92505b6118e585612bc2565b90506001604060020a03808216908616146119095761190985828560000154612f78565b8093505b505050919050565b6001805490818082016119288382613d8c565b916000526020600020906005020160006101006040519081016040528060018152600160a060020a033381166020830152604082018b9052606082018a90526001604060020a0389166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff191660018360028111156119a757fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a03199091161781556040820151816001019080516119ed929160200190613dbd565b50606082015181600201908051611a08929160200190613dbd565b50608082015160038201805467ffffffffffffffff19166001604060020a039290921691909117905560a08201518160030160086101000a8154816001604060020a0302191690836001604060020a0316021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905550506001604060020a0381167f014882843f1e57bd41e0826ad1cd5e6180d4d4f76df8b12edc8b44575322d94e60405160405180910390a2949350505050565b6001546000190190565b600080805b8351831015610e99576001604060020a03848481518110611b2f57fe5b90602001906020020151169150604060020a848481518110611b4d57fe5b90602001906020020151811515611b6057fe5b049050611b6d8282610f04565b600190920191611b12565b6000806001604060020a03851615611db057611b9385612b7c565b90506002815460ff166002811115611ba757fe5b14611bb157600080fd5b6014611da6826101006040519081016040528154909190829060ff166002811115611bd857fe5b6002811115611be357fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611caf5780601f10611c8457610100808354040283529160200191611caf565b820191906000526020600020905b815481529060010190602001808311611c9257829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611d515780601f10611d2657610100808354040283529160200191611d51565b820191906000526020600020905b815481529060010190602001808311611d3457829003601f168201915b505050918352505060038201546001604060020a038082166020840152604060020a8204166040830152608060020a900460ff1615156060820152600490910154600160a060020a031660809091015261389a565b10611db057600080fd5b60018054925082808201611dc48382613d8c565b916000526020600020906005020160006101006040519081016040528060028152600160a060020a03808c166020830152604082018e9052606082018d90526001604060020a03808b1660808401528b1660a0830152600060c0830152881660e09091015291905081518154829060ff19166001836002811115611e4457fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051611e8a929160200190613dbd565b50606082015181600201908051611ea5929160200190613dbd565b50608082015160038201805467ffffffffffffffff19166001604060020a039290921691909117905560a08201518160030160086101000a8154816001604060020a0302191690836001604060020a0316021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905550506001604060020a0382167fd7db7003e8f35149eda3d3685c2ab151ee561ad34853fdb0f4d7ecb33fff889060405160405180910390a2509695505050505050565b6000611fae82612b7c565b9050611fd5816101006040519081016040528154909190829060ff166002811115610f8357fe5b60038101805470ff000000000000000000000000000000001916608060020a1790556001604060020a0382167f2d65c225503bd4cd245a36c8030073ddd0fb02c23ce540fcd901e74e5006687c60405160405180910390a25050565b6001805490818082016120448382613d8c565b916000526020600020906005020160006101006040519081016040528060008152600160a060020a033381166020830152604082018b9052606082018a90526001604060020a0389166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff191660018360028111156120c357fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051612109929160200190613dbd565b50606082015181600201908051612124929160200190613dbd565b50608082015160038201805467ffffffffffffffff19166001604060020a039290921691909117905560a08201518160030160086101000a8154816001604060020a0302191690836001604060020a0316021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905550506001604060020a0381167efc763def3c85dbc7bab43e314ba21264ec158217c45cf1eaf94f5ae15bc2c560405160405180910390a2949350505050565b600080805b8351831015610e99576001604060020a0384848151811061224057fe5b90602001906020020151169150604060020a84848151811061225e57fe5b9060200190602002015181151561227157fe5b04905061227e8282610d5c565b600190920191612223565b6000806122958461174c565b93506122a084612b38565b60018101549092506122ba906001604060020a0316612b7c565b90506122e1816101006040519081016040528154909190829060ff166002811115610f8357fe5b6003820154610e99908590608060020a90046001604060020a031685612f78565b600080805b8351821015612346576001604060020a0384838151811061232457fe5b9060200190602002015116905061233a8161174c565b50600190910190612307565b5050919050565b60008080806001604060020a0386161515612393576123906020604051908101604052806000815250602060405190810160405260008082526203f48090612031565b95505b61239c86612b7c565b93506123c3846101006040519081016040528154909190829060ff166002811115610f8357fe5b6000845460ff1660028111156123d557fe5b146123df57600080fd5b349250600083116123ef57600080fd5b600254600160a060020a031683156108fc0284604051600060405180830381858888f19350505050151561242257600080fd5b6124518660006040518059106124355750595b9080825280602002602001820160405250600080600080612c88565b915061245c82612b38565b80548401815590506001604060020a03821660007feef5653f9c567b23a97bcfb111bfa6b076a95be73d85d161b4c57149c77b48018560405190815260200160405180910390a36124af868385886112a7565b505050505050565b60006124c286612b7c565b90506001815460ff1660028111156124d657fe5b146124e057600080fd5b805433600160a060020a0390811661010090920416146124ff57600080fd5b805461010060a860020a031916610100600160a060020a0387160217815560018101848051612532929160200190613dbd565b5060028101838051612548929160200190613dbd565b5060038101805467ffffffffffffffff19166001604060020a038481169190911790915586167f01a3bd608e7be74358498f90bd2ff305f9fdb8e94d76167f40fef03aae56620360405160405180910390a2505050505050565b600080805b84518310156124af576001604060020a038584815181106125c457fe5b90602001906020020151169150604060020a8584815181106125e257fe5b906020019060200201518115156125f557fe5b049050612604868383876112a7565b6001909201916125a7565b600061261a86612b7c565b90506000815460ff16600281111561262e57fe5b1461263857600080fd5b805433600160a060020a03908116610100909204161461265757600080fd5b805461010060a860020a031916610100600160a060020a038716021781556001810184805161268a929160200190613dbd565b50600281018380516126a0929160200190613dbd565b5060038101805467ffffffffffffffff19166001604060020a038481169190911790915586167fe8da06f5d4d8fa2ef122c9fc3d5ae15379d95f5b9ebf92a5821b57705600320a60405160405180910390a2505050505050565b600254600090819033600160a060020a0390811691161461271a57600080fd5b61272384612b38565b91506001600383015460c060020a900460ff16600281111561274157fe5b1461274b57600080fd5b6001820154600283018054612803926001604060020a031691906020808202016040519081016040528092919081815260200182805480156127de57602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a03168152602001906008019060208260070104928301926001038202915080841161279b5790505b505050506003860154600091508190608060020a90046001604060020a031681612c88565b9050610e8c8161174c565b600080612819613d7a565b612821613d7a565b60008060008060006128328a612b7c565b80546001808301805460ff84169d5061010093849004600160a060020a03169c509394509260029181161590920260001901909116046020601f820181900481020160405190810160405280929190818152602001828054600181600116156101000203166002900480156128e85780601f106128bd576101008083540402835291602001916128e8565b820191906000526020600020905b8154815290600101906020018083116128cb57829003601f168201915b50505050509650806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156129875780601f1061295c57610100808354040283529160200191612987565b820191906000526020600020905b81548152906001019060200180831161296a57829003601f168201915b5050505060038301546004909301549a9c999b50979990986001604060020a038084169950604060020a8404169750608060020a90920460ff169550600160a060020a03169350915050565b600080805b8351831015610e99576001604060020a038484815181106129f557fe5b90602001906020020151169150604060020a848481518110612a1357fe5b90602001906020020151811515612a2657fe5b049050612a3382826126fa565b6001909201916129d8565b6000612a4986612b7c565b90506002815460ff166002811115612a5d57fe5b14612a6757600080fd5b805433600160a060020a039081166101009092041614612a8657600080fd5b805461010060a860020a031916610100600160a060020a0387160217815560018101848051612ab9929160200190613dbd565b5060028101838051612acf929160200190613dbd565b5060038101805467ffffffffffffffff19166001604060020a038481169190911790915586167f035196d5942819024277421e936a2e76840abb7bb5a320924ce0a9826daeba4460405160405180910390a2505050505050565b600254600160a060020a031681565b600080546001604060020a03831610612b5057600080fd5b600080546001604060020a038416908110612b6757fe5b90600052602060002090600402019050919050565b6001546000906001604060020a03831610612b9657600080fd5b600180546001604060020a038416908110612bad57fe5b90600052602060002090600502019050919050565b600080806001604060020a0384161515612bdf5760009250612346565b612be884612b38565b6001810154909250612c02906001604060020a0316612b7c565b90506000815460ff166002811115612c1657fe5b1415612c2457839250612346565b6002815460ff166002811115612c3657fe5b14612c3d57fe5b6001820154612c54906001604060020a0316610ca1565b1515612c6257839250612346565b6003820154612c8090608060020a90046001604060020a0316612bc2565b949350505050565b600080600088888888888860405160c060020a6001604060020a03881602815260088101868051906020019060200280838360005b83811015612cd5578082015183820152602001612cbd565b50505050905001856001604060020a03166001604060020a031660c060020a028152600801846001604060020a03166001604060020a031660c060020a028152600801836001604060020a03166001604060020a031660c060020a028152600801826002811115612d4257fe5b60ff167f010000000000000000000000000000000000000000000000000000000000000002815260010196505050505050506040519081900390206000818152600360205260408120549193506001604060020a039091169150811115612dab57809250612f6c565b5060008054828252600360205260408220805467ffffffffffffffff19166001604060020a038316179055815490919060018101612de98382613e3b565b9160005260206000209060040201600060e060405190810160405280600081526020018d6001604060020a031681526020018c81526020018b6001604060020a031681526020018a6001604060020a03168152602001896001604060020a03168152602001886002811115612e5a57fe5b905291905081518155602082015160018201805467ffffffffffffffff19166001604060020a0392909216919091179055604082015181600201908051612ea5929160200190613e67565b50606082015160038201805467ffffffffffffffff19166001604060020a039290921691909117905560808201518160030160086101000a8154816001604060020a0302191690836001604060020a0316021790555060a08201518160030160106101000a8154816001604060020a0302191690836001604060020a0316021790555060c082015160038201805478ff000000000000000000000000000000000000000000000000191660c060020a836002811115612f6057fe5b02179055505050508092505b50509695505050505050565b6000806000612f8a6001878787613904565b9250846001604060020a0316866001604060020a03161415612fab576124af565b821515612fb7576124af565b612fc086612b38565b9150612fcb85612b38565b825490915083901015612fdd57600080fd5b815483900382558054830181556001604060020a038086169087167feef5653f9c567b23a97bcfb111bfa6b076a95be73d85d161b4c57149c77b48018560405190815260200160405180910390a36130386000878786613904565b50505050505050565b8060200151600160a060020a031633600160a060020a0316148061307a57508060e00151600160a060020a031633600160a060020a0316145b151561308557600080fd5b50565b6000610e8c8260006040518059106124355750599080825280602002602001820160405250600080600080612c88565b60008060006130c686612b38565b925060146131fa8460e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a031681526020016002820180548060200260200160405190810160405280929190818152602001828054801561319457602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116131515790505b505050918352505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff1660028111156131e757fe5b60028111156131f257fe5b90525061392a565b1061320457600080fd5b61320d84610ca1565b1561321757600080fd5b60018301546002840180546132a4926001604060020a0316919060208082020160405190810160405280929190818152602001828054801561185757600091825260209182902080546001604060020a031684529082028301929091600891018084116118145750505050600388015460009250829150608060020a90046001604060020a031681612c88565b91506132d48460006040518059106118a05750599080825280602002602001820160405250600080866000612c88565b90506124af868287612f78565b6000806132ec613d7a565b6000806132f888612b38565b60028101549094508690036040518059106133105750595b90808252806020026020018201604052509250600091505b600284015486900382101561339e576002840180548390811061334757fe5b90600052602060002090600491828204019190066008029054906101000a90046001604060020a031683838151811061337c57fe5b6001604060020a03909216602092830290910190910152600190910190613328565b600184015460038501546133ce916001604060020a039081169186916000918291608060020a9091041681612c88565b90506133db888289612f78565b979650505050505050565b60006133f0613d7a565b6000806133fc87612b38565b60028101549094506014901061341157600080fd5b60028401546001016040518059106134265750595b90808252806020026020018201604052509250600091505b60028401548210156134b1576002840180548390811061345a57fe5b90600052602060002090600491828204019190066008029054906101000a90046001604060020a031683838151811061348f57fe5b6001604060020a0390921660209283029091019091015260019091019061343e565b600284015485908490815181106134c457fe5b6001604060020a039283166020918202909201015260018501546003860154613500929182169186916000918291608060020a90041681612c88565b9050613038878288612f78565b6000805b83604001515181101561356157826001604060020a03168460400151828151811061353857fe5b906020019060200201516001604060020a031614156135595780915061356c565b600101613511565b6001604060020a0391505b5092915050565b60008061357f85612b38565b915060146136758360e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a031681526020016002820180548060200260200160405190810160405280929190818152602001828054801561319457600091825260209182902080546001604060020a031684529082028301929091600891018084116131515750505092845250505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff1660028111156131e757fe5b1061367f57600080fd5b61368883610ca1565b1561369257600080fd5b6001820154600283018054613882926001604060020a0316919060208082020160405190810160405280929190818152602001828054801561372557602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116136e25790505b50505050508561385b8660e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a03168152602001600282018054806020026020016040519081016040528092919081815260200182805480156137f557602002820191906000526020600020906000905b82829054906101000a90046001604060020a03166001604060020a0316815260200190600801906020826007010492830192600103820291508084116137b25790505b505050918352505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff16600281111561384857fe5b600281111561385357fe5b905250613a55565b613863613896565b6003880154910190608060020a90046001604060020a03166000612c88565b905061388f858286612f78565b5050505050565b4290565b6000806002835160028111156138ac57fe5b146138b357fe5b8260a001516001604060020a031615156138d05760019150610d4b565b6138dd8360a00151612b7c565b9050610d48816101006040519081016040528154909190829060ff166002811115611bd857fe5b806139128585808685613adf565b90506139218584868685613adf565b95945050505050565b6000808260a001516001604060020a0316151561394a5760009150610d4b565b6139578360a00151612b38565b9050613a4b8160e06040519081016040529081600082015481526020016001820160009054906101000a90046001604060020a03166001604060020a03166001604060020a031681526020016002820180548060200260200160405190810160405280929190818152602001828054801561319457600091825260209182902080546001604060020a031684529082028301929091600891018084116131515750505092845250505060038201546001604060020a038082166020840152604060020a820481166040840152608060020a820416606083015260809091019060c060020a900460ff1660028111156131e757fe5b6001019392505050565b6000806000613a678460200151612b7c565b60038101546001604060020a031693509150600090505b83604001515181101561234657613aad84604001518281518110613a9e57fe5b90602001906020020151612b7c565b60038101549092506001604060020a031683901115613ad75760038201546001604060020a031692505b600101613a7e565b600080600080866001604060020a0316886001604060020a031614613b0657610100613b09565b60005b61ffff169250849350613b1b88612b38565b6001810154909250613b3b908a906001604060020a031689898789613bfd565b9350600090505b60028201546001604060020a0382161015613bb657613bac8983600201836001604060020a0316815481101515613b7557fe5b90600052602060002090600491828204019190066008029054906101000a90046001604060020a0316898985880160010189613bfd565b9350600101613b42565b600382015460006001604060020a039091161115613bf1576003820154613bee908a906001604060020a0316898960ff880189613bfd565b93505b50505095945050505050565b80600080613c0a88612b7c565b6004810154909150600160a060020a031615801590613c295750600083115b15612f6c578815613ce4576004810154600160a060020a031663d4edf5e5898989898960006040516020015260405160e060020a63ffffffff88160281526001604060020a039586166004820152938516602485015291841660448401529092166064820152608481019190915260a401602060405180830381600087803b1515613cb357600080fd5b6102c65a03f11515613cc457600080fd5b505050604051805192505082821115613cdc57600080fd5b819250612f6c565b6004810154600160a060020a031663ad1483c3898989898960405160e060020a63ffffffff88160281526001604060020a039586166004820152938516602485015291841660448401529092166064820152608481019190915260a401600060405180830381600087803b1515613d5a57600080fd5b6102c65a03f11515613d6b57600080fd5b50505050509695505050505050565b60206040519081016040526000815290565b815481835581811511613db857600502816005028360005260206000209182019101613db89190613f1b565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613dfe57805160ff1916838001178555613e2b565b82800160010185558215613e2b579182015b82811115613e2b578251825591602001919060010190613e10565b50613e37929150613fa6565b5090565b815481835581811511613db857600402816004028360005260206000209182019101613db89190613fc0565b82805482825590600052602060002090600301600490048101928215613f0f5791602002820160005b83821115613eda57835183826101000a8154816001604060020a0302191690836001604060020a031602179055509260200192600801602081600701049283019260010302613e90565b8015613f0d5782816101000a8154906001604060020a030219169055600801602081600701049283019260010302613eda565b505b50613e37929150614020565b610d5991905b80821115613e3757805474ffffffffffffffffffffffffffffffffffffffffff191681556000613f546001830182614045565b613f62600283016000614045565b5060038101805470ffffffffffffffffffffffffffffffffff1916905560048101805473ffffffffffffffffffffffffffffffffffffffff19169055600501613f21565b610d5991905b80821115613e375760008155600101613fac565b610d5991905b80821115613e3757600080825560018201805467ffffffffffffffff19169055613ff36002830182614089565b5060038101805478ffffffffffffffffffffffffffffffffffffffffffffffffff19169055600401613fc6565b610d5991905b80821115613e3757805467ffffffffffffffff19168155600101614026565b50805460018160011615610100020316600290046000825580601f1061406b5750613085565b601f0160209004906000526020600020908101906130859190613fa6565b5080546000825560030160049004906000526020600020908101906130859190613fa65600a165627a7a72305820b7e4762d3d29183e2b3ff0fa894718f417f1b4e9cd156b774a679dad3afacf670029" +exports.LiquidPledgingBaseAbi = [{"constant":true,"inputs":[{"name":"idPledge","type":"uint64"},{"name":"_idxDelegate","type":"uint256"}],"name":"getPledgeDelegate","outputs":[{"name":"idxDelegate","type":"uint64"},{"name":"addr","type":"address"},{"name":"name","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"projectId","type":"uint64"}],"name":"isProjectCanceled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"numberOfPledges","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"idPledge","type":"uint64"}],"name":"getPledge","outputs":[{"name":"amount","type":"uint256"},{"name":"owner","type":"uint64"},{"name":"nDelegates","type":"uint64"},{"name":"intendedProject","type":"uint64"},{"name":"commitTime","type":"uint64"},{"name":"oldPledge","type":"uint64"},{"name":"paymentState","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addDelegate","outputs":[{"name":"idxDelegate","type":"uint64"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"numberOfPledgeAdmins","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"projectAdmin","type":"address"},{"name":"parentProject","type":"uint64"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addProject","outputs":[{"name":"idProject","type":"uint64"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addGiver","outputs":[{"name":"idGiver","type":"uint64"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"idxDelegate","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateDelegate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"idGiver","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateGiver","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"idAdmin","type":"uint64"}],"name":"getPledgeAdmin","outputs":[{"name":"adminType","type":"uint8"},{"name":"addr","type":"address"},{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"parentProject","type":"uint64"},{"name":"canceled","type":"bool"},{"name":"plugin","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"idProject","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateProject","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"vault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_vault","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idGiver","type":"uint64"}],"name":"GiverAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idGiver","type":"uint64"}],"name":"GiverUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idxDelegate","type":"uint64"}],"name":"DelegateAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idxDelegate","type":"uint64"}],"name":"DelegateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idProject","type":"uint64"}],"name":"ProjectAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idAdmin","type":"uint64"}],"name":"ProjectUpdated","type":"event"}] +exports.LiquidPledgingBaseByteCode = "0x606060405234156200001057600080fd5b60405160208062001cb0833981016040528080519150600190506200003681806200006d565b50600162000046600082620000a1565b5060028054600160a060020a031916600160a060020a039290921691909117905562000239565b8154818355818115116200009c576005028160050283600052602060002091820191016200009c9190620000d0565b505050565b8154818355818115116200009c576004028160040283600052602060002091820191016200009c919062000144565b6200014191905b808211156200013d578054600160a860020a03191681556000620000ff6001830182620001af565b6200010f600283016000620001af565b506003810180546001608860020a0319169055600481018054600160a060020a0319169055600501620000d7565b5090565b90565b6200014191905b808211156200013d57600080825560018201805467ffffffffffffffff191690556200017b6002830182620001fa565b506003810180547fffffffffffffff000000000000000000000000000000000000000000000000001690556004016200014b565b50805460018160011615610100020316600290046000825580601f10620001d75750620001f7565b601f016020900490600052602060002090810190620001f791906200021c565b50565b508054600082556003016004900490600052602060002090810190620001f791905b6200014191905b808211156200013d576000815560010162000223565b611a6780620002496000396000f3006060604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166314e7b1dc81146100c95780632101a6ad146101845780632a8ec8cc146101b85780633f657a46146101dd57806352dc7dcc1461025d5780635503d9ba1461032757806372116e921461033a5780637f61fa93146103f7578063cc19ecf7146104a4578063db7c231414610563578063eba8ba0614610620578063f6b24b1c14610778578063fbfa77cf14610835575b600080fd5b34156100d457600080fd5b6100ec67ffffffffffffffff60043516602435610864565b60405167ffffffffffffffff84168152600160a060020a038316602082015260606040820181815290820183818151815260200191508051906020019080838360005b8381101561014757808201518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b341561018f57600080fd5b6101a467ffffffffffffffff6004351661098a565b604051901515815260200160405180910390f35b34156101c357600080fd5b6101cb610a46565b60405190815260200160405180910390f35b34156101e857600080fd5b6101fd67ffffffffffffffff60043516610a51565b60405187815267ffffffffffffffff8088166020830152868116604083015285811660608301528481166080830152831660a082015260c0810182600281111561024357fe5b60ff16815260200197505050505050505060405180910390f35b341561026857600080fd5b61030a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050833567ffffffffffffffff169360200135600160a060020a03169250610ad1915050565b60405167ffffffffffffffff909116815260200160405180910390f35b341561033257600080fd5b6101cb610cc4565b341561034557600080fd5b61030a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965050600160a060020a03853581169567ffffffffffffffff602082013581169650604082013516945060600135169150610cce9050565b341561040257600080fd5b61030a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050833567ffffffffffffffff169360200135600160a060020a03169250611105915050565b34156104af57600080fd5b6105616004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff1692506112f7915050565b005b341561056e57600080fd5b6105616004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff1692506113e3915050565b341561062b57600080fd5b61064067ffffffffffffffff600435166114cf565b6040518089600281111561065057fe5b60ff168152600160a060020a03898116602083015267ffffffffffffffff8781166080840152861660a083015284151560c0830152831660e08201526101008282038101604083019081529160608101910189818151815260200191508051906020019080838360005b838110156106d25780820151838201526020016106ba565b50505050905090810190601f1680156106ff5780820380516001836020036101000a031916815260200191505b50838103825288818151815260200191508051906020019080838360005b8381101561073557808201518382015260200161071d565b50505050905090810190601f1680156107625780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b341561078357600080fd5b6105616004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff16925061169a915050565b341561084057600080fd5b610848611786565b604051600160a060020a03909116815260200160405180910390f35b60008061086f61188e565b60008061087b87611795565b9150816002016001870381548110151561089157fe5b90600052602060002090600491828204019190066008029054906101000a900467ffffffffffffffff1694506108c6856117db565b90508060000160019054906101000a9004600160a060020a03169350806001018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561097a5780601f1061094f5761010080835404028352916020019161097a565b820191906000526020600020905b81548152906001019060200180831161095d57829003601f168201915b5050505050925050509250925092565b600080610996836117db565b90506000815460ff1660028111156109aa57fe5b14156109b95760009150610a40565b6002815460ff1660028111156109cb57fe5b146109d257fe5b6003810154608060020a900460ff16156109ef5760019150610a40565b600381015468010000000000000000900467ffffffffffffffff161515610a195760009150610a40565b6003810154610a3d9068010000000000000000900467ffffffffffffffff1661098a565b91505b50919050565b600054600019015b90565b600080600080600080600080610a6689611795565b805460018201546002830154600390930154919c67ffffffffffffffff9182169c50929a50808216995068010000000000000000820481169850608060020a82041696507801000000000000000000000000000000000000000000000000900460ff16945092505050565b600180549081808201610ae483826118a0565b916000526020600020906005020160006101006040519081016040528060018152600160a060020a033381166020830152604082018b9052606082018a905267ffffffffffffffff89166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff19166001836002811115610b6457fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051610baa9291602001906118d1565b50606082015181600201908051610bc59291602001906118d1565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff81167f014882843f1e57bd41e0826ad1cd5e6180d4d4f76df8b12edc8b44575322d94e60405160405180910390a2949350505050565b6001546000190190565b60008067ffffffffffffffff851615610f0d57610cea856117db565b90506002815460ff166002811115610cfe57fe5b14610d0857600080fd5b6014610f03826101006040519081016040528154909190829060ff166002811115610d2f57fe5b6002811115610d3a57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e065780601f10610ddb57610100808354040283529160200191610e06565b820191906000526020600020905b815481529060010190602001808311610de957829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ea85780601f10610e7d57610100808354040283529160200191610ea8565b820191906000526020600020905b815481529060010190602001808311610e8b57829003601f168201915b5050509183525050600382015467ffffffffffffffff8082166020840152680100000000000000008204166040830152608060020a900460ff1615156060820152600490910154600160a060020a0316608090910152611823565b10610f0d57600080fd5b60018054925082808201610f2183826118a0565b916000526020600020906005020160006101006040519081016040528060028152600160a060020a03808c166020830152604082018e9052606082018d905267ffffffffffffffff808b1660808401528b1660a0830152600060c0830152881660e09091015291905081518154829060ff19166001836002811115610fa257fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051610fe89291602001906118d1565b506060820151816002019080516110039291602001906118d1565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff82167fd7db7003e8f35149eda3d3685c2ab151ee561ad34853fdb0f4d7ecb33fff889060405160405180910390a2509695505050505050565b60018054908180820161111883826118a0565b916000526020600020906005020160006101006040519081016040528060008152600160a060020a033381166020830152604082018b9052606082018a905267ffffffffffffffff89166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff1916600183600281111561119857fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a03199091161781556040820151816001019080516111de9291602001906118d1565b506060820151816002019080516111f99291602001906118d1565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff81167efc763def3c85dbc7bab43e314ba21264ec158217c45cf1eaf94f5ae15bc2c560405160405180910390a2949350505050565b6000611302866117db565b90506001815460ff16600281111561131657fe5b1461132057600080fd5b805433600160a060020a03908116610100909204161461133f57600080fd5b805461010060a860020a031916610100600160a060020a03871602178155600181018480516113729291602001906118d1565b50600281018380516113889291602001906118d1565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167f01a3bd608e7be74358498f90bd2ff305f9fdb8e94d76167f40fef03aae56620360405160405180910390a2505050505050565b60006113ee866117db565b90506000815460ff16600281111561140257fe5b1461140c57600080fd5b805433600160a060020a03908116610100909204161461142b57600080fd5b805461010060a860020a031916610100600160a060020a038716021781556001810184805161145e9291602001906118d1565b50600281018380516114749291602001906118d1565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167fe8da06f5d4d8fa2ef122c9fc3d5ae15379d95f5b9ebf92a5821b57705600320a60405160405180910390a2505050505050565b6000806114da61188e565b6114e261188e565b60008060008060006114f38a6117db565b80546001808301805460ff84169d5061010093849004600160a060020a03169c509394509260029181161590920260001901909116046020601f820181900481020160405190810160405280929190818152602001828054600181600116156101000203166002900480156115a95780601f1061157e576101008083540402835291602001916115a9565b820191906000526020600020905b81548152906001019060200180831161158c57829003601f168201915b50505050509650806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116485780601f1061161d57610100808354040283529160200191611648565b820191906000526020600020905b81548152906001019060200180831161162b57829003601f168201915b5050505060038301546004909301549a9c999b509799909867ffffffffffffffff8084169950680100000000000000008404169750608060020a90920460ff169550600160a060020a03169350915050565b60006116a5866117db565b90506002815460ff1660028111156116b957fe5b146116c357600080fd5b805433600160a060020a0390811661010090920416146116e257600080fd5b805461010060a860020a031916610100600160a060020a03871602178155600181018480516117159291602001906118d1565b506002810183805161172b9291602001906118d1565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167f035196d5942819024277421e936a2e76840abb7bb5a320924ce0a9826daeba4460405160405180910390a2505050505050565b600254600160a060020a031681565b6000805467ffffffffffffffff8316106117ae57600080fd5b6000805467ffffffffffffffff84169081106117c657fe5b90600052602060002090600402019050919050565b60015460009067ffffffffffffffff8316106117f657600080fd5b6001805467ffffffffffffffff841690811061180e57fe5b90600052602060002090600502019050919050565b60008060028351600281111561183557fe5b1461183c57fe5b8260a0015167ffffffffffffffff16151561185a5760019150610a40565b6118678360a001516117db565b9050610a3d816101006040519081016040528154909190829060ff166002811115610d2f57fe5b60206040519081016040526000815290565b8154818355818115116118cc576005028160050283600052602060002091820191016118cc919061194f565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061191257805160ff191683800117855561193f565b8280016001018555821561193f579182015b8281111561193f578251825591602001919060010190611924565b5061194b9291506119da565b5090565b610a4e91905b8082111561194b57805474ffffffffffffffffffffffffffffffffffffffffff19168155600061198860018301826119f4565b6119966002830160006119f4565b5060038101805470ffffffffffffffffffffffffffffffffff1916905560048101805473ffffffffffffffffffffffffffffffffffffffff19169055600501611955565b610a4e91905b8082111561194b57600081556001016119e0565b50805460018160011615610100020316600290046000825580601f10611a1a5750611a38565b601f016020900490600052602060002090810190611a3891906119da565b505600a165627a7a723058200b89fae13ce36e3ed42f3087ca3aa49f2ec8a313188b868e92db3aea94cc1de40029" +exports.LiquidPledgingBaseRuntimeByteCode = "0x6060604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166314e7b1dc81146100c95780632101a6ad146101845780632a8ec8cc146101b85780633f657a46146101dd57806352dc7dcc1461025d5780635503d9ba1461032757806372116e921461033a5780637f61fa93146103f7578063cc19ecf7146104a4578063db7c231414610563578063eba8ba0614610620578063f6b24b1c14610778578063fbfa77cf14610835575b600080fd5b34156100d457600080fd5b6100ec67ffffffffffffffff60043516602435610864565b60405167ffffffffffffffff84168152600160a060020a038316602082015260606040820181815290820183818151815260200191508051906020019080838360005b8381101561014757808201518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b341561018f57600080fd5b6101a467ffffffffffffffff6004351661098a565b604051901515815260200160405180910390f35b34156101c357600080fd5b6101cb610a46565b60405190815260200160405180910390f35b34156101e857600080fd5b6101fd67ffffffffffffffff60043516610a51565b60405187815267ffffffffffffffff8088166020830152868116604083015285811660608301528481166080830152831660a082015260c0810182600281111561024357fe5b60ff16815260200197505050505050505060405180910390f35b341561026857600080fd5b61030a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050833567ffffffffffffffff169360200135600160a060020a03169250610ad1915050565b60405167ffffffffffffffff909116815260200160405180910390f35b341561033257600080fd5b6101cb610cc4565b341561034557600080fd5b61030a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965050600160a060020a03853581169567ffffffffffffffff602082013581169650604082013516945060600135169150610cce9050565b341561040257600080fd5b61030a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050833567ffffffffffffffff169360200135600160a060020a03169250611105915050565b34156104af57600080fd5b6105616004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff1692506112f7915050565b005b341561056e57600080fd5b6105616004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff1692506113e3915050565b341561062b57600080fd5b61064067ffffffffffffffff600435166114cf565b6040518089600281111561065057fe5b60ff168152600160a060020a03898116602083015267ffffffffffffffff8781166080840152861660a083015284151560c0830152831660e08201526101008282038101604083019081529160608101910189818151815260200191508051906020019080838360005b838110156106d25780820151838201526020016106ba565b50505050905090810190601f1680156106ff5780820380516001836020036101000a031916815260200191505b50838103825288818151815260200191508051906020019080838360005b8381101561073557808201518382015260200161071d565b50505050905090810190601f1680156107625780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b341561078357600080fd5b6105616004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff16925061169a915050565b341561084057600080fd5b610848611786565b604051600160a060020a03909116815260200160405180910390f35b60008061086f61188e565b60008061087b87611795565b9150816002016001870381548110151561089157fe5b90600052602060002090600491828204019190066008029054906101000a900467ffffffffffffffff1694506108c6856117db565b90508060000160019054906101000a9004600160a060020a03169350806001018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561097a5780601f1061094f5761010080835404028352916020019161097a565b820191906000526020600020905b81548152906001019060200180831161095d57829003601f168201915b5050505050925050509250925092565b600080610996836117db565b90506000815460ff1660028111156109aa57fe5b14156109b95760009150610a40565b6002815460ff1660028111156109cb57fe5b146109d257fe5b6003810154608060020a900460ff16156109ef5760019150610a40565b600381015468010000000000000000900467ffffffffffffffff161515610a195760009150610a40565b6003810154610a3d9068010000000000000000900467ffffffffffffffff1661098a565b91505b50919050565b600054600019015b90565b600080600080600080600080610a6689611795565b805460018201546002830154600390930154919c67ffffffffffffffff9182169c50929a50808216995068010000000000000000820481169850608060020a82041696507801000000000000000000000000000000000000000000000000900460ff16945092505050565b600180549081808201610ae483826118a0565b916000526020600020906005020160006101006040519081016040528060018152600160a060020a033381166020830152604082018b9052606082018a905267ffffffffffffffff89166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff19166001836002811115610b6457fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051610baa9291602001906118d1565b50606082015181600201908051610bc59291602001906118d1565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff81167f014882843f1e57bd41e0826ad1cd5e6180d4d4f76df8b12edc8b44575322d94e60405160405180910390a2949350505050565b6001546000190190565b60008067ffffffffffffffff851615610f0d57610cea856117db565b90506002815460ff166002811115610cfe57fe5b14610d0857600080fd5b6014610f03826101006040519081016040528154909190829060ff166002811115610d2f57fe5b6002811115610d3a57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e065780601f10610ddb57610100808354040283529160200191610e06565b820191906000526020600020905b815481529060010190602001808311610de957829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ea85780601f10610e7d57610100808354040283529160200191610ea8565b820191906000526020600020905b815481529060010190602001808311610e8b57829003601f168201915b5050509183525050600382015467ffffffffffffffff8082166020840152680100000000000000008204166040830152608060020a900460ff1615156060820152600490910154600160a060020a0316608090910152611823565b10610f0d57600080fd5b60018054925082808201610f2183826118a0565b916000526020600020906005020160006101006040519081016040528060028152600160a060020a03808c166020830152604082018e9052606082018d905267ffffffffffffffff808b1660808401528b1660a0830152600060c0830152881660e09091015291905081518154829060ff19166001836002811115610fa257fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051610fe89291602001906118d1565b506060820151816002019080516110039291602001906118d1565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff82167fd7db7003e8f35149eda3d3685c2ab151ee561ad34853fdb0f4d7ecb33fff889060405160405180910390a2509695505050505050565b60018054908180820161111883826118a0565b916000526020600020906005020160006101006040519081016040528060008152600160a060020a033381166020830152604082018b9052606082018a905267ffffffffffffffff89166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff1916600183600281111561119857fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a03199091161781556040820151816001019080516111de9291602001906118d1565b506060820151816002019080516111f99291602001906118d1565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff81167efc763def3c85dbc7bab43e314ba21264ec158217c45cf1eaf94f5ae15bc2c560405160405180910390a2949350505050565b6000611302866117db565b90506001815460ff16600281111561131657fe5b1461132057600080fd5b805433600160a060020a03908116610100909204161461133f57600080fd5b805461010060a860020a031916610100600160a060020a03871602178155600181018480516113729291602001906118d1565b50600281018380516113889291602001906118d1565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167f01a3bd608e7be74358498f90bd2ff305f9fdb8e94d76167f40fef03aae56620360405160405180910390a2505050505050565b60006113ee866117db565b90506000815460ff16600281111561140257fe5b1461140c57600080fd5b805433600160a060020a03908116610100909204161461142b57600080fd5b805461010060a860020a031916610100600160a060020a038716021781556001810184805161145e9291602001906118d1565b50600281018380516114749291602001906118d1565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167fe8da06f5d4d8fa2ef122c9fc3d5ae15379d95f5b9ebf92a5821b57705600320a60405160405180910390a2505050505050565b6000806114da61188e565b6114e261188e565b60008060008060006114f38a6117db565b80546001808301805460ff84169d5061010093849004600160a060020a03169c509394509260029181161590920260001901909116046020601f820181900481020160405190810160405280929190818152602001828054600181600116156101000203166002900480156115a95780601f1061157e576101008083540402835291602001916115a9565b820191906000526020600020905b81548152906001019060200180831161158c57829003601f168201915b50505050509650806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116485780601f1061161d57610100808354040283529160200191611648565b820191906000526020600020905b81548152906001019060200180831161162b57829003601f168201915b5050505060038301546004909301549a9c999b509799909867ffffffffffffffff8084169950680100000000000000008404169750608060020a90920460ff169550600160a060020a03169350915050565b60006116a5866117db565b90506002815460ff1660028111156116b957fe5b146116c357600080fd5b805433600160a060020a0390811661010090920416146116e257600080fd5b805461010060a860020a031916610100600160a060020a03871602178155600181018480516117159291602001906118d1565b506002810183805161172b9291602001906118d1565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167f035196d5942819024277421e936a2e76840abb7bb5a320924ce0a9826daeba4460405160405180910390a2505050505050565b600254600160a060020a031681565b6000805467ffffffffffffffff8316106117ae57600080fd5b6000805467ffffffffffffffff84169081106117c657fe5b90600052602060002090600402019050919050565b60015460009067ffffffffffffffff8316106117f657600080fd5b6001805467ffffffffffffffff841690811061180e57fe5b90600052602060002090600502019050919050565b60008060028351600281111561183557fe5b1461183c57fe5b8260a0015167ffffffffffffffff16151561185a5760019150610a40565b6118678360a001516117db565b9050610a3d816101006040519081016040528154909190829060ff166002811115610d2f57fe5b60206040519081016040526000815290565b8154818355818115116118cc576005028160050283600052602060002091820191016118cc919061194f565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061191257805160ff191683800117855561193f565b8280016001018555821561193f579182015b8281111561193f578251825591602001919060010190611924565b5061194b9291506119da565b5090565b610a4e91905b8082111561194b57805474ffffffffffffffffffffffffffffffffffffffffff19168155600061198860018301826119f4565b6119966002830160006119f4565b5060038101805470ffffffffffffffffffffffffffffffffff1916905560048101805473ffffffffffffffffffffffffffffffffffffffff19169055600501611955565b610a4e91905b8082111561194b57600081556001016119e0565b50805460018160011615610100020316600290046000825580601f10611a1a5750611a38565b601f016020900490600052602060002090810190611a3891906119da565b505600a165627a7a723058200b89fae13ce36e3ed42f3087ca3aa49f2ec8a313188b868e92db3aea94cc1de40029" +exports._solcVersion = "0.4.18+commit.9cf6e910.Emscripten.clang" +exports._sha256 = "0x31faa112ad617623cc38e8ba395dd03c3436ef3579e7cea68241d3f0e6f4f662" diff --git a/build/LiquidPledgingBase.sol.js b/build/LiquidPledgingBase.sol.js index 5768643..c62a0c2 100644 --- a/build/LiquidPledgingBase.sol.js +++ b/build/LiquidPledgingBase.sol.js @@ -1,10 +1,13 @@ /* This is an autogenerated file. DO NOT EDIT MANUALLY */ -exports.ILiquidPledgingPluginAbi = [{"constant":false,"inputs":[{"name":"pledgeManager","type":"uint64"},{"name":"pledgeFrom","type":"uint64"},{"name":"pledgeTo","type":"uint64"},{"name":"context","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"afterTransfer","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"pledgeManager","type":"uint64"},{"name":"pledgeFrom","type":"uint64"},{"name":"pledgeTo","type":"uint64"},{"name":"context","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"beforeTransfer","outputs":[{"name":"maxAllowed","type":"uint256"}],"payable":false,"type":"function"}] +exports.ILiquidPledgingPluginAbi = [{"constant":false,"inputs":[{"name":"pledgeManager","type":"uint64"},{"name":"pledgeFrom","type":"uint64"},{"name":"pledgeTo","type":"uint64"},{"name":"context","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"afterTransfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pledgeManager","type":"uint64"},{"name":"pledgeFrom","type":"uint64"},{"name":"pledgeTo","type":"uint64"},{"name":"context","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"beforeTransfer","outputs":[{"name":"maxAllowed","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}] exports.ILiquidPledgingPluginByteCode = "0x" -exports.LiquidPledgingBaseAbi = [{"constant":true,"inputs":[{"name":"idPledge","type":"uint64"},{"name":"idxDelegate","type":"uint256"}],"name":"getPledgeDelegate","outputs":[{"name":"idDelegate","type":"uint64"},{"name":"addr","type":"address"},{"name":"name","type":"string"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"projectId","type":"uint64"}],"name":"isProjectCanceled","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"numberOfPledges","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"idPledge","type":"uint64"}],"name":"getPledge","outputs":[{"name":"amount","type":"uint256"},{"name":"owner","type":"uint64"},{"name":"nDelegates","type":"uint64"},{"name":"intendedProject","type":"uint64"},{"name":"commitTime","type":"uint64"},{"name":"oldPledge","type":"uint64"},{"name":"paymentState","type":"uint8"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addDelegate","outputs":[{"name":"idDelegate","type":"uint64"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"numberOfPledgeAdmins","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"projectAdmin","type":"address"},{"name":"parentProject","type":"uint64"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addProject","outputs":[{"name":"idProject","type":"uint64"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addGiver","outputs":[{"name":"idGiver","type":"uint64"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idDelegate","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateDelegate","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idGiver","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateGiver","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"idAdmin","type":"uint64"}],"name":"getPledgeAdmin","outputs":[{"name":"adminType","type":"uint8"},{"name":"addr","type":"address"},{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"parentProject","type":"uint64"},{"name":"canceled","type":"bool"},{"name":"plugin","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idProject","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateProject","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"vault","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"inputs":[{"name":"_vault","type":"address"}],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idGiver","type":"uint64"}],"name":"GiverAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idGiver","type":"uint64"}],"name":"GiverUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idDelegate","type":"uint64"}],"name":"DelegateAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idDelegate","type":"uint64"}],"name":"DelegateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idProject","type":"uint64"}],"name":"ProjectAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idAdmin","type":"uint64"}],"name":"ProjectUpdated","type":"event"}] -exports.LiquidPledgingBaseByteCode = "0x606060405234156200001057600080fd5b60405160208062001fb4833981016040528080519150505b60016200003681806200006a565b506001620000466000826200009f565b5060028054600160a060020a031916600160a060020a0383161790555b5062000255565b8154818355818115116200009957600502816005028360005260206000209182019101620000999190620000d4565b5b505050565b815481835581811511620000995760040281600402836000526020600020918201910162000099919062000148565b5b505050565b6200014591905b8082111562000141578054600160a860020a03191681556000620001036001830182620001ba565b62000113600283016000620001ba565b506003810180546001608860020a0319169055600481018054600160a060020a0319169055600501620000db565b5090565b90565b6200014591905b808211156200014157600080825560018201805467ffffffffffffffff191690556200017f600283018262000206565b506003810180547fffffffffffffff000000000000000000000000000000000000000000000000001690556004016200014f565b5090565b90565b50805460018160011615610100020316600290046000825580601f10620001e2575062000202565b601f01602090049060005260206000209081019062000202919062000231565b5b50565b50805460008255600301600490049060005260206000209081019062000202919062000231565b5b50565b6200014591905b8082111562000141576000815560010162000238565b5090565b90565b611d4f80620002656000396000f300606060405236156100c25763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166314e7b1dc81146100c75780632101a6ad146101835780632a8ec8cc146101b75780633f657a46146101dc57806352dc7dcc1461025c5780635503d9ba1461032657806372116e921461034b5780637f61fa9314610425578063cc19ecf7146104ef578063db7c2314146105ae578063eba8ba061461066d578063f6b24b1c146107c7578063fbfa77cf14610886575b600080fd5b34156100d257600080fd5b6100ea67ffffffffffffffff600435166024356108b5565b60405167ffffffffffffffff84168152600160a060020a038316602082015260606040820181815290820183818151815260200191508051906020019080838360005b838110156101465780820151818401525b60200161012d565b50505050905090810190601f1680156101735780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b341561018e57600080fd5b6101a367ffffffffffffffff600435166109dd565b604051901515815260200160405180910390f35b34156101c257600080fd5b6101ca610a9b565b60405190815260200160405180910390f35b34156101e757600080fd5b6101fc67ffffffffffffffff60043516610aa6565b60405187815267ffffffffffffffff8088166020830152868116604083015285811660608301528481166080830152831660a082015260c0810182600281111561024257fe5b60ff16815260200197505050505050505060405180910390f35b341561026757600080fd5b61030960046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050833567ffffffffffffffff169360200135600160a060020a03169250610b2e915050565b60405167ffffffffffffffff909116815260200160405180910390f35b341561033157600080fd5b6101ca610d24565b60405190815260200160405180910390f35b341561035657600080fd5b61030960046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965050600160a060020a03853581169567ffffffffffffffff602082013581169650604082013516945060600135169150610d2f9050565b60405167ffffffffffffffff909116815260200160405180910390f35b341561043057600080fd5b61030960046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050833567ffffffffffffffff169360200135600160a060020a0316925061116b915050565b60405167ffffffffffffffff909116815260200160405180910390f35b34156104fa57600080fd5b6105ac6004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff169250611360915050565b005b34156105b957600080fd5b6105ac6004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff16925061144e915050565b005b341561067857600080fd5b61068d67ffffffffffffffff6004351661153c565b6040518089600281111561069d57fe5b60ff168152600160a060020a03898116602083015267ffffffffffffffff8781166080840152861660a083015284151560c0830152831660e08201526101008282038101604083019081529160608101910189818151815260200191508051906020019080838360005b838110156107205780820151818401525b602001610707565b50505050905090810190601f16801561074d5780820380516001836020036101000a031916815260200191505b50838103825288818151815260200191508051906020019080838360005b838110156107845780820151818401525b60200161076b565b50505050905090810190601f1680156107b15780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b34156107d257600080fd5b6105ac6004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff169250611708915050565b005b341561089157600080fd5b6108996117f6565b604051600160a060020a03909116815260200160405180910390f35b6000806108c0611ae6565b6000806108cc87611805565b915081600201600187038154811015156108e257fe5b90600052602060002090600491828204019190066008025b9054906101000a900467ffffffffffffffff16945061091885611850565b90508060000160019054906101000a9004600160a060020a03169350806001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109cc5780601f106109a1576101008083540402835291602001916109cc565b820191906000526020600020905b8154815290600101906020018083116109af57829003601f168201915b505050505092505b50509250925092565b6000806109e983611850565b905060005b815460ff1660028111156109fe57fe5b1415610a0d5760009150610a95565b60025b815460ff166002811115610a2057fe5b14610a2757fe5b6003810154608060020a900460ff1615610a445760019150610a95565b600381015468010000000000000000900467ffffffffffffffff161515610a6e5760009150610a95565b6003810154610a929068010000000000000000900467ffffffffffffffff166109dd565b91505b50919050565b600054600019015b90565b600080600080600080600080610abb89611805565b8054600182015460028301546003840154929b5067ffffffffffffffff9182169a509850808216975068010000000000000000820481169650608060020a82041694507801000000000000000000000000000000000000000000000000900460ff16925090505b50919395979092949650565b600180549081808201610b418382611af8565b916000526020600020906005020160005b6101006040519081016040528060015b8152600160a060020a033381166020830152604082018b9052606082018a905267ffffffffffffffff89166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff19166001836002811115610bc357fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051610c09929160200190611b2a565b50606082015181600201908051610c24929160200190611b2a565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff81167f014882843f1e57bd41e0826ad1cd5e6180d4d4f76df8b12edc8b44575322d94e60405160405180910390a25b949350505050565b600154600019015b90565b60008067ffffffffffffffff851615610f6f57610d4b85611850565b905060025b815460ff166002811115610d6057fe5b14610d6a57600080fd5b6014610f65826101006040519081016040528154909190829060ff166002811115610d9157fe5b6002811115610d9c57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e685780601f10610e3d57610100808354040283529160200191610e68565b820191906000526020600020905b815481529060010190602001808311610e4b57829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f0a5780601f10610edf57610100808354040283529160200191610f0a565b820191906000526020600020905b815481529060010190602001808311610eed57829003601f168201915b5050509183525050600382015467ffffffffffffffff8082166020840152680100000000000000008204166040830152608060020a900460ff1615156060820152600490910154600160a060020a031660809091015261189d565b10610f6f57600080fd5b5b60018054925082808201610f848382611af8565b916000526020600020906005020160005b6101006040519081016040528060025b8152600160a060020a03808c166020830152604082018e9052606082018d905267ffffffffffffffff808b1660808401528b1660a0830152600060c0830152881660e09091015291905081518154829060ff1916600183600281111561100757fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a031990911617815560408201518160010190805161104d929160200190611b2a565b50606082015181600201908051611068929160200190611b2a565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff82167fd7db7003e8f35149eda3d3685c2ab151ee561ad34853fdb0f4d7ecb33fff889060405160405180910390a25b509695505050505050565b60018054908180820161117e8382611af8565b916000526020600020906005020160005b6101006040519081016040528060005b8152600160a060020a033381166020830152604082018b9052606082018a905267ffffffffffffffff89166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff1916600183600281111561120057fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051611246929160200190611b2a565b50606082015181600201908051611261929160200190611b2a565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff81167efc763def3c85dbc7bab43e314ba21264ec158217c45cf1eaf94f5ae15bc2c560405160405180910390a25b949350505050565b600061136b86611850565b905060015b815460ff16600281111561138057fe5b1461138a57600080fd5b805433600160a060020a0390811661010090920416146113a957600080fd5b805461010060a860020a031916610100600160a060020a03871602178155600181018480516113dc929160200190611b2a565b50600281018380516113f2929160200190611b2a565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167f01a3bd608e7be74358498f90bd2ff305f9fdb8e94d76167f40fef03aae56620360405160405180910390a25b505050505050565b600061145986611850565b905060005b815460ff16600281111561146e57fe5b1461147857600080fd5b805433600160a060020a03908116610100909204161461149757600080fd5b805461010060a860020a031916610100600160a060020a03871602178155600181018480516114ca929160200190611b2a565b50600281018380516114e0929160200190611b2a565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167fe8da06f5d4d8fa2ef122c9fc3d5ae15379d95f5b9ebf92a5821b57705600320a60405160405180910390a25b505050505050565b600080611547611ae6565b61154f611ae6565b60008060008060006115608a611850565b80546001808301805460ff84169d5061010093849004600160a060020a03169c509394509260029181161590920260001901909116046020601f820181900481020160405190810160405280929190818152602001828054600181600116156101000203166002900480156116165780601f106115eb57610100808354040283529160200191611616565b820191906000526020600020905b8154815290600101906020018083116115f957829003601f168201915b50505050509650806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116b55780601f1061168a576101008083540402835291602001916116b5565b820191906000526020600020905b81548152906001019060200180831161169857829003601f168201915b505050506003830154600484015492985067ffffffffffffffff8082169850680100000000000000008204169650608060020a900460ff16945050600160a060020a031691505b50919395975091939597565b600061171386611850565b905060025b815460ff16600281111561172857fe5b1461173257600080fd5b805433600160a060020a03908116610100909204161461175157600080fd5b805461010060a860020a031916610100600160a060020a0387160217815560018101848051611784929160200190611b2a565b506002810183805161179a929160200190611b2a565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167f035196d5942819024277421e936a2e76840abb7bb5a320924ce0a9826daeba4460405160405180910390a25b505050505050565b600254600160a060020a031681565b6000805467ffffffffffffffff83161061181e57600080fd5b6000805467ffffffffffffffff841690811061183657fe5b906000526020600020906004020160005b5090505b919050565b60015460009067ffffffffffffffff83161061186b57600080fd5b6001805467ffffffffffffffff841690811061188357fe5b906000526020600020906005020160005b5090505b919050565b60008060025b835160028111156118b057fe5b146118b757fe5b8260a0015167ffffffffffffffff1615156118d55760019150610a95565b6118e28360a00151611850565b9050610a92816101006040519081016040528154909190829060ff166002811115610d9157fe5b6002811115610d9c57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e685780601f10610e3d57610100808354040283529160200191610e68565b820191906000526020600020905b815481529060010190602001808311610e4b57829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f0a5780601f10610edf57610100808354040283529160200191610f0a565b820191906000526020600020905b815481529060010190602001808311610eed57829003601f168201915b5050509183525050600382015467ffffffffffffffff8082166020840152680100000000000000008204166040830152608060020a900460ff1615156060820152600490910154600160a060020a031660809091015261189d565b91505b50919050565b60206040519081016040526000815290565b815481835581811511611b2457600502816005028360005260206000209182019101611b249190611c28565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611b6b57805160ff1916838001178555611b98565b82800160010185558215611b98579182015b82811115611b98578251825591602001919060010190611b7d565b5b50611ba5929150611cba565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611b6b57805160ff1916838001178555611b98565b82800160010185558215611b98579182015b82811115611b98578251825591602001919060010190611b7d565b5b50611ba5929150611cba565b5090565b610aa391905b80821115611ba557805474ffffffffffffffffffffffffffffffffffffffffff191681556000611c616001830182611cdb565b611c6f600283016000611cdb565b5060038101805470ffffffffffffffffffffffffffffffffff1916905560048101805473ffffffffffffffffffffffffffffffffffffffff19169055600501611c2e565b5090565b90565b610aa391905b80821115611ba55760008155600101611cc0565b5090565b90565b50805460018160011615610100020316600290046000825580601f10611d015750611d1f565b601f016020900490600052602060002090810190611d1f9190611cba565b5b505600a165627a7a723058205e4b440a7a8060d5a055c4d8482d6fdb46539ad21e4c5923d38afe99fa37fd2f0029" -exports.VaultAbi = [{"constant":false,"inputs":[{"name":"_ref","type":"bytes32"},{"name":"_dest","type":"address"},{"name":"_amount","type":"uint256"}],"name":"authorizePayment","outputs":[],"payable":false,"type":"function"},{"payable":true,"type":"fallback"}] -exports.VaultByteCode = "0x" -exports._solcVersion = "0.4.15+commit.bbb8e64f.Emscripten.clang" -exports._sha256 = "0x4015d9fdc97a031838e6efed18f8963efc7f634dfd0f0c3a0077ef4dec1ada6b" +exports.ILiquidPledgingPluginRuntimeByteCode = "0x" +exports.LPVaultAbi = [{"constant":false,"inputs":[{"name":"_ref","type":"bytes32"},{"name":"_dest","type":"address"},{"name":"_amount","type":"uint256"}],"name":"authorizePayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"}] +exports.LPVaultByteCode = "0x" +exports.LPVaultRuntimeByteCode = "0x" +exports.LiquidPledgingBaseAbi = [{"constant":true,"inputs":[{"name":"idPledge","type":"uint64"},{"name":"_idxDelegate","type":"uint256"}],"name":"getPledgeDelegate","outputs":[{"name":"idxDelegate","type":"uint64"},{"name":"addr","type":"address"},{"name":"name","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"projectId","type":"uint64"}],"name":"isProjectCanceled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"numberOfPledges","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"idPledge","type":"uint64"}],"name":"getPledge","outputs":[{"name":"amount","type":"uint256"},{"name":"owner","type":"uint64"},{"name":"nDelegates","type":"uint64"},{"name":"intendedProject","type":"uint64"},{"name":"commitTime","type":"uint64"},{"name":"oldPledge","type":"uint64"},{"name":"paymentState","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addDelegate","outputs":[{"name":"idxDelegate","type":"uint64"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"numberOfPledgeAdmins","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"projectAdmin","type":"address"},{"name":"parentProject","type":"uint64"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addProject","outputs":[{"name":"idProject","type":"uint64"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"plugin","type":"address"}],"name":"addGiver","outputs":[{"name":"idGiver","type":"uint64"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"idxDelegate","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateDelegate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"idGiver","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateGiver","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"idAdmin","type":"uint64"}],"name":"getPledgeAdmin","outputs":[{"name":"adminType","type":"uint8"},{"name":"addr","type":"address"},{"name":"name","type":"string"},{"name":"url","type":"string"},{"name":"commitTime","type":"uint64"},{"name":"parentProject","type":"uint64"},{"name":"canceled","type":"bool"},{"name":"plugin","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"idProject","type":"uint64"},{"name":"newAddr","type":"address"},{"name":"newName","type":"string"},{"name":"newUrl","type":"string"},{"name":"newCommitTime","type":"uint64"}],"name":"updateProject","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"vault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_vault","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idGiver","type":"uint64"}],"name":"GiverAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idGiver","type":"uint64"}],"name":"GiverUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idxDelegate","type":"uint64"}],"name":"DelegateAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idxDelegate","type":"uint64"}],"name":"DelegateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idProject","type":"uint64"}],"name":"ProjectAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idAdmin","type":"uint64"}],"name":"ProjectUpdated","type":"event"}] +exports.LiquidPledgingBaseByteCode = "0x606060405234156200001057600080fd5b60405160208062001cb0833981016040528080519150600190506200003681806200006d565b50600162000046600082620000a1565b5060028054600160a060020a031916600160a060020a039290921691909117905562000239565b8154818355818115116200009c576005028160050283600052602060002091820191016200009c9190620000d0565b505050565b8154818355818115116200009c576004028160040283600052602060002091820191016200009c919062000144565b6200014191905b808211156200013d578054600160a860020a03191681556000620000ff6001830182620001af565b6200010f600283016000620001af565b506003810180546001608860020a0319169055600481018054600160a060020a0319169055600501620000d7565b5090565b90565b6200014191905b808211156200013d57600080825560018201805467ffffffffffffffff191690556200017b6002830182620001fa565b506003810180547fffffffffffffff000000000000000000000000000000000000000000000000001690556004016200014b565b50805460018160011615610100020316600290046000825580601f10620001d75750620001f7565b601f016020900490600052602060002090810190620001f791906200021c565b50565b508054600082556003016004900490600052602060002090810190620001f791905b6200014191905b808211156200013d576000815560010162000223565b611a6780620002496000396000f3006060604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166314e7b1dc81146100c95780632101a6ad146101845780632a8ec8cc146101b85780633f657a46146101dd57806352dc7dcc1461025d5780635503d9ba1461032757806372116e921461033a5780637f61fa93146103f7578063cc19ecf7146104a4578063db7c231414610563578063eba8ba0614610620578063f6b24b1c14610778578063fbfa77cf14610835575b600080fd5b34156100d457600080fd5b6100ec67ffffffffffffffff60043516602435610864565b60405167ffffffffffffffff84168152600160a060020a038316602082015260606040820181815290820183818151815260200191508051906020019080838360005b8381101561014757808201518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b341561018f57600080fd5b6101a467ffffffffffffffff6004351661098a565b604051901515815260200160405180910390f35b34156101c357600080fd5b6101cb610a46565b60405190815260200160405180910390f35b34156101e857600080fd5b6101fd67ffffffffffffffff60043516610a51565b60405187815267ffffffffffffffff8088166020830152868116604083015285811660608301528481166080830152831660a082015260c0810182600281111561024357fe5b60ff16815260200197505050505050505060405180910390f35b341561026857600080fd5b61030a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050833567ffffffffffffffff169360200135600160a060020a03169250610ad1915050565b60405167ffffffffffffffff909116815260200160405180910390f35b341561033257600080fd5b6101cb610cc4565b341561034557600080fd5b61030a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965050600160a060020a03853581169567ffffffffffffffff602082013581169650604082013516945060600135169150610cce9050565b341561040257600080fd5b61030a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050833567ffffffffffffffff169360200135600160a060020a03169250611105915050565b34156104af57600080fd5b6105616004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff1692506112f7915050565b005b341561056e57600080fd5b6105616004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff1692506113e3915050565b341561062b57600080fd5b61064067ffffffffffffffff600435166114cf565b6040518089600281111561065057fe5b60ff168152600160a060020a03898116602083015267ffffffffffffffff8781166080840152861660a083015284151560c0830152831660e08201526101008282038101604083019081529160608101910189818151815260200191508051906020019080838360005b838110156106d25780820151838201526020016106ba565b50505050905090810190601f1680156106ff5780820380516001836020036101000a031916815260200191505b50838103825288818151815260200191508051906020019080838360005b8381101561073557808201518382015260200161071d565b50505050905090810190601f1680156107625780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b341561078357600080fd5b6105616004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff16925061169a915050565b341561084057600080fd5b610848611786565b604051600160a060020a03909116815260200160405180910390f35b60008061086f61188e565b60008061087b87611795565b9150816002016001870381548110151561089157fe5b90600052602060002090600491828204019190066008029054906101000a900467ffffffffffffffff1694506108c6856117db565b90508060000160019054906101000a9004600160a060020a03169350806001018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561097a5780601f1061094f5761010080835404028352916020019161097a565b820191906000526020600020905b81548152906001019060200180831161095d57829003601f168201915b5050505050925050509250925092565b600080610996836117db565b90506000815460ff1660028111156109aa57fe5b14156109b95760009150610a40565b6002815460ff1660028111156109cb57fe5b146109d257fe5b6003810154608060020a900460ff16156109ef5760019150610a40565b600381015468010000000000000000900467ffffffffffffffff161515610a195760009150610a40565b6003810154610a3d9068010000000000000000900467ffffffffffffffff1661098a565b91505b50919050565b600054600019015b90565b600080600080600080600080610a6689611795565b805460018201546002830154600390930154919c67ffffffffffffffff9182169c50929a50808216995068010000000000000000820481169850608060020a82041696507801000000000000000000000000000000000000000000000000900460ff16945092505050565b600180549081808201610ae483826118a0565b916000526020600020906005020160006101006040519081016040528060018152600160a060020a033381166020830152604082018b9052606082018a905267ffffffffffffffff89166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff19166001836002811115610b6457fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051610baa9291602001906118d1565b50606082015181600201908051610bc59291602001906118d1565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff81167f014882843f1e57bd41e0826ad1cd5e6180d4d4f76df8b12edc8b44575322d94e60405160405180910390a2949350505050565b6001546000190190565b60008067ffffffffffffffff851615610f0d57610cea856117db565b90506002815460ff166002811115610cfe57fe5b14610d0857600080fd5b6014610f03826101006040519081016040528154909190829060ff166002811115610d2f57fe5b6002811115610d3a57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e065780601f10610ddb57610100808354040283529160200191610e06565b820191906000526020600020905b815481529060010190602001808311610de957829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ea85780601f10610e7d57610100808354040283529160200191610ea8565b820191906000526020600020905b815481529060010190602001808311610e8b57829003601f168201915b5050509183525050600382015467ffffffffffffffff8082166020840152680100000000000000008204166040830152608060020a900460ff1615156060820152600490910154600160a060020a0316608090910152611823565b10610f0d57600080fd5b60018054925082808201610f2183826118a0565b916000526020600020906005020160006101006040519081016040528060028152600160a060020a03808c166020830152604082018e9052606082018d905267ffffffffffffffff808b1660808401528b1660a0830152600060c0830152881660e09091015291905081518154829060ff19166001836002811115610fa257fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051610fe89291602001906118d1565b506060820151816002019080516110039291602001906118d1565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff82167fd7db7003e8f35149eda3d3685c2ab151ee561ad34853fdb0f4d7ecb33fff889060405160405180910390a2509695505050505050565b60018054908180820161111883826118a0565b916000526020600020906005020160006101006040519081016040528060008152600160a060020a033381166020830152604082018b9052606082018a905267ffffffffffffffff89166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff1916600183600281111561119857fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a03199091161781556040820151816001019080516111de9291602001906118d1565b506060820151816002019080516111f99291602001906118d1565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff81167efc763def3c85dbc7bab43e314ba21264ec158217c45cf1eaf94f5ae15bc2c560405160405180910390a2949350505050565b6000611302866117db565b90506001815460ff16600281111561131657fe5b1461132057600080fd5b805433600160a060020a03908116610100909204161461133f57600080fd5b805461010060a860020a031916610100600160a060020a03871602178155600181018480516113729291602001906118d1565b50600281018380516113889291602001906118d1565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167f01a3bd608e7be74358498f90bd2ff305f9fdb8e94d76167f40fef03aae56620360405160405180910390a2505050505050565b60006113ee866117db565b90506000815460ff16600281111561140257fe5b1461140c57600080fd5b805433600160a060020a03908116610100909204161461142b57600080fd5b805461010060a860020a031916610100600160a060020a038716021781556001810184805161145e9291602001906118d1565b50600281018380516114749291602001906118d1565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167fe8da06f5d4d8fa2ef122c9fc3d5ae15379d95f5b9ebf92a5821b57705600320a60405160405180910390a2505050505050565b6000806114da61188e565b6114e261188e565b60008060008060006114f38a6117db565b80546001808301805460ff84169d5061010093849004600160a060020a03169c509394509260029181161590920260001901909116046020601f820181900481020160405190810160405280929190818152602001828054600181600116156101000203166002900480156115a95780601f1061157e576101008083540402835291602001916115a9565b820191906000526020600020905b81548152906001019060200180831161158c57829003601f168201915b50505050509650806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116485780601f1061161d57610100808354040283529160200191611648565b820191906000526020600020905b81548152906001019060200180831161162b57829003601f168201915b5050505060038301546004909301549a9c999b509799909867ffffffffffffffff8084169950680100000000000000008404169750608060020a90920460ff169550600160a060020a03169350915050565b60006116a5866117db565b90506002815460ff1660028111156116b957fe5b146116c357600080fd5b805433600160a060020a0390811661010090920416146116e257600080fd5b805461010060a860020a031916610100600160a060020a03871602178155600181018480516117159291602001906118d1565b506002810183805161172b9291602001906118d1565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167f035196d5942819024277421e936a2e76840abb7bb5a320924ce0a9826daeba4460405160405180910390a2505050505050565b600254600160a060020a031681565b6000805467ffffffffffffffff8316106117ae57600080fd5b6000805467ffffffffffffffff84169081106117c657fe5b90600052602060002090600402019050919050565b60015460009067ffffffffffffffff8316106117f657600080fd5b6001805467ffffffffffffffff841690811061180e57fe5b90600052602060002090600502019050919050565b60008060028351600281111561183557fe5b1461183c57fe5b8260a0015167ffffffffffffffff16151561185a5760019150610a40565b6118678360a001516117db565b9050610a3d816101006040519081016040528154909190829060ff166002811115610d2f57fe5b60206040519081016040526000815290565b8154818355818115116118cc576005028160050283600052602060002091820191016118cc919061194f565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061191257805160ff191683800117855561193f565b8280016001018555821561193f579182015b8281111561193f578251825591602001919060010190611924565b5061194b9291506119da565b5090565b610a4e91905b8082111561194b57805474ffffffffffffffffffffffffffffffffffffffffff19168155600061198860018301826119f4565b6119966002830160006119f4565b5060038101805470ffffffffffffffffffffffffffffffffff1916905560048101805473ffffffffffffffffffffffffffffffffffffffff19169055600501611955565b610a4e91905b8082111561194b57600081556001016119e0565b50805460018160011615610100020316600290046000825580601f10611a1a5750611a38565b601f016020900490600052602060002090810190611a3891906119da565b505600a165627a7a723058205ceebbb5a35145d8b6543631508b3bbf13033f8dca3f4ad99beb24848cdbaaf20029" +exports.LiquidPledgingBaseRuntimeByteCode = "0x6060604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166314e7b1dc81146100c95780632101a6ad146101845780632a8ec8cc146101b85780633f657a46146101dd57806352dc7dcc1461025d5780635503d9ba1461032757806372116e921461033a5780637f61fa93146103f7578063cc19ecf7146104a4578063db7c231414610563578063eba8ba0614610620578063f6b24b1c14610778578063fbfa77cf14610835575b600080fd5b34156100d457600080fd5b6100ec67ffffffffffffffff60043516602435610864565b60405167ffffffffffffffff84168152600160a060020a038316602082015260606040820181815290820183818151815260200191508051906020019080838360005b8381101561014757808201518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b341561018f57600080fd5b6101a467ffffffffffffffff6004351661098a565b604051901515815260200160405180910390f35b34156101c357600080fd5b6101cb610a46565b60405190815260200160405180910390f35b34156101e857600080fd5b6101fd67ffffffffffffffff60043516610a51565b60405187815267ffffffffffffffff8088166020830152868116604083015285811660608301528481166080830152831660a082015260c0810182600281111561024357fe5b60ff16815260200197505050505050505060405180910390f35b341561026857600080fd5b61030a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050833567ffffffffffffffff169360200135600160a060020a03169250610ad1915050565b60405167ffffffffffffffff909116815260200160405180910390f35b341561033257600080fd5b6101cb610cc4565b341561034557600080fd5b61030a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965050600160a060020a03853581169567ffffffffffffffff602082013581169650604082013516945060600135169150610cce9050565b341561040257600080fd5b61030a60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050833567ffffffffffffffff169360200135600160a060020a03169250611105915050565b34156104af57600080fd5b6105616004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff1692506112f7915050565b005b341561056e57600080fd5b6105616004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff1692506113e3915050565b341561062b57600080fd5b61064067ffffffffffffffff600435166114cf565b6040518089600281111561065057fe5b60ff168152600160a060020a03898116602083015267ffffffffffffffff8781166080840152861660a083015284151560c0830152831660e08201526101008282038101604083019081529160608101910189818151815260200191508051906020019080838360005b838110156106d25780820151838201526020016106ba565b50505050905090810190601f1680156106ff5780820380516001836020036101000a031916815260200191505b50838103825288818151815260200191508051906020019080838360005b8381101561073557808201518382015260200161071d565b50505050905090810190601f1680156107625780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b341561078357600080fd5b6105616004803567ffffffffffffffff169060248035600160a060020a0316919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505050923567ffffffffffffffff16925061169a915050565b341561084057600080fd5b610848611786565b604051600160a060020a03909116815260200160405180910390f35b60008061086f61188e565b60008061087b87611795565b9150816002016001870381548110151561089157fe5b90600052602060002090600491828204019190066008029054906101000a900467ffffffffffffffff1694506108c6856117db565b90508060000160019054906101000a9004600160a060020a03169350806001018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561097a5780601f1061094f5761010080835404028352916020019161097a565b820191906000526020600020905b81548152906001019060200180831161095d57829003601f168201915b5050505050925050509250925092565b600080610996836117db565b90506000815460ff1660028111156109aa57fe5b14156109b95760009150610a40565b6002815460ff1660028111156109cb57fe5b146109d257fe5b6003810154608060020a900460ff16156109ef5760019150610a40565b600381015468010000000000000000900467ffffffffffffffff161515610a195760009150610a40565b6003810154610a3d9068010000000000000000900467ffffffffffffffff1661098a565b91505b50919050565b600054600019015b90565b600080600080600080600080610a6689611795565b805460018201546002830154600390930154919c67ffffffffffffffff9182169c50929a50808216995068010000000000000000820481169850608060020a82041696507801000000000000000000000000000000000000000000000000900460ff16945092505050565b600180549081808201610ae483826118a0565b916000526020600020906005020160006101006040519081016040528060018152600160a060020a033381166020830152604082018b9052606082018a905267ffffffffffffffff89166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff19166001836002811115610b6457fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051610baa9291602001906118d1565b50606082015181600201908051610bc59291602001906118d1565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff81167f014882843f1e57bd41e0826ad1cd5e6180d4d4f76df8b12edc8b44575322d94e60405160405180910390a2949350505050565b6001546000190190565b60008067ffffffffffffffff851615610f0d57610cea856117db565b90506002815460ff166002811115610cfe57fe5b14610d0857600080fd5b6014610f03826101006040519081016040528154909190829060ff166002811115610d2f57fe5b6002811115610d3a57fe5b81526020016000820160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e065780601f10610ddb57610100808354040283529160200191610e06565b820191906000526020600020905b815481529060010190602001808311610de957829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ea85780601f10610e7d57610100808354040283529160200191610ea8565b820191906000526020600020905b815481529060010190602001808311610e8b57829003601f168201915b5050509183525050600382015467ffffffffffffffff8082166020840152680100000000000000008204166040830152608060020a900460ff1615156060820152600490910154600160a060020a0316608090910152611823565b10610f0d57600080fd5b60018054925082808201610f2183826118a0565b916000526020600020906005020160006101006040519081016040528060028152600160a060020a03808c166020830152604082018e9052606082018d905267ffffffffffffffff808b1660808401528b1660a0830152600060c0830152881660e09091015291905081518154829060ff19166001836002811115610fa257fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a0319909116178155604082015181600101908051610fe89291602001906118d1565b506060820151816002019080516110039291602001906118d1565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff82167fd7db7003e8f35149eda3d3685c2ab151ee561ad34853fdb0f4d7ecb33fff889060405160405180910390a2509695505050505050565b60018054908180820161111883826118a0565b916000526020600020906005020160006101006040519081016040528060008152600160a060020a033381166020830152604082018b9052606082018a905267ffffffffffffffff89166080830152600060a0830181905260c0830152871660e09091015291905081518154829060ff1916600183600281111561119857fe5b021790555060208201518154600160a060020a03919091166101000261010060a860020a03199091161781556040820151816001019080516111de9291602001906118d1565b506060820151816002019080516111f99291602001906118d1565b50608082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560a08201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c0820151600382018054911515608060020a0270ff000000000000000000000000000000001990921691909117905560e0820151600491909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505067ffffffffffffffff81167efc763def3c85dbc7bab43e314ba21264ec158217c45cf1eaf94f5ae15bc2c560405160405180910390a2949350505050565b6000611302866117db565b90506001815460ff16600281111561131657fe5b1461132057600080fd5b805433600160a060020a03908116610100909204161461133f57600080fd5b805461010060a860020a031916610100600160a060020a03871602178155600181018480516113729291602001906118d1565b50600281018380516113889291602001906118d1565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167f01a3bd608e7be74358498f90bd2ff305f9fdb8e94d76167f40fef03aae56620360405160405180910390a2505050505050565b60006113ee866117db565b90506000815460ff16600281111561140257fe5b1461140c57600080fd5b805433600160a060020a03908116610100909204161461142b57600080fd5b805461010060a860020a031916610100600160a060020a038716021781556001810184805161145e9291602001906118d1565b50600281018380516114749291602001906118d1565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167fe8da06f5d4d8fa2ef122c9fc3d5ae15379d95f5b9ebf92a5821b57705600320a60405160405180910390a2505050505050565b6000806114da61188e565b6114e261188e565b60008060008060006114f38a6117db565b80546001808301805460ff84169d5061010093849004600160a060020a03169c509394509260029181161590920260001901909116046020601f820181900481020160405190810160405280929190818152602001828054600181600116156101000203166002900480156115a95780601f1061157e576101008083540402835291602001916115a9565b820191906000526020600020905b81548152906001019060200180831161158c57829003601f168201915b50505050509650806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116485780601f1061161d57610100808354040283529160200191611648565b820191906000526020600020905b81548152906001019060200180831161162b57829003601f168201915b5050505060038301546004909301549a9c999b509799909867ffffffffffffffff8084169950680100000000000000008404169750608060020a90920460ff169550600160a060020a03169350915050565b60006116a5866117db565b90506002815460ff1660028111156116b957fe5b146116c357600080fd5b805433600160a060020a0390811661010090920416146116e257600080fd5b805461010060a860020a031916610100600160a060020a03871602178155600181018480516117159291602001906118d1565b506002810183805161172b9291602001906118d1565b5060038101805467ffffffffffffffff191667ffffffffffffffff8481169190911790915586167f035196d5942819024277421e936a2e76840abb7bb5a320924ce0a9826daeba4460405160405180910390a2505050505050565b600254600160a060020a031681565b6000805467ffffffffffffffff8316106117ae57600080fd5b6000805467ffffffffffffffff84169081106117c657fe5b90600052602060002090600402019050919050565b60015460009067ffffffffffffffff8316106117f657600080fd5b6001805467ffffffffffffffff841690811061180e57fe5b90600052602060002090600502019050919050565b60008060028351600281111561183557fe5b1461183c57fe5b8260a0015167ffffffffffffffff16151561185a5760019150610a40565b6118678360a001516117db565b9050610a3d816101006040519081016040528154909190829060ff166002811115610d2f57fe5b60206040519081016040526000815290565b8154818355818115116118cc576005028160050283600052602060002091820191016118cc919061194f565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061191257805160ff191683800117855561193f565b8280016001018555821561193f579182015b8281111561193f578251825591602001919060010190611924565b5061194b9291506119da565b5090565b610a4e91905b8082111561194b57805474ffffffffffffffffffffffffffffffffffffffffff19168155600061198860018301826119f4565b6119966002830160006119f4565b5060038101805470ffffffffffffffffffffffffffffffffff1916905560048101805473ffffffffffffffffffffffffffffffffffffffff19169055600501611955565b610a4e91905b8082111561194b57600081556001016119e0565b50805460018160011615610100020316600290046000825580601f10611a1a5750611a38565b601f016020900490600052602060002090810190611a3891906119da565b505600a165627a7a723058205ceebbb5a35145d8b6543631508b3bbf13033f8dca3f4ad99beb24848cdbaaf20029" +exports._solcVersion = "0.4.18+commit.9cf6e910.Emscripten.clang" +exports._sha256 = "0x1d2839168167e1c73ccf1cd31315fe4a19604d7ff396c3db723d53055b6264ac" diff --git a/build/LiquidPledgingBase_all.sol b/build/LiquidPledgingBase_all.sol index 656eed3..0010bec 100644 --- a/build/LiquidPledgingBase_all.sol +++ b/build/LiquidPledgingBase_all.sol @@ -1,11 +1,37 @@ -//File: contracts/ILiquidPledgingPlugin.sol +//File: contracts\ILiquidPledgingPlugin.sol pragma solidity ^0.4.11; +/* + Copyright 2017, Jordi Baylina + Contributor: AdriĆ  Massanet + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +/// @dev `ILiquidPledgingPlugin` is the basic interface for any +/// liquid pledging plugin contract ILiquidPledgingPlugin { + /// @notice Plugins are used (much like web hooks) to initiate an action /// upon any donation, delegation, or transfer; this is an optional feature - /// and allows for extreme customization of the contract + /// and allows for extreme customization of the contract. This function + /// implements any action that should be initiated before a transfer. + /// @param pledgeManager The admin or current manager of the pledge + /// @param pledgeFrom This is the Id from which value will be transfered. + /// @param pledgeTo This is the Id that value will be transfered to. /// @param context The situation that is triggering the plugin: /// 0 -> Plugin for the owner transferring pledge to another party /// 1 -> Plugin for the first delegate transferring pledge to another party @@ -18,34 +44,77 @@ contract ILiquidPledgingPlugin { /// 258 -> Plugin for the second delegate receiving pledge to another party /// ... /// 511 -> Plugin for the intendedProject receiving pledge to another party + /// @param amount The amount of value that will be transfered. function beforeTransfer( uint64 pledgeManager, uint64 pledgeFrom, uint64 pledgeTo, uint64 context, - uint amount - ) returns (uint maxAllowed); + uint amount ) returns (uint maxAllowed); + + /// @notice Plugins are used (much like web hooks) to initiate an action + /// upon any donation, delegation, or transfer; this is an optional feature + /// and allows for extreme customization of the contract. This function + /// implements any action that should be initiated after a transfer. + /// @param pledgeManager The admin or current manager of the pledge + /// @param pledgeFrom This is the Id from which value will be transfered. + /// @param pledgeTo This is the Id that value will be transfered to. + /// @param context The situation that is triggering the plugin: + /// 0 -> Plugin for the owner transferring pledge to another party + /// 1 -> Plugin for the first delegate transferring pledge to another party + /// 2 -> Plugin for the second delegate transferring pledge to another party + /// ... + /// 255 -> Plugin for the intendedProject transferring pledge to another party + /// + /// 256 -> Plugin for the owner receiving pledge to another party + /// 257 -> Plugin for the first delegate receiving pledge to another party + /// 258 -> Plugin for the second delegate receiving pledge to another party + /// ... + /// 511 -> Plugin for the intendedProject receiving pledge to another party + /// @param amount The amount of value that will be transfered. function afterTransfer( uint64 pledgeManager, uint64 pledgeFrom, uint64 pledgeTo, uint64 context, - uint amount); + uint amount + ); } //File: ./contracts/LiquidPledgingBase.sol pragma solidity ^0.4.11; +/* + Copyright 2017, Jordi Baylina + Contributor: AdriĆ  Massanet + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ -/// @dev This is declares a few functions from `Vault` so that the -/// `LiquidPledgingBase` contract can interface with the `Vault` contract -contract Vault { +/// @dev `Vault` serves as an interface to allow the `LiquidPledgingBase` +/// contract to interface with a `Vault` contract +contract LPVault { function authorizePayment(bytes32 _ref, address _dest, uint _amount); function () payable; } +/// @dev `LiquidPledgingBase` is the base level contract used to carry out +/// liquid pledging. This function mostly handles the data structures +/// and basic CRUD methods for liquid pledging. contract LiquidPledgingBase { + // Limits inserted to prevent large loops that could prevent canceling uint constant MAX_DELEGATES = 20; uint constant MAX_SUBPROJECT_LEVEL = 20; @@ -54,7 +123,7 @@ contract LiquidPledgingBase { enum PledgeAdminType { Giver, Delegate, Project } enum PaymentState { Pledged, Paying, Paid } // TODO name change Pledged - /// @dev This struct defines the details of each the PledgeAdmin, these + /// @notice This struct defines the details of each the PledgeAdmin, these /// PledgeAdmins can own pledges and act as delegates struct PledgeAdmin { // TODO name change PledgeAdmin PledgeAdminType adminType; // Giver, Delegate or Project @@ -64,24 +133,31 @@ contract LiquidPledgingBase { uint64 commitTime; // In seconds, used for Givers' & Delegates' vetos uint64 parentProject; // Only for projects bool canceled; //Always false except for canceled projects - ILiquidPledgingPlugin plugin; // if the plugin is 0x0 then nothing happens if its a contract address than that smart contract is called via the milestone contract + // if the plugin is 0x0 then nothing happens if its a contract address + // than that smart contract is called via the milestone contract + ILiquidPledgingPlugin plugin; } struct Pledge { uint amount; uint64 owner; // PledgeAdmin uint64[] delegationChain; // list of index numbers - uint64 intendedProject; // TODO change the name only used for when delegates are precommiting to a project - uint64 commitTime; // When the intendedProject will become the owner - uint64 oldPledge; // this points to the Pledge[] index that the Pledge was derived from + // TODO change the name only used for when delegates are + // pre-committing to a project + uint64 intendedProject; + // When the intendedProject will become the owner + uint64 commitTime; + // this points to the Pledge[] index that the Pledge was derived from + uint64 oldPledge; PaymentState paymentState; } Pledge[] pledges; PledgeAdmin[] admins; //The list of pledgeAdmins 0 means there is no admin - Vault public vault; + LPVault public vault; - // this mapping allows you to search for a specific pledge's index number by the hash of that pledge + // this mapping allows you to search for a specific pledge's + // index number by the hash of that pledge mapping (bytes32 => uint64) hPledge2idx;//TODO Fix typo @@ -89,6 +165,7 @@ contract LiquidPledgingBase { // Modifiers ///// + /// @notice basic method to restrict a function to only the current vault modifier onlyVault() { require(msg.sender == address(vault)); _; @@ -99,12 +176,13 @@ contract LiquidPledgingBase { // Constructor ////// - /// @notice The Constructor creates the `LiquidPledgingBase` on the blockchain - /// @param _vault Where the ETH is stored that the pledges represent + /// @notice The Constructor creates the `LiquidPledgingBase` + /// on the blockchain + /// @param _vault The vault where ETH backing this pledge is stored function LiquidPledgingBase(address _vault) { admins.length = 1; // we reserve the 0 admin pledges.length = 1; // we reserve the 0 pledge - vault = Vault(_vault); + vault = LPVault(_vault); } @@ -112,9 +190,18 @@ contract LiquidPledgingBase { // Adminss functions ////// - /// @notice Creates a giver. - function addGiver(string name, string url, uint64 commitTime, ILiquidPledgingPlugin plugin - ) returns (uint64 idGiver) { + /// @notice `addGiver` Creates a giver and adds them to the list of admins. + /// @param name This is the name used to identify the giver. + /// @param url This is a link to the givers profile or a representative site. + /// @param commitTime Set the default commit time period for this giver. + /// @param plugin This is givers liquid pledge plugin allowing for + /// extended functionality. + function addGiver( + string name, + string url, + uint64 commitTime, + ILiquidPledgingPlugin plugin + ) returns (uint64 idGiver) { idGiver = uint64(admins.length); @@ -133,7 +220,15 @@ contract LiquidPledgingBase { event GiverAdded(uint64 indexed idGiver); - ///@notice Changes the address, name or commitTime associated with a specific giver + /// @notice `updateGiver` allows for basic update operation to change the address, + /// name or commitTime associated with a specific giver. + /// @param idGiver This is the internal ID used to specify the admin lookup + /// that coresponds to the giver. + /// @param newAddr This parameter specifies an address to change the given + /// correspondancec between the giver's internal ID and an external address. + /// @param newName This is the name used to identify the giver. + /// @param newUrl This is a link to the givers profile or a representative site. + /// @param newCommitTime Set the default commit time period for this giver. function updateGiver( uint64 idGiver, address newAddr, @@ -153,10 +248,19 @@ contract LiquidPledgingBase { event GiverUpdated(uint64 indexed idGiver); - /// @notice Creates a new Delegate - function addDelegate(string name, string url, uint64 commitTime, ILiquidPledgingPlugin plugin) returns (uint64 idDelegate) { //TODO return index number + /// @notice `addDelegate` Creates a delegate and adds them to the list of admins. + /// @param name This is the name used to identify the delegate. + /// @param url This is a link to the delegates profile or a representative site. + /// @param commitTime Set the default commit time period for this delegate. + /// @param plugin This is givers liquid pledge plugin allowing for extended functionality. + function addDelegate( + string name, + string url, + uint64 commitTime, + ILiquidPledgingPlugin plugin + ) returns (uint64 idxDelegate) { //TODO return index number - idDelegate = uint64(admins.length); + idxDelegate = uint64(admins.length); admins.push(PledgeAdmin( PledgeAdminType.Delegate, @@ -168,32 +272,54 @@ contract LiquidPledgingBase { false, plugin)); - DelegateAdded(idDelegate); + DelegateAdded(idxDelegate); } - event DelegateAdded(uint64 indexed idDelegate); + event DelegateAdded(uint64 indexed idxDelegate); - ///@notice Changes the address, name or commitTime associated with a specific delegate + /// @notice `updateDelegate` allows for basic update operation to change the address, + /// name or commitTime associated with a specific delegate. + /// @param idxDelegate This is the internal ID used to specify the admin lookup + /// that coresponds to the delegate. + /// @param newAddr This parameter specifies an address to change the given + /// correspondancec between the giver's internal ID and an external address. + /// @param newName This is the name used to identify the delegate. + /// @param newUrl This is a link to the delegates profile or a representative site. + /// @param newCommitTime Set the default commit time period for this giver. function updateDelegate( - uint64 idDelegate, + uint64 idxDelegate, address newAddr, string newName, string newUrl, uint64 newCommitTime) { - PledgeAdmin storage delegate = findAdmin(idDelegate); + PledgeAdmin storage delegate = findAdmin(idxDelegate); require(delegate.adminType == PledgeAdminType.Delegate); require(delegate.addr == msg.sender); delegate.addr = newAddr; delegate.name = newName; delegate.url = newUrl; delegate.commitTime = newCommitTime; - DelegateUpdated(idDelegate); + DelegateUpdated(idxDelegate); } - event DelegateUpdated(uint64 indexed idDelegate); + event DelegateUpdated(uint64 indexed idxDelegate); - /// @notice Creates a new Project - function addProject(string name, string url, address projectAdmin, uint64 parentProject, uint64 commitTime, ILiquidPledgingPlugin plugin) returns (uint64 idProject) { + /// @notice `addProject` Creates a project and adds it to the list of admins. + /// @param name This is the name used to identify the project. + /// @param url This is a link to the projects profile or a representative site. + /// @param projectAdmin This is the projects admin. This should be a trusted individual. + /// @param parentProject If this project has a parent project or a project it's + /// derived from use this parameter to supply it. + /// @param commitTime Set the default commit time period for this project. + /// @param plugin This is the projects liquid pledge plugin allowing for extended functionality. + function addProject( + string name, + string url, + address projectAdmin, + uint64 parentProject, + uint64 commitTime, + ILiquidPledgingPlugin plugin + ) returns (uint64 idProject) { if (parentProject != 0) { PledgeAdmin storage pa = findAdmin(parentProject); require(pa.adminType == PledgeAdminType.Project); @@ -218,7 +344,15 @@ contract LiquidPledgingBase { event ProjectAdded(uint64 indexed idProject); - ///@notice Changes the address, name or commitTime associated with a specific Project + /// @notice `updateProject` allows for basic update operation to change the address, + /// name or commitTime associated with a specific project. + /// @param idProject This is the internal ID used to specify the admin lookup + /// that coresponds to the project. + /// @param newAddr This parameter specifies an address to change the given + /// correspondance between the project's internal ID and an external address. + /// @param newName This is the name used to identify the project. + /// @param newUrl This is a link to the projects profile or a representative site. + /// @param newCommitTime Set the default commit time period for this project. function updateProject( uint64 idProject, address newAddr, @@ -243,11 +377,15 @@ contract LiquidPledgingBase { // Public constant functions ////////// - /// @notice Public constant that states how many pledgess are in the system + /// @notice `numberOfPledges` is a constant getter that simply returns + /// the number of pledges. function numberOfPledges() constant returns (uint) { return pledges.length - 1; } - /// @notice Public constant that states the details of the specified Pledge + + /// @notice `getPledge` is a constant getter that simply returns + /// the amount, owner, the number of delegates, the intended project, + /// the current commit time and the previous pledge attached to a specific pledge. function getPledge(uint64 idPledge) constant returns( uint amount, uint64 owner, @@ -266,24 +404,33 @@ contract LiquidPledgingBase { oldPledge = n.oldPledge; paymentState = n.paymentState; } - /// @notice Public constant that states the delegates one by one, because - /// an array cannot be returned - function getPledgeDelegate(uint64 idPledge, uint idxDelegate) constant returns( - uint64 idDelegate, + + /// @notice `getPledgeDelegate` returns a single delegate given the pledge ID + /// and the delegate ID. + /// @param idPledge The ID internally representing the pledge. + /// @param idxDelegate The ID internally representing the delegate. + function getPledgeDelegate(uint64 idPledge, uint _idxDelegate) constant returns( + uint64 idxDelegate, address addr, string name ) { Pledge storage n = findPledge(idPledge); - idDelegate = n.delegationChain[idxDelegate - 1]; - PledgeAdmin storage delegate = findAdmin(idDelegate); + idxDelegate = n.delegationChain[_idxDelegate - 1]; + PledgeAdmin storage delegate = findAdmin(idxDelegate); addr = delegate.addr; name = delegate.name; } - /// @notice Public constant that states the number of admins in the system + + /// @notice `numberOfPledgeAdmins` is a constant getter that simply returns + /// the number of admins (Givers, Delegates and Projects are all "admins"). function numberOfPledgeAdmins() constant returns(uint) { return admins.length - 1; } - /// @notice Public constant that states the details of the specified admin + + /// @notice `getPledgeAdmin` is a constant getter that simply returns + /// the address, name, url, the current commit time and the previous + /// the parentProject, whether the project has been cancelled + /// and the projects plugin for a specific project. function getPledgeAdmin(uint64 idAdmin) constant returns ( PledgeAdminType adminType, address addr, @@ -309,10 +456,16 @@ contract LiquidPledgingBase { // Private methods /////// - /// @notice All pledges technically exist... but if the pledge hasn't been - /// created in this system yet then it wouldn't be in the hash array - /// hPledge2idx[]; this creates a Pledge with and amount of 0 if one is not - /// created already... + /// @notice All pledges technically exist. If the pledge hasn't been + /// created in this system yet it simply isn't in the hash array + /// hPledge2idx[] yet; this creates a Pledge with an initial amount of 0 if one is not + /// created already. Otherwise + /// @param owner The owner of the pledge being looked up. + /// @param delegationChain The array of all delegates. + /// @param intendedProject The intended project is the project this pledge will Fund. + /// @param oldPledge This value is used to store the pledge the current pledge + /// is "coming from." + /// @param paid Based on the payment state this shows whether the pledge has been paid. function findOrCreatePledge( uint64 owner, uint64[] delegationChain, @@ -331,11 +484,17 @@ contract LiquidPledgingBase { return idx; } + /// @notice `findAdmin` is a basic getter to return a + /// specific admin (giver, delegate, or project) + /// @param idAdmin The admin ID to lookup. function findAdmin(uint64 idAdmin) internal returns (PledgeAdmin storage) { require(idAdmin < admins.length); return admins[idAdmin]; } + /// @notice `findPledge` is a basic getter to return a + /// specific pledge + /// @param idPledge The admin ID to pledge. function findPledge(uint64 idPledge) internal returns (Pledge storage) { require(idPledge < pledges.length); return pledges[idPledge]; @@ -344,25 +503,32 @@ contract LiquidPledgingBase { // a constant for the case that a delegate is requested that is not a delegate in the system uint64 constant NOTFOUND = 0xFFFFFFFFFFFFFFFF; - // helper function that searches the delegationChain fro a specific delegate and - // level of delegation returns their idx in the delegation chain which reflect their level of authority - function getDelegateIdx(Pledge n, uint64 idDelegate) internal returns(uint64) { + /// @notice `getDelegateIdx` is a helper function that searches the delegationChain + /// for a specific delegate and level of delegation returns their idx in the + /// delegation chain which reflect their level of authority. Returns MAX uint64 + /// if no delegate is found. + /// @param n The pledge that will be searched. + /// @param idxDelegate The internal ID of the delegate that's searched for. + function getDelegateIdx(Pledge n, uint64 idxDelegate) internal returns(uint64) { for (uint i=0; i + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +/// @dev `ILiquidPledgingPlugin` is the basic interface for any +/// liquid pledging plugin contract ILiquidPledgingPlugin { + /// @notice Plugins are used (much like web hooks) to initiate an action /// upon any donation, delegation, or transfer; this is an optional feature - /// and allows for extreme customization of the contract + /// and allows for extreme customization of the contract. This function + /// implements any action that should be initiated before a transfer. + /// @param pledgeManager The admin or current manager of the pledge + /// @param pledgeFrom This is the Id from which value will be transfered. + /// @param pledgeTo This is the Id that value will be transfered to. /// @param context The situation that is triggering the plugin: /// 0 -> Plugin for the owner transferring pledge to another party /// 1 -> Plugin for the first delegate transferring pledge to another party @@ -18,34 +44,77 @@ contract ILiquidPledgingPlugin { /// 258 -> Plugin for the second delegate receiving pledge to another party /// ... /// 511 -> Plugin for the intendedProject receiving pledge to another party + /// @param amount The amount of value that will be transfered. function beforeTransfer( uint64 pledgeManager, uint64 pledgeFrom, uint64 pledgeTo, uint64 context, - uint amount - ) returns (uint maxAllowed); + uint amount ) returns (uint maxAllowed); + + /// @notice Plugins are used (much like web hooks) to initiate an action + /// upon any donation, delegation, or transfer; this is an optional feature + /// and allows for extreme customization of the contract. This function + /// implements any action that should be initiated after a transfer. + /// @param pledgeManager The admin or current manager of the pledge + /// @param pledgeFrom This is the Id from which value will be transfered. + /// @param pledgeTo This is the Id that value will be transfered to. + /// @param context The situation that is triggering the plugin: + /// 0 -> Plugin for the owner transferring pledge to another party + /// 1 -> Plugin for the first delegate transferring pledge to another party + /// 2 -> Plugin for the second delegate transferring pledge to another party + /// ... + /// 255 -> Plugin for the intendedProject transferring pledge to another party + /// + /// 256 -> Plugin for the owner receiving pledge to another party + /// 257 -> Plugin for the first delegate receiving pledge to another party + /// 258 -> Plugin for the second delegate receiving pledge to another party + /// ... + /// 511 -> Plugin for the intendedProject receiving pledge to another party + /// @param amount The amount of value that will be transfered. function afterTransfer( uint64 pledgeManager, uint64 pledgeFrom, uint64 pledgeTo, uint64 context, - uint amount); + uint amount + ); } -//File: contracts/LiquidPledgingBase.sol +//File: contracts\LiquidPledgingBase.sol pragma solidity ^0.4.11; +/* + Copyright 2017, Jordi Baylina + Contributor: AdriĆ  Massanet + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ -/// @dev This is declares a few functions from `Vault` so that the -/// `LiquidPledgingBase` contract can interface with the `Vault` contract -contract Vault { +/// @dev `Vault` serves as an interface to allow the `LiquidPledgingBase` +/// contract to interface with a `Vault` contract +contract LPVault { function authorizePayment(bytes32 _ref, address _dest, uint _amount); function () payable; } +/// @dev `LiquidPledgingBase` is the base level contract used to carry out +/// liquid pledging. This function mostly handles the data structures +/// and basic CRUD methods for liquid pledging. contract LiquidPledgingBase { + // Limits inserted to prevent large loops that could prevent canceling uint constant MAX_DELEGATES = 20; uint constant MAX_SUBPROJECT_LEVEL = 20; @@ -54,7 +123,7 @@ contract LiquidPledgingBase { enum PledgeAdminType { Giver, Delegate, Project } enum PaymentState { Pledged, Paying, Paid } // TODO name change Pledged - /// @dev This struct defines the details of each the PledgeAdmin, these + /// @notice This struct defines the details of each the PledgeAdmin, these /// PledgeAdmins can own pledges and act as delegates struct PledgeAdmin { // TODO name change PledgeAdmin PledgeAdminType adminType; // Giver, Delegate or Project @@ -64,24 +133,31 @@ contract LiquidPledgingBase { uint64 commitTime; // In seconds, used for Givers' & Delegates' vetos uint64 parentProject; // Only for projects bool canceled; //Always false except for canceled projects - ILiquidPledgingPlugin plugin; // if the plugin is 0x0 then nothing happens if its a contract address than that smart contract is called via the milestone contract + // if the plugin is 0x0 then nothing happens if its a contract address + // than that smart contract is called via the milestone contract + ILiquidPledgingPlugin plugin; } struct Pledge { uint amount; uint64 owner; // PledgeAdmin uint64[] delegationChain; // list of index numbers - uint64 intendedProject; // TODO change the name only used for when delegates are precommiting to a project - uint64 commitTime; // When the intendedProject will become the owner - uint64 oldPledge; // this points to the Pledge[] index that the Pledge was derived from + // TODO change the name only used for when delegates are + // pre-committing to a project + uint64 intendedProject; + // When the intendedProject will become the owner + uint64 commitTime; + // this points to the Pledge[] index that the Pledge was derived from + uint64 oldPledge; PaymentState paymentState; } Pledge[] pledges; PledgeAdmin[] admins; //The list of pledgeAdmins 0 means there is no admin - Vault public vault; + LPVault public vault; - // this mapping allows you to search for a specific pledge's index number by the hash of that pledge + // this mapping allows you to search for a specific pledge's + // index number by the hash of that pledge mapping (bytes32 => uint64) hPledge2idx;//TODO Fix typo @@ -89,6 +165,7 @@ contract LiquidPledgingBase { // Modifiers ///// + /// @notice basic method to restrict a function to only the current vault modifier onlyVault() { require(msg.sender == address(vault)); _; @@ -99,12 +176,13 @@ contract LiquidPledgingBase { // Constructor ////// - /// @notice The Constructor creates the `LiquidPledgingBase` on the blockchain - /// @param _vault Where the ETH is stored that the pledges represent + /// @notice The Constructor creates the `LiquidPledgingBase` + /// on the blockchain + /// @param _vault The vault where ETH backing this pledge is stored function LiquidPledgingBase(address _vault) { admins.length = 1; // we reserve the 0 admin pledges.length = 1; // we reserve the 0 pledge - vault = Vault(_vault); + vault = LPVault(_vault); } @@ -112,9 +190,18 @@ contract LiquidPledgingBase { // Adminss functions ////// - /// @notice Creates a giver. - function addGiver(string name, string url, uint64 commitTime, ILiquidPledgingPlugin plugin - ) returns (uint64 idGiver) { + /// @notice `addGiver` Creates a giver and adds them to the list of admins. + /// @param name This is the name used to identify the giver. + /// @param url This is a link to the givers profile or a representative site. + /// @param commitTime Set the default commit time period for this giver. + /// @param plugin This is givers liquid pledge plugin allowing for + /// extended functionality. + function addGiver( + string name, + string url, + uint64 commitTime, + ILiquidPledgingPlugin plugin + ) returns (uint64 idGiver) { idGiver = uint64(admins.length); @@ -133,7 +220,15 @@ contract LiquidPledgingBase { event GiverAdded(uint64 indexed idGiver); - ///@notice Changes the address, name or commitTime associated with a specific giver + /// @notice `updateGiver` allows for basic update operation to change the address, + /// name or commitTime associated with a specific giver. + /// @param idGiver This is the internal ID used to specify the admin lookup + /// that coresponds to the giver. + /// @param newAddr This parameter specifies an address to change the given + /// correspondancec between the giver's internal ID and an external address. + /// @param newName This is the name used to identify the giver. + /// @param newUrl This is a link to the givers profile or a representative site. + /// @param newCommitTime Set the default commit time period for this giver. function updateGiver( uint64 idGiver, address newAddr, @@ -153,10 +248,19 @@ contract LiquidPledgingBase { event GiverUpdated(uint64 indexed idGiver); - /// @notice Creates a new Delegate - function addDelegate(string name, string url, uint64 commitTime, ILiquidPledgingPlugin plugin) returns (uint64 idDelegate) { //TODO return index number + /// @notice `addDelegate` Creates a delegate and adds them to the list of admins. + /// @param name This is the name used to identify the delegate. + /// @param url This is a link to the delegates profile or a representative site. + /// @param commitTime Set the default commit time period for this delegate. + /// @param plugin This is givers liquid pledge plugin allowing for extended functionality. + function addDelegate( + string name, + string url, + uint64 commitTime, + ILiquidPledgingPlugin plugin + ) returns (uint64 idxDelegate) { //TODO return index number - idDelegate = uint64(admins.length); + idxDelegate = uint64(admins.length); admins.push(PledgeAdmin( PledgeAdminType.Delegate, @@ -168,32 +272,54 @@ contract LiquidPledgingBase { false, plugin)); - DelegateAdded(idDelegate); + DelegateAdded(idxDelegate); } - event DelegateAdded(uint64 indexed idDelegate); + event DelegateAdded(uint64 indexed idxDelegate); - ///@notice Changes the address, name or commitTime associated with a specific delegate + /// @notice `updateDelegate` allows for basic update operation to change the address, + /// name or commitTime associated with a specific delegate. + /// @param idxDelegate This is the internal ID used to specify the admin lookup + /// that coresponds to the delegate. + /// @param newAddr This parameter specifies an address to change the given + /// correspondancec between the giver's internal ID and an external address. + /// @param newName This is the name used to identify the delegate. + /// @param newUrl This is a link to the delegates profile or a representative site. + /// @param newCommitTime Set the default commit time period for this giver. function updateDelegate( - uint64 idDelegate, + uint64 idxDelegate, address newAddr, string newName, string newUrl, uint64 newCommitTime) { - PledgeAdmin storage delegate = findAdmin(idDelegate); + PledgeAdmin storage delegate = findAdmin(idxDelegate); require(delegate.adminType == PledgeAdminType.Delegate); require(delegate.addr == msg.sender); delegate.addr = newAddr; delegate.name = newName; delegate.url = newUrl; delegate.commitTime = newCommitTime; - DelegateUpdated(idDelegate); + DelegateUpdated(idxDelegate); } - event DelegateUpdated(uint64 indexed idDelegate); + event DelegateUpdated(uint64 indexed idxDelegate); - /// @notice Creates a new Project - function addProject(string name, string url, address projectAdmin, uint64 parentProject, uint64 commitTime, ILiquidPledgingPlugin plugin) returns (uint64 idProject) { + /// @notice `addProject` Creates a project and adds it to the list of admins. + /// @param name This is the name used to identify the project. + /// @param url This is a link to the projects profile or a representative site. + /// @param projectAdmin This is the projects admin. This should be a trusted individual. + /// @param parentProject If this project has a parent project or a project it's + /// derived from use this parameter to supply it. + /// @param commitTime Set the default commit time period for this project. + /// @param plugin This is the projects liquid pledge plugin allowing for extended functionality. + function addProject( + string name, + string url, + address projectAdmin, + uint64 parentProject, + uint64 commitTime, + ILiquidPledgingPlugin plugin + ) returns (uint64 idProject) { if (parentProject != 0) { PledgeAdmin storage pa = findAdmin(parentProject); require(pa.adminType == PledgeAdminType.Project); @@ -218,7 +344,15 @@ contract LiquidPledgingBase { event ProjectAdded(uint64 indexed idProject); - ///@notice Changes the address, name or commitTime associated with a specific Project + /// @notice `updateProject` allows for basic update operation to change the address, + /// name or commitTime associated with a specific project. + /// @param idProject This is the internal ID used to specify the admin lookup + /// that coresponds to the project. + /// @param newAddr This parameter specifies an address to change the given + /// correspondance between the project's internal ID and an external address. + /// @param newName This is the name used to identify the project. + /// @param newUrl This is a link to the projects profile or a representative site. + /// @param newCommitTime Set the default commit time period for this project. function updateProject( uint64 idProject, address newAddr, @@ -243,11 +377,15 @@ contract LiquidPledgingBase { // Public constant functions ////////// - /// @notice Public constant that states how many pledgess are in the system + /// @notice `numberOfPledges` is a constant getter that simply returns + /// the number of pledges. function numberOfPledges() constant returns (uint) { return pledges.length - 1; } - /// @notice Public constant that states the details of the specified Pledge + + /// @notice `getPledge` is a constant getter that simply returns + /// the amount, owner, the number of delegates, the intended project, + /// the current commit time and the previous pledge attached to a specific pledge. function getPledge(uint64 idPledge) constant returns( uint amount, uint64 owner, @@ -266,24 +404,33 @@ contract LiquidPledgingBase { oldPledge = n.oldPledge; paymentState = n.paymentState; } - /// @notice Public constant that states the delegates one by one, because - /// an array cannot be returned - function getPledgeDelegate(uint64 idPledge, uint idxDelegate) constant returns( - uint64 idDelegate, + + /// @notice `getPledgeDelegate` returns a single delegate given the pledge ID + /// and the delegate ID. + /// @param idPledge The ID internally representing the pledge. + /// @param idxDelegate The ID internally representing the delegate. + function getPledgeDelegate(uint64 idPledge, uint _idxDelegate) constant returns( + uint64 idxDelegate, address addr, string name ) { Pledge storage n = findPledge(idPledge); - idDelegate = n.delegationChain[idxDelegate - 1]; - PledgeAdmin storage delegate = findAdmin(idDelegate); + idxDelegate = n.delegationChain[_idxDelegate - 1]; + PledgeAdmin storage delegate = findAdmin(idxDelegate); addr = delegate.addr; name = delegate.name; } - /// @notice Public constant that states the number of admins in the system + + /// @notice `numberOfPledgeAdmins` is a constant getter that simply returns + /// the number of admins (Givers, Delegates and Projects are all "admins"). function numberOfPledgeAdmins() constant returns(uint) { return admins.length - 1; } - /// @notice Public constant that states the details of the specified admin + + /// @notice `getPledgeAdmin` is a constant getter that simply returns + /// the address, name, url, the current commit time and the previous + /// the parentProject, whether the project has been cancelled + /// and the projects plugin for a specific project. function getPledgeAdmin(uint64 idAdmin) constant returns ( PledgeAdminType adminType, address addr, @@ -309,10 +456,16 @@ contract LiquidPledgingBase { // Private methods /////// - /// @notice All pledges technically exist... but if the pledge hasn't been - /// created in this system yet then it wouldn't be in the hash array - /// hPledge2idx[]; this creates a Pledge with and amount of 0 if one is not - /// created already... + /// @notice All pledges technically exist. If the pledge hasn't been + /// created in this system yet it simply isn't in the hash array + /// hPledge2idx[] yet; this creates a Pledge with an initial amount of 0 if one is not + /// created already. Otherwise + /// @param owner The owner of the pledge being looked up. + /// @param delegationChain The array of all delegates. + /// @param intendedProject The intended project is the project this pledge will Fund. + /// @param oldPledge This value is used to store the pledge the current pledge + /// is "coming from." + /// @param paid Based on the payment state this shows whether the pledge has been paid. function findOrCreatePledge( uint64 owner, uint64[] delegationChain, @@ -331,11 +484,17 @@ contract LiquidPledgingBase { return idx; } + /// @notice `findAdmin` is a basic getter to return a + /// specific admin (giver, delegate, or project) + /// @param idAdmin The admin ID to lookup. function findAdmin(uint64 idAdmin) internal returns (PledgeAdmin storage) { require(idAdmin < admins.length); return admins[idAdmin]; } + /// @notice `findPledge` is a basic getter to return a + /// specific pledge + /// @param idPledge The admin ID to pledge. function findPledge(uint64 idPledge) internal returns (Pledge storage) { require(idPledge < pledges.length); return pledges[idPledge]; @@ -344,25 +503,32 @@ contract LiquidPledgingBase { // a constant for the case that a delegate is requested that is not a delegate in the system uint64 constant NOTFOUND = 0xFFFFFFFFFFFFFFFF; - // helper function that searches the delegationChain fro a specific delegate and - // level of delegation returns their idx in the delegation chain which reflect their level of authority - function getDelegateIdx(Pledge n, uint64 idDelegate) internal returns(uint64) { + /// @notice `getDelegateIdx` is a helper function that searches the delegationChain + /// for a specific delegate and level of delegation returns their idx in the + /// delegation chain which reflect their level of authority. Returns MAX uint64 + /// if no delegate is found. + /// @param n The pledge that will be searched. + /// @param idxDelegate The internal ID of the delegate that's searched for. + function getDelegateIdx(Pledge n, uint64 idxDelegate) internal returns(uint64) { for (uint i=0; i + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +// Contract Imports - +/// @dev `LiquidPleding` allows for liquid pledging through the use of +/// internal id structures and delegate chaining. All basic operations for +/// handling liquid pledging are supplied as well as plugin features +/// to allow for expanded functionality. contract LiquidPledging is LiquidPledgingBase { @@ -424,7 +623,11 @@ contract LiquidPledging is LiquidPledgingBase { // Constructor ////// - // This constructor also calls the constructor for `LiquidPledgingBase` + /// @notice Basic constructor for LiquidPleding, also calls the + /// LiquidPledgingBase contract + /// @dev This constructor also calls the constructor + /// for `LiquidPledgingBase` + /// @param _vault The vault where ETH backing this pledge is stored function LiquidPledging(address _vault) LiquidPledgingBase(_vault) { } @@ -433,12 +636,12 @@ contract LiquidPledging is LiquidPledgingBase { /// relevant to this Giver without delegates is increased, and a normal /// transfer is done to the idReceiver /// @param idGiver Identifier of the giver thats donating. - /// @param idReceiver To whom it's transfered. Can be the same giver, another - /// giver, a delegate or a project - -function donate(uint64 idGiver, uint64 idReceiver) payable { + /// @param idReceiver To whom it's transfered. Can be the same giver, + /// another giver, a delegate or a project. + function donate(uint64 idGiver, uint64 idReceiver) payable { if (idGiver == 0) { - idGiver = addGiver('', '', 259200, ILiquidPledgingPlugin(0x0)); // default to 3 day commitTime + // default to 3 day commitTime + idGiver = addGiver("", "", 259200, ILiquidPledgingPlugin(0x0)); } PledgeAdmin storage sender = findAdmin(idGiver); @@ -458,7 +661,8 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { 0, 0, 0, - PaymentState.Pledged); + PaymentState.Pledged + ); Pledge storage nTo = findPledge(idPledge); @@ -471,13 +675,21 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { /// @notice Moves value between pledges - /// @param idSender ID of the giver, delegate or project admin that is transferring - /// the funds from Pledge to Pledge. This admin must have permissions to move the value + /// @param idSender ID of the giver, delegate or project admin that is + /// transferring the funds from Pledge to Pledge; this admin must have + /// permissions to move the value /// @param idPledge Id of the pledge that's moving the value /// @param amount Quantity of value that's being moved - /// @param idReceiver Destination of the value, can be a giver sending to a giver or - /// a delegate, a delegate to another delegate or a project to precommit it to that project - function transfer(uint64 idSender, uint64 idPledge, uint amount, uint64 idReceiver) { + /// @param idReceiver Destination of the value, can be a giver sending to + /// a giver or a delegate, a delegate to another delegate or a project + /// to pre-commit it to that project + function transfer( + uint64 idSender, + uint64 idPledge, + uint amount, + uint64 idReceiver + ) + { idPledge = normalizePledge(idPledge); @@ -495,7 +707,11 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { } else if (receiver.adminType == PledgeAdminType.Project) { transferOwnershipToProject(idPledge, amount, idReceiver); } else if (receiver.adminType == PledgeAdminType.Delegate) { - idPledge = undelegate(idPledge, amount, n.delegationChain.length); + idPledge = undelegate( + idPledge, + amount, + n.delegationChain.length + ); appendDelegate(idPledge, amount, idReceiver); } else { assert(false); @@ -509,7 +725,8 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { // If the receiver is another giver if (receiver.adminType == PledgeAdminType.Giver) { - // Only accept to change to the original giver to remove all delegates + // Only accept to change to the original giver to + // remove all delegates assert(n.owner == idReceiver); undelegate(idPledge, amount, n.delegationChain.length); return; @@ -521,31 +738,49 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { // If the receiver is not in the delegate list if (receiverDIdx == NOTFOUND) { - idPledge = undelegate(idPledge, amount, n.delegationChain.length - senderDIdx - 1); + idPledge = undelegate( + idPledge, + amount, + n.delegationChain.length - senderDIdx - 1 + ); appendDelegate(idPledge, amount, idReceiver); // If the receiver is already part of the delegate chain and is - // after the sender, then all of the other delegates after the sender are - // removed and the receiver is appended at the end of the delegation chain + // after the sender, then all of the other delegates after the + // sender are removed and the receiver is appended at the + // end of the delegation chain } else if (receiverDIdx > senderDIdx) { - idPledge = undelegate(idPledge, amount, n.delegationChain.length - senderDIdx - 1); + idPledge = undelegate( + idPledge, + amount, + n.delegationChain.length - senderDIdx - 1 + ); appendDelegate(idPledge, amount, idReceiver); // If the receiver is already part of the delegate chain and is // before the sender, then the sender and all of the other - // delegates after the RECEIVER are revomved from the chain, - // this is interesting because the delegate undelegates from the - // delegates that delegated to this delegate... game theory issues? should this be allowed + // delegates after the RECEIVER are removed from the chain, + // this is interesting because the delegate is removed from the + // delegates that delegated to this delegate. Are there game theory + // issues? should this be allowed? } else if (receiverDIdx <= senderDIdx) { - undelegate(idPledge, amount, n.delegationChain.length - receiverDIdx -1); + undelegate( + idPledge, + amount, + n.delegationChain.length - receiverDIdx - 1 + ); } return; } - // If the delegate wants to support a project, they undelegate all + // If the delegate wants to support a project, they remove all // the delegates after them in the chain and choose a project if (receiver.adminType == PledgeAdminType.Project) { - idPledge = undelegate(idPledge, amount, n.delegationChain.length - senderDIdx - 1); + idPledge = undelegate( + idPledge, + amount, + n.delegationChain.length - senderDIdx - 1 + ); proposeAssignProject(idPledge, amount, idReceiver); return; } @@ -554,9 +789,9 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { } - /// @notice This method is used to withdraw value from the system. This can be used - /// by the givers to avoid committing the donation or by project admin to use - /// the Ether. + /// @notice This method is used to withdraw value from the system. + /// This can be used by the givers to avoid committing the donation + /// or by project admin to use the Ether. /// @param idPledge Id of the pledge that wants to be withdrawn. /// @param amount Quantity of Ether that wants to be withdrawn. function withdraw(uint64 idPledge, uint amount) { @@ -641,7 +876,9 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { 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. function cancelPledge(uint64 idPledge, uint amount) { idPledge = normalizePledge(idPledge); @@ -658,10 +895,28 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { // Multi pledge methods //////// - // This set of functions makes moving a lot of pledges around much more + // @dev This set of functions makes moving a lot of pledges around much more // efficient (saves gas) than calling these functions in series + + + /// Bit mask used for dividing pledge amounts in Multi pledge methods uint constant D64 = 0x10000000000000000; - function mTransfer(uint64 idSender, uint[] pledgesAmounts, uint64 idReceiver) { + + /// @notice `mTransfer` allows for multiple pledges to be transferred + /// efficiently + /// @param idSender ID of the giver, delegate or project admin that is + /// transferring the funds from Pledge to Pledge. This admin must have + /// permissions to move the value + /// @param pledgesAmounts An array of pledge amounts and IDs which are extrapolated + /// using the D64 bitmask + /// @param idReceiver Destination of the value, can be a giver sending + /// to a giver or a delegate or a delegate to another delegate or a + /// project to pre-commit it to that project + function mTransfer( + uint64 idSender, + uint[] pledgesAmounts, + uint64 idReceiver + ) { for (uint i = 0; i < pledgesAmounts.length; i++ ) { uint64 idPledge = uint64( pledgesAmounts[i] & (D64-1) ); uint amount = pledgesAmounts[i] / D64; @@ -670,6 +925,10 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { } } + /// @notice `mWithdraw` allows for multiple pledges to be + /// withdrawn efficiently + /// @param pledgesAmounts An array of pledge amounts and IDs which are + /// extrapolated using the D64 bitmask function mWithdraw(uint[] pledgesAmounts) { for (uint i = 0; i < pledgesAmounts.length; i++ ) { uint64 idPledge = uint64( pledgesAmounts[i] & (D64-1) ); @@ -679,6 +938,10 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { } } + /// @notice `mConfirmPayment` allows for multiple pledges to be confirmed + /// efficiently + /// @param pledgesAmounts An array of pledge amounts and IDs which are extrapolated + /// using the D64 bitmask function mConfirmPayment(uint[] pledgesAmounts) { for (uint i = 0; i < pledgesAmounts.length; i++ ) { uint64 idPledge = uint64( pledgesAmounts[i] & (D64-1) ); @@ -688,6 +951,10 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { } } + /// @notice `mCancelPayment` allows for multiple pledges to be canceled + /// efficiently + /// @param pledgesAmounts An array of pledge amounts and IDs which are extrapolated + /// using the D64 bitmask function mCancelPayment(uint[] pledgesAmounts) { for (uint i = 0; i < pledgesAmounts.length; i++ ) { uint64 idPledge = uint64( pledgesAmounts[i] & (D64-1) ); @@ -697,6 +964,10 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { } } + /// @notice `mNormalizePledge` allows for multiple pledges to be + /// normalized efficiently + /// @param pledges An array of pledge IDs which are extrapolated using + /// the D64 bitmask function mNormalizePledge(uint[] pledges) returns(uint64) { for (uint i = 0; i < pledges.length; i++ ) { uint64 idPledge = uint64( pledges[i] & (D64-1) ); @@ -709,11 +980,21 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { // Private methods /////// - // this function is obvious, but it can also be called to undelegate everyone - // by setting yourself as the idReceiver - function transferOwnershipToProject(uint64 idPledge, uint amount, uint64 idReceiver) internal { + /// @notice `transferOwnershipToProject` allows for the transfer of + /// ownership to the project, but it can also be called to un-delegate + /// everyone by setting one's own id for the idReceiver + /// @param idPledge Id of the pledge to be transfered. + /// @param amount Quantity of value that's being transfered + /// @param idReceiver The new owner of the project (or self to un-delegate) + function transferOwnershipToProject( + uint64 idPledge, + uint amount, + uint64 idReceiver + ) internal { Pledge storage n = findPledge(idPledge); + // Ensure that the pledge is not already at max pledge depth + // and the project has not been canceled require(getPledgeLevel(n) < MAX_INTERPROJECT_LEVEL); require(!isProjectCanceled(idReceiver)); @@ -723,34 +1004,59 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { 0, 0, n.oldPledge, - PaymentState.Pledged); + PaymentState.Pledged + ); + uint64 toPledge = findOrCreatePledge( + idReceiver, // Set the new owner + new uint64[](0), // clear the delegation chain + 0, + 0, + oldPledge, + PaymentState.Pledged + ); + doTransfer(idPledge, toPledge, amount); + } + + + /// @notice `transferOwnershipToGiver` allows for the transfer of + /// value back to the Giver, value is placed in a pledged state + /// without being attached to a project, delegation chain, or time line. + /// @param idPledge Id of the pledge to be transfered. + /// @param amount Quantity of value that's being transfered + /// @param idReceiver The new owner of the pledge + function transferOwnershipToGiver( + uint64 idPledge, + uint amount, + uint64 idReceiver + ) internal { uint64 toPledge = findOrCreatePledge( idReceiver, new uint64[](0), 0, 0, - oldPledge, - PaymentState.Pledged); + 0, + PaymentState.Pledged + ); doTransfer(idPledge, toPledge, amount); } - function transferOwnershipToGiver(uint64 idPledge, uint amount, uint64 idReceiver) internal { - uint64 toPledge = findOrCreatePledge( - idReceiver, - new uint64[](0), - 0, - 0, - 0, - PaymentState.Pledged); - doTransfer(idPledge, toPledge, amount); - } + /// @notice `appendDelegate` allows for a delegate to be added onto the + /// end of the delegate chain for a given Pledge. + /// @param idPledge Id of the pledge thats delegate chain will be modified. + /// @param amount Quantity of value that's being chained. + /// @param idReceiver The delegate to be added at the end of the chain + function appendDelegate( + uint64 idPledge, + uint amount, + uint64 idReceiver + ) internal { + Pledge storage n = findPledge(idPledge); - function appendDelegate(uint64 idPledge, uint amount, uint64 idReceiver) internal { - Pledge storage n= findPledge(idPledge); - - require(n.delegationChain.length < MAX_DELEGATES); //TODO change to revert and say the error - uint64[] memory newDelegationChain = new uint64[](n.delegationChain.length + 1); - for (uint i=0; i= amount); @@ -817,21 +1153,32 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { callPlugins(false, from, to, amount); } - // This function does 2 things, #1: it checks to make sure that the pledges are correct - // if the a pledged project has already been committed then it changes the owner - // to be the proposed project (Pledge that the UI will have to read the commit time and manually - // do what this function does to the pledge for the end user at the expiration of the commitTime) - // #2: It checks to make sure that if there has been a cancellation in the chain of projects, - // then it adjusts the pledge's owner appropriately. - // This call can be called from any body at any time on any pledge. In general it can be called - // to force the calls of the affected plugins, which also need to be predicted by the UI + /// @notice `normalizePledge` does 2 things: + /// #1: Checks to make sure that the pledges are correct. Then if + /// a pledged project has already been committed, it changes + /// the owner to be the proposed project (The UI + /// will have to read the commit time and manually do what + /// this function does to the pledge for the end user + /// at the expiration of the commitTime) + /// + /// #2: Checks to make sure that if there has been a cancellation in the + /// chain of projects, the pledge's owner has been changed + /// appropriately. + /// + /// This function can be called by anybody at anytime on any pledge. + /// In general it can be called to force the calls of the affected + /// plugins, which also need to be predicted by the UI + /// @param idPledge This is the id of the pledge that will be normalized function normalizePledge(uint64 idPledge) returns(uint64) { + Pledge storage n = findPledge(idPledge); - // Check to make sure this pledge hasnt already been used or is in the process of being used - if (n.paymentState != PaymentState.Pledged) return idPledge; + // Check to make sure this pledge hasn't already been used + // or is in the process of being used + if (n.paymentState != PaymentState.Pledged) + return idPledge; - // First send to a project if it's proposed and commited + // First send to a project if it's proposed and committed if ((n.intendedProject > 0) && ( getTime() > n.commitTime)) { uint64 oldPledge = findOrCreatePledge( n.owner, @@ -864,52 +1211,165 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { // Plugins ///////////// - function callPlugin(bool before, uint64 adminId, uint64 fromPledge, uint64 toPledge, uint64 context, uint amount) internal returns (uint allowedAmount) { + /// @notice `callPlugin` is used to trigger the general functions in the + /// plugin for any actions needed before and after a transfer happens. + /// Specifically what this does in relation to the plugin is something + /// that largely depends on the functions of that plugin. This function + /// is generally called in pairs, once before, and once after a transfer. + /// @param before This toggle determines whether the plugin call is occurring + /// before or after a transfer. + /// @param adminId This should be the Id of the *trusted* individual + /// who has control over this plugin. + /// @param fromPledge This is the Id from which value is being transfered. + /// @param toPledge This is the Id that value is being transfered to. + /// @param context The situation that is triggering the plugin. See plugin + /// for a full description of contexts. + /// @param amount The amount of value that is being transfered. + function callPlugin( + bool before, + uint64 adminId, + uint64 fromPledge, + uint64 toPledge, + uint64 context, + uint amount + ) internal returns (uint allowedAmount) { + uint newAmount; allowedAmount = amount; PledgeAdmin storage admin = findAdmin(adminId); + // Checks admin has a plugin assigned and a non-zero amount is requested if ((address(admin.plugin) != 0) && (allowedAmount > 0)) { + // There are two seperate functions called in the plugin. + // One is called before the transfer and one after if (before) { - newAmount = admin.plugin.beforeTransfer(adminId, fromPledge, toPledge, context, amount); + newAmount = admin.plugin.beforeTransfer( + adminId, + fromPledge, + toPledge, + context, + amount + ); require(newAmount <= allowedAmount); allowedAmount = newAmount; } else { - admin.plugin.afterTransfer(adminId, fromPledge, toPledge, context, amount); + admin.plugin.afterTransfer( + adminId, + fromPledge, + toPledge, + context, + amount + ); } } } - function callPluginsPledge(bool before, uint64 idPledge, uint64 fromPledge, uint64 toPledge, uint amount) internal returns (uint allowedAmount) { + /// @notice `callPluginsPledge` is used to apply plugin calls to + /// the delegate chain and the intended project if there is one. + /// It does so in either a transferring or receiving context based + /// on the `idPledge` and `fromPledge` parameters. + /// @param before This toggle determines whether the plugin call is occuring + /// before or after a transfer. + /// @param idPledge This is the Id of the pledge on which this plugin + /// is being called. + /// @param fromPledge This is the Id from which value is being transfered. + /// @param toPledge This is the Id that value is being transfered to. + /// @param amount The amount of value that is being transfered. + function callPluginsPledge( + bool before, + uint64 idPledge, + uint64 fromPledge, + uint64 toPledge, + uint amount + ) internal returns (uint allowedAmount) { + // Determine if callPlugin is being applied in a receiving + // or transferring context uint64 offset = idPledge == fromPledge ? 0 : 256; allowedAmount = amount; Pledge storage n = findPledge(idPledge); - allowedAmount = callPlugin(before, n.owner, fromPledge, toPledge, offset, allowedAmount); + // Always call the plugin on the owner + allowedAmount = callPlugin( + before, + n.owner, + fromPledge, + toPledge, + offset, + allowedAmount + ); + // Apply call plugin to all delegates for (uint64 i=0; i 0) { - allowedAmount = callPlugin(before, n.intendedProject, fromPledge, toPledge, offset + 255, allowedAmount); + allowedAmount = callPlugin( + before, + n.intendedProject, + fromPledge, + toPledge, + offset + 255, + allowedAmount + ); } } - function callPlugins(bool before, uint64 fromPledge, uint64 toPledge, uint amount) internal returns (uint allowedAmount) { + + /// @notice `callPlugins` calls `callPluginsPledge` once for the transfer + /// context and once for the receiving context. The aggregated + /// allowed amount is then returned. + /// @param before This toggle determines whether the plugin call is occuring + /// before or after a transfer. + /// @param fromPledge This is the Id from which value is being transfered. + /// @param toPledge This is the Id that value is being transfered to. + /// @param amount The amount of value that is being transfered. + function callPlugins( + bool before, + uint64 fromPledge, + uint64 toPledge, + uint amount + ) internal returns (uint allowedAmount) { allowedAmount = amount; - allowedAmount = callPluginsPledge(before, fromPledge, fromPledge, toPledge, allowedAmount); - allowedAmount = callPluginsPledge(before, toPledge, fromPledge, toPledge, allowedAmount); + // Call the pledges plugins in the transfer context + allowedAmount = callPluginsPledge( + before, + fromPledge, + fromPledge, + toPledge, + allowedAmount + ); + + // Call the pledges plugins in the receive context + allowedAmount = callPluginsPledge( + before, + toPledge, + fromPledge, + toPledge, + allowedAmount + ); } ///////////// // Test functions ///////////// + /// @notice Basic helper function to return the current time function getTime() internal returns (uint) { return now; } + // Event Delcerations event Transfer(uint64 indexed from, uint64 indexed to, uint amount); event CancelProject(uint64 indexed idProject); @@ -917,23 +1377,50 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { //File: ./contracts/LiquidPledgingMock.sol pragma solidity ^0.4.11; +/* + Copyright 2017, Jordi Baylina + Contributor: AdriĆ  Massanet + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ -// @dev LiquidPledgingMock mocks current block number - +/// @dev `LiquidPledgingMock` allows for mocking up +/// a `LiquidPledging` contract with the added ability +/// to manipulate the block time for testing purposes. contract LiquidPledgingMock is LiquidPledging { uint public mock_time; + /// @dev `LiquidPledgingMock` creates a standard `LiquidPledging` + /// instance and sets the mocked time to the current blocktime. + /// @param _vault The vault where ETH backing this pledge is stored function LiquidPledgingMock(address _vault) LiquidPledging(_vault) { mock_time = now; } + /// @dev `getTime` is a basic getter function for + /// the mock_time parameter function getTime() internal returns (uint) { return mock_time; } + /// @dev `setMockedTime` is a basic setter function for + /// the mock_time parameter + /// @param _t This is the value to which the mocked time + /// will be set. function setMockedTime(uint _t) { mock_time = _t; } diff --git a/build/LiquidPledging_all.sol b/build/LiquidPledging_all.sol index bb20d40..0e7e375 100644 --- a/build/LiquidPledging_all.sol +++ b/build/LiquidPledging_all.sol @@ -1,11 +1,37 @@ -//File: contracts/ILiquidPledgingPlugin.sol +//File: contracts\ILiquidPledgingPlugin.sol pragma solidity ^0.4.11; +/* + Copyright 2017, Jordi Baylina + Contributor: AdriĆ  Massanet + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +/// @dev `ILiquidPledgingPlugin` is the basic interface for any +/// liquid pledging plugin contract ILiquidPledgingPlugin { + /// @notice Plugins are used (much like web hooks) to initiate an action /// upon any donation, delegation, or transfer; this is an optional feature - /// and allows for extreme customization of the contract + /// and allows for extreme customization of the contract. This function + /// implements any action that should be initiated before a transfer. + /// @param pledgeManager The admin or current manager of the pledge + /// @param pledgeFrom This is the Id from which value will be transfered. + /// @param pledgeTo This is the Id that value will be transfered to. /// @param context The situation that is triggering the plugin: /// 0 -> Plugin for the owner transferring pledge to another party /// 1 -> Plugin for the first delegate transferring pledge to another party @@ -18,34 +44,77 @@ contract ILiquidPledgingPlugin { /// 258 -> Plugin for the second delegate receiving pledge to another party /// ... /// 511 -> Plugin for the intendedProject receiving pledge to another party + /// @param amount The amount of value that will be transfered. function beforeTransfer( uint64 pledgeManager, uint64 pledgeFrom, uint64 pledgeTo, uint64 context, - uint amount - ) returns (uint maxAllowed); + uint amount ) returns (uint maxAllowed); + + /// @notice Plugins are used (much like web hooks) to initiate an action + /// upon any donation, delegation, or transfer; this is an optional feature + /// and allows for extreme customization of the contract. This function + /// implements any action that should be initiated after a transfer. + /// @param pledgeManager The admin or current manager of the pledge + /// @param pledgeFrom This is the Id from which value will be transfered. + /// @param pledgeTo This is the Id that value will be transfered to. + /// @param context The situation that is triggering the plugin: + /// 0 -> Plugin for the owner transferring pledge to another party + /// 1 -> Plugin for the first delegate transferring pledge to another party + /// 2 -> Plugin for the second delegate transferring pledge to another party + /// ... + /// 255 -> Plugin for the intendedProject transferring pledge to another party + /// + /// 256 -> Plugin for the owner receiving pledge to another party + /// 257 -> Plugin for the first delegate receiving pledge to another party + /// 258 -> Plugin for the second delegate receiving pledge to another party + /// ... + /// 511 -> Plugin for the intendedProject receiving pledge to another party + /// @param amount The amount of value that will be transfered. function afterTransfer( uint64 pledgeManager, uint64 pledgeFrom, uint64 pledgeTo, uint64 context, - uint amount); + uint amount + ); } -//File: contracts/LiquidPledgingBase.sol +//File: contracts\LiquidPledgingBase.sol pragma solidity ^0.4.11; +/* + Copyright 2017, Jordi Baylina + Contributor: AdriĆ  Massanet + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ -/// @dev This is declares a few functions from `Vault` so that the -/// `LiquidPledgingBase` contract can interface with the `Vault` contract -contract Vault { +/// @dev `Vault` serves as an interface to allow the `LiquidPledgingBase` +/// contract to interface with a `Vault` contract +contract LPVault { function authorizePayment(bytes32 _ref, address _dest, uint _amount); function () payable; } +/// @dev `LiquidPledgingBase` is the base level contract used to carry out +/// liquid pledging. This function mostly handles the data structures +/// and basic CRUD methods for liquid pledging. contract LiquidPledgingBase { + // Limits inserted to prevent large loops that could prevent canceling uint constant MAX_DELEGATES = 20; uint constant MAX_SUBPROJECT_LEVEL = 20; @@ -54,7 +123,7 @@ contract LiquidPledgingBase { enum PledgeAdminType { Giver, Delegate, Project } enum PaymentState { Pledged, Paying, Paid } // TODO name change Pledged - /// @dev This struct defines the details of each the PledgeAdmin, these + /// @notice This struct defines the details of each the PledgeAdmin, these /// PledgeAdmins can own pledges and act as delegates struct PledgeAdmin { // TODO name change PledgeAdmin PledgeAdminType adminType; // Giver, Delegate or Project @@ -64,24 +133,31 @@ contract LiquidPledgingBase { uint64 commitTime; // In seconds, used for Givers' & Delegates' vetos uint64 parentProject; // Only for projects bool canceled; //Always false except for canceled projects - ILiquidPledgingPlugin plugin; // if the plugin is 0x0 then nothing happens if its a contract address than that smart contract is called via the milestone contract + // if the plugin is 0x0 then nothing happens if its a contract address + // than that smart contract is called via the milestone contract + ILiquidPledgingPlugin plugin; } struct Pledge { uint amount; uint64 owner; // PledgeAdmin uint64[] delegationChain; // list of index numbers - uint64 intendedProject; // TODO change the name only used for when delegates are precommiting to a project - uint64 commitTime; // When the intendedProject will become the owner - uint64 oldPledge; // this points to the Pledge[] index that the Pledge was derived from + // TODO change the name only used for when delegates are + // pre-committing to a project + uint64 intendedProject; + // When the intendedProject will become the owner + uint64 commitTime; + // this points to the Pledge[] index that the Pledge was derived from + uint64 oldPledge; PaymentState paymentState; } Pledge[] pledges; PledgeAdmin[] admins; //The list of pledgeAdmins 0 means there is no admin - Vault public vault; + LPVault public vault; - // this mapping allows you to search for a specific pledge's index number by the hash of that pledge + // this mapping allows you to search for a specific pledge's + // index number by the hash of that pledge mapping (bytes32 => uint64) hPledge2idx;//TODO Fix typo @@ -89,6 +165,7 @@ contract LiquidPledgingBase { // Modifiers ///// + /// @notice basic method to restrict a function to only the current vault modifier onlyVault() { require(msg.sender == address(vault)); _; @@ -99,12 +176,13 @@ contract LiquidPledgingBase { // Constructor ////// - /// @notice The Constructor creates the `LiquidPledgingBase` on the blockchain - /// @param _vault Where the ETH is stored that the pledges represent + /// @notice The Constructor creates the `LiquidPledgingBase` + /// on the blockchain + /// @param _vault The vault where ETH backing this pledge is stored function LiquidPledgingBase(address _vault) { admins.length = 1; // we reserve the 0 admin pledges.length = 1; // we reserve the 0 pledge - vault = Vault(_vault); + vault = LPVault(_vault); } @@ -112,9 +190,18 @@ contract LiquidPledgingBase { // Adminss functions ////// - /// @notice Creates a giver. - function addGiver(string name, string url, uint64 commitTime, ILiquidPledgingPlugin plugin - ) returns (uint64 idGiver) { + /// @notice `addGiver` Creates a giver and adds them to the list of admins. + /// @param name This is the name used to identify the giver. + /// @param url This is a link to the givers profile or a representative site. + /// @param commitTime Set the default commit time period for this giver. + /// @param plugin This is givers liquid pledge plugin allowing for + /// extended functionality. + function addGiver( + string name, + string url, + uint64 commitTime, + ILiquidPledgingPlugin plugin + ) returns (uint64 idGiver) { idGiver = uint64(admins.length); @@ -133,7 +220,15 @@ contract LiquidPledgingBase { event GiverAdded(uint64 indexed idGiver); - ///@notice Changes the address, name or commitTime associated with a specific giver + /// @notice `updateGiver` allows for basic update operation to change the address, + /// name or commitTime associated with a specific giver. + /// @param idGiver This is the internal ID used to specify the admin lookup + /// that coresponds to the giver. + /// @param newAddr This parameter specifies an address to change the given + /// correspondancec between the giver's internal ID and an external address. + /// @param newName This is the name used to identify the giver. + /// @param newUrl This is a link to the givers profile or a representative site. + /// @param newCommitTime Set the default commit time period for this giver. function updateGiver( uint64 idGiver, address newAddr, @@ -153,10 +248,19 @@ contract LiquidPledgingBase { event GiverUpdated(uint64 indexed idGiver); - /// @notice Creates a new Delegate - function addDelegate(string name, string url, uint64 commitTime, ILiquidPledgingPlugin plugin) returns (uint64 idDelegate) { //TODO return index number + /// @notice `addDelegate` Creates a delegate and adds them to the list of admins. + /// @param name This is the name used to identify the delegate. + /// @param url This is a link to the delegates profile or a representative site. + /// @param commitTime Set the default commit time period for this delegate. + /// @param plugin This is givers liquid pledge plugin allowing for extended functionality. + function addDelegate( + string name, + string url, + uint64 commitTime, + ILiquidPledgingPlugin plugin + ) returns (uint64 idxDelegate) { //TODO return index number - idDelegate = uint64(admins.length); + idxDelegate = uint64(admins.length); admins.push(PledgeAdmin( PledgeAdminType.Delegate, @@ -168,32 +272,54 @@ contract LiquidPledgingBase { false, plugin)); - DelegateAdded(idDelegate); + DelegateAdded(idxDelegate); } - event DelegateAdded(uint64 indexed idDelegate); + event DelegateAdded(uint64 indexed idxDelegate); - ///@notice Changes the address, name or commitTime associated with a specific delegate + /// @notice `updateDelegate` allows for basic update operation to change the address, + /// name or commitTime associated with a specific delegate. + /// @param idxDelegate This is the internal ID used to specify the admin lookup + /// that coresponds to the delegate. + /// @param newAddr This parameter specifies an address to change the given + /// correspondancec between the giver's internal ID and an external address. + /// @param newName This is the name used to identify the delegate. + /// @param newUrl This is a link to the delegates profile or a representative site. + /// @param newCommitTime Set the default commit time period for this giver. function updateDelegate( - uint64 idDelegate, + uint64 idxDelegate, address newAddr, string newName, string newUrl, uint64 newCommitTime) { - PledgeAdmin storage delegate = findAdmin(idDelegate); + PledgeAdmin storage delegate = findAdmin(idxDelegate); require(delegate.adminType == PledgeAdminType.Delegate); require(delegate.addr == msg.sender); delegate.addr = newAddr; delegate.name = newName; delegate.url = newUrl; delegate.commitTime = newCommitTime; - DelegateUpdated(idDelegate); + DelegateUpdated(idxDelegate); } - event DelegateUpdated(uint64 indexed idDelegate); + event DelegateUpdated(uint64 indexed idxDelegate); - /// @notice Creates a new Project - function addProject(string name, string url, address projectAdmin, uint64 parentProject, uint64 commitTime, ILiquidPledgingPlugin plugin) returns (uint64 idProject) { + /// @notice `addProject` Creates a project and adds it to the list of admins. + /// @param name This is the name used to identify the project. + /// @param url This is a link to the projects profile or a representative site. + /// @param projectAdmin This is the projects admin. This should be a trusted individual. + /// @param parentProject If this project has a parent project or a project it's + /// derived from use this parameter to supply it. + /// @param commitTime Set the default commit time period for this project. + /// @param plugin This is the projects liquid pledge plugin allowing for extended functionality. + function addProject( + string name, + string url, + address projectAdmin, + uint64 parentProject, + uint64 commitTime, + ILiquidPledgingPlugin plugin + ) returns (uint64 idProject) { if (parentProject != 0) { PledgeAdmin storage pa = findAdmin(parentProject); require(pa.adminType == PledgeAdminType.Project); @@ -218,7 +344,15 @@ contract LiquidPledgingBase { event ProjectAdded(uint64 indexed idProject); - ///@notice Changes the address, name or commitTime associated with a specific Project + /// @notice `updateProject` allows for basic update operation to change the address, + /// name or commitTime associated with a specific project. + /// @param idProject This is the internal ID used to specify the admin lookup + /// that coresponds to the project. + /// @param newAddr This parameter specifies an address to change the given + /// correspondance between the project's internal ID and an external address. + /// @param newName This is the name used to identify the project. + /// @param newUrl This is a link to the projects profile or a representative site. + /// @param newCommitTime Set the default commit time period for this project. function updateProject( uint64 idProject, address newAddr, @@ -243,11 +377,15 @@ contract LiquidPledgingBase { // Public constant functions ////////// - /// @notice Public constant that states how many pledgess are in the system + /// @notice `numberOfPledges` is a constant getter that simply returns + /// the number of pledges. function numberOfPledges() constant returns (uint) { return pledges.length - 1; } - /// @notice Public constant that states the details of the specified Pledge + + /// @notice `getPledge` is a constant getter that simply returns + /// the amount, owner, the number of delegates, the intended project, + /// the current commit time and the previous pledge attached to a specific pledge. function getPledge(uint64 idPledge) constant returns( uint amount, uint64 owner, @@ -266,24 +404,33 @@ contract LiquidPledgingBase { oldPledge = n.oldPledge; paymentState = n.paymentState; } - /// @notice Public constant that states the delegates one by one, because - /// an array cannot be returned - function getPledgeDelegate(uint64 idPledge, uint idxDelegate) constant returns( - uint64 idDelegate, + + /// @notice `getPledgeDelegate` returns a single delegate given the pledge ID + /// and the delegate ID. + /// @param idPledge The ID internally representing the pledge. + /// @param idxDelegate The ID internally representing the delegate. + function getPledgeDelegate(uint64 idPledge, uint _idxDelegate) constant returns( + uint64 idxDelegate, address addr, string name ) { Pledge storage n = findPledge(idPledge); - idDelegate = n.delegationChain[idxDelegate - 1]; - PledgeAdmin storage delegate = findAdmin(idDelegate); + idxDelegate = n.delegationChain[_idxDelegate - 1]; + PledgeAdmin storage delegate = findAdmin(idxDelegate); addr = delegate.addr; name = delegate.name; } - /// @notice Public constant that states the number of admins in the system + + /// @notice `numberOfPledgeAdmins` is a constant getter that simply returns + /// the number of admins (Givers, Delegates and Projects are all "admins"). function numberOfPledgeAdmins() constant returns(uint) { return admins.length - 1; } - /// @notice Public constant that states the details of the specified admin + + /// @notice `getPledgeAdmin` is a constant getter that simply returns + /// the address, name, url, the current commit time and the previous + /// the parentProject, whether the project has been cancelled + /// and the projects plugin for a specific project. function getPledgeAdmin(uint64 idAdmin) constant returns ( PledgeAdminType adminType, address addr, @@ -309,10 +456,16 @@ contract LiquidPledgingBase { // Private methods /////// - /// @notice All pledges technically exist... but if the pledge hasn't been - /// created in this system yet then it wouldn't be in the hash array - /// hPledge2idx[]; this creates a Pledge with and amount of 0 if one is not - /// created already... + /// @notice All pledges technically exist. If the pledge hasn't been + /// created in this system yet it simply isn't in the hash array + /// hPledge2idx[] yet; this creates a Pledge with an initial amount of 0 if one is not + /// created already. Otherwise + /// @param owner The owner of the pledge being looked up. + /// @param delegationChain The array of all delegates. + /// @param intendedProject The intended project is the project this pledge will Fund. + /// @param oldPledge This value is used to store the pledge the current pledge + /// is "coming from." + /// @param paid Based on the payment state this shows whether the pledge has been paid. function findOrCreatePledge( uint64 owner, uint64[] delegationChain, @@ -331,11 +484,17 @@ contract LiquidPledgingBase { return idx; } + /// @notice `findAdmin` is a basic getter to return a + /// specific admin (giver, delegate, or project) + /// @param idAdmin The admin ID to lookup. function findAdmin(uint64 idAdmin) internal returns (PledgeAdmin storage) { require(idAdmin < admins.length); return admins[idAdmin]; } + /// @notice `findPledge` is a basic getter to return a + /// specific pledge + /// @param idPledge The admin ID to pledge. function findPledge(uint64 idPledge) internal returns (Pledge storage) { require(idPledge < pledges.length); return pledges[idPledge]; @@ -344,25 +503,32 @@ contract LiquidPledgingBase { // a constant for the case that a delegate is requested that is not a delegate in the system uint64 constant NOTFOUND = 0xFFFFFFFFFFFFFFFF; - // helper function that searches the delegationChain fro a specific delegate and - // level of delegation returns their idx in the delegation chain which reflect their level of authority - function getDelegateIdx(Pledge n, uint64 idDelegate) internal returns(uint64) { + /// @notice `getDelegateIdx` is a helper function that searches the delegationChain + /// for a specific delegate and level of delegation returns their idx in the + /// delegation chain which reflect their level of authority. Returns MAX uint64 + /// if no delegate is found. + /// @param n The pledge that will be searched. + /// @param idxDelegate The internal ID of the delegate that's searched for. + function getDelegateIdx(Pledge n, uint64 idxDelegate) internal returns(uint64) { for (uint i=0; i + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +// Contract Imports - +/// @dev `LiquidPleding` allows for liquid pledging through the use of +/// internal id structures and delegate chaining. All basic operations for +/// handling liquid pledging are supplied as well as plugin features +/// to allow for expanded functionality. contract LiquidPledging is LiquidPledgingBase { @@ -424,7 +623,11 @@ contract LiquidPledging is LiquidPledgingBase { // Constructor ////// - // This constructor also calls the constructor for `LiquidPledgingBase` + /// @notice Basic constructor for LiquidPleding, also calls the + /// LiquidPledgingBase contract + /// @dev This constructor also calls the constructor + /// for `LiquidPledgingBase` + /// @param _vault The vault where ETH backing this pledge is stored function LiquidPledging(address _vault) LiquidPledgingBase(_vault) { } @@ -433,12 +636,12 @@ contract LiquidPledging is LiquidPledgingBase { /// relevant to this Giver without delegates is increased, and a normal /// transfer is done to the idReceiver /// @param idGiver Identifier of the giver thats donating. - /// @param idReceiver To whom it's transfered. Can be the same giver, another - /// giver, a delegate or a project - -function donate(uint64 idGiver, uint64 idReceiver) payable { + /// @param idReceiver To whom it's transfered. Can be the same giver, + /// another giver, a delegate or a project. + function donate(uint64 idGiver, uint64 idReceiver) payable { if (idGiver == 0) { - idGiver = addGiver('', '', 259200, ILiquidPledgingPlugin(0x0)); // default to 3 day commitTime + // default to 3 day commitTime + idGiver = addGiver("", "", 259200, ILiquidPledgingPlugin(0x0)); } PledgeAdmin storage sender = findAdmin(idGiver); @@ -458,7 +661,8 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { 0, 0, 0, - PaymentState.Pledged); + PaymentState.Pledged + ); Pledge storage nTo = findPledge(idPledge); @@ -471,13 +675,21 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { /// @notice Moves value between pledges - /// @param idSender ID of the giver, delegate or project admin that is transferring - /// the funds from Pledge to Pledge. This admin must have permissions to move the value + /// @param idSender ID of the giver, delegate or project admin that is + /// transferring the funds from Pledge to Pledge; this admin must have + /// permissions to move the value /// @param idPledge Id of the pledge that's moving the value /// @param amount Quantity of value that's being moved - /// @param idReceiver Destination of the value, can be a giver sending to a giver or - /// a delegate, a delegate to another delegate or a project to precommit it to that project - function transfer(uint64 idSender, uint64 idPledge, uint amount, uint64 idReceiver) { + /// @param idReceiver Destination of the value, can be a giver sending to + /// a giver or a delegate, a delegate to another delegate or a project + /// to pre-commit it to that project + function transfer( + uint64 idSender, + uint64 idPledge, + uint amount, + uint64 idReceiver + ) + { idPledge = normalizePledge(idPledge); @@ -495,7 +707,11 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { } else if (receiver.adminType == PledgeAdminType.Project) { transferOwnershipToProject(idPledge, amount, idReceiver); } else if (receiver.adminType == PledgeAdminType.Delegate) { - idPledge = undelegate(idPledge, amount, n.delegationChain.length); + idPledge = undelegate( + idPledge, + amount, + n.delegationChain.length + ); appendDelegate(idPledge, amount, idReceiver); } else { assert(false); @@ -509,7 +725,8 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { // If the receiver is another giver if (receiver.adminType == PledgeAdminType.Giver) { - // Only accept to change to the original giver to remove all delegates + // Only accept to change to the original giver to + // remove all delegates assert(n.owner == idReceiver); undelegate(idPledge, amount, n.delegationChain.length); return; @@ -521,31 +738,49 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { // If the receiver is not in the delegate list if (receiverDIdx == NOTFOUND) { - idPledge = undelegate(idPledge, amount, n.delegationChain.length - senderDIdx - 1); + idPledge = undelegate( + idPledge, + amount, + n.delegationChain.length - senderDIdx - 1 + ); appendDelegate(idPledge, amount, idReceiver); // If the receiver is already part of the delegate chain and is - // after the sender, then all of the other delegates after the sender are - // removed and the receiver is appended at the end of the delegation chain + // after the sender, then all of the other delegates after the + // sender are removed and the receiver is appended at the + // end of the delegation chain } else if (receiverDIdx > senderDIdx) { - idPledge = undelegate(idPledge, amount, n.delegationChain.length - senderDIdx - 1); + idPledge = undelegate( + idPledge, + amount, + n.delegationChain.length - senderDIdx - 1 + ); appendDelegate(idPledge, amount, idReceiver); // If the receiver is already part of the delegate chain and is // before the sender, then the sender and all of the other - // delegates after the RECEIVER are revomved from the chain, - // this is interesting because the delegate undelegates from the - // delegates that delegated to this delegate... game theory issues? should this be allowed + // delegates after the RECEIVER are removed from the chain, + // this is interesting because the delegate is removed from the + // delegates that delegated to this delegate. Are there game theory + // issues? should this be allowed? } else if (receiverDIdx <= senderDIdx) { - undelegate(idPledge, amount, n.delegationChain.length - receiverDIdx -1); + undelegate( + idPledge, + amount, + n.delegationChain.length - receiverDIdx - 1 + ); } return; } - // If the delegate wants to support a project, they undelegate all + // If the delegate wants to support a project, they remove all // the delegates after them in the chain and choose a project if (receiver.adminType == PledgeAdminType.Project) { - idPledge = undelegate(idPledge, amount, n.delegationChain.length - senderDIdx - 1); + idPledge = undelegate( + idPledge, + amount, + n.delegationChain.length - senderDIdx - 1 + ); proposeAssignProject(idPledge, amount, idReceiver); return; } @@ -554,9 +789,9 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { } - /// @notice This method is used to withdraw value from the system. This can be used - /// by the givers to avoid committing the donation or by project admin to use - /// the Ether. + /// @notice This method is used to withdraw value from the system. + /// This can be used by the givers to avoid committing the donation + /// or by project admin to use the Ether. /// @param idPledge Id of the pledge that wants to be withdrawn. /// @param amount Quantity of Ether that wants to be withdrawn. function withdraw(uint64 idPledge, uint amount) { @@ -641,7 +876,9 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { 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. function cancelPledge(uint64 idPledge, uint amount) { idPledge = normalizePledge(idPledge); @@ -658,10 +895,28 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { // Multi pledge methods //////// - // This set of functions makes moving a lot of pledges around much more + // @dev This set of functions makes moving a lot of pledges around much more // efficient (saves gas) than calling these functions in series + + + /// Bit mask used for dividing pledge amounts in Multi pledge methods uint constant D64 = 0x10000000000000000; - function mTransfer(uint64 idSender, uint[] pledgesAmounts, uint64 idReceiver) { + + /// @notice `mTransfer` allows for multiple pledges to be transferred + /// efficiently + /// @param idSender ID of the giver, delegate or project admin that is + /// transferring the funds from Pledge to Pledge. This admin must have + /// permissions to move the value + /// @param pledgesAmounts An array of pledge amounts and IDs which are extrapolated + /// using the D64 bitmask + /// @param idReceiver Destination of the value, can be a giver sending + /// to a giver or a delegate or a delegate to another delegate or a + /// project to pre-commit it to that project + function mTransfer( + uint64 idSender, + uint[] pledgesAmounts, + uint64 idReceiver + ) { for (uint i = 0; i < pledgesAmounts.length; i++ ) { uint64 idPledge = uint64( pledgesAmounts[i] & (D64-1) ); uint amount = pledgesAmounts[i] / D64; @@ -670,6 +925,10 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { } } + /// @notice `mWithdraw` allows for multiple pledges to be + /// withdrawn efficiently + /// @param pledgesAmounts An array of pledge amounts and IDs which are + /// extrapolated using the D64 bitmask function mWithdraw(uint[] pledgesAmounts) { for (uint i = 0; i < pledgesAmounts.length; i++ ) { uint64 idPledge = uint64( pledgesAmounts[i] & (D64-1) ); @@ -679,6 +938,10 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { } } + /// @notice `mConfirmPayment` allows for multiple pledges to be confirmed + /// efficiently + /// @param pledgesAmounts An array of pledge amounts and IDs which are extrapolated + /// using the D64 bitmask function mConfirmPayment(uint[] pledgesAmounts) { for (uint i = 0; i < pledgesAmounts.length; i++ ) { uint64 idPledge = uint64( pledgesAmounts[i] & (D64-1) ); @@ -688,6 +951,10 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { } } + /// @notice `mCancelPayment` allows for multiple pledges to be canceled + /// efficiently + /// @param pledgesAmounts An array of pledge amounts and IDs which are extrapolated + /// using the D64 bitmask function mCancelPayment(uint[] pledgesAmounts) { for (uint i = 0; i < pledgesAmounts.length; i++ ) { uint64 idPledge = uint64( pledgesAmounts[i] & (D64-1) ); @@ -697,6 +964,10 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { } } + /// @notice `mNormalizePledge` allows for multiple pledges to be + /// normalized efficiently + /// @param pledges An array of pledge IDs which are extrapolated using + /// the D64 bitmask function mNormalizePledge(uint[] pledges) returns(uint64) { for (uint i = 0; i < pledges.length; i++ ) { uint64 idPledge = uint64( pledges[i] & (D64-1) ); @@ -709,11 +980,21 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { // Private methods /////// - // this function is obvious, but it can also be called to undelegate everyone - // by setting yourself as the idReceiver - function transferOwnershipToProject(uint64 idPledge, uint amount, uint64 idReceiver) internal { + /// @notice `transferOwnershipToProject` allows for the transfer of + /// ownership to the project, but it can also be called to un-delegate + /// everyone by setting one's own id for the idReceiver + /// @param idPledge Id of the pledge to be transfered. + /// @param amount Quantity of value that's being transfered + /// @param idReceiver The new owner of the project (or self to un-delegate) + function transferOwnershipToProject( + uint64 idPledge, + uint amount, + uint64 idReceiver + ) internal { Pledge storage n = findPledge(idPledge); + // Ensure that the pledge is not already at max pledge depth + // and the project has not been canceled require(getPledgeLevel(n) < MAX_INTERPROJECT_LEVEL); require(!isProjectCanceled(idReceiver)); @@ -723,34 +1004,59 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { 0, 0, n.oldPledge, - PaymentState.Pledged); + PaymentState.Pledged + ); + uint64 toPledge = findOrCreatePledge( + idReceiver, // Set the new owner + new uint64[](0), // clear the delegation chain + 0, + 0, + oldPledge, + PaymentState.Pledged + ); + doTransfer(idPledge, toPledge, amount); + } + + + /// @notice `transferOwnershipToGiver` allows for the transfer of + /// value back to the Giver, value is placed in a pledged state + /// without being attached to a project, delegation chain, or time line. + /// @param idPledge Id of the pledge to be transfered. + /// @param amount Quantity of value that's being transfered + /// @param idReceiver The new owner of the pledge + function transferOwnershipToGiver( + uint64 idPledge, + uint amount, + uint64 idReceiver + ) internal { uint64 toPledge = findOrCreatePledge( idReceiver, new uint64[](0), 0, 0, - oldPledge, - PaymentState.Pledged); + 0, + PaymentState.Pledged + ); doTransfer(idPledge, toPledge, amount); } - function transferOwnershipToGiver(uint64 idPledge, uint amount, uint64 idReceiver) internal { - uint64 toPledge = findOrCreatePledge( - idReceiver, - new uint64[](0), - 0, - 0, - 0, - PaymentState.Pledged); - doTransfer(idPledge, toPledge, amount); - } + /// @notice `appendDelegate` allows for a delegate to be added onto the + /// end of the delegate chain for a given Pledge. + /// @param idPledge Id of the pledge thats delegate chain will be modified. + /// @param amount Quantity of value that's being chained. + /// @param idReceiver The delegate to be added at the end of the chain + function appendDelegate( + uint64 idPledge, + uint amount, + uint64 idReceiver + ) internal { + Pledge storage n = findPledge(idPledge); - function appendDelegate(uint64 idPledge, uint amount, uint64 idReceiver) internal { - Pledge storage n= findPledge(idPledge); - - require(n.delegationChain.length < MAX_DELEGATES); //TODO change to revert and say the error - uint64[] memory newDelegationChain = new uint64[](n.delegationChain.length + 1); - for (uint i=0; i= amount); @@ -817,21 +1153,32 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { callPlugins(false, from, to, amount); } - // This function does 2 things, #1: it checks to make sure that the pledges are correct - // if the a pledged project has already been committed then it changes the owner - // to be the proposed project (Pledge that the UI will have to read the commit time and manually - // do what this function does to the pledge for the end user at the expiration of the commitTime) - // #2: It checks to make sure that if there has been a cancellation in the chain of projects, - // then it adjusts the pledge's owner appropriately. - // This call can be called from any body at any time on any pledge. In general it can be called - // to force the calls of the affected plugins, which also need to be predicted by the UI + /// @notice `normalizePledge` does 2 things: + /// #1: Checks to make sure that the pledges are correct. Then if + /// a pledged project has already been committed, it changes + /// the owner to be the proposed project (The UI + /// will have to read the commit time and manually do what + /// this function does to the pledge for the end user + /// at the expiration of the commitTime) + /// + /// #2: Checks to make sure that if there has been a cancellation in the + /// chain of projects, the pledge's owner has been changed + /// appropriately. + /// + /// This function can be called by anybody at anytime on any pledge. + /// In general it can be called to force the calls of the affected + /// plugins, which also need to be predicted by the UI + /// @param idPledge This is the id of the pledge that will be normalized function normalizePledge(uint64 idPledge) returns(uint64) { + Pledge storage n = findPledge(idPledge); - // Check to make sure this pledge hasnt already been used or is in the process of being used - if (n.paymentState != PaymentState.Pledged) return idPledge; + // Check to make sure this pledge hasn't already been used + // or is in the process of being used + if (n.paymentState != PaymentState.Pledged) + return idPledge; - // First send to a project if it's proposed and commited + // First send to a project if it's proposed and committed if ((n.intendedProject > 0) && ( getTime() > n.commitTime)) { uint64 oldPledge = findOrCreatePledge( n.owner, @@ -864,52 +1211,165 @@ function donate(uint64 idGiver, uint64 idReceiver) payable { // Plugins ///////////// - function callPlugin(bool before, uint64 adminId, uint64 fromPledge, uint64 toPledge, uint64 context, uint amount) internal returns (uint allowedAmount) { + /// @notice `callPlugin` is used to trigger the general functions in the + /// plugin for any actions needed before and after a transfer happens. + /// Specifically what this does in relation to the plugin is something + /// that largely depends on the functions of that plugin. This function + /// is generally called in pairs, once before, and once after a transfer. + /// @param before This toggle determines whether the plugin call is occurring + /// before or after a transfer. + /// @param adminId This should be the Id of the *trusted* individual + /// who has control over this plugin. + /// @param fromPledge This is the Id from which value is being transfered. + /// @param toPledge This is the Id that value is being transfered to. + /// @param context The situation that is triggering the plugin. See plugin + /// for a full description of contexts. + /// @param amount The amount of value that is being transfered. + function callPlugin( + bool before, + uint64 adminId, + uint64 fromPledge, + uint64 toPledge, + uint64 context, + uint amount + ) internal returns (uint allowedAmount) { + uint newAmount; allowedAmount = amount; PledgeAdmin storage admin = findAdmin(adminId); + // Checks admin has a plugin assigned and a non-zero amount is requested if ((address(admin.plugin) != 0) && (allowedAmount > 0)) { + // There are two seperate functions called in the plugin. + // One is called before the transfer and one after if (before) { - newAmount = admin.plugin.beforeTransfer(adminId, fromPledge, toPledge, context, amount); + newAmount = admin.plugin.beforeTransfer( + adminId, + fromPledge, + toPledge, + context, + amount + ); require(newAmount <= allowedAmount); allowedAmount = newAmount; } else { - admin.plugin.afterTransfer(adminId, fromPledge, toPledge, context, amount); + admin.plugin.afterTransfer( + adminId, + fromPledge, + toPledge, + context, + amount + ); } } } - function callPluginsPledge(bool before, uint64 idPledge, uint64 fromPledge, uint64 toPledge, uint amount) internal returns (uint allowedAmount) { + /// @notice `callPluginsPledge` is used to apply plugin calls to + /// the delegate chain and the intended project if there is one. + /// It does so in either a transferring or receiving context based + /// on the `idPledge` and `fromPledge` parameters. + /// @param before This toggle determines whether the plugin call is occuring + /// before or after a transfer. + /// @param idPledge This is the Id of the pledge on which this plugin + /// is being called. + /// @param fromPledge This is the Id from which value is being transfered. + /// @param toPledge This is the Id that value is being transfered to. + /// @param amount The amount of value that is being transfered. + function callPluginsPledge( + bool before, + uint64 idPledge, + uint64 fromPledge, + uint64 toPledge, + uint amount + ) internal returns (uint allowedAmount) { + // Determine if callPlugin is being applied in a receiving + // or transferring context uint64 offset = idPledge == fromPledge ? 0 : 256; allowedAmount = amount; Pledge storage n = findPledge(idPledge); - allowedAmount = callPlugin(before, n.owner, fromPledge, toPledge, offset, allowedAmount); + // Always call the plugin on the owner + allowedAmount = callPlugin( + before, + n.owner, + fromPledge, + toPledge, + offset, + allowedAmount + ); + // Apply call plugin to all delegates for (uint64 i=0; i 0) { - allowedAmount = callPlugin(before, n.intendedProject, fromPledge, toPledge, offset + 255, allowedAmount); + allowedAmount = callPlugin( + before, + n.intendedProject, + fromPledge, + toPledge, + offset + 255, + allowedAmount + ); } } - function callPlugins(bool before, uint64 fromPledge, uint64 toPledge, uint amount) internal returns (uint allowedAmount) { + + /// @notice `callPlugins` calls `callPluginsPledge` once for the transfer + /// context and once for the receiving context. The aggregated + /// allowed amount is then returned. + /// @param before This toggle determines whether the plugin call is occuring + /// before or after a transfer. + /// @param fromPledge This is the Id from which value is being transfered. + /// @param toPledge This is the Id that value is being transfered to. + /// @param amount The amount of value that is being transfered. + function callPlugins( + bool before, + uint64 fromPledge, + uint64 toPledge, + uint amount + ) internal returns (uint allowedAmount) { allowedAmount = amount; - allowedAmount = callPluginsPledge(before, fromPledge, fromPledge, toPledge, allowedAmount); - allowedAmount = callPluginsPledge(before, toPledge, fromPledge, toPledge, allowedAmount); + // Call the pledges plugins in the transfer context + allowedAmount = callPluginsPledge( + before, + fromPledge, + fromPledge, + toPledge, + allowedAmount + ); + + // Call the pledges plugins in the receive context + allowedAmount = callPluginsPledge( + before, + toPledge, + fromPledge, + toPledge, + allowedAmount + ); } ///////////// // Test functions ///////////// + /// @notice Basic helper function to return the current time function getTime() internal returns (uint) { return now; } + // Event Delcerations event Transfer(uint64 indexed from, uint64 indexed to, uint amount); event CancelProject(uint64 indexed idProject); diff --git a/build/Owned.sol.js b/build/Owned.sol.js index 61f3ab3..e2e5500 100644 --- a/build/Owned.sol.js +++ b/build/Owned.sol.js @@ -1,6 +1,7 @@ /* This is an autogenerated file. DO NOT EDIT MANUALLY */ -exports.OwnedAbi = [{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"}] -exports.OwnedByteCode = "0x6060604052341561000f57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b6101d18061003c6000396000f300606060405263ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166379ba5097811461005e5780638da5cb5b14610073578063a6f9dae1146100a2578063d4ee1d90146100c3575b600080fd5b341561006957600080fd5b6100716100f2565b005b341561007e57600080fd5b61008661013f565b604051600160a060020a03909116815260200160405180910390f35b34156100ad57600080fd5b610071600160a060020a036004351661014e565b005b34156100ce57600080fd5b610086610196565b604051600160a060020a03909116815260200160405180910390f35b60015433600160a060020a0390811691161461010d57600080fd5b6001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b565b600054600160a060020a031681565b60005433600160a060020a0390811691161461016957600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600154600160a060020a0316815600a165627a7a72305820e68440031004354b3db9d740fb2b8896f5bedd56653beb65edd62e94e414a7ad0029" -exports._solcVersion = "0.4.15+commit.bbb8e64f.Emscripten.clang" +exports.OwnedAbi = [{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"}] +exports.OwnedByteCode = "0x6060604052341561000f57600080fd5b60008054600160a060020a033316600160a060020a03199091161790556101bc8061003b6000396000f3006060604052600436106100615763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166379ba509781146100665780638da5cb5b1461007b578063a6f9dae1146100aa578063d4ee1d90146100c9575b600080fd5b341561007157600080fd5b6100796100dc565b005b341561008657600080fd5b61008e610128565b604051600160a060020a03909116815260200160405180910390f35b34156100b557600080fd5b610079600160a060020a0360043516610137565b34156100d457600080fd5b61008e610181565b60015433600160a060020a039081169116146100f757600080fd5b6001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600054600160a060020a031681565b60005433600160a060020a0390811691161461015257600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154600160a060020a0316815600a165627a7a7230582093915e2078cf23efe265b372c026c6cbc79ddd13f04e6e31d52efe53c70380790029" +exports.OwnedRuntimeByteCode = "0x6060604052600436106100615763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166379ba509781146100665780638da5cb5b1461007b578063a6f9dae1146100aa578063d4ee1d90146100c9575b600080fd5b341561007157600080fd5b6100796100dc565b005b341561008657600080fd5b61008e610128565b604051600160a060020a03909116815260200160405180910390f35b34156100b557600080fd5b610079600160a060020a0360043516610137565b34156100d457600080fd5b61008e610181565b60015433600160a060020a039081169116146100f757600080fd5b6001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600054600160a060020a031681565b60005433600160a060020a0390811691161461015257600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154600160a060020a0316815600a165627a7a7230582093915e2078cf23efe265b372c026c6cbc79ddd13f04e6e31d52efe53c70380790029" +exports._solcVersion = "0.4.18+commit.9cf6e910.Emscripten.clang" exports._sha256 = "0xf61824cbb7f4765beceba9899e284825b9c60abba4179558d6b40e6976076b6b" diff --git a/build/Vault.sol.js b/build/Vault.sol.js index 54d8914..c2bc130 100644 --- a/build/Vault.sol.js +++ b/build/Vault.sol.js @@ -1,10 +1,13 @@ /* This is an autogenerated file. DO NOT EDIT MANUALLY */ -exports.LiquidPledgingAbi = [{"constant":false,"inputs":[{"name":"idNote","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"confirmPayment","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"idNote","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"cancelPayment","outputs":[],"payable":false,"type":"function"}] +exports.LPVaultAbi = [{"constant":true,"inputs":[],"name":"nPayments","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"liquidPledging","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_idPayment","type":"uint256"}],"name":"cancelPayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_idPayment","type":"uint256"}],"name":"confirmPayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"payments","outputs":[{"name":"state","type":"uint8"},{"name":"ref","type":"bytes32"},{"name":"dest","type":"address"},{"name":"amount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_automatic","type":"bool"}],"name":"setAutopay","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_idPayments","type":"uint256[]"}],"name":"multiCancel","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_ref","type":"bytes32"},{"name":"_dest","type":"address"},{"name":"_amount","type":"uint256"}],"name":"authorizePayment","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"autoPay","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"VaultMock","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newLiquidPledging","type":"address"}],"name":"setLiquidPledging","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_idPayments","type":"uint256[]"}],"name":"multiConfirm","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idPayment","type":"uint256"}],"name":"ConfirmPayment","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idPayment","type":"uint256"}],"name":"CancelPayment","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idPayment","type":"uint256"},{"indexed":true,"name":"ref","type":"bytes32"},{"indexed":true,"name":"dest","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"AuthorizePayment","type":"event"}] +exports.LPVaultByteCode = "0x606060405260008054600160a060020a033316600160a060020a0319909116179055610a68806100306000396000f3006060604052600436106100cc5763ffffffff60e060020a6000350416633baf35fb81146100ce57806374041d1f146100f357806379ba5097146101225780638422927d14610135578063876ca09f1461014b57806387d81789146101615780638da5cb5b146101bf578063a4500c33146101d2578063a6f9dae1146101ea578063b796105c14610209578063bb4f28df14610258578063bbc328201461027d578063cd6b8caf146102a4578063d4ee1d90146102b7578063e99996b1146102ca578063ffd82d21146102e9575b005b34156100d957600080fd5b6100e1610338565b60405190815260200160405180910390f35b34156100fe57600080fd5b61010661033f565b604051600160a060020a03909116815260200160405180910390f35b341561012d57600080fd5b6100cc61034e565b341561014057600080fd5b6100cc60043561039a565b341561015657600080fd5b6100cc6004356103c1565b341561016c57600080fd5b6101776004356103e5565b6040518085600281111561018757fe5b60ff168152602081019490945250600160a060020a039091166040808401919091526060830191909152608090910191505180910390f35b34156101ca57600080fd5b61010661042a565b34156101dd57600080fd5b6100cc6004351515610439565b34156101f557600080fd5b6100cc600160a060020a0360043516610494565b341561021457600080fd5b6100cc60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506104de95505050505050565b341561026357600080fd5b6100e1600435600160a060020a0360243516604435610531565b341561028857600080fd5b6102906106a2565b604051901515815260200160405180910390f35b34156102af57600080fd5b6100cc6106c3565b34156102c257600080fd5b6101066106c5565b34156102d557600080fd5b6100cc600160a060020a03600435166106d4565b34156102f457600080fd5b6100cc600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061073495505050505050565b6003545b90565b600254600160a060020a031681565b60015433600160a060020a0390811691161461036957600080fd5b6001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b60005433600160a060020a039081169116146103b557600080fd5b6103be81610783565b50565b60005433600160a060020a039081169116146103dc57600080fd5b6103be81610881565b60038054829081106103f357fe5b6000918252602090912060049091020180546001820154600283015460039093015460ff909216935091600160a060020a03169084565b600054600160a060020a031681565b60005433600160a060020a0390811691161461045457600080fd5b60028054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b60005433600160a060020a039081169116146104af57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000805433600160a060020a039081169116146104fa57600080fd5b5060005b815181101561052d5761052582828151811061051657fe5b90602001906020020151610783565b6001016104fe565b5050565b600254600090819033600160a060020a0390811691161461055157600080fd5b506003805490819061056690600183016109bc565b50600060038281548110151561057857fe5b60009182526020909120600490910201805460ff1916600183600281111561059c57fe5b0217905550846003828154811015156105b157fe5b600091825260209091206001600490920201015560038054859190839081106105d657fe5b906000526020600020906004020160020160006101000a815481600160a060020a030219169083600160a060020a031602179055508260038281548110151561061b57fe5b6000918252602090912060036004909202010155600160a060020a03841685827fb025fbd648b47675e5160bb9a938180cda38f285280e390d3aac0c3c0002ba088660405190815260200160405180910390a460025474010000000000000000000000000000000000000000900460ff161561069a5761069a81610881565b949350505050565b60025474010000000000000000000000000000000000000000900460ff1681565b565b600154600160a060020a031681565b60005433600160a060020a039081169116146106ef57600080fd5b600254600160a060020a03161561070557600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000805433600160a060020a0390811691161461075057600080fd5b5060005b815181101561052d5761077b82828151811061076c57fe5b90602001906020020151610881565b600101610754565b600354600090821061079457600080fd5b60038054839081106107a257fe5b6000918252602082206004909102019150815460ff1660028111156107c357fe5b146107cd57600080fd5b805460ff1916600290811782555460018201546003830154600160a060020a039092169163e9c211e2919060405160e060020a63ffffffff851602815267ffffffffffffffff90921660048301526024820152604401600060405180830381600087803b151561083c57600080fd5b6102c65a03f1151561084d57600080fd5b505050817ff1a1a3c38f42dc56b083903c7f8fb342b64c15e710c3a4179a4ba5c36733e91d60405160405180910390a25050565b600354600090821061089257600080fd5b60038054839081106108a057fe5b6000918252602082206004909102019150815460ff1660028111156108c157fe5b146108cb57600080fd5b805460ff1916600117815560028101546003820154600160a060020a03909116906108fc81150290604051600060405180830381858888f19350505050151561091357600080fd5b60025460018201546003830154600160a060020a0390921691632ee88808919060405160e060020a63ffffffff851602815267ffffffffffffffff90921660048301526024820152604401600060405180830381600087803b151561097757600080fd5b6102c65a03f1151561098857600080fd5b505050817fe46ac4851953c525120fe90499f529bf6236f067292c975d33ad0afb2c585be660405160405180910390a25050565b8154818355818115116109e8576004028160040283600052602060002091820191016109e891906109ed565b505050565b61033c91905b80821115610a3857805460ff1916815560006001820181905560028201805473ffffffffffffffffffffffffffffffffffffffff1916905560038201556004016109f3565b50905600a165627a7a72305820e76e2d0b4804ed1f67f5e470f1eaab5a1881c2d99a0b023f47f5bad1627ff7380029" +exports.LPVaultRuntimeByteCode = "0x6060604052600436106100cc5763ffffffff60e060020a6000350416633baf35fb81146100ce57806374041d1f146100f357806379ba5097146101225780638422927d14610135578063876ca09f1461014b57806387d81789146101615780638da5cb5b146101bf578063a4500c33146101d2578063a6f9dae1146101ea578063b796105c14610209578063bb4f28df14610258578063bbc328201461027d578063cd6b8caf146102a4578063d4ee1d90146102b7578063e99996b1146102ca578063ffd82d21146102e9575b005b34156100d957600080fd5b6100e1610338565b60405190815260200160405180910390f35b34156100fe57600080fd5b61010661033f565b604051600160a060020a03909116815260200160405180910390f35b341561012d57600080fd5b6100cc61034e565b341561014057600080fd5b6100cc60043561039a565b341561015657600080fd5b6100cc6004356103c1565b341561016c57600080fd5b6101776004356103e5565b6040518085600281111561018757fe5b60ff168152602081019490945250600160a060020a039091166040808401919091526060830191909152608090910191505180910390f35b34156101ca57600080fd5b61010661042a565b34156101dd57600080fd5b6100cc6004351515610439565b34156101f557600080fd5b6100cc600160a060020a0360043516610494565b341561021457600080fd5b6100cc60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506104de95505050505050565b341561026357600080fd5b6100e1600435600160a060020a0360243516604435610531565b341561028857600080fd5b6102906106a2565b604051901515815260200160405180910390f35b34156102af57600080fd5b6100cc6106c3565b34156102c257600080fd5b6101066106c5565b34156102d557600080fd5b6100cc600160a060020a03600435166106d4565b34156102f457600080fd5b6100cc600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061073495505050505050565b6003545b90565b600254600160a060020a031681565b60015433600160a060020a0390811691161461036957600080fd5b6001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b60005433600160a060020a039081169116146103b557600080fd5b6103be81610783565b50565b60005433600160a060020a039081169116146103dc57600080fd5b6103be81610881565b60038054829081106103f357fe5b6000918252602090912060049091020180546001820154600283015460039093015460ff909216935091600160a060020a03169084565b600054600160a060020a031681565b60005433600160a060020a0390811691161461045457600080fd5b60028054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b60005433600160a060020a039081169116146104af57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000805433600160a060020a039081169116146104fa57600080fd5b5060005b815181101561052d5761052582828151811061051657fe5b90602001906020020151610783565b6001016104fe565b5050565b600254600090819033600160a060020a0390811691161461055157600080fd5b506003805490819061056690600183016109bc565b50600060038281548110151561057857fe5b60009182526020909120600490910201805460ff1916600183600281111561059c57fe5b0217905550846003828154811015156105b157fe5b600091825260209091206001600490920201015560038054859190839081106105d657fe5b906000526020600020906004020160020160006101000a815481600160a060020a030219169083600160a060020a031602179055508260038281548110151561061b57fe5b6000918252602090912060036004909202010155600160a060020a03841685827fb025fbd648b47675e5160bb9a938180cda38f285280e390d3aac0c3c0002ba088660405190815260200160405180910390a460025474010000000000000000000000000000000000000000900460ff161561069a5761069a81610881565b949350505050565b60025474010000000000000000000000000000000000000000900460ff1681565b565b600154600160a060020a031681565b60005433600160a060020a039081169116146106ef57600080fd5b600254600160a060020a03161561070557600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000805433600160a060020a0390811691161461075057600080fd5b5060005b815181101561052d5761077b82828151811061076c57fe5b90602001906020020151610881565b600101610754565b600354600090821061079457600080fd5b60038054839081106107a257fe5b6000918252602082206004909102019150815460ff1660028111156107c357fe5b146107cd57600080fd5b805460ff1916600290811782555460018201546003830154600160a060020a039092169163e9c211e2919060405160e060020a63ffffffff851602815267ffffffffffffffff90921660048301526024820152604401600060405180830381600087803b151561083c57600080fd5b6102c65a03f1151561084d57600080fd5b505050817ff1a1a3c38f42dc56b083903c7f8fb342b64c15e710c3a4179a4ba5c36733e91d60405160405180910390a25050565b600354600090821061089257600080fd5b60038054839081106108a057fe5b6000918252602082206004909102019150815460ff1660028111156108c157fe5b146108cb57600080fd5b805460ff1916600117815560028101546003820154600160a060020a03909116906108fc81150290604051600060405180830381858888f19350505050151561091357600080fd5b60025460018201546003830154600160a060020a0390921691632ee88808919060405160e060020a63ffffffff851602815267ffffffffffffffff90921660048301526024820152604401600060405180830381600087803b151561097757600080fd5b6102c65a03f1151561098857600080fd5b505050817fe46ac4851953c525120fe90499f529bf6236f067292c975d33ad0afb2c585be660405160405180910390a25050565b8154818355818115116109e8576004028160040283600052602060002091820191016109e891906109ed565b505050565b61033c91905b80821115610a3857805460ff1916815560006001820181905560028201805473ffffffffffffffffffffffffffffffffffffffff1916905560038201556004016109f3565b50905600a165627a7a72305820e76e2d0b4804ed1f67f5e470f1eaab5a1881c2d99a0b023f47f5bad1627ff7380029" +exports.LiquidPledgingAbi = [{"constant":false,"inputs":[{"name":"idNote","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"confirmPayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"idNote","type":"uint64"},{"name":"amount","type":"uint256"}],"name":"cancelPayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}] exports.LiquidPledgingByteCode = "0x" -exports.OwnedAbi = [{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"}] -exports.OwnedByteCode = "0x6060604052341561000f57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b6101d18061003c6000396000f300606060405263ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166379ba5097811461005e5780638da5cb5b14610073578063a6f9dae1146100a2578063d4ee1d90146100c3575b600080fd5b341561006957600080fd5b6100716100f2565b005b341561007e57600080fd5b61008661013f565b604051600160a060020a03909116815260200160405180910390f35b34156100ad57600080fd5b610071600160a060020a036004351661014e565b005b34156100ce57600080fd5b610086610196565b604051600160a060020a03909116815260200160405180910390f35b60015433600160a060020a0390811691161461010d57600080fd5b6001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b565b600054600160a060020a031681565b60005433600160a060020a0390811691161461016957600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600154600160a060020a0316815600a165627a7a723058206a8fea8a6be1bef5d767c60630c0553a5c81aea6d4751c10e110a74f895c33830029" -exports.VaultAbi = [{"constant":true,"inputs":[],"name":"nPayments","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"liquidPledging","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_idPayment","type":"uint256"}],"name":"cancelPayment","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_idPayment","type":"uint256"}],"name":"confirmPayment","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"payments","outputs":[{"name":"state","type":"uint8"},{"name":"ref","type":"bytes32"},{"name":"dest","type":"address"},{"name":"amount","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_automatic","type":"bool"}],"name":"setAutopay","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_idPayments","type":"uint256[]"}],"name":"multiCancel","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_ref","type":"bytes32"},{"name":"_dest","type":"address"},{"name":"_amount","type":"uint256"}],"name":"authorizePayment","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"autoPay","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"VaultMock","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newLiquidPledging","type":"address"}],"name":"setLiquidPledging","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_idPayments","type":"uint256[]"}],"name":"multiConfirm","outputs":[],"payable":false,"type":"function"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idPayment","type":"uint256"}],"name":"ConfirmPayment","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idPayment","type":"uint256"}],"name":"CancelPayment","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idPayment","type":"uint256"},{"indexed":true,"name":"ref","type":"bytes32"},{"indexed":true,"name":"dest","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"AuthorizePayment","type":"event"}] -exports.VaultByteCode = "0x60606040525b60008054600160a060020a03191633600160a060020a03161790555b5b610b0e806100316000396000f300606060405236156100ca5763ffffffff60e060020a6000350416633baf35fb81146100ce57806374041d1f146100f357806379ba5097146101225780638422927d14610137578063876ca09f1461014f57806387d81789146101675780638da5cb5b146101c5578063a4500c33146101f4578063a6f9dae11461020e578063b796105c1461022f578063bb4f28df14610280578063bbc32820146102b7578063cd6b8caf146102de578063d4ee1d90146102f3578063e99996b114610322578063ffd82d2114610343575b5b5b005b34156100d957600080fd5b6100e1610394565b60405190815260200160405180910390f35b34156100fe57600080fd5b61010661039b565b604051600160a060020a03909116815260200160405180910390f35b341561012d57600080fd5b6100ca6103aa565b005b341561014257600080fd5b6100ca6004356103f7565b005b341561015a57600080fd5b6100ca600435610420565b005b341561017257600080fd5b61017d600435610449565b6040518085600281111561018d57fe5b60ff168152602081019490945250600160a060020a039091166040808401919091526060830191909152608090910191505180910390f35b34156101d057600080fd5b610106610490565b604051600160a060020a03909116815260200160405180910390f35b34156101ff57600080fd5b6100ca600435151561049f565b005b341561021957600080fd5b6100ca600160a060020a03600435166104f8565b005b341561023a57600080fd5b6100ca600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061054095505050505050565b005b341561028b57600080fd5b6100e1600435600160a060020a0360243516604435610596565b60405190815260200160405180910390f35b34156102c257600080fd5b6102ca61071f565b604051901515815260200160405180910390f35b34156102e957600080fd5b6100ca6103f5565b005b34156102fe57600080fd5b610106610743565b604051600160a060020a03909116815260200160405180910390f35b341561032d57600080fd5b6100ca600160a060020a0360043516610752565b005b341561034e57600080fd5b6100ca60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506107b095505050505050565b005b6003545b90565b600254600160a060020a031681565b60015433600160a060020a039081169116146103c557600080fd5b6001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b565b60005433600160a060020a0390811691161461041257600080fd5b61041b81610806565b5b5b50565b60005433600160a060020a0390811691161461043b57600080fd5b61041b81610914565b5b5b50565b600380548290811061045757fe5b906000526020600020906004020160005b5080546001820154600283015460039093015460ff909216935091600160a060020a03169084565b600054600160a060020a031681565b60005433600160a060020a039081169116146104ba57600080fd5b6002805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000831515021790555b5b50565b60005433600160a060020a0390811691161461051357600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b6000805433600160a060020a0390811691161461055c57600080fd5b5060005b81518110156105905761058782828151811061057857fe5b90602001906020020151610806565b5b600101610560565b5b5b5050565b600254600090819033600160a060020a039081169116146105b657600080fd5b50600380549081906105cb9060018301610a5e565b5060006003828154811015156105dd57fe5b906000526020600020906004020160005b50805460ff1916600183600281111561060357fe5b02179055508460038281548110151561061857fe5b906000526020600020906004020160005b5060010155600380548591908390811061063f57fe5b906000526020600020906004020160005b50600201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055600380548491908390811061069057fe5b906000526020600020906004020160005b5060030155600160a060020a03841685827fb025fbd648b47675e5160bb9a938180cda38f285280e390d3aac0c3c0002ba088660405190815260200160405180910390a460025474010000000000000000000000000000000000000000900460ff16156107115761071181610914565b5b8091505b5b509392505050565b60025474010000000000000000000000000000000000000000900460ff1681565b5b565b600154600160a060020a031681565b60005433600160a060020a0390811691161461076d57600080fd5b600254600160a060020a03161561078357600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b6000805433600160a060020a039081169116146107cc57600080fd5b5060005b8151811015610590576107f78282815181106107e857fe5b90602001906020020151610914565b5b6001016107d0565b5b5b5050565b600354600090821061081757600080fd5b600380548390811061082557fe5b906000526020600020906004020160005b50905060005b815460ff16600281111561084c57fe5b1461085657600080fd5b8054600290829060ff19166001835b021790555060025460018201546003830154600160a060020a039092169163e9c211e2919060405160e060020a63ffffffff851602815267ffffffffffffffff90921660048301526024820152604401600060405180830381600087803b15156108ce57600080fd5b6102c65a03f115156108df57600080fd5b505050817ff1a1a3c38f42dc56b083903c7f8fb342b64c15e710c3a4179a4ba5c36733e91d60405160405180910390a25b5050565b600354600090821061092557600080fd5b600380548390811061093357fe5b906000526020600020906004020160005b50905060005b815460ff16600281111561095a57fe5b1461096457600080fd5b8054600190829060ff191682805b021790555060028101546003820154600160a060020a039091169080156108fc0290604051600060405180830381858888f1935050505015156109b457600080fd5b60025460018201546003830154600160a060020a0390921691632ee88808919060405160e060020a63ffffffff851602815267ffffffffffffffff90921660048301526024820152604401600060405180830381600087803b1515610a1857600080fd5b6102c65a03f11515610a2957600080fd5b505050817fe46ac4851953c525120fe90499f529bf6236f067292c975d33ad0afb2c585be660405160405180910390a25b5050565b815481835581811511610a8a57600402816004028360005260206000209182019101610a8a9190610a90565b5b505050565b61039891905b80821115610adb57805460ff1916815560006001820181905560028201805473ffffffffffffffffffffffffffffffffffffffff191690556003820155600401610a96565b5090565b905600a165627a7a7230582089d4f70c572dccc9382e705b36c8488331b5d5488a6793173458a9da9f0cb0c80029" -exports._solcVersion = "0.4.15+commit.bbb8e64f.Emscripten.clang" -exports._sha256 = "0x55fb3ff315e3297664118d0d8d4eefb81be1c0f350996fb5657a68a41491d8be" +exports.LiquidPledgingRuntimeByteCode = "0x" +exports.OwnedAbi = [{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"}] +exports.OwnedByteCode = "0x6060604052341561000f57600080fd5b60008054600160a060020a033316600160a060020a03199091161790556101bc8061003b6000396000f3006060604052600436106100615763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166379ba509781146100665780638da5cb5b1461007b578063a6f9dae1146100aa578063d4ee1d90146100c9575b600080fd5b341561007157600080fd5b6100796100dc565b005b341561008657600080fd5b61008e610128565b604051600160a060020a03909116815260200160405180910390f35b34156100b557600080fd5b610079600160a060020a0360043516610137565b34156100d457600080fd5b61008e610181565b60015433600160a060020a039081169116146100f757600080fd5b6001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600054600160a060020a031681565b60005433600160a060020a0390811691161461015257600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154600160a060020a0316815600a165627a7a723058201063dfc91fa5c1974f8f0be40d901e1364e4342034fc03bdfbe9c177ad44cc760029" +exports.OwnedRuntimeByteCode = "0x6060604052600436106100615763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166379ba509781146100665780638da5cb5b1461007b578063a6f9dae1146100aa578063d4ee1d90146100c9575b600080fd5b341561007157600080fd5b6100796100dc565b005b341561008657600080fd5b61008e610128565b604051600160a060020a03909116815260200160405180910390f35b34156100b557600080fd5b610079600160a060020a0360043516610137565b34156100d457600080fd5b61008e610181565b60015433600160a060020a039081169116146100f757600080fd5b6001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600054600160a060020a031681565b60005433600160a060020a0390811691161461015257600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154600160a060020a0316815600a165627a7a723058201063dfc91fa5c1974f8f0be40d901e1364e4342034fc03bdfbe9c177ad44cc760029" +exports._solcVersion = "0.4.18+commit.9cf6e910.Emscripten.clang" +exports._sha256 = "0x5b96d9bd39076044d8277221249fb8deea106860cbc6f45ce579caec78cfbf82" diff --git a/build/Vault_all.sol b/build/Vault_all.sol index ebbf33e..69416b9 100644 --- a/build/Vault_all.sol +++ b/build/Vault_all.sol @@ -1,5 +1,5 @@ -//File: contracts/Owned.sol +//File: contracts\Owned.sol pragma solidity ^0.4.11; @@ -53,8 +53,8 @@ pragma solidity ^0.4.11; /// to allow for an optional escape hatch to be implemented -/// @dev This is declares a few functions from `LiquidPledging` so that the -/// `Vault` contract can interface with the `LiquidPledging` contract +/// @dev `LiquidPledging` is a basic interface to allow the `Vault` contract +/// to confirm and cancel payments in the `LiquidPledging` contract. contract LiquidPledging { function confirmPayment(uint64 idNote, uint amount); function cancelPayment(uint64 idNote, uint amount); @@ -63,7 +63,7 @@ contract LiquidPledging { /// @dev `Vault` is a higher level contract built off of the `Owned` /// contract that holds funds for the liquid pledging system. -contract Vault is Owned { +contract LPVault is Owned { LiquidPledging public liquidPledging; // liquidPledging contract's address bool public autoPay; // if false, payments will take 2 txs to be completed @@ -101,17 +101,34 @@ contract Vault is Owned { } + /// @notice `setLiquidPledging` is used to attach a specific liquid pledging + /// instance to this vault. Keep in mind this isn't a single pledge but + /// instead an entire liquid pledging contract. + /// @param _newLiquidPledging A full liquid pledging contract function setLiquidPledging(address _newLiquidPledging) onlyOwner { require(address(liquidPledging) == 0x0); liquidPledging = LiquidPledging(_newLiquidPledging); } + /// @notice `setAutopay` is used to toggle whether the vault will + /// automatically confirm a payment after the payment has been authorized. + /// @param _automatic If true payments will confirm automatically function setAutopay(bool _automatic) onlyOwner { autoPay = _automatic; } - - function authorizePayment(bytes32 _ref, address _dest, uint _amount) onlyLiquidPledging returns (uint) { + /// @notice `authorizePayment` is used in order to approve a payment + /// from the liquid pledging contract. Whenever a project or other address + /// needs to receive a payment it needs to be authorized with this contract. + /// @param _ref This parameter is used to reference details about the + /// payment from another contract. + /// @param _dest This is the address that payments will end up being sent to + /// @param _amount This is the amount that the payment is being authorized + /// for. + function authorizePayment( + bytes32 _ref, + address _dest, + uint _amount ) onlyLiquidPledging returns (uint) { uint idPayment = payments.length; payments.length ++; payments[idPayment].state = PaymentStatus.Pending; @@ -126,10 +143,23 @@ contract Vault is Owned { return idPayment; } + + + + /// @notice `confirmPayment` is a basic function used to allow the + /// owner of the vault to initiate a payment confirmation. Since + /// `authorizePayment` is the only pay to populate the `payments` array + /// this is generally used when `autopay` is `false` after a payment has + /// has been authorized. + /// @param _idPayment Array lookup for the payment. function confirmPayment(uint _idPayment) onlyOwner { doConfirmPayment(_idPayment); } + /// @notice `doConfirmPayment` is used to actually initiate a payment + /// to the final destination. All of the payment information should be + /// set before calling this function. + /// @param _idPayment Array lookup for the payment. function doConfirmPayment(uint _idPayment) internal { require(_idPayment < payments.length); Payment storage p = payments[_idPayment]; @@ -143,10 +173,16 @@ contract Vault is Owned { ConfirmPayment(_idPayment); } + /// @notice `cancelPayment` is used when `autopay` is `false` in order + /// to allow the owner to cancel a payment instead of confirming it. + /// @param _idPayment Array lookup for the payment. function cancelPayment(uint _idPayment) onlyOwner { doCancelPayment(_idPayment); } + /// @notice `doCancelPayment` This carries out the task of actually + /// canceling a payment instead of confirming it. + /// @param _idPayment Array lookup for the payment. function doCancelPayment(uint _idPayment) internal { require(_idPayment < payments.length); Payment storage p = payments[_idPayment]; @@ -160,18 +196,27 @@ contract Vault is Owned { } + /// @notice `multiConfirm` allows for more efficient confirmation of + /// multiple payments. + /// @param _idPayments An array of multiple payment ids function multiConfirm(uint[] _idPayments) onlyOwner { for (uint i=0; i < _idPayments.length; i++) { doConfirmPayment(_idPayments[i]); } } + /// @notice `multiCancel` allows for more efficient cancellation of + /// multiple payments. + /// @param _idPayments An array of multiple payment ids function multiCancel(uint[] _idPayments) onlyOwner { for (uint i=0; i < _idPayments.length; i++) { doCancelPayment(_idPayments[i]); } } + /// @notice `nPayments` Basic getter to return the number of payments + /// currently held in the system. Since payments are not removed from + /// the array this represents all payments over all time. function nPayments() constant returns (uint) { return payments.length; } diff --git a/contracts/ILiquidPledgingPlugin.sol b/contracts/ILiquidPledgingPlugin.sol index e76a7cc..75a1afc 100644 --- a/contracts/ILiquidPledgingPlugin.sol +++ b/contracts/ILiquidPledgingPlugin.sol @@ -42,14 +42,13 @@ contract ILiquidPledgingPlugin { /// 258 -> Plugin for the second delegate receiving pledge to another party /// ... /// 511 -> Plugin for the intendedProject receiving pledge to another party - /// @param _amount The amount of value that will be transfered. + /// @param amount The amount of value that will be transfered. function beforeTransfer( uint64 pledgeManager, uint64 pledgeFrom, uint64 pledgeTo, uint64 context, - uint amount - ) returns (uint maxAllowed); + uint amount ) returns (uint maxAllowed); /// @notice Plugins are used (much like web hooks) to initiate an action /// upon any donation, delegation, or transfer; this is an optional feature @@ -70,7 +69,7 @@ contract ILiquidPledgingPlugin { /// 258 -> Plugin for the second delegate receiving pledge to another party /// ... /// 511 -> Plugin for the intendedProject receiving pledge to another party - /// @param _amount The amount of value that will be transfered. + /// @param amount The amount of value that will be transfered. function afterTransfer( uint64 pledgeManager, uint64 pledgeFrom, diff --git a/contracts/LiquidPledging.sol b/contracts/LiquidPledging.sol index 490e830..8f024e3 100644 --- a/contracts/LiquidPledging.sol +++ b/contracts/LiquidPledging.sol @@ -316,7 +316,7 @@ contract LiquidPledging is LiquidPledgingBase { /// @param idSender ID of the giver, delegate or project admin that is /// transferring the funds from Pledge to Pledge. This admin must have /// permissions to move the value - /// @param amount An array of pledge amounts and IDs which are extrapolated + /// @param pledgesAmounts An array of pledge amounts and IDs which are extrapolated /// using the D64 bitmask /// @param idReceiver Destination of the value, can be a giver sending /// to a giver or a delegate or a delegate to another delegate or a @@ -336,7 +336,7 @@ contract LiquidPledging is LiquidPledgingBase { /// @notice `mWithdraw` allows for multiple pledges to be /// withdrawn efficiently - /// @param amount An array of pledge amounts and IDs which are + /// @param pledgesAmounts An array of pledge amounts and IDs which are /// extrapolated using the D64 bitmask function mWithdraw(uint[] pledgesAmounts) { for (uint i = 0; i < pledgesAmounts.length; i++ ) { @@ -349,7 +349,7 @@ contract LiquidPledging is LiquidPledgingBase { /// @notice `mConfirmPayment` allows for multiple pledges to be confirmed /// efficiently - /// @param amount An array of pledge amounts and IDs which are extrapolated + /// @param pledgesAmounts An array of pledge amounts and IDs which are extrapolated /// using the D64 bitmask function mConfirmPayment(uint[] pledgesAmounts) { for (uint i = 0; i < pledgesAmounts.length; i++ ) { @@ -362,7 +362,7 @@ contract LiquidPledging is LiquidPledgingBase { /// @notice `mCancelPayment` allows for multiple pledges to be canceled /// efficiently - /// @param amount An array of pledge amounts and IDs which are extrapolated + /// @param pledgesAmounts An array of pledge amounts and IDs which are extrapolated /// using the D64 bitmask function mCancelPayment(uint[] pledgesAmounts) { for (uint i = 0; i < pledgesAmounts.length; i++ ) { @@ -375,7 +375,7 @@ contract LiquidPledging is LiquidPledgingBase { /// @notice `mNormalizePledge` allows for multiple pledges to be /// normalized efficiently - /// @param amount An array of pledge IDs which are extrapolated using + /// @param pledges An array of pledge IDs which are extrapolated using /// the D64 bitmask function mNormalizePledge(uint[] pledges) returns(uint64) { for (uint i = 0; i < pledges.length; i++ ) { @@ -682,7 +682,7 @@ contract LiquidPledging is LiquidPledgingBase { /// is being called. /// @param fromPledge This is the Id from which value is being transfered. /// @param toPledge This is the Id that value is being transfered to. - /// @param _amount The amount of value that is being transfered. + /// @param amount The amount of value that is being transfered. function callPluginsPledge( bool before, uint64 idPledge, diff --git a/contracts/LiquidPledgingBase.sol b/contracts/LiquidPledgingBase.sol index e5d3660..5b01160 100644 --- a/contracts/LiquidPledgingBase.sol +++ b/contracts/LiquidPledgingBase.sol @@ -70,7 +70,7 @@ contract LiquidPledgingBase { Pledge[] pledges; PledgeAdmin[] admins; //The list of pledgeAdmins 0 means there is no admin - Vault public vault; + LPVault public vault; // this mapping allows you to search for a specific pledge's // index number by the hash of that pledge @@ -98,7 +98,7 @@ contract LiquidPledgingBase { function LiquidPledgingBase(address _vault) { admins.length = 1; // we reserve the 0 admin pledges.length = 1; // we reserve the 0 pledge - vault = Vault(_vault); + vault = LPVault(_vault); } @@ -195,7 +195,7 @@ contract LiquidPledgingBase { /// @notice `updateDelegate` allows for basic update operation to change the address, /// name or commitTime associated with a specific delegate. - /// @param idGiver This is the internal ID used to specify the admin lookup + /// @param idxDelegate This is the internal ID used to specify the admin lookup /// that coresponds to the delegate. /// @param newAddr This parameter specifies an address to change the given /// correspondancec between the giver's internal ID and an external address. @@ -325,13 +325,13 @@ contract LiquidPledgingBase { /// and the delegate ID. /// @param idPledge The ID internally representing the pledge. /// @param idxDelegate The ID internally representing the delegate. - function getPledgeDelegate(uint64 idPledge, uint idxDelegate) constant returns( + function getPledgeDelegate(uint64 idPledge, uint _idxDelegate) constant returns( uint64 idxDelegate, address addr, string name ) { Pledge storage n = findPledge(idPledge); - idxDelegate = n.delegationChain[idxDelegate - 1]; + idxDelegate = n.delegationChain[_idxDelegate - 1]; PledgeAdmin storage delegate = findAdmin(idxDelegate); addr = delegate.addr; name = delegate.name; diff --git a/contracts/LPVault.sol b/contracts/Vault.sol similarity index 96% rename from contracts/LPVault.sol rename to contracts/Vault.sol index 7df9a4d..996afe9 100644 --- a/contracts/LPVault.sol +++ b/contracts/Vault.sol @@ -75,13 +75,16 @@ contract LPVault is Owned { /// @notice `authorizePayment` is used in order to approve a payment /// from the liquid pledging contract. Whenever a project or other address - /// needs to receve a payment it needs to be authorized with this contract. + /// needs to receive a payment it needs to be authorized with this contract. /// @param _ref This parameter is used to reference details about the - /// payment from another conttract. + /// payment from another contract. /// @param _dest This is the address that payments will end up being sent to /// @param _amount This is the amount that the payment is being authorized /// for. - function authorizePayment(bytes32 _ref, address _dest, uint _amount) onlyLiquidPledging returns (uint) { + function authorizePayment( + bytes32 _ref, + address _dest, + uint _amount ) onlyLiquidPledging returns (uint) { uint idPayment = payments.length; payments.length ++; payments[idPayment].state = PaymentStatus.Pending; @@ -96,6 +99,9 @@ contract LPVault is Owned { return idPayment; } + + + /// @notice `confirmPayment` is a basic function used to allow the /// owner of the vault to initiate a payment confirmation. Since /// `authorizePayment` is the only pay to populate the `payments` array diff --git a/js/vault.js b/js/vault.js index b9fe764..889f452 100644 --- a/js/vault.js +++ b/js/vault.js @@ -2,4 +2,4 @@ const VaultAbi = require('../build/LPVault.sol').VaultAbi; const VaultByteCode = require('../build/LPVault.sol').VaultByteCode; const generateClass = require('eth-contract-class').default; -module.exports = generateClass(VaultAbi, VaultByteCode); +module.exports = generateClass(VaultAbi, VaultByteCode); \ No newline at end of file