Skip to content

Commit

Permalink
Fix indentation + Add dotenv to manage env variables and update Netwo…
Browse files Browse the repository at this point in the history
…rkConfiguration
  • Loading branch information
mertcelebi committed May 6, 2019
1 parent 243101c commit 22a80e6
Show file tree
Hide file tree
Showing 81 changed files with 3,092 additions and 2,985 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -11,6 +11,7 @@ __pycache__/

# Distribution / packaging
.Python
.env
.env/
env/
venv/
Expand Down
2 changes: 1 addition & 1 deletion .soliumrc.json
Expand Up @@ -9,7 +9,7 @@
"uppercase": "off",
"operator-whitespace": "off",
"array-declarations": "error",
"indentation": ["error", 4],
"indentation": ["error", 2],
"quotes": "off",
"conditionals-whitespace": "error",
"comma-whitespace": "error",
Expand Down
155 changes: 78 additions & 77 deletions package.json
@@ -1,79 +1,80 @@
{
"name": "augur-core",
"version": "1.1.0",
"description": "Core augur contracts and deployment process",
"author": "The Augur Developers <team@augur.net>",
"repository": "http://github.com/AugurProject/augur-core",
"main": "output/index.js",
"types": "output/index.d.ts",
"module": "output/index.js",
"browser": "output/browser.js",
"license": "GPL-3.0",
"directories": {
"src": "source",
"test": "test"
},
"scripts": {
"lint": "npx solium --dir source --reporter=gcc",
"build:source": "npx tsc",
"build:contracts": "npm run build:flattener && . venv/bin/activate && node output/deployment/compileContracts.js",
"build:interfaces": "node output/tools/generateContractInterfaces.js",
"build:flattener": "source/tools/installSolidityFlattener",
"build": "npm run build:source && npm run lint && npm run build:contracts && npm run build:interfaces",
"preversion": "npm run build",
"version": "git add source/libraries/ContractInterfaces.ts",
"release": "npm version prerelease && npm publish",
"test:unit": "pytest -vv",
"test:unit:all": "pytest tests -vv",
"test:integration": "npx mocha output/tests-integration/**/*.js --no-timeouts --require source-map-support/register",
"deploy:net": "bash ./source/support/deploy/run.sh direct",
"deploy:rinkeby": "npm run deploy:net -- rinkeby",
"deploy:ropsten": "npm run deploy:net -- ropsten",
"deploy:foundation": "npm run deploy:net -- foundation",
"deploy": "npm run deploy:net -- rinkeby",
"artifacts": "bash support/artifacts/run.sh"
},
"dependencies": {
"@types/get-port": "3.2.0",
"@types/mkdirp": "0.5.1",
"@types/node": "9.6.7",
"@types/yargs": "11.0.0",
"async-file": "2.0.2",
"async-mkdirp": "1.2.0",
"async-parallel": "1.2.3",
"binascii": "0.0.1",
"bn.js": "4.11.8",
"copy-dir": "0.3.0",
"crypto-promise": "2.0.0",
"ethereumjs-testrpc": "6.0.3",
"ethjs-abi": "0.2.1",
"ethjs-account": "0.1.4",
"ethjs-contract": "0.1.9",
"ethjs-provider-http": "0.1.6",
"ethjs-query": "0.3.1",
"ethjs-rpc": "0.1.8",
"ethjs-signer": "0.1.1",
"fs-readfile-promise": "3.0.0",
"get-port": "3.2.0",
"path": "0.12.7",
"recursive-readdir": "2.2.1",
"replace": "1.0.0",
"rimraf": "2.6.2",
"solidity-coverage": "0.5.4",
"yargs": "11.0.0"
},
"devDependencies": {
"@types/chai": "4.0.4",
"@types/chai-as-promised": "7.1.0",
"@types/mocha": "5.1.0",
"chai": "4.1.2",
"chai-as-promised": "7.1.1",
"cross-env": "5.1.3",
"mocha": "5.1.1",
"solc": "0.4.20",
"solium": "1.1.7",
"source-map-support": "0.5.0",
"ts-node": "3.3.0",
"typescript": "2.6.1"
}
"name": "veil-augur",
"version": "0.0.1",
"description": "Core VeilAugur contracts and deployment process",
"author": "Veil <hello@veil.co>",
"repository": "http://github.com/veilco/veil-augur",
"main": "output/index.js",
"types": "output/index.d.ts",
"module": "output/index.js",
"browser": "output/browser.js",
"license": "GPL-3.0",
"directories": {
"src": "source",
"test": "test"
},
"scripts": {
"lint": "npx solium --dir source --reporter=gcc",
"build:source": "npx tsc",
"build:contracts": "npm run build:flattener && . venv/bin/activate && node output/deployment/compileContracts.js",
"build:interfaces": "node output/tools/generateContractInterfaces.js",
"build:flattener": "source/tools/installSolidityFlattener",
"build": "npm run build:source && npm run lint && npm run build:contracts && npm run build:interfaces",
"preversion": "npm run build",
"version": "git add source/libraries/ContractInterfaces.ts",
"release": "npm version prerelease && npm publish",
"test:unit": "pytest -vv",
"test:unit:all": "pytest tests -vv",
"test:integration": "npx mocha output/tests-integration/**/*.js --no-timeouts --require source-map-support/register",
"deploy:net": "bash ./source/support/deploy/run.sh direct",
"deploy:rinkeby": "npm run deploy:net -- rinkeby",
"deploy:ropsten": "npm run deploy:net -- ropsten",
"deploy:kovan": "npm run deploy:net -- kovan",
"deploy:mainnet": "npm run deploy:net -- mainnet",
"artifacts": "bash support/artifacts/run.sh"
},
"dependencies": {
"@types/get-port": "3.2.0",
"@types/mkdirp": "0.5.1",
"@types/node": "9.6.7",
"@types/yargs": "11.0.0",
"async-file": "2.0.2",
"async-mkdirp": "1.2.0",
"async-parallel": "1.2.3",
"binascii": "0.0.1",
"bn.js": "4.11.8",
"copy-dir": "0.3.0",
"crypto-promise": "2.0.0",
"dotenv": "^8.0.0",
"ethereumjs-testrpc": "6.0.3",
"ethjs-abi": "0.2.1",
"ethjs-account": "0.1.4",
"ethjs-contract": "0.1.9",
"ethjs-provider-http": "0.1.6",
"ethjs-query": "0.3.1",
"ethjs-rpc": "0.1.8",
"ethjs-signer": "0.1.1",
"fs-readfile-promise": "3.0.0",
"get-port": "3.2.0",
"path": "0.12.7",
"recursive-readdir": "2.2.1",
"replace": "1.0.0",
"rimraf": "2.6.2",
"solidity-coverage": "0.5.4",
"yargs": "11.0.0"
},
"devDependencies": {
"@types/chai": "4.0.4",
"@types/chai-as-promised": "7.1.0",
"@types/mocha": "5.1.0",
"chai": "4.1.2",
"chai-as-promised": "7.1.1",
"cross-env": "5.1.3",
"mocha": "5.1.1",
"solc": "0.4.20",
"solium": "1.1.7",
"source-map-support": "0.5.0",
"ts-node": "3.3.0",
"typescript": "2.6.1"
}
}
79 changes: 39 additions & 40 deletions source/contracts/Controlled.sol
@@ -1,49 +1,48 @@
pragma solidity 0.4.25;


