๐Our Contract
Our sybil contract
Purpose
Contract Structure
General Types
Contract
pub struct Contract {
contract_source_metadata: LazyOption<VersionedContractSourceMetadata>,
owner: AccountId,
admins: UnorderedSet<AccountId>,
providers_by_id: UnorderedMap<ProviderId, VersionedProvider>,
pending_provider_ids: UnorderedSet<ProviderId>,
active_provider_ids: UnorderedSet<ProviderId>,
deactivated_provider_ids: UnorderedSet<ProviderId>,
default_provider_ids: UnorderedSet<ProviderId>,
default_human_threshold: u32,
// MAPPINGS
// Stores all Stamp records, versioned for easy upgradeability
stamps_by_id: UnorderedMap<StampId, VersionedStamp>,
// Enables fetching of all stamps for a user
provider_ids_for_user: LookupMap<AccountId, UnorderedSet<ProviderId>>,
// Enables fetching of all users with given stamp (provider ID)
user_ids_for_provider: LookupMap<ProviderId, UnorderedSet<AccountId>>,
// Enables fetching of providers that a user has submitted (e.g. if user has submitted one malicious provider, they are likely to submit more and you'll want to be able to fetch these or filter them out of results)
provider_ids_for_submitter: LookupMap<AccountId, UnorderedSet<ProviderId>>,
}
/// Ephemeral-only
pub struct Config {
pub owner: AccountId,
pub admins: Vec<AccountId>,
pub default_provider_ids: Vec<ProviderId>,
pub default_human_threshold: u32,
pub pending_provider_count: u64, // may want to change these to U64 (string) to avoid JSON overflow, but this is highly unlikely. Easy to change later since this is ephemeral.
pub active_provider_count: u64,
pub deactivated_provider_count: u64,
}Providers
Stamps
Constants & Input Validation
Contract Source Metadata
Methods
Write Methods
Read Methods
Events
set_source_metadata
set_source_metadataadd_provider
add_providerupdate_provider
update_providerLast updated