rm build dir

This commit is contained in:
perissology 2018-04-24 13:23:52 -07:00
parent e81fff9de8
commit ca261d48e2
37 changed files with 0 additions and 40298 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,680 +0,0 @@
///File: giveth-common-contracts/contracts/ERC20.sol
pragma solidity ^0.4.15;
/**
* @title ERC20
* @dev A standard interface for tokens.
* @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
*/
contract ERC20 {
/// @dev Returns the total token supply
function totalSupply() public constant returns (uint256 supply);
/// @dev Returns the account balance of the account with address _owner
function balanceOf(address _owner) public constant returns (uint256 balance);
/// @dev Transfers _value number of tokens to address _to
function transfer(address _to, uint256 _value) public returns (bool success);
/// @dev Transfers _value number of tokens from address _from to address _to
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @dev Allows _spender to withdraw from the msg.sender's account up to the _value amount
function approve(address _spender, uint256 _value) public returns (bool success);
/// @dev Returns the amount which _spender is still allowed to withdraw from _owner
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
///File: @aragon/os/contracts/acl/IACL.sol
pragma solidity ^0.4.18;
interface IACL {
function initialize(address permissionsCreator) public;
function hasPermission(address who, address where, bytes32 what, bytes how) public view returns (bool);
}
///File: @aragon/os/contracts/kernel/IKernel.sol
pragma solidity ^0.4.18;
interface IKernel {
event SetApp(bytes32 indexed namespace, bytes32 indexed name, bytes32 indexed id, address app);
function acl() public view returns (IACL);
function hasPermission(address who, address where, bytes32 what, bytes how) public view returns (bool);
function setApp(bytes32 namespace, bytes32 name, address app) public returns (bytes32 id);
function getApp(bytes32 id) public view returns (address);
}
///File: @aragon/os/contracts/apps/AppStorage.sol
pragma solidity ^0.4.18;
contract AppStorage {
IKernel public kernel;
bytes32 public appId;
address internal pinnedCode; // used by Proxy Pinned
uint256 internal initializationBlock; // used by Initializable
uint256[95] private storageOffset; // forces App storage to start at after 100 slots
uint256 private offset;
}
///File: @aragon/os/contracts/common/Initializable.sol
pragma solidity ^0.4.18;
contract Initializable is AppStorage {
modifier onlyInit {
require(initializationBlock == 0);
_;
}
/**
* @return Block number in which the contract was initialized
*/
function getInitializationBlock() public view returns (uint256) {
return initializationBlock;
}
/**
* @dev Function to be called by top level contract after initialization has finished.
*/
function initialized() internal onlyInit {
initializationBlock = getBlockNumber();
}
/**
* @dev Returns the current block number.
* Using a function rather than `block.number` allows us to easily mock the block number in
* tests.
*/
function getBlockNumber() internal view returns (uint256) {
return block.number;
}
}
///File: @aragon/os/contracts/evmscript/IEVMScriptExecutor.sol
pragma solidity ^0.4.18;
interface IEVMScriptExecutor {
function execScript(bytes script, bytes input, address[] blacklist) external returns (bytes);
}
///File: @aragon/os/contracts/evmscript/IEVMScriptRegistry.sol
pragma solidity 0.4.18;
contract EVMScriptRegistryConstants {
bytes32 constant public EVMSCRIPT_REGISTRY_APP_ID = keccak256("evmreg.aragonpm.eth");
bytes32 constant public EVMSCRIPT_REGISTRY_APP = keccak256(keccak256("app"), EVMSCRIPT_REGISTRY_APP_ID);
}
interface IEVMScriptRegistry {
function addScriptExecutor(address executor) external returns (uint id);
function disableScriptExecutor(uint256 executorId) external;
function getScriptExecutor(bytes script) public view returns (address);
}
///File: @aragon/os/contracts/evmscript/ScriptHelpers.sol
pragma solidity 0.4.18;
library ScriptHelpers {
// To test with JS and compare with actual encoder. Maintaining for reference.
// t = function() { return IEVMScriptExecutor.at('0x4bcdd59d6c77774ee7317fc1095f69ec84421e49').contract.execScript.getData(...[].slice.call(arguments)).slice(10).match(/.{1,64}/g) }
// run = function() { return ScriptHelpers.new().then(sh => { sh.abiEncode.call(...[].slice.call(arguments)).then(a => console.log(a.slice(2).match(/.{1,64}/g)) ) }) }
// This is truly not beautiful but lets no daydream to the day solidity gets reflection features
function abiEncode(bytes _a, bytes _b, address[] _c) public pure returns (bytes d) {
return encode(_a, _b, _c);
}
function encode(bytes memory _a, bytes memory _b, address[] memory _c) internal pure returns (bytes memory d) {
// A is positioned after the 3 position words
uint256 aPosition = 0x60;
uint256 bPosition = aPosition + 32 * abiLength(_a);
uint256 cPosition = bPosition + 32 * abiLength(_b);
uint256 length = cPosition + 32 * abiLength(_c);
d = new bytes(length);
assembly {
// Store positions
mstore(add(d, 0x20), aPosition)
mstore(add(d, 0x40), bPosition)
mstore(add(d, 0x60), cPosition)
}
// Copy memory to correct position
copy(d, getPtr(_a), aPosition, _a.length);
copy(d, getPtr(_b), bPosition, _b.length);
copy(d, getPtr(_c), cPosition, _c.length * 32); // 1 word per address
}
function abiLength(bytes memory _a) internal pure returns (uint256) {
// 1 for length +
// memory words + 1 if not divisible for 32 to offset word
return 1 + (_a.length / 32) + (_a.length % 32 > 0 ? 1 : 0);
}
function abiLength(address[] _a) internal pure returns (uint256) {
// 1 for length + 1 per item
return 1 + _a.length;
}
function copy(bytes _d, uint256 _src, uint256 _pos, uint256 _length) internal pure {
uint dest;
assembly {
dest := add(add(_d, 0x20), _pos)
}
memcpy(dest, _src, _length + 32);
}
function getPtr(bytes memory _x) internal pure returns (uint256 ptr) {
assembly {
ptr := _x
}
}
function getPtr(address[] memory _x) internal pure returns (uint256 ptr) {
assembly {
ptr := _x
}
}
function getSpecId(bytes _script) internal pure returns (uint32) {
return uint32At(_script, 0);
}
function uint256At(bytes _data, uint256 _location) internal pure returns (uint256 result) {
assembly {
result := mload(add(_data, add(0x20, _location)))
}
}
function addressAt(bytes _data, uint256 _location) internal pure returns (address result) {
uint256 word = uint256At(_data, _location);
assembly {
result := div(and(word, 0xffffffffffffffffffffffffffffffffffffffff000000000000000000000000),
0x1000000000000000000000000)
}
}
function uint32At(bytes _data, uint256 _location) internal pure returns (uint32 result) {
uint256 word = uint256At(_data, _location);
assembly {
result := div(and(word, 0xffffffff00000000000000000000000000000000000000000000000000000000),
0x100000000000000000000000000000000000000000000000000000000)
}
}
function locationOf(bytes _data, uint256 _location) internal pure returns (uint256 result) {
assembly {
result := add(_data, add(0x20, _location))
}
}
function toBytes(bytes4 _sig) internal pure returns (bytes) {
bytes memory payload = new bytes(4);
payload[0] = bytes1(_sig);
payload[1] = bytes1(_sig << 8);
payload[2] = bytes1(_sig << 16);
payload[3] = bytes1(_sig << 24);
return payload;
}
function memcpy(uint _dest, uint _src, uint _len) public pure {
uint256 src = _src;
uint256 dest = _dest;
uint256 len = _len;
// Copy word-length chunks while possible
for (; len >= 32; len -= 32) {
assembly {
mstore(dest, mload(src))
}
dest += 32;
src += 32;
}
// Copy remaining bytes
uint mask = 256 ** (32 - len) - 1;
assembly {
let srcpart := and(mload(src), not(mask))
let destpart := and(mload(dest), mask)
mstore(dest, or(destpart, srcpart))
}
}
}
///File: @aragon/os/contracts/evmscript/EVMScriptRunner.sol
pragma solidity ^0.4.18;
contract EVMScriptRunner is AppStorage, EVMScriptRegistryConstants {
using ScriptHelpers for bytes;
function runScript(bytes _script, bytes _input, address[] _blacklist) protectState internal returns (bytes output) {
// TODO: Too much data flying around, maybe extracting spec id here is cheaper
address executorAddr = getExecutor(_script);
require(executorAddr != address(0));
bytes memory calldataArgs = _script.encode(_input, _blacklist);
bytes4 sig = IEVMScriptExecutor(0).execScript.selector;
require(executorAddr.delegatecall(sig, calldataArgs));
return returnedDataDecoded();
}
function getExecutor(bytes _script) public view returns (IEVMScriptExecutor) {
return IEVMScriptExecutor(getExecutorRegistry().getScriptExecutor(_script));
}
// TODO: Internal
function getExecutorRegistry() internal view returns (IEVMScriptRegistry) {
address registryAddr = kernel.getApp(EVMSCRIPT_REGISTRY_APP);
return IEVMScriptRegistry(registryAddr);
}
/**
* @dev copies and returns last's call data. Needs to ABI decode first
*/
function returnedDataDecoded() internal view returns (bytes ret) {
assembly {
let size := returndatasize
switch size
case 0 {}
default {
ret := mload(0x40) // free mem ptr get
mstore(0x40, add(ret, add(size, 0x20))) // free mem ptr set
returndatacopy(ret, 0x20, sub(size, 0x20)) // copy return data
}
}
return ret;
}
modifier protectState {
address preKernel = kernel;
bytes32 preAppId = appId;
_; // exec
require(kernel == preKernel);
require(appId == preAppId);
}
}
///File: @aragon/os/contracts/acl/ACLSyntaxSugar.sol
pragma solidity 0.4.18;
contract ACLSyntaxSugar {
function arr() internal pure returns (uint256[] r) {}
function arr(bytes32 _a) internal pure returns (uint256[] r) {
return arr(uint256(_a));
}
function arr(bytes32 _a, bytes32 _b) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b));
}
function arr(address _a) internal pure returns (uint256[] r) {
return arr(uint256(_a));
}
function arr(address _a, address _b) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b));
}
function arr(address _a, uint256 _b, uint256 _c) internal pure returns (uint256[] r) {
return arr(uint256(_a), _b, _c);
}
function arr(address _a, uint256 _b) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b));
}
function arr(address _a, address _b, uint256 _c, uint256 _d, uint256 _e) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b), _c, _d, _e);
}
function arr(address _a, address _b, address _c) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b), uint256(_c));
}
function arr(address _a, address _b, uint256 _c) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b), uint256(_c));
}
function arr(uint256 _a) internal pure returns (uint256[] r) {
r = new uint256[](1);
r[0] = _a;
}
function arr(uint256 _a, uint256 _b) internal pure returns (uint256[] r) {
r = new uint256[](2);
r[0] = _a;
r[1] = _b;
}
function arr(uint256 _a, uint256 _b, uint256 _c) internal pure returns (uint256[] r) {
r = new uint256[](3);
r[0] = _a;
r[1] = _b;
r[2] = _c;
}
function arr(uint256 _a, uint256 _b, uint256 _c, uint256 _d) internal pure returns (uint256[] r) {
r = new uint256[](4);
r[0] = _a;
r[1] = _b;
r[2] = _c;
r[3] = _d;
}
function arr(uint256 _a, uint256 _b, uint256 _c, uint256 _d, uint256 _e) internal pure returns (uint256[] r) {
r = new uint256[](5);
r[0] = _a;
r[1] = _b;
r[2] = _c;
r[3] = _d;
r[4] = _e;
}
}
contract ACLHelpers {
function decodeParamOp(uint256 _x) internal pure returns (uint8 b) {
return uint8(_x >> (8 * 30));
}
function decodeParamId(uint256 _x) internal pure returns (uint8 b) {
return uint8(_x >> (8 * 31));
}
function decodeParamsList(uint256 _x) internal pure returns (uint32 a, uint32 b, uint32 c) {
a = uint32(_x);
b = uint32(_x >> (8 * 4));
c = uint32(_x >> (8 * 8));
}
}
///File: @aragon/os/contracts/apps/AragonApp.sol
pragma solidity ^0.4.18;
contract AragonApp is AppStorage, Initializable, ACLSyntaxSugar, EVMScriptRunner {
modifier auth(bytes32 _role) {
require(canPerform(msg.sender, _role, new uint256[](0)));
_;
}
modifier authP(bytes32 _role, uint256[] params) {
require(canPerform(msg.sender, _role, params));
_;
}
function canPerform(address _sender, bytes32 _role, uint256[] params) public view returns (bool) {
bytes memory how; // no need to init memory as it is never used
if (params.length > 0) {
uint256 byteLength = params.length * 32;
assembly {
how := params // forced casting
mstore(how, byteLength)
}
}
return address(kernel) == 0 || kernel.hasPermission(_sender, address(this), _role, how);
}
}
///File: ./contracts/EscapableApp.sol
pragma solidity ^0.4.18;
/*
Copyright 2016, Jordi Baylina
Contributor: Adrià Massanet <adria@codecontext.io>
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 <http://www.gnu.org/licenses/>.
*/
// import "./Owned.sol";
/// @dev `EscapableApp` is a base level contract; it creates an escape hatch
/// function that can be called in an
/// emergency that will allow designated addresses to send any ether or tokens
/// held in the contract to an `escapeHatchDestination` as long as they were
/// not blacklisted
contract EscapableApp is AragonApp {
// warning whoever has this role can move all funds to the `escapeHatchDestination`
bytes32 constant public ESCAPE_HATCH_CALLER_ROLE = keccak256("ESCAPE_HATCH_CALLER_ROLE");
event EscapeHatchBlackistedToken(address token);
event EscapeHatchCalled(address token, uint amount);
address public escapeHatchDestination;
mapping (address=>bool) private escapeBlacklist; // Token contract addresses
uint[20] private storageOffset; // reserve 20 slots for future upgrades
function EscapableApp(address _escapeHatchDestination) public {
_init(_escapeHatchDestination);
}
/// @param _escapeHatchDestination The address of a safe location (usu a
/// Multisig) to send the ether held in this contract; if a neutral address
/// is required, the WHG Multisig is an option:
/// 0x8Ff920020c8AD673661c8117f2855C384758C572
function initialize(address _escapeHatchDestination) onlyInit public {
_init(_escapeHatchDestination);
}
/// @notice The `escapeHatch()` should only be called as a last resort if a
/// security issue is uncovered or something unexpected happened
/// @param _token to transfer, use 0x0 for ether
function escapeHatch(address _token) external authP(ESCAPE_HATCH_CALLER_ROLE, arr(_token)) {
require(escapeBlacklist[_token]==false);
uint256 balance;
/// @dev Logic for ether
if (_token == 0x0) {
balance = this.balance;
escapeHatchDestination.transfer(balance);
EscapeHatchCalled(_token, balance);
return;
}
/// @dev Logic for tokens
ERC20 token = ERC20(_token);
balance = token.balanceOf(this);
require(token.transfer(escapeHatchDestination, balance));
EscapeHatchCalled(_token, balance);
}
/// @notice Checks to see if `_token` is in the blacklist of tokens
/// @param _token the token address being queried
/// @return False if `_token` is in the blacklist and can't be taken out of
/// the contract via the `escapeHatch()`
function isTokenEscapable(address _token) view external returns (bool) {
return !escapeBlacklist[_token];
}
function _init(address _escapeHatchDestination) internal {
initialized();
require(_escapeHatchDestination != 0x0);
escapeHatchDestination = _escapeHatchDestination;
}
/// @notice Creates the blacklist of tokens that are not able to be taken
/// out of the contract; can only be done at the deployment, and the logic
/// to add to the blacklist will be in the constructor of a child contract
/// @param _token the token contract address that is to be blacklisted
function _blacklistEscapeToken(address _token) internal {
escapeBlacklist[_token] = true;
EscapeHatchBlackistedToken(_token);
}
}
///File: ./contracts/EscapableApp.sol
pragma solidity ^0.4.18;
/*
Copyright 2016, Jordi Baylina
Contributor: Adrià Massanet <adria@codecontext.io>
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 <http://www.gnu.org/licenses/>.
*/
// import "./Owned.sol";
/// @dev `EscapableApp` is a base level contract; it creates an escape hatch
/// function that can be called in an
/// emergency that will allow designated addresses to send any ether or tokens
/// held in the contract to an `escapeHatchDestination` as long as they were
/// not blacklisted
contract EscapableApp is AragonApp {
// warning whoever has this role can move all funds to the `escapeHatchDestination`
bytes32 constant public ESCAPE_HATCH_CALLER_ROLE = keccak256("ESCAPE_HATCH_CALLER_ROLE");
event EscapeHatchBlackistedToken(address token);
event EscapeHatchCalled(address token, uint amount);
address public escapeHatchDestination;
mapping (address=>bool) private escapeBlacklist; // Token contract addresses
uint[20] private storageOffset; // reserve 20 slots for future upgrades
function EscapableApp(address _escapeHatchDestination) public {
_init(_escapeHatchDestination);
}
/// @param _escapeHatchDestination The address of a safe location (usu a
/// Multisig) to send the ether held in this contract; if a neutral address
/// is required, the WHG Multisig is an option:
/// 0x8Ff920020c8AD673661c8117f2855C384758C572
function initialize(address _escapeHatchDestination) onlyInit public {
_init(_escapeHatchDestination);
}
/// @notice The `escapeHatch()` should only be called as a last resort if a
/// security issue is uncovered or something unexpected happened
/// @param _token to transfer, use 0x0 for ether
function escapeHatch(address _token) external authP(ESCAPE_HATCH_CALLER_ROLE, arr(_token)) {
require(escapeBlacklist[_token]==false);
uint256 balance;
/// @dev Logic for ether
if (_token == 0x0) {
balance = this.balance;
escapeHatchDestination.transfer(balance);
EscapeHatchCalled(_token, balance);
return;
}
/// @dev Logic for tokens
ERC20 token = ERC20(_token);
balance = token.balanceOf(this);
require(token.transfer(escapeHatchDestination, balance));
EscapeHatchCalled(_token, balance);
}
/// @notice Checks to see if `_token` is in the blacklist of tokens
/// @param _token the token address being queried
/// @return False if `_token` is in the blacklist and can't be taken out of
/// the contract via the `escapeHatch()`
function isTokenEscapable(address _token) view external returns (bool) {
return !escapeBlacklist[_token];
}
function _init(address _escapeHatchDestination) internal {
initialized();
require(_escapeHatchDestination != 0x0);
escapeHatchDestination = _escapeHatchDestination;
}
/// @notice Creates the blacklist of tokens that are not able to be taken
/// out of the contract; can only be done at the deployment, and the logic
/// to add to the blacklist will be in the constructor of a child contract
/// @param _token the token contract address that is to be blacklisted
function _blacklistEscapeToken(address _token) internal {
escapeBlacklist[_token] = true;
EscapeHatchBlackistedToken(_token);
}
}

