Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions contracts/admin_init.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pub fn init_admin(admin_address: &str) -> Result<(), &'static str> {
if admin_address == "" || admin_address == "0x0000000000000000000000000000000000000000" {
return Err("Zero-address admin initialization not allowed");
}
Ok(())
}
6 changes: 6 additions & 0 deletions contracts/payment_requests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pub fn validate_expiry(timestamp: u64) -> Result<(), &'static str> {
if timestamp < 1000 {
return Err("Expired payment request");
}
Ok(())
}
6 changes: 6 additions & 0 deletions contracts/transfer_validation.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pub fn validate_amount(amount: u64) -> Result<(), &'static str> {
if amount == 0 {
return Err("Zero-value transfer not allowed");
}
Ok(())
}
Loading