forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.rs
More file actions
36 lines (31 loc) · 1.05 KB
/
Copy pathevents.rs
File metadata and controls
36 lines (31 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use soroban_sdk::{symbol_short, Address, Env};
pub fn emit_initialized(env: &Env, admin: &Address, token: &Address) {
env.events().publish(
(symbol_short!("staking"), symbol_short!("init")),
(admin, token),
);
}
pub fn emit_staked(env: &Env, staker: &Address, amount: i128) {
env.events().publish(
(symbol_short!("staking"), symbol_short!("stake")),
(staker, amount),
);
}
pub fn emit_unstaked(env: &Env, staker: &Address, amount: i128, unlock_time: u64) {
env.events().publish(
(symbol_short!("staking"), symbol_short!("unstake")),
(staker, amount, unlock_time),
);
}
pub fn emit_rewards_claimed(env: &Env, staker: &Address, amount: i128) {
env.events().publish(
(symbol_short!("staking"), symbol_short!("claim")),
(staker, amount),
);
}
pub fn emit_delegated(env: &Env, delegator: &Address, delegatee: &Option<Address>) {
env.events().publish(
(symbol_short!("staking"), symbol_short!("delegate")),
(delegator.clone(), delegatee.clone()),
);
}