Kamigotchi Documentation
  • GAME
    • Quick Start
    • Official Links
    • Kamigotchi
      • Stats
      • Traits
      • Types
      • Levels and Skills
      • Bonuses
    • The World
      • Movement and Stamina
      • Time
      • Important Locations
    • Harvesting
      • Cooldown
      • Liquidations
      • Scavenging
      • Room Typing
    • Quests and Factions
      • Co-Ops
    • Crafting
    • Merchants
  • ONYX
  • Mint and Distribution
    • Re-rolls
    • Tickets Auction Mechanisms
  • VIP
    • How to stake INIT and boost Yominet VIP Rewards
    • How to stake esINIT and boost Yominet VIP Rewards
  • Analytics
  • Tech
    • Contracts
      • Live addresses
      • IDs & ABIs
    • Player API
      • Overview
Powered by GitBook
On this page
  • Constant
  • Dynamic
  1. Tech
  2. Contracts

Live addresses

Constant

World

0x89090F774BeC95420f6359003149f51fec207133

Dynamic

Component and system addresses can change when upgrading/deploying. These addresses are instead stored in World, and reference via its id.

const getCompAddr = async (strID: string): Promise<string> => {
  const world = new ethers.Contract(worldAddr, WorldABI, provider);
  const systemRegistry = await world.components();

  const id = ethers.utils.solidityKeccak256(['string'], [strID]);
  return await getAddrByID(systemRegistry, id);
};

const getSystemAddr = async (strID: string): Promise<string> => {
  const world = new ethers.Contract(worldAddr, WorldABI, provider);
  const systemRegistry = await world.systems();

  const id = ethers.utils.solidityKeccak256(['string'], [strID]);
  return await getAddrByID(systemRegistry, id);
};

const getAddrByID = async (
  compsAddr: string,
  id: BigNumberish
): Promise<string> => {
  const comp = new ethers.Contract(compsAddr, UintCompABI, provider);
  const values = await comp.getEntitiesWithValue(id);
  return values.length > 0 ? values[0].toHexString() : '0x0000000000000000000000000000000000000000';
};
PreviousContractsNextPlayer API

Last updated 5 months ago