Skip to content

Commit

Permalink
#151 as well as a a bunch of other stuff required for the new repo (#1)
Browse files Browse the repository at this point in the history
* #151 as well as a a bunch of other stuff required for the new repo

* remove a couple things

* changed lintignore

* changed package name
  • Loading branch information
dkent600 authored and leviadam committed Dec 11, 2017
1 parent 8ace719 commit 108a890
Show file tree
Hide file tree
Showing 39 changed files with 6,370 additions and 920 deletions.
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["es2015"],
"plugins": ["syntax-async-functions"]
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
27 changes: 27 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"extends": "eslint:recommended",
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"rules": {
"semi": 2,
"no-undef": "off",
"object-curly-newline": [ "error", { "multiline": true } ],
"no-trailing-spaces": [ "error", { "skipBlankLines": false, "ignoreComments": false} ],
"no-tabs": 2,
"no-var": 2,
"prefer-const": 2,
"prefer-spread": 2,
"prefer-rest-params": 2,
"prefer-arrow-callback": 2,
"no-duplicate-imports": 2,
"no-dupe-class-members": 2,
"no-const-assign": 2,
"no-confusing-arrow": 2,
"no-lonely-if": 2,
"no-continue": 2,
"indent": ["error", 2]
}
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
.node-xmlhttprequest-sync*
*.tgz
.vscode/
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
dist: trusty

language: node_js

node_js:
- "7.10.0"

before_install:
- sudo apt-get update -qq
- sudo apt-get install software-properties-common -y -qq
- sudo add-apt-repository -y ppa:ethereum/ethereum
- sudo add-apt-repository -y ppa:ethereum/ethereum-dev
- sudo apt-get update -qq
- sudo apt-get install geth -y -qq

install:
- yarn
- rm -rf build/ # remove any remaining artifacts from a previous build
- nohup yarn run testrpc &
- truffle version

script:
- yarn test
- yarn lint
notifications:
slack: daostack:fGuaFPsiQiV5mgmzRcSzbYqw
54 changes: 54 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

# Contributing

Bug reports and pull requests very much welcomed.

Please make sure test pass before submitting a PR.

We try to follow the style guidelines from http://solidity.readthedocs.io/en/develop/style-guide.html

The development id done on unix based systems.

# Testing

These contracts are tested using the truffle framework

## Installation

