From 84eacec6657186183ef19ff560a8e37283c5cb42 Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Sun, 8 Dec 2024 20:27:39 +0700 Subject: [PATCH] Create utils.rs --- src/smart_contract/utils.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/smart_contract/utils.rs diff --git a/src/smart_contract/utils.rs b/src/smart_contract/utils.rs new file mode 100644 index 0000000..360c04e --- /dev/null +++ b/src/smart_contract/utils.rs @@ -0,0 +1,9 @@ +pub fn calculate_fee(amount: Balance) -> Balance { + // Example fee calculation: 1% of the transaction amount + amount / 100 +} + +pub fn log_event(event: &str) { + // Log an event to the blockchain + ink_env::debug_println!("{}", event); +}