import 'IControlled.sol';
import 'IController.sol';
import 'libraries/token/ERC20Basic.sol';


contract Controlled is IControlled {
IController internal controller;

constructor() public {
controller = IController(msg.sender);
}

modifier onlyWhitelistedCallers {
require(controller.assertIsWhitelisted(msg.sender));
_;
}

modifier onlyCaller(bytes32 _key) {
require(msg.sender == controller.lookup(_key));
_;
}

modifier onlyControllerCaller {
require(IController(msg.sender) == controller);
_;
}

modifier onlyInGoodTimes {
require(controller.stopInEmergency());
_;
}

modifier onlyInBadTimes {
require(controller.onlyInEmergency());
_;
}

function getController() public view returns(IController) {
return controller;
}

function setController(IController _controller) public onlyControllerCaller returns(bool) {
controller = _controller;
return true;
}
IController internal controller;

constructor() public {
controller = IController(msg.sender);
}

modifier onlyWhitelistedCallers {
require(controller.assertIsWhitelisted(msg.sender));
_;
}

modifier onlyCaller(bytes32 _key) {
require(msg.sender == controller.lookup(_key));
_;
}

modifier onlyControllerCaller {
require(IController(msg.sender) == controller);
_;
}

modifier onlyInGoodTimes {
require(controller.stopInEmergency());
_;
}

modifier onlyInBadTimes {
require(controller.onlyInEmergency());
_;
}

function getController() public view returns(IController) {
return controller;
}

function setController(IController _controller) public onlyControllerCaller returns(bool) {
controller = _controller;
return true;
}
}

0 comments on commit 22a80e6

Please sign in to comment.