View File

@ -1,7 +0,0 @@
/* 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":"token","type":"address"},{"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":"token","type":"address"},{"name":"amount","type":"uint256"}],"name":"beforeTransfer","outputs":[{"name":"maxAllowed","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]
exports.ILiquidPledgingPluginByteCode = "0x"
exports.ILiquidPledgingPluginRuntimeByteCode = "0x"
exports['_./contracts/ILiquidPledgingPlugin.sol_keccak256'] = "0x5428d88ef6856b67f0d3271065542aa4b7e6d73428b35bf1b434e5f507d3b88b"
exports._solcVersion = "0.4.18+commit.9cf6e910.Darwin.appleclang"

View File

@ -1,87 +0,0 @@
///File: ./contracts/ILiquidPledgingPlugin.sol
pragma solidity ^0.4.11;
/*
Copyright 2017, Jordi Baylina
Contributors: Adrià Massanet <adria@codecontext.io>, RJ Ewing, Griff
Green, Arthur Lunn
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 <http://www.gnu.org/licenses/>.
*/
/// @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. 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
/// 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 beforeTransfer(
uint64 pledgeManager,
uint64 pledgeFrom,
uint64 pledgeTo,
uint64 context,
address token,
uint amount ) public 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,
address token,
uint amount
) public;
}

View File

