-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
173 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use starknet::{ContractAddress, ClassHash}; | ||
|
||
// TODO Align => Rename ClaimData to Claim OR claim to claim_data | ||
// Or even rename to GIFT? so that the user will see gifts in the interface | ||
/// @notice Struct representing the data required for a gift claim | ||
/// @param factory The address of the factory | ||
/// @param class_hash The class hash of the gift account | ||
/// @param sender The address of the sender | ||
/// @param gift_token The ERC-20 token address of the gift | ||
/// @param gift_amount The amount of the gift | ||
/// @param fee_token The ERC-20 token address of the fee | ||
/// @param fee_amount The amount of the fee | ||
/// @param claim_pubkey The public key associated with the gift | ||
#[derive(Serde, Drop, Copy)] | ||
pub struct ClaimData { | ||
pub factory: ContractAddress, | ||
pub class_hash: ClassHash, | ||
pub sender: ContractAddress, | ||
pub gift_token: ContractAddress, | ||
pub gift_amount: u256, | ||
pub fee_token: ContractAddress, | ||
pub fee_amount: u128, | ||
pub claim_pubkey: felt252 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use starknet::{ContractAddress, ClassHash, account::Call}; | ||
|
||
|
||
/// @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 | ||
/// @param nonce It can be any value as long as it's unique. Prevents signature reuse | ||
/// @param execute_after `execute_from_outside` only succeeds if executing after this time | ||
/// @param execute_before `execute_from_outside` only succeeds if executing before this time | ||
/// @param calls The calls that will be executed by the Account | ||
/// Using `Call` here instead of re-declaring `OutsideCall` to avoid the conversion | ||
#[derive(Copy, Drop, Serde)] | ||
pub struct OutsideExecution { | ||
pub caller: ContractAddress, | ||
pub nonce: felt252, | ||
pub execute_after: u64, | ||
pub execute_before: u64, | ||
pub calls: Span<Call> | ||
} | ||
|
||
#[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>>; | ||
|
||
/// Get the status of a given nonce, true if the nonce is available to use | ||
fn is_valid_outside_execution_nonce(self: @TContractState, nonce: felt252) -> bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.