Skip to content

Commit 7253032

Browse files
committed
Boilerplate cra and truffle
1 parent bfc0667 commit 7253032

33 files changed

+13418
-2
lines changed

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/node_modules/
2+
**/build
3+
**/coverage
4+
coverage.json

.eslintrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
globals: {
3+
artifacts: true
4+
},
5+
extends: ['web3studio', 'web3studio/truffle', 'react-app']
6+
};

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.sol linguist-language=Solidity

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Jupyter
2+
.ipynb_checkpoints
3+
4+
## Node
5+
node_modules
6+
*.log
7+
coverage/
8+
.env
9+
10+
## Eth
11+
build/
12+
.0x-artifacts/

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
10

.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
**/coverage/
2+
**/build/
3+
**/node_modules/
4+
5+
**/coverage.json

.prettierrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('eslint-config-web3studio/prettier');

.soliumignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.soliumrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "web3studio",
3+
"plugins": ["security"]
4+
}

.travis.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: node_js
2+
node_js:
3+
- '10'
4+
5+
cache:
6+
yarn: true
7+
directories:
8+
- 'node_modules'
9+
10+
before_install:
11+
- curl -o- -L https://yarnpkg.com/install.sh | bash
12+
- export PATH="$HOME/.yarn/bin:$PATH"
13+
14+
branches:
15+
only:
16+
- master

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ a project from the [ConsenSys Web3Studio](https://consensys.net/web3studio/) tea
1717

1818
Web3Studio doesn't just do open source projects. We do open source from the first line of code and the first fragment of an idea that leads to that code. SideJam is an approach to using the Ethereum mainnet as a message bus between confidential state machines. Get on board now. Raise your hand to be part of our first community call, and you'll be ahead of the pack as we figure out what this thing is going to be.
1919

20-
2120
## Overview
2221

2322
This repo holds the code and development assets SideJam.
2423

2524
**More Coming Soon.** Watch this repo to stay up to date on new developments.
2625

27-
2826
## License
2927

3028
As per usual, we are publishing under the [Apache 2.0 License](LICENSE).

lerna.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"packages": ["packages/*"],
3+
"version": "0.0.0",
4+
"npmClient": "yarn",
5+
"useWorkspaces": true
6+
}

