Skip to content

Commit

Permalink
Update params
Browse files Browse the repository at this point in the history
  • Loading branch information
0xandee committed Mar 11, 2024
1 parent 508873a commit a7a0257
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
13 changes: 11 additions & 2 deletions deployment-script/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function deploy() {
const compiledCurrencyManagerCasm = json.parse(fs.readFileSync("../target/dev/flex_CurrencyManager.compiled_contract_class.json").toString("ascii"))
const compiledCurrencyManagerSierra = json.parse(fs.readFileSync("../target/dev/flex_CurrencyManager.contract_class.json").toString("ascii"))
const currencyManagerCallData: CallData = new CallData(compiledCurrencyManagerSierra.abi)
const currencyManagerConstructor: Calldata = currencyManagerCallData.compile("constructor", { owner: account0.address, proxy_admin: account0.address })
const currencyManagerConstructor: Calldata = currencyManagerCallData.compile("constructor", { owner: account0.address })
const deployCurrencyManagerResponse = await account0.declareAndDeploy({
contract: compiledCurrencyManagerSierra,
casm: compiledCurrencyManagerCasm,
Expand Down Expand Up @@ -117,7 +117,16 @@ async function deploy() {
const compiledMarketplaceCasm = json.parse(fs.readFileSync("../target/dev/flex_MarketPlace.compiled_contract_class.json").toString("ascii"))
const compiledMarketplaceSierra = json.parse(fs.readFileSync("../target/dev/flex_MarketPlace.contract_class.json").toString("ascii"))
const marketplaceCallData: CallData = new CallData(compiledMarketplaceSierra.abi)
const marketplaceConstructor: Calldata = marketplaceCallData.compile("constructor", { hash: "1161338756782444142862655110517618273593182489677642162506529284371874760008", recipient: account0.address, currency: deployCurrencyManagerResponse.deploy.contract_address, execution: deployExecutionManagerResponse.deploy.contract_address, royalty_manager: deployRoyaltyFeeManagerResponse.deploy.contract_address, checker: deploySignatureChecker2Response.deploy.contract_address, owner: account0.address, proxy_admin: account0.address })
const marketplaceConstructor: Calldata = marketplaceCallData.compile("constructor", {
domain_name: "Flex",
domain_ver: "1",
recipient: account0.address,
currency: deployCurrencyManagerResponse.deploy.contract_address,
execution: deployExecutionManagerResponse.deploy.contract_address,
royalty_manager: deployRoyaltyFeeManagerResponse.deploy.contract_address,
checker: deploySignatureChecker2Response.deploy.contract_address,
owner: account0.address
})
const deployMarketplaceResponse = await account0.declareAndDeploy({
contract: compiledMarketplaceSierra,
casm: compiledMarketplaceCasm,
Expand Down
3 changes: 1 addition & 2 deletions deployment-script/deploymentMarketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ async function deploy() {
execution: "0x506e8991aa19400ea8d0e2170d32253592452c31928ca4255b3f0138a42753c",
royalty_manager: "0x15847ab0292274d7c559e25bdf73b015d92c7d5be08bb1560aa0ff9380ec86a",
checker: "0x03b6ae6c8f0c9042398b2692c655180610cba4a58fd49bef49a8cead68bf14f5",
owner: account0.address,
proxy_admin: account0.address
owner: account0.address
})
const deployMarketplaceResponse = await account0.declareAndDeploy({
contract: compiledMarketplaceSierra,
Expand Down
9 changes: 4 additions & 5 deletions src/marketplace/currency_manager.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use starknet::ContractAddress;

#[starknet::interface]
trait ICurrencyManager<TState> {
fn initializer(ref self: TState, owner: ContractAddress, proxy_admin: ContractAddress);
fn initializer(ref self: TState, owner: ContractAddress);
fn add_currency(ref self: TState, currency: ContractAddress);
fn remove_currency(ref self: TState, currency: ContractAddress);
fn is_currency_whitelisted(self: @TState, currency: ContractAddress) -> bool;
Expand Down Expand Up @@ -57,16 +57,15 @@ mod CurrencyManager {
#[constructor]
fn constructor(
ref self: ContractState,
owner: ContractAddress,
proxy_admin: ContractAddress
owner: ContractAddress
) {
self.initializer(owner, proxy_admin);
self.initializer(owner);
}

#[external(v0)]
impl CurrencyManagerImpl of super::ICurrencyManager<ContractState> {
fn initializer(
ref self: ContractState, owner: ContractAddress, proxy_admin: ContractAddress
ref self: ContractState, owner: ContractAddress
) {
assert!(!self.initialized.read(), "CurrencyManager: already initialized");
self.initialized.write(true);
Expand Down
2 changes: 1 addition & 1 deletion src/marketplace/signature_checker.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use flex::marketplace::utils::order_types::MakerOrder;

#[starknet::interface]
trait ISignatureChecker<TState> {
fn initializer(ref self: TState, proxy_admin: ContractAddress);
fn initializer(ref self: TState);
fn compute_maker_order_hash(self: @TState, hash_domain: felt252, order: MakerOrder) -> felt252;
fn verify_maker_order_signature(
self: @TState, hash_domain: felt252, order: MakerOrder, order_signature: Span<felt252>
Expand Down

0 comments on commit a7a0257

Please sign in to comment.