-
Notifications
You must be signed in to change notification settings - Fork 42
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
1 changed file
with
31 additions
and
0 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,31 @@ | ||
#[starknet::interface] | ||
trait IAirdrop<TContractState> { | ||
fn stake( | ||
ref self: TContractState, length: u64, amount: u128 | ||
) -> u32; // returns stake ID | ||
fn unstake( | ||
ref self: TContractState, id: u32 | ||
); | ||
|
||
|
||
// owner only | ||
// set_curve_point | ||
} | ||
|
||
#[starknet::component] | ||
mod staking { | ||
use cubit::f128; | ||
|
||
#[storage] | ||
struct Storage { | ||
stake: LegacyMap::<(ContractAddress, u32), (u128, u128, u64, u64)>, // STAKE(address, ID) → (amount staked, amount veCARM, start date, length of stake) | ||
curve: LegacyMap::<u64, f128> // length of stake > CARM to veCARM conversion rate (in cubit f128) | ||
} | ||
|
||
// impl, etc, embeddable_as StakingImpl... | ||
// fn stake() | ||
// fn unstake(){ | ||
// here, keep in mind the special case where the user has veCARM and no corresponding entry in the stake storage var. | ||
// what id to use? to be decided | ||
//} | ||
} |