@ -1,14 +0,0 @@
/* This is an autogenerated file. DO NOT EDIT MANUALLY */
exports.KernelConstantsAbi = [{"constant":true,"inputs":[],"name":"KERNEL_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"APP_ADDR_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"KERNEL_APP","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CORE_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ACL_APP","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ACL_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"APP_BASES_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"}]
exports.KernelConstantsByteCode = "0x6060604052341561000f57600080fd5b6103468061001e6000396000f3006060604052600436106100825763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631113ed0d8114610087578063178e6079146100ac57806325012699146100bf578063756f6049146100d2578063a3b4b07f146100e5578063cbcc65eb146100f8578063db8a61d41461010b575b600080fd5b341561009257600080fd5b61009a61011e565b60405190815260200160405180910390f35b34156100b757600080fd5b61009a610152565b34156100ca57600080fd5b61009a610186565b34156100dd57600080fd5b61009a610202565b34156100f057600080fd5b61009a610236565b341561010357600080fd5b61009a6102b2565b341561011657600080fd5b61009a6102e6565b6040517f6b65726e656c2e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b6040517f61707000000000000000000000000000000000000000000000000000000000008152600301604051809103902081565b6040517f636f726500000000000000000000000000000000000000000000000000000000815260040160405180910390206040517f6b65726e656c2e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902081565b6040517f636f7265000000000000000000000000000000000000000000000000000000008152600401604051809103902081565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f61636c2e617261676f6e706d2e6574680000000000000000000000000000000081526010016040518091039020604051918252602082015260409081019051809103902081565b6040517f61636c2e617261676f6e706d2e657468000000000000000000000000000000008152601001604051809103902081565b6040517f626173650000000000000000000000000000000000000000000000000000000081526004016040518091039020815600a165627a7a7230582014d71f7869e1c0dfd619151bc2e8c85bd036f00365073c15c71ad8a4fa9507ea0029"
exports.KernelConstantsRuntimeByteCode = "0x6060604052600436106100825763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631113ed0d8114610087578063178e6079146100ac57806325012699146100bf578063756f6049146100d2578063a3b4b07f146100e5578063cbcc65eb146100f8578063db8a61d41461010b575b600080fd5b341561009257600080fd5b61009a61011e565b60405190815260200160405180910390f35b34156100b757600080fd5b61009a610152565b34156100ca57600080fd5b61009a610186565b34156100dd57600080fd5b61009a610202565b34156100f057600080fd5b61009a610236565b341561010357600080fd5b61009a6102b2565b341561011657600080fd5b61009a6102e6565b6040517f6b65726e656c2e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b6040517f61707000000000000000000000000000000000000000000000000000000000008152600301604051809103902081565b6040517f636f726500000000000000000000000000000000000000000000000000000000815260040160405180910390206040517f6b65726e656c2e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902081565b6040517f636f7265000000000000000000000000000000000000000000000000000000008152600401604051809103902081565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f61636c2e617261676f6e706d2e6574680000000000000000000000000000000081526010016040518091039020604051918252602082015260409081019051809103902081565b6040517f61636c2e617261676f6e706d2e657468000000000000000000000000000000008152601001604051809103902081565b6040517f626173650000000000000000000000000000000000000000000000000000000081526004016040518091039020815600a165627a7a7230582014d71f7869e1c0dfd619151bc2e8c85bd036f00365073c15c71ad8a4fa9507ea0029"
exports.KernelStorageAbi = [{"constant":true,"inputs":[],"name":"KERNEL_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"APP_ADDR_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"KERNEL_APP","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"apps","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CORE_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ACL_APP","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ACL_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"APP_BASES_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"}]
exports.KernelStorageByteCode = "0x6060604052341561000f57600080fd5b6103b88061001e6000396000f30060606040526004361061008d5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631113ed0d8114610092578063178e6079146100b757806325012699146100ca57806338bb6def146100dd578063756f60491461011c578063a3b4b07f1461012f578063cbcc65eb14610142578063db8a61d414610155575b600080fd5b341561009d57600080fd5b6100a5610168565b60405190815260200160405180910390f35b34156100c257600080fd5b6100a561019c565b34156100d557600080fd5b6100a56101d0565b34156100e857600080fd5b6100f360043561024c565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b341561012757600080fd5b6100a5610274565b341561013a57600080fd5b6100a56102a8565b341561014d57600080fd5b6100a5610324565b341561016057600080fd5b6100a5610358565b6040517f6b65726e656c2e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b6040517f61707000000000000000000000000000000000000000000000000000000000008152600301604051809103902081565b6040517f636f726500000000000000000000000000000000000000000000000000000000815260040160405180910390206040517f6b65726e656c2e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902081565b60006020819052908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6040517f636f7265000000000000000000000000000000000000000000000000000000008152600401604051809103902081565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f61636c2e617261676f6e706d2e6574680000000000000000000000000000000081526010016040518091039020604051918252602082015260409081019051809103902081565b6040517f61636c2e617261676f6e706d2e657468000000000000000000000000000000008152601001604051809103902081565b6040517f626173650000000000000000000000000000000000000000000000000000000081526004016040518091039020815600a165627a7a723058204d2856d471af02cd9bfd249b4c2eaafdd0bef99f1994ac38e1e056a9e6b3a0d10029"
exports.KernelStorageRuntimeByteCode = "0x60606040526004361061008d5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631113ed0d8114610092578063178e6079146100b757806325012699146100ca57806338bb6def146100dd578063756f60491461011c578063a3b4b07f1461012f578063cbcc65eb14610142578063db8a61d414610155575b600080fd5b341561009d57600080fd5b6100a5610168565b60405190815260200160405180910390f35b34156100c257600080fd5b6100a561019c565b34156100d557600080fd5b6100a56101d0565b34156100e857600080fd5b6100f360043561024c565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b341561012757600080fd5b6100a5610274565b341561013a57600080fd5b6100a56102a8565b341561014d57600080fd5b6100a5610324565b341561016057600080fd5b6100a5610358565b6040517f6b65726e656c2e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b6040517f61707000000000000000000000000000000000000000000000000000000000008152600301604051809103902081565b6040517f636f726500000000000000000000000000000000000000000000000000000000815260040160405180910390206040517f6b65726e656c2e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902081565b60006020819052908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6040517f636f7265000000000000000000000000000000000000000000000000000000008152600401604051809103902081565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f61636c2e617261676f6e706d2e6574680000000000000000000000000000000081526010016040518091039020604051918252602082015260409081019051809103902081565b6040517f61636c2e617261676f6e706d2e657468000000000000000000000000000000008152601001604051809103902081565b6040517f626173650000000000000000000000000000000000000000000000000000000081526004016040518091039020815600a165627a7a723058204d2856d471af02cd9bfd249b4c2eaafdd0bef99f1994ac38e1e056a9e6b3a0d10029"
exports['_@aragon/os/contracts/kernel/KernelStorage.sol_keccak256'] = "0x5eeaeb6e75a435278d5a2d74dab865bd9c2a88fba296db5b8669769d6a60573e"
exports.LPConstantsAbi = [{"constant":true,"inputs":[],"name":"KERNEL_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"APP_ADDR_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"KERNEL_APP","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"LP_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CORE_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ACL_APP","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ACL_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"VAULT_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"APP_BASES_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"}]
exports.LPConstantsByteCode = "0x6060604052341561000f57600080fd5b6103ea8061001e6000396000f3006060604052600436106100985763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631113ed0d811461009d578063178e6079146100c257806325012699146100d557806330744267146100e8578063756f6049146100fb578063a3b4b07f1461010e578063cbcc65eb14610121578063d2dd420f14610134578063db8a61d414610147575b600080fd5b34156100a857600080fd5b6100b061015a565b60405190815260200160405180910390f35b34156100cd57600080fd5b6100b061018e565b34156100e057600080fd5b6100b06101c2565b34156100f357600080fd5b6100b061023e565b341561010657600080fd5b6100b0610272565b341561011957600080fd5b6100b06102a6565b341561012c57600080fd5b6100b0610322565b341561013f57600080fd5b6100b0610356565b341561015257600080fd5b6100b061038a565b6040517f6b65726e656c2e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b6040517f61707000000000000000000000000000000000000000000000000000000000008152600301604051809103902081565b6040517f636f726500000000000000000000000000000000000000000000000000000000815260040160405180910390206040517f6b65726e656c2e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902081565b6040517f6c6971756964506c656467696e670000000000000000000000000000000000008152600e01604051809103902081565b6040517f636f7265000000000000000000000000000000000000000000000000000000008152600401604051809103902081565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f61636c2e617261676f6e706d2e6574680000000000000000000000000000000081526010016040518091039020604051918252602082015260409081019051809103902081565b6040517f61636c2e617261676f6e706d2e657468000000000000000000000000000000008152601001604051809103902081565b6040517f7661756c740000000000000000000000000000000000000000000000000000008152600501604051809103902081565b6040517f626173650000000000000000000000000000000000000000000000000000000081526004016040518091039020815600a165627a7a723058200ec32a4f75b4df13b45d516179ebc2a84dba287232e7699a8d347f2704d293f70029"
exports.LPConstantsRuntimeByteCode = "0x6060604052600436106100985763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631113ed0d811461009d578063178e6079146100c257806325012699146100d557806330744267146100e8578063756f6049146100fb578063a3b4b07f1461010e578063cbcc65eb14610121578063d2dd420f14610134578063db8a61d414610147575b600080fd5b34156100a857600080fd5b6100b061015a565b60405190815260200160405180910390f35b34156100cd57600080fd5b6100b061018e565b34156100e057600080fd5b6100b06101c2565b34156100f357600080fd5b6100b061023e565b341561010657600080fd5b6100b0610272565b341561011957600080fd5b6100b06102a6565b341561012c57600080fd5b6100b0610322565b341561013f57600080fd5b6100b0610356565b341561015257600080fd5b6100b061038a565b6040517f6b65726e656c2e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b6040517f61707000000000000000000000000000000000000000000000000000000000008152600301604051809103902081565b6040517f636f726500000000000000000000000000000000000000000000000000000000815260040160405180910390206040517f6b65726e656c2e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902081565b6040517f6c6971756964506c656467696e670000000000000000000000000000000000008152600e01604051809103902081565b6040517f636f7265000000000000000000000000000000000000000000000000000000008152600401604051809103902081565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f61636c2e617261676f6e706d2e6574680000000000000000000000000000000081526010016040518091039020604051918252602082015260409081019051809103902081565b6040517f61636c2e617261676f6e706d2e657468000000000000000000000000000000008152601001604051809103902081565b6040517f7661756c740000000000000000000000000000000000000000000000000000008152600501604051809103902081565b6040517f626173650000000000000000000000000000000000000000000000000000000081526004016040518091039020815600a165627a7a723058200ec32a4f75b4df13b45d516179ebc2a84dba287232e7699a8d347f2704d293f70029"
exports['_./contracts/LPConstants.sol_keccak256'] = "0x558e8800a807b65c952c7d731ca1c5c42539d734df4d545f801ecff0f0cd2314"
exports._solcVersion = "0.4.18+commit.9cf6e910.Darwin.appleclang"

View File

@ -1,35 +0,0 @@
///File: @aragon/os/contracts/kernel/KernelStorage.sol
pragma solidity 0.4.18;
contract KernelConstants {
bytes32 constant public CORE_NAMESPACE = keccak256("core");
bytes32 constant public APP_BASES_NAMESPACE = keccak256("base");
bytes32 constant public APP_ADDR_NAMESPACE = keccak256("app");
bytes32 constant public KERNEL_APP_ID = keccak256("kernel.aragonpm.eth");
bytes32 constant public KERNEL_APP = keccak256(CORE_NAMESPACE, KERNEL_APP_ID);
bytes32 constant public ACL_APP_ID = keccak256("acl.aragonpm.eth");
bytes32 constant public ACL_APP = keccak256(APP_ADDR_NAMESPACE, ACL_APP_ID);
}
contract KernelStorage is KernelConstants {
mapping (bytes32 => address) public apps;
}
///File: ./contracts/LPConstants.sol
pragma solidity ^0.4.18;
contract LPConstants is KernelConstants {
bytes32 constant public VAULT_APP_ID = keccak256("vault");
bytes32 constant public LP_APP_ID = keccak256("liquidPledging");
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
/* This is an autogenerated file. DO NOT EDIT MANUALLY */
exports.LiquidPledgingACLHelpersAbi = []
exports.LiquidPledgingACLHelpersByteCode = "0x60606040523415600e57600080fd5b603580601b6000396000f3006060604052600080fd00a165627a7a723058206973d85c28cf65c663e788b11ff59a0e1ad645176781c9df02b74ed0907ba89a0029"
exports.LiquidPledgingACLHelpersRuntimeByteCode = "0x6060604052600080fd00a165627a7a723058206973d85c28cf65c663e788b11ff59a0e1ad645176781c9df02b74ed0907ba89a0029"
exports['_./contracts/LiquidPledgingACLHelpers.sol_keccak256'] = "0xb675a7a788bf656d4c3c78f3b4cf6645afb432939d1a4c38d70e01d068b0ce62"
exports._solcVersion = "0.4.18+commit.9cf6e910.Darwin.appleclang"

View File

@ -1,25 +0,0 @@
///File: ./contracts/LiquidPledgingACLHelpers.sol
pragma solidity ^0.4.18;
contract LiquidPledgingACLHelpers {
function arr(uint64 a, uint64 b, address c, uint d, address e) internal pure returns(uint[] r) {
r = new uint[](4);
r[0] = uint(a);
r[1] = uint(b);
r[2] = uint(c);
r[3] = d;
r[4] = uint(e);
}
function arr(bool a) internal pure returns (uint[] r) {
r = new uint[](1);
uint _a;
assembly {
_a := a // forced casting
}
r[0] = _a;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,798 +0,0 @@
///File: @aragon/os/contracts/acl/IACL.sol
pragma solidity ^0.4.18;
interface IACL {
function initialize(address permissionsCreator) public;
function hasPermission(address who, address where, bytes32 what, bytes how) public view returns (bool);
}
///File: @aragon/os/contracts/kernel/IKernel.sol
pragma solidity ^0.4.18;
interface IKernel {
event SetApp(bytes32 indexed namespace, bytes32 indexed name, bytes32 indexed id, address app);
function acl() public view returns (IACL);
function hasPermission(address who, address where, bytes32 what, bytes how) public view returns (bool);
function setApp(bytes32 namespace, bytes32 name, address app) public returns (bytes32 id);
function getApp(bytes32 id) public view returns (address);
}
///File: @aragon/os/contracts/apps/AppStorage.sol
pragma solidity ^0.4.18;
contract AppStorage {
IKernel public kernel;
bytes32 public appId;
address internal pinnedCode; // used by Proxy Pinned
uint256 internal initializationBlock; // used by Initializable
uint256[95] private storageOffset; // forces App storage to start at after 100 slots
uint256 private offset;
}
///File: @aragon/os/contracts/common/Initializable.sol
pragma solidity ^0.4.18;
contract Initializable is AppStorage {
modifier onlyInit {
require(initializationBlock == 0);
_;
}
/**
* @return Block number in which the contract was initialized
*/
function getInitializationBlock() public view returns (uint256) {
return initializationBlock;
}
/**
* @dev Function to be called by top level contract after initialization has finished.
*/
function initialized() internal onlyInit {
initializationBlock = getBlockNumber();
}
/**
* @dev Returns the current block number.
* Using a function rather than `block.number` allows us to easily mock the block number in
* tests.
*/
function getBlockNumber() internal view returns (uint256) {
return block.number;
}
}
///File: @aragon/os/contracts/evmscript/IEVMScriptExecutor.sol
pragma solidity ^0.4.18;
interface IEVMScriptExecutor {
function execScript(bytes script, bytes input, address[] blacklist) external returns (bytes);
}
///File: @aragon/os/contracts/evmscript/IEVMScriptRegistry.sol
pragma solidity 0.4.18;
contract EVMScriptRegistryConstants {
bytes32 constant public EVMSCRIPT_REGISTRY_APP_ID = keccak256("evmreg.aragonpm.eth");
bytes32 constant public EVMSCRIPT_REGISTRY_APP = keccak256(keccak256("app"), EVMSCRIPT_REGISTRY_APP_ID);
}
interface IEVMScriptRegistry {
function addScriptExecutor(address executor) external returns (uint id);
function disableScriptExecutor(uint256 executorId) external;
function getScriptExecutor(bytes script) public view returns (address);
}
///File: @aragon/os/contracts/evmscript/ScriptHelpers.sol
pragma solidity 0.4.18;
library ScriptHelpers {
// To test with JS and compare with actual encoder. Maintaining for reference.
// t = function() { return IEVMScriptExecutor.at('0x4bcdd59d6c77774ee7317fc1095f69ec84421e49').contract.execScript.getData(...[].slice.call(arguments)).slice(10).match(/.{1,64}/g) }
// run = function() { return ScriptHelpers.new().then(sh => { sh.abiEncode.call(...[].slice.call(arguments)).then(a => console.log(a.slice(2).match(/.{1,64}/g)) ) }) }
// This is truly not beautiful but lets no daydream to the day solidity gets reflection features
function abiEncode(bytes _a, bytes _b, address[] _c) public pure returns (bytes d) {
return encode(_a, _b, _c);
}
function encode(bytes memory _a, bytes memory _b, address[] memory _c) internal pure returns (bytes memory d) {
// A is positioned after the 3 position words
uint256 aPosition = 0x60;
uint256 bPosition = aPosition + 32 * abiLength(_a);
uint256 cPosition = bPosition + 32 * abiLength(_b);
uint256 length = cPosition + 32 * abiLength(_c);
d = new bytes(length);
assembly {
// Store positions
mstore(add(d, 0x20), aPosition)
mstore(add(d, 0x40), bPosition)
mstore(add(d, 0x60), cPosition)
}
// Copy memory to correct position
copy(d, getPtr(_a), aPosition, _a.length);
copy(d, getPtr(_b), bPosition, _b.length);
copy(d, getPtr(_c), cPosition, _c.length * 32); // 1 word per address
}
function abiLength(bytes memory _a) internal pure returns (uint256) {
// 1 for length +
// memory words + 1 if not divisible for 32 to offset word
return 1 + (_a.length / 32) + (_a.length % 32 > 0 ? 1 : 0);
}
function abiLength(address[] _a) internal pure returns (uint256) {
// 1 for length + 1 per item
return 1 + _a.length;
}
function copy(bytes _d, uint256 _src, uint256 _pos, uint256 _length) internal pure {
uint dest;
assembly {
dest := add(add(_d, 0x20), _pos)
}
memcpy(dest, _src, _length + 32);
}
function getPtr(bytes memory _x) internal pure returns (uint256 ptr) {
assembly {
ptr := _x
}
}
function getPtr(address[] memory _x) internal pure returns (uint256 ptr) {
assembly {
ptr := _x
}
}
function getSpecId(bytes _script) internal pure returns (uint32) {
return uint32At(_script, 0);
}
function uint256At(bytes _data, uint256 _location) internal pure returns (uint256 result) {
assembly {
result := mload(add(_data, add(0x20, _location)))
}
}
function addressAt(bytes _data, uint256 _location) internal pure returns (address result) {
uint256 word = uint256At(_data, _location);
assembly {
result := div(and(word, 0xffffffffffffffffffffffffffffffffffffffff000000000000000000000000),
0x1000000000000000000000000)
}
}
function uint32At(bytes _data, uint256 _location) internal pure returns (uint32 result) {
uint256 word = uint256At(_data, _location);
assembly {
result := div(and(word, 0xffffffff00000000000000000000000000000000000000000000000000000000),
0x100000000000000000000000000000000000000000000000000000000)
}
}
function locationOf(bytes _data, uint256 _location) internal pure returns (uint256 result) {
assembly {
result := add(_data, add(0x20, _location))
}
}
function toBytes(bytes4 _sig) internal pure returns (bytes) {
bytes memory payload = new bytes(4);
payload[0] = bytes1(_sig);
payload[1] = bytes1(_sig << 8);
payload[2] = bytes1(_sig << 16);
payload[3] = bytes1(_sig << 24);
return payload;
}
function memcpy(uint _dest, uint _src, uint _len) public pure {
uint256 src = _src;
uint256 dest = _dest;
uint256 len = _len;
// Copy word-length chunks while possible
for (; len >= 32; len -= 32) {
assembly {
mstore(dest, mload(src))
}
dest += 32;
src += 32;
}
// Copy remaining bytes
uint mask = 256 ** (32 - len) - 1;
assembly {
let srcpart := and(mload(src), not(mask))
let destpart := and(mload(dest), mask)
mstore(dest, or(destpart, srcpart))
}
}
}
///File: @aragon/os/contracts/evmscript/EVMScriptRunner.sol
pragma solidity ^0.4.18;
contract EVMScriptRunner is AppStorage, EVMScriptRegistryConstants {
using ScriptHelpers for bytes;
function runScript(bytes _script, bytes _input, address[] _blacklist) protectState internal returns (bytes output) {
// TODO: Too much data flying around, maybe extracting spec id here is cheaper
address executorAddr = getExecutor(_script);
require(executorAddr != address(0));
bytes memory calldataArgs = _script.encode(_input, _blacklist);
bytes4 sig = IEVMScriptExecutor(0).execScript.selector;
require(executorAddr.delegatecall(sig, calldataArgs));
return returnedDataDecoded();
}
function getExecutor(bytes _script) public view returns (IEVMScriptExecutor) {
return IEVMScriptExecutor(getExecutorRegistry().getScriptExecutor(_script));
}
// TODO: Internal
function getExecutorRegistry() internal view returns (IEVMScriptRegistry) {
address registryAddr = kernel.getApp(EVMSCRIPT_REGISTRY_APP);
return IEVMScriptRegistry(registryAddr);
}
/**
* @dev copies and returns last's call data. Needs to ABI decode first
*/
function returnedDataDecoded() internal view returns (bytes ret) {
assembly {
let size := returndatasize
switch size
case 0 {}
default {
ret := mload(0x40) // free mem ptr get
mstore(0x40, add(ret, add(size, 0x20))) // free mem ptr set
returndatacopy(ret, 0x20, sub(size, 0x20)) // copy return data
}
}
return ret;
}
modifier protectState {
address preKernel = kernel;
bytes32 preAppId = appId;
_; // exec
require(kernel == preKernel);
require(appId == preAppId);
}
}
///File: @aragon/os/contracts/acl/ACLSyntaxSugar.sol
pragma solidity 0.4.18;
contract ACLSyntaxSugar {
function arr() internal pure returns (uint256[] r) {}
function arr(bytes32 _a) internal pure returns (uint256[] r) {
return arr(uint256(_a));
}
function arr(bytes32 _a, bytes32 _b) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b));
}
function arr(address _a) internal pure returns (uint256[] r) {
return arr(uint256(_a));
}
function arr(address _a, address _b) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b));
}
function arr(address _a, uint256 _b, uint256 _c) internal pure returns (uint256[] r) {
return arr(uint256(_a), _b, _c);
}
function arr(address _a, uint256 _b) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b));
}
function arr(address _a, address _b, uint256 _c, uint256 _d, uint256 _e) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b), _c, _d, _e);
}
function arr(address _a, address _b, address _c) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b), uint256(_c));
}
function arr(address _a, address _b, uint256 _c) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b), uint256(_c));
}
function arr(uint256 _a) internal pure returns (uint256[] r) {
r = new uint256[](1);
r[0] = _a;
}
function arr(uint256 _a, uint256 _b) internal pure returns (uint256[] r) {
r = new uint256[](2);
r[0] = _a;
r[1] = _b;
}
function arr(uint256 _a, uint256 _b, uint256 _c) internal pure returns (uint256[] r) {
r = new uint256[](3);
r[0] = _a;
r[1] = _b;
r[2] = _c;
}
function arr(uint256 _a, uint256 _b, uint256 _c, uint256 _d) internal pure returns (uint256[] r) {
r = new uint256[](4);
r[0] = _a;
r[1] = _b;
r[2] = _c;
r[3] = _d;
}
function arr(uint256 _a, uint256 _b, uint256 _c, uint256 _d, uint256 _e) internal pure returns (uint256[] r) {
r = new uint256[](5);
r[0] = _a;
r[1] = _b;
r[2] = _c;
r[3] = _d;
r[4] = _e;
}
}
contract ACLHelpers {
function decodeParamOp(uint256 _x) internal pure returns (uint8 b) {
return uint8(_x >> (8 * 30));
}
function decodeParamId(uint256 _x) internal pure returns (uint8 b) {
return uint8(_x >> (8 * 31));
}
function decodeParamsList(uint256 _x) internal pure returns (uint32 a, uint32 b, uint32 c) {
a = uint32(_x);
b = uint32(_x >> (8 * 4));
c = uint32(_x >> (8 * 8));
}
}
///File: @aragon/os/contracts/apps/AragonApp.sol
pragma solidity ^0.4.18;
contract AragonApp is AppStorage, Initializable, ACLSyntaxSugar, EVMScriptRunner {
modifier auth(bytes32 _role) {
require(canPerform(msg.sender, _role, new uint256[](0)));
_;
}
modifier authP(bytes32 _role, uint256[] params) {
require(canPerform(msg.sender, _role, params));
_;
}
function canPerform(address _sender, bytes32 _role, uint256[] params) public view returns (bool) {
bytes memory how; // no need to init memory as it is never used
if (params.length > 0) {
uint256 byteLength = params.length * 32;
assembly {
how := params // forced casting
mstore(how, byteLength)
}
}
return address(kernel) == 0 || kernel.hasPermission(_sender, address(this), _role, how);
}
}
///File: ./contracts/ILiquidPledgingPlugin.sol
pragma solidity ^0.4.11;
/*
Copyright 2017, Jordi Baylina
Contributors: Adrià Massanet <adria@codecontext.io>, RJ Ewing, Griff
Green, Arthur Lunn
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 <http://www.gnu.org/licenses/>.
*/
/// @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. 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
/// 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 beforeTransfer(
uint64 pledgeManager,
uint64 pledgeFrom,
uint64 pledgeTo,
uint64 context,
address token,
uint amount ) public 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,
address token,
uint amount
) public;
}
///File: ./contracts/LiquidPledgingStorage.sol
pragma solidity ^0.4.18;
/// @dev This is an interface for `LPVault` which serves as a secure storage for
/// the ETH that backs the Pledges, only after `LiquidPledging` authorizes
/// payments can Pledges be converted for ETH
interface ILPVault {
function authorizePayment(bytes32 _ref, address _dest, address _token, uint _amount) public;
}
/// This contract contains all state variables used in LiquidPledging contracts
/// This is done to have everything in 1 location, b/c state variable layout
/// is MUST have be the same when performing an upgrade.
contract LiquidPledgingStorage {
enum PledgeAdminType { Giver, Delegate, Project }
enum PledgeState { Pledged, Paying, Paid }
/// @dev This struct defines the details of a `PledgeAdmin` which are
/// commonly referenced by their index in the `admins` array
/// and can own pledges and act as delegates
struct PledgeAdmin {
PledgeAdminType adminType; // Giver, Delegate or Project
address addr; // Account or contract address for admin
uint64 commitTime; // In seconds, used for time Givers' & Delegates' have to veto
uint64 parentProject; // Only for projects
bool canceled; //Always false except for canceled projects
/// @dev if the plugin is 0x0 then nothing happens, if its an address
// than that smart contract is called when appropriate
ILiquidPledgingPlugin plugin;
string name;
string url; // Can be IPFS hash
}
struct Pledge {
uint amount;
uint64[] delegationChain; // List of delegates in order of authority
uint64 owner; // PledgeAdmin
uint64 intendedProject; // Used when delegates are sending to projects
uint64 commitTime; // When the intendedProject will become the owner
uint64 oldPledge; // Points to the id that this Pledge was derived from
address token;
PledgeState pledgeState; // Pledged, Paying, Paid
}
PledgeAdmin[] admins; //The list of pledgeAdmins 0 means there is no admin
Pledge[] pledges;
/// @dev this mapping allows you to search for a specific pledge's
/// index number by the hash of that pledge
mapping (bytes32 => uint64) hPledge2idx;
// this whitelist is for non-proxied plugins
mapping (bytes32 => bool) pluginContractWhitelist;
// this whitelist is for proxied plugins
mapping (address => bool) pluginInstanceWhitelist;
bool public whitelistDisabled = false;
ILPVault public vault;
// reserve 50 slots for future upgrades. I'm not sure if this is necessary
// but b/c of multiple inheritance used in lp, better safe then sorry.
// especially since it is free
uint[50] private storageOffset;
}
///File: ./contracts/LiquidPledgingACLHelpers.sol
pragma solidity ^0.4.18;
contract LiquidPledgingACLHelpers {
function arr(uint64 a, uint64 b, address c, uint d, address e) internal pure returns(uint[] r) {
r = new uint[](4);
r[0] = uint(a);
r[1] = uint(b);
r[2] = uint(c);
r[3] = d;
r[4] = uint(e);
}
function arr(bool a) internal pure returns (uint[] r) {
r = new uint[](1);
uint _a;
assembly {
_a := a // forced casting
}
r[0] = _a;
}
}
///File: ./contracts/LiquidPledgingPlugins.sol
pragma solidity ^0.4.18;
/*
Copyright 2017, Jordi Baylina, RJ Ewing
Contributors: Adrià Massanet <adria@codecontext.io>, Griff Green,
Arthur Lunn
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 <http://www.gnu.org/licenses/>.
*/
contract LiquidPledgingPlugins is AragonApp, LiquidPledgingStorage, LiquidPledgingACLHelpers {
bytes32 constant public PLUGIN_MANAGER_ROLE = keccak256("PLUGIN_MANAGER_ROLE");
function addValidPluginInstance(address addr) auth(PLUGIN_MANAGER_ROLE) external {
pluginInstanceWhitelist[addr] = true;
}
function addValidPluginContract(bytes32 contractHash) auth(PLUGIN_MANAGER_ROLE) public {
pluginContractWhitelist[contractHash] = true;
}
function addValidPluginContracts(bytes32[] contractHashes) external auth(PLUGIN_MANAGER_ROLE) {
for (uint8 i = 0; i < contractHashes.length; i++) {
addValidPluginContract(contractHashes[i]);
}
}
function removeValidPluginContract(bytes32 contractHash) external authP(PLUGIN_MANAGER_ROLE, arr(contractHash)) {
pluginContractWhitelist[contractHash] = false;
}
function removeValidPluginInstance(address addr) external authP(PLUGIN_MANAGER_ROLE, arr(addr)) {
pluginInstanceWhitelist[addr] = false;
}
function useWhitelist(bool useWhitelist) external auth(PLUGIN_MANAGER_ROLE) {
whitelistDisabled = !useWhitelist;
}
function isValidPlugin(address addr) public view returns(bool) {
if (whitelistDisabled || addr == 0x0) {
return true;
}
// first check pluginInstances
if (pluginInstanceWhitelist[addr]) {
return true;
}
// if the addr isn't a valid instance, check the contract code
bytes32 contractHash = getCodeHash(addr);
return pluginContractWhitelist[contractHash];
}
function getCodeHash(address addr) public view returns(bytes32) {
bytes memory o_code;
assembly {
// retrieve the size of the code, this needs assembly
let size := extcodesize(addr)
// allocate output byte array - this could also be done without assembly
// by using o_code = new bytes(size)
o_code := mload(0x40)
mstore(o_code, size) // store length in memory
// actually retrieve the code, this needs assembly
extcodecopy(addr, add(o_code, 0x20), 0, size)
}
return keccak256(o_code);
}
}
///File: ./contracts/LiquidPledgingPlugins.sol
pragma solidity ^0.4.18;
/*
Copyright 2017, Jordi Baylina, RJ Ewing
Contributors: Adrià Massanet <adria@codecontext.io>, Griff Green,
Arthur Lunn
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 <http://www.gnu.org/licenses/>.
*/
contract LiquidPledgingPlugins is AragonApp, LiquidPledgingStorage, LiquidPledgingACLHelpers {
bytes32 constant public PLUGIN_MANAGER_ROLE = keccak256("PLUGIN_MANAGER_ROLE");
function addValidPluginInstance(address addr) auth(PLUGIN_MANAGER_ROLE) external {
pluginInstanceWhitelist[addr] = true;
}
function addValidPluginContract(bytes32 contractHash) auth(PLUGIN_MANAGER_ROLE) public {
pluginContractWhitelist[contractHash] = true;
}
function addValidPluginContracts(bytes32[] contractHashes) external auth(PLUGIN_MANAGER_ROLE) {
for (uint8 i = 0; i < contractHashes.length; i++) {
addValidPluginContract(contractHashes[i]);
}
}
function removeValidPluginContract(bytes32 contractHash) external authP(PLUGIN_MANAGER_ROLE, arr(contractHash)) {
pluginContractWhitelist[contractHash] = false;
}
function removeValidPluginInstance(address addr) external authP(PLUGIN_MANAGER_ROLE, arr(addr)) {
pluginInstanceWhitelist[addr] = false;
}
function useWhitelist(bool useWhitelist) external auth(PLUGIN_MANAGER_ROLE) {
whitelistDisabled = !useWhitelist;
}
function isValidPlugin(address addr) public view returns(bool) {
if (whitelistDisabled || addr == 0x0) {
return true;
}
// first check pluginInstances
if (pluginInstanceWhitelist[addr]) {
return true;
}
// if the addr isn't a valid instance, check the contract code
bytes32 contractHash = getCodeHash(addr);
return pluginContractWhitelist[contractHash];
}
function getCodeHash(address addr) public view returns(bytes32) {
bytes memory o_code;
assembly {
// retrieve the size of the code, this needs assembly
let size := extcodesize(addr)
// allocate output byte array - this could also be done without assembly
// by using o_code = new bytes(size)
o_code := mload(0x40)
mstore(o_code, size) // store length in memory
// actually retrieve the code, this needs assembly
extcodecopy(addr, add(o_code, 0x20), 0, size)
}
return keccak256(o_code);
}
}

