Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include the Extra Data to Order Datum #53

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions amm-v2-docs/amm-v2-specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ An Order Datum keeps information about Order Type and some other informations:
- _step_: The information about Order Type which we mentioned above
- _max_batcher_fee_: The maximum fee users have to pay to Batcher to execute batching transaction. The actual fee Batcher will take might be less than the maximum fee
- _expired_setting_opt_: contain Order Expired time and max tip for cancelling expired order. If the order is not executed after Expired Time, anyone can help the owner cancel it
- _extra_data_: The extra data of the order contract. Its scope is not defined yet but it will be used on the future features of Order contract. Pool contract can safely ignore this field. It will only be used by future Order contracts and external contracts that are integrated with future Order contract.


#### 3.3.2.3 Redeemer
Expand Down
2 changes: 2 additions & 0 deletions lib/amm_dex_v2/order_validation.ak
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,7 @@ pub fn apply_orders(
max_batcher_fee,
lp_asset: order_lp_asset,
expiry_setting_opt,
extra_data,
} = order_in_datum
expect and {
// max_batcher_fee must be positive
Expand Down Expand Up @@ -1612,6 +1613,7 @@ pub fn apply_orders(
},
max_batcher_fee: max_batcher_fee - used_batcher_fee,
expiry_setting_opt,
extra_data,
}
and {
expected_order_out_datum == order_out_datum,
Expand Down
4 changes: 4 additions & 0 deletions lib/amm_dex_v2/types.ak
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ pub type OrderDatum {
// - Order Expired time: If the order is not executed after Expired Time, anyone can help the owner cancel it
// - Max tip for cancelling expired order
expiry_setting_opt: Option<(Int, Int)>,
// The extra data of the order contract
// Its scope is not defined yet but it will be used on the future features of Order contract
// Pool contract can safely ignore this field. It will only be used by future Order contracts and external contracts that are integrated with future Order contract.
extra_data: Option<Data>,
}

pub type OrderRedeemer {
Expand Down
Loading
Loading