Skip to content

Commit

Permalink
solis: remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
ybensacq committed Mar 13, 2024
1 parent bd8fac0 commit cce44ba
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 618 deletions.
2 changes: 1 addition & 1 deletion contracts.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"goerli":{"nftContract":"0x22411b480425fe6e627fdf4d1b6ac7f8567314ada5617a0a6d8ef3e74b69436","messaging":"0x2c3d3e0c37d29364a13ba8cff046e7bc5624655a72526961876a1c8bb3f63c8","executor":"0x73148536f8ea9546e92761d11515548cc433df46883d5ee98871a6f63a0bbbc","orderbook":"0x66f1e6acf9bdbd23837b2eea271430298b355c506978edb132737e7fcb6b310"},"sepolia":{},"mainnet":{},"dev":{"messaging":"0x39158ac23c270863af623b7f3f9f5d4d723406df4e7b6153bd2a81ea320304d","executor":"0xf15cf88c171ed5c762b895331319ca57177cf31f575c76536e7657c8874bc6","nftContract":"0x5672baf1f4f06d36ef564ace9248b7df377ec112853aa605dd51bbd006323a7","eth":"0x144a0c8ae6e665dc3652e164ba2881eda87ad9cb5dcc93d30ca6d61b818014c","orderbook":"0x47be7c3b8503580aca1999774a9b0be1a79a2a60fd1f01b10eb28be8f8107ad"}}
{"goerli":{"nftContract":"0x22411b480425fe6e627fdf4d1b6ac7f8567314ada5617a0a6d8ef3e74b69436","messaging":"0x2c3d3e0c37d29364a13ba8cff046e7bc5624655a72526961876a1c8bb3f63c8","executor":"0x73148536f8ea9546e92761d11515548cc433df46883d5ee98871a6f63a0bbbc","orderbook":"0x66f1e6acf9bdbd23837b2eea271430298b355c506978edb132737e7fcb6b310"},"sepolia":{},"mainnet":{},"dev":{"messaging":"0x28f42924c72d2d444be20e715d0b5c97544b22e3147002d67bd59232187bc3","executor":"0x24457c33d887b2b3c6a9dd1d65205e1b1796e97537d5ee1e291012bb68ee382","nftContract":"0x64e73de9240ba05218b7e8fe53d1f9a3bae51791c5c5b6746fa7dae2e912764","eth":"0x144a0c8ae6e665dc3652e164ba2881eda87ad9cb5dcc93d30ca6d61b818014c","orderbook":"0x6404d0ba6809a56549bd132573e39170d0134c74a21b06375352c2cfd1c54d8"}}
8 changes: 4 additions & 4 deletions crates/solis/messaging.local.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"chain": "starknet",
"rpc_url": "http://127.0.0.1:5050",
"contract_address": "0x38e142d3d69cfe6757fd9d11704652f6bd8302dd23f483555e9b5698bf69d5",
"sender_address": "0x2d71e9c974539bb3ffb4b115e66a23d0f62a641ea66c4016e903454c8753bbc",
"private_key": "0x33003003001800009900180300d206308b0070db00121318d17b5e6262150b",
"contract_address": "0x28f42924c72d2d444be20e715d0b5c97544b22e3147002d67bd59232187bc3",
"sender_address": "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03",
"private_key": "0x1800000000300000180000000000030000000000003006001800006600",
"interval": 2,
"from_block": 0
}
}
15 changes: 0 additions & 15 deletions crates/solis/src/error.rs

This file was deleted.

36 changes: 1 addition & 35 deletions crates/solis/src/hooker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,40 +339,6 @@ impl<P: Provider + Sync + Send + 'static + std::fmt::Debug> KatanaHooker for Sol
current_owner: cainome::cairo_serde::ContractAddress(execution_info.nft_from.into()),
};

let owner_ship_verification = self.verify_ownership(&verifier).await;
if !owner_ship_verification {
println!("verify ownership for starknet before failed");
return false;
}

