tempo_contracts/precompiles/tip20_rewards_registry.rs
1pub use ITIP20RewardsRegistry::ITIP20RewardsRegistryErrors as TIP20RewardsRegistryError;
2use alloy::sol;
3
4sol! {
5 #[derive(Debug, PartialEq, Eq)]
6 #[sol(rpc, abi)]
7 interface ITIP20RewardsRegistry {
8 /// Finalize streams for all tokens ending at the current timestamp
9 function finalizeStreams() external;
10
11 error Unauthorized();
12 error StreamsAlreadyFinalized();
13 }
14}
15
16impl TIP20RewardsRegistryError {
17 /// Creates an unauthorized access error.
18 pub const fn unauthorized() -> Self {
19 Self::Unauthorized(ITIP20RewardsRegistry::Unauthorized {})
20 }
21
22 /// Creates an error for streams already finalized
23 pub const fn streams_already_finalized() -> Self {
24 Self::StreamsAlreadyFinalized(ITIP20RewardsRegistry::StreamsAlreadyFinalized {})
25 }
26}