nest
Module0xff3e…279d
- Move path
- 0x61e6…e413::nest
- Functions
- 3123 public, 7 entry
- Structs
- 15
- Friend modules
- nestv2
Declarations
Rebuilt from the module interface. No verified source is published, and function bodies are only available as bytecode.
module nest;
struct AccumulatedHarvest has copy, drop {
nest_id: ID,
duck_id: ID,
owner: address,
cycles_harvested: u64,
total_sht_earned: u64,
harvest_results: vector<HarvestResult>,
}
struct DuckStaked has copy, drop {
nest_id: ID,
duck_id: ID,
staked_duck_id: ID,
owner: address,
slot_index: u8,
}
struct DuckUnstaked has copy, drop {
nest_id: ID,
duck_id: ID,
staked_duck_id: ID,
owner: address,
slot_index: u8,
}
struct HarvestAttempted has copy, drop {
nest_id: ID,
duck_id: ID,
owner: address,
success: bool,
sht_earned: u64,
luck_used: u8,
}
struct HarvestResult has copy, drop {
cycle_number: u64,
success: bool,
sht_earned: u64,
luck_used: u8,
}
struct HarvestStats has key {
id: UID,
total_sht_harvested: u64,
total_harvest_attempts: u64,
total_successful_harvests: u64,
active_ducks_staked: u64,
sht_harvested_today: u64,
last_harvest_reset_day: u64,
leaderboard: vector<LeaderboardEntry>,
}
struct LeaderboardEntry has copy, drop, store {
user: address,
total_harvested: u64,
}
struct Nest has key {
id: UID,
owner: address,
nest_index: u8,
level: u8,
staked_duck_id: Option<ID>,
}
struct NestAdminCap has key {
id: UID,
}
struct NestCreated has copy, drop {
nest_id: ID,
owner: address,
}
struct NestRegistry has key {
id: UID,
user_nests: Table<address, Table<u8, ID>>,
is_initialized: bool,
}
struct SlotUpgraded has copy, drop {
nest_id: ID,
owner: address,
slot_index: u8,
old_level: u8,
new_level: u8,
sht_cost: u64,
}
struct StakedDuck has key {
id: UID,
duck_id: ID,
owner: address,
nest_id: ID,
staked_at: u64,
last_harvest_time: u64,
duck_rarity: u8,
duck_multiplier: u8,
}
struct StakingKiosk has key {
id: UID,
kiosk: Kiosk,
cap: KioskOwnerCap,
}
struct UserHarvestStats has copy, drop, store {
lifetime_sht_earned: u64,
total_harvest_attempts: u64,
successful_harvests: u64,
current_ducks_staked: u64,
sht_earned_today: u64,
last_activity_day: u64,
}
fun get_duck_base_luck(u8): u8
fun get_duck_multiplier(u8): u8
fun get_nest_luck_bonus(u8): u8
fun get_upgrade_cost(u8): u64
public entry fun harvest_duck(&mut StakedDuck,&Nest,&mut HarvestStats,&shttoken::NestMintCap,&mut shttoken::SharedTreasury,&Random,&Clock)
fun init()
public entry fun stake_duck(&mut Kiosk,&KioskOwnerCap,ID,&mut Nest,&mut StakingKiosk,&mut TransferPolicy<duck_nft::DuckNFT>,&mut HarvestStats,&Clock)
public entry fun unstake_duck(StakedDuck,&mut Nest,&mut Kiosk,&KioskOwnerCap,&mut StakingKiosk,&mut TransferPolicy<duck_nft::DuckNFT>,&mut HarvestStats,&shttoken::NestMintCap,&mut shttoken::SharedTreasury,&Random,&Clock)
public entry fun upgrade_nest(&mut Nest,&mut Coin<shttoken::SHTTOKEN>,&mut shttoken::SharedTreasury)