2.58.0 • Published 17 days ago

@uma/core v2.58.0

Weekly downloads
2,085
License
AGPL-3.0-or-later
Repository
github
Last release
17 days ago

@uma/core

This package contains contract artifacts for all UMA smart contracts. It contains the following sets of smart contracts within the contracts directory:

Directory NameDescription
commonCommon contracts re-used between diffrent contract implementations within this repo.
cross-chain-oracleContracts to enable the UMA DVM to reach a number of side-chains & rollups.
data-verification-mechanismSchelling point commit reveal oracle used to arbitrate disputes in downstream escalation games.
externalExternal integration points from projects integrated into UMA core contracts.
finanical-templatesFinancial contracts built on top of UMA's Oracle. Include Synthetic tokens (fixed term and perpetual), Long-short-pair(on-chain contract for diffrence) and a number of other mechanisms used to build on-chain incentive systems.
gnosis-zodiacGnosis Safe Zodiac integration enabling an Optimistic Oracle powered multisig deployments.
merkle-distributorContracts enabling token distribution via merkle distribution and claim process.
optimistic-oracle-v2Optimistic oracle mechanism, used to bring data on-chain. Highly suited for complex, longtailed, time insensitive data such as prediction markets, insurance products and complex cross-chain applications.
optimistic-oracle-v3Next iteration of optimistic oracle pattern wherein assertions are about the state of the world which are optimistically verified. Uses "sovereign security" to enable bespoke security models and design patterns over what is possible with other optimistic oracle designs..
polygon-cross-chain-oracleSimilar to cross-chain-oracle contracts, except just supports polygon. Kept for legacy reasons.
proxy-scripts"Script" smart contracts, used in conjunction with DSProxy based actors.
umip-helpersSmart contracts used in UMIPs, such as upgrading the DVM.

Installing the package

Note: this package should rarely be installed by third parties. For abi, bytecode, and official addresses, please use the @uma/contracts-node or @uma/contracts-frontend packages.

This package should be primarily used to access the full contract source code where necessary. The contracts are available in contracts/. If you need direct access to the hardhat artifacts, they are available under artifacts/.

yarn add @uma/core

Deploying the contracts

To deploy the contracts, we use the hardhat-deploy package. This may be familiar to users of hardhat. The deployment process is faily simple, as a result.

To deploy the entire UMA system on a network of your choice:

export MNEMONIC="Your 12-word phrase here"
export CUSTOM_NODE_URL="Your node url here"
yarn hardhat deploy --network kovan

To deploy a particular contract (along with any dependencies that haven't been deployed on this network):

export MNEMONIC="Your 12-word phrase here"
export CUSTOM_NODE_URL="Your node url here"
yarn hardhat deploy --network kovan --tags LongShortPairCreator

Note: other tags, like dvm, exist to deploy subsets of contracts.

To perform an etherscan verification on a particular contract address that you have deployed on a public network:

export ETHERSCAN_API_KEY="Your etherscan api key here"
export CUSTOM_NODE_URL="Your node url here"
yarn hardhat verify "Your contract address here" --network kovan

To perform a verification on all the contracts you have deployed on a particular network:

export CUSTOM_NODE_URL="Your node url here"
export ETHERSCAN_API_KEY="Your etherscan api key here"
yarn hardhat etherscan-verify --network kovan --license AGPL-3.0 --force-license

To add a contract to the official UMA deployments, find the networks/[chainId].json file, and update an existing contract entry or add a new one.

The following commands are implemented as hardhat tasks that make it easy to interact with deployed contracts via the CLI:

Registers the deployer account (as defined in the namedAccounts param in hardhat.config.js) with the deployed Registry for the network. Optionally registers a custom account.

export MNEMONIC="Your 12-word phrase here"
export CUSTOM_NODE_URL="Your node url here"
yarn hardhat register-accounts --network <NETWORK-NAME> --account <CUSTOM-ACCOUNT>

Whitelist hardcoded identifiers from the config/identifiers.json file. Optionally whitelists a custom identifier.

export MNEMONIC="Your 12-word phrase here"
export CUSTOM_NODE_URL="Your node url here"
yarn hardhat whitelist-identifiers --network <NETWORK-NAME> --id <CUSTOM-IDENTIFIER>

Sets specified contracts in the deployed Finder. More contracts available to be set can be found in the common/hardhat/tasks/finder.js script.

export MNEMONIC="Your 12-word phrase here"
export CUSTOM_NODE_URL="Your node url here"
yarn hardhat setup-finder --network <NETWORK-NAME> --registry --bridge --generichandler

Integration tests

Some contracts, such as the Insured bridge, contain end to end integration tests that are run differently to the rest of core's tests. Running these specific tests can be done as follows:

cd ../.. # navigate to the root of the protocol repo
yarn optimism-up # start the optimism containers. note this will take a long time as a few containers need to be built
cd ./packages/core # move back to this package
yarn test-e2e # run the end to end tests against the optimism containers.
2.58.0

17 days ago

2.57.0

2 months ago

2.56.0

9 months ago

2.56.1

7 months ago

2.56.2

6 months ago

2.53.0

1 year ago

2.55.0

1 year ago

2.54.0

1 year ago

2.52.0

1 year ago

2.51.0

1 year ago

2.46.0

1 year ago

2.48.0

1 year ago

2.45.0

1 year ago

2.47.0

1 year ago

2.49.0

1 year ago

2.50.0

1 year ago

2.44.0

1 year ago

2.38.0

2 years ago

2.43.0

1 year ago

2.43.2

1 year ago

2.43.1

1 year ago

2.41.0

1 year ago

2.39.0

1 year ago

2.37.1

2 years ago

2.40.0

1 year ago

2.36.0

2 years ago

2.37.0

2 years ago

2.35.0

2 years ago

2.32.0

2 years ago

2.34.0

2 years ago

2.33.0

2 years ago

2.29.0

2 years ago

2.30.0

2 years ago

2.31.0

2 years ago

2.28.3

2 years ago

2.27.0

2 years ago

2.28.1

2 years ago

2.28.0

2 years ago

2.28.2

2 years ago

2.26.0

2 years ago

2.25.0

2 years ago

2.24.1

2 years ago

2.24.0

2 years ago

2.25.1

2 years ago

2.23.0

2 years ago

2.17.0

2 years ago

2.18.0

2 years ago

2.16.0

2 years ago

2.15.1

2 years ago

2.21.0

2 years ago

2.20.0

2 years ago

2.22.0

2 years ago

2.15.0

2 years ago

2.14.1

2 years ago

2.13.0

2 years ago

2.14.0

2 years ago

2.11.0

3 years ago

2.12.0

3 years ago

2.10.0

3 years ago

2.9.0

3 years ago

2.8.0

3 years ago

2.7.0

3 years ago

2.6.0

3 years ago

2.5.0

3 years ago

2.5.0-beta.0

3 years ago

2.4.0

3 years ago

2.3.0-alpha.0

3 years ago

2.3.0-alpha.1

3 years ago

2.3.0

3 years ago

2.3.0-beta.0

3 years ago

2.2.0

3 years ago

2.2.0-alpha.0

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

2.0.0-alpha.1

3 years ago

2.0.0-alpha.0

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

4 years ago

1.0.0

4 years ago