odra_modules/cep18/
events.rs

1use odra::casper_types::U256;
2use odra::prelude::*;
3
4/// An event emitted when a mint operation is performed.
5#[odra::event]
6pub struct Mint {
7    /// The recipient of the minted tokens.
8    pub recipient: Address,
9    /// The amount of tokens minted.
10    pub amount: U256
11}
12
13/// An event emitted when a burn operation is performed.
14#[odra::event]
15pub struct Burn {
16    /// The owner of the tokens that are burned.
17    pub owner: Address,
18    /// The amount of tokens burned.
19    pub amount: U256
20}
21
22/// An event emitted when an allowance is set.
23#[odra::event]
24pub struct SetAllowance {
25    /// The owner of the tokens.
26    pub owner: Address,
27    /// The spender that is allowed to spend the tokens.
28    pub spender: Address,
29    /// The allowance amount.
30    pub allowance: U256
31}
32
33/// An event emitted when an allowance is increased.
34#[odra::event]
35pub struct IncreaseAllowance {
36    /// The owner of the tokens.
37    pub owner: Address,
38    /// The spender that is allowed to spend the tokens.
39    pub spender: Address,
40    /// The final allowance amount.
41    pub allowance: U256,
42    /// The amount by which the allowance was increased.
43    pub inc_by: U256
44}
45
46/// An event emitted when an allowance is decreased.
47#[odra::event]
48pub struct DecreaseAllowance {
49    /// The owner of the tokens.
50    pub owner: Address,
51    /// The spender that is allowed to spend the tokens.
52    pub spender: Address,
53    /// The final allowance amount.
54    pub allowance: U256,
55    /// The amount by which the allowance was decreased.
56    pub decr_by: U256
57}
58
59/// An event emitted when a transfer is performed.
60#[odra::event]
61pub struct Transfer {
62    /// The sender of the tokens.
63    pub sender: Address,
64    /// The recipient of the tokens.
65    pub recipient: Address,
66    /// The amount of tokens transferred.
67    pub amount: U256
68}
69
70/// An event emitted when a transfer_from is performed.
71#[odra::event]
72pub struct TransferFrom {
73    /// The spender that is allowed to spend the tokens.
74    pub spender: Address,
75    /// The sender of the tokens.
76    pub owner: Address,
77    /// The recipient of the tokens.
78    pub recipient: Address,
79    /// The amount of tokens transferred.
80    pub amount: U256
81}