Skip to content

Commit 61d6c27

Browse files
committed
add forward callback data structs
1 parent ec8c67b commit 61d6c27

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Diff for: src/extensions/interfaces/twamm.cairo

+22
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,28 @@ pub struct SaleRateState {
3333
pub last_virtual_order_time: u64
3434
}
3535

36+
#[derive(Serde, Copy, Drop)]
37+
pub struct UpdateSaleRateCallbackData {
38+
pub salt: felt252,
39+
pub order_key: OrderKey,
40+
pub sale_rate_delta: i129,
41+
}
42+
43+
#[derive(Serde, Copy, Drop)]
44+
pub struct CollectProceedsCallbackData {
45+
pub salt: felt252,
46+
pub order_key: OrderKey,
47+
}
48+
49+
#[derive(Serde, Copy, Drop)]
50+
pub enum ForwardCallbackData {
51+
// Returns an i129 representing the token delta required to update the sale rate, e.g. positive
52+
// for increases and negative for decreases
53+
UpdateSaleRate: UpdateSaleRateCallbackData,
54+
// Returns a u128 representing the amount of proceeds collected
55+
CollectProceeds: CollectProceedsCallbackData
56+
}
57+
3658
#[starknet::interface]
3759
pub trait ITWAMM<TContractState> {
3860
// Return the current state of the given order

0 commit comments

Comments
 (0)