View File

@ -1,14 +0,0 @@
/* 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":"token","type":"address"},{"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":"token","type":"address"},{"name":"amount","type":"uint256"}],"name":"beforeTransfer","outputs":[{"name":"maxAllowed","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]
exports.ILiquidPledgingPluginByteCode = "0x"
exports.ILiquidPledgingPluginRuntimeByteCode = "0x"
exports['_./contracts/ILiquidPledgingPlugin.sol_keccak256'] = "0x5428d88ef6856b67f0d3271065542aa4b7e6d73428b35bf1b434e5f507d3b88b"
exports.ILPVaultAbi = [{"constant":false,"inputs":[{"name":"_ref","type":"bytes32"},{"name":"_dest","type":"address"},{"name":"_token","type":"address"},{"name":"_amount","type":"uint256"}],"name":"authorizePayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]
exports.ILPVaultByteCode = "0x"
exports.ILPVaultRuntimeByteCode = "0x"
exports.LiquidPledgingStorageAbi = [{"constant":true,"inputs":[],"name":"whitelistDisabled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]
exports.LiquidPledgingStorageByteCode = "0x60606040526005805460ff19169055341561001957600080fd5b610100806100286000396000f30060606040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631c8e85688114604d578063fbfa77cf146071575b600080fd5b3415605757600080fd5b605d60aa565b604051901515815260200160405180910390f35b3415607b57600080fd5b608160b3565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b60055460ff1681565b600554610100900473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a7230582074d9d7bbdf9db1111999ed5df541c7c34bae37949773a356678e251f819f25260029"
exports.LiquidPledgingStorageRuntimeByteCode = "0x60606040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631c8e85688114604d578063fbfa77cf146071575b600080fd5b3415605757600080fd5b605d60aa565b604051901515815260200160405180910390f35b3415607b57600080fd5b608160b3565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b60055460ff1681565b600554610100900473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a7230582074d9d7bbdf9db1111999ed5df541c7c34bae37949773a356678e251f819f25260029"
exports['_./contracts/LiquidPledgingStorage.sol_keccak256'] = "0x81ef504efbc50c58acec1b85784d9be3cb0bd761b3e9d013b19aa5f0d5169a08"
exports._solcVersion = "0.4.18+commit.9cf6e910.Darwin.appleclang"

View File

@ -1,156 +0,0 @@
///File: ./contracts/ILiquidPledgingPlugin.sol
pragma solidity ^0.4.11;
/*
Copyright 2017, Jordi Baylina
Contributors: Adrià Massanet <adria@codecontext.io>, RJ Ewing, Griff
Green, Arthur Lunn
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 <http://www.gnu.org/licenses/>.
*/
/// @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. 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
/// 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 beforeTransfer(
uint64 pledgeManager,
uint64 pledgeFrom,
uint64 pledgeTo,
uint64 context,
address token,
uint amount ) public 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,
address token,
uint amount
) public;
}
///File: ./contracts/LiquidPledgingStorage.sol
pragma solidity ^0.4.18;
/// @dev This is an interface for `LPVault` which serves as a secure storage for
/// the ETH that backs the Pledges, only after `LiquidPledging` authorizes
/// payments can Pledges be converted for ETH
interface ILPVault {
function authorizePayment(bytes32 _ref, address _dest, address _token, uint _amount) public;
}
/// This contract contains all state variables used in LiquidPledging contracts
/// This is done to have everything in 1 location, b/c state variable layout
/// is MUST have be the same when performing an upgrade.
contract LiquidPledgingStorage {
enum PledgeAdminType { Giver, Delegate, Project }
enum PledgeState { Pledged, Paying, Paid }
/// @dev This struct defines the details of a `PledgeAdmin` which are
/// commonly referenced by their index in the `admins` array
/// and can own pledges and act as delegates
struct PledgeAdmin {
PledgeAdminType adminType; // Giver, Delegate or Project
address addr; // Account or contract address for admin
uint64 commitTime; // In seconds, used for time Givers' & Delegates' have to veto
uint64 parentProject; // Only for projects
bool canceled; //Always false except for canceled projects
/// @dev if the plugin is 0x0 then nothing happens, if its an address
// than that smart contract is called when appropriate
ILiquidPledgingPlugin plugin;
string name;
string url; // Can be IPFS hash
}
struct Pledge {
uint amount;
uint64[] delegationChain; // List of delegates in order of authority
uint64 owner; // PledgeAdmin
uint64 intendedProject; // Used when delegates are sending to projects
uint64 commitTime; // When the intendedProject will become the owner
uint64 oldPledge; // Points to the id that this Pledge was derived from
address token;
PledgeState pledgeState; // Pledged, Paying, Paid
}
PledgeAdmin[] admins; //The list of pledgeAdmins 0 means there is no admin
Pledge[] pledges;
/// @dev this mapping allows you to search for a specific pledge's
/// index number by the hash of that pledge
mapping (bytes32 => uint64) hPledge2idx;
// this whitelist is for non-proxied plugins
mapping (bytes32 => bool) pluginContractWhitelist;
// this whitelist is for proxied plugins
mapping (address => bool) pluginInstanceWhitelist;
bool public whitelistDisabled = false;
ILPVault public vault;
// reserve 50 slots for future upgrades. I'm not sure if this is necessary
// but b/c of multiple inheritance used in lp, better safe then sorry.
// especially since it is free
uint[50] private storageOffset;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,68 +0,0 @@
/* This is an autogenerated file. DO NOT EDIT MANUALLY */
exports.IACLAbi = [{"constant":false,"inputs":[{"name":"permissionsCreator","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"},{"name":"where","type":"address"},{"name":"what","type":"bytes32"},{"name":"how","type":"bytes"}],"name":"hasPermission","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"}]
exports.IACLByteCode = "0x"
exports.IACLRuntimeByteCode = "0x"
exports['_@aragon/os/contracts/acl/IACL.sol_keccak256'] = "0xa120fc32d8d2c5096d605b0fe012d5b1e4a62118952a25a18bac5210f4fceede"
exports.IKernelAbi = [{"constant":true,"inputs":[{"name":"id","type":"bytes32"}],"name":"getApp","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"namespace","type":"bytes32"},{"name":"name","type":"bytes32"},{"name":"app","type":"address"}],"name":"setApp","outputs":[{"name":"id","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"acl","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"},{"name":"where","type":"address"},{"name":"what","type":"bytes32"},{"name":"how","type":"bytes"}],"name":"hasPermission","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"namespace","type":"bytes32"},{"indexed":true,"name":"name","type":"bytes32"},{"indexed":true,"name":"id","type":"bytes32"},{"indexed":false,"name":"app","type":"address"}],"name":"SetApp","type":"event"}]
exports.IKernelByteCode = "0x"
exports.IKernelRuntimeByteCode = "0x"
exports['_@aragon/os/contracts/kernel/IKernel.sol_keccak256'] = "0xc4bd88d7355351f68614906f04d7a67b4fcd81b28112f75df090b7eb8b93c881"
exports.AppStorageAbi = [{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]
exports.AppStorageByteCode = "0x6060604052341561000f57600080fd5b60f68061001d6000396000f30060606040526004361060485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166380afdea88114604d578063d4aae0c414606f575b600080fd5b3415605757600080fd5b605d60a8565b60405190815260200160405180910390f35b3415607957600080fd5b607f60ae565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a7230582098c96720e68692f53d4ae253d0df419ec188a713882f6d4b396f47905ba131970029"
exports.AppStorageRuntimeByteCode = "0x60606040526004361060485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166380afdea88114604d578063d4aae0c414606f575b600080fd5b3415605757600080fd5b605d60a8565b60405190815260200160405180910390f35b3415607957600080fd5b607f60ae565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a7230582098c96720e68692f53d4ae253d0df419ec188a713882f6d4b396f47905ba131970029"
exports['_@aragon/os/contracts/apps/AppStorage.sol_keccak256'] = "0x8b9205a3fdf9d94fb1461d2c2d32335803122aa75d3fa8cf0b982796fd040c25"
exports.InitializableAbi = [{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]
exports.InitializableByteCode = "0x6060604052341561000f57600080fd5b6101168061001e6000396000f30060606040526004361060525763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166380afdea8811460575780638b3dd749146079578063d4aae0c4146089575b600080fd5b3415606157600080fd5b606760c2565b60405190815260200160405180910390f35b3415608357600080fd5b606760c8565b3415609357600080fd5b609960ce565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b60015481565b60035490565b60005473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a72305820beda3c4bd32e8698bb1fe210ec93ece6a7b34cd70d72bce5a00e05e77fa6d3850029"
exports.InitializableRuntimeByteCode = "0x60606040526004361060525763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166380afdea8811460575780638b3dd749146079578063d4aae0c4146089575b600080fd5b3415606157600080fd5b606760c2565b60405190815260200160405180910390f35b3415608357600080fd5b606760c8565b3415609357600080fd5b609960ce565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b60015481565b60035490565b60005473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a72305820beda3c4bd32e8698bb1fe210ec93ece6a7b34cd70d72bce5a00e05e77fa6d3850029"
exports['_@aragon/os/contracts/common/Initializable.sol_keccak256'] = "0x07ef04e0cf56217c5e103a760dd577a7fffa06ca166dc15af35b3895e58880e9"
exports.IEVMScriptExecutorAbi = [{"constant":false,"inputs":[{"name":"script","type":"bytes"},{"name":"input","type":"bytes"},{"name":"blacklist","type":"address[]"}],"name":"execScript","outputs":[{"name":"","type":"bytes"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]
exports.IEVMScriptExecutorByteCode = "0x"
exports.IEVMScriptExecutorRuntimeByteCode = "0x"
exports['_@aragon/os/contracts/evmscript/IEVMScriptExecutor.sol_keccak256'] = "0x6a4beed810085f11cda9d50c3547ac4cc2100d9dc18ab4982ff11dd483410012"
exports.EVMScriptRegistryConstantsAbi = [{"constant":true,"inputs":[],"name":"EVMSCRIPT_REGISTRY_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"EVMSCRIPT_REGISTRY_APP","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"}]
exports.EVMScriptRegistryConstantsByteCode = "0x6060604052341561000f57600080fd5b6101648061001e6000396000f30060606040526004361061004b5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166360b1e05781146100505780639b3fdf4c14610075575b600080fd5b341561005b57600080fd5b610063610088565b60405190815260200160405180910390f35b341561008057600080fd5b6100636100bc565b6040517f65766d7265672e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e65746800000000000000000000000000815260130160405180910390206040519182526020820152604090810190518091039020815600a165627a7a7230582021e63987a96f9d13ef3f54e8b7d7d046c77a931285a0179816c923fd45dfc0110029"
exports.EVMScriptRegistryConstantsRuntimeByteCode = "0x60606040526004361061004b5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166360b1e05781146100505780639b3fdf4c14610075575b600080fd5b341561005b57600080fd5b610063610088565b60405190815260200160405180910390f35b341561008057600080fd5b6100636100bc565b6040517f65766d7265672e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e65746800000000000000000000000000815260130160405180910390206040519182526020820152604090810190518091039020815600a165627a7a7230582021e63987a96f9d13ef3f54e8b7d7d046c77a931285a0179816c923fd45dfc0110029"
exports.IEVMScriptRegistryAbi = [{"constant":true,"inputs":[{"name":"script","type":"bytes"}],"name":"getScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"executorId","type":"uint256"}],"name":"disableScriptExecutor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"executor","type":"address"}],"name":"addScriptExecutor","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]
exports.IEVMScriptRegistryByteCode = "0x"
exports.IEVMScriptRegistryRuntimeByteCode = "0x"
exports['_@aragon/os/contracts/evmscript/IEVMScriptRegistry.sol_keccak256'] = "0xa0cf92b96ee915266c74d42f3479ee809754264cc783fe9635f74d3795c7b2e1"
exports.ScriptHelpersAbi = [{"constant":true,"inputs":[{"name":"_dest","type":"uint256"},{"name":"_src","type":"uint256"},{"name":"_len","type":"uint256"}],"name":"memcpy","outputs":[],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"_a","type":"bytes"},{"name":"_b","type":"bytes"},{"name":"_c","type":"address[]"}],"name":"abiEncode","outputs":[{"name":"d","type":"bytes"}],"payable":false,"stateMutability":"pure","type":"function"}]
exports.ScriptHelpersByteCode = "0x6060604052341561000f57600080fd5b6103718061001e6000396000f30060606040526004361061004b5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166311fe773d8114610050578063137d702614610063575b600080fd5b6100616004356024356044356101a2565b005b61012b60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506101ec95505050505050565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561016757808201518382015260200161014f565b50505050905090810190601f1680156101945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b81838260005b602082106101ca578351835260209384019390920191601f19909101906101a8565b6001826020036101000a03905080198451168184511617909252505050505050565b6101f4610333565b6101ff848484610207565b949350505050565b61020f610333565b60606000808061021e886102c9565b6020028401925061022e876102c9565b6020028301915061023e86610304565b60200282019050806040518059106102535750595b818152601f19601f830116810160200160405290509450836020860152826040860152816060860152610291856102898a610311565b868b51610314565b6102a68561029e89610311565b858a51610314565b6102be856102b388610311565b848951602002610314565b505050509392505050565b600080602083518115156102d957fe5b06116102e65760006102e9565b60015b60ff16602083518115156102f957fe5b040160010192915050565b6000815160010192915050565b90565b6000826020860101905061032c8185846020016101a2565b5050505050565b602060405190810160405260008152905600a165627a7a7230582054a248fd48c50998bbbebebac97db462911b4b7e7ecb1d66118f6cfda43e837d0029"
exports.ScriptHelpersRuntimeByteCode = "0x60606040526004361061004b5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166311fe773d8114610050578063137d702614610063575b600080fd5b6100616004356024356044356101a2565b005b61012b60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506101ec95505050505050565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561016757808201518382015260200161014f565b50505050905090810190601f1680156101945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b81838260005b602082106101ca578351835260209384019390920191601f19909101906101a8565b6001826020036101000a03905080198451168184511617909252505050505050565b6101f4610333565b6101ff848484610207565b949350505050565b61020f610333565b60606000808061021e886102c9565b6020028401925061022e876102c9565b6020028301915061023e86610304565b60200282019050806040518059106102535750595b818152601f19601f830116810160200160405290509450836020860152826040860152816060860152610291856102898a610311565b868b51610314565b6102a68561029e89610311565b858a51610314565b6102be856102b388610311565b848951602002610314565b505050509392505050565b600080602083518115156102d957fe5b06116102e65760006102e9565b60015b60ff16602083518115156102f957fe5b040160010192915050565b6000815160010192915050565b90565b6000826020860101905061032c8185846020016101a2565b5050505050565b602060405190810160405260008152905600a165627a7a7230582054a248fd48c50998bbbebebac97db462911b4b7e7ecb1d66118f6cfda43e837d0029"
exports['_@aragon/os/contracts/evmscript/ScriptHelpers.sol_keccak256'] = "0x21a99d2fc9de2244829954ea1c21057f25f74a23f18ac7f7402420922e287517"
exports.EVMScriptRunnerAbi = [{"constant":true,"inputs":[],"name":"EVMSCRIPT_REGISTRY_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"EVMSCRIPT_REGISTRY_APP","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]
exports.EVMScriptRunnerByteCode = "0x6060604052341561000f57600080fd5b6103f08061001e6000396000f3006060604052600436106100535763ffffffff60e060020a60003504166360b1e057811461005857806380afdea81461007d5780639b3fdf4c14610090578063d4aae0c4146100a3578063f92a79ff146100df575b600080fd5b341561006357600080fd5b61006b610130565b60405190815260200160405180910390f35b341561008857600080fd5b61006b610164565b341561009b57600080fd5b61006b61016a565b34156100ae57600080fd5b6100b66101e6565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34156100ea57600080fd5b6100b660046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061020295505050505050565b6040517f65766d7265672e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b60015481565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902081565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b600061020c6102eb565b73ffffffffffffffffffffffffffffffffffffffff166304bf2a7f836000604051602001526040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610280578082015183820152602001610268565b50505050905090810190601f1680156102ad5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15156102cb57600080fd5b6102c65a03f115156102dc57600080fd5b50505060405180519392505050565b60008054819073ffffffffffffffffffffffffffffffffffffffff166342c71f1d6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156102cb57600080fd00a165627a7a72305820fd11cd20e57a349bb3adcc4cb9f4573292e3423ba4f7cb0fb5a2aa8e9cc3272d0029"
exports.EVMScriptRunnerRuntimeByteCode = "0x6060604052600436106100535763ffffffff60e060020a60003504166360b1e057811461005857806380afdea81461007d5780639b3fdf4c14610090578063d4aae0c4146100a3578063f92a79ff146100df575b600080fd5b341561006357600080fd5b61006b610130565b60405190815260200160405180910390f35b341561008857600080fd5b61006b610164565b341561009b57600080fd5b61006b61016a565b34156100ae57600080fd5b6100b66101e6565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34156100ea57600080fd5b6100b660046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061020295505050505050565b6040517f65766d7265672e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b60015481565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902081565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b600061020c6102eb565b73ffffffffffffffffffffffffffffffffffffffff166304bf2a7f836000604051602001526040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610280578082015183820152602001610268565b50505050905090810190601f1680156102ad5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15156102cb57600080fd5b6102c65a03f115156102dc57600080fd5b50505060405180519392505050565b60008054819073ffffffffffffffffffffffffffffffffffffffff166342c71f1d6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156102cb57600080fd00a165627a7a72305820fd11cd20e57a349bb3adcc4cb9f4573292e3423ba4f7cb0fb5a2aa8e9cc3272d0029"
exports['_@aragon/os/contracts/evmscript/EVMScriptRunner.sol_keccak256'] = "0xf226f2c5c0a930340d49a5f79ac49a18dc0f88632acdef32c4eb698d5bb8a77e"
exports.ACLHelpersAbi = []
exports.ACLHelpersByteCode = "0x60606040523415600e57600080fd5b603580601b6000396000f3006060604052600080fd00a165627a7a72305820d80800acb0ff6d5b4f8a459d711d73b78d39644560090b4540a7e2dee4bfc9920029"
exports.ACLHelpersRuntimeByteCode = "0x6060604052600080fd00a165627a7a72305820d80800acb0ff6d5b4f8a459d711d73b78d39644560090b4540a7e2dee4bfc9920029"
exports.ACLSyntaxSugarAbi = []
exports.ACLSyntaxSugarByteCode = "0x60606040523415600e57600080fd5b603580601b6000396000f3006060604052600080fd00a165627a7a7230582060e615b52107384b8776abb03f853c9b7cb52237a0214d7f01e8f210b9a418bd0029"
exports.ACLSyntaxSugarRuntimeByteCode = "0x6060604052600080fd00a165627a7a7230582060e615b52107384b8776abb03f853c9b7cb52237a0214d7f01e8f210b9a418bd0029"
exports['_@aragon/os/contracts/acl/ACLSyntaxSugar.sol_keccak256'] = "0x92c85fe20e03c5fde11c3006b2acd7c24021d53356bd14070522d71912e5419b"
exports.AragonAppAbi = [{"constant":true,"inputs":[],"name":"EVMSCRIPT_REGISTRY_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"EVMSCRIPT_REGISTRY_APP","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]
exports.AragonAppByteCode = "0x6060604052341561000f57600080fd5b6105b28061001e6000396000f3006060604052600436106100695763ffffffff60e060020a60003504166360b1e057811461006e57806380afdea8146100935780638b3dd749146100a65780639b3fdf4c146100b9578063a1658fad146100cc578063d4aae0c414610143578063f92a79ff14610172575b600080fd5b341561007957600080fd5b6100816101c3565b60405190815260200160405180910390f35b341561009e57600080fd5b6100816101f7565b34156100b157600080fd5b6100816101fd565b34156100c457600080fd5b610081610203565b34156100d757600080fd5b61012f60048035600160a060020a031690602480359190606490604435908101908301358060208082020160405190810160405280939291908181526020018383602002808284375094965061027f95505050505050565b604051901515815260200160405180910390f35b341561014e57600080fd5b6101566103bd565b604051600160a060020a03909116815260200160405180910390f35b341561017d57600080fd5b61015660046024813581810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506103cc95505050505050565b6040517f65766d7265672e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b60015481565b60035490565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902081565b6000610289610574565b600080845111156102a257835160200290508391508082525b600054600160a060020a031615806103b3575060008054600160a060020a03169063fdef91069088903090899087906040516020015260405160e060020a63ffffffff8716028152600160a060020a0380861660048301908152908516602483015260448201849052608060648301908152909160840183818151815260200191508051906020019080838360005b83811015610349578082015183820152602001610331565b50505050905090810190601f1680156103765780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b151561039757600080fd5b6102c65a03f115156103a857600080fd5b505050604051805190505b9695505050505050565b600054600160a060020a031681565b60006103d66104a8565b600160a060020a03166304bf2a7f836000604051602001526040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561043d578082015183820152602001610425565b50505050905090810190601f16801561046a5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b151561048857600080fd5b6102c65a03f1151561049957600080fd5b50505060405180519392505050565b600080548190600160a060020a03166342c71f1d6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561048857600080fd5b602060405190810160405260008152905600a165627a7a72305820b21859fce2e1261146b28fb6136aee5e120cdd38040d7e4cbdef9f8d0f8191440029"
exports.AragonAppRuntimeByteCode = "0x6060604052600436106100695763ffffffff60e060020a60003504166360b1e057811461006e57806380afdea8146100935780638b3dd749146100a65780639b3fdf4c146100b9578063a1658fad146100cc578063d4aae0c414610143578063f92a79ff14610172575b600080fd5b341561007957600080fd5b6100816101c3565b60405190815260200160405180910390f35b341561009e57600080fd5b6100816101f7565b34156100b157600080fd5b6100816101fd565b34156100c457600080fd5b610081610203565b34156100d757600080fd5b61012f60048035600160a060020a031690602480359190606490604435908101908301358060208082020160405190810160405280939291908181526020018383602002808284375094965061027f95505050505050565b604051901515815260200160405180910390f35b341561014e57600080fd5b6101566103bd565b604051600160a060020a03909116815260200160405180910390f35b341561017d57600080fd5b61015660046024813581810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506103cc95505050505050565b6040517f65766d7265672e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b60015481565b60035490565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902081565b6000610289610574565b600080845111156102a257835160200290508391508082525b600054600160a060020a031615806103b3575060008054600160a060020a03169063fdef91069088903090899087906040516020015260405160e060020a63ffffffff8716028152600160a060020a0380861660048301908152908516602483015260448201849052608060648301908152909160840183818151815260200191508051906020019080838360005b83811015610349578082015183820152602001610331565b50505050905090810190601f1680156103765780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b151561039757600080fd5b6102c65a03f115156103a857600080fd5b505050604051805190505b9695505050505050565b600054600160a060020a031681565b60006103d66104a8565b600160a060020a03166304bf2a7f836000604051602001526040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561043d578082015183820152602001610425565b50505050905090810190601f16801561046a5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b151561048857600080fd5b6102c65a03f1151561049957600080fd5b50505060405180519392505050565b600080548190600160a060020a03166342c71f1d6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561048857600080fd5b602060405190810160405260008152905600a165627a7a72305820b21859fce2e1261146b28fb6136aee5e120cdd38040d7e4cbdef9f8d0f8191440029"
exports['_@aragon/os/contracts/apps/AragonApp.sol_keccak256'] = "0x7b5ed0ab203aea14886f337bc8b73ec49177415d43b3251d917d51a6d138d8f1"
exports.ILiquidPledgingPluginAbi = [{"constant":false,"inputs":[{"name":"pledgeManager","type":"uint64"},{"name":"pledgeFrom","type":"uint64"},{"name":"pledgeTo","type":"uint64"},{"name":"context","type":"uint64"},{"name":"token","type":"address"},{"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":"token","type":"address"},{"name":"amount","type":"uint256"}],"name":"beforeTransfer","outputs":[{"name":"maxAllowed","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]
exports.ILiquidPledgingPluginByteCode = "0x"
exports.ILiquidPledgingPluginRuntimeByteCode = "0x"
exports['_./contracts/ILiquidPledgingPlugin.sol_keccak256'] = "0x5428d88ef6856b67f0d3271065542aa4b7e6d73428b35bf1b434e5f507d3b88b"
exports.ILPVaultAbi = [{"constant":false,"inputs":[{"name":"_ref","type":"bytes32"},{"name":"_dest","type":"address"},{"name":"_token","type":"address"},{"name":"_amount","type":"uint256"}],"name":"authorizePayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]
exports.ILPVaultByteCode = "0x"
exports.ILPVaultRuntimeByteCode = "0x"
exports.LiquidPledgingStorageAbi = [{"constant":true,"inputs":[],"name":"whitelistDisabled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]
exports.LiquidPledgingStorageByteCode = "0x60606040526005805460ff19169055341561001957600080fd5b610100806100286000396000f30060606040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631c8e85688114604d578063fbfa77cf146071575b600080fd5b3415605757600080fd5b605d60aa565b604051901515815260200160405180910390f35b3415607b57600080fd5b608160b3565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b60055460ff1681565b600554610100900473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a7230582074d9d7bbdf9db1111999ed5df541c7c34bae37949773a356678e251f819f25260029"
exports.LiquidPledgingStorageRuntimeByteCode = "0x60606040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631c8e85688114604d578063fbfa77cf146071575b600080fd5b3415605757600080fd5b605d60aa565b604051901515815260200160405180910390f35b3415607b57600080fd5b608160b3565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b60055460ff1681565b600554610100900473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a7230582074d9d7bbdf9db1111999ed5df541c7c34bae37949773a356678e251f819f25260029"
exports['_./contracts/LiquidPledgingStorage.sol_keccak256'] = "0x81ef504efbc50c58acec1b85784d9be3cb0bd761b3e9d013b19aa5f0d5169a08"
exports.PledgesAbi = [{"constant":true,"inputs":[],"name":"whitelistDisabled","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":"token","type":"address"},{"name":"pledgeState","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"EVMSCRIPT_REGISTRY_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"EVMSCRIPT_REGISTRY_APP","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]
exports.PledgesByteCode = "0x60606040526069805460ff19169055341561001957600080fd5b61091a806100286000396000f3006060604052600436106100955763ffffffff60e060020a6000350416631c8e8568811461009a5780632a8ec8cc146100c15780633f657a46146100e657806360b1e0571461017657806380afdea8146101895780638b3dd7491461019c5780639b3fdf4c146101af578063a1658fad146101c2578063d4aae0c414610225578063f92a79ff14610254578063fbfa77cf146102a5575b600080fd5b34156100a557600080fd5b6100ad6102b8565b604051901515815260200160405180910390f35b34156100cc57600080fd5b6100d46102c1565b60405190815260200160405180910390f35b34156100f157600080fd5b61010667ffffffffffffffff600435166102cb565b60405188815267ffffffffffffffff8089166020830152878116604083015286811660608301528581166080830152841660a0820152600160a060020a03831660c082015260e0810182600281111561015b57fe5b60ff1681526020019850505050505050505060405180910390f35b341561018157600080fd5b6100d4610483565b341561019457600080fd5b6100d46104b7565b34156101a757600080fd5b6100d46104bd565b34156101ba57600080fd5b6100d46104c3565b34156101cd57600080fd5b6100ad60048035600160a060020a031690602480359190606490604435908101908301358060208082020160405190810160405280939291908181526020018383602002808284375094965061053f95505050505050565b341561023057600080fd5b61023861067d565b604051600160a060020a03909116815260200160405180910390f35b341561025f57600080fd5b61023860046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061068c95505050505050565b34156102b057600080fd5b610238610768565b60695460ff1681565b6065546000190190565b6000806000806000806000806102df610890565b6102e88a61077c565b6101006040519081016040529081600082015481526020016001820180548060200260200160405190810160405280929190818152602001828054801561038257602002820191906000526020600020906000905b82829054906101000a900467ffffffffffffffff1667ffffffffffffffff168152602001906008019060208260070104928301926001038202915080841161033d5790505b505050918352505060028281015467ffffffffffffffff80821660208501526801000000000000000082048116604085015270010000000000000000000000000000000082048116606085015278010000000000000000000000000000000000000000000000009091041660808301526003830154600160a060020a03811660a084015260c09092019174010000000000000000000000000000000000000000900460ff169081111561043157fe5b600281111561043c57fe5b90525090508051985080604001519750806020015151965080606001519550806080015194508060a0015193508060c0015192508060e00151915050919395975091939597565b6040517f65766d7265672e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b60015481565b60035490565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902081565b60006105496108dc565b6000808451111561056257835160200290508391508082525b600054600160a060020a03161580610673575060008054600160a060020a03169063fdef91069088903090899087906040516020015260405160e060020a63ffffffff8716028152600160a060020a0380861660048301908152908516602483015260448201849052608060648301908152909160840183818151815260200191508051906020019080838360005b838110156106095780820151838201526020016105f1565b50505050905090810190601f1680156106365780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b151561065757600080fd5b6102c65a03f1151561066857600080fd5b505050604051805190505b9695505050505050565b600054600160a060020a031681565b60006106966107c4565b600160a060020a03166304bf2a7f836000604051602001526040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156106fd5780820151838201526020016106e5565b50505050905090810190601f16801561072a5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b151561074857600080fd5b6102c65a03f1151561075957600080fd5b50505060405180519392505050565b6069546101009004600160a060020a031681565b60655460009067ffffffffffffffff83161061079757600080fd5b6065805467ffffffffffffffff84169081106107af57fe5b90600052602060002090600402019050919050565b600080548190600160a060020a03166342c71f1d6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561074857600080fd5b61010060405190810160405280600081526020016108ac6108dc565b815260006020820181905260408201819052606082018190526080820181905260a0820181905260c09091015290565b602060405190810160405260008152905600a165627a7a723058200d4e5d4c975f206a9b62cd4645a202bad964626e9f2fc28fac6b080f55677fd30029"
exports.PledgesRuntimeByteCode = "0x6060604052600436106100955763ffffffff60e060020a6000350416631c8e8568811461009a5780632a8ec8cc146100c15780633f657a46146100e657806360b1e0571461017657806380afdea8146101895780638b3dd7491461019c5780639b3fdf4c146101af578063a1658fad146101c2578063d4aae0c414610225578063f92a79ff14610254578063fbfa77cf146102a5575b600080fd5b34156100a557600080fd5b6100ad6102b8565b604051901515815260200160405180910390f35b34156100cc57600080fd5b6100d46102c1565b60405190815260200160405180910390f35b34156100f157600080fd5b61010667ffffffffffffffff600435166102cb565b60405188815267ffffffffffffffff8089166020830152878116604083015286811660608301528581166080830152841660a0820152600160a060020a03831660c082015260e0810182600281111561015b57fe5b60ff1681526020019850505050505050505060405180910390f35b341561018157600080fd5b6100d4610483565b341561019457600080fd5b6100d46104b7565b34156101a757600080fd5b6100d46104bd565b34156101ba57600080fd5b6100d46104c3565b34156101cd57600080fd5b6100ad60048035600160a060020a031690602480359190606490604435908101908301358060208082020160405190810160405280939291908181526020018383602002808284375094965061053f95505050505050565b341561023057600080fd5b61023861067d565b604051600160a060020a03909116815260200160405180910390f35b341561025f57600080fd5b61023860046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061068c95505050505050565b34156102b057600080fd5b610238610768565b60695460ff1681565b6065546000190190565b6000806000806000806000806102df610890565b6102e88a61077c565b6101006040519081016040529081600082015481526020016001820180548060200260200160405190810160405280929190818152602001828054801561038257602002820191906000526020600020906000905b82829054906101000a900467ffffffffffffffff1667ffffffffffffffff168152602001906008019060208260070104928301926001038202915080841161033d5790505b505050918352505060028281015467ffffffffffffffff80821660208501526801000000000000000082048116604085015270010000000000000000000000000000000082048116606085015278010000000000000000000000000000000000000000000000009091041660808301526003830154600160a060020a03811660a084015260c09092019174010000000000000000000000000000000000000000900460ff169081111561043157fe5b600281111561043c57fe5b90525090508051985080604001519750806020015151965080606001519550806080015194508060a0015193508060c0015192508060e00151915050919395975091939597565b6040517f65766d7265672e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b60015481565b60035490565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902081565b60006105496108dc565b6000808451111561056257835160200290508391508082525b600054600160a060020a03161580610673575060008054600160a060020a03169063fdef91069088903090899087906040516020015260405160e060020a63ffffffff8716028152600160a060020a0380861660048301908152908516602483015260448201849052608060648301908152909160840183818151815260200191508051906020019080838360005b838110156106095780820151838201526020016105f1565b50505050905090810190601f1680156106365780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b151561065757600080fd5b6102c65a03f1151561066857600080fd5b505050604051805190505b9695505050505050565b600054600160a060020a031681565b60006106966107c4565b600160a060020a03166304bf2a7f836000604051602001526040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156106fd5780820151838201526020016106e5565b50505050905090810190601f16801561072a5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b151561074857600080fd5b6102c65a03f1151561075957600080fd5b50505060405180519392505050565b6069546101009004600160a060020a031681565b60655460009067ffffffffffffffff83161061079757600080fd5b6065805467ffffffffffffffff84169081106107af57fe5b90600052602060002090600402019050919050565b600080548190600160a060020a03166342c71f1d6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561074857600080fd5b61010060405190810160405280600081526020016108ac6108dc565b815260006020820181905260408201819052606082018190526080820181905260a0820181905260c09091015290565b602060405190810160405260008152905600a165627a7a723058200d4e5d4c975f206a9b62cd4645a202bad964626e9f2fc28fac6b080f55677fd30029"
exports['_./contracts/Pledges.sol_keccak256'] = "0x9c7a60dff92f94d518d0c4a40d5434cd23680f79fd364ae855575ae4ca683797"
exports.PledgesAbi = [{"constant":true,"inputs":[],"name":"whitelistDisabled","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":"token","type":"address"},{"name":"pledgeState","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"EVMSCRIPT_REGISTRY_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"EVMSCRIPT_REGISTRY_APP","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]
exports.PledgesByteCode = "0x60606040526069805460ff19169055341561001957600080fd5b61091a806100286000396000f3006060604052600436106100955763ffffffff60e060020a6000350416631c8e8568811461009a5780632a8ec8cc146100c15780633f657a46146100e657806360b1e0571461017657806380afdea8146101895780638b3dd7491461019c5780639b3fdf4c146101af578063a1658fad146101c2578063d4aae0c414610225578063f92a79ff14610254578063fbfa77cf146102a5575b600080fd5b34156100a557600080fd5b6100ad6102b8565b604051901515815260200160405180910390f35b34156100cc57600080fd5b6100d46102c1565b60405190815260200160405180910390f35b34156100f157600080fd5b61010667ffffffffffffffff600435166102cb565b60405188815267ffffffffffffffff8089166020830152878116604083015286811660608301528581166080830152841660a0820152600160a060020a03831660c082015260e0810182600281111561015b57fe5b60ff1681526020019850505050505050505060405180910390f35b341561018157600080fd5b6100d4610483565b341561019457600080fd5b6100d46104b7565b34156101a757600080fd5b6100d46104bd565b34156101ba57600080fd5b6100d46104c3565b34156101cd57600080fd5b6100ad60048035600160a060020a031690602480359190606490604435908101908301358060208082020160405190810160405280939291908181526020018383602002808284375094965061053f95505050505050565b341561023057600080fd5b61023861067d565b604051600160a060020a03909116815260200160405180910390f35b341561025f57600080fd5b61023860046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061068c95505050505050565b34156102b057600080fd5b610238610768565b60695460ff1681565b6065546000190190565b6000806000806000806000806102df610890565b6102e88a61077c565b6101006040519081016040529081600082015481526020016001820180548060200260200160405190810160405280929190818152602001828054801561038257602002820191906000526020600020906000905b82829054906101000a900467ffffffffffffffff1667ffffffffffffffff168152602001906008019060208260070104928301926001038202915080841161033d5790505b505050918352505060028281015467ffffffffffffffff80821660208501526801000000000000000082048116604085015270010000000000000000000000000000000082048116606085015278010000000000000000000000000000000000000000000000009091041660808301526003830154600160a060020a03811660a084015260c09092019174010000000000000000000000000000000000000000900460ff169081111561043157fe5b600281111561043c57fe5b90525090508051985080604001519750806020015151965080606001519550806080015194508060a0015193508060c0015192508060e00151915050919395975091939597565b6040517f65766d7265672e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b60015481565b60035490565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902081565b60006105496108dc565b6000808451111561056257835160200290508391508082525b600054600160a060020a03161580610673575060008054600160a060020a03169063fdef91069088903090899087906040516020015260405160e060020a63ffffffff8716028152600160a060020a0380861660048301908152908516602483015260448201849052608060648301908152909160840183818151815260200191508051906020019080838360005b838110156106095780820151838201526020016105f1565b50505050905090810190601f1680156106365780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b151561065757600080fd5b6102c65a03f1151561066857600080fd5b505050604051805190505b9695505050505050565b600054600160a060020a031681565b60006106966107c4565b600160a060020a03166304bf2a7f836000604051602001526040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156106fd5780820151838201526020016106e5565b50505050905090810190601f16801561072a5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b151561074857600080fd5b6102c65a03f1151561075957600080fd5b50505060405180519392505050565b6069546101009004600160a060020a031681565b60655460009067ffffffffffffffff83161061079757600080fd5b6065805467ffffffffffffffff84169081106107af57fe5b90600052602060002090600402019050919050565b600080548190600160a060020a03166342c71f1d6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561074857600080fd5b61010060405190810160405280600081526020016108ac6108dc565b815260006020820181905260408201819052606082018190526080820181905260a0820181905260c09091015290565b602060405190810160405260008152905600a165627a7a723058200d4e5d4c975f206a9b62cd4645a202bad964626e9f2fc28fac6b080f55677fd30029"
exports.PledgesRuntimeByteCode = "0x6060604052600436106100955763ffffffff60e060020a6000350416631c8e8568811461009a5780632a8ec8cc146100c15780633f657a46146100e657806360b1e0571461017657806380afdea8146101895780638b3dd7491461019c5780639b3fdf4c146101af578063a1658fad146101c2578063d4aae0c414610225578063f92a79ff14610254578063fbfa77cf146102a5575b600080fd5b34156100a557600080fd5b6100ad6102b8565b604051901515815260200160405180910390f35b34156100cc57600080fd5b6100d46102c1565b60405190815260200160405180910390f35b34156100f157600080fd5b61010667ffffffffffffffff600435166102cb565b60405188815267ffffffffffffffff8089166020830152878116604083015286811660608301528581166080830152841660a0820152600160a060020a03831660c082015260e0810182600281111561015b57fe5b60ff1681526020019850505050505050505060405180910390f35b341561018157600080fd5b6100d4610483565b341561019457600080fd5b6100d46104b7565b34156101a757600080fd5b6100d46104bd565b34156101ba57600080fd5b6100d46104c3565b34156101cd57600080fd5b6100ad60048035600160a060020a031690602480359190606490604435908101908301358060208082020160405190810160405280939291908181526020018383602002808284375094965061053f95505050505050565b341561023057600080fd5b61023861067d565b604051600160a060020a03909116815260200160405180910390f35b341561025f57600080fd5b61023860046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061068c95505050505050565b34156102b057600080fd5b610238610768565b60695460ff1681565b6065546000190190565b6000806000806000806000806102df610890565b6102e88a61077c565b6101006040519081016040529081600082015481526020016001820180548060200260200160405190810160405280929190818152602001828054801561038257602002820191906000526020600020906000905b82829054906101000a900467ffffffffffffffff1667ffffffffffffffff168152602001906008019060208260070104928301926001038202915080841161033d5790505b505050918352505060028281015467ffffffffffffffff80821660208501526801000000000000000082048116604085015270010000000000000000000000000000000082048116606085015278010000000000000000000000000000000000000000000000009091041660808301526003830154600160a060020a03811660a084015260c09092019174010000000000000000000000000000000000000000900460ff169081111561043157fe5b600281111561043c57fe5b90525090508051985080604001519750806020015151965080606001519550806080015194508060a0015193508060c0015192508060e00151915050919395975091939597565b6040517f65766d7265672e617261676f6e706d2e657468000000000000000000000000008152601301604051809103902081565b60015481565b60035490565b6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902081565b60006105496108dc565b6000808451111561056257835160200290508391508082525b600054600160a060020a03161580610673575060008054600160a060020a03169063fdef91069088903090899087906040516020015260405160e060020a63ffffffff8716028152600160a060020a0380861660048301908152908516602483015260448201849052608060648301908152909160840183818151815260200191508051906020019080838360005b838110156106095780820151838201526020016105f1565b50505050905090810190601f1680156106365780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b151561065757600080fd5b6102c65a03f1151561066857600080fd5b505050604051805190505b9695505050505050565b600054600160a060020a031681565b60006106966107c4565b600160a060020a03166304bf2a7f836000604051602001526040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156106fd5780820151838201526020016106e5565b50505050905090810190601f16801561072a5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b151561074857600080fd5b6102c65a03f1151561075957600080fd5b50505060405180519392505050565b6069546101009004600160a060020a031681565b60655460009067ffffffffffffffff83161061079757600080fd5b6065805467ffffffffffffffff84169081106107af57fe5b90600052602060002090600402019050919050565b600080548190600160a060020a03166342c71f1d6040517f6170700000000000000000000000000000000000000000000000000000000000815260030160405180910390206040517f65766d7265672e617261676f6e706d2e6574680000000000000000000000000081526013016040518091039020604051918252602082015260409081019051809103902060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561074857600080fd5b61010060405190810160405280600081526020016108ac6108dc565b815260006020820181905260408201819052606082018190526080820181905260a0820181905260c09091015290565b602060405190810160405260008152905600a165627a7a723058200d4e5d4c975f206a9b62cd4645a202bad964626e9f2fc28fac6b080f55677fd30029"
exports['_./contracts/Pledges.sol_keccak256'] = "0x9c7a60dff92f94d518d0c4a40d5434cd23680f79fd364ae855575ae4ca683797"
exports._solcVersion = "0.4.18+commit.9cf6e910.Darwin.appleclang"

View File

@ -1,919 +0,0 @@
///File: @aragon/os/contracts/acl/IACL.sol
pragma solidity ^0.4.18;
interface IACL {
function initialize(address permissionsCreator) public;
function hasPermission(address who, address where, bytes32 what, bytes how) public view returns (bool);
}
///File: @aragon/os/contracts/kernel/IKernel.sol
pragma solidity ^0.4.18;
interface IKernel {
event SetApp(bytes32 indexed namespace, bytes32 indexed name, bytes32 indexed id, address app);
function acl() public view returns (IACL);
function hasPermission(address who, address where, bytes32 what, bytes how) public view returns (bool);
function setApp(bytes32 namespace, bytes32 name, address app) public returns (bytes32 id);
function getApp(bytes32 id) public view returns (address);
}
///File: @aragon/os/contracts/apps/AppStorage.sol
pragma solidity ^0.4.18;
contract AppStorage {
IKernel public kernel;
bytes32 public appId;
address internal pinnedCode; // used by Proxy Pinned
uint256 internal initializationBlock; // used by Initializable
uint256[95] private storageOffset; // forces App storage to start at after 100 slots
uint256 private offset;
}
///File: @aragon/os/contracts/common/Initializable.sol
pragma solidity ^0.4.18;
contract Initializable is AppStorage {
modifier onlyInit {
require(initializationBlock == 0);
_;
}
/**
* @return Block number in which the contract was initialized
*/
function getInitializationBlock() public view returns (uint256) {
return initializationBlock;
}
/**
* @dev Function to be called by top level contract after initialization has finished.
*/
function initialized() internal onlyInit {
initializationBlock = getBlockNumber();
}
/**
* @dev Returns the current block number.
* Using a function rather than `block.number` allows us to easily mock the block number in
* tests.
*/
function getBlockNumber() internal view returns (uint256) {
return block.number;
}
}
///File: @aragon/os/contracts/evmscript/IEVMScriptExecutor.sol
pragma solidity ^0.4.18;
interface IEVMScriptExecutor {
function execScript(bytes script, bytes input, address[] blacklist) external returns (bytes);
}
///File: @aragon/os/contracts/evmscript/IEVMScriptRegistry.sol
pragma solidity 0.4.18;
contract EVMScriptRegistryConstants {
bytes32 constant public EVMSCRIPT_REGISTRY_APP_ID = keccak256("evmreg.aragonpm.eth");
bytes32 constant public EVMSCRIPT_REGISTRY_APP = keccak256(keccak256("app"), EVMSCRIPT_REGISTRY_APP_ID);
}
interface IEVMScriptRegistry {
function addScriptExecutor(address executor) external returns (uint id);
function disableScriptExecutor(uint256 executorId) external;
function getScriptExecutor(bytes script) public view returns (address);
}
///File: @aragon/os/contracts/evmscript/ScriptHelpers.sol
pragma solidity 0.4.18;
library ScriptHelpers {
// To test with JS and compare with actual encoder. Maintaining for reference.
// t = function() { return IEVMScriptExecutor.at('0x4bcdd59d6c77774ee7317fc1095f69ec84421e49').contract.execScript.getData(...[].slice.call(arguments)).slice(10).match(/.{1,64}/g) }
// run = function() { return ScriptHelpers.new().then(sh => { sh.abiEncode.call(...[].slice.call(arguments)).then(a => console.log(a.slice(2).match(/.{1,64}/g)) ) }) }
// This is truly not beautiful but lets no daydream to the day solidity gets reflection features
function abiEncode(bytes _a, bytes _b, address[] _c) public pure returns (bytes d) {
return encode(_a, _b, _c);
}
function encode(bytes memory _a, bytes memory _b, address[] memory _c) internal pure returns (bytes memory d) {
// A is positioned after the 3 position words
uint256 aPosition = 0x60;
uint256 bPosition = aPosition + 32 * abiLength(_a);
uint256 cPosition = bPosition + 32 * abiLength(_b);
uint256 length = cPosition + 32 * abiLength(_c);
d = new bytes(length);
assembly {
// Store positions
mstore(add(d, 0x20), aPosition)
mstore(add(d, 0x40), bPosition)
mstore(add(d, 0x60), cPosition)
}
// Copy memory to correct position
copy(d, getPtr(_a), aPosition, _a.length);
copy(d, getPtr(_b), bPosition, _b.length);
copy(d, getPtr(_c), cPosition, _c.length * 32); // 1 word per address
}
function abiLength(bytes memory _a) internal pure returns (uint256) {
// 1 for length +
// memory words + 1 if not divisible for 32 to offset word
return 1 + (_a.length / 32) + (_a.length % 32 > 0 ? 1 : 0);
}
function abiLength(address[] _a) internal pure returns (uint256) {
// 1 for length + 1 per item
return 1 + _a.length;
}
function copy(bytes _d, uint256 _src, uint256 _pos, uint256 _length) internal pure {
uint dest;
assembly {
dest := add(add(_d, 0x20), _pos)
}
memcpy(dest, _src, _length + 32);
}
function getPtr(bytes memory _x) internal pure returns (uint256 ptr) {
assembly {
ptr := _x
}
}
function getPtr(address[] memory _x) internal pure returns (uint256 ptr) {
assembly {
ptr := _x
}
}
function getSpecId(bytes _script) internal pure returns (uint32) {
return uint32At(_script, 0);
}
function uint256At(bytes _data, uint256 _location) internal pure returns (uint256 result) {
assembly {
result := mload(add(_data, add(0x20, _location)))
}
}
function addressAt(bytes _data, uint256 _location) internal pure returns (address result) {
uint256 word = uint256At(_data, _location);
assembly {
result := div(and(word, 0xffffffffffffffffffffffffffffffffffffffff000000000000000000000000),
0x1000000000000000000000000)
}
}
function uint32At(bytes _data, uint256 _location) internal pure returns (uint32 result) {
uint256 word = uint256At(_data, _location);
assembly {
result := div(and(word, 0xffffffff00000000000000000000000000000000000000000000000000000000),
0x100000000000000000000000000000000000000000000000000000000)
}
}
function locationOf(bytes _data, uint256 _location) internal pure returns (uint256 result) {
assembly {
result := add(_data, add(0x20, _location))
}
}
function toBytes(bytes4 _sig) internal pure returns (bytes) {
bytes memory payload = new bytes(4);
payload[0] = bytes1(_sig);
payload[1] = bytes1(_sig << 8);
payload[2] = bytes1(_sig << 16);
payload[3] = bytes1(_sig << 24);
return payload;
}
function memcpy(uint _dest, uint _src, uint _len) public pure {
uint256 src = _src;
uint256 dest = _dest;
uint256 len = _len;
// Copy word-length chunks while possible
for (; len >= 32; len -= 32) {
assembly {
mstore(dest, mload(src))
}
dest += 32;
src += 32;
}
// Copy remaining bytes
uint mask = 256 ** (32 - len) - 1;
assembly {
let srcpart := and(mload(src), not(mask))
let destpart := and(mload(dest), mask)
mstore(dest, or(destpart, srcpart))
}
}
}
///File: @aragon/os/contracts/evmscript/EVMScriptRunner.sol
pragma solidity ^0.4.18;
contract EVMScriptRunner is AppStorage, EVMScriptRegistryConstants {
using ScriptHelpers for bytes;
function runScript(bytes _script, bytes _input, address[] _blacklist) protectState internal returns (bytes output) {
// TODO: Too much data flying around, maybe extracting spec id here is cheaper
address executorAddr = getExecutor(_script);
require(executorAddr != address(0));
bytes memory calldataArgs = _script.encode(_input, _blacklist);
bytes4 sig = IEVMScriptExecutor(0).execScript.selector;
require(executorAddr.delegatecall(sig, calldataArgs));
return returnedDataDecoded();
}
function getExecutor(bytes _script) public view returns (IEVMScriptExecutor) {
return IEVMScriptExecutor(getExecutorRegistry().getScriptExecutor(_script));
}
// TODO: Internal
function getExecutorRegistry() internal view returns (IEVMScriptRegistry) {
address registryAddr = kernel.getApp(EVMSCRIPT_REGISTRY_APP);
return IEVMScriptRegistry(registryAddr);
}
/**
* @dev copies and returns last's call data. Needs to ABI decode first
*/
function returnedDataDecoded() internal view returns (bytes ret) {
assembly {
let size := returndatasize
switch size
case 0 {}
default {
ret := mload(0x40) // free mem ptr get
mstore(0x40, add(ret, add(size, 0x20))) // free mem ptr set
returndatacopy(ret, 0x20, sub(size, 0x20)) // copy return data
}
}
return ret;
}
modifier protectState {
address preKernel = kernel;
bytes32 preAppId = appId;
_; // exec
require(kernel == preKernel);
require(appId == preAppId);
}
}
///File: @aragon/os/contracts/acl/ACLSyntaxSugar.sol
pragma solidity 0.4.18;
contract ACLSyntaxSugar {
function arr() internal pure returns (uint256[] r) {}
function arr(bytes32 _a) internal pure returns (uint256[] r) {
return arr(uint256(_a));
}
function arr(bytes32 _a, bytes32 _b) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b));
}
function arr(address _a) internal pure returns (uint256[] r) {
return arr(uint256(_a));
}
function arr(address _a, address _b) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b));
}
function arr(address _a, uint256 _b, uint256 _c) internal pure returns (uint256[] r) {
return arr(uint256(_a), _b, _c);
}
function arr(address _a, uint256 _b) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b));
}
function arr(address _a, address _b, uint256 _c, uint256 _d, uint256 _e) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b), _c, _d, _e);
}
function arr(address _a, address _b, address _c) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b), uint256(_c));
}
function arr(address _a, address _b, uint256 _c) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b), uint256(_c));
}
function arr(uint256 _a) internal pure returns (uint256[] r) {
r = new uint256[](1);
r[0] = _a;
}
function arr(uint256 _a, uint256 _b) internal pure returns (uint256[] r) {
r = new uint256[](2);
r[0] = _a;
r[1] = _b;
}
function arr(uint256 _a, uint256 _b, uint256 _c) internal pure returns (uint256[] r) {
r = new uint256[](3);
r[0] = _a;
r[1] = _b;
r[2] = _c;
}
function arr(uint256 _a, uint256 _b, uint256 _c, uint256 _d) internal pure returns (uint256[] r) {
r = new uint256[](4);
r[0] = _a;
r[1] = _b;
r[2] = _c;
r[3] = _d;
}
function arr(uint256 _a, uint256 _b, uint256 _c, uint256 _d, uint256 _e) internal pure returns (uint256[] r) {
r = new uint256[](5);
r[0] = _a;
r[1] = _b;
r[2] = _c;
r[3] = _d;
r[4] = _e;
}
}
contract ACLHelpers {
function decodeParamOp(uint256 _x) internal pure returns (uint8 b) {
return uint8(_x >> (8 * 30));
}
function decodeParamId(uint256 _x) internal pure returns (uint8 b) {
return uint8(_x >> (8 * 31));
}
function decodeParamsList(uint256 _x) internal pure returns (uint32 a, uint32 b, uint32 c) {
a = uint32(_x);
b = uint32(_x >> (8 * 4));
c = uint32(_x >> (8 * 8));
}
}
///File: @aragon/os/contracts/apps/AragonApp.sol
pragma solidity ^0.4.18;
contract AragonApp is AppStorage, Initializable, ACLSyntaxSugar, EVMScriptRunner {
modifier auth(bytes32 _role) {
require(canPerform(msg.sender, _role, new uint256[](0)));
_;
}
modifier authP(bytes32 _role, uint256[] params) {
require(canPerform(msg.sender, _role, params));
_;
}
function canPerform(address _sender, bytes32 _role, uint256[] params) public view returns (bool) {
bytes memory how; // no need to init memory as it is never used
if (params.length > 0) {
uint256 byteLength = params.length * 32;
assembly {
how := params // forced casting
mstore(how, byteLength)
}
}
return address(kernel) == 0 || kernel.hasPermission(_sender, address(this), _role, how);
}
}
///File: ./contracts/ILiquidPledgingPlugin.sol
pragma solidity ^0.4.11;
/*
Copyright 2017, Jordi Baylina
Contributors: Adrià Massanet <adria@codecontext.io>, RJ Ewing, Griff
Green, Arthur Lunn
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 <http://www.gnu.org/licenses/>.
*/
/// @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. 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
/// 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 beforeTransfer(
uint64 pledgeManager,
uint64 pledgeFrom,
uint64 pledgeTo,
uint64 context,
address token,
uint amount ) public 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,
address token,
uint amount
) public;
}
///File: ./contracts/LiquidPledgingStorage.sol
pragma solidity ^0.4.18;
/// @dev This is an interface for `LPVault` which serves as a secure storage for
/// the ETH that backs the Pledges, only after `LiquidPledging` authorizes
/// payments can Pledges be converted for ETH
interface ILPVault {
function authorizePayment(bytes32 _ref, address _dest, address _token, uint _amount) public;
}
/// This contract contains all state variables used in LiquidPledging contracts
/// This is done to have everything in 1 location, b/c state variable layout
/// is MUST have be the same when performing an upgrade.
contract LiquidPledgingStorage {
enum PledgeAdminType { Giver, Delegate, Project }
enum PledgeState { Pledged, Paying, Paid }
/// @dev This struct defines the details of a `PledgeAdmin` which are
/// commonly referenced by their index in the `admins` array
/// and can own pledges and act as delegates
struct PledgeAdmin {
PledgeAdminType adminType; // Giver, Delegate or Project
address addr; // Account or contract address for admin
uint64 commitTime; // In seconds, used for time Givers' & Delegates' have to veto
uint64 parentProject; // Only for projects
bool canceled; //Always false except for canceled projects
/// @dev if the plugin is 0x0 then nothing happens, if its an address
// than that smart contract is called when appropriate
ILiquidPledgingPlugin plugin;
string name;
string url; // Can be IPFS hash
}
struct Pledge {
uint amount;
uint64[] delegationChain; // List of delegates in order of authority
uint64 owner; // PledgeAdmin
uint64 intendedProject; // Used when delegates are sending to projects
uint64 commitTime; // When the intendedProject will become the owner
uint64 oldPledge; // Points to the id that this Pledge was derived from
address token;
PledgeState pledgeState; // Pledged, Paying, Paid
}
PledgeAdmin[] admins; //The list of pledgeAdmins 0 means there is no admin
Pledge[] pledges;
/// @dev this mapping allows you to search for a specific pledge's
/// index number by the hash of that pledge
mapping (bytes32 => uint64) hPledge2idx;
// this whitelist is for non-proxied plugins
mapping (bytes32 => bool) pluginContractWhitelist;
// this whitelist is for proxied plugins
mapping (address => bool) pluginInstanceWhitelist;
bool public whitelistDisabled = false;
ILPVault public vault;
// reserve 50 slots for future upgrades. I'm not sure if this is necessary
// but b/c of multiple inheritance used in lp, better safe then sorry.
// especially since it is free
uint[50] private storageOffset;
}
///File: ./contracts/Pledges.sol
pragma solidity ^0.4.18;
/*
Copyright 2017, Jordi Baylina, RJ Ewing
Contributors: Adrià Massanet <adria@codecontext.io>, Griff Green,
Arthur Lunn
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 <http://www.gnu.org/licenses/>.
*/
contract Pledges is AragonApp, LiquidPledgingStorage {
// Limits inserted to prevent large loops that could prevent canceling
uint constant MAX_DELEGATES = 10;
// a constant for when a delegate is requested that is not in the system
uint64 constant NOTFOUND = 0xFFFFFFFFFFFFFFFF;
/////////////////////////////
// Public constant functions
////////////////////////////
/// @notice A constant getter that returns the total number of pledges
/// @return The total number of Pledges in the system
function numberOfPledges() external view returns (uint) {
return pledges.length - 1;
}
/// @notice A getter that returns the details of the specified pledge
/// @param idPledge the id number of the pledge being queried
/// @return the amount, owner, the number of delegates (but not the actual
/// delegates, the intendedProject (if any), the current commit time and
/// the previous pledge this pledge was derived from
function getPledge(uint64 idPledge) external view returns(
uint amount,
uint64 owner,
uint64 nDelegates,
uint64 intendedProject,
uint64 commitTime,
uint64 oldPledge,
address token,
PledgeState pledgeState
) {
Pledge memory p = _findPledge(idPledge);
amount = p.amount;
owner = p.owner;
nDelegates = uint64(p.delegationChain.length);
intendedProject = p.intendedProject;
commitTime = p.commitTime;
oldPledge = p.oldPledge;
token = p.token;
pledgeState = p.pledgeState;
}
////////////////////
// Internal methods
////////////////////
/// @notice This creates a Pledge with an initial amount of 0 if one is not
/// created already; otherwise it finds the pledge with the specified
/// attributes; 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
/// @param owner The owner of the pledge being looked up
/// @param delegationChain The list of delegates in order of authority
/// @param intendedProject The project this pledge will Fund after the
/// commitTime has passed
/// @param commitTime The length of time in seconds the Giver has to
/// veto when the Giver's delegates Pledge funds to a project
/// @param oldPledge This value is used to store the pledge the current
/// pledge was came from, and in the case a Project is canceled, the Pledge
/// will revert back to it's previous state
/// @param state The pledge state: Pledged, Paying, or state
/// @return The hPledge2idx index number
function _findOrCreatePledge(
uint64 owner,
uint64[] delegationChain,
uint64 intendedProject,
uint64 commitTime,
uint64 oldPledge,
address token,
PledgeState state
) internal returns (uint64)
{
bytes32 hPledge = keccak256(delegationChain, owner, intendedProject, commitTime, oldPledge, token, state);
uint64 id = hPledge2idx[hPledge];
if (id > 0) {
return id;
}
id = uint64(pledges.length);
hPledge2idx[hPledge] = id;
pledges.push(
Pledge(
0,
delegationChain,
owner,
intendedProject,
commitTime,
oldPledge,
token,
state
)
);
return id;
}
/// @param idPledge the id of the pledge to load from storage
/// @return The Pledge
function _findPledge(uint64 idPledge) internal view returns(Pledge storage) {
require(idPledge < pledges.length);
return pledges[idPledge];
}
/// @notice A getter that searches the delegationChain for the level of
/// authority a specific delegate has within a Pledge
/// @param p The Pledge that will be searched
/// @param idDelegate The specified delegate that's searched for
/// @return If the delegate chain contains the delegate with the
/// `admins` array index `idDelegate` this returns that delegates
/// corresponding index in the delegationChain. Otherwise it returns
/// the NOTFOUND constant
function _getDelegateIdx(Pledge p, uint64 idDelegate) internal pure returns(uint64) {
for (uint i = 0; i < p.delegationChain.length; i++) {
if (p.delegationChain[i] == idDelegate) {
return uint64(i);
}
}
return NOTFOUND;
}
/// @notice A getter to find how many old "parent" pledges a specific Pledge
/// had using a self-referential loop
/// @param p The Pledge being queried
/// @return The number of old "parent" pledges a specific Pledge had
function _getPledgeLevel(Pledge p) internal view returns(uint) {
if (p.oldPledge == 0) {
return 0;
}
Pledge storage oldP = _findPledge(p.oldPledge);
return _getPledgeLevel(oldP) + 1; // a loop lookup
}
}
///File: ./contracts/Pledges.sol
pragma solidity ^0.4.18;
/*
Copyright 2017, Jordi Baylina, RJ Ewing
Contributors: Adrià Massanet <adria@codecontext.io>, Griff Green,
Arthur Lunn
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 <http://www.gnu.org/licenses/>.
*/
contract Pledges is AragonApp, LiquidPledgingStorage {
// Limits inserted to prevent large loops that could prevent canceling
uint constant MAX_DELEGATES = 10;
// a constant for when a delegate is requested that is not in the system
uint64 constant NOTFOUND = 0xFFFFFFFFFFFFFFFF;
/////////////////////////////
// Public constant functions
////////////////////////////
/// @notice A constant getter that returns the total number of pledges
/// @return The total number of Pledges in the system
function numberOfPledges() external view returns (uint) {
return pledges.length - 1;
}
/// @notice A getter that returns the details of the specified pledge
/// @param idPledge the id number of the pledge being queried
/// @return the amount, owner, the number of delegates (but not the actual
/// delegates, the intendedProject (if any), the current commit time and
/// the previous pledge this pledge was derived from
function getPledge(uint64 idPledge) external view returns(
uint amount,
uint64 owner,
uint64 nDelegates,
uint64 intendedProject,
uint64 commitTime,
uint64 oldPledge,
address token,
PledgeState pledgeState
) {
Pledge memory p = _findPledge(idPledge);
amount = p.amount;
owner = p.owner;
nDelegates = uint64(p.delegationChain.length);
intendedProject = p.intendedProject;
commitTime = p.commitTime;
oldPledge = p.oldPledge;
token = p.token;
pledgeState = p.pledgeState;
}
////////////////////
// Internal methods
////////////////////
/// @notice This creates a Pledge with an initial amount of 0 if one is not
/// created already; otherwise it finds the pledge with the specified
/// attributes; 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
/// @param owner The owner of the pledge being looked up
/// @param delegationChain The list of delegates in order of authority
/// @param intendedProject The project this pledge will Fund after the
/// commitTime has passed
/// @param commitTime The length of time in seconds the Giver has to
/// veto when the Giver's delegates Pledge funds to a project
/// @param oldPledge This value is used to store the pledge the current
/// pledge was came from, and in the case a Project is canceled, the Pledge
/// will revert back to it's previous state
/// @param state The pledge state: Pledged, Paying, or state
/// @return The hPledge2idx index number
function _findOrCreatePledge(
uint64 owner,
uint64[] delegationChain,
uint64 intendedProject,
uint64 commitTime,
uint64 oldPledge,
address token,
PledgeState state
) internal returns (uint64)
{
bytes32 hPledge = keccak256(delegationChain, owner, intendedProject, commitTime, oldPledge, token, state);
uint64 id = hPledge2idx[hPledge];
if (id > 0) {
return id;
}
id = uint64(pledges.length);
hPledge2idx[hPledge] = id;
pledges.push(
Pledge(
0,
delegationChain,
owner,
intendedProject,
commitTime,
oldPledge,
token,
state
)
);
return id;
}
/// @param idPledge the id of the pledge to load from storage
/// @return The Pledge
function _findPledge(uint64 idPledge) internal view returns(Pledge storage) {
require(idPledge < pledges.length);
return pledges[idPledge];
}
/// @notice A getter that searches the delegationChain for the level of
/// authority a specific delegate has within a Pledge
/// @param p The Pledge that will be searched
/// @param idDelegate The specified delegate that's searched for
/// @return If the delegate chain contains the delegate with the
/// `admins` array index `idDelegate` this returns that delegates
/// corresponding index in the delegationChain. Otherwise it returns
/// the NOTFOUND constant
function _getDelegateIdx(Pledge p, uint64 idDelegate) internal pure returns(uint64) {
for (uint i = 0; i < p.delegationChain.length; i++) {
if (p.delegationChain[i] == idDelegate) {
return uint64(i);
}
}
return NOTFOUND;
}
/// @notice A getter to find how many old "parent" pledges a specific Pledge
/// had using a self-referential loop
/// @param p The Pledge being queried
/// @return The number of old "parent" pledges a specific Pledge had
function _getPledgeLevel(Pledge p) internal view returns(uint) {
if (p.oldPledge == 0) {
return 0;
}
Pledge storage oldP = _findPledge(p.oldPledge);
return _getPledgeLevel(oldP) + 1; // a loop lookup
}
}

