1use alloy_primitives::{Address, U256};
2
3pub fn transfer_balance<F>(
8 from: Option<&Address>,
9 to: Option<&Address>,
10 amount: U256,
11 mut state_fn: F,
12) -> Result<(), ()>
13where
14 F: FnMut(Option<&Address>, Option<&Address>, U256) -> Result<(), ()>,
15{
16 state_fn(from, to, amount)
17}
18
19pub fn mint_balance<F>(to: &Address, amount: U256, state_fn: F) -> Result<(), ()>
21where
22 F: FnMut(Option<&Address>, Option<&Address>, U256) -> Result<(), ()>,
23{
24 transfer_balance(None, Some(to), amount, state_fn)
25}
26
27pub fn burn_balance<F>(from: &Address, amount: U256, state_fn: F) -> Result<(), ()>
29where
30 F: FnMut(Option<&Address>, Option<&Address>, U256) -> Result<(), ()>,
31{
32 transfer_balance(Some(from), None, amount, state_fn)
33}