-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
253 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,40 @@ | ||
# amm_dex_v2 | ||
# 😻 Minswap DEX V2 Contract | ||
|
||
Write validators in the `validators` folder, and supporting functions in the `lib` folder using `.ak` as a file extension. | ||
|
||
For example, as `validators/always_true.ak` | ||
|
||
```gleam | ||
validator { | ||
fn spend(_datum: Data, _redeemer: Data, _context: Data) -> Bool { | ||
True | ||
} | ||
} | ||
``` | ||
## Structure | ||
- Main contracts: | ||
- [Authen Minting Policy](/validators/authen_minting_policy.ak) | ||
- [Pool Factory Validator](/validators/factory_validator.ak) | ||
- [Liquidity Pool Validator](/validators/pool_validator.ak) | ||
- [Order Validator](/validators/order_validator.ak) | ||
- Library: under [library](/lib/amm_dex_v2) package | ||
|
||
## Building | ||
|
||
```sh | ||
aiken build | ||
``` | ||
### Prerequisites | ||
- Install [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) | ||
- Install [Aiken v1.0.24-alpha](https://aiken-lang.org/installation-instructions) | ||
- Run `aiken build` to double check scripts bytecode in `plutus.json` file | ||
- Run `npm install` to install necessary dependencies | ||
- Run `npm run exec src/build-plutus.ts` to build scripts with initial parameters. The result is `script.json` file | ||
|
||
## Testing | ||
|
||
You can write tests in any module using the `test` keyword. For example: | ||
|
||
```gleam | ||
test foo() { | ||
1 + 1 == 2 | ||
} | ||
``` | ||
|
||
To run all tests, simply do: | ||
|
||
```sh | ||
aiken check | ||
``` | ||
- Run `aiken check` to run all unit tests of the contract | ||
|
||
To run only tests matching the string `foo`, do: | ||
|
||
```sh | ||
aiken check -m foo | ||
``` | ||
## Deployment | ||
|
||
## Documentation | ||
### Testnet Preprod | ||
The smart contract has already been deployed on Testnet Preprod. | ||
|
||
If you're writing a library, you might want to generate an HTML documentation for it. | ||
The detailed information on the deployment is located in [References](/deployed/preprod/references.json) | ||
|
||
Use: | ||
## Audit Report | ||
|
||
```sh | ||
aiken docs | ||
``` | ||
The contract audit has been conducted by Certik and Anastasia Labs | ||
The Audit report is available under [Audit Report](/audit-report) folder | ||
|
||
## Resources | ||
## References | ||
|
||
Find more on the [Aiken's user manual](https://aiken-lang.org). | ||
1. [Specification](/amm-v2-docs/amm-v2-specs.md) | ||
2. [Formula](/amm-v2-docs/formula.md) |
Oops, something went wrong.