![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
augur-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 couple local proof of authority networks (Geth/Clique and Parity/Aura) running with the contracts deployed then you can just clone the repo and run:
docker-compose -f support/test/integration/docker-compose.yml up --build --force-recreate
47622
.47624
.0xfae42052f82bed612a724fec3632f325f377120592c75bb78adfcceae6470c5a
.You need system-wide installations of Python 2.7.6+, Node.js 8+, and Solidity 0.4.18. (Or Docker; see below.) Install the dependencies:
npm install npx
npm install
pip install -r requirements.txt
Note: on macOS, you need to use virtualenv or homebrew Python to work around System Integrity Protection.
Solidity contract deployment is handled by ContractDeployer.ts
and the wrapper programs located in source/deployment
. This deployment framework allows for incremental deploys of contracts to a given controller (specified via a configuration option). This allows us to deploy new contracts without touching the controller, effectively upgrading the deployed system in-place.
Travis CI is set up automatically deploy the contracts to the Rinkeby testnet after the tests run successfully. These deployments happen on a tagged version (release or pre-release) of augur-core, pushes changes to augur-contracts, and updates augur.js to match that new version of augur-contracts.
npm version prerelease
Deployment can be run in two modes, direct or Docker. In direct mode, the assumption is that the entire system has been built (TypeScript and Solidity), and there is a working Node.js environment locally. Furthermore, one must possess an account on the deployment target (e.g. Rinkeby testnet) which has enough ETH to cover the costs of the deployment. For the purposes of deploying to the testnets, those with access to the augur private testnet keys can deploy and update the existing contracts. For reference, these keys are stored in an encrypted git repository within the Augur Project's keybase team. If you need access, please inquire in the Augur Discord.
All deployment commands can be managed through scripts in package.json, and can be executed using npm run <command>
.
Build and create compile artifacts:
npm run build
Deploy to Rinkeby and push build artifacts: This is not using the dockerized commands, so that your local git and npm envs are used for the deployment. If you need to use the dockerized version you will need to pass:
a. GITHUB_DEPLOYMENT_TOKEN - set to a valid OAUTH token that allows pushing to github b. NPM_TOKEN - The auth token value from your ~/.npmrc after you've logged into NOM
RINKEBY_PRIVATE_KEY=$(cat ../keys/deploy_keys/rinkeby.prv) DEPLOY=true ARTIFACTS=true AUTOCOMMIT=true npm run deploy:rinkeby
(Note: commands in this section only should be run from your local augur-contracts folder, not from augur-core!)
Manual deployment generates artifacts in the output/contracts
directory. To merge these changes into augur-contracts, there are scripts located in the augur-contracts repository. In local deployments, this is not automatic.
To merge the local changes into augur-contracts:
SOURCE="path/to/augur-core/output/contracts" BRANCH=master npm run update-contracts
Next, update the version of augur-contracts:
npm version [<version>, major,minor,patch, prerelease]
git push && git push --tags
Finally, publish to NPM. If this is a pre-release tag, deploy it to the dev
channel. The dev
channel is the default for versions which are published from CI.
npm publish [--tag dev]
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:
pytest tests
This executes all the tests. To run a test individually, run the following:
pytest path/to/test_file.py -k '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.
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 test
npm run docker:test:integration
For quicker iteration on integration tests follow the instructions here to run tests locally against a node running in docker:
If the contracts aren't changing, after the first run you can add "AUGUR_CONTROLLER_ADDRESS": "..." to the env and it will even skip re-uploading the contracts with each run of the integration tests.
Augur's smart contracts are organized into four folders:
source/contracts/factories
: Constructors for universes, markets, fee windows, etc.source/contracts/libraries
: Data structures used elsewhere in the source code.source/contracts/reporting
: Creation and manipulation of universes, markets, fee 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 augur-core receives a total of 17 weekly downloads. As such, augur-core popularity was classified as not popular.
We found that augur-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.