Commit Graph
76 Commits
Author SHA1 Message Date
bumi cd917ebc35 Rename healthcheck to PreflightChecker
Naming things is hard
2018-06-07 15:22:39 +02:00
bumi 017073018f Use more readable Array.every method instead of reduce 2018-04-26 15:35:32 +02:00
bumi fe1fa2e881 Allow filter and find for contributors by account data 2018-04-26 14:51:18 +02:00
bumiandGitHub c367c9cf6b Merge pull request #44 from 67P/add-contributors-alias
Add Contributors alias for Contributor
2018-04-26 11:52:23 +00:00
bumi 52643da096 typo 2018-04-26 13:52:09 +02:00
bumi 3895553e88 Use destructuring for options
This makes it more readable what options are used
2018-04-26 10:23:27 +02:00
bumi 89261d039a Fix contributor id lookup for proposal creation script 2018-04-26 02:42:31 +02:00
bumiandGitHub ce5f5fb8d2 Merge branch 'master' into features/batch-voting 2018-04-24 12:39:16 +00:00
bumi 2e8d00bc2c Add a filter by account function to contributors
This allows to filter contributors by the account entries.
For example:

```js

Contributor.filterByAccount({site: 'github.com'}); // returns all
contributors with github account
Contributor.filterByAccount({site: 'github.com', username: 'bumi'});
// returns bumi

```
2018-04-23 16:29:44 +02:00
bumi b1345b53f3 Add repl.js helper script
This is similar to the cli.js helper but only provides an initialized
`kredits` instance.
The cli.js is for executing contract functions
2018-04-23 16:24:40 +02:00
bumi 847f5a251c Allow funding accounts with the seeds script 2018-04-23 13:43:35 +02:00
bumi 62a5cefd1a Update readme to reflect helper script changes 2018-04-23 13:20:57 +02:00
bumi 6378df7075 cleanup 2018-04-23 12:11:26 +02:00
bumi bd2af6ed72 Smarter cli script
It now allows you to list available functions and allows to call
functions on the wrapper or on the contract directly.
2018-04-23 12:10:20 +02:00
bumi 85032353ca Use kredits library in add-proposal script 2018-04-23 12:06:04 +02:00
bumi 78b47753b3 Constructor confugration options
This changes the function signature of the constructor but allows us to
pass any options.
Mainly this is now used for the ipfs configs.
2018-04-23 11:01:08 +02:00
bumi 7ba32bb0ed Extract healthcheck into its own class
This moves the whole checks if everything is running into its own class
and is no longer inside the different functions.
Makes the functions smaller and the healthcheck can be used from the
client only if wanted/needed.
2018-04-21 16:45:04 +02:00
bumi 92f3963c5a Remove not needed static contractNames function 2018-04-20 13:01:44 +02:00
bumiandGitHub aedf2cc7bd Merge pull request #34 from 67P/feature/support-contract-call-options
Add support for contract tx call options
2018-04-20 10:59:07 +00:00
bumi 2503ac7c73 Refactor helper scripts to use kredits module
This reuses the kredits library functions in the helper scripts and
seeds. We no longer need to add IPFS hashes manually but simply can
provider contributor/proposal data.
2018-04-20 12:56:09 +02:00
bumi 3da3e22214 Refactor kredits address initialization
This moves the Kredits initialization to the instance which allows us to
be more flexible with handling contract addresses.

Example:

var k = new Kredits(provider, signer, {Registry: '0xabc'});
k.init().then((kredits) { ...});

var k = new Kredits(provider, signer, {Contributors: '0xabc'})
k.Contributor.add(...);
2018-04-20 03:08:18 +02:00
bumi 6738abd0b3 Add support for contract tx call options
This allows to provide options like gas price/limit settings for the
state changing contract calls.
These options are simply passed to the ethers contract instance.