View File

@ -1,7 +0,0 @@
/* This is an autogenerated file. DO NOT EDIT MANUALLY */
exports.StandardTokenAbi = [{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"mint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_subtractedValue","type":"uint256"}],"name":"decreaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_addedValue","type":"uint256"}],"name":"increaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"}]
exports.StandardTokenByteCode = "0x6060604052341561000f57600080fd5b60038054600160a060020a03191633600160a060020a031617905561063e806100396000396000f3006060604052600436106100985763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461009d57806318160ddd146100d357806323b872dd146100f857806340c10f1914610120578063661884631461014457806370a0823114610166578063a9059cbb14610185578063d73dd623146101a7578063dd62ed3e146101c9575b600080fd5b34156100a857600080fd5b6100bf600160a060020a03600435166024356101ee565b604051901515815260200160405180910390f35b34156100de57600080fd5b6100e6610258565b60405190815260200160405180910390f35b341561010357600080fd5b6100bf600160a060020a036004358116906024351660443561025e565b341561012b57600080fd5b610142600160a060020a0360043516602435610358565b005b341561014f57600080fd5b6100bf600160a060020a03600435166024356103d1565b341561017157600080fd5b6100e6600160a060020a03600435166104b7565b341561019057600080fd5b6100bf600160a060020a03600435166024356104d2565b34156101b257600080fd5b6100bf600160a060020a036004351660243561057c565b34156101d457600080fd5b6100e6600160a060020a03600435811690602435166105e9565b600160a060020a0333811660008181526020818152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60025490565b6000600160a060020a038316151561027557600080fd5b600160a060020a03841660009081526001602052604090205482111561029a57600080fd5b600160a060020a0380851660009081526020818152604080832033909416835292905220548211156102cb57600080fd5b600160a060020a038481166000818152600160209081526040808320805488900390558785168084528184208054890190558484528383528184203390961684529490915290819020805486900390557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60035433600160a060020a0390811691161461037357600080fd5b6002805482019055600160a060020a0382166000818152600160205260408082208054850190557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a35050565b600160a060020a033381166000908152602081815260408083209386168352929052908120548083111561042a57600160a060020a03338116600090815260208181526040808320938816835292905290812055610453565b600160a060020a0333811660009081526020818152604080832093881683529290522083820390555b600160a060020a033381166000818152602081815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526001602052604090205490565b6000600160a060020a03831615156104e957600080fd5b600160a060020a03331660009081526001602052604090205482111561050e57600080fd5b600160a060020a033381166000818152600160205260408082208054879003905592861680825290839020805486019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a03338116600081815260208181526040808320948716808452949091528082208054860190819055919392917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260208181526040808320939094168252919091522054905600a165627a7a72305820fa577b915d604e5de01c5990f46ef5965ecb67e138d98331dc9d7d065bfd00100029"
exports.StandardTokenRuntimeByteCode = "0x6060604052600436106100985763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461009d57806318160ddd146100d357806323b872dd146100f857806340c10f1914610120578063661884631461014457806370a0823114610166578063a9059cbb14610185578063d73dd623146101a7578063dd62ed3e146101c9575b600080fd5b34156100a857600080fd5b6100bf600160a060020a03600435166024356101ee565b604051901515815260200160405180910390f35b34156100de57600080fd5b6100e6610258565b60405190815260200160405180910390f35b341561010357600080fd5b6100bf600160a060020a036004358116906024351660443561025e565b341561012b57600080fd5b610142600160a060020a0360043516602435610358565b005b341561014f57600080fd5b6100bf600160a060020a03600435166024356103d1565b341561017157600080fd5b6100e6600160a060020a03600435166104b7565b341561019057600080fd5b6100bf600160a060020a03600435166024356104d2565b34156101b257600080fd5b6100bf600160a060020a036004351660243561057c565b34156101d457600080fd5b6100e6600160a060020a03600435811690602435166105e9565b600160a060020a0333811660008181526020818152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60025490565b6000600160a060020a038316151561027557600080fd5b600160a060020a03841660009081526001602052604090205482111561029a57600080fd5b600160a060020a0380851660009081526020818152604080832033909416835292905220548211156102cb57600080fd5b600160a060020a038481166000818152600160209081526040808320805488900390558785168084528184208054890190558484528383528184203390961684529490915290819020805486900390557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60035433600160a060020a0390811691161461037357600080fd5b6002805482019055600160a060020a0382166000818152600160205260408082208054850190557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a35050565b600160a060020a033381166000908152602081815260408083209386168352929052908120548083111561042a57600160a060020a03338116600090815260208181526040808320938816835292905290812055610453565b600160a060020a0333811660009081526020818152604080832093881683529290522083820390555b600160a060020a033381166000818152602081815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526001602052604090205490565b6000600160a060020a03831615156104e957600080fd5b600160a060020a03331660009081526001602052604090205482111561050e57600080fd5b600160a060020a033381166000818152600160205260408082208054879003905592861680825290839020805486019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a03338116600081815260208181526040808320948716808452949091528082208054860190819055919392917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260208181526040808320939094168252919091522054905600a165627a7a72305820fa577b915d604e5de01c5990f46ef5965ecb67e138d98331dc9d7d065bfd00100029"
exports['_./contracts/test/StandardToken.sol_keccak256'] = "0x9a4ae5b291b2fdb616bf902bff927d7b1bd0c1f3bcd6f0745f8e0c13dbb0ae55"
exports._solcVersion = "0.4.18+commit.9cf6e910.Darwin.appleclang"

