-
Notifications
You must be signed in to change notification settings - Fork 51
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
9 changed files
with
60 additions
and
47 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
16 changes: 9 additions & 7 deletions
16
onchain/src/quests/interface.cairo → onchain/src/quests/interfaces.cairo
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 |
---|---|---|
@@ -1,17 +1,19 @@ | ||
use starknet::ContractAddress; | ||
|
||
#[derive(Drop, starknet::Event)] | ||
pub struct QuestClaimed { | ||
pub user: ContractAddress, | ||
pub reward: u32, | ||
} | ||
|
||
#[starknet::interface] | ||
pub trait IQuest<TContractState> { | ||
// Return the reward for the quest. | ||
fn get_reward(self: @TContractState) -> u32; | ||
// Return if the user can claim the quest. | ||
// Return true if the user can claim the quest. | ||
fn is_claimable(self: @TContractState, user: ContractAddress) -> bool; | ||
// Claim the quest. | ||
fn claim(ref self: TContractState, user: ContractAddress) -> u32; | ||
} | ||
|
||
#[starknet::interface] | ||
pub trait IPixelQuest<TContractState> { | ||
fn is_claimed(self: @TContractState, user: starknet::ContractAddress) -> bool; | ||
fn get_pixels_needed(self: @TContractState) -> u32; | ||
fn is_daily(self: @TContractState) -> bool; | ||
fn claim_day(self: @TContractState) -> u32; | ||
} |
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
12 changes: 6 additions & 6 deletions
12
onchain/src/templates/interface.cairo → onchain/src/templates/interfaces.cairo
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