We need to provide the gas limit when using the jsonrpc provider.
(ganache failed with revert if not enought gas was provider)
2018-04-20 02:09:30 +02:00
bumiandfsmanuel 9669f0137b Use prompt instead of argv arguments in scripts
This makes it easier to handle truffle arguments which we for example
need to specify the network.
So we ask the user for input instead on using the argv array which might
change.
2018-04-20 00:22:09 +02:00
bumi 3ad9835f79 Add kovan deployment 2018-04-19 15:02:40 +02:00
bumi 42bfb3d24e Fallback to provider if no contract signer is given
No signing functions will be available then.
2018-04-19 01:30:27 +02:00
bumi a16cd862f6 Better ipfs handling and default configs 2018-04-19 00:40:33 +02:00
bumi 424a2c4d02 Fix token modle.exports 2018-04-19 00:28:03 +02:00
bumi 8b0df655e8 Remove debug logs
The classes from the library should be less noisy
2018-04-19 00:23:28 +02:00
bumi d5e68e1639 Hello wrapper library 2018-04-18 18:51:27 +02:00
bumi 64ce554c49 readme 2018-04-16 11:01:43 +02:00
bumi 4b1cbbd0f7 Persist ganache DB and use fixed Mnemonic
This persists the state of the ganache db and uses a fixed mnemonic
code to create accounts.
It now acts more like a local presistent database and no need to
send funds to the accounts after restart.
2018-04-15 21:03:12 +02:00
bumi 9e57567cd3 rename recipent to contributor in token contract 2018-04-15 20:21:49 +02:00
bumi d7c8ee46bd Rename recipientId to contributorId in Operator 2018-04-15 19:58:28 +02:00
bumi 00a7a4e511 Merge branch 'master' into refactor/naming-conventions
* master:
  Adjust seeds to new proposal storage
2018-04-15 19:39:30 +02:00
bumi 4fd35a86c8 update seeds 2018-04-15 19:35:30 +02:00
bumi e2e9cd5c3b Add batch voting for proposals
The batchVote function accepts an array of proposal ids and votes for
every one.
Normally arrays without fix length are problematic and gas usage can not be
estimated really well. So we need to see how that works or what other
pattern could be used.
2018-04-15 18:15:21 +02:00
bumi 5235370960 Adjust seeds to new proposal storage 2018-04-15 15:37:11 +02:00
bumi 3a0350d581 Fix 2018-04-10 18:16:19 +02:00
bumi b85117835d update contributor account vs. address 2018-04-10 18:02:00 +02:00
bumi e116e7ebf3 Use new naming convention to call address things accounts
So here we use creatorAccount - similar to proposalId.
Like this we will always have an *Account or *Id as identifier.
2018-04-10 17:49:16 +02:00
bumi 147904e237 maybe more consitent 2018-04-10 16:40:11 +02:00
bumi 7f30006703 More consistent contract parameter naming 2018-04-10 16:25:17 +02:00
bumi 163a57af98 Rename Contributors function parameter to be more consitent 2018-04-09 21:50:35 +02:00
bumi b3d19e556c Make the CLI a real reply
After calling the contract function a reply is started.
This allows to interact and inspect the result object or call more
functions on the contract.
2018-04-09 01:52:51 +02:00
bumi 0a39a9056d Add voterIds to proposals
Adding a voterIds array to the proposal.
This allows us to check if a user already has voted on a proposal.
As this is not directly supported by the default proposals accessor this
also adds a getProposal function to get all proposal data.
2018-04-09 01:49:41 +02:00
bumi 054b0acac9 Readme 2018-04-08 13:50:19 +02:00
bumi 19518435fa Allow Contributors management by core contirbutors
So far we only allowed calls to the Contributors contract from the
Operator. With the new registry concept we can call functions again
directly on the Contributors contract (without the need to call it through
the operator).
This changes the authentication for the contributor management functions
to allow either core contributors or the operator to call them.

