diff --git a/src/contracts/escrow_account.cairo b/src/contracts/escrow_account.cairo index 4bf867e..9138213 100644 --- a/src/contracts/escrow_account.cairo +++ b/src/contracts/escrow_account.cairo @@ -76,20 +76,19 @@ mod EscrowAccount { impl IAccountImpl of IAccount { fn __validate__(ref self: ContractState, calls: Array) -> felt252 { let execution_info = get_execution_info().unbox(); - assert(execution_info.caller_address.is_zero(), 'escrow/only-protocol'); // Not tested + assert(execution_info.caller_address.is_zero(), 'escrow/only-protocol'); assert(calls.len() == 1, 'escrow/invalid-call-len'); let Call { to, selector, calldata } = calls.at(0); assert(*to == get_contract_address(), 'escrow/invalid-call-to'); assert(*selector == selector!("claim_internal"), 'escrow/invalid-call-selector'); - let (gift, _): (GiftData, ContractAddress) = full_deserialize(*calldata) - .expect('escrow/invalid-calldata'); // Not tested + let (gift, _): (GiftData, ContractAddress) = full_deserialize(*calldata).expect('escrow/invalid-calldata'); assert_valid_claim(gift); let tx_info = execution_info.tx_info.unbox(); assert(tx_info.nonce == 0, 'escrow/invalid-gift-nonce'); let execution_hash = tx_info.transaction_hash; let signature = tx_info.signature; - assert(signature.len() == 2, 'escrow/invalid-signature-len'); // Not tested + assert(signature.len() == 2, 'escrow/invalid-signature-len'); let tx_version = tx_info.version; assert( @@ -97,18 +96,15 @@ mod EscrowAccount { || tx_version == TX_V3_ESTIMATE || tx_version == TX_V1_ESTIMATE, 'escrow/invalid-signature' - ); // Not tested + ); if gift.fee_token == STRK_ADDRESS() { - // Not tested assert(tx_version == TX_V3 || tx_version == TX_V3_ESTIMATE, 'escrow/invalid-tx3-version'); let tx_fee = compute_max_fee_v3(tx_info, tx_info.tip); assert(tx_fee <= gift.fee_amount, 'escrow/max-fee-too-high-v3'); } else if gift.fee_token == ETH_ADDRESS() { - // Not tested assert(tx_version == TX_V1 || tx_version == TX_V1_ESTIMATE, 'escrow/invalid-tx1-version'); assert(tx_info.max_fee <= gift.fee_amount, 'escrow/max-fee-too-high-v1'); } else { - // Not tested core::panic_with_felt252('escrow/invalid-token-fee'); } VALIDATED @@ -118,7 +114,6 @@ mod EscrowAccount { let execution_info = get_execution_info().unbox(); assert(execution_info.caller_address.is_zero(), 'escrow/only-protocol'); let tx_version = execution_info.tx_info.unbox().version; - // Not tested assert( tx_version == TX_V3 || tx_version == TX_V1 @@ -127,7 +122,6 @@ mod EscrowAccount { 'escrow/invalid-tx-version' ); let Call { .., calldata }: @Call = calls[0]; - // Not tested let (gift, receiver): (GiftData, ContractAddress) = full_deserialize(*calldata) .expect('escrow/invalid-calldata'); // The __validate__ function already ensures the claim is valid @@ -182,7 +176,6 @@ mod EscrowAccount { fn assert_valid_claim(gift: GiftData) { let calculated_address = calculate_escrow_account_address(gift); - // Not tested assert(calculated_address == get_contract_address(), 'escrow/invalid-escrow-address'); } diff --git a/src/contracts/escrow_library.cairo b/src/contracts/escrow_library.cairo index f15332c..1e73049 100644 --- a/src/contracts/escrow_library.cairo +++ b/src/contracts/escrow_library.cairo @@ -78,7 +78,6 @@ mod EscrowLibrary { // This prevents creating instances of this classhash by mistake, as it's not needed. // While it is technically possible to create instances by replacing classhashes, this practice is not recommended. // This contract is intended to be used exclusively through library calls. - // Not tested panic_with_felt252('escr-lib/instance-not-recommend') } @@ -95,7 +94,6 @@ mod EscrowLibrary { let is_whitelisted = selector == selector!("claim_external") || selector == selector!("claim_dust") || selector == selector!("cancel"); - // not tested assert(is_whitelisted, 'escr-lib/invalid-selector'); library_call_syscall(this_class_hash, selector, args).unwrap() } @@ -138,7 +136,6 @@ mod EscrowLibrary { let factory_owner = IOwnableDispatcher { contract_address: gift.factory }.owner(); assert(factory_owner == get_caller_address(), 'escr-lib/only-factory-owner'); let gift_balance = balance_of(gift.gift_token, contract_address); - // Not tested assert(gift_balance < gift.gift_amount, 'escr-lib/not-yet-claimed'); if gift.gift_token == gift.fee_token { transfer_from_account(gift.gift_token, receiver, gift_balance); @@ -157,7 +154,6 @@ mod EscrowLibrary { fn execute_from_outside_v2( ref self: ContractState, gift: GiftData, outside_execution: OutsideExecution, signature: Span ) -> Array> { - // Not tested panic_with_felt252('escr-lib/not-allowed-yet') } } @@ -196,7 +192,6 @@ mod EscrowLibrary { } fn transfer_from_account(token: ContractAddress, receiver: ContractAddress, amount: u256,) { - // Not tested assert(IERC20Dispatcher { contract_address: token }.transfer(receiver, amount), 'escr-lib/transfer-failed'); } diff --git a/src/contracts/gift_factory.cairo b/src/contracts/gift_factory.cairo index d02a329..2e5806e 100644 --- a/src/contracts/gift_factory.cairo +++ b/src/contracts/gift_factory.cairo @@ -147,7 +147,6 @@ mod GiftFactory { gift_pubkey: felt252 ) { self.pausable.assert_not_paused(); - // Not tested assert(fee_token == STRK_ADDRESS() || fee_token == ETH_ADDRESS(), 'gift-fac/invalid-fee-token'); if gift_token == fee_token { // This is needed so we can tell if a gift has been claimed or not just by looking at the balances @@ -164,7 +163,7 @@ mod GiftFactory { escrow_class_hash, 0, // salt serialize(@constructor_arguments).span(), false // deploy_from_zero ) - .expect('gift-fac/deploy-failed'); // Not tested? + .expect('gift-fac/deploy-failed'); self .emit( GiftCreated { @@ -182,7 +181,6 @@ mod GiftFactory { if (gift_token == fee_token) { let transfer_status = IERC20Dispatcher { contract_address: gift_token } .transfer_from(get_caller_address(), escrow_contract, gift_amount + fee_amount.into()); - // Not tested assert(transfer_status, 'gift-fac/transfer-failed'); } else { let transfer_gift_status = IERC20Dispatcher { contract_address: gift_token } @@ -190,7 +188,6 @@ mod GiftFactory { assert(transfer_gift_status, 'gift-fac/transfer-gift-failed'); let transfer_fee_status = IERC20Dispatcher { contract_address: fee_token } .transfer_from(get_caller_address(), escrow_contract, fee_amount.into()); - // Not tested assert(transfer_fee_status, 'gift-fac/transfer-fee-failed'); } } diff --git a/src/contracts/timelock_upgrade.cairo b/src/contracts/timelock_upgrade.cairo index 5d4c817..9b332aa 100644 --- a/src/contracts/timelock_upgrade.cairo +++ b/src/contracts/timelock_upgrade.cairo @@ -128,7 +128,6 @@ pub mod TimelockUpgradeComponent { let block_timestamp = get_block_timestamp(); let calldata_hash = poseidon_hash_span(calldata.span()); assert(calldata_hash == self.calldata_hash.read(), 'upgrade/invalid-calldata'); - // Not tested assert(new_implementation.is_non_zero(), 'upgrade/no-pending-upgrade'); assert(block_timestamp >= ready_at, 'upgrade/too-early'); assert(block_timestamp < ready_at + VALID_WINDOW_PERIOD, 'upgrade/upgrade-too-late');