Function sway_libs::admin::only_admin
pub fn only_admin()
Expand description
Ensures that the sender is an administrator.
Additional Information
NOTE: Owner and administrator are independent of one another. If an Owner calls this function, it will revert.
Reverts
- When the caller is not an administrator.
Number of Storage Accesses
- Reads:
1
Examples
use sway_libs::admin::{only_admin};
fn foo() {
only_admin();
// Only reachable by an administrator
}