Make sure you have a recent version of [node.js](https://nodejs.org/) (7.6 and above) and [yarn](https://yarnpkg.com) package manager.

Installation of dependencies. After cloning the repository run:

yarn


## Run tests

To run the test locally use a local blockchain using testrpc, just run:

testrpc

On a second terminal, run the tests:

yarn run test


# Style

For solidity, we are following the style guide here: http://solidity.readthedocs.io/en/develop/style-guide.html

A Solidity linter (solium is installed, which can be run with:

yarn run solium

Code should survive Javascript linting as well:

yarn run lint

# Breakpoints

if you run tests with:

node debug ./node_modules/truffle/build/cli.bundled.js test

it is possible to use `debugger` statemetns and inspect the state
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
master: [![Build Status](https://travis-ci.org/daostack/daostack.svg?branch=master)](https://travis-ci.org/daostack/daostack)

dev: [![Build Status](https://travis-ci.org/daostack/daostack.svg?branch=dev)](https://travis-ci.org/daostack/daostack)


# Mission Statement

DAOStack is a widely open collaboration to build the basic framework for [Decentralized Autonomous Organizations](https://en.wikipedia.org/wiki/Decentralized_autonomous_organization) (DAO) through bootstrap, or dogfooding.

Meaning, firstly publish the minimal smart contract that distributes tokens and voting power (AKA reputation) for further token distribution. Then, collectively distribute more tokens and voting power to contributors of code and other contributions, according to the appreciation of current reputation holders. Anyone who disagrees with the current reputation alignment can always open a new contract, with new token and reputation systems (and be the initial reputation holder).

Gradually, bit by bit, we aim to build the first decentralized corporation, an array of contracts that can hold the tokens and voting power of each other, interact and form a decentralized economy.



# Contributing

Contributions and pull requests are very welcome. Check out [The DAOStack roadmap](docs/roadmap.md), and join us on [Slack](daostack.slack.com).

If you want to contribute to the code, check out [CONTRIBUTING.md](CONTRIBUTING.md).
18 changes: 9 additions & 9 deletions dist/arc.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,17 @@ function configure(options) {
options; // for lint
// not used at the moment: const network = options && options.network && options.network.name ? options.network.name : 'testrpc';
/**
* TODO: supply testrpc url in options? Problem is that at this point web3 has already been set in utils
* so it's too late at this point to set the url. Would need to somehow effect this initialization before
* any contract imports have been attempted. Need to figure out how to export the modules above somewhere
* else, or separately.
*/
* TODO: supply testrpc url in options? Problem is that at this point web3 has already been set in utils
* so it's too late at this point to set the url. Would need to somehow effect this initialization before
* any contract imports have been attempted. Need to figure out how to export the modules above somewhere
* else, or separately.
*/

/**
* TODO: should we specify something here?
* See: https://mikemcl.github.io/bignumber.js/#config
BigNumber.config({...});
*/
* TODO: should we specify something here?
* See: https://mikemcl.github.io/bignumber.js/#config
BigNumber.config({...});
*/
return (0, _utils.getWeb3)();
}

Expand Down
54 changes: 27 additions & 27 deletions dist/daostack.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
exports.Organization = exports.daostack = undefined;

Expand All @@ -16,33 +16,33 @@ var _organization = require('./organization.js');

var daostack = function () {

// async function _checkForNecessaryFunds() {
// // TODO: this is not working at all yet: the idea is that we check some precodnitions
// // to be able to give some useful user feedback
// return true;
//
// // check if we have tokens in the schemeregistrar for adding an organization
// const schemeRegistrarTokenAddress = await schemeRegistrar.nativeToken();
// const schemeRegistrarToken = await DAOToken.at(schemeRegistrarTokenAddress);
// const avatarBalance = await schemeRegistrarToken.balanceOf(avatar.address);
// const fee = await schemeRegistrar.fee();
//
// // check if we have the funds to pay the fee
// if (avatarBalance.toNumber() < fee.toNumber()) {
// throw new Error('The balance of the controller\'s avatar is too low to pay the fee for adding an organization. Balance: ' + ourBalance.valueOf() + 'fee: ' + fee);
// }
//
// const beneficiary = await schemeRegistrar.beneficiary();
// await controller.ExternalTokenApprove(schemeRegistrarToken, beneficiary, fee.toNumber());
// // check if externaltokenapprove has indeed approved the right allowance
// // TODO: move this to a separate test on the controller
// const allowance = await schemeRegistrarToken.allowance(avatar.address, beneficiary);
// if (allowance.toNumber() < fee.toNumber()) {
// throw new Error('The allowance of the controllers avatar to the registrars beneficiary is too low to pay the fee for adding an organization. Balance: ' + ourBalance.valueOf() + 'fee: ' + fee);
// }
// }
// async function _checkForNecessaryFunds() {
// // TODO: this is not working at all yet: the idea is that we check some precodnitions
// // to be able to give some useful user feedback
// return true;
//
// // check if we have tokens in the schemeregistrar for adding an organization
// const schemeRegistrarTokenAddress = await schemeRegistrar.nativeToken();
// const schemeRegistrarToken = await DAOToken.at(schemeRegistrarTokenAddress);
// const avatarBalance = await schemeRegistrarToken.balanceOf(avatar.address);
// const fee = await schemeRegistrar.fee();
//
// // check if we have the funds to pay the fee
// if (avatarBalance.toNumber() < fee.toNumber()) {
// throw new Error('The balance of the controller\'s avatar is too low to pay the fee for adding an organization. Balance: ' + ourBalance.valueOf() + 'fee: ' + fee);
// }
//
// const beneficiary = await schemeRegistrar.beneficiary();
// await controller.ExternalTokenApprove(schemeRegistrarToken, beneficiary, fee.toNumber());
// // check if externaltokenapprove has indeed approved the right allowance
// // TODO: move this to a separate test on the controller
// const allowance = await schemeRegistrarToken.allowance(avatar.address, beneficiary);
// if (allowance.toNumber() < fee.toNumber()) {
// throw new Error('The allowance of the controllers avatar to the registrars beneficiary is too low to pay the fee for adding an organization. Balance: ' + ourBalance.valueOf() + 'fee: ' + fee);
// }
// }

return {};
return {};
}();

exports.daostack = daostack;
Expand Down
2 changes: 1 addition & 1 deletion dist/globalconstraintregistrar.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ var GlobalConstraintRegistrar = exports.GlobalConstraintRegistrar = function (_E
}, {
key: 'getDefaultPermissions',
value: function getDefaultPermissions(overrideValue) {
return overrideValue || '0x00000005';
return overrideValue || '0x00000007';
}
}], [{
key: 'new',
Expand Down
Loading

0 comments on commit 108a890

Please sign in to comment.