if !self
.verify_balance(&BalanceVerifier {
currency_address: ContractAddress(execution_info.payment_currency_address.into()),
offerer: cainome::cairo_serde::ContractAddress(execution_info.nft_to.into()),
start_amount: U256 {
low: execution_info.payment_amount.low,
high: execution_info.payment_amount.high,
},
})
.await
{
return false;
}

let execution_info = match ExecutionInfo::cairo_deserialize(&call.calldata, 0) {
Ok(execution_info) => execution_info,
Err(e) => {
tracing::error!("Fail deserializing ExecutionInfo: {:?}", e);
return false;
}
};

let verifier = OwnershipVerifier {
token_address: ContractAddress(execution_info.nft_address.into()),
token_id: execution_info.nft_token_id,
current_owner: cainome::cairo_serde::ContractAddress(execution_info.nft_to.into()),
};

let owner_ship_verification = self.verify_ownership(&verifier).await;
if !owner_ship_verification {
// rollback the status
Expand All @@ -386,7 +352,7 @@ impl<P: Provider + Sync + Send + 'static + std::fmt::Debug> KatanaHooker for Sol
if !self
.verify_balance(&BalanceVerifier {
currency_address: ContractAddress(execution_info.payment_currency_address.into()),
offerer: cainome::cairo_serde::ContractAddress(execution_info.nft_from.into()),
offerer: cainome::cairo_serde::ContractAddress(execution_info.nft_to.into()),
start_amount: U256 {
low: execution_info.payment_amount.low,
high: execution_info.payment_amount.high,
Expand Down
11 changes: 5 additions & 6 deletions crates/solis/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ use args::KatanaArgs;

//mod args;
mod contracts;
mod error;
mod hooker;
mod solis_args;

Expand Down Expand Up @@ -146,18 +145,18 @@ fn print_intro(accounts: String, seed: String, address: String, account_class_ha
Style::new().blue().apply_to(
r"
___ ___ | (_)___
___ ___ | (_)___
/ __|/ _ \| | / __|
\__ \ (_) | | \__ \
|___/\___/|_|_|___/
|___/\___/|_|_|___/
"
)
);

println!(
r"
PREDEPLOYED CONTRACTS
==================
PREDEPLOYED CONTRACTS
==================
| Contract | Fee Token
| Address | {}
Expand All @@ -178,7 +177,7 @@ PREDEPLOYED CONTRACTS
);

println!(
r"
r"
PREFUNDED ACCOUNTS
==================
{accounts}
Expand Down
8 changes: 7 additions & 1 deletion packages/core/src/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ export const GOERLI_CONTRACTS = {
};
export const SEPOLIA_CONTRACTS = {};
export const MAINNET_CONTRACTS = {};
export const DEV_CONTRACTS = {};
export const DEV_CONTRACTS = {
"messaging": "0x28f42924c72d2d444be20e715d0b5c97544b22e3147002d67bd59232187bc3",
"executor": "0x24457c33d887b2b3c6a9dd1d65205e1b1796e97537d5ee1e291012bb68ee382",
"nftContract": "0x64e73de9240ba05218b7e8fe53d1f9a3bae51791c5c5b6746fa7dae2e912764",
"eth": "0x144a0c8ae6e665dc3652e164ba2881eda87ad9cb5dcc93d30ca6d61b818014c",
"orderbook": "0x6404d0ba6809a56549bd132573e39170d0134c74a21b06375352c2cfd1c54d8"
};
91 changes: 0 additions & 91 deletions packages/core/tests-new/cancelOffer.test.ts

This file was deleted.

24 changes: 0 additions & 24 deletions packages/core/tests-new/createAccount.test.ts

This file was deleted.

96 changes: 0 additions & 96 deletions packages/core/tests-new/createListing.test.ts

This file was deleted.

Loading

0 comments on commit cce44ba

Please sign in to comment.