readme and license touchup

This commit is contained in:
tim
2025-01-03 21:37:31 -04:00
parent 8422e4382a
commit 5fa52dd23e
2 changed files with 25 additions and 16 deletions

View File

@@ -9,4 +9,4 @@ The following directories of this repository contain third party code under sepa
See the LICENSE file under each of the above directories. See the LICENSE file under each of the above directories.
All other material not distributed under the third-party directories is All other material not distributed under the third-party directories is
Copyright ©2024 Dexorder LLC. All Rights Reserved. Copyright ©2025 Dexorder LLC. All Rights Reserved.

View File

@@ -5,6 +5,7 @@ These contracts power [⬆dexorder](https://dexorder.trade).
The heart of the system is contained in `OrderLib.sol`, particularly the `OrderLib.execute()` method. `Vaults` are The heart of the system is contained in `OrderLib.sol`, particularly the `OrderLib.execute()` method. `Vaults` are
basically thin wrappers around the `OrderLib`. basically thin wrappers around the `OrderLib`.
# Quickstart # Quickstart
The development environment is based on [Foundry](https://book.getfoundry.sh) toolset. The development environment is based on [Foundry](https://book.getfoundry.sh) toolset.
@@ -16,30 +17,34 @@ cp foundry-default.toml foundry.toml # edit to include your own RPC URLs
bin/build bin/build
``` ```
# Development # Development
## Error Codes ## Error Codes
All Dexorder error codes, along with a few error codes from Uniswap, are described in `doc/errors.md`. All Dexorder error codes, along with a few error codes from Uniswap, are described in `doc/errors.md`.
## Mock Environment ## Mock Environment
run `bin/mock` to spin up an Anvil node which forks Arbitrum in order to have the Uniswap v3 contracts available, run `bin/mock` to spin up an Anvil node which forks Arbitrum in order to have the Uniswap v3 contracts available,
deploys the essential Dexorder init contracts, and also deploys the `MockEnv` class, which contains two mock tokens deploys the essential Dexorder init contracts, and also deploys the `MockEnv` class, which contains two mock tokens
MEH and USXD along with a mock pool to trade that pair. See `test/MockEnv.sol`. MEH and USXD along with a mock pool to trade that pair. See `test/MockEnv.sol`.
### Mock Shell ### Mock Shell
Source `. bin/shmockenv` to populate these environment variables: Source `. bin/shmockenv` to populate these environment variables:
`MOCK` address of the MockEnv | Variable | Description |
`MEH` address of MEH token |-------------|--------------------------------------------------------------------------------------------|
`USXD` address of the USXD token | `MOCK` | Address of the MockEnv |
`POOL` address of the MEH/USXD pool | `MEH` | Address of MEH token |
`T0` address of token0 in the mock pool | `USXD` | Address of the USXD token |
`T1` address of token1 in the mock pool | `POOL` | Address of the MEH/USXD pool |
`INVERTED` true iff USXD is token 0 and MEH is token 1 (USXD/MEH) instead of the other way (MEH/USXD) | `T0` | Address of token0 in the mock pool |
`MIRRORENV` address of the MirrorEnv (if deployed) | `T1` | Address of token1 in the mock pool |
| `INVERTED` | True iff USXD is token 0 and MEH is token 1 (USXD/MEH) instead of the other way (MEH/USXD) |
| `MIRRORENV` | Address of the MirrorEnv (if deployed) |
There are also a few scripts available to manipulate the MockEnv: There are also a few scripts available to manipulate the MockEnv:
@@ -49,7 +54,6 @@ NOTE: this price is always expressed as MEH/USXD regardless of the order of thos
`bin/setprice <number>` adjusts the price of the mock pool by minting new tokens and swapping them. `bin/setprice <number>` adjusts the price of the mock pool by minting new tokens and swapping them.
NOTE: this sets the price of MEH in terms of USXD regardless of whether the pool is inverted. NOTE: this sets the price of MEH in terms of USXD regardless of whether the pool is inverted.
## Deployments ## Deployments
Solidity compiler output and Foundry broadcast files for each chain are found under deployment/*<tag>*. The `broadcast` Solidity compiler output and Foundry broadcast files for each chain are found under deployment/*<tag>*. The `broadcast`
@@ -91,6 +95,7 @@ Dexorder website to place orders. However, only the owner of a vault may place o
Standard `withdraw()` and `withdrawTo()` methods for both native coin and ERC20 tokens are available on the `IVault` Standard `withdraw()` and `withdrawTo()` methods for both native coin and ERC20 tokens are available on the `IVault`
interface. Withdrawal transactions must be signed by the vault's owner. interface. Withdrawal transactions must be signed by the vault's owner.
# Security Notes # Security Notes
The Vault itself is a proxy contract that points its external methods to a shared VaultImpl contract, which is The Vault itself is a proxy contract that points its external methods to a shared VaultImpl contract, which is
@@ -110,9 +115,13 @@ are always avaiable even after a kill switch.
The `execute()` method is intentionally public. It is expected to revert if any test of the order conditions fails. The `execute()` method is intentionally public. It is expected to revert if any test of the order conditions fails.
See `review.md` for more detail.
# Detailed Technical Overview
The [review.md](https://github.com/dexorder/contract/blob/main/review.md) file describes the architecture, motivation,
security issues, implementation details, and more.
# Support # Support
Create a new issue in this project using the `Question` tag, or join our [Discord](https://discord.gg/fqp9JXXQyt) for a Create a new issue in this project using the `Question` tag, or join our [Discord](https://discord.gg/fqp9JXXQyt).
more interactive experience.