This commit is contained in:
Jordi Baylina 2017-08-13 13:23:00 +02:00
parent ba2c87364c
commit 32c905de49
No known key found for this signature in database
GPG Key ID: 7480C80C1BE43112
7 changed files with 324 additions and 15268 deletions

3
.tavis.yml Normal file
View File

@ -0,0 +1,3 @@
language: 'node_js'
node_js:
- '8'

53
contracts/LP2.sol.new Normal file
View File

@ -0,0 +1,53 @@
contract PledgedTokens {
MinimeToken
}
contract LiquidPledgingInterface {
function deposit(uint64 user) payable;
function withdraw(uint64 user, uint64 idNote, uint amount);
function delegate(uint64 user, uint64 idNote, uint64 purpuse, uint amout);
function undelegate(uint64 user, uint64 idNote, uint amount);
function propose(uint user, uint64 idNote, uint64 recipient, uint amount);
function unPropose(uint user, uint64 idNote, uint amount);
function transfer(uint64 user, uint64 idNote, uint64 recipient, uint amount);
}
contract Project {
struct TokenOwnership {
address token;
uint purchaseBlock;
uint amount;
bytes32 ref;
}
Minime2Token public projectToken;
mapping(uint => Minime2Token) public pledgedTokens;
TokenOwnership[] public ownerships;
function pledge(address investor, uint amount, uint precommit);
function unpledge(address investor, uint amount);
function invest(address investor, uint amount);
function unInvest(address investor, uint amount);
function pay(address dest, uint amount, uint block) onlyProjectManager;
function receive(uint amount);
function payDividends(uint token, uint amount, uint payBlock);
}

View File

@ -2,6 +2,7 @@ pragma solidity ^0.4.11;
contract Vault {
function authorizePayment(bytes32 _ref, address _dest, uint _amount);
function () payable;
}
contract LiquidPledgingBase {
@ -268,7 +269,7 @@ contract LiquidPledgingBase {
// are not too many Projects that violate MAX_SUBPROJECT_LEVEL
function getProjectLevel(Note n) internal returns(uint) {
if (n.oldNote == 0) return 0;//changed
Note oldN = findNote(n.oldNote);
Note storage oldN = findNote(n.oldNote);
return getProjectLevel(oldN) + 1;
}
// this makes it easy to cancel projects

15469
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,8 @@
"test": "test"
},
"scripts": {
"test": "truffle test"
"build": "solcpiler",
"test": "solcpiler; mocha --harmony"
},
"repository": {
"type": "git",
@ -28,22 +29,20 @@
"url": "https://github.com/Giveth/liquidpledging/issues"
},
"devDependencies": {
"async": "^2.4.0",
"bignumber.js": "^4.0.2",
"babel-eslint": "^7.2.3",
"eslint-config-airbnb": "^15.0.1",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.1.0",
"ethereumjs-testrpc": "^3.0.5",
"random-bytes": "^1.0.0",
"truffle": "3.2.4",
"truffle-hdwallet-provider": "0.0.3",
"web3": "^0.18.4"
"mocha": "^3.5.0",
"chai": "^4.1.0",
"solcpiler": "0.0.4"
},
"homepage": "https://github.com/Giveth/liquidpledging#readme",
"dependencies": {
"babel-eslint": "^7.2.3",
"chai": "^4.1.0",
"async": "^2.4.0",
"ethconnector": "0.0.25",
"runethtx": "0.1.0"
}

View File

@ -1,4 +0,0 @@
require('runethtx')
console.log('hh');

View File

@ -1,45 +0,0 @@
const HDWalletProvider = require('truffle-hdwallet-provider');
const mnemonic = process.env.TEST_MNEMONIC || 'giveth liquid pledging mnemonic';
const providerRopsten = new HDWalletProvider(mnemonic, 'https://ropsten.infura.io/', 0);
const providerKovan = new HDWalletProvider(mnemonic, 'https://kovan.infura.io', 0);
module.exports = {
networks: {
development: {
network_id: 15,
host: "localhost",
port: 8545,
gas: 4000000,
gasPrice: 20e9,
},
development_migrate: {
network_id: 15,
host: "localhost",
port: 8545,
gas: 4000000,
gasPrice: 20e9,
from: "0xf93df8c288b9020e76583a6997362e89e0599e99",
},
mainnet: {
network_id: 1,
host: "localhost",
port: 8545,
gas: 4000000,
gasPrice: 20e9,
from: "0xf93df8c288b9020e76583a6997362e89e0599e99",
},
ropsten: {
network_id: 3,
provider: providerRopsten,
gas: 4000000,
gasPrice: 20e9,
},
kovan: {
network_id: 42,
provider: providerKovan,
gas: 4000000,
gasPrice: 20e9,
},
}
};