In the future I envision a bit more flexible and configurable
authentication concept that can more easily evolve over time.
2018-04-08 12:55:39 +02:00
bumi 7c766e2791 Rename IPFS hash names to be more consistent
We use ipfsHash now everywhere.
2018-04-07 22:33:32 +02:00
bumiandGitHub 8ff8717bed Merge pull request #16 from 67P/refactor/new-solidity-style
Newer solidity style
2018-04-07 20:24:30 +00:00
bumi 5e614713d7 Newer solidity style
removes depricated throw calls and constant modifiers
2018-04-07 21:34:06 +02:00
bumi baa26a85bb Add getContributorById
Similiar to directly accessing the contributors mapping this method also
returns the balance of the contributor.
2018-04-07 20:10:55 +02:00
bumi ebb26f78c2 code style 2018-04-07 19:41:39 +02:00
bumi 1488862b42 Add check if method is defined on the contract 2018-04-04 22:42:16 +02:00
bumi d42b0fa2dd Add a general purpose contract CLI
This allows to call any method on any contract using the CLI.

for example:

  $ truffle exec scripts/cli.js Operator proposalsCount
2018-04-04 22:24:33 +02:00
bumi 7d52161014 Document helper scripts to interact with the contracts 2018-04-04 22:05:22 +02:00
bumiandGitHub bdd99d58cf Merge pull request #9 from 67P/developer-networkid
Unify network id for development
2018-04-04 12:11:03 +00:00
bumi 4d2ba2a4bf Store contract names in registry as bytes32 hashes
This allows use to call the methods with a string but still store the
name as bytes32.
I also had some issues when calling the methods from ethers.js and a
string parameter so this is easier and safer.
2018-04-03 20:23:36 +02:00
bumi 13ce6b1a94 Add note about invalid nonce with metamask to readme 2018-04-03 20:22:52 +02:00
bumi fc4c964253 Add scripts/add-proposal script 2018-04-03 20:21:56 +02:00
bumi d510bd4a03 Use new proposal ipfs storage 2018-04-02 18:14:07 +02:00
bumi f55e95c7ae Split IPFS hash for proposals to use bytes32
Uses the same method as in Contrbutors to store proposal hashes
2018-04-02 18:09:12 +02:00
bumi 8301514c64 Add script to send funds from the main account
Helpful in development mode using ganache to fund another account

usage:

truffle exec scripts/send-funds.js <address> <amount in ether>
2018-04-02 16:53:25 +02:00
bumi d9ece98ffa Add script to add new contirbutors
Usage:

truffle exec scripts/add-contributor.js <ethereum address> <ipfs hash>
2018-04-02 14:44:46 +02:00
bumi 78b6b2e14f Add seeds script
Allows to seed the smart contract with development data specified in
config/seeds.js

Usage:

truffle exec scripts/seeds.js

or

npm run bootstrap which runs them all:
* truffle migrate --reset
* truffle exec scripts/seeds.js
* npm run build-json
2018-04-02 13:25:03 +02:00
bumiandGitHub 8f8582be69 Merge pull request #7 from 67P/json-abis
Add build-json script
2018-03-31 15:08:33 +00:00
bumi 85ae154860 Import/Migrate existing kredits contracts
This brings in the current state of the kredits contracts incl. the
Contributors, Operator and Token contract.
2018-03-31 16:18:17 +02:00
bumi f0caa1208d Add truffle and ganache-cli as dev dependency 2018-03-15 09:01:26 +01:00
bumi f0211ff4c1 Add proper Token contract 2018-03-15 08:55:17 +01:00
bumi 68fb8b2bee update readme 2018-03-14 23:26:30 +01:00
bumi ae0ae82fcb Log an event for implementation changes 2018-03-14 21:05:35 +01:00
bumi 6cbfc88159 Refactor to support multiple contracts in the registry
This allows to manage different contracts (Token, Collaborator, etc.)
with one registry.
The registry serves as main source for all contracts and versions.
Versions are independently deployed and added to the registry. From
there the proxy contract's implementation can be upgraded to the new
version.
Currently no access control is implemented.
2018-03-14 19:12:03 +01:00
bumi 4051093f72 Add requirements 2018-03-12 20:13:38 +01:00
bumiandGitHub e69bd2a976 Example process for upgrading a contract 2018-03-12 19:49:57 +01:00
bumiandGitHub 50ed9a6a79 Fix readme formatting 2018-03-12 19:20:09 +01:00
bumi 9deb7c2c7f more basic readme 2018-03-12 17:47:31 +01:00
bumi 9efe30afda Upgradable experiments 2018-03-11 23:12:29 +01:00