View File

@ -1,155 +0,0 @@
///File: ./contracts/test/StandardToken.sol
pragma solidity ^0.4.18;
/**
* WARNING: This token is for testing purposes only
* and has been modified from the original version: https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC20/StandardToken.sol
*
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping (address => mapping (address => uint256)) internal allowed;
mapping(address => uint256) balances;
uint256 totalSupply_;
address owner;
function StandardToken() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
function mint(address _to, uint _value) public onlyOwner {
totalSupply_ += _value;
balances[_to] += _value;
Transfer(0, _to, _value);
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender] - _value;
balances[_to] = balances[_to] + _value;
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from] - _value;
balances[_to] = balances[_to] + _value;
allowed[_from][msg.sender] = allowed[_from][msg.sender] - _value;
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender] + _addedValue;
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue - _subtractedValue;
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +0,0 @@
const fs = require("fs");
const generateClass = require('eth-contract-class').default;
const contracts = {};
fs.readdirSync(__dirname).forEach(file => {
if ( /^.*\.sol\.js$/.test(file)) {
const f = require("./" + file);
Object.keys(f).forEach((k) => {
const res = /^(.*)Abi$/.exec(k);
if (res) {
const contractName = res[1];
if (f[contractName+"ByteCode"].length > 2) {
contracts[contractName] = generateClass(f[contractName+"Abi"], f[contractName+"ByteCode"]);
}
}
});
}
});
module.exports = contracts;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long