-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
strategy_standard_sale_for_fixed_price.cairo converted to cairo1 (#23)
* strategy_standard_sale_for_fixed_price.cairo converted to cairo1 * snake_case naming+struct def changed+removed imports * scarb fmt on order types * protocol_fee return keyword dropped
Showing
2 changed files
with
69 additions
and
30 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
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,7 +1,28 @@ | ||
#[derive(Drop, Serde)] | ||
struct MakerOrder { // TODO | ||
use starknet::ContractAddress; | ||
|
||
#[derive(Copy, Drop, Serde)] | ||
struct MakerOrder { | ||
is_order_ask: bool, // 1 = ask / 0 = bid | ||
signer: ContractAddress, // signer of the maker order | ||
collection: ContractAddress, // collection address | ||
price: u128, | ||
token_id: u256, | ||
amount: u128, // amount of tokens to sell/purchase (must be 1 for ERC721, 1+ for ERC1155) | ||
strategy: ContractAddress, // strategy address for trade execution (e.g. StandardSaleForFixedPrice) | ||
currency: ContractAddress, // currency address | ||
nonce: u128, // order nonce (must be unique unless new maker order is meant to override existing one e.g. lower ask price) | ||
start_time: u64, // startTime in timestamp | ||
end_time: u64, // endTime in timestamp | ||
min_percentage_to_ask: u128, // slippage protection (9000 = 90% of the final price must return to ask) | ||
params: felt252, | ||
} | ||
|
||
#[derive(Drop, Serde)] | ||
struct TakerOrder { // TODO | ||
#[derive(Copy, Drop, Serde)] | ||
struct TakerOrder { | ||
is_order_ask: bool, // 1 = ask / 0 = bid | ||
taker: ContractAddress, // caller | ||
price: u128, // final price for the purchase | ||
token_id: u256, | ||
min_percentage_to_ask: u128, // slippage protection (9000 = 90% of the final price must return to ask) | ||
params: felt252, | ||
} |