Skip to content
This repository has been archived by the owner on Dec 26, 2017. It is now read-only.

oraclesorg/oracles-contract

Repository files navigation

Oracles POA Network smart contracts

Ethereum smart contracts to manage validators in Oracles POA Network

Oracles POA Network contracts features checklist

These are contracts for storing and managing the data for validators.

Description Status
1 Validator's personal data addition is available for valid initial key from ceremony good
2 Validator's personal data addition is forbidden for invalid initial key from ceremony good
3 Validator's personal data addition is forbidden for the same valid initial key from ceremony twice good
4 Validator's personal data addition is forbidden from ceremony, if counter of initial keys, invalidated from ceremony, reached the limit good
5 Validator's personal data addition is available for valid voting key from governance good
6 Validator's personal data addition is forbidden for invalid voting key from governance good
7 Validator's personal data addition is forbidden for the same valid voting key from governance twice good
8 Validator's personal data addition is forbidden from governance, if counter of validators, added from governance, reached the limit good
9 Mining key is added to validators' array after generation of new production keys good
10 Personal data: output zip code is equal to input zip code and it is a bignumber good
11 Personal data: output licenseExpiredAt is equal to input licenseExpiredAt and it is a bignumber good
12 Personal data: output licenseID is equal to input licenseID good
13 Personal data: output fullname is equal to input fullname good
14 Personal data: output streetname is equal to input streetname good
15 Personal data: output state is equal to input state good
16 Personal data: output sisablingDate is empty good

KeysStorage and KeysManager contracts.

These are contracts for storing and managing the data for Oracles POA Network Keys Generation dApp.

Description Status
1 Initial key addition is available for contract owner good
2 Initial key addition fails to add same key twice good
3 Initial key is valid after execution of addInitialKey function good
4 Initial key generation is forbidden for non-owner of contract good
5 It is allowed to add only limited number of initial keys (25) good
6 Production keys generation fails for invalid initial key good
7 Production keys generation fails for used initial key good
8 Licenses counter is incremented by generation of production keys good
9 Initial keys invalidation counter is incremented by generation of production keys good
10 Mining, voting and payout keys are generated after execution createKeys function, and they are valid good
11 Initial key is invalidated immediately after mining/payout/voting keys are created good

These are contracts for storing and managing the data for Oracles POA Network Governance dApp.

To be done...

Known Ethereum contracts attack vectors checklist

Attack vector Description Status
1 Race Conditions The order of transactions themselves (within a block) is easily subject to manipulation good
1.a Reentrancy Functions can be called repeatedly, before the first invocation of the function was finished good
1.b Cross-function Race Conditions A similar attack using two different functions that share the same state good
1.c Pitfalls in Race Condition Solutions Avoiding of calling functions which call external functions good
2 Timestamp Dependence Timestamp of the block can be manipulated by the miner
3 Integer Overflow and Underflow Usage of unlimited increments can cause such issue good
4 DoS with (Unexpected) Throw Unexpected throw is reached with some contract method for any user, because of malicious user called it before with bad parameters good
5 DoS with Block Gas Limit Block gas limit can be reached, for example, with looping through an array with unknown size and sending send() in a single transaction. Sending should be divided to multiple transactions good

Compiling of Oracles contract

Install dapp cli

  1. git clone https://github.com/oraclesorg/oracles-contract // clone repository

  2. cd oracles-contract/ // move to folder with project

  3. git submodule update --init --recursive // get submodules data

  4. dapp build // compiling of contracts to ./out

Expected result:

./out/Oracles.bin - bytecode of Oracles contract

./out/Oracles.abi - binary interface of Oracles contract

How to run tests

  • Start testrpc process with specific accounts and balances. Use make testrpc command.
  • Run tests with command truffle test.