Accessories

The AccessoryCore contract holds NFTs and data for items that are used in both the Offhand1 and Offhand2 Hero Equipment slots, as well as the Accessory slot. Both of these item types share the same base types.

Contracts

Addresses

Name
Mainnet
Testnet

DFK Chain

0x8E32DDD6B75314aA78fd99952299f21Ff4441839

0xc03a74F4707BD3084CbC8736CbF1dE8C57ac4F88

Kaia

0xa505EE303D5Ab53AFc392a06f08758fC83A07209

0x03b19e0095899D6311f29F054D6590383d9997Cb

Metis

0xb16838fc6eAE51FaeA13FBeB655BDe8Bf702d5c2

0xCD3BC364173D5961C55b2f26D0d93402976b3b7B

Interface

interface IAccessoryCoreDiamond {

    // Events
    event AccessoryCreated(address indexed owner, uint256 indexed accessoryId, tuple(uint256 id, tuple(uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount) displayBonusInfo, tuple(uint64 equippedTo, uint64 equippableAt, uint16 maxDurability, uint16 durability, uint8 maxRepairs, uint8 remainingRepairs, uint8 equipRequirement, uint8 enchantmentType1, uint8 enchantmentType2, uint8 enchantmentType3, uint16 enchantmentScalar1, uint16 enchantmentScalar2, uint16 enchantmentScalar3) stateEnchantments) accessory);
    event AccessoryUpdated(address indexed owner, uint256 indexed accessoryId, tuple(uint256 id, tuple(uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount) displayBonusInfo, tuple(uint64 equippedTo, uint64 equippableAt, uint16 maxDurability, uint16 durability, uint8 maxRepairs, uint8 remainingRepairs, uint8 equipRequirement, uint8 enchantmentType1, uint8 enchantmentType2, uint8 enchantmentType3, uint16 enchantmentScalar1, uint16 enchantmentScalar2, uint16 enchantmentScalar3) stateEnchantments) accessory);
    event Approval(address indexed owner, address indexed operator, uint256 indexed tokenId);
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
    event DisplayBonusInfoUpdated(address indexed owner, uint256 accessoryId, tuple(uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount) displayBonusInfo);
    event Paused(address account);
    event StateEnchantmentsUpdated(address indexed owner, uint256 accessoryId, tuple(uint64 equippedTo, uint64 equippableAt, uint16 maxDurability, uint16 durability, uint8 maxRepairs, uint8 remainingRepairs, uint8 equipRequirement, uint8 enchantmentType1, uint8 enchantmentType2, uint8 enchantmentType3, uint16 enchantmentScalar1, uint16 enchantmentScalar2, uint16 enchantmentScalar3) stateEnchantments);
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
    event Unpaused(address account);

    // Functions
    function approve(address operator, uint256 tokenId) payable;
    function balanceOf(address account) view returns (uint256);
    function getAccessories(uint256[] _ids) view returns (tuple(uint256 id, tuple(uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount) displayBonusInfo, tuple(uint64 equippedTo, uint64 equippableAt, uint16 maxDurability, uint16 durability, uint8 maxRepairs, uint8 remainingRepairs, uint8 equipRequirement, uint8 enchantmentType1, uint8 enchantmentType2, uint8 enchantmentType3, uint16 enchantmentScalar1, uint16 enchantmentScalar2, uint16 enchantmentScalar3) stateEnchantments)[]);
    function getAccessory(uint256 _id) view returns (tuple(uint256 id, tuple(uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount) displayBonusInfo, tuple(uint64 equippedTo, uint64 equippableAt, uint16 maxDurability, uint16 durability, uint8 maxRepairs, uint8 remainingRepairs, uint8 equipRequirement, uint8 enchantmentType1, uint8 enchantmentType2, uint8 enchantmentType3, uint16 enchantmentScalar1, uint16 enchantmentScalar2, uint16 enchantmentScalar3) stateEnchantments));
    function getApproved(uint256 tokenId) view returns (address);
    function getStateEnchantments(uint256 _id) view returns (tuple(uint64 equippedTo, uint64 equippableAt, uint16 maxDurability, uint16 durability, uint8 maxRepairs, uint8 remainingRepairs, uint8 equipRequirement, uint8 enchantmentType1, uint8 enchantmentType2, uint8 enchantmentType3, uint16 enchantmentScalar1, uint16 enchantmentScalar2, uint16 enchantmentScalar3));
    function getUserAccessories(address _address) view returns (tuple(uint256 id, tuple(uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount) displayBonusInfo, tuple(uint64 equippedTo, uint64 equippableAt, uint16 maxDurability, uint16 durability, uint8 maxRepairs, uint8 remainingRepairs, uint8 equipRequirement, uint8 enchantmentType1, uint8 enchantmentType2, uint8 enchantmentType3, uint16 enchantmentScalar1, uint16 enchantmentScalar2, uint16 enchantmentScalar3) stateEnchantments)[]);
    function getUserAccessoryIds(address _address) view returns (uint256[]);
    function isApprovedForAll(address account, address operator) view returns (bool);
    function name() view returns (string);
    function ownerOf(uint256 tokenId) view returns (address);
    function pause();
    function paused() view returns (bool);
    function safeTransferFrom(address from, address to, uint256 tokenId) payable;
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) payable;
    function symbol() view returns (string);
    function tokenByIndex(uint256 index) view returns (uint256);
    function tokenOfOwnerByIndex(address owner, uint256 index) view returns (uint256);
    function tokenURI(uint256 tokenId) view returns (string);
    function totalSupply() view returns (uint256);
    function transferFrom(address from, address to, uint256 tokenId) payable;
    function unpause();

}

