Skip to content

Commit

Permalink
Merge branch 'develop' into improve-lib-call-syntax
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/contracts/escrow_account.cairo
  • Loading branch information
sgc-code committed Jun 26, 2024
2 parents aeab5ca + b63ba14 commit 0b67de7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/contracts/escrow_account.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ mod EscrowAccount {
use argent_gifting::contracts::escrow_library::{IEscrowLibraryLibraryDispatcher, IEscrowLibraryDispatcherTrait};
use argent_gifting::contracts::gift_data::GiftData;
use argent_gifting::contracts::gift_factory::{IGiftFactory, IGiftFactoryDispatcher, IGiftFactoryDispatcherTrait};
use argent_gifting::contracts::outside_execution::{IOutsideExecution, OutsideExecution};
use argent_gifting::contracts::outside_execution::{
IOutsideExecution, OutsideExecution, ERC165_OUTSIDE_EXECUTION_INTERFACE_ID_VERSION_2
};

use argent_gifting::contracts::utils::{
calculate_escrow_account_address, full_deserialize, serialize, STRK_ADDRESS, ETH_ADDRESS, TX_V1_ESTIMATE, TX_V1,
Expand All @@ -56,10 +58,6 @@ mod EscrowAccount {
const SRC5_INTERFACE_ID: felt252 = 0x3f918d17e5ee77373b56385708f855659a07f75997f365cf87748628532a055;
// https://github.com/starknet-io/SNIPs/blob/main/SNIPS/snip-6.md
const SRC5_ACCOUNT_INTERFACE_ID: felt252 = 0x2ceccef7f994940b3962a6c67e0ba4fcd37df7d131417c604f91e03caecc1cd;
// https://github.com/starknet-io/SNIPs/blob/main/SNIPS/snip-9.md version 1
const ERC165_OUTSIDE_EXECUTION_INTERFACE_ID_VERSION_1: felt252 =
0x1d1144bb2138366ff28d8e9ab57456b1d332ac42196230c3a602003c89872;


#[storage]
struct Storage {
Expand Down Expand Up @@ -142,7 +140,7 @@ mod EscrowAccount {
fn supports_interface(self: @ContractState, interface_id: felt252) -> bool {
interface_id == SRC5_INTERFACE_ID
|| interface_id == SRC5_ACCOUNT_INTERFACE_ID
|| interface_id == ERC165_OUTSIDE_EXECUTION_INTERFACE_ID_VERSION_1
|| interface_id == ERC165_OUTSIDE_EXECUTION_INTERFACE_ID_VERSION_2
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/contracts/outside_execution.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use starknet::{ContractAddress, ClassHash, account::Call};


// https://github.com/starknet-io/SNIPs/blob/main/SNIPS/snip-9.md
pub const ERC165_OUTSIDE_EXECUTION_INTERFACE_ID_VERSION_2: felt252 =
0x1d1144bb2138366ff28d8e9ab57456b1d332ac42196230c3a602003c89872;

/// @notice As defined in SNIP-9 https://github.com/starknet-io/SNIPs/blob/main/SNIPS/snip-9.md
/// @param caller Only the address specified here will be allowed to call `execute_from_outside`
/// As an exception, to opt-out of this check, the value 'ANY_CALLER' can be used
Expand All @@ -20,7 +24,6 @@ pub struct OutsideExecution {

#[starknet::interface]
pub trait IOutsideExecution<TContractState> {
/// @notice Outside execution using SNIP-12 Rev 1
fn execute_from_outside_v2(
ref self: TContractState, outside_execution: OutsideExecution, signature: Span<felt252>
) -> Array<Span<felt252>>;
Expand Down

0 comments on commit 0b67de7

Please sign in to comment.