Skip to content

Commit

Permalink
docs: updating specs
Browse files Browse the repository at this point in the history
  • Loading branch information
HinsonSIDAN committed Dec 13, 2023
1 parent dcee592 commit 574ef47
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

- [x] 1. OracleNFT
- [ ] 2. OracleValidator
- [ ] 3. AccountRefToken
- [ ] 4. AccountInfoValidator
- [ ] 3. FeeRefToken
- [ ] 4. FeeInfoValidator
- [ ] 5. TradeAccount
- [ ] 6. ChangeAccount
- [ ] 7. VirtualDEX
Expand All @@ -21,8 +21,8 @@

- [x] 1. Unit tests - OracleNFT
- [ ] 2. Unit tests - OracleValidator
- [ ] 3. Unit tests - AccountRefToken
- [ ] 4. Unit tests - AccountInfoValidator
- [ ] 3. Unit tests - FeeRefToken
- [ ] 4. Unit tests - FeeInfoValidator
- [ ] 5. Unit tests - TradeAccount
- [ ] 6. Unit tests - ChangeAccount
- [ ] 7. Unit tests - VirtualDEX
Expand Down
2 changes: 1 addition & 1 deletion lib/aiken-virtual-dex/types.ak
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub type TradeAddressRedeemer {

// 6. ChangeAccount
pub type ChangeAddressDatum {
ChangeNormalDatum
ChangeAddressDatum
}

pub type ChangeAddressRedeemer {
Expand Down
11 changes: 11 additions & 0 deletions specs/0_scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,14 @@ There are in total 7 scripts for the DeltaDeFi virtual dex to work. Below provid
8. EmergencyToken - [specification](./emergency_token.md)

- The minting policy for taking any withdrawal / cancel actions solely by users.

## Param Dependency Graph

- `EmergencyToken`
- `utxo_ref` from admin wallet
- `OracleNFT`
- `FeeRefToken`
- `VirtualDEX`
- `FeeInfoValidator`
- `TradeAccount`
- `ChangeAccount`
2 changes: 1 addition & 1 deletion specs/5_trade_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@

- Signed by owner
- Validity range is after `valid_since`
- `EmergencyToken` is burnt in current transaction
- `EmergencyToken` with correct token name of hash of current address is burnt in current transaction
6 changes: 1 addition & 5 deletions specs/6_change_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@

## Datum

1. ChangeNormalDatum
1. ChangeAddressDatum

- Stating that the UTxO is ready for normal app operation, including placing orders, taking orders and authorized withdrawal

2. ChangeEmergencyDatum {valid_since}

- Stating that the UTxO is attached with an emergency token, ready for user withdrawal without passing through application logic

## User Action

1. Owner withdraws the amount from change address - Redeemer `OwnerWithdraw`
Expand Down
3 changes: 2 additions & 1 deletion specs/7_virtual_dex.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Parameter

- `oracle_nft`: The policy id of `OracleNFT`
- `fee_ref_token`: The policy id of `FeeRefToken`

## Datum

Expand Down Expand Up @@ -33,4 +34,4 @@

4. Emergency operation - Redeemer `EmergencyCancel`

- `EmergencyToken` coming from the same address as `trade_account_address` burnt in current transaction
- `EmergencyToken` with token name hashing `trade_account_address` burnt in current transaction
4 changes: 2 additions & 2 deletions specs/8_emergency_token.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
## Parameter

- `owner`: The pub key has of account owner
- `trade_account_address`: The address of the owner's trade account

## User Action

1. Mint - Redeemer `EMint {current_timestamp}`
1. Mint - Redeemer `EMint {current_timestamp, trade_account_address}`

- The `AssetName` must be in form of hash of `ValidatorHash` + `StakeCredentialHash`
- There must be 1 output to `trade_account_address`
- The output datum to `trade_account_address` with `valid_since` after current signing interval
- Must be signed by owner
Expand Down

0 comments on commit 574ef47

Please sign in to comment.