View Functions and Asserts

Get functions have been implemented to provide easy access to objects and data within the module.

public fun usdk_address(): address {
object::create_object_address(&@stablecoin, ASSET_SYMBOL)
public fun metadata(): Object<Metadata> {

We also have assert functions to provide re-usable and cleaner code.

fun assert_is_minter(minter: &signer) acquires Roles {
let roles = borrow_global<Roles>(usdk_address());
let minter = signer::address_of(minter);
assert!(minter == roles.master_minter || vector::contains(&roles.minters, &minter), EUNAUTHORIZED);
fun assert_not_denylisted(account: address) acquires State {
let state = borrow_global<State>(usdk_address());
assert!(!smart_table::contains(&state.denylist, account), EBLACKLISTED);