forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.rs
More file actions
23 lines (21 loc) · 769 Bytes
/
Copy pathtypes.rs
File metadata and controls
23 lines (21 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use soroban_sdk::{contracttype, Address};
#[derive(Clone)]
#[contracttype]
pub struct StakerInfo {
pub amount: i128, // Amount currently staked
pub pending_withdrawal: i128, // Amount waiting for cooldown
pub unlock_time: u64, // Timestamp when pending withdrawal can be claimed
pub last_reward_index: i128, // The global reward index when staker last updated
pub accumulated_rewards: i128, // Rewards harvested but not yet claimed
pub delegated_to: Option<Address>,
}
#[derive(Clone)]
#[contracttype]
pub enum DataKey {
Admin,
Token,
RewardIndex, // Global index: total_rewards / total_staked
TotalStaked,
Staker(Address),
DelegatedAmount(Address), // Total amount delegated TO this address
}