Skip to content

Commit 76c1963

Browse files
authored
Merge pull request #1 from singnet/enhancements/vesting-factory
Enhancements/vesting factory
2 parents d2fb23b + d706eb5 commit 76c1963

19 files changed

+249
-289
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
build
22
node_modules
33
yarn-error.log
4-
/.DS_Store
4+
.DS_Store
55
npm-debug.log
66
addresses.json
77
package-lock.json

Dockerfile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
FROM node:6
1+
FROM node:8
22

3-
WORKDIR /code
4-
5-
ADD . /code
6-
7-
RUN npm install -g truffle
3+
RUN npm install

README.md

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@ Includes contracts, migrations, tests, user interface and webpack build pipeline
1313

1414
## Install
1515

16-
### Truffle
16+
### Dependencies
1717
```bash
18-
npm i -g truffle
18+
npm install
1919
```
2020

21-
### Ethereum
22-
You can choose between Parity or local testrpc
21+
### Test
22+
2323

24-
### testRPC
25-
```bash
26-
npm install -g ethereumjs-testrpc
27-
```
2824

2925
### Parity
3026
**Parity requires Rust version 1.19.0 to build**
@@ -70,14 +66,6 @@ npm install -g ethereumjs-testrpc
7066
cp /target/release/parity /usr/local/bin
7167
```
7268

73-
74-
## Build
75-
1. First `cd dao && npm i`
76-
2. `truffle compile` and run on separated tab `parity` or `testrpc`
77-
3. `truffle migrate` to deploy the contracts onto your network of choice (default "development").
78-
5. `truffle test`
79-
80-
8169
## Usage
8270

8371
You can choose of using web3 with Python and Javascript

contracts/.DS_Store

6 KB
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
pragma solidity ^0.4.18;
2+
3+
import "./TokenVesting.sol";
4+
import "zeppelin-solidity/contracts/math/SafeMath.sol";
5+
import "zeppelin-solidity/contracts/ownership/Ownable.sol";
6+
7+
contract TokenVestingFactory is Ownable {
8+
9+
event Created(TokenVesting vesting);
10+
11+
function create(address _beneficiary, uint256 _start, uint256 _cliff, uint256 _duration, bool _revocable) onlyOwner public returns (TokenVesting) {
12+
13+
TokenVesting vesting = new TokenVesting(_beneficiary, _start, _cliff, _duration, _revocable);
14+
15+
Created(vesting);
16+
17+
return vesting;
18+
}
19+
20+
}

migrations/.DS_Store

6 KB
Binary file not shown.

migrations/2_deploy_contracts.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
const fs = require('fs')
22

3-
const MarketJobFactory = artifacts.require('market/MarketJobFactory.sol')
43
const AgentFactory = artifacts.require('agent/AgentFactory.sol')
54
const AgentRegistry = artifacts.require('registries/AgentRegistry.sol')
5+
const MarketJobFactory = artifacts.require('market/MarketJobFactory.sol')
66
const SingularityNetToken = artifacts.require('tokens/SingularityNetToken.sol')
7+
const TokenVestingFactory = artifacts.require('tokens/TokenVestingFactory.sol')
78

89
module.exports = function(deployer, network, accounts) {
910
deployer.deploy([
1011
AgentFactory,
1112
AgentRegistry,
1213
MarketJobFactory,
13-
SingularityNetToken
14+
SingularityNetToken,
15+
TokenVestingFactory
1416
]).then(() => {
1517
const fileName = "addresses.json"
1618
const content = {
1719
AgentFactory: AgentFactory.address,
1820
AgentRegistry: AgentRegistry.address,
1921
MarketJobFactory: MarketJobFactory.address,
20-
SingularityNetToken: SingularityNetToken.address
22+
SingularityNetToken: SingularityNetToken.address,
23+
TokenVestingFactory: TokenVestingFactory.address
2124
}
2225

2326
fs.writeFile(fileName, JSON.stringify(content), 'utf-8', (err) => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"author": "tiero",
1313
"license": "MIT",
1414
"dependencies": {
15-
"ethereumjs-testrpc": "^4.1.3",
15+
"truffle": "^4.0.1",
1616
"truffle-hdwallet-provider": "0.0.3",
1717
"zeppelin-solidity": "^1.4.0"
1818
},

test.sh

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,4 @@
11
#!/usr/bin/env bash
22

3-
trap cleanup EXIT
4-
5-
cleanup() {
6-
if [ -n "$testrpc_pid" ] && ps -p $testrpc_pid > /dev/null; then
7-
kill -9 $testrpc_pid
8-
fi
9-
}
10-
11-
testrpc_running() {
12-
nc -z localhost 8545
13-
}
14-
15-
if testrpc_running; then
16-
echo "Using existing testrpc"
17-
else
18-
echo "testrpc is running "
19-
node_modules/.bin/testrpc > /dev/null &
20-
testrpc_pid=$!
21-
fi
22-
23-
node_modules/.bin/truffle compile --all "$@"
24-
node_modules/.bin/truffle migrate --reset "$@"
3+
npm i
254
node_modules/.bin/truffle test "$@"
26-
cd py && python main.py

test/.DS_Store

6 KB
Binary file not shown.

0 commit comments

Comments
 (0)