package.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "root",
3+
"private": true,
4+
"scripts": {
5+
"test": "yarn lint && yarn test:packages",
6+
"test:packages": "lerna run test --concurrency 1",
7+
"lint": "yarn eslint . && yarn solium -d .",
8+
"prettier": "prettier \"**/*.{js,json,css,md}\" --write"
9+
},
10+
"devDependencies": {
11+
"eslint": "^5.16.0",
12+
"eslint-config-web3studio": "^1.2.0",
13+
"husky": "^2.2.0",
14+
"lerna": "^3.5.0",
15+
"prettier": "^1.17.0",
16+
"pretty-quick": "^1.10.0",
17+
"solium": "^1.2.4",
18+
"solium-config-web3studio": "^1.2.0",
19+
"truffle": "^5.0.17"
20+
},
21+
"workspaces": {
22+
"packages": [
23+
"packages/*"
24+
]
25+
},
26+
"husky": {
27+
"hooks": {
28+
"pre-commit": "yarn pretty-quick --staged"
29+
}
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
pragma solidity >=0.4.21 <0.6.0;
2+
3+
contract Migrations {
4+
address public owner;
5+
uint public lastCompletedMigration;
6+
7+
constructor() public {
8+
owner = msg.sender;
9+
}
10+
11+
modifier restricted() {
12+
if (msg.sender == owner) {
13+
_;
14+
}
15+
}
16+
17+
function setCompleted(uint completed) public restricted {
18+
lastCompletedMigration = completed;
19+
}
20+
21+
function upgrade(address newAddress) public restricted {
22+
Migrations upgraded = Migrations(newAddress);
23+
upgraded.setCompleted(lastCompletedMigration);
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const Migrations = artifacts.require('Migrations');
2+
3+
module.exports = function(deployer) {
4+
deployer.deploy(Migrations);
5+
};

packages/message-bus/package.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "message-bus",
3+
"version": "0.0.0",
4+
"description": "Message bus contracts",
5+
"author": "Web3Studio Developers <[email protected]>",
6+
"homepage": "https://github.com/ConsenSys/web3studio-sidejam#readme",
7+
"license": "Apache-2.0",
8+
"repository": {
9+
"type": "git",
10+
"url": "git+https://github.com/ConsenSys/web3studio-sidejam.git"
11+
},
12+
"scripts": {
13+
"build": "yarn buidl",
14+
"buidl": "truffle compile",
15+
"migrate": "truffle migrate --reset",
16+
"truffle": "truffle"
17+
},
18+
"bugs": {
19+
"url": "https://github.com/ConsenSys/web3studio-sidejam/issues"
20+
},
21+
"dependencies": {},
22+
"devDependencies": {}
23+
}
+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/**
2+
* Use this file to configure your truffle project. It's seeded with some
3+
* common settings for different networks and features like migrations,
4+
* compilation and testing. Uncomment the ones you need or modify
5+
* them to suit your project as necessary.
6+
*
7+
* More information about configuration can be found at:
8+
*
9+
* truffleframework.com/docs/advanced/configuration
10+
*
11+
* To deploy via Infura you'll need a wallet provider (like truffle-hdwallet-provider)
12+
* to sign your transactions before they're sent to a remote public node. Infura accounts
13+
* are available for free at: infura.io/register.
14+
*
15+
* You'll also need a mnemonic - the twelve word phrase the wallet uses to generate
16+
* public/private key pairs. If you're publishing your code to GitHub make sure you load this
17+
* phrase from a file you've .gitignored so it doesn't accidentally become public.
18+
*
19+
*/
20+
21+
// const HDWalletProvider = require('truffle-hdwallet-provider');
22+
// const infuraKey = "fj4jll3k.....";
23+
//
24+
// const fs = require('fs');
25+
// const mnemonic = fs.readFileSync(".secret").toString().trim();
26+
27+
module.exports = {
28+
/**
29+
* Networks define how you connect to your ethereum client and let you set the
30+
* defaults web3 uses to send transactions. If you don't specify one truffle
31+
* will spin up a development blockchain for you on port 9545 when you
32+
* run `develop` or `test`. You can ask a truffle command to use a specific
33+
* network from the command line, e.g
34+
*
35+
* $ truffle test --network <network-name>
36+
*/
37+
38+
networks: {
39+
// Useful for testing. The `development` name is special - truffle uses it by default
40+
// if it's defined here and no other network is specified at the command line.
41+
// You should run a client (like ganache-cli, geth or parity) in a separate terminal
42+
// tab if you use this network and you must also set the `host`, `port` and `network_id`
43+
// options below to some value.
44+
//
45+
// development: {
46+
// host: "127.0.0.1", // Localhost (default: none)
47+
// port: 8545, // Standard Ethereum port (default: none)
48+
// network_id: "*", // Any network (default: none)
49+
// },
50+
// Another network with more advanced options...
51+
// advanced: {
52+
// port: 8777, // Custom port
53+
// network_id: 1342, // Custom network
54+
// gas: 8500000, // Gas sent with each transaction (default: ~6700000)
55+
// gasPrice: 20000000000, // 20 gwei (in wei) (default: 100 gwei)
56+
// from: <address>, // Account to send txs from (default: accounts[0])
57+
// websockets: true // Enable EventEmitter interface for web3 (default: false)
58+
// },
59+
// Useful for deploying to a public network.
60+
// NB: It's important to wrap the provider as a function.
61+
// ropsten: {
62+
// provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/YOUR-PROJECT-ID`),
63+
// network_id: 3, // Ropsten's id
64+
// gas: 5500000, // Ropsten has a lower block limit than mainnet
65+
// confirmations: 2, // # of confs to wait between deployments. (default: 0)
66+
// timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
67+
// skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
68+
// },
69+
// Useful for private networks
70+
// private: {
71+
// provider: () => new HDWalletProvider(mnemonic, `https://network.io`),
72+
// network_id: 2111, // This network is yours, in the cloud.
73+
// production: true // Treats this network as if it was a public net. (default: false)
74+
// }
75+
},
76+
77+
// Set default mocha options here, use special reporters etc.
78+
mocha: {
79+
// timeout: 100000
80+
},
81+
82+
// Configure your compilers
83+
compilers: {
84+
solc: {
85+
// version: "0.5.1", // Fetch exact version from solc-bin (default: truffle's version)
86+
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
87+
// settings: { // See the solidity docs for advice about optimization and evmVersion
88+
// optimizer: {
89+
// enabled: false,
90+
// runs: 200
91+
// },
92+
// evmVersion: "byzantium"
93+
// }
94+
}
95+
}
96+
};

packages/stratego-four/README.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2+
3+
## Available Scripts
4+
5+
In the project directory, you can run:
6+
7+
### `npm start`
8+
9+
Runs the app in the development mode.<br>
10+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11+
12+
The page will reload if you make edits.<br>
13+
You will also see any lint errors in the console.
14+
15+
### `npm test`
16+
17+
Launches the test runner in the interactive watch mode.<br>
18+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19+
20+
### `npm run build`
21+
22+
Builds the app for production to the `build` folder.<br>
23+
It correctly bundles React in production mode and optimizes the build for the best performance.
24+
25+
The build is minified and the filenames include the hashes.<br>
26+
Your app is ready to be deployed!
27+
28+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29+
30+
### `npm run eject`
31+
32+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33+
34+
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35+
36+
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37+
38+
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39+
40+
## Learn More
41+
42+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43+
44+
To learn React, check out the [React documentation](https://reactjs.org/).
45+
46+
### Code Splitting
47+
48+
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49+
50+
### Analyzing the Bundle Size
51+
52+
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53+
54+
### Making a Progressive Web App
55+
56+
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57+
58+
### Advanced Configuration
59+
60+
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61+
62+
### Deployment
63+
64+
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65+
66+
### `npm run build` fails to minify
67+
68+
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
pragma solidity >=0.4.21 <0.6.0;
2+
3+
contract Migrations {
4+
address public owner;
5+
uint public lastCompletedMigration;
6+
7+
constructor() public {
8+
owner = msg.sender;
9+
}
10+
11+
modifier restricted() {
12+
if (msg.sender == owner) {
13+
_;
14+
}
15+
}
16+
17+
function setCompleted(uint completed) public restricted {
18+
lastCompletedMigration = completed;
19+
}
20+
21+
function upgrade(address newAddress) public restricted {
22+
Migrations upgraded = Migrations(newAddress);
23+
upgraded.setCompleted(lastCompletedMigration);
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const Migrations = artifacts.require('Migrations');
2+
3+
module.exports = function(deployer) {
4+
deployer.deploy(Migrations);
5+
};

packages/stratego-four/package.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "stratego-four",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"react": "^16.8.6",
7+
"react-dom": "^16.8.6",
8+
"react-scripts": "3.0.1"
9+
},
10+
"scripts": {
11+
"start": "react-scripts start",
12+
"build": "react-scripts build",
13+
"test": "CI=true react-scripts test",
14+
"eject": "react-scripts eject"
15+
},
16+
"browserslist": {
17+
"production": [
18+
">0.2%",
19+
"not dead",
20+
"not op_mini all"
21+
],
22+
"development": [
23+
"last 1 chrome version",
24+
"last 1 firefox version",
25+
"last 1 safari version"
26+
]
27+
}
28+
}
3.78 KB
Binary file not shown.

0 commit comments

Comments
 (0)