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

bodies for functions + fixed types + added Display Debug 4 ContractAddress #22

Merged
merged 1 commit into from
Dec 25, 2023
Merged
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
16 changes: 15 additions & 1 deletion flex_marketplace/src/lib.cairo
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
use core::fmt::{Display, Error, Formatter, Debug};

impl DisplayContractAddress of Display<starknet::ContractAddress> {
fn fmt(self: @starknet::ContractAddress, ref f: Formatter) -> Result<(), Error> {
write!(f, "{}", *self)
}
}

impl DebugContractAddress of Debug<starknet::ContractAddress> {
fn fmt(self: @starknet::ContractAddress, ref f: Formatter) -> Result<(), Error> {
Display::fmt(self, ref f)
}
}

mod marketplace {
mod launchpad {
mod ERC721_launchpad_migrated;
Expand All @@ -21,7 +35,7 @@ mod marketplace {
mod currency_manager;
mod ERC721_flex;
mod execution_manager;
mod market_place;
mod marketplace;
mod proxy;
mod royalty_fee_manager;
mod royalty_fee_registry;
Expand Down
12 changes: 6 additions & 6 deletions flex_marketplace/src/marketplace/execution_manager.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ use starknet::ContractAddress;
#[starknet::interface]
trait IExecutionManager<TState> {
fn initializer(ref self: TState, owner: ContractAddress, proxy_admin: ContractAddress);
fn add_strategy(ref self: TState, strategy: felt252);
fn remove_strategy(ref self: TState, strategy: felt252);
fn add_strategy(ref self: TState, strategy: ContractAddress);
fn remove_strategy(ref self: TState, strategy: ContractAddress);
fn transfer_ownership(ref self: TState, new_owner: ContractAddress);
fn owner(self: @TState) -> ContractAddress;
fn is_strategy_whitelisted(self: @TState, strategy: felt252) -> bool;
fn is_strategy_whitelisted(self: @TState, strategy: ContractAddress) -> bool;
fn get_whitelisted_strategies_count(self: @TState) -> usize;
fn get_whitelisted_strategy(self: @TState, index: usize) -> felt252;
}
Expand Down Expand Up @@ -60,10 +60,10 @@ mod ExecutionManager {
) { // TODO
}

fn add_strategy(ref self: ContractState, strategy: felt252) { // TODO
fn add_strategy(ref self: ContractState, strategy: ContractAddress) { // TODO
}

fn remove_strategy(ref self: ContractState, strategy: felt252) { // TODO
fn remove_strategy(ref self: ContractState, strategy: ContractAddress) { // TODO
}

fn transfer_ownership(ref self: ContractState, new_owner: ContractAddress) { // TODO
Expand All @@ -74,7 +74,7 @@ mod ExecutionManager {
contract_address_const::<0>()
}

fn is_strategy_whitelisted(self: @ContractState, strategy: felt252) -> bool {
fn is_strategy_whitelisted(self: @ContractState, strategy: ContractAddress) -> bool {
// TODO
true
}
Expand Down
Loading
Loading