-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: upgradeable contract * feat: prenium management * feat: randomness fee management * fix: example randomness types * fix: issues in randomness contract * fix: uncomment code * ✨ mock oracle * 🐛 camel case abi * feat: balance management tests * fix: residuals * feat: out of gas verification * fix: tests * feat: fetch all out of gas requests * fix: fmt * feat: more tests * fix: fmt * remove comments * feat: spell ignore * feat: withdraw + error management * fix: decimal adjustment * fix: remove unused function * feat: admin management --------- Co-authored-by: 0xevolve <[email protected]>
- Loading branch information
Showing
7 changed files
with
761 additions
and
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
requestor |
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,37 @@ | ||
use pragma::entry::structs::{DataType, PragmaPricesResponse}; | ||
|
||
#[starknet::interface] | ||
trait IOracle<TContractState> { | ||
fn get_data_median(self: @TContractState, data_type: DataType) -> PragmaPricesResponse; | ||
} | ||
|
||
#[starknet::contract] | ||
mod MockOracle { | ||
use starknet::{get_block_timestamp}; | ||
use super::{IOracle, PragmaPricesResponse, DataType}; | ||
use option::OptionTrait; | ||
|
||
#[storage] | ||
struct Storage {} | ||
|
||
#[constructor] | ||
fn constructor(ref self: ContractState) { | ||
return (); | ||
} | ||
|
||
#[external(v0)] | ||
impl IOracleImpl of IOracle<ContractState> { | ||
/// @notice Returns a fixed mocked price of 1000 USD | ||
fn get_data_median(self: @ContractState, data_type: DataType) -> PragmaPricesResponse { | ||
let timestamp = get_block_timestamp(); | ||
PragmaPricesResponse { | ||
price: 100000000000, | ||
decimals: 8, | ||
last_updated_timestamp: timestamp, | ||
num_sources_aggregated: 5, | ||
expiration_timestamp: Option::None, | ||
} | ||
} | ||
} | ||
} | ||
|
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.