Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@augurproject/core
Advanced tools
Smart contracts for Augur, a decentralized prediction market platform on the Ethereum blockchain.
If you just want to clone the repo and quickly have a local proof of authority network running with the contracts deployed then you can just clone the repo and run:
docker run -it -p 8545:8545 -p 8546:8546 augurproject/dev-node-geth:v1.9.9
yarn deploy:local
8545
.0xfae42052f82bed612a724fec3632f325f377120592c75bb78adfcceae6470c5a
.You need system-wide installations of Python 3.6, Node.js 10+, and Solidity 0.5.15. (Or Docker; see below.) Install the dependencies:
yarn
pip install -r requirements.txt
Note: on macOS, you'll need to use virtualenv or homebrew Python to work around System Integrity Protection. To do this using virtualenv, run:
python3 -m venv venv
source venv/bin/activate
python3 -m pip install -r requirements.txt
python3 -m pip install pytest
Solidity contract deployment is handled by ContractDeployer.ts
and the wrapper programs located in source/deployment
.
Main Code
Configuration
Wrapper programs
The tests directory (augur-core/tests) contain tests and test fixtures to test the various functionalities present in Augur, including trading, reporting, and wcl tests.
Use pytest to run Augur's test suite:
python3 -m pytest tests
This executes all the tests. To run a test individually, run the following:
python3 -m pytest tests::'name_of_test'
When writing tests, it is highly recommended to make use of the ContractFixtures class for "placeholder" variables. Python's unit testing framework comes handy here; encapsulate tests within functions that start with "test_", and use assert
statements when testing for certain values. Parameterized tests are recommended as well to test various possibilities and edge cases.
To generate a coverage report simply run the command:
yarn test:coverage
The results will be displayed on the command line and a much richer HTML output will be generated in the coverage
folder of the project.
Make sure you actually have enough memory to run the command above. The coverage tool being used will pull a massive file into memory to generate the report and will fail with an OOM exception if not enough is available. Since tests take about 40 minutes to run with coverage enabled this will be a sad event.
augur-core can optionally be built, run, and tested using Docker. A number of Docker commands are included as npm scripts, which map to the non-Dockerized versions where this makes sense. Docker commands beginning with docker:run
execute the command within the Docker image. Docker commands without run
(e.g. docker:test
) first build the image, then execute docker:run:<command>
.
npm run docker:build
# With a pre-built image
npm run docker:run:test:unit:all
# Build and run all unit tests and integration tests
npm run docker:test
# Build and run just integration tests (using Geth)
npm run docker:run:test:integration:geth
# Build and run just integration tests (using Parity)
npm run docker:run:test:integration:parity
For quicker iteration on integration tests follow the instructions here to run tests locally against a node running in docker:
Augur's smart contracts are organized into four folders:
source/contracts/factories
: Constructors for universes, markets, dispute windows, etc.source/contracts/libraries
: Data structures used elsewhere in the source code.source/contracts/reporting
: Creation and manipulation of universes, markets, dispute windows, and reporting-related tokens.source/contracts/trading
: Functions to create, view, and fill orders, to issue and close out complete sets of shares, and for traders to claim proceeds after markets are closed.There are no floating-point numbers in the EVM, only integers. Therefore, Ether and Reputation values in contracts are always represented in units of wei (i.e., indivisible units of 10^-18 Ether or 10^-18 Reputation).
FAQs
Core augur contracts and deployment process
The npm package @augurproject/core receives a total of 2 weekly downloads. As such, @augurproject/core popularity was classified as not popular.
We found that @augurproject/core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.