Skip to content
Wowok Protocol edited this page May 23, 2024 · 3 revisions

wowok grantor: used for trust granting and transferring, and Guard conditional guarding, etc.

struct Grantor has  copy, drop, store {
    name: String, // Name
    register_time: u64,   // Registration time
    expired_time: u64, // Expiration time
    grantee: address, // Grantee Repository address, used to store the information of the grantee
}
struct Wowok has key, store {
    id: UID,
    initor: address,    
    everyone_guard: address, 
    entities: address, 
    grantors: Table<address, Grantor>,  // registered grantors
}

everyone_guard: A Guard that everyone can pass, used for setting certain conditions (for example, in Vote.guard, setting: everyone's guard has a weight of 1 vote, and some entities can have more votes)
entities: Entity information, used to store address avatars, homepage, Twitter, Discord, etc.; also used to record the number of likes and dislikes

Register as a grantor, no centralized review is needed, a new Repository (of type TYPE_WOWOK_GRANTEE) managed by the specified grantee_permission is generated

grantor_register(wowok:&mut Wowok, name:String, clock:&Clock, grantee_permission:&Permission)

Grantor changes name

grantor_rename(wowok:&mut Wowok, new_name:String)
Clone this wiki locally