@dolomite-exchange/v2-protocol v1.0.11
Ethereum Smart Contracts and TypeScript library used for the Dolomite Trading Protocol. Currently used by app.dolomite.io
Full Documentation at legacy-docs.dydx.exchange
Table of Contents
Documentation
Check out our full documentation at legacy-docs.dydx.exchange
Install
npm i -s @dolomite-exchange/solo
Contracts
Mainnet
Contract Name | Description | Address |
---|---|---|
SoloMargin | Main dYdX contract | |
PayableProxyForSoloMargin | WETH wrapper proxy | |
PolynomialInterestSetter | Sets interest rates | |
Expiry | Handles account expiries | |
ExpiryV2 | Handles account expiries (version 2) | |
ChainlinkPriceOracleV1 | Price oracle for all assets, utilizing Chainlink | |
AdminImpl | SoloMargin library containing admin functions | |
OperationImpl | SoloMargin library containing operation functions | |
LiquidatorProxyV1ForSoloMargin | Proxy contract for liquidating other accounts | |
LiquidatorProxyV1WithAmmForSoloMargin | Proxy contract for liquidating other accounts and automatically selling collateral using Dolomite's AMM pools | |
LimitOrders | Contract for making limit orders using Dolomite funds | |
StopLimitOrders | Contract for making stop limit orders using Dolomite funds | |
CanonicalOrders | Contract for making canonical limit and canonical stop-limit orders using Dolomite funds | |
DolomiteAmmRouterProxy | Routing contract for trading against Dolomite AMM pools | |
SignedOperationProxy | Contract for sending signed operations on behalf of another account owner | |
TransferProxy | Contract for transferring funds within Dolomite to other users | |
Refunder | Allows sending of funds to other accounts | |
SimpleFeeOwner | Owns the admin fees that are accrued by AMM liquidity providers (LPs) | |
UniswapV2Factory | The factory responsible for deploying new AMM pools | |
UniswapV2Pair | A templated AMM pool that allows users to trade with on-chain liquidity. These pools are natively integrated with Solo, so LPs also accrue interest from borrowers |
Security
Independent Audits
The smart contracts were audited independently by both Zeppelin Solutions and Bramah Systems.
Zeppelin Solutions Audit Report
Code Coverage
All production smart contracts are tested and have 100% line and branch coverage.
Vulnerability Disclosure Policy
The disclosure of security vulnerabilities helps us ensure the security of our users.
How to report a security vulnerability?
If you believe you’ve found a security vulnerability in one of our contracts or platforms, send it to us by emailing security@dolomite.io. Please include the following details with your report:
A description of the location and potential impact of the vulnerability.
A detailed description of the steps required to reproduce the vulnerability.
Scope
Any vulnerability not previously disclosed by us or our independent auditors in their reports.
Guidelines
We require that all reporters:
Make every effort to avoid privacy violations, degradation of user experience, disruption to production systems, and destruction of data during security testing.
Use the identified communication channels to report vulnerability information to us.
Keep information about any vulnerabilities you’ve discovered confidential between yourself and dYdX until we’ve had 30 days to resolve the issue.
If you follow these guidelines when reporting an issue to us, we commit to:
Not pursue or support any legal action related to your findings.
Work with you to understand and resolve the issue quickly (including an initial confirmation of your report within 72 hours of submission).
Grant a monetary reward based on the OWASP risk assessment methodology.
Development
Compile Contracts
Requires a running docker engine.
npm run build
Compile TypeScript
npm run build:js
Test
Requires a running docker engine.
Start test node:
docker-compose up
Deploy contracts to test node & run tests:
npm test
Just run tests (contracts must already be deployed to test node):
npm run test_only
Just deploy contracts to test node:
npm run deploy_test
Contributing
You may open a pull request with any added or modified code. The pull request should state the rationale behind any changes or the motivation behind any additions. All pull requests should contain adequate test coverage too.
Maintainers
Corey Caplan @coreycaplan3
corey@dolomite.io
Adam Knuckey @aknuck
adam@dolomite.io