diff --git a/README.md b/README.md index f71fa4b..2dbdf76 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ - [x] 1. OracleNFT - [ ] 2. OracleValidator - - [ ] 3. AccountRefToken - - [ ] 4. AccountInfoValidator + - [ ] 3. FeeRefToken + - [ ] 4. FeeInfoValidator - [ ] 5. TradeAccount - [ ] 6. ChangeAccount - [ ] 7. VirtualDEX @@ -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 diff --git a/lib/aiken-virtual-dex/types.ak b/lib/aiken-virtual-dex/types.ak index 79cd971..cdd791d 100644 --- a/lib/aiken-virtual-dex/types.ak +++ b/lib/aiken-virtual-dex/types.ak @@ -51,7 +51,7 @@ pub type TradeAddressRedeemer { // 6. ChangeAccount pub type ChangeAddressDatum { - ChangeNormalDatum + ChangeAddressDatum } pub type ChangeAddressRedeemer { diff --git a/specs/0_scripts.md b/specs/0_scripts.md index 2055a62..fb6ca9c 100644 --- a/specs/0_scripts.md +++ b/specs/0_scripts.md @@ -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` diff --git a/specs/5_trade_account.md b/specs/5_trade_account.md index ac9f757..06ca4e7 100644 --- a/specs/5_trade_account.md +++ b/specs/5_trade_account.md @@ -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 diff --git a/specs/6_change_account.md b/specs/6_change_account.md index fcd4bce..b3e4cde 100644 --- a/specs/6_change_account.md +++ b/specs/6_change_account.md @@ -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` diff --git a/specs/7_virtual_dex.md b/specs/7_virtual_dex.md index ca951f5..68f3b30 100644 --- a/specs/7_virtual_dex.md +++ b/specs/7_virtual_dex.md @@ -3,6 +3,7 @@ ## Parameter - `oracle_nft`: The policy id of `OracleNFT` +- `fee_ref_token`: The policy id of `FeeRefToken` ## Datum @@ -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 diff --git a/specs/8_emergency_token.md b/specs/8_emergency_token.md index 86cb5de..02f51c3 100644 --- a/specs/8_emergency_token.md +++ b/specs/8_emergency_token.md @@ -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