ABI

Types

Accessory

The primary Accessory struct contains the item's unique ID on the contract, and two sub-structs that hold the item data.

DisplayBonusInfo

Name
Type
Description

EquipmentType

The numeric ID defining the equipment type (e.g. 1 = Accessory, etc.)

displayId

uint16

Defines the item's base appearance

rarity

uint8

The item's rarity (0-12). See Rarity.

craftedBy

uint64

The Hero ID of the crafting Hero, or a unique ID for dropped items. See CraftedBy.

dye1

uint8

A unique mapping indicating the primary color variation for some items (0 = no dye). See Dye1.

dye2

uint8

A unique mapping indicating the secondary color variation for some items (0 = no dye). See Dye2.

bonus1

uint8

A mapping of an item bonus ID (0 = no bonus)

bonus2

uint8

A mapping of an item bonus ID (0 = no bonus)

bonus3

uint8

A mapping of an item bonus ID (0 = no bonus)

bonus4

uint8

A mapping of an item bonus ID (0 = no bonus)

bonus5

uint8

A mapping of an item bonus ID (0 = no bonus)

bonusScalar1

uint16

The scalar value of the corresponding bonus

bonusScalar2

uint16

The scalar value of the corresponding bonus

bonusScalar3

uint16

The scalar value of the corresponding bonus

bonusScalar4

uint16

The scalar value of the corresponding bonus

bonusScalar5

uint16

The scalar value of the corresponding bonus

uniqueSettings

uint16

Currently unused

restorationCount

uint8

The number of times the item's remainingRepairs have been restored

StateEnchantments

Name
Type
Description

equippedTo

uint64

The Hero ID of the Hero that the item is equipped to

equippableAt

uint64

The Unix timestamp when the item is next equippable

maxDurability

uint16

The maximum durability of the item

durability

uint16

The current durability of the item

maxRepairs

uint8

The maximum number of repairs for the item

remainingRepairs

uint8

The remaining number of repairs for the item

equipRequirement

uint8

The Level requirement to equip the item

enchantmentType1

uint8

A mapping of the enchantment type:

  • 0 = no enchantment slot available

  • 1 = empty enchantment slot

enchantmentType2

uint8

A mapping of the enchantment type:

  • 0 = no enchantment slot available

  • 1 = empty enchantment slot

enchantmentType3

uint8

A mapping of the enchantment type:

  • 0 = no enchantment slot available

  • 1 = empty enchantment slot

enchantmentScalar1

uint16

The scalar value of the corresponding enchantment

enchantmentScalar2

uint16

The scalar value of the corresponding enchantment

enchantmentScalar3

uint16

The scalar value of the corresponding enchantment

EquipmentType

Name
Value
Description
Type
Usable By

None

0

None

N/A

N/A

Accessory

1

Accessory

Accessory

  • All Classes

Shield

2

Shield

Offhand

  • Knight

  • Legionnaire

  • Paladin

  • Warrior

Focus

3

Focus

Offhand

  • Paladin

  • Priest

  • Sage

  • Scholar

  • Seer

  • Summoner

  • Wizard

Mappings

Equipment Details

The equipment details correspond to a two-layer mapping by equipmentType and displayId. Most base data can be found on-chain or through the API. Mappings for additional string data are as follows:

Accessory Bonuses

Accessory Bonus descriptions correspond to the following mappings. The X in each mapping represents the corresponding bonusScalar value.

For Bonuses with both X and Y values, these are determined by using bitwise operators against the uint16 bonusScalar value as follows:

  • X = bonusScalar & 255

  • Y = bonusScalar >> 8

Offhand Bonuses

Offhand Bonus descriptions correspond to the following mappings. The X in each mapping represents the corresponding bonusScalar value.

Last updated