Skip to content

Commit

Permalink
Feat: Revert to one-step minter (#326)
Browse files Browse the repository at this point in the history
* ⏪ revert to one step

* ⏪ revert structure, contract and tests

* ✨ add two step minter in separate component

* 🧪 add 2-step mint contract and tests
  • Loading branch information
tekkac authored Jan 30, 2024
1 parent d8b3f22 commit 9a9d6fb
Show file tree
Hide file tree
Showing 10 changed files with 2,322 additions and 1,061 deletions.
31 changes: 3 additions & 28 deletions src/components/mint/interface.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ trait IMint<TContractState> {
fn get_max_value_per_tx(self: @TContractState) -> u256;
fn get_unit_price(self: @TContractState) -> u256;
fn get_reserved_value(self: @TContractState) -> u256;
fn get_remaining_value(self: @TContractState) -> u256;
fn get_available_value(self: @TContractState) -> u256;
fn get_max_value(self: @TContractState) -> u256;
fn get_whitelist_merkle_root(self: @TContractState) -> felt252;
fn get_whitelist_allocation(
self: @TContractState, account: ContractAddress, allocation: felt252, proof: Span<felt252>
) -> felt252;
fn get_claimed_value(self: @TContractState, account: ContractAddress) -> u256;
fn is_sold_out(self: @TContractState) -> bool;
fn is_canceled(self: @TContractState) -> bool;
fn set_whitelist_merkle_root(ref self: TContractState, whitelist_merkle_root: felt252);
fn set_public_sale_open(ref self: TContractState, public_sale_open: bool);
fn set_max_value_per_tx(ref self: TContractState, max_value_per_tx: u256);
Expand All @@ -34,35 +32,12 @@ trait IMint<TContractState> {
recipient: ContractAddress,
amount: u256
);
fn prebook(
fn pre_buy(
ref self: TContractState,
allocation: felt252,
proof: Span<felt252>,
value: u256,
force: bool
);
fn book(ref self: TContractState, value: u256, force: bool);
fn claim(ref self: TContractState, user_address: ContractAddress, id: u32);
fn refund(ref self: TContractState, user_address: ContractAddress, id: u32);
fn refund_to(
ref self: TContractState, to: ContractAddress, user_address: ContractAddress, id: u32
);
fn cancel(ref self: TContractState);
}

#[starknet::interface]
trait IL1Mint<TContractState> {
fn get_l1_minter_address(self: @TContractState) -> ContractAddress;
fn set_l1_minter_address(ref self: TContractState, l1_address: ContractAddress);
}

#[starknet::interface]
trait IL1Handler<TContractState> {
fn book_from_l1(
ref self: TContractState,
from_address: ContractAddress,
user_address: ContractAddress,
value: u256,
amount: u256,
);
fn public_buy(ref self: TContractState, value: u256, force: bool);
}
Loading

0 comments on commit 9a9d6fb

Please sign in to comment.