-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce internal components (#634)
* remove state from eip712 mod * move SNIP12 to components * add simple quorum component * annotate ownableImpl with embed_v0 * add space manager component * add reinitializable component * scarb: fmt * add Single Slot Proof Component * scarb fmt * use storage prefix to avoid clashes * add SingleSlotProofImpl as embeddable * chore: fmt * ensure ozvotes / evm_slot_value strategies expose the SingleSlotProof external functions * remove cfg test
- Loading branch information
Showing
25 changed files
with
910 additions
and
748 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
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,28 @@ | ||
use sx::external::herodotus::BinarySearchTree; | ||
|
||
/// Optional trait that execution strategies can decide to implement. | ||
#[starknet::interface] | ||
trait ISingleSlotProof<TContractState> { | ||
/// Queries the Timestamp Remapper contract for the closest L1 block number that occurred before | ||
/// the given timestamp and then caches the result. If the queried timestamp is less than the earliest | ||
/// timestamp or larger than the latest timestamp in the mapper then the transaction will revert. | ||
/// This function should be used to cache a remapped timestamp before it's used when calling the | ||
/// `get_storage_slot` function with the same timestamp. | ||
/// | ||
/// # Arguments | ||
/// | ||
/// * `timestamp` - The timestamp at which to query. | ||
/// * `tree` - The tree proof required to query the remapper. | ||
fn cache_timestamp(ref self: TContractState, timestamp: u32, tree: BinarySearchTree); | ||
|
||
/// View function exposing the cached remapped timestamps. Reverts if the timestamp is not cached. | ||
/// | ||
/// # Arguments | ||
/// | ||
/// * `timestamp` - The timestamp to query. | ||
/// | ||
/// # Returns | ||
/// | ||
/// * `u256` - The cached L1 block number corresponding to the timestamp. | ||
fn cached_timestamps(self: @TContractState, timestamp: u32) -> u256; | ||
} |
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.