# DFK Developer Docs

Welcome to the Defi Kingdoms Developer Docs! This is a one-stop-shop for the information that a community developer would need to safely and properly integrate with DFK Assets.

DeFi Kingdoms is a multi-blockchain game. Through the use of the blockchain, all player-owned assets are available and encouraged to be used and integrated across games and across chains.

{% hint style="info" %}
**Good to know:** All assets are made publicly available but are owned by Kingdom Studios. Any use of these assets must abide by the Defi Kingdoms TOS.
{% endhint %}

## Getting Started

### Contracts, NFTs, and Tokens

Details and information about DFK smart contracts and assets.

{% content-ref url="/pages/umwAwHF61cKaHZlDspq5" %}
[Contracts](/contracts/exchanges)
{% endcontent-ref %}

{% content-ref url="/pages/0cOzEkcBZwiondDADj7c" %}
[NFTs](/nfts/heroes)
{% endcontent-ref %}

{% content-ref url="/pages/DofMf5E9A6R0fsewAVPm" %}
[Tokens](/tokens/ecosystem-token)
{% endcontent-ref %}

{% content-ref url="/pages/FnxOsVp8OiTfDq3R8ySS" %}
[Crafting](/crafting/alchemist)
{% endcontent-ref %}

{% content-ref url="/pages/4Rqz6Xk4nk0A3n1o0ubG" %}
[Collections](/collections/runes)
{% endcontent-ref %}

### Community API

Details about the GraphQL API that is available to all developers and community members.

{% content-ref url="/pages/TL6F7wx3Finp2P8B54MP" %}
[API](/api/community-graphql-api)
{% endcontent-ref %}

## Extras

### Kingdom Building Program

The Kingdom Building Program exists to drive innovation for the benefit of the DFK game, the DFK community players, and the blockchain experience. It is one way we listen to the needs and desires of the community, in addition to reinforcing their efforts and supporting their ideas.

For more information, visit: <https://build.defikingdoms.com/>

### DFK Chain

The DeFi Kingdoms Blockchain (DFK Chain) is the home of the DFK: Crystalvale expansion. It is our vision that DFK Chain will become a go-to location for community members and projects to launch GameFi and other blockchain gaming experiences.

{% content-ref url="/pages/aE94UlN5o0RaWKSRu20u" %}
[Getting Started](/dfk-chain/getting-started)
{% endcontent-ref %}


# Exchanges


# The Trader

The DEX or (Decentralized Exchange) is the center piece of the DFK Marketplace

The DFK Dex is (Decentralized Exchange) is the centerpiece of the DFK Marketplace; it is an automated market maker (AMM).&#x20;

{% hint style="info" %}
The DFK Dex is built on top of the UniswapV2 system. For more information, please view the Uniswap documentation: <https://docs.uniswap.org/contracts/v2/overview>
{% endhint %}

## Contracts

### Addresses

#### DFK Chain

| Name             | Mainnet                                                                          | Testnet                                      |
| ---------------- | -------------------------------------------------------------------------------- | -------------------------------------------- |
| UniswapV2Factory | `0x794C07912474351b3134E6D6B3B7b3b4A07cbAAa`                                     | `0x2c22Ee594Fe562f548c88ed504D57Ebc86f1D9D1` |
| UniswapV2Router  | `0x3C351E1afdd1b1BC44e931E12D4E05D6125eaeCa`                                     | `0x7dEfa830CE7E3Ec374B2cE07EabeD6FBB48a1c09` |
| UniswapV2Pair    | *For incentivized pairs, see the* [*Gardens*](/contracts/gardens#dfk-chain-1)*.* |                                              |

#### Klaytn

| Name             | Mainnet                                                                       | Testnet                                      |
| ---------------- | ----------------------------------------------------------------------------- | -------------------------------------------- |
| UniswapV2Factory | `0x36fAE766e51f17F8218C735f58426E293498Db2B`                                  | `0x4D4B23d51e763955E7FB5bEDF1FbFa337C2274A3` |
| UniswapV2Router  | `0x9e987E5E9aB872598f601BE4aCC5ac23F484845E`                                  | `0x40AF60Cc7BD3bb1ae9a99e7C8d94b68E7E9802b6` |
| UniswapV2Pair    | *For incentivized pairs, see the* [*Gardens*](/contracts/gardens#klaytn-1)*.* |                                              |

### ABIs

{% file src="/files/ZeX33PHnhmYBTu4vVUfa" %}

{% file src="/files/okOwTvFi74wuYTD9jbDm" %}

{% file src="/files/bNk8mzeJApYEwa9QYq9X" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

| Name             | Mainnet                                      | Testnet                                      |
| ---------------- | -------------------------------------------- | -------------------------------------------- |
| UniswapV2Factory | `0x9014B937069918bd319f80e8B3BB4A2cf6FAA5F7` | `0x017096690dceADb10dB4926196AA56BB4b4C2629` |
| UniswapV2Router  | `0x24ad62502d1C652Cc7684081169D04896aC20f30` | `0xa755d4728B74ae0D76ecA76d0a36D4Ffc1544122` |


# The Bazaar

An order book decentralized exchange (DEX)

## Introduction

The Bazaar is a decentralized exchange (DEX) that uses an order book instead of liquidity pools to manage trades. Players can create buy and sell orders for any ERC-20 or ERC-1155 token at the price point of their choosing, which will be filled immediately when able, or placed on the order book for fulfillment later.

All items or tokens traded in the Bazaar use [JEWEL](/tokens/ecosystem-token) as the base currency on all realms.

### Orders

[Orders](#order) are the center of the Bazaar contract, created using the [`makeOrders`](#makeorders) function and stored on the contract while they are open. Orders can be created on the buy or sell [side](#side) of the contract, and are executed when an order on the other side meets an existing order's price. Orders at the same price point are executed on a first-in-first-out basis. Completed orders are deleted from the contract, and must be viewed either as [`OrderExecuted`](#orderexecuted) events or as [`BazaarTransactions`](/api/community-graphql-api/bazaar#bazaartransactions) in the API.

### Quantity

The Bazaar is token agnostic, and is built to work with tokens of any decimal amount. The `quantity` of an order is entered and stored in `wei`. For DFK's many zero-decimal tokens, a single token will be a single digit. For 18-decimal tokens, all digits must be entered.

{% hint style="info" %}
**Examples**

* 1 Greater Might Stone: `1`
* 123.456 DFK Gold: `123456`
* 10.5 CRYSTAL: `10500000000000000000`
  {% endhint %}

### Price

The price of an order is entered and stored in different ways. Since all orders are placed in JEWEL, the price per unit must be expressed in `wei` (18 digits).

The [`makeOrders`](#makeorders) function requires an input of `totalPrice`, calculated as follows:

* `unitPrice (in wei) * quantity (in wei) / 10^(tokenDecimals)`

Once stored on the contract and in the API, the token price (*per unit, not total*) is multiplied by the contract's `PRICE_FACTOR`, expressed as:

* &#x20;`unitPrice (in wei) * 10^12`

{% hint style="info" %}
**Examples**

* 1 Greater Might Stone @ 250 JEWEL
  * Order Input: `250000000000000000000 * 1 / 10^0 = 250000000000000000000`
  * Held in Contract as: `250000000000000000000 * 10^12 = 250000000000000000000000000000000`
* 123.456 DFK Gold @ 0.001 JEWEL / each
  * Order Input: `1000000000000000 * 123456 / 10^3 = 123456000000000000`
  * Held in Contract as: `1000000000000000 * 10^12 = 1000000000000000000000000000`
* 10.5 CRYSTAL @ 0.16 JEWEL / each
  * Order Input: `160000000000000000 * 10500000000000000000 / 10^18 = 1680000000000000000`
  * Held in Contract as: `160000000000000000 * 10^12 = 160000000000000000000000000000`
    {% endhint %}

### Restrictions

There are a number of restrictions on how orders can be placed:

#### Precision

By default, the price per unit of an order is limited to 4 digits of precision. Exceeding this limit will cause the transaction to revert.

{% hint style="info" %}
**Examples**

* ✅ 123.4 JEWEL
* ✅ 0.000001234 JEWEL
* ✅ 1234000 JEWEL
* ❌ 123.04 JEWEL
* ❌ 1.000000001 JEWEL
* ❌ 123402 JEWEL
  {% endhint %}

Some tokens with larger prices relative to JEWEL have a `precisionOverride` set. Currently these tokens include **Bitcoin** and **Ethereum**, which are set to `6` digits of precision.

#### Minimum & Maximum Order Value

Each Order has a minimum and maximum limit to the total value of the order, that is, the `pricePerUnit * quantity + fee`. Exceeding these limits will cause the transaction to revert.

* **Minimum Order Value**: 0.0001 JEWEL (`100000000000000 wei`)
* **Maximum Order Value**: 50,000,000 JEWEL (`50000000000000000000000000 wei`)

## Contract

### Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| DFK Chain | `0x902F2b740bC158e16170d57528405d7f2a793Ca2` | `0x767A9114B61fb14732Cfca1ccA2d9FD309c74E93` |
| Metis     | `0x4cB622C886c89c0472C0056A7C4c929c98c35D14` | `0xa678d193fEcC677e137a00FEFb43a9ccffA53210` |

### Interface

```solidity
interface IBazaarDiamond {

    // Events
    event DefaultFeeSet(uint8 side, uint256 fee);
    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDeferred(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeLockedBurned(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event MarketFeeSet(address token, uint8 side, uint256 fee);
    event OrderAdded(uint256 indexed orderId, address indexed token, address baseToken, uint256 tokenId, bool isERC20, uint8 side, address indexed sender, uint256 price, uint256 quantity);
    event OrderCancelled(uint256 orderId, tuple(uint256 orderId, address token, uint256 tokenId, bool isERC20, uint8 side, address owner, uint256 price, uint256 quantity, uint256 feePercent) order);
    event OrderExecuted(uint256 indexed orderId, address indexed initiator, uint256 quantity, uint256 remainingQuantity, uint256 price);

    // Static Functions
    function MIN_ORDER_VALUE() view returns (uint256);
    function PRICE_FACTOR() view returns (uint256);
    function defaultPrecision() view returns (uint256);
    function maxTotalPrice() view returns (uint256);
    function nextOrderId() view returns (uint256);
    function paused() view returns (bool);
    function powerUpManagerAddress() view returns (address);
    function precisionOverride(address) view returns (uint256);
    function useWeth() view returns (bool);

    // Read-Only Functions
    function calcFee(address _token, uint8 _side, uint256 _quantity) view returns (uint256);
    function calcFeePercent(address _user, address _token, uint8 _side) view returns (uint256);
    function getBestOrder(address _token, uint256 _tokenId, uint8 _side) view returns (tuple(uint256 orderId, address token, uint256 tokenId, bool isERC20, uint8 side, address owner, uint256 price, uint256 quantity, uint256 feePercent));
    function getBestOrderId(address _token, uint256 _tokenId, uint8 _side) view returns (uint256, uint256);
    function getBestOrders(address _token, uint256 _tokenId) view returns (tuple(uint256 orderId, address token, uint256 tokenId, bool isERC20, uint8 side, address owner, uint256 price, uint256 quantity, uint256 feePercent) buyOrder, tuple(uint256 orderId, address token, uint256 tokenId, bool isERC20, uint8 side, address owner, uint256 price, uint256 quantity, uint256 feePercent) sellOrder);
    function getCostForQuantity(address _token, uint256 _tokenId, uint8 _side, uint256 _quantity) view returns (uint256, uint256);
    function getNumPrices(address _token, uint256 _tokenId, uint8 _side) view returns (uint256);
    function getOrderIdsAtPrice(address _token, uint256 _tokenId, uint8 _side, uint256 _price) view returns (uint256[], uint256[]);
    function getOrders(uint256[] _orderIds) view returns (tuple(uint256 orderId, address token, uint256 tokenId, bool isERC20, uint8 side, address owner, uint256 price, uint256 quantity, uint256 feePercent)[]);
    function getPrices(address _token, uint256 _tokenId, uint8 _side) view returns (uint256[]);
    function getQuantityUpToPrice(address _token, uint256 _tokenId, uint8 _side, uint256 _price) view returns (uint256);
    function getUserOpenOrderIds(address _user) view returns (uint256[]);

    // State-Changing Functions
    function cancelOrders(uint256[] _orderIds);
    function editOrders(tuple(uint256 orderId, uint256 newTotalPrice, uint256 newQuantity)[] _inputs) payable;
    function makeOrders(tuple(address token, uint256 tokenId, uint8 side, uint256 totalPrice, uint256 quantity, bool addUnfilledOrderToOrderbook, bool isERC20)[] _inputs) payable;

}
```

### ABI

{% file src="/files/PlCtCfeMFjusb6AQTQFC" %}

## Types

### Order

An open order book order stored on the blockchain in the Bazaar contract.

```solidity
struct Order {
    uint256 orderId;
    address token;
    uint256 tokenId;
    bool isERC20;
    Side side;
    address owner;
    uint256 price;
    uint256 quantity;
    uint256 feePercent;
}
```

<table><thead><tr><th width="183.33333333333331">Name</th><th width="143">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>orderId</code></strong></td><td><code>uint256</code></td><td>The unique ID of the Order</td></tr><tr><td><strong><code>token</code></strong></td><td><code>address</code></td><td>The contract address of the transacted token</td></tr><tr><td><strong><code>tokenId</code></strong></td><td><code>uint256</code></td><td>The <code>id</code> of an ERC-1155 token, or <code>0</code> for an ERC-20 token</td></tr><tr><td><strong><code>isERC20</code></strong></td><td><code>bool</code></td><td>Whether the token is an ERC-20 (<code>true</code>), as opposed to ERC-1155 (<code>false</code>)</td></tr><tr><td><strong><code>side</code></strong></td><td><a href="#side"><code>Side</code></a></td><td>The side of the order - <code>0</code> for buy; <code>1</code> for sell</td></tr><tr><td><strong><code>owner</code></strong></td><td><code>address</code></td><td>The <code>0x</code> address of the wallet that created the order</td></tr><tr><td><strong><code>price</code></strong></td><td><code>uint256</code></td><td>The price per unit of the <code>token</code> stored as <code>unitPrice (in wei) * 10^12</code></td></tr><tr><td><strong><code>quantity</code></strong></td><td><code>uint256</code></td><td>The quantity of <code>token</code> to be transacted, expressed in <code>wei</code></td></tr><tr><td><strong><code>feePercent</code></strong></td><td><code>uint256</code></td><td>The fee percent paid/to be paid by the order <code>owner</code>, expressed as <code>decimalPercent * 10000</code> (e.g. <code>1500</code> for 1.5%, <code>1400</code> for 1.4%, and <code>1000</code> for 1%)</td></tr></tbody></table>

### OrderInput

The input struct to the `makeOrders` function to create one or more new [Orders](#order).

```solidity
struct OrderInput {
    address token;
    uint256 tokenId;
    Side side;
    uint256 totalPrice;
    uint256 quantity;
    bool addUnfilledOrderToOrderbook;
    bool isERC20;
}
```

<table><thead><tr><th width="206.33333333333331">Name</th><th width="117">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>token</code></strong></td><td><code>address</code></td><td>The contract address of the transacted token</td></tr><tr><td><strong><code>tokenId</code></strong></td><td><code>uint256</code></td><td>The <code>id</code> of an ERC-1155 token, or <code>0</code> for an ERC-20 token</td></tr><tr><td><strong><code>side</code></strong></td><td><a href="#side"><code>Side</code></a></td><td>The side of the order - <code>0</code> for buy; <code>1</code> for sell</td></tr><tr><td><strong><code>totalPrice</code></strong></td><td><code>uint256</code></td><td>The total price of the order expressed as <code>unitPrice (in wei) * quantity (in wei) / 10^(tokenDecimals)</code></td></tr><tr><td><strong><code>quantity</code></strong></td><td><code>uint256</code></td><td>The quantity of <code>token</code> to be transacted, expressed in <code>wei</code></td></tr><tr><td><strong><code>addUnfilledOrderToOrderbook</code></strong></td><td><code>bool</code></td><td>Whether any unfilled portion of the order should be placed on the order book (<code>true</code>) or not (<code>false</code>)</td></tr><tr><td><strong><code>isERC20</code></strong></td><td><code>bool</code></td><td>Whether the token is an ERC-20 (<code>true</code>), as opposed to ERC-1155 (<code>false</code>)</td></tr></tbody></table>

### EditOrderInput

The input struct to the `editOrders` function to edit one or more existing [Orders](#order).

```solidity
struct EditOrderInput {
    uint256 orderId;
    uint256 newTotalPrice;
    uint256 newQuantity;
}
```

<table><thead><tr><th width="206.33333333333331">Name</th><th width="117">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>orderId</code></strong></td><td><code>uint256</code></td><td>The <code>orderId</code> of the <a href="#order">Order</a> to be edited</td></tr><tr><td><strong><code>newTotalPrice</code></strong></td><td><code>uint256</code></td><td>The new total price of the order expressed as <code>unitPrice (in wei) * quantity (in wei) / 10^(tokenDecimals)</code></td></tr><tr><td><strong><code>newQuantity</code></strong></td><td><code>uint256</code></td><td>The new quantity of <code>token</code> to be transacted, expressed in <code>wei</code></td></tr></tbody></table>

### Side

The side (buy or sell) of the order book that an [Order](#order) is created or stored on.

```solidity
enum Side {
    BUY,
    SELL
}
```

<table><thead><tr><th width="139.33333333333331">Name</th><th width="105">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>BUY</code></td><td><code>0</code></td><td>The <code>buy</code> side of the order book</td></tr><tr><td><code>SELL</code></td><td><code>1</code></td><td>The <code>sell</code> side of the order book</td></tr></tbody></table>

## Events

### OrderAdded

{% code fullWidth="false" %}

```solidity
event OrderAdded(
    uint256 indexed orderId,
    address indexed token,
    address baseToken,
    uint256 tokenId,
    bool isERC20,
    uint8 side,
    address indexed sender,
    uint256 price,
    uint256 quantity
);
```

{% endcode %}

Emitted whenever an [Order](#order) is added to the order book by the [makeOrders](#makeorders) or [editOrders](#editorders) functions.

<table><thead><tr><th width="183.33333333333331">Name</th><th width="143">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>orderId</code></strong></td><td><code>uint256</code></td><td>The unique ID of the <a href="#order">Order</a></td></tr><tr><td><strong><code>token</code></strong></td><td><code>address</code></td><td>The contract address of the transacted token</td></tr><tr><td><strong><code>baseToken</code></strong></td><td><code>address</code></td><td>The contract address of the base token (JEWEL)</td></tr><tr><td><strong><code>tokenId</code></strong></td><td><code>uint256</code></td><td>The <code>id</code> of an ERC-1155 token, or <code>0</code> for an ERC-20 token</td></tr><tr><td><strong><code>isERC20</code></strong></td><td><code>bool</code></td><td>Whether the token is an ERC-20 (<code>true</code>), as opposed to ERC-1155 (<code>false</code>)</td></tr><tr><td><strong><code>side</code></strong></td><td><code>uint8</code></td><td>The <a href="#side"><code>Side</code></a> of the order - <code>0</code> for buy; <code>1</code> for sell</td></tr><tr><td><strong><code>sender</code></strong></td><td><code>address</code></td><td>The <code>0x</code> address of the wallet creating the order</td></tr><tr><td><strong><code>price</code></strong></td><td><code>uint256</code></td><td>The price per unit of the <code>token</code> expressed as <code>unitPrice (in wei) * 10^12</code></td></tr><tr><td><strong><code>quantity</code></strong></td><td><code>uint256</code></td><td>The quantity of <code>token</code> being transacted, expressed in <code>wei</code></td></tr></tbody></table>

### OrderCancelled

```solidity
event OrderCancelled(
    uint256 orderId,
    tuple(
        uint256 orderId,
        address token,
        uint256 tokenId,
        bool isERC20,
        uint8 side,
        address owner,
        uint256 price,
        uint256 quantity,
        uint256 feePercent
    ) Order
);
```

Emitted whenever an [Order](#order) is cancelled by the [cancelOrders](#cancelorders) or [editOrders](#editorders) functions.

<table><thead><tr><th width="137.33333333333331">Name</th><th width="115">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>orderId</code></strong></td><td><code>uint256</code></td><td>The unique ID of the <a href="#order">Order</a></td></tr><tr><td><strong><code>order</code></strong></td><td><a href="#order"><code>Order</code></a></td><td>The full <a href="#order">Order</a> struct</td></tr></tbody></table>

### OrderExecuted

```solidity
event OrderExecuted(
    uint256 indexed orderId,
    address indexed initiator,
    uint256 quantity,
    uint256 remainingQuantity,
    uint256 price
);
```

Emitted whenever an [Order](#order) is executed by the [makeOrders](#makeorders) or [editOrders](#editorders) function.

<table><thead><tr><th width="219.33333333333331">Name</th><th width="113">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>orderId</code></strong></td><td><code>uint256</code></td><td>The unique ID of the <a href="#order">Order</a></td></tr><tr><td><strong><code>initiator</code></strong></td><td><code>address</code></td><td>The <code>0x</code> address of the wallet initiating the order execution</td></tr><tr><td><strong><code>quantity</code></strong></td><td><code>uint256</code></td><td>The quantity of <code>token</code> being transacted, expressed in <code>wei</code></td></tr><tr><td><strong><code>remainingQuantity</code></strong></td><td><code>uint256</code></td><td>The remaining quantity of the <code>token</code> left in the order, expressed in <code>wei</code></td></tr><tr><td><strong><code>price</code></strong></td><td><code>uint256</code></td><td>The price per unit of the <code>token</code> expressed as <code>unitPrice (in wei) * 10^12</code></td></tr></tbody></table>

## State-Changing Functions

### cancelOrders

```solidity
function cancelOrders(uint256[] _orderIds);
```

Removes one or more open [Orders](#order) that are owned by the `msg.sender` from the order book.

* Emits [`OrderCancelled`](#ordercancelled)

### editOrders

```solidity
function editOrders(
  tuple(
    uint256 orderId,
    uint256 newTotalPrice,
    uint256 newQuantity
  )[] EditOrderInput
) payable;
```

Given one or more [`EditOrderInput`](#editorderinput) structs, cancels each [Order](#order) and creates a new Order with the same `token` and other parameters, but with a new `totalPrice` and/or `quantity`.

* Editing a `buy` order on DFK Chain must submit the appropriate `totalPrice` + `fee` as `value` with the transaction.
* Editing a `sell` order must have already approved the appropriate `quantity` of `token` to the Bazaar contract.
* Emits [`OrderAdded`](#orderadded), [`OrderCancelled`](#ordercancelled), [`OrderExecuted`](#orderexecuted)

### makeOrders

```solidity
function makeOrders(
  tuple(
    address token,
    uint256 tokenId,
    uint8 side,
    uint256 totalPrice,
    uint256 quantity,
    bool addUnfilledOrderToOrderbook,
    bool isERC20
  )[] OrderInput
) payable;
```

Given one or more [`OrderInput`](#orderinput) structs, creates an [Order](#order) for each and executes on it when possible.

* A `buy` order on DFK Chain must submit the appropriate `totalPrice` + `fee` as `value` with the transaction.
* A `sell` order must have already approved the appropriate `quantity` of `token` to the Bazaar contract.
* Emits [`OrderAdded`](#orderadded), [`OrderExecuted`](#orderexecuted)

## Related Pages

{% content-ref url="/pages/zcWw5HYUjNNTn8srcE6n" %}
[Bazaar](/api/community-graphql-api/bazaar)
{% endcontent-ref %}


# Sales & Rentals


# Hero Auction

## Contracts

### Addresses

#### DFK Chain

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| DFK Chain | `0xc390fAA4C7f66E4D62E59C231D5beD32Ff77BEf0` | `0xb9b4C20165a421E7208494A38a37679c7F334770` |
| Kaia      | `0x7F2B66DB2D02f642a9eb8d13Bc998d441DDe17A8` | `0x72e4bBe95Af9fA4A94627974EF738f3A8E0103e7` |
| Metis     | `0xD035eb0ebDf22eD8B9B4309a3f72C7CAC03dca8F` | `0x4a737026ba0f4e4c75675AEaE46E97A2A8F649D1` |

### Interfaces

```solidity
interface IHeroAuctionUpgradeable {

    event AuctionCancelled(uint256 auctionId, uint256 indexed tokenId);
    event AuctionCreated(uint256 auctionId, address indexed owner, uint256 indexed tokenId, uint256 startingPrice, uint256 endingPrice, uint256 duration, address winner);
    event AuctionSuccessful(uint256 auctionId, uint256 indexed tokenId, uint256 totalPrice, address winner);
    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);    
    
    function ERC721() view returns (address);
    function assistingAuction() view returns (address);
    function auctionIdOffset() view returns (uint256);
    function auctions(uint256) view returns (address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open);
    function bid(uint256 _tokenId, uint256 _bidAmount);
    function bidFor(address _bidder, uint256 _tokenId, uint256 _bidAmount);
    function cancelAuction(uint256 _tokenId);
    function cancelAuctionWhenPaused(uint256 _tokenId);
    function createAuction(uint256 _tokenId, uint128 _startingPrice, uint128 _endingPrice, uint64 _duration, address _winner);
    function feeAddresses(uint256) view returns (address);
    function feePercents(uint256) view returns (uint256);
    function getAuction(uint256 _tokenId) view returns (tuple(address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open));
    function getAuctions(uint256[] _tokenIds) view returns (tuple(address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open)[]);
    function getCurrentPrice(uint256 _tokenId) view returns (uint256);
    function getUserAuctions(address _address) view returns (uint256[]);
    function isOnAuction(uint256 _tokenId) view returns (bool);
    function ownerCut() view returns (uint256);
    function paused() view returns (bool);
    function powerToken() view returns (address);
    function totalAuctions() view returns (uint256);
    function userAuctions(address, uint256) view returns (uint256);

}
```

### ABIs

{% file src="/files/vT9Z9NIk07jfius7xjhT" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### Harmony

| Name        | Mainnet                                      | Testnet                                      |
| ----------- | -------------------------------------------- | -------------------------------------------- |
| SaleAuction | `0x13a65B9F8039E2c032Bc022171Dc05B30c3f2892` | `0xC839907F3341540C29F1F583e65A111847cc9203` |

### Interfaces

```solidity
interface ISaleAuction {

    event AuctionCancelled(uint256 auctionId, uint256 indexed tokenId);
    event AuctionCreated(uint256 auctionId, address indexed owner, uint256 indexed tokenId, uint256 startingPrice, uint256 endingPrice, uint256 duration, address winner);
    event AuctionSuccessful(uint256 auctionId, uint256 indexed tokenId, uint256 totalPrice, address winner);
    
    function assistingAuction() view returns (address);
    function auctionHeroCore() view returns (address);
    function bid(uint256 _tokenId, uint256 _bidAmount);
    function cancelAuction(uint256 _tokenId);
    function cancelAuctionWhenPaused(uint256 _tokenId);
    function createAuction(uint256 _tokenId, uint128 _startingPrice, uint128 _endingPrice, uint64 _duration, address _winner);
    function getAuction(uint256 _tokenId) view returns (uint256 auctionId, address seller, uint256 startingPrice, uint256 endingPrice, uint256 duration, uint256 startedAt);
    function getCurrentPrice(uint256 _tokenId) view returns (uint256);
    function getUserAuctions(address _address) view returns (uint256[]);
    function isOnAuction(uint256 _tokenId) view returns (bool);
    function jewelToken() view returns (address);
    function maxPrice() view returns (uint256);
    function minPrice() view returns (uint256);
    function ownerCut() view returns (uint256);
    function paused() view returns (bool);
    function userAuctions(address, uint256) view returns (uint256);

}
```

### ABIs

{% file src="/files/ZyRKVvh8zK13IBmM4be5" %}


# Hero Rental

## Contracts

### Addresses

#### DFK Chain

<table><thead><tr><th width="263.3333333333333">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>AssistingAuction</td><td><code>0x8101CfFBec8E045c3FAdC3877a1D30f97d301209</code></td><td><code>0x846635615609a8dd88eA4A92dA1F1Ba6880a9Eb5</code></td></tr></tbody></table>

#### Klaytn

<table><thead><tr><th width="263.3333333333333">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>AssistingAuction</td><td><code>0xA2cef1763e59198025259d76Ce8F9E60d27B17B5</code></td><td><code>0xAd51199B453075C73FA106aFcAAD59f705EF7872</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IAssistingAuctionUpgradeable {

    event AuctionCancelled(uint256 auctionId, uint256 indexed tokenId);
    event AuctionCreated(uint256 auctionId, address indexed owner, uint256 indexed tokenId, uint256 startingPrice, uint256 endingPrice, uint256 duration, address winner);
    event AuctionSuccessful(uint256 auctionId, uint256 indexed tokenId, uint256 totalPrice, address winner);
    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    
    function auctionIdOffset() view returns (uint256);
    function auctions(uint256) view returns (address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open);
    function bidFor(address _bidder, uint256 _tokenId, uint256 _bidAmount);
    function cancelAuction(uint256 _tokenId);
    function cancelAuctionWhenPaused(uint256 _tokenId);
    function createAuction(uint256 _tokenId, uint128 _startingPrice, uint128 _endingPrice, uint64 _duration, address _winner);
    function feeAddresses(uint256) view returns (address);
    function feePercents(uint256) view returns (uint256);
    function getAuction(uint256 _tokenId) view returns (tuple(address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open));
    function getAuctions(uint256[] _tokenIds) view returns (tuple(address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open)[]);
    function getCurrentPrice(uint256 _tokenId) view returns (uint256);
    function getUserAuctions(address _address) view returns (uint256[]);
    function isOnAuction(uint256 _tokenId) view returns (bool);
    function ownerCut() view returns (uint256);
    function paused() view returns (bool);
    function powerToken() view returns (address);
    function totalAuctions() view returns (uint256);
    function userAuctions(address, uint256) view returns (uint256);

}
```

### ABIs

{% file src="/files/FpQBOQk62LK0y4iDlOjs" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

{% hint style="info" %}
From 10/23/2022 until 1/15/2022, the AssistingAuction contract on Harmony also contained the `summonCrystal` and `open` functions and related events for the summoning of all Heroes, including those summoned through an Assisting Auction. On 1/15/2022, these were migrated to the [Hero Summoning](/contracts/summoning/hero-summoning) contract.
{% endhint %}

### Addresses

#### Harmony

| Name             | Mainnet                                      | Testnet                                      |
| ---------------- | -------------------------------------------- | -------------------------------------------- |
| AssistingAuction | `0x65DEA93f7b886c33A78c10343267DD39727778c2` | `0x5f5a567140A4b7A0406f568B152aA4bc3aCda8Ed` |

### Interfaces

```solidity
interface IAssistingAuction {

    event AuctionCancelled(uint256 auctionId, uint256 indexed tokenId);
    event AuctionCreated(uint256 auctionId, address indexed owner, uint256 indexed tokenId, uint256 startingPrice, uint256 endingPrice, uint256 duration, address winner);
    event AuctionSuccessful(uint256 auctionId, uint256 indexed tokenId, uint256 totalPrice, address winner);
    
    function auctionHeroCore() view returns (address);
    function bid(uint256 _tokenId, uint256 _bidAmount);
    function cancelAuction(uint256 _tokenId);
    function cancelAuctionWhenPaused(uint256 _tokenId);
    function createAuction(uint256 _tokenId, uint128 _startingPrice, uint128 _endingPrice, uint64 _duration, address _winner);
    function getAuction(uint256 _tokenId) view returns (uint256 auctionId, address seller, uint256 startingPrice, uint256 endingPrice, uint256 duration, uint256 startedAt);
    function getCurrentPrice(uint256 _tokenId) view returns (uint256);
    function getUserAuctions(address _address) view returns (uint256[]);
    function isOnAuction(uint256 _tokenId) view returns (bool);
    function jewelToken() view returns (address);
    function maxPrice() view returns (uint256);
    function minPrice() view returns (uint256);
    function ownerCut() view returns (uint256);
    function paused() view returns (bool);
    function userAuctions(address, uint256) view returns (uint256)

}
```

### ABIs

{% file src="/files/IHp9rKyhGwGV6LirMzZQ" %}


# Equipment Auction

## Contracts

### Addresses

#### DFK Chain

| Name             | Mainnet                                      | Testnet                                      |
| ---------------- | -------------------------------------------- | -------------------------------------------- |
| WeaponAuction    | `0x5C7d6ce011FDFCA8C6DB988206DEfAA6bb7E5269` | `0x5465dA4f04b750E2226Fa7838F9f28A55f3e3B9E` |
| ArmorAuction     | `0xF063bF01075884BdCfD0e16976cE34AFdae2Db3C` | `0xF6227e90c9D81c0911a422e72B25524E30cE6430` |
| AccessoryAuction | `0x5e57E11B319CFb4fb1c3D02231423fDA5aaF2038` | `0x6bFcCca9c0A66F2E9eed79F103498113Bdb0f786` |

#### Kaia

| Name             | Mainnet                                      | Testnet                                      |
| ---------------- | -------------------------------------------- | -------------------------------------------- |
| WeaponAuction    | `0x4eE3AdD88318c5E0d22c3b4B5C3ae6838146F524` | `0x7BEe3C60Fc30fFce7De1111405d50b07885C0d51` |
| ArmorAuction     | `0xAD5Ee02c8a9b330Ddd04D28d5019351Dc30A9644` | `0x8A46AE82311048D99ad694249630cA03BAaFdcBd` |
| AccessoryAuction | `0xc47Cb5de364D5fe6d0aaA34Af032675bdb5f79e0` | `0xF8AF80251b952A86A174C828d35999F2D94B6897` |

#### Metis

| Name             | Mainnet                                      | Testnet                                      |
| ---------------- | -------------------------------------------- | -------------------------------------------- |
| WeaponAuction    | `0xf4Ad97B1f8855D3e18c614C774E392D7CC70Ac0A` | `0xC60E980721eed7D3bde3e6Ab0E032647394ddB6c` |
| ArmorAuction     | `0xeD20092C3BB5f310FD3597f66286e9df92fb09EC` | `0x2e33Acf05d619080dB31A973F242E77AaCb33499` |
| AccessoryAuction | `0xeD5Ef0dD008D6fFBB9773297ba8Ef185F59ECC88` | `0xEF7ad9f2d6fbE73DCd5A84011196c4bB49A46471` |

### Interfaces

The Interfaces for all three equipment auction contracts are identical.

```solidity
interface IEquipmentAuction {
    
    event AuctionCancelled(uint256 auctionId, uint256 indexed tokenId);
    event AuctionCreated(uint256 auctionId, address indexed owner, uint256 indexed tokenId, uint256 startingPrice, uint256 endingPrice, uint256 duration, address winner);
    event AuctionSuccessful(uint256 auctionId, uint256 indexed tokenId, uint256 totalPrice, address winner);
    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDeferred(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeLockedBurned(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);

    function auctionIdOffset() view returns (uint256);
    function auctions(uint256) view returns (address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open);
    function bid(uint256 _tokenId, uint256 _bidAmount);
    function bidFor(address _bidder, uint256 _tokenId, uint256 _bidAmount);
    function cancelAuction(uint256 _tokenId);
    function cancelAuctionWhenPaused(uint256 _tokenId);
    function createAuction(uint256 _tokenId, uint128 _startingPrice, uint128 _endingPrice, uint64 _duration, address _winner);
    function feeAddresses(uint256) view returns (address);
    function feePercents(uint256) view returns (uint256);
    function getAuction(uint256 _tokenId) view returns (tuple(address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open));
    function getAuctions(uint256[] _tokenIds) view returns (tuple(address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open)[]);
    function getCurrentPrice(uint256 _tokenId) view returns (uint256);
    function getUserAuctions(address _address) view returns (uint256[]);
    function heroCore() view returns (address);
    function isOnAuction(uint256 _tokenId) view returns (bool);
    function onERC721Received(address, address, uint256, bytes) pure returns (bytes4);
    function ownerCut() view returns (uint256);
    function paused() view returns (bool);
    function powerToken() view returns (address);
    function totalAuctions() view returns (uint256);
    function userAuctions(address, uint256) view returns (uint256);

}
```

### ABIs

{% file src="/files/3rwQ2G9FOjtPNHckwbz7" %}

{% file src="/files/MxyveKrEDx16yPS2rPwf" %}

{% file src="/files/PD9OpQVjmB2F0rzkWF1k" %}


# Pet Auction

## Contracts

### Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| DFK Chain | `0x49744F76caA3B63CccE9CE7de5C8282C92c891e5` | `0x3dF6453a977d6e946E2229d03e4feD7f8ad950f3` |
| Kaia      | `0x7aB1C574A8762bEde901F32670481c0427DdF626` | `0xD0582fDAfB3f569D5Ef8E243cc312176a7c2C5dc` |
| Metis     | `0xB03CD47153Fbb111Fc8e4356b4fd86c614f7832E` | `0x869B64EEE22B6e9A9a59D2Bd5a3f8629DF063888` |

### Interfaces

```solidity
interface IPetAuction {

    event AuctionCancelled(uint256 auctionId, uint256 indexed tokenId);
    event AuctionCreated(uint256 auctionId, address indexed owner, uint256 indexed tokenId, uint256 startingPrice, uint256 endingPrice, uint256 duration, address winner);
    event AuctionSuccessful(uint256 auctionId, uint256 indexed tokenId, uint256 totalPrice, address winner);
    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    
    function auctionIdOffset() view returns (uint256);
    function auctions(uint256) view returns (address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open);
    function bid(uint256 _tokenId, uint256 _bidAmount);
    function bidFor(address _bidder, uint256 _tokenId, uint256 _bidAmount);
    function cancelAuction(uint256 _tokenId);
    function cancelAuctionWhenPaused(uint256 _tokenId);
    function createAuction(uint256 _tokenId, uint128 _startingPrice, uint128 _endingPrice, uint64 _duration, address _winner);
    function feeAddresses(uint256) view returns (address);
    function feePercents(uint256) view returns (uint256);
    function getAuction(uint256 _tokenId) view returns (tuple(address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open));
    function getAuctions(uint256[] _tokenIds) view returns (tuple(address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open)[]);
    function getCurrentPrice(uint256 _tokenId) view returns (uint256);
    function getUserAuctions(address _address) view returns (uint256[]);
    function isOnAuction(uint256 _tokenId) view returns (bool);
    function maxPrice() view returns (uint256);
    function minPrice() view returns (uint256);
    function ownerCut() view returns (uint256);
    function paused() view returns (bool);
    function powerToken() view returns (address);
    function totalAuctions() view returns (uint256);
    function userAuctions(address, uint256) view returns (uint256);

}
```

### ABIs

{% file src="/files/jV9RXR2vqYBNOA3K3E8F" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

| Name       | Mainnet                                      | Testnet                                      |
| ---------- | -------------------------------------------- | -------------------------------------------- |
| PetAuction | `0x72F860bF73ffa3FC42B97BbcF43Ae80280CFcdc3` | `0x13A757e733535B1827dBD6Aa9E9B6D51B1578B69` |


# Land Auction

## Contracts

### Addresses

#### Klaytn

| Name        | Mainnet                                      | Testnet                                      |
| ----------- | -------------------------------------------- | -------------------------------------------- |
| LandAuction | `0xE74D437d5F4893dB0A5758f5EaeB5B3Af6096036` | `0x573E2A90bF86Cff5DBA03b1782C09e89cdb5573B` |

### Interfaces

```solidity
interface ILandAuction {

    event AuctionCancelled(uint256 auctionId, uint256 indexed tokenId);
    event AuctionCreated(uint256 auctionId, address indexed owner, uint256 indexed tokenId, uint256 startingPrice, uint256 endingPrice, uint256 duration, address winner);
    event AuctionSuccessful(uint256 auctionId, uint256 indexed tokenId, uint256 totalPrice, address winner);
    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);

    function ERC721() view returns (address);
    function auctionIdOffset() view returns (uint256);
    function auctions(uint256) view returns (address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open);
    function bid(uint256 _tokenId, uint256 _bidAmount);
    function bidFor(address _bidder, uint256 _tokenId, uint256 _bidAmount);
    function cancelAuction(uint256 _tokenId);
    function cancelAuctionWhenPaused(uint256 _tokenId);
    function createAuction(uint256 _tokenId, uint128 _startingPrice, uint128 _endingPrice, uint64 _duration, address _winner);
    function feeAddresses(uint256) view returns (address);
    function feePercents(uint256) view returns (uint256);
    function getAuction(uint256 _tokenId) view returns (tuple(address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open));
    function getAuctions(uint256[] _tokenIds) view returns (tuple(address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open)[]);
    function getCurrentPrice(uint256 _tokenId) view returns (uint256);
    function getUserAuctions(address _address) view returns (uint256[]);
    function isOnAuction(uint256 _tokenId) view returns (bool);
    function ownerCut() view returns (uint256);
    function paused() view returns (bool);
    function powerToken() view returns (address);
    function totalAuctions() view returns (uint256);
    function userAuctions(address, uint256) view returns (uint256);

}
```

### ABIs

{% file src="/files/ozMnZ3gaJNfmCHgvGaOn" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### Harmony

| Name        | Mainnet                                      | Testnet                                      |
| ----------- | -------------------------------------------- | -------------------------------------------- |
| LandAuction | `0x77D991987ca85214f9686131C58c1ABE4C93E547` | `0xE54D5904F20Df8305cE7318bAD431c450106254A` |

### Interfaces

```solidity
interface ILandAuction {

    event AuctionCancelled(uint256 auctionId, uint256 indexed tokenId);
    event AuctionCreated(uint256 auctionId, address indexed owner, uint256 indexed tokenId, uint256 startingPrice, uint256 endingPrice, uint256 duration, address winner);
    event AuctionSuccessful(uint256 auctionId, uint256 indexed tokenId, uint256 totalPrice, address winner);

    function auctionIdOffset() view returns (uint256);
    function auctions(uint256) view returns (address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open);
    function bid(uint256 _tokenId, uint256 _bidAmount);
    function bidFor(address _bidder, uint256 _tokenId, uint256 _bidAmount);
    function cancelAuction(uint256 _tokenId);
    function cancelAuctionWhenPaused(uint256 _tokenId);
    function createAuction(uint256 _tokenId, uint128 _startingPrice, uint128 _endingPrice, uint64 _duration, address _winner);
    function getAuction(uint256 _tokenId) view returns (tuple(address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open));
    function getAuctions(uint256[] _tokenIds) view returns (tuple(address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open)[]);
    function getCurrentPrice(uint256 _tokenId) view returns (uint256);
    function getUserAuctions(address _address) view returns (uint256[]);
    function isOnAuction(uint256 _tokenId) view returns (bool);
    function jewelToken() view returns (address);
    function maxPrice() view returns (uint256);
    function minPrice() view returns (uint256);
    function ownerCut() view returns (uint256);
    function paused() view returns (bool);
    function totalAuctions() view returns (uint256);
    function userAuctions(address, uint256) view returns (uint256);
    
}
```

### ABIs

{% file src="/files/BV8tdMIz8D7Qkhwyidtw" %}


# Summoning


# Hero Summoning

## Contracts

### Addresses

#### DFK Chain

<table><thead><tr><th width="262.3333333333333">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>HeroSummoning</td><td><code>0xBc36D18662Bb97F9e74B1EAA1B752aA7A44595A7</code></td><td><code>0x1017c852e3731FaD2e893e80C6916D71Cf0B0A0a</code></td></tr><tr><td>CrystalCore</td><td><code>0x68f6C64786cfCb35108986041D1009c9d27bde22</code></td><td><code>0x51aacFeA9be0d10032aC66dF69F72Cc78730b162</code></td></tr></tbody></table>

#### Klaytn

<table><thead><tr><th width="262.3333333333333">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>HeroSummoning</td><td><code>0xb086584f476Ad21B40aF0672f385a67334A0b294</code></td><td><code>0x2C2D54137350FE5947e5483E0d0B5398cB34B792</code></td></tr><tr><td>CrystalCore</td><td><code>0x13cE9c99E8E2fcDe1632adA7B69b2eCf5BE8ED45</code></td><td><code>0xBC5248B4f50f4c7D2F9A67Be1f1d4b8be44ffc75</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IHeroSummoning {
    
    event CrystalAirdrop(address indexed owner, uint256 crystalId, uint256 createdBlock);
    event CrystalDarkSummoned(uint256 crystalId, address indexed owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint8 summonerTears, uint8 assistantTears, address enhancementStone);
    event CrystalOpen(address indexed owner, uint256 crystalId, uint256 heroId);
    event CrystalSummoned(uint256 crystalId, address indexed owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint8 summonerTears, uint8 assistantTears, address enhancementStone);
    event EnhancementStoneAdded(address atunementItemAddress);
    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDeferred(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeLockedBurned(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    
    function activeEnhancementStones(address) view returns (bool);
    function approveAuctionSpending(address _address, uint256 _amount);
    function baseCooldown() view returns (uint256);
    function baseSummonFee() view returns (uint256);
    function calculateSummoningCost(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) _hero) view returns (uint256);
    function cooldownPerGen() view returns (uint256);
    function feeAddresses(uint256) view returns (address);
    function feePercents(uint256) view returns (uint256);
    function increasePerGen() view returns (uint256);
    function increasePerSummon() view returns (uint256);
    function paused() view returns (bool);
    function powerToken() view returns (address);
    function summonCrystal(uint256 _summonerId, uint256 _assistantId, uint16 _summonerTears, uint16 _assistantTears, address _enhancementStone);
    function summonCrystalWithAuction(uint256 _summonerId, uint256 _assistantId, uint16 _summonerTears, uint16 _assistantTears, address _enhancementStone, address _assistingAuctionAddress, uint256 _hireAmount);
    function summonCrystalWithAuctionWithLocked(uint256 _summonerId, uint256 _assistantId, uint16 _summonerTears, uint16 _assistantTears, address _enhancementStone, address _assistingAuctionAddress, uint256 _hireAmount);
    function summonCrystalWithLocked(uint256 _summonerId, uint256 _assistantId, uint16 _summonerTears, uint16 _assistantTears, address _enhancementStone);
    
}
```

```solidity
interface ICrystalCore {
    
    event CrystalAirdrop(address indexed owner, uint256 crystalId, uint256 createdBlock);
    event CrystalDarkSummoned(uint256 crystalId, address indexed owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint8 summonerTears, uint8 assistantTears, address enhancementStone);
    event CrystalOpen(address indexed owner, uint256 crystalId, uint256 heroId);
    event CrystalSummoned(uint256 crystalId, address indexed owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint8 summonerTears, uint8 assistantTears, address enhancementStone);
    event EnhancementStoneAdded(address atunementItemAddress);
    
    function airdropCrystal(address _recipient, bool _isShiny);
    function createCrystal(address _owner, uint256 _summonerId, uint256 _assistantId, uint16 _generation, uint8 _summonerBonusTears, uint8 _assistantBonusTears, address _enhancementStone, uint32 _maxSummons, bool _darkSummoned, uint8 _rarityBonusCharges);
    function gen0Cap() view returns (uint256);
    function getCrystal(uint256 _crystalId) view returns (tuple(address owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint256 heroId, uint8 summonerTears, uint8 assistantTears, address enhancementStone, uint32 maxSummons, uint32 firstName, uint32 lastName, uint8 shinyStyle, bool darkSummoned, uint8 rarityBonusCharges));
    function getUserCrystals(address _address) view returns (uint256[]);
    function getUserCrystalsData(address _address) view returns (uint256[], tuple(address owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint256 heroId, uint8 summonerTears, uint8 assistantTears, address enhancementStone, uint32 maxSummons, uint32 firstName, uint32 lastName, uint8 shinyStyle, bool darkSummoned, uint8 rarityBonusCharges)[]);    
    function globalStartTime() view returns (uint256);
    function newSummonCooldown() view returns (uint256);
    function nextCrystalId() view returns (uint256);
    function open(uint256 _crystalId) returns (uint256);
    function paused() view returns (bool);
    function totalCrystals() view returns (uint256);
    function waitBlocks() view returns (uint256);

}
```

### ABIs

{% file src="/files/oOBlnTV31sUim526dfYp" %}

{% file src="/files/vWfU6bPF9UbiFKs8p3CU" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### Harmony

<table><thead><tr><th width="262.3333333333333">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>HeroSummoningUpgradable</td><td><code>0xf4d3aE202c9Ae516f7eb1DB5afF19Bf699A5E355</code></td><td><code>0x1702c7f5d67C0FDE65a8f3ed1a0C02c9FE4a5b99</code></td></tr></tbody></table>

The Hero Summoning functions on Harmony Mainnet were migrated several times:

<table><thead><tr><th width="460">Contract Address</th><th>From</th><th>Until</th></tr></thead><tbody><tr><td><code>0xf4d3aE202c9Ae516f7eb1DB5afF19Bf699A5E355</code></td><td>1/15/2022</td><td>9/21/2022</td></tr><tr><td><p><code>0x65dea93f7b886c33a78c10343267dd39727778c2</code><br></p><p><em>Note: this was also the</em> <a href="/pages/2UUI3ZrZ1wHjcjfDGm6D"><em>Assisting Auction</em></a> <em>contract</em></p></td><td>~10/23/2021</td><td>1/15/2022</td></tr><tr><td><code>0xa2D001C829328aa06a2DB2740c05ceE1bFA3c6bb</code></td><td>10/6/2021</td><td>~10/29/2021</td></tr></tbody></table>

### Interfaces

#### Harmony

```solidity
interface IHeroSummoningUpgradeable {

    event CrystalOpen(address indexed owner, uint256 crystalId, uint256 heroId);
    event CrystalSummoned(uint256 crystalId, address indexed owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint8 summonerTears, uint8 assistantTears, address enhancementStone);
    event EnhancementStoneAdded(address atunementItemAddress);
    
    function activeEnhancementStones(address) view returns (bool);
    function approveAuctionSpending(address _address, uint256 _amount);
    function baseCooldown() view returns (uint256);
    function baseSummonFee() view returns (uint256);
    function calculateSummoningCost(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) _hero) view returns (uint256);
    function cooldownPerGen() view returns (uint256);
    function createCrystal(address _owner, uint256 _summonerId, uint256 _assistantId, uint16 _generation, uint8 _summonerBonusTears, uint8 _assistantBonusTears, address _enhancementStone, uint32 _maxSummons);
    function crystalIdOffset() view returns (uint256);
    function crystals(uint256) view returns (address owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint256 heroId, uint8 summonerTears, uint8 assistantTears, address enhancementStone, uint32 maxSummons, uint32 firstName, uint32 lastName, uint8 shinyStyle);
    function determineRarity(uint256 _rarityRoll, uint256 _rarityMod) pure returns (uint8);
    function enabled() view returns (bool);
    function getCrystal(uint256 _crystalId) view returns (tuple(address owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint256 heroId, uint8 summonerTears, uint8 assistantTears, address enhancementStone, uint32 maxSummons, uint32 firstName, uint32 lastName, uint8 shinyStyle));
    function getUserCrystals(address _address) view returns (uint256[]);
    function increasePerGen() view returns (uint256);
    function increasePerSummon() view returns (uint256);
    function jewelToken() view returns (address);
    function newSummonCooldown() view returns (uint256);
    function open(uint256 _crystalId) returns (uint256);
    function paused() view returns (bool);
    function statScience() view returns (address);
    function summonCrystal(uint256 _summonerId, uint256 _assistantId, uint16 _summonerTears, uint16 _assistantTears, address _enhancementStone);
    function summonCrystalWithAuction(uint256 _summonerId, uint256 _assistantId, uint16 _summonerTears, uint16 _assistantTears, address _enhancementStone, address _assistingAuctionAddress, uint256 _hireAmount);
    function summonCrystalWithAuctionOld(uint256 _summonerId, uint256 _assistantId, uint16 _summonerTears, uint16 _assistantTears, address _enhancementStone, address _assistingAuctionAddress);
    function totalCrystals() view returns (uint256);
    function userCrystals(address, uint256) view returns (uint256);

}
```

### ABIs

{% file src="/files/AtUK0ykB5PJ3R3m9Qo1E" %}


# Dark Summoning

## Contracts

### Addresses

#### DFK Chain

<table><thead><tr><th width="262.3333333333333">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>DarkSummoning</td><td><code>0x70908Fd7278aab183C7EfC4f3449184E98e2e305</code></td><td><code>0xf366B5706c2C3caAe87107a04e73965eAd47988B</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IDarkSummoning {
    
    event CrystalAirdrop(address indexed owner, uint256 crystalId, uint256 createdBlock);
    event CrystalDarkSummoned(uint256 crystalId, address indexed owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint8 summonerTears, uint8 assistantTears, address enhancementStone);
    event CrystalOpen(address indexed owner, uint256 crystalId, uint256 heroId);
    event CrystalSummoned(uint256 crystalId, address indexed owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint8 summonerTears, uint8 assistantTears, address enhancementStone);
    event EnhancementStoneAdded(address atunementItemAddress);
    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDeferred(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeLockedBurned(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    
    function activeEnhancementStones(address) view returns (bool);
    function addEnhancementStone(address _address);
    function baseCooldown() view returns (uint256);
    function baseSummonFee() view returns (uint256);
    function calculateRarityBonusCost(uint8 _rarityBonusCharges) pure returns (uint256);
    function calculateSummoningCost(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) _hero) view returns (uint256);
    function cooldownPerGen() view returns (uint256);
    function feeAddresses(uint256) view returns (address);
    function feePercents(uint256) view returns (uint256);
    function increasePerGen() view returns (uint256);
    function increasePerSummon() view returns (uint256);
    function paused() view returns (bool);
    function powerToken() view returns (address);
    function summonCrystal(uint256 _summonerId, uint256 _assistantId, uint16 _summonerTears, uint16 _assistantTears, address _enhancementStone, uint8 _rarityBonusCharges);
    function summonCrystalWithLocked(uint256 _summonerId, uint256 _assistantId, uint16 _summonerTears, uint16 _assistantTears, address _enhancementStone, uint8 _rarityBonusCharges);
    
}
```

### ABIs

{% file src="/files/2zXcnvG5hjSy8kpjy4Dw" %}

## Related Contracts

{% content-ref url="/pages/VQipJ4xZiNKOTwnyWJpf" %}
[Hero Summoning](/contracts/summoning/hero-summoning)
{% endcontent-ref %}

{% content-ref url="/pages/UPDPwyYapDkXsoTyK4TQ" %}
[Graveyard](/contracts/miscellaneous/graveyard)
{% endcontent-ref %}


# Pet Hatching

## Contracts

### Addresses

<table><thead><tr><th width="157.33333333333331">Name</th><th width="287">Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>DFK Chain</td><td><code>0x564D03ccF4A9634D97100Ec18d7770A3C4E45541</code></td><td><code>0x0f6A6A3eaAd0C25cc82E1b7dB382bEC1b70eE452</code></td></tr><tr><td>Klaytn</td><td><code>0x22e656419Be8A0abf0B53D0941FfDC3B70Fea36e</code></td><td><code>0x81d9256c24A2b6A5c8602989e4eb11170b459E3f</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IPetHatching {

    event EggCracked(address indexed owner, uint256 indexed eggId, uint256 petId);
    event EggIncubated(address indexed owner, uint256 eggId, uint8 indexed eggType, uint8 indexed tier);
    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDeferred(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeLockedBurned(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event PetRerollStarted(uint256 indexed petId);
    event PetRerolled(uint256 indexed petId, tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo) petAfter);
    
    function completePetBonusReroll(uint256 _petId);
    function crack(uint256 _eggId) returns (uint256);
    function eggTypeCosts(uint256) view returns (address eggAddress, address itemAddress1, uint16 itemAmount1, address itemAddress2, uint16 itemAmount2);
    function feeAddresses(uint256) view returns (address);
    function feePercents(uint256) view returns (uint256);
    function getEgg(uint256 _eggId) view returns (tuple(uint256 id, uint256 petId, address owner, uint8 eggType, uint256 seedblock, uint256 finishTime, uint8 tier));
    function getUserEggs(address _address) view returns (uint256[]);
    function incubateEgg(uint8 _eggType, uint8 _tier);
    function incubateEggWithLocked(uint8 _eggType, uint8 _tier);
    function multiCompleteBonusReroll(uint256[] _petIds);
    function multiCrack(uint256[] _eggIds);
    function multiIncubate(uint8[] _eggTypes, uint8[] _tiers, bool[] _useLockedTokens);
    function multiStartBonusReroll(uint256[] _petIds);
    function originId() view returns (uint8);
    function paused() view returns (bool);
    function powerToken() view returns (address);
    function priceTiers(uint256) view returns (uint8 powerTokenCost, uint16 goldCost, uint8 tearCost, uint32 incubationTime, uint16 shinyChance);
    function rerollData(uint256) view returns (uint256 petId, uint256 seedblock, bool needsProfReroll, bool needsCraftReroll, bool needsCombatReroll);
    function season() view returns (uint8);
    function startPetBonusReroll(uint256 _petId);
    function totalEggs() view returns (uint256);

}
```

### ABIs

{% file src="/files/AvWDERQByGhmVY8yuJMz" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

| Name        | Mainnet                                      | Testnet                                      |
| ----------- | -------------------------------------------- | -------------------------------------------- |
| PetHatching | `0x576C260513204392F0eC0bc865450872025CB1cA` | `0x1263B2a59F17b829D2a53d18a2f459EB77f6801c` |


# Meditation Circle

## Stat Mappings

The Meditation Circle contract uses the following mappings for stats:

{% hint style="warning" %}
Note that the order of these mappings is different from those found on the [HeroCore](/nfts/heroes) contract, which uses `[Str, Int, Wis, Lck, Agi, Vit, End, Dex]` as the canonical order for Hero Stats and Stat Growth values. We hope to align these values in the future.
{% endhint %}

#### Stat Mappings

```json
{
    0: "Strength",
    1: "Agility",
    2: "Intelligence",
    3: "Wisdom",
    4: "Luck",
    5: "Vitality",
    6: "Endurance",
    7: "Dexterity",
    8: "HP",
    9: "MP",
    10: "Stamina"
}
```

#### Stat-Up Update Types

```json
{
    0: "PRIMARY",
    1: "SECONDARY",
    2: "BONUS",
    3: "RARITY",
    4: "HP",
    5: "MP",
    6: "STAMINA",
    7: "PRIMARY_ATTUNEMENT",
    8: "SECONDARY_ATTUNEMENT"
}
```

## Contracts

### Addresses

#### DFK Chain

| Name             | Mainnet                                      | Testnet                                      |
| ---------------- | -------------------------------------------- | -------------------------------------------- |
| MeditationCircle | `0xD507b6b299d9FC835a0Df92f718920D13fA49B47` | `0xdC95B65914626be8f2dD3d5D0eCD6842a4Dec722` |

#### Klaytn

| Name             | Mainnet                                      | Testnet                                      |
| ---------------- | -------------------------------------------- | -------------------------------------------- |
| MeditationCircle | `0xdbEE8C336B06f2d30a6d2bB3817a3Ae0E34f4900` | `0x24DEbA3A73ACF76eDCfcafD75683a6064e01E77c` |

### Interfaces

{% hint style="info" %}
The `MeditationBegunWithLevel` event was added on DFK Chain around Block #11268573 and on Klaytn around Block #109509600.
{% endhint %}

```solidity
interface IMeditationCircle {

    // Events
    event AttunementCrystalAdded(address atunementItemAddress);
    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDeferred(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeLockedBurned(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event LevelUp(address indexed player, uint256 indexed heroId, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) hero, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) oldHero);
    event MeditationBegun(address indexed player, uint256 indexed heroId, uint256 meditationId, uint8 primaryStat, uint8 secondaryStat, uint8 tertiaryStat, address attunementCrystal);
    event MeditationBegunWithLevel(address indexed player, uint256 indexed heroId, uint256 meditationId, uint8 primaryStat, uint8 secondaryStat, uint8 tertiaryStat, address attunementCrystal, uint16 toLevel);
    event MeditationCompleted(address indexed player, uint256 indexed heroId, uint256 meditationId);
    event MeditationCompletedV2(address indexed player, uint256 indexed heroId, uint256 meditationId, address attunementCrystal, uint16 toLevel);
    event StatUp(address indexed player, uint256 indexed heroId, uint256 stat, uint8 increase, uint8 updateType);
    event StatUpV2(address indexed player, uint256 indexed heroId, uint256 stat, uint8 increase, uint8 updateType, uint16 toLevel);

    // State-Changing Functions
    function completeMeditation(uint256 _heroId);
    function completeMeditations(uint256[] _heroIds);
    function startMeditation(uint256 _heroId, uint8 _primaryStat, uint8 _secondaryStat, uint8 _tertiaryStat, address _attunementCrystal);
    function startMeditationWithLocked(uint256 _heroId, uint8 _primaryStat, uint8 _secondaryStat, uint8 _tertiaryStat, address _attunementCrystal);
    function startMeditations(tuple(uint256 heroId, uint8 primaryStat, uint8 secondaryStat, uint8 tertiaryStat, address attunementCrystal, bool useLockedTokens)[] _meditations);

    // View Functions
    function _getRequiredRunes(uint16 _level) pure returns (uint16[10]);
    function activeAttunementCrystals(address) view returns (bool);
    function feeAddresses(uint256) view returns (address);
    function feePercents(uint256) view returns (uint256);
    function getActiveMeditations(address _address) view returns (tuple(uint256 id, address player, uint256 heroId, uint8 primaryStat, uint8 secondaryStat, uint8 tertiaryStat, address attunementCrystal, uint256 startBlock, uint8 status)[]);
    function getHeroMeditation(uint256 _heroId) view returns (tuple(uint256 id, address player, uint256 heroId, uint8 primaryStat, uint8 secondaryStat, uint8 tertiaryStat, address attunementCrystal, uint256 startBlock, uint8 status));
    function getMeditation(uint256 _id) view returns (tuple(uint256 id, address player, uint256 heroId, uint8 primaryStat, uint8 secondaryStat, uint8 tertiaryStat, address attunementCrystal, uint256 startBlock, uint8 status));
    function heroToMeditation(uint256) view returns (uint256);
    function paused() view returns (bool);
    function powerToken() view returns (address);
    function profileActiveMeditations(address, uint256) view returns (uint256 id, address player, uint256 heroId, uint8 primaryStat, uint8 secondaryStat, uint8 tertiaryStat, address attunementCrystal, uint256 startBlock, uint8 status);
    function runes(uint256) view returns (address);
    function tokenUnlockerAddress() view returns (address);
    
}
```

### ABIs

{% file src="/files/FaXNAb9YNmpNDSweypPf" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### Harmony

| Name             | Mainnet                                      | Testnet                                      |
| ---------------- | -------------------------------------------- | -------------------------------------------- |
| MeditationCircle | `0x0594D86b2923076a2316EaEA4E1Ca286dAA142C1` | `0x93E0767a1bbA95068cF91dc8fA4D8bAD79290b76` |

### Interfaces

```solidity
interface IMeditationCircle {

    event AttunementCrystalAdded(address atunementItemAddress)
    event LevelUp(address indexed player, uint256 indexed heroId, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) hero, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) oldHero);
    event MeditationBegun(address indexed player, uint256 indexed heroId, uint256 meditationId, uint8 primaryStat, uint8 secondaryStat, uint8 tertiaryStat, address attunementCrystal);
    event MeditationCompleted(address indexed player, uint256 indexed heroId, uint256 meditationId);    
    event StatUp(address indexed player, uint256 indexed heroId, uint256 stat, uint8 increase, uint8 updateType);

    function _getRequiredRunes(uint16 _level) external pure returns (uint16[10]);
    function activeAttunementCrystals(address) external view returns (bool);
    function completeMeditation(uint256 _heroId) external;
    function getActiveMeditations(address _address) view returns (tuple(uint256 id, address player, uint256 heroId, uint8 primaryStat, uint8 secondaryStat, uint8 tertiaryStat, address attunementCrystal, uint256 startBlock, uint8 status)[]);
    function getHeroMeditation(uint256 _heroId) view returns (tuple(uint256 id, address player, uint256 heroId, uint8 primaryStat, uint8 secondaryStat, uint8 tertiaryStat, address attunementCrystal, uint256 startBlock, uint8 status));
    function getMeditation(uint256 _id) view returns (tuple(uint256 id, address player, uint256 heroId, uint8 primaryStat, uint8 secondaryStat, uint8 tertiaryStat, address attunementCrystal, uint256 startBlock, uint8 status));
    function heroToMeditation(uint256) external view returns (uint256);
    function paused() external view returns (bool);
    function profileActiveMeditations(address, uint256) external view returns (uint256 id, address player, uint256 heroId, uint8 primaryStat, uint8 secondaryStat, uint8 tertiaryStat, address attunementCrystal, uint256 startBlock, uint8 status);
    function runes(uint256) external view returns (address);
    function startMeditation(uint256 _heroId, uint8 _primaryStat, uint8 _secondaryStat, uint8 _tertiaryStat, address _attunementCrystal) external;

}
```

### ABIs

{% file src="/files/P1W4slaAeQPgHWwvzpwz" %}


# Quests


# Quest Core

{% hint style="info" %}
The `QuestRewarder` contract mints reward items for QuestCoreV3, and should not be directly interacted with. It emits the `RewardMinted` event log as part of Quest Completion transactions.
{% endhint %}

## Contracts

### Addresses

#### DFK Chain

| Name          | Mainnet                                      | Testnet                                      |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| QuestCoreV3   | `0x530fff22987E137e7C8D2aDcC4c15eb45b4FA752` | `0x08BDdaB7d681c6406fE61d261c26Da80678874f6` |
| QuestRewarder | `0x08D93Db24B783F8eBb68D7604bF358F5027330A6` | `0xE79C79564A74DC75b9B0476a8500773f83e73590` |
| Quest Fund    | `0x1137643FE14b032966a59Acd68EBf3c1271Df316` | `0x36a0f2Bf04BCDBd38b2d97CA785B266dd39BF21c` |

#### Klaytn

| Name          | Mainnet                                      | Testnet                                      |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| QuestCoreV3   | `0x1Ac6Cd893EDdb6Cac15E5A9FC549335b8b449015` | `0x00746dF5d408ff9c0021867Eb0776Bc60A1C043A` |
| QuestRewarder | `0x3fAB563BD19CaFbf8717Cd99a605b3661Cf3391f` | `0x931aB25e12dF3bd881985ACFa1b25d7424357757` |
| Quest Fund    | `0x24D557a1C580ec8B78E6e0de910df5E0CE090049` | `0x298Ae561513ee00eA120c596919d4187CA1557dD` |

### Interfaces

```solidity
interface IQuestCoreV3 {

    // Events
    event ExpeditionCanceled(uint256 indexed expeditionId, address indexed player, uint256 feeRefunded, uint16 petTreats, uint32 staminaPotions);
    event ExpeditionClaimStarted(uint256 indexed expeditionId, address indexed player, tuple(uint40 lastClaimedAt, uint24 iterationsToProcess, uint24 remainingIterations, uint16 escrowedPetTreats, uint32 escrowedStaminaPotions, uint16 globalSettings, uint40 iterationTime, uint40 claimStartBlock, uint24 feePerStamina) expedition);
    event ExpeditionCompleted(uint256 indexed expeditionId, address indexed player);
    event ExpeditionExtended(uint256 indexed expeditionId, address indexed player, uint256 additionalIterations, uint256 additionalFee, uint256 additionalTreats);
    event ExpeditionInProgressHeroUpdate(uint256 indexed expeditionId, address indexed player, uint256 indexed heroId, uint32 currentXP, uint16 currentProfessionSkill, uint8 profession);
    event ExpeditionIterationProcessed(uint256 indexed expeditionId, uint256 indexed questId, address indexed player, uint256[] heroIds, uint256 iterationsProcessed, uint256 totalFee, uint40 lastClaimedAt, uint16 staminaPotions, uint16 petTreats);
    event ExpeditionStarted(uint256 indexed expeditionId, address indexed player, uint256 indexed heroId, tuple(uint40 lastClaimedAt, uint24 iterationsToProcess, uint24 remainingIterations, uint16 escrowedPetTreats, uint32 escrowedStaminaPotions, uint16 globalSettings, uint40 iterationTime, uint40 claimStartBlock, uint24 feePerStamina) expedition, uint256 fee, uint8 foodType);
    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDeferred(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeLockedBurned(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event PetBonusReceived(uint256 indexed questId, address indexed player, uint256 heroId, uint256 petId);
    event PetBonusReceivedExpedition(uint256 indexed questId, address indexed player, uint256 heroId);
    event PetFed(address indexed fedBy, uint256 petId, uint8 foodType, uint256 hungryAt);
    event QuestCanceled(uint256 indexed questId, address indexed player, uint256 indexed heroId, tuple(uint256 id, uint256 questInstanceId, uint8 level, uint256[] heroes, address player, uint256 startBlock, uint256 startAtTime, uint256 completeAtTime, uint8 attempts, uint8 status, uint8 questType) quest);
    event QuestCompleted(uint256 indexed questId, address indexed player, uint256 indexed heroId, tuple(uint256 id, uint256 questInstanceId, uint8 level, uint256[] heroes, address player, uint256 startBlock, uint256 startAtTime, uint256 completeAtTime, uint8 attempts, uint8 status, uint8 questType) quest);
    event QuestSkillUp(uint256 indexed questId, address indexed player, uint256 heroId, uint8 profession, uint16 skillUp);
    event QuestStaminaSpent(uint256 indexed questId, address indexed player, uint256 heroId, uint256 staminaFullAt, uint256 staminaSpent);
    event QuestStarted(uint256 indexed questId, address indexed player, uint256 indexed heroId, tuple(uint256 id, uint256 questInstanceId, uint8 level, uint256[] heroes, address player, uint256 startBlock, uint256 startAtTime, uint256 completeAtTime, uint8 attempts, uint8 status, uint8 questType) quest, uint256 startAtTime, uint256 completeAtTime);
    event QuestXP(uint256 indexed questId, address indexed player, uint256 heroId, uint64 xpEarned);
    event RewardMinted(uint256 indexed questId, address indexed player, uint256 heroId, address indexed reward, uint256 amount, uint256 data);
    event TokenBonusAwarded(uint256 indexed questId, address indexed player, uint256 heroId, uint256 amount);
    event TrainingAttemptDone(bool success, uint256 attempt, uint256 indexed heroId);
    event TrainingSuccessRatio(uint256 winCount, uint256 attempts, uint256 indexed heroId);

    // State-Changing Functions - Quests
    function clearActiveQuests(uint256 _questInstanceId);
    function clearActiveQuestsAndHeroes();
    function clearActiveQuestsAndHeroesWithOffset(uint256 _offset, uint256 _amount);
    function clearActiveQuestsByType(uint256 _questInstanceId, uint8 _level, uint8 _type);
    function cancelQuest(uint256 _heroId);
    function completeQuest(uint256 _heroId);
    function multiCompleteQuest(uint256[] _heroIds);
    function multiStartQuest(uint256[][] _heroIds, uint256[] _questInstanceId, uint8[] _attempts, uint8[] _level, uint8[] _type);
    function startQuest(uint256[] _heroIds, uint256 _questInstanceId, uint8 _attempts, uint8 _level, uint8 _type);

    // State-Changing Functinos - Expeditions
    function cancelExpedition(uint256 _expeditionId);
    function extendExpedition(uint256 _expeditionId, uint24 _additionalIterations) payable;
    function multiCancelExpedition(uint256[] _expeditionIds);
    function multiProcessExpeditionClaim(uint256[] _expeditionIds);
    function multiProcessExpeditionClaimWithCustomIterationCap(uint256[] _expeditionIds, uint24[] _requestedIterations);
    function multiStartExpeditionClaim(uint256[] _expeditionIds);
    function processExpeditionClaim(uint256 _expeditionId);
    function processExpeditionClaimWithCustomIterationCap(uint256 _expeditionId, uint24 _requestedIterations);
    function startExpedition(tuple(uint256[] heroIds, uint256 questInstanceId, uint8 attempts, uint8 level, uint8 questType, uint24 iterations, uint16 staminaPotions, uint8 petFoodType) _inputs) payable;
    function startExpeditionClaim(uint256 _expeditionId);

    // View Functions - Quests/General
    function getAccountActiveQuests(address _account) view returns (tuple(uint256 id, uint256 questInstanceId, uint8 level, uint256[] heroes, address player, uint256 startBlock, uint256 startAtTime, uint256 completeAtTime, uint8 attempts, uint8 status, uint8 questType)[]);
    function getCurrentStamina(uint256 _heroId) view returns (uint256);
    function getCurrentStaminaForMultiple(uint256[] _heroIds) view returns (uint256[]);
    function getFormattedQuestAddress(uint8 _format, uint8 _instanceId, uint8 _level, uint8 _type) pure returns (address);
    function getHeroQuest(uint256 heroId) view returns (tuple(uint256 id, uint256 questInstanceId, uint8 level, uint256[] heroes, address player, uint256 startBlock, uint256 startAtTime, uint256 completeAtTime, uint8 attempts, uint8 status, uint8 questType));
    function getQuestInstanceIds() view returns (uint256[]);
    function heroToQuest(uint256 _heroId) view returns (uint256);
    function quests(uint256 _id) view returns (tuple(uint256 id, uint256 questInstanceId, uint8 level, uint256[] heroes, address player, uint256 startBlock, uint256 startAtTime, uint256 completeAtTime, uint8 attempts, uint8 status, uint8 questType));
    function timePerStamina() view returns (uint256);

    // View Functions - Expeditions
    function getRequiredFeeForExtension(uint256 _expeditionId, uint24 _additionalIterations) view returns (uint256);
    function getRequiredTreatsForExtension(uint256 _expeditionId, uint24 _additionalIterations) view returns (uint256);
    function getAccountExpeditionIds(address _playerAddress) view returns (uint256[]);
    function getAccountExpeditionIdsWithOffset(uint256 _offset, uint256 _amount, address _playerAddress) view returns (uint256[]);
    function getAccountExpeditions(address _playerAddress) view returns (tuple(uint40 lastClaimedAt, uint24 iterationsToProcess, uint24 remainingIterations, uint16 escrowedPetTreats, uint32 escrowedStaminaPotions, uint16 globalSettings, uint40 iterationTime, uint40 claimStartBlock, uint24 feePerStamina)[]);
    function getAccountExpeditionsCounts(address _playerAddress) view returns (uint256);
    function getAccountExpeditionsWithAssociatedQuests(address _playerAddress) view returns (tuple(uint256 expeditionId, tuple(uint40 lastClaimedAt, uint24 iterationsToProcess, uint24 remainingIterations, uint16 escrowedPetTreats, uint32 escrowedStaminaPotions, uint16 globalSettings, uint40 iterationTime, uint40 claimStartBlock, uint24 feePerStamina) expedition, tuple(uint256 id, uint256 questInstanceId, uint8 level, uint256[] heroes, address player, uint256 startBlock, uint256 startAtTime, uint256 completeAtTime, uint8 attempts, uint8 status, uint8 questType) quest, uint256 escrowedFee, uint8 foodType)[]);
    function getAccountExpeditionsWithAssociatedQuestsWithOffset(uint256 _offset, uint256 _amount, address _playerAddress) view returns (tuple(uint256 expeditionId, tuple(uint40 lastClaimedAt, uint24 iterationsToProcess, uint24 remainingIterations, uint16 escrowedPetTreats, uint32 escrowedStaminaPotions, uint16 globalSettings, uint40 iterationTime, uint40 claimStartBlock, uint24 feePerStamina) expedition, tuple(uint256 id, uint256 questInstanceId, uint8 level, uint256[] heroes, address player, uint256 startBlock, uint256 startAtTime, uint256 completeAtTime, uint8 attempts, uint8 status, uint8 questType) quest, uint256 escrowedFee, uint8 foodType)[]);
    function getAccountExpeditionsWithOffset(uint256 _offset, uint256 _amount, address _playerAddress) view returns (tuple(uint40 lastClaimedAt, uint24 iterationsToProcess, uint24 remainingIterations, uint16 escrowedPetTreats, uint32 escrowedStaminaPotions, uint16 globalSettings, uint40 iterationTime, uint40 claimStartBlock, uint24 feePerStamina)[]);
    function getEstimatedExpeditionCompletionTime(uint256 _expeditionId) view returns (uint64);
    function getExpedition(uint256 _id) view returns (tuple(uint40 lastClaimedAt, uint24 iterationsToProcess, uint24 remainingIterations, uint16 escrowedPetTreats, uint32 escrowedStaminaPotions, uint16 globalSettings, uint40 iterationTime, uint40 claimStartBlock, uint24 feePerStamina));
    function getExpeditionEscrowedFee(uint256 _expeditionId) view returns (uint256);
    function getExpeditionGardeningPoolCounts(address _account, uint8 _questType) view returns (tuple(uint8 questLength, uint8 count));
    function getExpeditionTokenMiningCounts(address _account) view returns (tuple(uint8 questLength, uint8 count));
    function getExpeditionHeroData(uint256 _heroId) view returns (tuple(uint8 heroSettings, uint16 statScores, uint16 professionSkill, uint16 luck, uint8 foodType, uint8 eggType, uint8 rarity, uint8 professionBonus, uint8 scalar, uint8 level, uint64 petHungryAt, uint32 xp));
    function getHeroExpedition(uint256 _heroId) view returns (tuple(uint40 lastClaimedAt, uint24 iterationsToProcess, uint24 remainingIterations, uint16 escrowedPetTreats, uint32 escrowedStaminaPotions, uint16 globalSettings, uint40 iterationTime, uint40 claimStartBlock, uint24 feePerStamina));
    function getHeroesExpeditions(uint256[] _heroIds) view returns (tuple(uint40 lastClaimedAt, uint24 iterationsToProcess, uint24 remainingIterations, uint16 escrowedPetTreats, uint32 escrowedStaminaPotions, uint16 globalSettings, uint40 iterationTime, uint40 claimStartBlock, uint24 feePerStamina)[]);
    function getIterationDuration(tuple(uint256[] heroIds, uint256 questInstanceId, uint8 attempts, uint8 level, uint8 questType, uint24 iterations, uint16 staminaPotions, uint8 petFoodType) _inputs) view returns (uint256);
    function getIterationDurationForCurrentExpedition(uint256 _expeditionId) view returns (uint64);
    function getNextIterationStartTime(uint256 _expeditionId) view returns (uint64);
    function getRequiredFee(tuple(uint256[] heroIds, uint256 questInstanceId, uint8 attempts, uint8 level, uint8 questType, uint24 iterations, uint16 staminaPotions, uint8 petFoodType) _inputs) view returns (uint256);
    function getRequiredTreats(tuple(uint256[] heroIds, uint256 questInstanceId, uint8 attempts, uint8 level, uint8 questType, uint24 iterations, uint16 staminaPotions, uint8 petFoodType) _inputs) view returns (uint64);
    function getTotalExpeditionDuration(tuple(uint256[] heroIds, uint256 questInstanceId, uint8 attempts, uint8 level, uint8 questType, uint24 iterations, uint16 staminaPotions, uint8 petFoodType) _inputs) view returns (uint256);

}
```

### ABIs

{% file src="/files/zfnhZmKgNqRAR88MM4w0" %}

## Types

### Quest

The primary struct for a Quest that has been created on the contract.

```solidity
struct Quest {
    uint256 id;
    uint256 questInstanceId;
    uint8 level;
    uint256[] heroes;
    address player;
    uint256 startBlock;
    uint256 startAtTime;
    uint256 completeAtTime;
    uint8 attempts;
    QuestStatus status;
    uint8 questType;
}
```

<table><thead><tr><th width="207">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>id</code></strong></td><td><code>uint256</code></td><td>The unique <code>id</code> of the Quest on the contract</td></tr><tr><td><strong><code>questInstanceId</code></strong></td><td><code>uint256</code></td><td>A unique mapping indicating which category of Quest the Heroes are on (e.g. Fishing, Mining, Training). See <a href="#quest-instance">Quest Instance</a>.</td></tr><tr><td><strong><code>level</code></strong></td><td><code>uint8</code></td><td>The skill level of the Quest. Current values include:<br>- Fishing, Foraging, Gardening: <code>0</code> or <code>10</code><br>- Token Mining, Gold Mining: <code>0</code><br>- Training Quests: <code>1</code></td></tr><tr><td><strong><code>heroes</code></strong></td><td><code>uint256[]</code></td><td>An array of the questing <a href="/pages/2P4FixjlDAV4kxTqMqXY">Hero</a> <code>id</code>s </td></tr><tr><td><strong><code>player</code></strong></td><td><code>address</code></td><td>The <code>0x</code> address of the wallet creating the Quest</td></tr><tr><td><strong><code>startBlock</code></strong></td><td><code>uint256</code></td><td>The block height at which the Quest was started</td></tr><tr><td><strong><code>startAtTime</code></strong></td><td><code>uint256</code></td><td>The UNIX timestamp at which the Quest was started</td></tr><tr><td><strong><code>completeAtTime</code></strong></td><td><code>uint256</code></td><td>The UNIX timestamp at which the Quest was/will be completed</td></tr><tr><td><strong><code>attempts</code></strong></td><td><code>uint8</code></td><td>The number of Quest attempts that the Heroes will perform</td></tr><tr><td><strong><code>status</code></strong></td><td><a href="#quest-status"><code>QuestStatus</code></a></td><td>The current status of the Quest on the contract</td></tr><tr><td><strong><code>questType</code></strong></td><td><code>uint8</code></td><td>A unique mapping for Quests that have additional varieties, currently including Gardening and Training Quests. See <a href="#quest-type">Quest Type</a>.</td></tr></tbody></table>

### Quest Status

Indicates the current status of the [Quest](#quest) on the contract.

```solidity
enum QuestStatus {
    NONE,
    STARTED,
    COMPLETED,
    CANCELED,
    EXPEDITION
}
```

## Mappings

### Quest Instance

Quests in QuestCore V3 are routed to the correct diamond facets by using **Instance IDs** that are unique to each Quest category. These IDs are also stored in each Hero's `currentQuest` state, padded as an `0x` address (e.g. `0x0000000000000000000000000000000000000001`).

```json
{
  1: "Fishing",
  2: "Foraging",
  3: "Gold Mining",
  4: "Token Mining",
  5: "Gardening",
  6: "Training"
}
```

### Quest Type

For Quests that have additional varieties, the `type` input determines which Quest the Hero is ultimately is sent to. Currently Gardening and Training Quests use these mappings.

#### Gardening Quests

The Quest `type` for Gardening Quests matches the `poolId` of the Garden, as defined [here](/contracts/gardens#incentivized-gardens). PID `255` is the Unlimited Gardening Pool for Expeditions only.

#### Training Quests

The Quest `type` for Training Quests uses the following mapping, matching the **stat order used on the** [**HeroCore**](/nfts/heroes) **contract**, which is **not the same order as the mapping** used for stat growth and in the [MeditationCircle](/contracts/meditation-circle#stat-mappings) and similar contracts.

```json
{
  0: "Strength",
  1: "Intelligence",
  2: "Wisdom",
  3: "Luck",
  4: "Agility",
  5: "Vitality",
  6: "Endurance",
  7: "Dexterity"
}
```


# Historical Contracts


# Quest Core

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### DFK Chain

{% hint style="info" %}
With the release on Gardening Quests on DFK Chain (9/2022), the Quest Fund contracts were upgraded. The previous addresses are listed below.
{% endhint %}

| Name        | Mainnet                                      | Testnet                                      |
| ----------- | -------------------------------------------- | -------------------------------------------- |
| QuestCoreV2 | `0xE9AbfBC143d7cef74b5b793ec5907fa62ca53154` | `0xAff49531F126bc1296B2dc7d7460770339CF19D2` |
| Quest Fund  | `0x64a3dc745806d9d6e88ea5555F8fdA65B147A31D` | `0x012D7Fe69F280c0d91802988b960F568Aa8Ad4A0` |

#### Klaytn

| Name        | Mainnet                                      | Testnet                                      |
| ----------- | -------------------------------------------- | -------------------------------------------- |
| QuestCoreV2 | `0x8dc58d6327E1f65b18B82EDFb01A361f3AAEf624` | `0x542a3903c7F2dD47a7F31b08Bd1C6791e3C43784` |

#### Harmony

| Name          | Mainnet                                      | Testnet                                      |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| QuestCoreV2   | `0xAa9a289ce0565E4D6548e63a441e7C084E6B52F6` | `0x359C91d97a8859619f31E2E8A6294B3607053Ad7` |
| QuestCoreV1   | `0x5100Bd31b822371108A0f63DCFb6594b9919Eaf4` | `0x13e4818A1433A7B63f228266d9d5e5c42B015ba5` |
| QuestRewarder | `0x71BCF4EB2FEb164a177184a71715d18989CB15Ef` | `0xc68fcCEB712Cc21547b9F4749C6a7307303dc803` |
| Quest Fund    | `0x5cA5bcd91929c7152ca577e8c001C9b5a185F568` | `0x64d42015b09B88280e6376D9B4C7F442DEDA5a33` |

### Interfaces

#### QuestCoreV2.3

```solidity
interface IQuestCoreV2.3 {

    event QuestCanceled(uint256 indexed questId, address indexed player, uint256 indexed heroId, tuple(uint256 id, address questAddress, uint8 level, uint256[] heroes, address player, uint256 startBlock, uint256 startAtTime, uint256 completeAtTime, uint8 attempts, uint8 status) quest);
    event QuestCompleted(uint256 indexed questId, address indexed player, uint256 indexed heroId, tuple(uint256 id, address questAddress, uint8 level, uint256[] heroes, address player, uint256 startBlock, uint256 startAtTime, uint256 completeAtTime, uint8 attempts, uint8 status) quest);
    event QuestReward(uint256 indexed questId, address indexed player, uint256 heroId, address rewardItem, uint256 itemQuantity);
    event QuestSkillUp(uint256 indexed questId, address indexed player, uint256 heroId, uint8 profession, uint16 skillUp);
    event QuestStaminaSpent(uint256 indexed questId, address indexed player, uint256 heroId, uint256 staminaFullAt, uint256 staminaSpent);
    event QuestStarted(uint256 indexed questId, address indexed player, uint256 indexed heroId, tuple(uint256 id, address questAddress, uint8 level, uint256[] heroes, address player, uint256 startBlock, uint256 startAtTime, uint256 completeAtTime, uint8 attempts, uint8 status) quest, uint256 startAtTime, uint256 completeAtTime);
    event QuestXP(uint256 indexed questId, address indexed player, uint256 heroId, uint64 xpEarned);
    event QuickStudy(uint256 indexed questId, address indexed player, uint256 heroId, uint256 xpBefore, uint256 xpAfter, uint256 percentage);
    event RewardMinted(uint256 indexed questId, address indexed player, uint256 heroId, address indexed reward, uint256 amount, uint256 data);
    event TokenBonusAwarded(uint256 indexed questId, address indexed player, uint256 heroId, uint256 amount);
    event TrainingAttemptDone(bool success, uint256 attempt, uint256 indexed heroId);
    event TrainingSuccessRatio(uint256 winCount, uint256 attempts, uint256 indexed heroId);
    
    function cancelQuest(uint256 _heroId);
    function clearActiveQuests(address _questAddress);
    function clearActiveQuestsAndHeroes();
    function clearActiveQuestsAndHeroesWithOffset(uint256 _offset, uint256 _amount);
    function completeQuest(uint256 _heroId);
    function getAccountActiveQuests(address _account) view returns (tuple(uint256 id, address questAddress, uint8 level, uint256[] heroes, address player, uint256 startBlock, uint256 startAtTime, uint256 completeAtTime, uint8 attempts, uint8 status)[]);
    function getCurrentStamina(uint256 _heroId) view returns (uint256);
    function getHeroQuest(uint256 heroId) view returns (tuple(uint256 id, address questAddress, uint8 level, uint256[] heroes, address player, uint256 startBlock, uint256 startAtTime, uint256 completeAtTime, uint8 attempts, uint8 status));
    function getQuestContracts() view returns (address[]);
    function heroCore() view returns (address);
    function heroToQuest(uint256) view returns (uint256);
    function isQuest(address) view returns (bool);
    function multiCompleteQuest(uint256[] _heroIds);
    function multiStartQuest(address[] _questAddress, uint256[][] _heroIds, uint8[] _attempts, uint8[] _level);
    function paused() view returns (bool);
    function questCounter() view returns (uint256);
    function questLib() view returns (address);
    function questRewarder() view returns (address);
    function quests(uint256) view returns (uint256 id, address questAddress, uint8 level, address player, uint256 startBlock, uint256 startAtTime, uint256 completeAtTime, uint8 attempts, uint8 status);
    function startQuest(uint256[] _heroIds, address _questAddress, uint8 _attempts, uint8 _level);
    function timePerStamina() view returns (uint256);

}
```

#### QuestCoreV2.0 (Harmony)

{% hint style="warning" %}
With the release of Quests on DFK Chain (7/2022), the QuestCore contract underwent a minor upgrade to V2.1 that impacted the `QuestStarted` event logs. This change took place on Harmony around Block #28840730. The contract address did not change as part of this upgrade.

The V2.0 version of the `QuestStarted` event is shown below.
{% endhint %}

```solidity
interface IQuestCoreV2 {

  event QuestStarted(
    uint256 indexed questId, 
    address indexed player, 
    uint256 indexed heroId, 
    tuple(
      uint256 id, 
      address questAddress, 
      uint8 level, 
      uint256[] heroes, 
      address player, 
      uint256 startBlock, 
      uint256 startAtTime, 
      uint256 completeAtTime, 
      uint8 attempts, 
      uint8 status
    ) quest
  );

}
```

#### QuestCoreV1 (Harmony)

```solidity
interface IQuestCoreV1 {

  event QuestAdded(uint256 indexed questTypeId, address indexed questAddress, tuple(uint256 id, address quest, uint8 status, uint8 minHeroes, uint8 maxHeroes, uint256 level, uint8 maxAttempts) questType);
  event QuestCanceled(uint256 indexed questId, address indexed player, uint256 indexed heroId, tuple(uint256 id, address quest, uint256[] heroes, address player, uint256 startTime, uint256 startBlock, uint256 completeAtTime, uint8 attempts, uint8 status) quest);
  event QuestCompleted(uint256 indexed questId, address indexed player, uint256 indexed heroId, tuple(uint256 id, address quest, uint256[] heroes, address player, uint256 startTime, uint256 startBlock, uint256 completeAtTime, uint8 attempts, uint8 status) quest);
  event QuestReward(uint256 indexed questId, address indexed player, uint256 heroId, address rewardItem, uint256 itemQuantity);
  event QuestSkillUp(uint256 indexed questId, address indexed player, uint256 heroId, uint8 profession, uint16 skillUp);
  event QuestStaminaSpent(uint256 indexed questId, address indexed player, uint256 heroId, uint256 staminaFullAt, uint16 staminaSpent);
  event QuestStarted(uint256 indexed questId, address indexed player, uint256 indexed heroId, tuple(uint256 id, address quest, uint256[] heroes, address player, uint256 startTime, uint256 startBlock, uint256 completeAtTime, uint8 attempts, uint8 status) quest);
  event QuestUpdated(uint256 indexed questTypeId, address indexed questAddress, tuple(uint256 id, address quest, uint8 status, uint8 minHeroes, uint8 maxHeroes, uint256 level, uint8 maxAttempts) questType);
  event QuestXP(uint256 indexed questId, address indexed player, uint256 heroId, uint64 xpEarned);
  
  function adminClearActiveQuests(address _profile, address _questAddress);
  function cancelQuest(uint256 _heroId);
  function cleanQuests();
  function completeQuest(uint256 _heroId);
  function getActiveQuests(address _address) view returns (tuple(uint256 id, address quest, uint256[] heroes, address player, uint256 startTime, uint256 startBlock, uint256 completeAtTime, uint8 attempts, uint8 status)[]);
  function getCurrentStamina(uint256 _heroId) view returns (uint256);
  function getFutureStamina(uint256 _heroId, uint256 _timestamp) view returns (uint256);
  function getGeneBonus(uint256 _genes, uint8 _pos, uint8 _val) returns (uint64);
  function getHero(uint256 _heroId) view returns (tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions));
  function getHeroQuest(uint256 _heroId) view returns (tuple(uint256 id, address quest, uint256[] heroes, address player, uint256 startTime, uint256 startBlock, uint256 completeAtTime, uint8 attempts, uint8 status));
  function getQuest(uint256 _id) view returns (tuple(uint256 id, address quest, uint256[] heroes, address player, uint256 startTime, uint256 startBlock, uint256 completeAtTime, uint8 attempts, uint8 status));
  function getQuestData(uint256 _questId) view returns (tuple(uint256 uint1, uint256 uint2, uint256 uint3, uint256 uint4, int256 int1, int256 int2, string string1, string string2, address address1, address address2, address address3, address address4));
  function heroToQuest(uint256) view returns (uint256);
  function logReward(tuple(uint256 id, address quest, uint256[] heroes, address player, uint256 startTime, uint256 startBlock, uint256 completeAtTime, uint8 attempts, uint8 status) _quest, uint256 _heroId, tuple(address item, int64 expBonus, int64 skillUpChance, int64 smallSkillUpMod, int64 mediumSkillUpMod, int64 largeSkillUpMod, int64 baseChance, int64 skillMod, int64 statMod, int64 luckMod) _reward, uint256 _quantity);
  function logSkillUp(tuple(uint256 id, address quest, uint256[] heroes, address player, uint256 startTime, uint256 startBlock, uint256 completeAtTime, uint8 attempts, uint8 status) _quest, uint256 _heroId, uint8 _profession, uint16 _skillUp);
  function logXp(tuple(uint256 id, address quest, uint256[] heroes, address player, uint256 startTime, uint256 startBlock, uint256 completeAtTime, uint8 attempts, uint8 status) _quest, uint256 _heroId, uint64 _xpEarned);
  function paused() view returns (bool);
  function profileActiveQuests(address, uint256) view returns (uint256 id, address quest, address player, uint256 startTime, uint256 startBlock, uint256 completeAtTime, uint8 attempts, uint8 status);
  function questAddressToType(address) view returns (uint256);
  function questTypes(uint256) view returns (uint256 id, address quest, uint8 status, uint8 minHeroes, uint8 maxHeroes, uint256 level, uint8 maxAttempts);
  function saveQuestData(uint256 _questId, tuple(uint256 uint1, uint256 uint2, uint256 uint3, uint256 uint4, int256 int1, int256 int2, string string1, string string2, address address1, address address2, address address3, address address4) _questData);
  function startQuest(uint256[] _heroIds, address _questAddress, uint8 _attempts);
  function startQuestWithData(uint256[] _heroIds, address _questAddress, uint8 _attempts, tuple(uint256 uint1, uint256 uint2, uint256 uint3, uint256 uint4, int256 int1, int256 int2, string string1, string string2, address address1, address address2, address address3, address address4) _questData);
  function timePerStamina() view returns (uint256);
  function updateHero(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) _hero);
  function updateQuestType(address _questAddress, uint8 _status);

}
```

### ABIs

{% file src="/files/yxQyA2bqfFxUySgkBpQf" %}

{% file src="/files/DtuWx0HYN1ag1LUJyQiq" %}

{% file src="/files/2bfzhJU93hyI9kwKdZlA" %}

{% file src="/files/qtabX8IBq3PewQgK8vzH" %}

{% file src="/files/NeJpFVGy9uxbMjCG2I7a" %}


# Profession Quests

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

## Historical Contracts

### DFK Chain

| Name           | Mainnet                                      | Testnet                                      |
| -------------- | -------------------------------------------- | -------------------------------------------- |
| CRYSTAL Mining | `0x98b3C85ac3cC3EF36Ff25A9229857AbACE3e7410` | `0xcEa07Fad1b5b5270b50085695c1e7efc3C09fa1a` |
| Fishing        | `0x407ab39B3675f29A719476af6eb3B9E5d93969E6` | `0x8fe8510667eB5E4dBDD51020Bf802D1AAb3D709C` |
| Foraging       | `0xAd51199B453075C73FA106aFcAAD59f705EF7872` | `0x9E626E400E5053Fe101B6cC178A010aEAE67941e` |
| Gardening      | *See Table Below*                            | *See Table Below*                            |
| Gold Mining    | `0x75912145f5cFEfb980616FA47B2f103210FaAb94` | `0x59f4C8678e8359580DBE69De34e5bF12275a5fD0` |

#### **Gardening Quests (DFK Chain Mainnet)**

{% hint style="warning" %}
Gardening Quests have unique contract addresses for each Liquidity Pool. These are **not the same** as the contract addresses for the LP Pairs themselves, which are listed in [Incentivized Gardens](/contracts/gardens#incentivized-gardens).
{% endhint %}

<table><thead><tr><th width="105" align="right">Pool ID (PID)</th><th width="175">Pair</th><th>Quest Contract Address</th><th data-hidden data-type="checkbox">Archived</th><th data-hidden></th></tr></thead><tbody><tr><td align="right">0</td><td>wJEWEL-xJEWEL</td><td><code>0xd3d8ff8e42C2eD51FabE4BA34080C6ac79395f24</code></td><td>false</td><td></td></tr><tr><td align="right">1</td><td>CRYSTAL-AVAX</td><td><code>0x8eDA0ceA7a90E794B33708Cc0768727A1A612f3d</code></td><td>false</td><td></td></tr><tr><td align="right">2</td><td>CRYSTAL-wJEWEL</td><td><code>0xC4839Fb9A5466878168EaE3fD58c647B71475b61</code></td><td>false</td><td></td></tr><tr><td align="right">3</td><td>CRYSTAL-USDC</td><td><code>0x6FEF23498877bC4c3940ebE121dd7D138BdA4e11</code></td><td>false</td><td></td></tr><tr><td align="right">4</td><td>ETH-USDC</td><td><code>0xdeF7cBeE7d0B62037616ee26BCAc1C8364f53476</code></td><td>false</td><td></td></tr><tr><td align="right">5</td><td>wJEWEL-USDC</td><td><code>0xaac3933Faa3B668304C9276d10CA88853463BD42</code></td><td>false</td><td></td></tr><tr><td align="right">6</td><td>CRYSTAL-ETH</td><td><code>0x810e1fF51fDd58c474c66A31013713D1A17BF458</code></td><td>false</td><td></td></tr><tr><td align="right">7</td><td>CRYSTAL-BTC.b</td><td><code>0x706916dbC3b66d89632708CC193080ea05E0534A</code></td><td>false</td><td></td></tr><tr><td align="right">8</td><td>CRYSTAL-KLAY</td><td><code>0x1fCc67a01525fd715A67bCcbF73665Fb3dBE76c7</code></td><td>false</td><td></td></tr><tr><td align="right">9</td><td>JEWEL-KLAY</td><td><code>0x2A70aA48f9dBF859239ae5E7f98fe95aE27A6CD4</code></td><td>false</td><td></td></tr><tr><td align="right">10</td><td>JEWEL-AVAX</td><td><code>0xA0d17554F09047d65E0ae0e76CD8923A9525183c</code></td><td>false</td><td></td></tr><tr><td align="right">11</td><td>JEWEL-BTC.b</td><td><code>0x3391B9384AC66C7Aa3BF4A75A4f441942B1dCf30</code></td><td>false</td><td></td></tr><tr><td align="right">12</td><td>JEWEL-ETH</td><td><code>0xbaEc39Dd81b964B57bc5fa5f5421Cd82185409E6</code></td><td>false</td><td></td></tr><tr><td align="right">13</td><td>BTC.b-USDC</td><td><code>0x045838dBfb8026520E872c8298F4Ed542B81Eaca</code></td><td>false</td><td></td></tr></tbody></table>

#### **Gardening Quests (DFK Chain Testnet)**

<table><thead><tr><th width="108.66815322866361" align="right">Pool ID (PID)</th><th width="178.35953522508254">Pair</th><th>Quest Contract Address</th><th data-hidden data-type="checkbox">Archived</th><th data-hidden></th></tr></thead><tbody><tr><td align="right">0</td><td>wJEWEL-xJEWEL</td><td><code>0x3A82541780D078276dE0F24143Ef3A21c4888474</code></td><td>false</td><td></td></tr><tr><td align="right">4</td><td>CRYSTAL-AVAX</td><td><code>0x3408DF8bfd042bbd17faFC088788C51BA3259eD1</code></td><td>false</td><td></td></tr></tbody></table>

### Klaytn

| Name        | Mainnet                                      | Testnet                                      |
| ----------- | -------------------------------------------- | -------------------------------------------- |
| Fishing     | `0x0E7a8b035eF2FA0183a2680458818256424Bd60B` | `0x37b96Edd8eAFbA8947C8e628059E7eE9b851Bd48` |
| Foraging    | `0x54DaD24dDc2cC6E7616438816DE0EeFCad79B625` | `0x854bBAC0233CF03783D3Be4AeC924b031d8bcfe1` |
| Gardening   | *See Table Below*                            | *See Table Below*                            |
| Gold Mining | `0x46F036B26870188aD69877621815238D2b81bef1` | `0x40D2c135a3E5a6f6546626795DEc67f818f0352a` |
| JADE Mining | `0x20B274262FA6da57B5Ff90498EC373c0266eF901` | `0xc2eF7E4f659272ca2DaE9d3df05680783b299Cd0` |

#### Gardening Quests (Klaytn Mainnet)

<table><thead><tr><th width="105" align="right">Pool ID (PID)</th><th width="175">Pair</th><th>Quest Contract Address</th><th data-hidden data-type="checkbox">Archived</th><th data-hidden></th></tr></thead><tbody><tr><td align="right">0</td><td>JADE-JEWEL</td><td><code>0x3837612f3A14C92Da8E0186AB398A753fe169dc1</code></td><td>false</td><td></td></tr><tr><td align="right">1</td><td>JADE-wKLAY</td><td><code>0xc1C01a860B841F47f8191026D9Ca8eE2F1f37ab3</code></td><td>false</td><td></td></tr><tr><td align="right">2</td><td>JADE-AVAX</td><td><code>0x7643ADB5AaF129A424390CB055d6e23231fFd690</code></td><td>false</td><td></td></tr><tr><td align="right">3</td><td>JADE-oUSDT</td><td><code>0x177D9F3A92630CB8C46F169b1F99a12A7a326c45</code></td><td>false</td><td></td></tr><tr><td align="right">4</td><td>JADE-oBTC</td><td><code>0x05305c97e9A2FDC0F5Ea23824c1348DEeD9Aff04</code></td><td>false</td><td></td></tr><tr><td align="right">5</td><td>JADE-oETH</td><td><code>0xb911F5D6F9129365d1a415DD3CBa17F0240CFA70</code></td><td>false</td><td></td></tr><tr><td align="right">6</td><td>JEWEL-wKLAY</td><td><code>0x3198f51A1c8cFC5f1FeaD58feaa19E6dFc8e9737</code></td><td>false</td><td></td></tr><tr><td align="right">7</td><td>JEWEL-AVAX</td><td><code>0xDAd93871e42a11aD577E4DCa02c7C426800A47D5</code></td><td>false</td><td></td></tr><tr><td align="right">8</td><td>JEWEL-oUSDT</td><td><code>0x0831f733870e847263907F32B3367De2f47CeAf0</code></td><td>false</td><td></td></tr><tr><td align="right">9</td><td>JEWEL-oBTC</td><td><code>0x85106b1aF8B0337CB39a9aacDa87849B882a3170</code></td><td>false</td><td></td></tr><tr><td align="right">10</td><td>JEWEL-oETH</td><td><code>0x7038F49cAA6e2f26677D237A2A40EC6354bA1eA5</code></td><td>false</td><td></td></tr></tbody></table>

#### Gardening Quests (Klaytn Testnet)

<table><thead><tr><th width="150" align="right">Pool ID (PID)</th><th width="206.35953522508254">Pair</th><th>Quest Contract Address</th><th data-hidden data-type="checkbox">Archived</th><th data-hidden></th></tr></thead><tbody><tr><td align="right">0</td><td>wKLAY-JADE</td><td><code>0x30B8c11592C343B89E97A2257e5b736AE01a9b05</code></td><td>false</td><td></td></tr></tbody></table>

#### Harmony

| Name              | Mainnet                                      | Testnet                                      |
| ----------------- | -------------------------------------------- | -------------------------------------------- |
| Fishing (V2)      | `0xADFFD2A255B3792873a986895c6312e8FbacFc8B` | `0x226991204EF8605E87Fa983d193dfACe9d224B59` |
| Fishing (V1)      | `0xE259e8386d38467f0E7fFEdB69c3c9C935dfaeFc` | `0x6499e23d00092bcf8d9f0a9eeae5b823bd1a5e69` |
| Foraging (V2)     | `0xB465F4590095daD50FEe6Ee0B7c6700AC2b04dF8` | `0x0472f29CBB06445677647FB2f4B1804207F9086C` |
| Foraging (V1)     | `0x3132c76acF2217646fB8391918D28a16bD8A8Ef4` | `0x91b4a64958e632b8da517CD4754Ec8fc40417207` |
| Gardening (V1)    | `0xe4154B6E5D240507F9699C730a496790A722DF19` | `0x3bB67a48D39aB0CC69ebCC5F4e07DE8C74E7d389` |
| Gold Mining (V1)  | `0x569E6a4c2e3aF31B337Be00657B4C040C828Dd73` | `0x029ca80AB56491Bf239197242E39cA0B49f76F15` |
| JEWEL Mining (V1) | `0x6FF019415Ee105aCF2Ac52483A33F5B43eaDB8d0` | `0x48B9FB9da467f0169BE602c4356b63fe6A645619` |
| Wishing Well (V2) | `0x35e9adF3F63dEeE6a266494BB0ad7627472A518F` | `0x79840Dce95A09Fb410AF5b7584421892C0b3884B` |
| Wishing Well (V1) | `0xf5ff69f4ac4a851730668b93fc408bc1c49ef4ce` | `0x7f1da8b8F43986a655eb05bbd139b763BDE8B135` |


# Training Quests

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

## Historical Contracts

#### DFK Chain

| Name                       | Mainnet                                      | Testnet                                      |
| -------------------------- | -------------------------------------------- | -------------------------------------------- |
| Tug of War (Strength)      | `0xb8828c687Fb1C875D5acb4281C5CDf9F49fA4637` | `0x7cBF70de4ca73fDbe65f9eD6972EFAb709cC850e` |
| Tafl Match (Intelligence)  | `0xD8cCf866959830a8E397442B5F7DDD790F230962` | `0xF537848fc4643a4aED1D0f89718D388Ba50a959C` |
| Animal Handling (Wisdom)   | `0x0832A218c2202088A1800D424248fC689ae74600` | `0xe4A60931f5B14B13e9C1Fa659e4729a3cd7609Bd` |
| Catching Emberlings (Luck) | `0x81fA8a2bfcd703dc83c5d4bEE1075899448A5CdE` | `0x19eA33Cc4a3EbAcdd990108D4DD41E9A51E823e5` |
| Log Rolling (Agility)      | `0x801b7296f106d8818DA1D04Ed769e5a76e8911fe` | `0xaa1E1bd5c03dFA33cC6F312C56170cbb312b1a35` |
| Polar Plunge (Vitality)    | `0xE3edf52D33F2BB05DBdA5BA73903E27a9B9b7e9d` | `0xB6fF23fC946C37720DE4c5682c2f123E44A8Be3B` |
| Hunting Party (Endurance)  | `0xBD391e4641E1bce989a246602EcDC746efA9d845` | `0xAb1E3454128298fC634764d9199132308d10Bca3` |
| Stick and Ball (Dexterity) | `0x9ec92963d0387bA57D5f2D505319b1c135C6f1D3` | `0x23Dc50E759Fb357635e536Aa15169aA0dA2e4d5c` |

#### Klaytn

| Name                                | Mainnet                                      | Testnet                                      |
| ----------------------------------- | -------------------------------------------- | -------------------------------------------- |
| Arm Wrestling (Strength)            | `0xF2143c7c8Dfca976415bDf7d37dfa63aed8Ef741` | `0xF1845D76Edc1475707f2CD94b6ead19c94306e69` |
| Alchemist Assistance (Intelligence) | `0xe606f6548Ae34DA9065B4fee88990F239b445403` | `0xdf82D8337eCc237C0C430555d3d5381194d103C2` |
| Puzzle Solving (Wisdom)             | `0x80F93836811a9A7721A21D7d8751aFd6A8fC9308` | `0x209D90eb6A63458E63b3976f56157EC9BD9e8219` |
| Card Game (Luck)                    | `0x5C01d797d0Cc3D79c01ef98f7ffAe25E4dCEB400` | `0x2Bc6047C2A6723118e153A820B700397678d6831` |
| Game of Ball (Agility)              | `0x378052bbc8D2E1819194802b8A990E7Ae43655bA` | `0x3BC38E3ea654693f9EdBd589577dF3dA01CFA29b` |
| Helping the Farm (Vitality)         | `0x89a60d8B332ce2Dd3bE8b170c6391F98a03a665F` | `0xc2A7953C90fF8E4de4450312a2E011cE8a7a7bd7` |
| Dancing (Endurance)                 | `0x058282847F1C8E893edcdfea5df6eb203ECA7832` | `0x07Ed0f3ba100Bf51bCE1Ed013D4Cb759e992A471` |
| Darts (Dexterity)                   | `0x8F3acf63fd09ceCD1F387B7bC45bc245f43D4B5e` | `0x10d8D837405D95680807Be1fff313347191F404e` |

#### Harmony

| Name                                | Mainnet                                      | Testnet                                      |
| ----------------------------------- | -------------------------------------------- | -------------------------------------------- |
| Arm Wrestling (Strength)            | `0xf60AF3a32Bb94e395E17C70aB695d968F37Bd2e4` | `0x2f5b9590B22479219532071388FCC299Fa29CFE7` |
| Alchemist Assistance (Intelligence) | `0x6176EedE1AE9127D59266f197Ad598653E4F8c92` | `0xDD53015F6ef6CebC9425BdDB7A1d9242F3f63576` |
| Puzzle Solving (Wisdom)             | `0x347097454fA1931A4e80dcDebb31F29FC355CbCE` | `0x77b92ca6CADF2acdC60BB0E2888756c82E1038e4` |
| Card Game (Luck)                    | `0x13E74E4E64805E7fdA381C9BEF1e77cd16086E56` | `0xbaD55FC759dfEAe46E543E02c6005cB5910aa3b5` |
| Game of Ball (Agility)              | `0xFA20B218927B0f57a08196743488c7C790a5625B` | `0x115153e27395628befa2F2c62d26F9729782A36a` |
| Helping the Farm (Vitality)         | `0x2174bBeFbEFBD766326a7C7538f93a78Db3eD449` | `0x89e465a433B0DFDd03A66eEFEE79c52F8aD5C3c9` |
| Dancing (Endurance)                 | `0xCb594A24D802cdF65000A84dC0059dde11c9d15f` | `0x2468189746Bc26772a1DFE18f89A36676F502880` |
| Darts (Dexterity)                   | `0xe03fd4e2F6421b1251297240cE5248508C9104eD` | `0x029e68846BC2661b6e05B458d6511418DB224C71` |


# Void Hunts

## Mappings

### Hunt IDs

Use the following

```json
{
  1: "Mad Boar"
  2: "Bad Motherclucker"
}
```

### Potions

The `_amounts` input of `startHuntWithItems` takes an array of item quantities, which **must include `0` values for any items not submitted**. The combined weights of the submitted items must not exceed the Battle Inventory of the selected Hunt.

The order of items submitted to the array is as follows. Additional future items will be appended to this array.

```json
[
  "Health Vial",
  "Full Health Potion",
  "Mana Vial",
  "Full Mana Potion",
  "Anti-Poison Potion",
  "Anti-Blind Potion",
  "Magic Resistance Potion",
  "Toughness Potion",
  "Swiftness Potion",
  [Unused],
  [Unused],
  [Unused],
  [Unused],
  [Unused],
  "Smoke Bomb"
]
```

## Contracts

### Addresses

#### DFK Chain

| Name         | Mainnet                                      | Testnet                                      |
| ------------ | -------------------------------------------- | -------------------------------------------- |
| HuntsDiamond | `0xEaC69796Cff468ED1694A6FfAc4cbC23bbe33aFa` | `0xEF333BfE61d9274549d1b2504c2d52c9F9DB4B83` |

### Interfaces

```solidity
interface IHuntsDiamond {

    // Events
    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDeferred(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeLockedBurned(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event HuntCanceled(uint256 huntId);
    event HuntCompleted(uint256 huntId, (uint256 id, uint256 huntDataId, uint256 startBlock, uint256[] heroIds, address player, uint8 status, uint256 resultSubmittedTimestamp, uint256[] petXpBonuses, uint256 startAtTime, uint256 retries, (address item, uint16 submittedAmount, uint16 usedAmount)[] consumableItems) hunt, bool huntWon, uint256[] heroIds);
    event HuntEquipmentMinted(uint256 indexed huntId, address indexed item, address indexed player, uint8 equipmentType, uint16 displayId, uint8 rarity, uint256 nftId);
    event HuntPetBonusReceived(uint256 indexed questId, address indexed player, uint256 heroId, uint256 petId);
    event HuntPotionBurned(uint256 indexed huntId, address indexed item, address indexed player, uint8 amount);
    event HuntPotionRefunded(uint256 indexed huntId, address indexed item, address indexed player, uint8 tier, uint8 amount);
    event HuntPotionReturned(uint256 indexed huntId, address indexed item, address indexed player, uint8 amount);
    event HuntRaffleAwarded(address winner, uint128 amount, uint64 raffleDay, uint64 totalEntries);
    event HuntResultSubmitted(uint256 huntId, bool result);
    event HuntRetried(uint256 huntId);
    event HuntRewardMinted(uint256 indexed huntId, address indexed player, address indexed item, uint256 amount, uint256 data);
    event HuntSponsoredRaffleAdded((uint256[] rewardAmounts, address rewardToken, uint16 sponsorId, uint16 startDay, uint16 remainingDays, uint32 raffleId) raffleData);
    event HuntSponsoredRaffleAwarded(address[] winners, uint256[] amounts, uint64 raffleDay, uint64 totalEntries, uint16 sponsorId, uint32 raffleId);
    event HuntSponsoredRaffleExpired((uint256[] rewardAmounts, address rewardToken, uint16 sponsorId, uint16 startDay, uint16 remainingDays, uint32 raffleId) raffleData);
    event HuntStarted((uint256 id, uint256 huntDataId, uint256 startBlock, uint256[] heroIds, address player, uint8 status, uint256 resultSubmittedTimestamp, uint256[] petXpBonuses, uint256 startAtTime, uint256 retries, (address item, uint16 submittedAmount, uint16 usedAmount)[] consumableItems) hunt);
    event HuntXP(uint256 indexed huntId, address indexed player, uint256 heroId, uint64 xpEarned);

    // State-Changing Functions
    function cancelHunt(uint256 _huntId);
    function completeHunt(uint256 _huntId);
    function retryHunt(uint256 _huntId);
    function startHunt(uint256 _huntDataId, uint256[] _heroIds);
    function startHuntWithItems(uint256 _huntDataId, uint256[] _heroIds, uint16[] _amounts);

    // View Functions
    function getActiveHunts() view returns (uint256[]);
    function getCurrentRaffleDay() view returns (uint256);
    function getHeroHunt(uint256 _heroId) view returns ((uint256 id, uint256 huntDataId, uint256 startBlock, uint256[] heroIds, address player, uint8 status, uint256 resultSubmittedTimestamp, uint256[] petXpBonuses, uint256 startAtTime, uint256 retries, (address item, uint16 submittedAmount, uint16 usedAmount)[] consumableItems, uint16[] itemWeights));
    function getHeroHuntAvailableAtTimestamps(uint256 _huntDataId, uint256[] _heroIds) view returns (uint256[]);
    function getHunt(uint256 _huntId) view returns ((uint256 id, uint256 huntDataId, uint256 startBlock, uint256[] heroIds, address player, uint8 status, uint256 resultSubmittedTimestamp, uint256[] petXpBonuses, uint256 startAtTime, uint256 retries, (address item, uint16 submittedAmount, uint16 usedAmount)[] consumableItems, uint16[] itemWeights));
    function getHuntCooldown() view returns (uint256);
    function getHuntCounter() view returns (uint256);
    function getLastPromoRaffleWinners() view returns ((address winner, uint16 sponsorId, uint32 raffleId, uint256 rewardQuantity, address rewardToken)[]);
    function getLastRaffleWinner() view returns (address);
    function getPromoRaffleData() view returns ((uint256[] rewardAmounts, address rewardToken, uint16 sponsorId, uint16 startDay, uint16 remainingDays, uint32 raffleId)[]);
    function getRaffleEntryCount() view returns (uint256);
    function getUserHuntIds(address _address) view returns (uint256[]);
    function getUserHunts(address _address) view returns ((uint256 id, uint256 huntDataId, uint256 startBlock, uint256[] heroIds, address player, uint8 status, uint256 resultSubmittedTimestamp, uint256[] petXpBonuses, uint256 startAtTime, uint256 retries, (address item, uint16 submittedAmount, uint16 usedAmount)[] consumableItems, uint16[] itemWeights)[]);
    function huntAtIndex(uint256 _id) view returns (uint256);
   
}
```

### ABIs

{% file src="/files/Pc0vsRwxyLaO1mPjNgm4" %}

{% file src="/files/DXoZzssR622XnGeZy8SK" %}


# Patrols

{% hint style="info" %}
Patrols is part of the [PVP Diamond](/contracts/pvp-combat) contract, and is combined with the [HeroV4 facet](/nfts/heroes/herov4-metis), [PVP facet](/contracts/pvp-combat), [Influence facet](/contracts/pvp-combat), and [MeditationV4](/contracts/meditation-circle) facet, which all share a contract address.
{% endhint %}

## Contracts

### Addresses

| Name  | Mainnet                                      | Testnet                                      |
| ----- | -------------------------------------------- | -------------------------------------------- |
| Metis | `0xc7681698B14a2381d9f1eD69FC3D27F33965b53B` | `0xb2bC817C100a6bd60e8bf8a79dBAD607cE9C3cF2` |

### Interfaces

```solidity
interface IPVPDiamond {

    // Events
    event PatrolAvailibleStageLinks(uint256 indexed patrolId, uint256[] allowedTrialIds);
    event PatrolBattleBudget(uint256 indexed patrolId, uint256 battleBudget);
    event PatrolCanceled(uint256 indexed patrolId, address indexed player);
    event PatrolCompleted(uint256 indexed patrolId, address indexed player, uint256 fightsCompleted, bool patrolWon);
    event PatrolEquipmentMinted(uint256 indexed huntId, address indexed item, address indexed player, uint256 equipmentType, uint256 displayId, uint256 rarity, uint256 nftId);
    event PatrolHeroAssigned(uint256 indexed patrolId, uint256 indexed heroId, uint256 attempts);
    event PatrolHeroStatsUpdated(uint256 indexed patrolId, uint256 indexed heroId, uint256 hp, uint256 mp, uint256 position);
    event PatrolHeroUnassigned(uint256 indexed patrolId, uint256 indexed heroId, uint256 attempts);
    event PatrolInvalidResultSubmission(uint256 indexed patrolId);
    event PatrolPlayerInputReceived(uint256 indexed patrolId, address indexed player, uint256 trialId, bool playerIsContinuing);
    event PatrolPotionBurned(uint256 indexed patrolId, address indexed item, address indexed player, uint8 amount);
    event PatrolPotionReturned(uint256 indexed patrolId, address indexed item, address indexed player, uint8 amount);
    event PatrolResultSubmitted(uint256 indexed patrolId, bool patrolWon, uint256[] enemyIndexes, uint256 usedPotions);
    event PatrolRewardMinted(uint256 indexed patrolId, address indexed player, address indexed item, uint256 amount, uint256 data);
    event PatrolStarted(uint256 indexed patrolId, address indexed player, uint256 enemyPoolId);
    event PatrolXpEarned(uint256 indexed patrolId, uint256 indexed heroId, uint256 xpEarned);
  
    // State-Changing Functions
    function completePatrol(uint256 _patrolId);
    function startPatrol(uint256 _trialId, uint256[] _heroIds, uint8[] _potionAmounts);
    function submitPlayerDecision(uint256 _patrolId, uint256 _trialId, bool _playerIsContinuing);
    
    // View Functions
    function getAllPlayerEnemyPoolIdCounters(address _player) view returns (uint256[]);
    function getAllPlayerKillCountersForEnemyPoolId(address _player, uint256 _enemyPoolId) view returns (uint256[]);
    function getEnemyKillCounter(address _player, uint256 _enemyPoolId, uint256 _enemyIndex) view returns (uint256);
    function getNextAvailableStageLinks(uint256 _patrolId) view returns ((uint256 trialId, uint256 poolId)[], (address player, uint256 trialId, uint256 stage, uint256 blockNumber, uint8 status, bool patrolWon, uint256 fightsCompleted));
    function getPatrol(uint256 _patrolId) view returns ((uint256 patrolId, (address player, uint256 trialId, uint256 stage, uint256 blockNumber, uint8 status, bool patrolWon, uint256 fightsCompleted) patrol, uint256[3] heroIds, uint256 potions));
    function getPatrolEnemyCounters(uint256 _patrolId) view returns ((uint256 enemyPoolId, uint256 enemyIndex, uint256 count)[]);
    function getPlayerEnemyPoolIdCounter(address _player, uint256 _enemyPoolId) view returns (uint256);
    function getPlayerPatrolStatsTracker(address _player) view returns ((uint256 battlesWon, uint256 fullPatrolsCompleted, uint256 patrolsLost, uint256 currentDay, uint256 battlesToday, uint256 battlesYesterday, uint256 battlesThisWeek, uint256 battlesLastWeek, uint256 battlesThisMonth, uint256 battlesLastMonth, uint256 fullPatrolsToday, uint256 fullPatrolsYesterday, uint256 fullPatrolsThisWeek, uint256 fullPatrolsLastWeek, uint256 fullPatrolsThisMonth, uint256 fullPatrolsLastMonth));
    function getTrial(uint256 _trialId) view returns ((bool canInitiate, uint256 dailyAttemptLimitGroup, uint256 dailyAttemptLimit, uint256 enemyPoolId, uint256 stages, uint256[8] stageLinks, uint256[8] stageLinkChances, bool hasSpecialRules, uint256 battleInventory, uint256 battleBudget));
    function getUpToDatePlayerPatrolStatsTracker(address _player) view returns ((uint256 battlesWon, uint256 fullPatrolsCompleted, uint256 patrolsLost, uint256 currentDay, uint256 battlesToday, uint256 battlesYesterday, uint256 battlesThisWeek, uint256 battlesLastWeek, uint256 battlesThisMonth, uint256 battlesLastMonth, uint256 fullPatrolsToday, uint256 fullPatrolsYesterday, uint256 fullPatrolsThisWeek, uint256 fullPatrolsLastWeek, uint256 fullPatrolsThisMonth, uint256 fullPatrolsLastMonth));
    function getUserPatrolIds(address _player) view returns (uint256[]);
    function getUserPatrols(address _player) view returns ((uint256 patrolId, (address player, uint256 trialId, uint256 stage, uint256 blockNumber, uint8 status, bool patrolWon, uint256 fightsCompleted) patrol, uint256[3] heroIds, uint256 potions)[]);
  
}
```

### ABIs

{% file src="/files/Qlo0WbRlefVzNNDjRmd6" %}

{% file src="/files/Qv1tOe7vHjZWDIdXeE2Z" %}

## Contract Data

### Mappings

#### Potions

Patrols use the same 15-item array mappings as [Void Hunts](/contracts/void-hunts#mappings).

#### Trial ID

| Trial ID | Trial Name        |
| -------- | ----------------- |
| 1        | Night Raid        |
| 2        | Dark Water        |
| 3        | Blood Moon Rising |
| 4        | Dark Water        |
| 5        | Dark Water        |
| 6        | Blood Moon Rising |
| 7        | Blood Moon Rising |


# PVP Combat

{% hint style="info" %}
The PVP Diamond is combined with the [HeroV4 facet](/nfts/heroes/herov4-metis), [Influence facet](/contracts/pvp-combat), Patrols facet, and [MeditationV4](/contracts/meditation-circle) facet, which all share a contract address.
{% endhint %}

## Contracts

### Addresses

| Name  | Mainnet                                      | Testnet                                      |
| ----- | -------------------------------------------- | -------------------------------------------- |
| Metis | `0xc7681698B14a2381d9f1eD69FC3D27F33965b53B` | `0xb2bC817C100a6bd60e8bf8a79dBAD607cE9C3cF2` |

### Interfaces

```solidity
interface IPVPDiamond {

    // Events
    event BattleAccepted(uint256 indexed battleId, address indexed host, address indexed opponent, uint256 battleSettingsPt1, uint256 battleSettingsPt2);
    event BattleAdminCanceled(uint256 indexed battleId, address indexed player);
    event BattleCanceled(uint256 indexed battleId, address indexed host);
    event BattleCompleteInvalid(uint256 battleId);
    event BattleCompleted(uint256 indexed battleId, address battleWinner, uint8 winner);
    event BattleCreated(uint256 indexed battleId, address indexed host, uint256 battleSettingsPt1, uint256 battleSettingsPt2);
    event BattleEarlyStartInvalid(uint256 battleId);
    event BattleHeroAssigned(uint256 heroId, uint256 battleId, uint8 side);
    event BattleHeroUnassigned(uint256 heroId, uint256 battleId, uint8 side);
    event BattleInfluenceDataUpdated(uint256 indexed battleId, tuple(uint256 influenceSideA, uint256 influenceSideB, uint256 spectatorCountSideA, uint256 spectatorCountSideB) influenceData);
    event BattleOpponentWithdrew(uint256 indexed battleId, address indexed opponent, uint256 battleSettingsPt1, uint256 battleSettingsPt2);
    event BattlePotionBurned(uint256 indexed battleId, address indexed item, address indexed player, uint8 amount);
    event BattlePotionReturned(uint256 indexed battleId, address indexed item, address indexed player, uint8 amount);
    event BattleResultSubmitted(uint256 indexed battleId, address indexed battleWinner, uint8[] _hostUsedAmounts, uint8[] _opponentUsedAmounts);
    event BattleSpectatorAdded(uint256 indexed battleId, address indexed player, uint8 winner, uint256 influenceAdded, tuple(uint256 influenceSideA, uint256 influenceSideB, uint256 spectatorCountSideA, uint256 spectatorCountSideB) influenceData);
    event BattleSpectatorRemoved(uint256 indexed battleId, address indexed player);
    event BattleSpectatorRewarded(uint256 indexed battleId, address indexed player, address rewardToken, bool isGasToken, uint256 amount);
    event BattleSpectatorVoteChanged(uint256 indexed battleId, address indexed player, uint8 newWinner, uint256 newInfluence, tuple(uint256 influenceSideA, uint256 influenceSideB, uint256 spectatorCountSideA, uint256 spectatorCountSideB) influenceData);
    event BattleSpectatorWithdrew(uint256 indexed battleId, address indexed player, uint8 winner, uint256 influenceRemoved, tuple(uint256 influenceSideA, uint256 influenceSideB, uint256 spectatorCountSideA, uint256 spectatorCountSideB) influenceData);
    event BattleSponsorRefunded(uint256 indexed battleId, address indexed sponsor, address sponsorToken, bool isGasToken, uint256 amount);
    event BattleSponsored(uint256 indexed battleId, address indexed sponsor, address sponsorToken, bool isGasToken, uint256 amount, uint256 sponsorCount, uint256 newTotal);
    event BattleStartedEarly(uint256 indexed battleId, uint256 battleStartTime);
    event BattleWinnerRewarded(uint256 indexed battleId, address indexed player, address rewardToken, bool isGasToken, uint256 amount);

    // State-Changing Functions
    function acceptBattle(uint256 _battleId, uint256[] _heroIds, uint8[] _potionAmounts, uint256 _glories);
    function cancelBattle(uint256 _battleId);
    function createBattle(uint256[] _heroIds, tuple(address host, uint256 battleStartTime, uint256 votingEnabledWithWindow, uint256 setupTime, uint256 minRank, uint256 maxRank, uint256 minRarity, uint256 maxRarity, uint256 battleInventory, uint256 battleBudget, uint256 minHeroStatScore, uint256 maxHeroStatScore, uint256 minTeamStatScore, uint256 maxTeamStatScore, uint256 minLevel, uint256 maxLevel, uint256 excludedClasses, uint256 excludedConsumables, uint256 excludedOrigin, uint256 shotClockDuration, uint256 bankedShotClockTime, uint256 shotClockPenaltyMode, uint256 shotClockForfeitCount, address opponent, uint256 partyCount, uint256 mapId, uint256 minGlories, uint256 hostGlories, uint256 opponentGlories, uint256 sponsorCount, uint8 battleState, bool privateBattle, bool allUniqueClasses, bool noTripleClasses, bool allowEarlyBattleStart, bool onlyPJ, bool autoRandom, bool gloryBout, bool mustIncludeClass1, uint256 includedClass1) _battleSettings, uint8[] _potionAmounts, address _opponentAddress);
    function modifyVote(uint256 _battleId, uint256 _influence, uint8 _winner);
    function sponsorBattle(uint256 _battleId, address _sponsorToken, bool _isGasToken, uint256 _amount) payable;
    function voteOnWinner(uint256 _battleId, uint256 _influence, uint8 _winner);
    function withdrawFromBattle(uint256 _battleId);
    function withdrawVote(uint256 _battleId);
    
    // View Functions
    function getBattle(uint256 _battleId) view returns (tuple(uint256 id, tuple(address host, uint256 battleStartTime, uint256 votingEnabledWithWindow, uint256 setupTime, uint256 minRank, uint256 maxRank, uint256 minRarity, uint256 maxRarity, uint256 battleInventory, uint256 battleBudget, uint256 minHeroStatScore, uint256 maxHeroStatScore, uint256 minTeamStatScore, uint256 maxTeamStatScore, uint256 minLevel, uint256 maxLevel, uint256 excludedClasses, uint256 excludedConsumables, uint256 excludedOrigin, uint256 shotClockDuration, uint256 bankedShotClockTime, uint256 shotClockPenaltyMode, uint256 shotClockForfeitCount, address opponent, uint256 partyCount, uint256 mapId, uint256 minGlories, uint256 hostGlories, uint256 opponentGlories, uint256 sponsorCount, uint8 battleState, bool privateBattle, bool allUniqueClasses, bool noTripleClasses, bool allowEarlyBattleStart, bool onlyPJ, bool autoRandom, bool gloryBout, bool mustIncludeClass1, uint256 includedClass1) settings, uint256[] hostHeroIds, uint256[] opponentHeroIds, uint256 hostPotions, uint256 opponentPotions));
    function getBattleAndSpectatorInfo(uint256 _battleId) view returns (tuple(tuple(uint256 id, tuple(address host, uint256 battleStartTime, uint256 votingEnabledWithWindow, uint256 setupTime, uint256 minRank, uint256 maxRank, uint256 minRarity, uint256 maxRarity, uint256 battleInventory, uint256 battleBudget, uint256 minHeroStatScore, uint256 maxHeroStatScore, uint256 minTeamStatScore, uint256 maxTeamStatScore, uint256 minLevel, uint256 maxLevel, uint256 excludedClasses, uint256 excludedConsumables, uint256 excludedOrigin, uint256 shotClockDuration, uint256 bankedShotClockTime, uint256 shotClockPenaltyMode, uint256 shotClockForfeitCount, address opponent, uint256 partyCount, uint256 mapId, uint256 minGlories, uint256 hostGlories, uint256 opponentGlories, uint256 sponsorCount, uint8 battleState, bool privateBattle, bool allUniqueClasses, bool noTripleClasses, bool allowEarlyBattleStart, bool onlyPJ, bool autoRandom, bool gloryBout, bool mustIncludeClass1, uint256 includedClass1) settings, uint256[] hostHeroIds, uint256[] opponentHeroIds, uint256 hostPotions, uint256 opponentPotions) battle, tuple(tuple(uint256 influenceSideA, uint256 influenceSideB, uint256 spectatorCountSideA, uint256 spectatorCountSideB) influenceData, tuple(address player, uint256 usedInfluence, uint8 side)[] spectators, tuple(address tokenAddress, uint256 amountAdded, bool isGasToken)[] sponsorTokens, tuple(address sponsor, uint256 amountAdded)[][] sponsors) spectatorInfo));
    function getBattleCounter() view returns (uint256);
    function getBattleIndex(uint256 _id, address _player) view returns (uint256);
    function getBattleInfluenceData(uint256 _battleId) view returns (tuple(uint256 influenceSideA, uint256 influenceSideB, uint256 spectatorCountSideA, uint256 spectatorCountSideB));
    function getBattleSettings(uint256 _battleId) view returns (tuple(address host, uint256 battleStartTime, uint256 votingEnabledWithWindow, uint256 setupTime, uint256 minRank, uint256 maxRank, uint256 minRarity, uint256 maxRarity, uint256 battleInventory, uint256 battleBudget, uint256 minHeroStatScore, uint256 maxHeroStatScore, uint256 minTeamStatScore, uint256 maxTeamStatScore, uint256 minLevel, uint256 maxLevel, uint256 excludedClasses, uint256 excludedConsumables, uint256 excludedOrigin, uint256 shotClockDuration, uint256 bankedShotClockTime, uint256 shotClockPenaltyMode, uint256 shotClockForfeitCount, address opponent, uint256 partyCount, uint256 mapId, uint256 minGlories, uint256 hostGlories, uint256 opponentGlories, uint256 sponsorCount, uint8 battleState, bool privateBattle, bool allUniqueClasses, bool noTripleClasses, bool allowEarlyBattleStart, bool onlyPJ, bool autoRandom, bool gloryBout, bool mustIncludeClass1, uint256 includedClass1));
    function getBattleSettingsPt1(uint256 _battleId) view returns (uint256);
    function getBattleSettingsPt2(uint256 _battleId) view returns (uint256);
    function getBattleSpectatorInfo(uint256 _battleId) view returns (tuple(tuple(uint256 influenceSideA, uint256 influenceSideB, uint256 spectatorCountSideA, uint256 spectatorCountSideB) influenceData, tuple(address player, uint256 usedInfluence, uint8 side)[] spectators, tuple(address tokenAddress, uint256 amountAdded, bool isGasToken)[] sponsorTokens, tuple(address sponsor, uint256 amountAdded)[][] sponsors));
    function getHeroBattle(uint256 _heroId) view returns (tuple(address host, uint256 battleStartTime, uint256 votingEnabledWithWindow, uint256 setupTime, uint256 minRank, uint256 maxRank, uint256 minRarity, uint256 maxRarity, uint256 battleInventory, uint256 battleBudget, uint256 minHeroStatScore, uint256 maxHeroStatScore, uint256 minTeamStatScore, uint256 maxTeamStatScore, uint256 minLevel, uint256 maxLevel, uint256 excludedClasses, uint256 excludedConsumables, uint256 excludedOrigin, uint256 shotClockDuration, uint256 bankedShotClockTime, uint256 shotClockPenaltyMode, uint256 shotClockForfeitCount, address opponent, uint256 partyCount, uint256 mapId, uint256 minGlories, uint256 hostGlories, uint256 opponentGlories, uint256 sponsorCount, uint8 battleState, bool privateBattle, bool allUniqueClasses, bool noTripleClasses, bool allowEarlyBattleStart, bool onlyPJ, bool autoRandom, bool gloryBout, bool mustIncludeClass1, uint256 includedClass1));
    function getHosts(uint256 _battleId) view returns (address);
    function getUnpackedBattleSettingsPt1(uint256 _battleId) view returns (tuple(uint256 battleStartTime, uint256 votingEnabledWithWindow, uint256 setupTime, uint256 minRank, uint256 maxRank, uint256 minRarity, uint256 maxRarity, uint256 battleInventory, uint256 battleBudget, uint256 minHeroStatScore, uint256 maxHeroStatScore, uint256 minTeamStatScore, uint256 maxTeamStatScore, uint256 minLevel, uint256 maxLevel, uint256 excludedClasses, uint256 excludedConsumables, uint256 excludedOrigin, uint256 shotClockDuration, uint256 bankedShotClockTime, uint256 shotClockPenaltyMode, uint256 shotClockForfeitCount, bool mustIncludeClass1));
    function getUnpackedBattleSettingsPt2(uint256 _battleId) view returns (tuple(address opponent, uint256 partyCount, uint256 mapId, uint256 minGlories, uint256 hostGlories, uint256 opponentGlories, uint256 sponsorCount, uint8 battleState, bool privateBattle, bool allUniqueClasses, bool noTripleClasses, bool allowEarlyBattleStart, bool onlyPJ, bool autoRandom, bool gloryBout, uint256 includedClass1));
    function getUserBattleIds(address _address) view returns (uint256[]);
    function getUserBattles(address _address) view returns (tuple(uint256 id, tuple(address host, uint256 battleStartTime, uint256 votingEnabledWithWindow, uint256 setupTime, uint256 minRank, uint256 maxRank, uint256 minRarity, uint256 maxRarity, uint256 battleInventory, uint256 battleBudget, uint256 minHeroStatScore, uint256 maxHeroStatScore, uint256 minTeamStatScore, uint256 maxTeamStatScore, uint256 minLevel, uint256 maxLevel, uint256 excludedClasses, uint256 excludedConsumables, uint256 excludedOrigin, uint256 shotClockDuration, uint256 bankedShotClockTime, uint256 shotClockPenaltyMode, uint256 shotClockForfeitCount, address opponent, uint256 partyCount, uint256 mapId, uint256 minGlories, uint256 hostGlories, uint256 opponentGlories, uint256 sponsorCount, uint8 battleState, bool privateBattle, bool allUniqueClasses, bool noTripleClasses, bool allowEarlyBattleStart, bool onlyPJ, bool autoRandom, bool gloryBout, bool mustIncludeClass1, uint256 includedClass1) settings, uint256[] hostHeroIds, uint256[] opponentHeroIds, uint256 hostPotions, uint256 opponentPotions)[]);
    
}
```

### ABIs

{% file src="/files/Qlo0WbRlefVzNNDjRmd6" %}

{% file src="/files/Qv1tOe7vHjZWDIdXeE2Z" %}

### Mappings

#### Potions

Patrols use the same 15-item array mappings as [Void Hunts](/contracts/void-hunts#mappings).


# Influence System

{% hint style="info" %}
The Influence System is part of the [PVP Diamond](/contracts/pvp-combat) contract, and is combined with the [HeroV4 facet](/nfts/heroes/herov4-metis), sharing a contract address.
{% endhint %}

## Contracts

### Addresses

#### Metis

| Name           | Mainnet                                      | Testnet                                      |
| -------------- | -------------------------------------------- | -------------------------------------------- |
| PVPDiamond     | `0xc7681698B14a2381d9f1eD69FC3D27F33965b53B` | `0xb2bC817C100a6bd60e8bf8a79dBAD607cE9C3cF2` |
| Colosseum Fund | `0xA0D026484859B84709749047a0118e3932c5DD92` | `0x3A1DD2De69AeC241eB6D601F73F29B7FE8a443c4` |

### Interfaces

```solidity
interface IPVPDiamond {

    // Events
    event BattleRewardsCollected(address indexed player, tuple(address tokenAddress, bool isGasToken)[] rewardTokens, uint256[] totalAmounts, uint256[] rewardCounts);
    event DailyInfluenceRewardCollected(address tokenAddress, uint256 amount, bool isGasToken, uint256 accTokensPerShare, uint256 globalInfluence);
    event DailyShellQuestComplete(address indexed player, uint256 rewardAmount, uint256 consecutiveDays);
    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDeferred(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeLockedBurned(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FrequentShellQuesterComplete(address indexed player, uint256 rewardAmount);
    event HeroInfluenceDataSet(uint256 indexed heroId, tuple(uint256 lockExpirationDay, uint256 daysLocked, uint256 influence, uint256 lastXpClaimDay) heroInfluenceData);
    event HeroPledgeRemoved(uint256 indexed heroId, uint256 fee);
    event HeroXpClaimed(uint256 indexed heroId, uint256 xpClaimed);
    event InfluenceRewardCollected(address indexed player, address tokenAddress, uint256 amount, bool isGasToken);
    event PlayerInfluenceDataUpdated(address indexed player, tuple(uint256 totalInfluence, uint256 availableInfluence, uint256 resetWeekNumber, uint256 spectatingBattleId) playerInfluenceData);
    event PlayerInfluenceDataUpdatedV2(address indexed player, (uint256 totalInfluence, uint256 availableInfluence, uint256 resetWeekNumber, uint256 spectatingBattleCount, bool convertedToV2, uint256 activeInfluence) playerInfluenceData);
    event ShellsClaimed(address indexed player, uint256 claimedAmount, (uint256 availableShells, uint256 dailyQuestRemainder, uint256 currentClaimDay, uint256 lastRewardDay, uint256 consecutiveRewardDays, uint256 totalDaysRewarded) claimData);
    event ShellsEarned(address indexed player, uint256 earnedAmount);
    event WeeklyShellQuestComplete(address indexed player, uint256 rewardAmount);

    // State-Changing Functions
    function breakPledge(uint256 _heroId);
    function claimBattleRewards();
    function claimHeroXp(uint256 _heroId);
    function claimInfluenceRewards();
    function claimShells();
    function earlyBreakPledge(uint256 _heroId);
    function multiBreakPledge(uint256[] _heroIds);
    function multiClaimHeroXp(uint256[] _heroIds);
    function multiEarlyBreakPledge(uint256[] _heroIds);
    function multiPledgeHero(uint256[] _heroIds, uint256[] _lockDurations);
    function pledgeHero(uint256 _heroId, uint256 _lockDuration);
    function updateRewards();
    
    // View Functions
    function MAX_DAYS_LOCKED() view returns (uint256);
    function MIN_DAYS_LOCKED() view returns (uint256);
    function getAllPlayerRewards(address _player) view returns (tuple(address tokenAddress, uint256 dayAdded, bool isGasToken)[], uint256[], tuple(tuple(address tokenAddress, bool isGasToken) token, tuple(uint256 rewardAmount, uint256 timeReceived, uint256 battleId, uint8 reason)[] rewardInfo)[]);
    function getCurrentRewards(address _player) view returns (tuple(address tokenAddress, uint256 dayAdded, bool isGasToken)[], uint256[]);
    function getCurrentSpectatorRewards(address _player) view returns (tuple(tuple(address tokenAddress, bool isGasToken) token, tuple(uint256 rewardAmount, uint256 timeReceived, uint256 battleId, uint8 reason)[] rewardInfo)[]);
    function getGlobalInfluence() view returns (uint256);
    function getHeroInfluence(uint256 _heroId, uint256 _lockDuration) view returns (uint256);
    function getHeroInfluenceData(uint256 _heroId) view returns (tuple(uint256 lockExpirationDay, uint256 daysLocked, uint256 influence, uint256 lastXpClaimDay));
    function getHeroScore(uint256 _heroId) view returns (uint256);
    function getPlayerInfluenceData(address _player) view returns (tuple(uint256 totalInfluence, uint256 availableInfluence, uint256 resetWeekNumber, uint256 spectatingBattleId));
    function getPlayerPledgedHeroes(address _player) view returns (uint256[]);
    function getPlayerPledgedHeroesWithIndex(address _player, uint256 _index, uint256 _count) view returns (uint256[]);
    function getShellClaimData(address _player) view returns ((uint256 availableShells, uint256 dailyQuestRemainder, uint256 currentClaimDay, uint256 lastRewardDay, uint256 consecutiveRewardDays, uint256 totalDaysRewarded));
    function getWithdrawalFee(uint256 _heroId) view returns (uint256);
    
}
```

### ABIs

{% file src="/files/Qlo0WbRlefVzNNDjRmd6" %}

{% file src="/files/Qv1tOe7vHjZWDIdXeE2Z" %}


# Gardens

{% hint style="info" %}

* On January 15, 2024, the [MasterGardener](/contracts/gardens/master-gardener) contract on **DFK Chain** was deprecated and replaced with the LP Staking contract.
* On March 6, 2024, [MasterGardener](/contracts/gardens/master-gardener) contract on **Klaytn** was deprecated and replaced with the LP Staking contract.
  {% endhint %}

## LP Staking

<table><thead><tr><th width="157.33333333333331">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>DFK Chain</td><td><code>0xB04e8D6aED037904B77A9F0b08002592925833b7</code></td><td><code>0x68c343846913163A356e353fEB56695031eb3D2a</code></td></tr><tr><td>Klaytn</td><td><code>0xcce557DF36a6E774694D5071FC1baF19B9b07Fdc</code></td><td><code>0x53Def60bE82255eAaA3451b923b083F4A0deF7B3</code></td></tr></tbody></table>

### Interface

```solidity
interface ILPStaking {

    // Events
    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event FeeRecipientSet(address indexed feeRecipient);
    event FeeStagesSet(uint256[] feeTimeStages, uint256[] feePercentStages);
    event PoolAdded(uint256 indexed pid, uint256 allocPoint, address lpToken);
    event PoolUpdated(uint256 indexed pid, uint256 allocPoint);
    event RewardClaimed(address indexed user, uint256 indexed pid, uint256 amount);
    event RewardCollected(uint256 indexed pid, uint256 amount, uint256 accRewardPerShare, uint256 govTokenSupply, uint256 timestamp);
    event RewardsProcessed(uint256 timestamp, uint256 amount);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);

    // State-Changing Functions
    function claimAllRewards();
    function claimRewards(uint256 _pid);
    function deposit(uint256 _pid, uint256 _amount);
    function processRewards();
    function withdraw(uint256 _pid, uint256 _amount);

    // View Functions
    function getAllPendingRewards(address _user) view returns (uint256 _pendingRewards);
    function getFeeRecipient() view returns (address _feeRecipient);
    function getFeeStageForUserAndPool(address _user, uint256 _pid) view returns (uint256 _timeSinceDeposit, uint256 _currentFeePercent);
    function getFeeStages() view returns (uint256[] _feeTimeStages, uint256[] _feePercentStages);
    function getPendingRewards(uint256 _pid, address _user) view returns (uint256 _pendingRewards);
    function getPoolInfo(uint256 _pid) view returns (tuple(address lpToken, uint256 allocPoint, uint256 lastRewardBlock, uint256 accRewardPerShare, uint256 totalStaked) _poolInfo);
    function getPoolLength() view returns (uint256 _poolLength);
    function getTotalAllocPoint() view returns (uint256 _totalAllocPoint);
    function getUserInfo(uint256 _pid, address _user) view returns (tuple(uint256 amount, uint256 rewardDebt, uint256 lastDepositTimestamp) _userInfo);
    function getWithdrawalFeePercentage(uint256 _timeDelta) view returns (uint256 _feePercentage);
    function poolInfo(uint256 _pid) view returns (tuple(address lpToken, uint256 allocPoint, uint256 lastRewardBlock, uint256 accGovTokenPerShare) _poolInfoLegacy);
    function totalAllocPoint() view returns (uint256 _totalAllocPoint);
    function userInfo(uint256 _pid, address _user) view returns (tuple(uint256 amount, uint256 rewardDebt, uint256 rewardDebtAtBlock, uint256 lastWithdrawBlock, uint256 firstDepositBlock, uint256 blockdelta, uint256 lastDepositBlock) _userInfoLegacy);

}
```

### ABI

{% file src="/files/bNIbwYCmYrbHXGqb9S0N" %}

## Incentivized Garden Pairs

{% hint style="warning" %}
Archived Garden pairs no longer receive token rewards and have been removed from the primary game interface.
{% endhint %}

#### DFK Chain

<table><thead><tr><th width="91.66815322866361" align="right">Pool ID (PID)</th><th width="178.35953522508254">Token Pair</th><th width="365">LP Contract Address</th><th data-type="checkbox">Archived Garden</th><th data-hidden data-type="checkbox">Archived</th><th data-hidden></th></tr></thead><tbody><tr><td align="right">0</td><td>wJEWEL-xJEWEL</td><td><code>0x6AC38A4C112F125eac0eBDbaDBed0BC8F4575d0d</code></td><td>true</td><td>false</td><td></td></tr><tr><td align="right">1</td><td>CRYSTAL-AVAX</td><td><code>0x9f378F48d0c1328fd0C80d7Ae544C6CadB5Ba99E</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">2</td><td>CRYSTAL-wJEWEL</td><td><code>0x48658E69D741024b4686C8f7b236D3F1D291f386</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">3</td><td>CRYSTAL-USDC</td><td><code>0x04Dec678825b8DfD2D0d9bD83B538bE3fbDA2926</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">4</td><td>ETH-USDC</td><td><code>0x7d4daa9eB74264b082A92F3f559ff167224484aC</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">5</td><td>wJEWEL-USDC</td><td><code>0xCF329b34049033dE26e4449aeBCb41f1992724D3</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">6</td><td>CRYSTAL-ETH</td><td><code>0x78C893E262e2681Dbd6B6eBA6CCA2AaD45de19AD</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">7</td><td>CRYSTAL-BTC.b</td><td><code>0x00BD81c9bAc29a3b6aea7ABc92d2C9a3366Bb4dD</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">8</td><td>CRYSTAL-KLAY</td><td><code>0xaFC1fBc3F3fB517EB54Bb2472051A6f0b2105320</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">9</td><td>wJEWEL-KLAY</td><td><code>0x561091E2385C90d41b4c0dAef651A4b33E1a5CfE</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">10</td><td>wJEWEL-AVAX</td><td><code>0xF3EabeD6Bd905e0FcD68FC3dBCd6e3A4aEE55E98</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">11</td><td>wJEWEL-BTC.b</td><td><code>0xfAa8507e822397bd56eFD4480Fb12ADC41ff940B</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">12</td><td>wJEWEL-ETH</td><td><code>0x79724B6996502afc773feB3Ff8Bb3C23ADf2854B</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">13</td><td>BTC.b-USDC</td><td><code>0x59D642B471dd54207Cb1CDe2e7507b0Ce1b1a6a5</code></td><td>false</td><td>false</td><td></td></tr></tbody></table>

#### Klaytn

<table><thead><tr><th width="90.66815322866361" align="right">Pool ID (PID)</th><th width="182.35953522508254">Token Pair</th><th width="362">LP Contract Address</th><th data-type="checkbox">Archived Garden</th><th data-hidden data-type="checkbox">Archived</th><th data-hidden></th></tr></thead><tbody><tr><td align="right">0</td><td>JADE-JEWEL</td><td><code>0x85DB3CC4BCDB8bffA073A3307D48Ed97C78Af0AE</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">1</td><td>JADE-wKLAY</td><td><code>0xd08A937a67eb5613ccC8729C01605E0320f1B216</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">2</td><td>JADE-AVAX</td><td><code>0x63b67d4a0f553D436B0a511836A7A4bDF8Af376A</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">3</td><td>JADE-oUSDT</td><td><code>0x509d49AC90EF180363269E35b363E10b95c983AF</code></td><td>true</td><td>false</td><td></td></tr><tr><td align="right">4</td><td>JADE-oWBTC</td><td><code>0x50943e1E500D7D62cc4c6904FBB3957fAfaEbEd5</code></td><td>true</td><td>false</td><td></td></tr><tr><td align="right">5</td><td>JADE-oETH</td><td><code>0x6fc625D907b524475887524b11DE833feF460698</code></td><td>true</td><td>false</td><td></td></tr><tr><td align="right">6</td><td>JEWEL-wKLAY</td><td><code>0x0d9d200720021F9de5C8413244f81087ecB4AdcC</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">7</td><td>JEWEL-AVAX</td><td><code>0x6CE5bb25A4E7aBF7214309F7b8D7cceCEF60867E</code></td><td>false</td><td>false</td><td></td></tr><tr><td align="right">8</td><td>JEWEL-oUSDT</td><td><code>0xB32839faF3826158995aF72d7824802840187f19</code></td><td>true</td><td>false</td><td></td></tr><tr><td align="right">9</td><td>JEWEL-oWBTC</td><td><code>0x7828926761e7a6E1f9532914A282bf6631EA3C81</code></td><td>true</td><td>false</td><td></td></tr><tr><td align="right">10</td><td>JEWEL-oETH</td><td><code>0xd3e2Fd9dB41Acea03f0E0c22d85D3076186f4f24</code></td><td>true</td><td>false</td><td></td></tr></tbody></table>


# Master Gardener

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

{% hint style="info" %}
The Master Gardener is based on the SushiSwap MasterChef contact. For more information, please view the Sushi Documentation: <https://docs.sushi.com/docs/Developers/Sushiswap/MasterChef>
{% endhint %}

{% hint style="success" %}
Fully Verified Contract on Harmony <https://explorer.harmony.one/address/0xdb30643c71ac9e2122ca0341ed77d09d5f99f924?activeTab=7>
{% endhint %}

### Addresses

| Network   | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| DFK Chain | `0x57Dec9cC7f492d6583c773e2E7ad66dcDc6940Fb` | `0xF8eDA301Fe64103DAa18a810527F77Cff674fe14` |
| Klaytn    | `0xad2ea7b7e49be15918E4917736E86ff7feA57a6A` | `0xA00F1B0D04D9a36e356A13459E76c25FAb688271` |
| Harmony   | `0xDB30643c71aC9e2122cA0341ED77d09D5f99F924` | `0x889aB3A26FEFFC204c9c566923D2aBED2236E661` |

### Interfaces

```solidity
interface IMasterGardener {

  event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
  event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
  event SendGovernanceTokenReward(address indexed user, uint256 indexed pid, uint256 amount, uint256 lockAmount);
  event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);

  function FINISH_BONUS_AT_TIMESTAMP() view returns (uint256);
  function HALVING_AT_TIMESTAMP(uint256) view returns (uint256);
  function PERCENT_FOR_COM() view returns (uint256);
  function PERCENT_FOR_DEV() view returns (uint256);
  function PERCENT_FOR_FOUNDERS() view returns (uint256);
  function PERCENT_FOR_LP() view returns (uint256);
  function PERCENT_LOCK_BONUS_REWARD(uint256) view returns (uint256);
  function REWARD_MULTIPLIER(uint256) view returns (uint256);
  function REWARD_PER_SECOND() view returns (uint256);
  function START_TIMESTAMP() view returns (uint256);
  function add(uint256 _allocPoint, address _lpToken, bool _withUpdate);
  function addAuthorized(address _toAdd);
  function authorized(address) view returns (bool);
  function bonusFinishUpdate(uint256 _newFinish);
  function claimReward(uint256 _pid);
  function claimRewards(uint256[] _pids);
  function comUpdate(address _newCom);
  function comfundaddr() view returns (address);
  function deposit(uint256 _pid, uint256 _amount);
  function dev(address _devaddr);
  function devFeeStage(uint256) view returns (uint256);
  function devaddr() view returns (address);
  function emergencyWithdraw(uint256 _pid);
  function founderUpdate(address _newFounder);
  function founderaddr() view returns (address);
  function getLockPercentage(uint256 _from, uint256 _to) view returns (uint256);
  function getMultiplier(uint256 _from, uint256 _to) view returns (uint256);
  function getNewRewardPerSecond(uint256 pid1) view returns (uint256);
  function getPoolReward(uint256 _from, uint256 _to, uint256 _allocPoint) view returns (uint256 forDev, uint256 forFarmer, uint256 forLP, uint256 forCom, uint256 forFounders);
  function govToken() view returns (address);
  function halvingUpdate(uint256[] _newHalving);
  function liquidityaddr() view returns (address);
  function lockUpdate(uint256[] _newlock);
  function lockcomUpdate(uint256 _newcomlock);
  function lockdevUpdate(uint256 _newdevlock);
  function lockfounderUpdate(uint256 _newfounderlock);
  function locklpUpdate(uint256 _newlplock);
  function lpUpdate(address _newLP);
  function massUpdatePools();
  function owner() view returns (address);
  function pendingReward(uint256 _pid, address _user) view returns (uint256);
  function poolExistence(address) view returns (bool);
  function poolId1(address) view returns (uint256);
  function poolInfo(uint256) view returns (address lpToken, uint256 allocPoint, uint256 lastRewardTimestamp, uint256 accGovTokenPerShare);
  function poolLength() view returns (uint256);
  function reclaimTokenOwnership(address _newOwner);
  function removeAuthorized(address _toRemove);
  function renounceOwnership();
  function rewardMulUpdate(uint256[] _newMulReward);
  function rewardUpdate(uint256 _newReward);
  function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate);
  function setDevFeeStage(uint256[] _devFees);
  function setStageEnds(uint256[] _timeEnds);
  function setStageStarts(uint256[] _timeStarts);
  function setUserFeeStage(uint256[] _userFees);
  function startTimestampUpdate(uint256 _newstarttimestamp);
  function timeDeltaEndStage(uint256) view returns (uint256);
  function timeDeltaStartStage(uint256) view returns (uint256);
  function totalAllocPoint() view returns (uint256);
  function transferOwnership(address newOwner);
  function updatePool(uint256 _pid);
  function usdOracle() view returns (address);
  function userDelta(uint256 _pid) view returns (uint256);
  function userFeeStage(uint256) view returns (uint256);
  function userInfo(uint256, address) view returns (uint256 amount, uint256 rewardDebt, uint256 rewardDebtAtTimestamp, uint256 lastWithdrawTimestamp, uint256 firstDepositTimestamp, uint256 timeDelta, uint256 lastDepositTimestamp);
  function withdraw(uint256 _pid, uint256 _amount)

}
```

```solidity
interface IMasterGardenerHarmony {

    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event SendGovernanceTokenReward(address indexed user, uint256 indexed pid, uint256 amount, uint256 lockAmount);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
    
    function FINISH_BONUS_AT_BLOCK() view returns (uint256);
    function HALVING_AT_BLOCK(uint256) view returns (uint256);
    function PERCENT_FOR_COM() view returns (uint256);
    function PERCENT_FOR_DEV() view returns (uint256);
    function PERCENT_FOR_FOUNDERS() view returns (uint256);
    function PERCENT_FOR_LP() view returns (uint256);
    function PERCENT_LOCK_BONUS_REWARD(uint256) view returns (uint256);
    function REWARD_MULTIPLIER(uint256) view returns (uint256);
    function REWARD_PER_BLOCK() view returns (uint256);
    function START_BLOCK() view returns (uint256);
    function add(uint256 _allocPoint, address _lpToken, bool _withUpdate);
    function addAuthorized(address _toAdd);
    function authorized(address) view returns (bool);
    function blockDeltaEndStage(uint256) view returns (uint256);
    function blockDeltaStartStage(uint256) view returns (uint256);
    function bonusFinishUpdate(uint256 _newFinish);
    function claimReward(uint256 _pid);
    function claimRewards(uint256[] _pids);
    function comUpdate(address _newCom);
    function comfundaddr() view returns (address);
    function deposit(uint256 _pid, uint256 _amount, address _ref);
    function dev(address _devaddr);
    function devDepFee() view returns (uint256);
    function devFeeStage(uint256) view returns (uint256);
    function devaddr() view returns (address);
    function emergencyWithdraw(uint256 _pid);
    function founderUpdate(address _newFounder);
    function founderaddr() view returns (address);
    function getGlobalAmount(address _user) view returns (uint256);
    function getGlobalRefAmount(address _user) view returns (uint256);
    function getLockPercentage(uint256 _from, uint256 _to) view returns (uint256);
    function getMultiplier(uint256 _from, uint256 _to) view returns (uint256);
    function getNewRewardPerBlock(uint256 pid1) view returns (uint256);
    function getPoolReward(uint256 _from, uint256 _to, uint256 _allocPoint) view returns (uint256 forDev, uint256 forFarmer, uint256 forLP, uint256 forCom, uint256 forFounders);
    function getRefValueOf(address _user, address _user2) view returns (uint256);
    function getTotalRefs(address _user) view returns (uint256);
    function govToken() view returns (address);
    function halvingUpdate(uint256[] _newHalving);
    function liquidityaddr() view returns (address);
    function lockUpdate(uint256[] _newlock);
    function lockcomUpdate(uint256 _newcomlock);
    function lockdevUpdate(uint256 _newdevlock);
    function lockfounderUpdate(uint256 _newfounderlock);
    function locklpUpdate(uint256 _newlplock);
    function lpUpdate(address _newLP);
    function massUpdatePools();
    function owner() view returns (address);
    function pendingReward(uint256 _pid, address _user) view returns (uint256);
    function poolExistence(address) view returns (bool);
    function poolId1(address) view returns (uint256);
    function poolInfo(uint256) view returns (address lpToken, uint256 allocPoint, uint256 lastRewardBlock, uint256 accGovTokenPerShare);
    function poolLength() view returns (uint256);
    function reclaimTokenOwnership(address _newOwner);
    function removeAuthorized(address _toRemove);
    function renounceOwnership();
    function reviseDeposit(uint256 _pid, address _user, uint256 _block);
    function reviseWithdraw(uint256 _pid, address _user, uint256 _block);
    function rewardMulUpdate(uint256[] _newMulReward);
    function rewardUpdate(uint256 _newReward);
    function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate);
    function setDevDepFee(uint256 _devDepFees);
    function setDevFeeStage(uint256[] _devFees);
    function setStageEnds(uint256[] _blockEnds);
    function setStageStarts(uint256[] _blockStarts);
    function setUserDepFee(uint256 _usrDepFees);
    function setUserFeeStage(uint256[] _userFees);
    function starblockUpdate(uint256 _newstarblock);
    function totalAllocPoint() view returns (uint256);
    function transferOwnership(address newOwner);
    function updatePool(uint256 _pid);
    function usdOracle() view returns (address);
    function userDelta(uint256 _pid) view returns (uint256);
    function userDepFee() view returns (uint256);
    function userFeeStage(uint256) view returns (uint256);
    function userGlobalInfo(address) view returns (uint256 globalAmount, uint256 totalReferals, uint256 globalRefAmount);
    function userInfo(uint256, address) view returns (uint256 amount, uint256 rewardDebt, uint256 rewardDebtAtBlock, uint256 lastWithdrawBlock, uint256 firstDepositBlock, uint256 blockdelta, uint256 lastDepositBlock);
    function withdraw(uint256 _pid, uint256 _amount, address _ref);

}
```

### ABIs

{% file src="/files/cTh1a99FP6jI0N9CcBNV" %}

{% file src="/files/OdkemUr8jklkejhiyHZl" %}

## Garden Pairs

#### Harmony

<table><thead><tr><th width="116" align="right">Pool ID (PID)</th><th width="179">Pair</th><th>LP Contract Address</th></tr></thead><tbody><tr><td align="right">0</td><td>JEWEL-WONE</td><td><code>0xEb579ddcD49A7beb3f205c9fF6006Bb6390F138f</code></td></tr><tr><td align="right">1</td><td>JEWEL-BUSD</td><td><code>0xE01502Db14929b7733e7112E173C3bCF566F996E</code></td></tr><tr><td align="right">2</td><td>JEWEL-bscBNB</td><td><code>0xE7d0116Dd1DBBBA2EFBAd58f097D1FFbbeDc4923</code></td></tr><tr><td align="right">3</td><td>1ETH-JEWEL</td><td><code>0xEaB84868f6c8569E14263a5326ECd62F5328a70f</code></td></tr><tr><td align="right">4</td><td>WONE-BUSD</td><td><code>0x3a0C4D87BdE442150779d63c1c695d003184dF52</code></td></tr><tr><td align="right">5</td><td>JEWEL-XYA</td><td><code>0x3733062773B24F9bAfa1e8f2e5A352976f008A95</code></td></tr><tr><td align="right">6</td><td>JEWEL-1USDC</td><td><code>0xA1221A5BBEa699f507CC00bDedeA05b5d2e32Eba</code></td></tr><tr><td align="right">7</td><td>1WBTC-JEWEL</td><td><code>0x0AcCE15D05B4BA4dBEdFD7AFD51EA4FA1592f75E</code></td></tr><tr><td align="right">8</td><td>UST-JEWEL</td><td><code>0xb91A0dFA0178500FEDC526f26A89803C387772E8</code></td></tr><tr><td align="right">9</td><td>1ETH-WONE</td><td><code>0x864fcd9a42a5f6e0f76BC309Ee26c8fab473FC3e</code></td></tr><tr><td align="right">10</td><td>1USDC-WONE</td><td><code>0x66C17f5381d7821385974783BE34c9b31f75Eb78</code></td></tr><tr><td align="right">11</td><td>1WBTC-1ETH</td><td><code>0x997f00485B238c83f7e58C2Ea1866DFD79f04A4b</code></td></tr><tr><td align="right">12</td><td>1SUPERBID-JEWEL</td><td><code>0x95f2409a44a9B989F8C5601037C513890E90cd06</code></td></tr><tr><td align="right">13</td><td>1SUPERBID-WONE</td><td><code>0x68a73f563ba14d51f070A6ddD073177FB794190A</code></td></tr><tr><td align="right">14</td><td>JEWEL-MIS</td><td><code>0x751606585FcAa73bf92Cf823b7b6D8A0398a1c99</code></td></tr><tr><td align="right">15</td><td>JEWEL-AVAX</td><td><code>0x093956649D43f23fe4E7144fb1C3Ad01586cCf1e</code></td></tr><tr><td align="right">16</td><td>JEWEL-FTM</td><td><code>0x7f89b5F33138C89FAd4092a7C079973C95362D53</code></td></tr><tr><td align="right">17</td><td>JEWEL-LUNA</td><td><code>0xB6e9754b90b338ccB2a74fA31de48ad89f65ec5e</code></td></tr><tr><td align="right">18</td><td>JEWEL-WMATIC</td><td><code>0x3E81154912E5E2Cc9B10Ad123BF14aeb93aE5318</code></td></tr></tbody></table>


# Jeweler 2.0

## Contracts

### Addresses

#### DFK Chain

| Name                         | Mainnet                                      | Testnet                                      |
| ---------------------------- | -------------------------------------------- | -------------------------------------------- |
| VoteEscrowTokenPool (cJEWEL) | `0x9ed2c155632C042CB8bC20634571fF1CA26f5742` | `0xD5b38Cb2B174ce5E8B183C4c369ED224BeE24AF8` |
| Jeweler2                     | `0x39DE24fA396eE8F94C8E01530cfdd57B195bDd7D` | `0x81c0FB3D00247cf259089B5954d9D03628AD1092` |
| FeeCollector                 | `0x8DEd102aAc620320ECc643603932117ed697091A` | `0x4f0ADF739aC417d8b04108239A26f5538B619dAc` |

#### Klaytn

| Name                         | Mainnet                                      | Testnet                                      |
| ---------------------------- | -------------------------------------------- | -------------------------------------------- |
| VoteEscrowTokenPool (sJEWEL) | `0xaA8548665bCC12C202d5d0C700093123F2463EA6` | `0x4419F44043301a38Ae6b6384c454740fe4DfB6eA` |
| Jeweler                      | `0x1AE44dbBf06025E4F72c632Aced1a5195233FA71` | `0x02D2441614119079Fb219691c51964E01bDa7693` |
| FeeCollector                 | `0xF34D3Cd4BB06b81D28f15068Bb8Dd0e078B7a6f7` | `0x75b0d1370161D34560eA895865Bae3b8C34AB067` |

### Interfaces

```solidity
interface IVoteEscrowTokenPool {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
    event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance);
    event Deposit(address indexed provider, tuple(uint256 amount, uint256 govTokenBalance, uint256 end, uint256 rewardDebt, uint256 availableSubBalance, uint32 subscriptionCount) user, uint256 govTokenReceived, uint256 timestamp);
    event EarlyWithdrawPenaltySet(uint256 indexed penalty);
    event FeeCollectorSet(address indexed addr);
    event MinLockedAmountSet(uint256 indexed amount);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event PenaltyCollectorSet(address indexed addr);
    event RewardClaimed(address indexed user, uint256 amount);
    event RewardCollected(uint256 amount, uint256 accGovTokenPerShare, uint256 govTokenSupply, uint256 timestamp);
    event SendGovernanceTokenReward(address indexed user, uint256 amount);
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Withdraw(address indexed provider, uint256 value, uint256 timestamp);
    
    function DOMAIN_SEPARATOR() view returns (bytes32);
    function MAXDAYS() view returns (uint256);
    function MAXTIME() view returns (uint256);
    function MAX_WITHDRAWAL_PENALTY() view returns (uint256);
    function MINDAYS() view returns (uint256);
    function PRECISION() view returns (uint256);
    function REWARD_PRECISION() view returns (uint256);
    function _votingPowerLockedDays(uint256 _value, uint256 _days) pure returns (uint256);
    function _votingPowerUnlockTime(uint256 _value, uint256 _unlockTime) view returns (uint256);
    function accGovTokenPerShare() view returns (uint256);
    function allowance(address owner, address spender) view returns (uint256);
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn() view returns (address);
    function checkpoints(address account, uint32 pos) view returns (tuple(uint32 fromBlock, uint224 votes));
    function claimReward();
    function createLock(uint256 _value, uint256 _days) payable;
    function dailyBalances(uint256) view returns (uint256);
    function dailyRewards(uint256) view returns (uint256);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function delegate(address delegatee);
    function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s);
    function delegates(address account) view returns (address);
    function deploymentTime() view returns (uint256);
    function earlyWithdrawPenaltyRate() view returns (uint256);
    function emergencyWithdraw();
    function feeCollector() view returns (address);
    function getAPRData(uint256 _day) view returns (uint256, uint256);
    function getPastTotalSupply(uint256 blockNumber) view returns (uint256);
    function getPastVotes(address account, uint256 blockNumber) view returns (uint256);
    function getTotalGovTokenAmount() view returns (uint256);
    function getTotalLockedAmount() view returns (uint256);
    function getUserInfo(address _addr) view returns (tuple(uint256 amount, uint256 govTokenBalance, uint256 end, uint256 rewardDebt, uint256 availableSubBalance, uint32 subscriptionCount));
    function getVotes(address account) view returns (uint256);
    function getYesterdayAPRData() view returns (uint256, uint256);
    function govTokenSupply() view returns (uint256);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function increaseLock(uint256 _value, uint256 _days) payable;
    function initialize(string _name, string _symbol, address _lockedToken, uint256 _minLockedAmount, bool _isGasToken);
    function isGasToken() view returns (bool);
    function lastRewardBlock() view returns (uint256);
    function lockedToken() view returns (address);
    function lockedTokenSupply() view returns (uint256);
    function minLockedAmount() view returns (uint256);
    function name() view returns (string);
    function nonces(address owner) view returns (uint256);
    function numCheckpoints(address account) view returns (uint32);
    function owner() view returns (address);
    function penaltyCollector() view returns (address);
    function pendingReward(address _user) view returns (uint256);
    function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s);
    function renounceOwnership();
    function symbol() view returns (string);
    function today() view returns (uint256);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    function transferOwnership(address newOwner);
    function updatePool();
    function userInfo(address) view returns (uint256 amount, uint256 govTokenBalance, uint256 end, uint256 rewardDebt, uint256 availableSubBalance, uint32 subscriptionCount);
    function withdraw();
    
}
```

```solidity
interface IJeweler {

    event LogBridgeSet(address indexed token, address indexed bridge);
    event LogConvert(address indexed server, address indexed token0, address indexed token1, uint256 amount0, uint256 amount1, uint256 amountGovToken);
    
    function bank() view returns (address);
    function bridgeFor(address token) view returns (address bridge);
    function convert(address token0, address token1);
    function convertMultiple(address[] token0, address[] token1);
    function factory() view returns (address);
    function owner() view returns (address);
    function setBridge(address token, address bridge);
    
}
```

```solidity
interface IFeeCollector {

    event Trade(address fromToken, address toToken, uint256 soldAmount, uint256 boughtAmount);
    
    function collectRewards();
    
}
```

### ABIs

{% file src="/files/Q4aJ6JTp6ENJglLPqYvK" %}

{% file src="/files/mdMmv6HfPwZGSUS2fqvS" %}

{% file src="/files/zFYkgE4VpzmlskwNU3UK" %}

## Related Contracts

{% content-ref url="/pages/oc29UJkT8G2NHEicW8q9" %}
[Governance Tokens](/tokens/governance-tokens)
{% endcontent-ref %}


# Power-Ups

## Power-Ups

The following Power-Ups are currently active:

```json
[
    {
        "id": 1,
        "name": "Quick Study",
        "powerUpType": 3,
        "tiers": 1,
        "heroesPerTier": 6,
        "lockTimeRequiredToAcquire": 604800,
        "cancelDelay": 86400,
        "govTokenPerTier": [30000000000000000000]
    },
    {
        "id": 2,
        "name": "Rapid Renewal",
        "powerUpType": 3,
        "tiers": 1,
        "heroesPerTier": 6,
        "lockTimeRequiredToAcquire": 604800,
        "cancelDelay": 86400,
        "govTokenPerTier": [20000000000000000000]
    },
    {
        "name": "Thrifty",
        "id": 3,
        "powerUpType": 2,
        "tiers": 2,
        "heroesPerTier": 0,
        "lockTimeRequiredToAcquire": 604800,
        "cancelDelay": 86400,
        "govTokenPerTier: ["500000000000000000000", "1500000000000000000000"],
    },
    {
        "id": 1001,
        "name": "Premium Provisions",
        "powerUpType": 1,
        "tiers": 1,
        "heroesPerTier": 0,
        "lockTimeRequiredToAcquire": 1209600,
        "cancelDelay": 1209600,
        "govTokenPerTier": [500000000000000000000]
    },
    {
        "id": 2001,
        "name": "Backstage Pass",
        "powerUpType": 1,
        "tiers": 1,
        "heroesPerTier": 0,
        "lockTimeRequiredToAcquire": 604800,
        "cancelDelay": 86400,
        "govTokenPerTier": [50000000000000000000]
    },
    {
        "id": 3001,
        "name": "Master Merchant",
        "powerUpType": 2,
        "tiers": 2,
        "heroesPerTier": 0,
        "lockTimeRequiredToAcquire": 604800,
        "cancelDelay": 86400,
        "govTokenPerTier": [500000000000000000000, 5000000000000000000000]
    },
]
```

## Contracts

### Addresses

#### DFK Chain

| Name           | Mainnet                                      | Testnet                                      |
| -------------- | -------------------------------------------- | -------------------------------------------- |
| PowerUpManager | `0xc20a268bc7c4dB28f1f6e1703676513Db06C1B93` | `0x61810dAbFE1Cf808c9e6dF9ED128b9806B95c33d` |

#### Klaytn

| Name           | Mainnet                                      | Testnet                                      |
| -------------- | -------------------------------------------- | -------------------------------------------- |
| PowerUpManager | `0xcd26DfD7EdAe42eD525266D9a53b466db4Ed4f7b` | `0x60faE1faE8123D3cB8d0e44C2a5c80A8c97d716b` |

### Types

```solidity
struct PowerUp {
    uint256 id; // Power-Up ID
    string name; // Name of the Power-Up
    uint256 powerUpType; // Type 1, 2, or 3. See docs for details
    uint256 tiers; // The number of tiers available; 1 for types 1 and 3, or a defined number for type 2
    uint256 heroesPerTier; // 0 for types 1 and 2, defined number for type 3
    uint256 lockTimeRequiredToAcquire; // Minimum Lock Time - Defined value per Power-Up (usually 7 days)
    uint256 cancelDelay; // Cancellation Hold Time - Defined value per Power-Up (usually 24 hours)
    uint256[] govTokenPerTier; // Array of length 1 for tiers 1 and 3, defined length for type 2
}

struct PowerUpUserData {
    bool isActivated; // Used by verifier to quickly check status of Power-Up
    bool emergencyWithdrawHappened; // Set to true if user performs an emergencyWithdraw while this Power-Up is active
    uint256 tier; // Set to 1 for type 1, one of the tier options for type 2, or a number between 1 and (user.heroesOwned + heroesPerTier - 1) / heroesPerTier for type 3
    uint256 openHeroSlots; // Initially set to heroesPerTier * tier for type 3, 0 for other types
    uint256 cancellationHeldSlots; // Used to hold slots for a time before making them available again
    uint256 heldSlotExpiration; // If in the past then any cancellationHeldSlots will be added back to openHeroSlots
    uint256 govTokenHoldExpiration; // Set upon cancelling a Power-Up or extending an expired Jeweler locking period
    address owner; // Player address
}

struct PowerUpHeroData {
    uint256 powerUpId; // Used to quickly check if a mapping exists for a given Power-Up and HeroID
    uint256 heroId; // The ID of the hero that this data references
    uint256 assignedSlot; // Used as a pointer to where the Hero is listed in PowerUpHeroesAssigned[]
    address owner; // Used to check that the Hero is using a Power-Up assigned by the current owner
}

struct PowerUpLock {
    uint256 powerUpId; // Power-Up ID
    uint256 govTokens; // The number of govTokens locked by the user Power-Up
    uint256 end; // The unlock time of the user's govToken balance
    uint256 govTokenHoldExpiration; // The expiration time of the govToken balance from the Power-Up 
    uint256 usedBalance; // The balance of the user's allocated govTokens
}
```

### Interfaces

```solidity
interface IPowerUpManager {

    // Events
    event Canceled(address player, uint256 powerUpId);
    event Deactivated(address player, uint256 powerUpId);
    event Expired(address player, uint256 powerUpId);
    event HeroAssigned(address player, uint256 powerUpId, uint256 heroId);
    event HeroRemoved(address player, uint256 powerUpId, uint256 heroId);
    event IncreasedTier(address player, uint256 powerUpId, tuple(bool isActivated, bool emergencyWithdrawHappened, uint256 tier, uint256 openHeroSlots, uint256 cancellationHeldSlots, uint256 heldSlotExpiration, uint256 govTokenHoldExpiration, address owner) userData);
    event PowerUpAdded(tuple(uint256 id, string name, uint256 powerUpType, uint256 tiers, uint256 heroesPerTier, uint256 lockTimeRequiredToAcquire, uint256 cancelDelay, uint256[] govTokenPerTier) powerup);
    event PowerUpRemoved(tuple(uint256 id, string name, uint256 powerUpType, uint256 tiers, uint256 heroesPerTier, uint256 lockTimeRequiredToAcquire, uint256 cancelDelay, uint256[] govTokenPerTier) powerup);
    event PowerUpUpdated(tuple(uint256 id, string name, uint256 powerUpType, uint256 tiers, uint256 heroesPerTier, uint256 lockTimeRequiredToAcquire, uint256 cancelDelay, uint256[] govTokenPerTier) powerup);
    event Subscribed(address player, uint256 powerUpId, tuple(bool isActivated, bool emergencyWithdrawHappened, uint256 tier, uint256 openHeroSlots, uint256 cancellationHeldSlots, uint256 heldSlotExpiration, uint256 govTokenHoldExpiration, address owner) userData);
    
    // State-Changing Functions
    function assignHero(uint256 _powerUpId, uint256 _heroId);
    function assignHeroes(uint256[] _powerUpIds, uint256[] _heroIds);
    function cancel(uint256 _powerUpId);
    function increaseTier(uint256 _powerUpId, uint256 _tier);
    function multiRemoveHeroFromAllType3ForSender(uint256[] _heroIds);
    function multiSendAndRemove(uint256[] _heroIds, address _recipient);
    function removeHero(uint256 _powerUpId, uint256 _heroId);
    function removeHeroFromAllType3ForSender(uint256 _heroId);
    function removeHeroes(uint256[] _powerUpIds, uint256[] _heroIds);
    function subscribe(uint256 _powerUpId, uint256 _tier);
    function verifyAllPowerUps();
    function verifyPowerUp(uint256 _powerUpId);
    function verifyPowerUpForUser(address _user, uint256 _powerUpId);
    function verifyPowerUpsForUser(address _user, uint256[] _powerUpIds);

    // View Methods
    function activePowerUps(uint256) view returns (uint256);
    function getActivePowerUps() view returns (tuple(uint256 id, string name, uint256 powerUpType, uint256 tiers, uint256 heroesPerTier, uint256 lockTimeRequiredToAcquire, uint256 cancelDelay, uint256[] govTokenPerTier)[]);
    function getAssignedHeroIds(address _account, uint256 _powerUpId) view returns (uint256[]);
    function getAssignedHeroes(address _account, uint256 _powerUpId) view returns (tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions)[]);
    function getPowerUpHeroData(uint256 _powerUpId, uint256 _heroId) view returns (tuple(uint256 powerUpId, uint256 heroId, uint256 assignedSlot, address owner));
    function getPowerUpStatusesAndTiers(uint256[] _powerUpIds, uint256[] _heroIds, address _user) view returns (tuple(uint64 powerUpId, uint8 tier, bool isActive, bool[6] heroStates)[]);
    function getUserPowerUpData(address _address, uint256 _powerUpId) view returns (tuple(bool isActivated, bool emergencyWithdrawHappened, uint256 tier, uint256 openHeroSlots, uint256 cancellationHeldSlots, uint256 heldSlotExpiration, uint256 govTokenHoldExpiration, address owner));
    function getUserPowerUpDataForActivePowerUps(address _address) view returns (tuple(bool isActivated, bool emergencyWithdrawHappened, uint256 tier, uint256 openHeroSlots, uint256 cancellationHeldSlots, uint256 heldSlotExpiration, uint256 govTokenHoldExpiration, address owner)[], tuple(uint256 powerUpId, uint256 govTokens, uint256 end, uint256 govTokenHoldExpiration, uint256 usedBalance)[]);
    function isHeroPowerUpActive(address _user, uint256 _powerUpId, uint256 _heroId) view returns (bool);
    function isUserPowerUpActive(address _user, uint256 _powerUpId) view returns (bool);
    function powerUpHeroData(uint256, uint256) view returns (uint256 powerUpId, uint256 heroId, uint256 assignedSlot, address owner);
    function powerUpHeroesAssigned(address, uint256, uint256) view returns (uint256);
    function powerUps(uint256) view returns (uint256 id, string name, uint256 powerUpType, uint256 tiers, uint256 heroesPerTier, uint256 lockTimeRequiredToAcquire, uint256 cancelDelay);
    function userPowerUpData(address, uint256) view returns (bool isActivated, bool emergencyWithdrawHappened, uint256 tier, uint256 openHeroSlots, uint256 cancellationHeldSlots, uint256 heldSlotExpiration, uint256 govTokenHoldExpiration, address owner);

}
```

### ABIs

{% file src="/files/2ML78tDb8t0BPUnbOL8z" %}

## Related Contracts

{% content-ref url="/pages/Z5n4cFVkwQvw7AULh6jf" %}
[Jeweler 2.0](/contracts/jeweler-2.0)
{% endcontent-ref %}

{% content-ref url="/pages/oc29UJkT8G2NHEicW8q9" %}
[Governance Tokens](/tokens/governance-tokens)
{% endcontent-ref %}


# Jeweler 1.0

{% hint style="info" %}
The Bank is based on the SushiSwap SushiBar contract. For more information, please view the Sushi Documentation: <https://docs.sushi.com/docs/Developers/Sushiswap/SushiBar>
{% endhint %}

{% hint style="info" %}
The Banker is based on the SushiSwap SushiMaker contract. For more information, please view the Sushi Documentation: <https://docs.sushi.com/docs/Developers/Sushiswap/SushiMaker>
{% endhint %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

{% hint style="success" %}
Fully Verified Contract: Bank\
<https://explorer.harmony.one/address/0xa9ce83507d872c5e1273e745abcfda849daa654f?activeTab=7>
{% endhint %}

{% hint style="success" %}
Fully Verified Contract: Banker\
<https://explorer.harmony.one/address/0x3685ec75ea531424bbe67db11e07013abeb95f1e?activeTab=7>
{% endhint %}

### Addresses

#### DFK Chain

| Name            | Mainnet                                      | Testnet                                      |
| --------------- | -------------------------------------------- | -------------------------------------------- |
| Bank (xCRYSTAL) | `0x6e7185872bcdf3f7a6cbbe81356e50daffb002d2` | `0x1A516207ABe4A0A636C6bB1C083c9EB46a026131` |
| Banker          | `0x4b1F4C7981465F814c4A78d79be21558A60f57F2` | `0x14b54Bf631c5147a1a59920f89128bE6A5FCe602` |

#### Harmony

| Name          | Mainnet                                      | Testnet                                      |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| Bank (xJEWEL) | `0xA9cE83507D872C5e1273E745aBcfDa849DAA654F` | `0x9bBD946ED9b6e9EA4FD85f3Fa9ADB9CC6f03c2BE` |
| Banker        | `0x3685Ec75Ea531424Bbe67dB11e07013ABeB95f1e` | `0xC617C69089a7f41C4030aC94Cf06dA2722D7ea12` |

### Interfaces

```solidity
interface IBank {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function enter(uint256 _amount);
    function govToken() view returns (address);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function leave(uint256 _share);
    function name() view returns (string);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address recipient, uint256 amount) returns (bool);
    function transferFrom(address sender, address recipient, uint256 amount) returns (bool)

}
```

```solidity
interface IBanker {

    event LogBridgeSet(address indexed token, address indexed bridge);
    event LogConvert(address indexed server, address indexed token0, address indexed token1, uint256 amount0, uint256 amount1, uint256 amountGovToken);
    
    function bank() view returns (address);
    function bridgeFor(address token) view returns (address bridge);
    function convert(address token0, address token1);
    function convertMultiple(address[] token0, address[] token1);
    function factory() view returns (address);
    function owner() view returns (address);
    function setBridge(address token, address bridge);
    
}
```

### ABIs

{% file src="/files/rXAo4Lmzj69CZflTHOdB" %}

{% file src="/files/xvPKqAJtqhAsQyZscUFx" %}

## Related Contracts

{% content-ref url="/pages/oc29UJkT8G2NHEicW8q9" %}
[Governance Tokens](/tokens/governance-tokens)
{% endcontent-ref %}


# Profiles

## Contracts

### Addresses

#### DFK Chain

| Name                | Mainnet                                      | Testnet                                      |
| ------------------- | -------------------------------------------- | -------------------------------------------- |
| Profiles            | `0xC4cD8C09D1A90b21Be417be91A81603B03993E81` | `0x8BCa36AA967b7ab0158D1eE1453A9de47Af71D78` |
| Stylist             | `0xf697D08Fba8db26EA8B9868aB3214f9E072F8f1c` | `0xCdeCB1A8B17de0b3C8D1D1a3AB50232d0c39275E` |
| IdentityTokenRouter | `0xD598F17d4Bcdf30E6fBE6f7dCF7A45c3ee662850` | `0xD598F17d4Bcdf30E6fBE6f7dCF7A45c3ee662850` |

#### Kaia

| Name                | Mainnet                                      | Testnet                                      |
| ------------------- | -------------------------------------------- | -------------------------------------------- |
| Profiles            | `0xe1b8C354BE50357c2ab90A962254526d08aF0D2D` | `0x8Bb052D91895868a13fde5698814Bbbbc497497F` |
| Stylist             | `0x2dB164A65BB10BBbde7Aa441EAfDAED67AbE08EE` | `0x5Ee8F510c1C7E82c48b22915016f3F70fEbff3C0` |
| IdentityTokenRouter | `0x15D9833EfcEce2E7877aca20f4140AE71c9e2394` | `0xDD1EC3228e854D6B159a3438F9D65c6c42Cf4cc7` |

#### Metis

| Name                | Mainnet                                      | Testnet                                      |
| ------------------- | -------------------------------------------- | -------------------------------------------- |
| Profiles            | `0x5477D7f1539aDC67787AEA54306700196B81E7c4` | `0xa06E6c2c4Ac7163e9c5beC56aF79ae483177d1bC` |
| IdentityTokenRouter | `0xDB850023dDc7E086D6f09c77C546cd867E872ecB` | `0x091cfc85d2e20b110Cd754c6c410A67c925C55ED` |

### Interfaces

```solidity
interface IProfiles {

    event ProfileCreated(address owner, string name, uint64 created, uint256 nftId, uint256 collectionId);
    event ProfileUpdated(address owner, string name, uint256 nftId, uint256 collectionId);
    
    function addressToProfile(address) view returns (address owner, string name, uint64 created, uint256 nftId, uint256 collectionId, string picUri);
    function changeName(address _profileAddress, string _name);
    function changePic(address _profileAddress, uint256 _nftId, uint256 _collectionId);
    function createProfile(string _name, uint256 _nftId, uint256 _collectionId);
    function getNames(address[] _addresses) view returns (string[]);
    function getProfile(address _profileAddress) view returns (tuple(address owner, string name, uint64 created, uint256 nftId, uint256 collectionId, string picUri));
    function getProfileByAddress(address _profileAddress) view returns (uint256 _id, address _owner, string _name, uint64 _created, uint8 _picId, uint256 _heroId, uint256 _points);
    function getProfileByName(string _name) view returns (tuple(address owner, string name, uint64 created, uint256 nftId, uint256 collectionId, string picUri));
    function getTokenUrisHeldByAddress(address _profileAddress, uint256 _collectionId) view returns (string[]);
    function heroesNftContract() view returns (address);
    function identityTokenRouter() view returns (address);
    function maxChar() view returns (uint8);
    function maxPic() view returns (uint8);
    function minChar() view returns (uint8);
    function nameToAddress(string) view returns (address);
    function picUris(uint256) view returns (string);

}
```

```solidity
interface IStylist {

    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event NameChange(address profileAddress, string oldName, string newName);
    event PicChange(address profileAddress, uint256 nftId, uint256 collectionId);
    
    function changeName(string _name);
    function changePic(uint256 _nftId, uint256 _collectionId);
    function feeAddresses(uint256) view returns (address);
    function feePercents(uint256) view returns (uint256);
    function nameChangeFee() view returns (uint256);
    function paused() view returns (bool);
    function picChangeFee() view returns (uint256);
    function powerToken() view returns (address);
    function profilesContract() view returns (address);

}
```

```solidity
interface IIdentityTokenRouter {

    event CollectionSet(uint256 collectionId, string collectionName, address externalTokenContract);
    
    function collections(uint256) view returns (uint256 collectionId, string collectionName, address collectionContract);
    function getTokenUrisHeldByAddress(address _owner, uint256 _collectionId) view returns (string[]);
    function ownerOf(uint256 _tokenId, uint256 _collectionId) view returns (address);
    function paused() view returns (bool);
    function tokenURI(uint256 _tokenId, uint256 _collectionId) view returns (string)

}
```

### ABIs

{% file src="/files/4BmnYRJs72GDmh7gcc7m" %}

{% file src="/files/PF3A2sIv4AzSu1mBFmrH" %}

{% file src="/files/0x7VfKlwZgL4X9e8gVv5" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

{% hint style="info" %}
The ProfilesV2 contract on Harmony was introduced on 2/15/2022.
{% endhint %}

### Addresses

#### Harmony

| Name                | Mainnet                                      | Testnet                                      |
| ------------------- | -------------------------------------------- | -------------------------------------------- |
| Profiles (V2)       | `0x6391F796D56201D279a42fD3141aDa7e26A3B4A5` | `0x729Fcb5f7C17Def718BC2D96b779742e1818fd06` |
| Profiles (V1)       | `0xabD4741948374b1f5DD5Dd7599AC1f85A34cAcDD` | `0xC9e3D669E51b9a77e214F94156DAB9B33Faadd08` |
| Stylist             | `0x8f1CeD3ABa6893E65DE59452C466B2CBb7Cd690b` | `0x703cadA8b820A0C7e22B424DAd7B2937A7afFD68` |
| IdentityTokenRouter | `0x51887a8271D50Ff1bc90C3c6befd47c65aeAa6C6` | `0xC9e3D669E51b9a77e214F94156DAB9B33Faadd08` |

### Interfaces

```solidity
interface IProfilesV1 {

    event ProfileCreated(uint256 profileId, address owner, string name, uint64 created, uint8 picId);
    event ProfileUpdated(uint256 profileId, address owner, string name, uint64 created, uint8 picId, uint256 heroId);
    
    function addressToIndex(address) view returns (uint256);
    function addresses(uint256) view returns (address);
    function changeHeroPic(uint256 profileId, uint256 _heroId) returns (bool success);
    function changeName(uint256 profileId, string _name) returns (bool success);
    function changePic(uint256 profileId, uint8 _picId) returns (bool success);
    function createProfile(string _name, uint8 _picId) returns (bool success);
    function getAddressByName(string name) view returns (address profileAddress);
    function getProfileByAddress(address profileAddress) view returns (uint256 _id, address _owner, string _name, uint64 _created, uint8 _picId, uint256 _heroId);
    function getProfileByName(string name) view returns (uint256 _id, address _owner, string _name, uint64 _created, uint8 _picId, uint256 _heroId);
    function getProfileCount() view returns (uint256 count);
    function heroesNftContract() view returns (address);
    function nameTaken(string name) view returns (bool taken);
    function nameToIndex(string) view returns (uint256);
    function profileExists(address profileAddress) view returns (bool exists);
    function profiles(uint256) view returns (uint256 id, address owner, string name, uint64 created, uint8 picId, uint256 heroId, bool set);

}
```

```solidity
interface IStylistHarmony {

    event NameChange(address profileAddress, string oldName, string newName);
    event PicChange(address profileAddress, uint256 nftId, uint256 collectionId);
    
    function changeName(string _name); // Currently Unavailable
    function changePic(uint256 _nftId, uint256 _collectionId);
    function jewelToken() view returns (address);
    function nameChangeFee() view returns (uint256);
    function paused() view returns (bool);
    function picChangeFee() view returns (uint256);
    function profilesContract() view returns (address);

}
```

### ABIs

{% file src="/files/YroKZIKBsbt6r8H0ubfu" %}

{% file src="/files/EnSL1a59BWiAJ1vuCh30" %}


# DFK Duel

## Contracts

### Addresses

#### DFK Chain

| Name            | Mainnet                                      | Testnet                                      |
| --------------- | -------------------------------------------- | -------------------------------------------- |
| DFK Duel (S6)   | `0xb7F679d69FA55b762F7f48432Da77D096d749540` | `0xB1834889b1B87dEbd5FB4aAA9a339eA489C34793` |
| Duel Rank Claim | `0x89789a580fdE00319493BdCdB6C65959DAB1e517` | `0x14dB6602b620Ad4B781164C7BADB288b675e18eb` |

#### Klaytn

| Name            | Mainnet                                      | Testnet                                      |
| --------------- | -------------------------------------------- | -------------------------------------------- |
| DFK Duel (S6)   | `0x1207b51994c7A21cC0C78Ad1B12f2A3E203afC85` | `0x1c648BaFfA8F06d552ebf0cF6E5169f299aff26E` |
| Duel Rank Claim | `0xb0f423BCB1F4396781e21ad9E0BC151d29Ac020C` | `0x4818D6cFCCBCbe1a11B26d381fd6Af8321d42A16` |

### Interfaces

```solidity
interface IDFKDuelS6 {

    // Events
    event ChampionMedalReturned(address player, uint256 lobby, uint256 medalId);
    event ChampionMedalsEarned(address player, uint256 lobby, uint256 count);
    event DuelCompleted(uint256 indexed duelId, address indexed player1, address indexed player2, tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange) duel);
    event DuelCreated(uint256 indexed duelId, address indexed player1, address indexed player2, tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange) duel);
    event DuelEntryCreated(uint256 id, address indexed player, uint256[] heroIds, tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata) duelEntry);
    event DuelEntryMatched(uint256 indexed duelId, uint256 indexed duelEntryId, address indexed player1, address player2);
    event DuelKingBounty(uint256 indexed lobby, address player, uint256 duelEntryId, uint256 amount, uint64 timestamp);
    event DuelKingReward(uint256 indexed lobby, address player, uint256 duelEntryId, uint256 amount, uint64 timestamp);
    event DuelMatchReshuffle(uint256 indexed duelEntryId, uint256 indexed duelType);
    event DuelNewKing(uint256 indexed lobby, uint256 newKingId, uint256 oldKingId);
    event DuelPtBalanceClaimed(address player, uint256 amount, uint64 timestamp);
    event EntriesRecharged(uint256 indexed heroId, uint256 indexed lobby, uint256 day, uint256 rechargeCount, uint256 amount);
    event FeeDeferred(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event HeroLockedToWallet(uint256 heroId, address indexed lastHeroDuelOwner, uint256 indexed lastHeroDuelTime);
    event PassiveEntryRemoved(uint256 indexed duelEntryId, uint256 indexed duelType);
    event PlayerScoreChanged(uint256 indexed duelId, address indexed player, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) playerScoreChange);
    event TurnOutcome(uint256 indexed duelId, uint256 indexed player1HeroId, uint256 indexed player2HeroId, tuple(uint16 turn, uint256 player1HeroId, uint256 player2HeroId, uint8 stat, uint8 background, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 equipmentBonus, uint16 total, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) hero1Score, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 equipmentBonus, uint16 total, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) hero2Score, uint256 winnerHeroId, address winnerPlayer, tuple(uint256 petId, uint8 petRarity, tuple(tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, uint8 class, uint8 subClass, uint8 element, uint8 background, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) data) hero1Snapshot, tuple(uint256 petId, uint8 petRarity, tuple(tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, uint8 class, uint8 subClass, uint8 element, uint8 background, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) data) hero2Snapshot) turnResult);
    event UpdatedCrossChainData(uint256 indexed _heroId, address indexed _address, uint256 indexed time);

    // Ranked Mode
    function completeDuel(uint256 _duelId);
    function completeDuels(uint256 _numToComplete);
    function enterDuelLobby(uint256 _lobby, uint256[] _heroIds, uint256 _tokenFee, uint8 _background, uint8 _stat, uint8 _entries);
    function enterDuelLobbyWithLocked(uint256 _lobby, uint256[] _heroIds, uint256 _tokenFee, uint8 _background, uint8 _stat, uint8 _entries);
    function matchMake();
    function repairDuelEntry(uint256 _entryId);
    function rechargeEntries(uint8 _lobby, uint256 _heroId);
    function rechargeEntriesMulti(uint8 _lobby, uint256[] _heroIds);

    // Champion Mode
    function challengeKing(uint256 _lobby, uint256[] _heroIds, uint256 _background, uint256 _stat);
    function claimPtBalance();
    function returnChampionMedal(uint256 _lobby, uint256 _accessoryId);
    function updateChampionLeaderboard(uint256 _lobby);
            
    // Private & Practice Modes
    function acceptChallenge(uint256 _duelId, uint256[] _heroIds, uint8 _background, uint8 _stat);
    function cancelPrivateDuel(uint256 _duelId);
    function startPracticeDuel(uint256 _lobby, uint256[] _heroIds, uint8 _rank, uint8 _background, uint8 _stat);
    function startPrivateDuel(uint256 _lobby, uint256[] _heroIds, address _opponent, uint8 _background, uint8 _stat);

    // View Functions
    function getActiveDuels(address _address) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getChallenges(address _profile) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getChampionLeaderboard(uint256 _type, uint256 _start, uint256 _end) view returns (address[] _addresses, uint256[] _times, uint256 _lastUpdate);
    function getCurrentClassBonuses() view returns (uint8[6][2]);
    function getCurrentHeroScoreDuelId(uint256 _heroId) view returns (uint256);
    function getDuel(uint256 _id) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange));
    function getDuelEntries(uint256 _start, uint256 _end) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata)[]);
    function getDuelEntry(uint256 _id) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata));
    function getDuelHistory(address _profile) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[100]);
    function getDuelIndexP1(uint256 _duelId) view returns (uint256);
    function getDuelRewards(uint256 _id) view returns (tuple(address item, address recipient, uint256 qty)[]);
    function getDuelTurns(uint256 _id) view returns (tuple(uint16 turn, uint256 player1HeroId, uint256 player2HeroId, uint8 stat, uint8 background, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 equipmentBonus, uint16 total, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) hero1Score, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 equipmentBonus, uint16 total, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) hero2Score, uint256 winnerHeroId, address winnerPlayer, tuple(uint256 petId, uint8 petRarity, tuple(tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, uint8 class, uint8 subClass, uint8 element, uint8 background, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) data) hero1Snapshot, tuple(uint256 petId, uint8 petRarity, tuple(tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, uint8 class, uint8 subClass, uint8 element, uint8 background, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) data) hero2Snapshot)[]);
    function getDuels(uint256 _start, uint256 _end) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getHeroAddress(uint256[] _heroIds) view returns (address[]);
    function getHeroCoreAddress() view returns (address);
    function getHeroDuel(uint256 _heroId) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange));
    function getHeroDuelCountForDay(uint256[] _heroIds, uint256 _duelType) view returns (uint256[]);
    function getHeroDuelEntry(uint256 _heroId) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata));
    function getHeroLastTimePlayed(uint256 _heroId) view returns (uint256);
    function getHeroRechargeInfo(uint256 _heroId, uint256 _lobby) view returns (uint256 _rechargeCount, uint256 _rechargeCost, uint256 _day, uint64 _secondsUntilNextDay);
    function getHeroesDuelDailyData(uint256[] _heroIds, uint256 _duelType) view returns (tuple(uint256 numDuels, uint256 rechargeCount, uint256 rechargeCost, uint256 formerKingRechallengeTime, address lastPlayer)[] heroData, uint256 _today, uint64 _secondsUntilNextDay);
    function getHighestScore(uint256 _type) view returns (uint64);
    function getKingInfo(uint256 _lobby) view returns (uint256 _kingId, uint256 _currentBounty, uint256 _challengeCost, uint32 _streakRequired, uint64 _scoreRequired, uint256 _kingChangeDuelId);
    function getLeaderboard(uint256 _type, uint256 _start, uint256 _end) view returns (address[] _addresses, uint256[] _scores, uint256[] _totalDuels, uint256[] _totalWins);
    function getLeaderboardRank(uint64 _score, uint256 _type) view returns (uint256);
    function getNumRanks(uint256 _type) pure returns (uint256);
    function getPlayerDuelEntries(address _profile) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata)[]);
    function getPlayerInfo(address _profile) view returns (uint64[] _scores, uint256[] _ranks, uint64[] _totalWins, uint32[] _winStreaks, uint64[] _totalDuels, uint256[] _lbRanks, uint256 _ptBalance, uint256[] _championTimes);
    function getPlayerRank(address _profile, uint256 _type) view returns (uint256);
    function getPlayerScore(address _profile, uint256 _type) view returns (uint64);
    function getPracticeEntry(uint256 _type, uint8 _rank) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata));
    function getRankLevels(uint256 _type) pure returns (uint16[]);
    function getSeasonInfo() view returns (uint256 startTime, uint256 endTime, uint16 season);
    function getTotalDuelEntries() view returns (uint256);
    function getTotalDuelEntriesByType(uint256 _type) view returns (uint256);
    function getTotalDuels() view returns (uint256);
    function getTotalDuelsByType(uint256 _type) view returns (uint256);
    function getTotalOpenDuelEntries(uint256 _lobby) view returns (uint256);
    function getTotalPlayerDuels(address _profile, uint256 _type) view returns (uint64);
    function getTotalPlayerWins(address _profile, uint256 _type) view returns (uint64);
    function getWinStreaks(address _player, uint256 _type) view returns (uint256);
            
}
```

```solidity
interface IDuelRankClaim {

    event Claimed(uint256 indexed rankId, address indexed recipient, address token, uint256 amount, uint256 timestamp);

    function _calculateRankId(uint256 _season, uint256 _duelType, uint256 _rank) pure returns (uint256);
    function claimReward(uint256 _season, uint256 _duelType, uint256 _rank);
    function getClaimedRanks(uint256 _season, uint256 _duelType, address _user) view returns (uint256[]);
    function getRewards(uint256 _season, uint256 _duelType, uint256 _rank) view returns (tuple(address tokenAddress, uint256 amount, bool isEquipmentCache, uint8 equipmentType, uint16 displayId, uint8 rarity)[]);
    function getRewardsForSeasonAndDuelType(uint256 _season, uint256 _duelType) view returns (tuple(address tokenAddress, uint256 amount, bool isEquipmentCache, uint8 equipmentType, uint16 displayId, uint8 rarity)[][]);
    function getSeasonInfo(address _player, uint256 _season, uint256 _duelType) view returns (uint64 score, uint256 rank, uint16[] ranks, uint256[] claimedRanks, tuple(address tokenAddress, uint256 amount, bool isEquipmentCache, uint8 equipmentType, uint16 displayId, uint8 rarity)[][] rewards, uint256 startTime, uint256 endTime);
    function getSeasonRankRequirements(uint256 _season, uint256 _duelType) view returns (uint16[]);
    function rankRewards(uint256, uint256) view returns (address tokenAddress, uint256 amount);
    function rankRewardsV2(uint256, uint256) view returns (address tokenAddress, uint256 amount, bool isEquipmentCache, uint8 equipmentType, uint16 displayId, uint8 rarity);
    function userRankClaims(uint256, address) view returns (uint256);

}
```

### ABIs

{% file src="/files/PT7aqOSTosDG62ZQghcK" %}

{% file src="/files/jPx5HDqYERLMTXCZFOA2" %}

## Related Contracts

{% content-ref url="/pages/4SnUu1Y8A3akXp5hSN35" %}
[Raffle Master](/contracts/dfk-duel/raffle-master)
{% endcontent-ref %}

{% content-ref url="/pages/QJfkuQQDjlHvajMZCd8R" %}
[Raffle Tickets](/tokens/miscellaneous-tokens/raffle-tickets)
{% endcontent-ref %}


# Previous Seasons

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### DFK Chain

| Name          | Mainnet                                      | Testnet                                      |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| DFK Duel (S5) | `0x8990EAc13974522e5DAb87241a5002A61b2883d1` | `0x1C1cCB51025444A1411A06aBBC5a2e014fE614d4` |
| DFK Duel (S4) | `0xb7fe0195808E620A71672bcCa853cD848f906621` | `0xDF1772ba8B6f91FcEE6B4d18C1064023B88C5B1b` |
| DFK Duel (S3) | `0x26E47585e93f354864Ad2644fcAc348e3db5a7F3` | `0x290Ae855d535aA515426341B24605f7a8E4B5cA1` |
| DFK Duel (S2) | `0x9EEaBBcf42F0c4900d302544Cce599811C2De2b9` | `0x586b789E6aAFBc9E11FA58E3f721bf7c97C6d832` |
| DFK Duel (S1) | `0xf724FE22b45D519D149477aA2eC5348Cee08Cae3` | `0x1c6225F77A875a6217150595A3437EfA55046197` |

#### Klaytn

| Name          | Mainnet                                      | Testnet                                      |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| DFK Duel (S5) | `0x8d68BdfFa8830f9b7Dc36e07175E80286127E597` | `0xC14aa095EF6e56Fad84f0f18A8E5b687597D18d5` |
| DFK Duel (S4) | `0x338D7Dfb8E44c39Bfdfe4967CB79B08188dEA3C0` | `0x0F3455f223148Ba58327887247d47fF2524295E4` |
| DFK Duel (S3) | `0x780AB5bdD18eD8cBB45267e53B11EE72EbF65A21` | `0x856ac3B199Cd778996c19EF5ED92c2166eECf152` |
| DFK Duel (S2) | `0xF719C12a5A7C0f13F3c1B71074960A25E2f9Aa9e` | `0x20f10ef23Cdc11Fa55E6B3703d88f19A7B345D15` |

#### Harmony

| Name                  | Mainnet                                      | Testnet                                      |
| --------------------- | -------------------------------------------- | -------------------------------------------- |
| DFK Duel (Pre-Season) | `0xE97196f4011dc9DA0829dd8E151EcFc0f37EE3c7` | `0x3b1114AF654E022bBDeE927b5dFa5F183b717b0B` |

### Interfaces

#### Season 5

```solidity
interface IDFKDuelS5 {

    // Events
    event DuelCompleted(uint256 indexed duelId, address indexed player1, address indexed player2, tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange) duel);
    event DuelCreated(uint256 indexed duelId, address indexed player1, address indexed player2, tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange) duel);
    event DuelEntryCreated(uint256 id, address indexed player, uint256[] heroIds, tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata) duelEntry);
    event DuelEntryMatched(uint256 indexed duelId, uint256 indexed duelEntryId, address indexed player1, address player2);
    event DuelKingBounty(uint256 indexed lobby, address player, uint256 duelEntryId, uint256 amount, uint64 timestamp);
    event DuelKingReward(uint256 indexed lobby, address player, uint256 duelEntryId, uint256 amount, uint64 timestamp);
    event DuelMatchReshuffle(uint256 indexed duelEntryId, uint256 indexed duelType);
    event DuelNewKing(uint256 indexed lobby, uint256 newKingId, uint256 oldKingId);
    event DuelPtBalanceClaimed(address player, uint256 amount, uint64 timestamp);
    event EntriesRecharged(uint256 indexed heroId, uint256 indexed lobby, uint256 day, uint256 rechargeCount, uint256 amount);
    event FeeDeferred(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event HeroLockedToWallet(uint256 heroId, address indexed lastHeroDuelOwner, uint256 indexed lastHeroDuelTime);
    event PassiveEntryRemoved(uint256 indexed duelEntryId, uint256 indexed duelType);
    event PlayerScoreChanged(uint256 indexed duelId, address indexed player, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) playerScoreChange);
    event TurnOutcome(uint256 indexed duelId, uint256 indexed player1HeroId, uint256 indexed player2HeroId, tuple(uint16 turn, uint256 player1HeroId, uint256 player2HeroId, uint8 stat, uint8 background, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 equipmentBonus, uint16 total, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) hero1Score, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 equipmentBonus, uint16 total, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) hero2Score, uint256 winnerHeroId, address winnerPlayer, tuple(uint256 petId, uint8 petRarity) hero1Snapshot, tuple(uint256 petId, uint8 petRarity) hero2Snapshot) turnResult);
    event UpdatedCrossChainData(uint256 indexed _heroId, address indexed _address, uint256 indexed time);

    // Ranked Mode
    function completeDuel(uint256 _duelId);
    function completeDuels(uint256 _numToComplete);
    function enterDuelLobby(uint256 _lobby, uint256[] _heroIds, uint256 _tokenFee, uint8 _background, uint8 _stat, uint8 _entries);
    function enterDuelLobbyWithLocked(uint256 _lobby, uint256[] _heroIds, uint256 _tokenFee, uint8 _background, uint8 _stat, uint8 _entries);
    function matchMake();
    function repairDuelEntry(uint256 _entryId);
    function rechargeEntries(uint8 _lobby, uint256 _heroId);
    function rechargeEntriesMulti(uint8 _lobby, uint256[] _heroIds);

    // Champion Mode
    function challengeKing(uint256 _lobby, uint256[] _heroIds, uint256 _background, uint256 _stat);
    function claimPtBalance();

    // Private & Practice Modes
    function acceptChallenge(uint256 _duelId, uint256[] _heroIds, uint8 _background, uint8 _stat);
    function cancelPrivateDuel(uint256 _duelId);
    function startPracticeDuel(uint256 _lobby, uint256[] _heroIds, uint8 _rank, uint8 _background, uint8 _stat);
    function startPrivateDuel(uint256 _lobby, uint256[] _heroIds, address _opponent, uint8 _background, uint8 _stat);

    // View Functions
    function getActiveDuels(address _address) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getChallenges(address _profile) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getCurrentClassBonuses() view returns (uint8[6][2]);
    function getCurrentHeroScoreDuelId(uint256 _heroId) view returns (uint256);
    function getDuel(uint256 _id) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange));
    function getDuelEntries(uint256 _start, uint256 _end) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata)[]);
    function getDuelEntry(uint256 _id) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata));
    function getDuelHistory(address _profile) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[100]);
    function getDuelIndexP1(uint256 _duelId) view returns (uint256);
    function getDuelRewards(uint256 _id) view returns (tuple(address item, address recipient, uint256 qty)[]);
    function getDuelTurns(uint256 _id) view returns (tuple(uint16 turn, uint256 player1HeroId, uint256 player2HeroId, uint8 stat, uint8 background, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 equipmentBonus, uint16 total, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) hero1Score, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 equipmentBonus, uint16 total, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) hero2Score, uint256 winnerHeroId, address winnerPlayer, tuple(uint256 petId, uint8 petRarity) hero1Snapshot, tuple(uint256 petId, uint8 petRarity) hero2Snapshot)[]);
    function getDuels(uint256 _start, uint256 _end) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getHeroAddress(uint256[] _heroIds) view returns (address[]);
    function getHeroCoreAddress() view returns (address);
    function getHeroDuel(uint256 _heroId) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange));
    function getHeroDuelCountForDay(uint256[] _heroIds, uint256 _duelType) view returns (uint256[]);
    function getHeroDuelEntry(uint256 _heroId) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata));
    function getHeroLastTimePlayed(uint256 _heroId) view returns (uint256);
    function getHeroRechargeInfo(uint256 _heroId, uint256 _lobby) view returns (uint256 _rechargeCount, uint256 _rechargeCost, uint256 _day, uint64 _secondsUntilNextDay);
    function getHeroesDuelDailyData(uint256[] _heroIds, uint256 _duelType) view returns (tuple(uint256 numDuels, uint256 rechargeCount, uint256 rechargeCost, uint256 formerKingRechallengeTime, address lastPlayer)[] heroData, uint256 _today, uint64 _secondsUntilNextDay);
    function getHighestScore(uint256 _type) view returns (uint64);
    function getKingInfo(uint256 _lobby) view returns (uint256 _kingId, uint256 _currentBounty, uint256 _challengeCost, uint32 _streakRequired, uint64 _scoreRequired);
    function getLeaderboard(uint256 _type, uint256 _start, uint256 _end) view returns (address[] _addresses, uint256[] _scores, uint256[] _totalDuels, uint256[] _totalWins);
    function getLeaderboardRank(uint64 _score, uint256 _type) view returns (uint256);
    function getNumRanks(uint256 _type) pure returns (uint256);
    function getPlayerDuelEntries(address _profile) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata)[]);
    function getPlayerInfo(address _profile) view returns (uint64[] _scores, uint256[] _ranks, uint64[] _totalWins, uint32[] _winStreaks, uint64[] _totalDuels, uint256[] _lbRanks, uint256 _ptBalance);
    function getPlayerRank(address _profile, uint256 _type) view returns (uint256);
    function getPlayerScore(address _profile, uint256 _type) view returns (uint64);
    function getPracticeEntry(uint256 _type, uint8 _rank) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata));
    function getRankLevels(uint256 _type) pure returns (uint16[]);
    function getSeasonInfo() view returns (uint256 startTime, uint256 endTime, uint16 season);
    function getTotalDuelEntries() view returns (uint256);
    function getTotalDuelEntriesByType(uint256 _type) view returns (uint256);
    function getTotalDuels() view returns (uint256);
    function getTotalDuelsByType(uint256 _type) view returns (uint256);
    function getTotalOpenDuelEntries(uint256 _lobby) view returns (uint256);
    function getTotalPlayerDuels(address _profile, uint256 _type) view returns (uint64);
    function getTotalPlayerWins(address _profile, uint256 _type) view returns (uint64);
    function getWinStreaks(address _player, uint256 _type) view returns (uint256);

}
```

#### Season 4

```solidity
interface IDFKDuelS4 {

    // Events
    event DuelCompleted(uint256 indexed duelId, address indexed player1, address indexed player2, tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange) duel);
    event DuelCreated(uint256 indexed duelId, address indexed player1, address indexed player2, tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange) duel);
    event DuelEntryCreated(uint256 id, address indexed player, uint256[] heroIds, tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata) duelEntry);
    event DuelEntryMatched(uint256 indexed duelId, uint256 indexed duelEntryId, address indexed player1, address player2);
    event DuelMatchReshuffle(uint256 indexed duelEntryId, uint256 indexed duelType);
    event EntriesRecharged(uint256 indexed heroId, uint256 indexed lobby, uint256 day, uint256 rechargeCount, uint256 amount);
    event FeeDeferred(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event HeroLockedToWallet(uint256 heroId, address indexed lastHeroDuelOwner, uint256 indexed lastHeroDuelTime);
    event PassiveEntryRemoved(uint256 indexed duelEntryId, uint256 indexed duelType);
    event PlayerScoreChanged(uint256 indexed duelId, address indexed player, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) playerScoreChange);
    event TurnOutcome(uint256 indexed duelId, uint256 indexed player1HeroId, uint256 indexed player2HeroId, tuple(uint16 turn, uint256 player1HeroId, uint256 player2HeroId, uint8 stat, uint8 background, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 equipmentBonus, uint16 total, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) hero1Score, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 equipmentBonus, uint16 total, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) hero2Score, uint256 winnerHeroId, address winnerPlayer, tuple(uint256 petId, uint8 petRarity) hero1Snapshot, tuple(uint256 petId, uint8 petRarity) hero2Snapshot) turnResult);
    event UpdatedCrossChainData(uint256 indexed _heroId, address indexed _address, uint256 indexed time);

    // Ranked Duels
    function completeDuel(uint256 _duelId);
    function completeDuels(uint256 _numToComplete);
    function completeDuelAdmin(uint256 _duelId);
    function enterDuelLobby(uint256 _type, uint256[] _heroIds, uint256 _tokenFee, uint8 _background, uint8 _stat, uint8 _entries);
    function enterDuelLobbyWithLocked(uint256 _type, uint256[] _heroIds, uint256 _tokenFee, uint8 _background, uint8 _stat, uint8 _entries);
    function matchMake();
    function rechargeEntries(uint8 _lobby, uint256 _heroId);

    // Private & Practice Duels
    function acceptChallenge(uint256 _duelId, uint256[] _heroIds, uint8 _background, uint8 _stat);
    function cancelPrivateDuel(uint256 _duelId);
    function startPracticeDuel(uint256 _type, uint256[] _heroIds, uint8 _rank, uint8 _background, uint8 _stat);
    function startPrivateDuel(uint256 _type, uint256[] _heroIds, address _opponent, uint8 _background, uint8 _stat);
    
    // View Functions
    function getActiveDuels(address _address) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getChallenges(address _profile) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getCurrentClassBonuses() view returns (uint8[6][2]);
    function getCurrentHeroScoreDuelId(uint256 _heroId) view returns (uint256);
    function getDuel(uint256 _id) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange));
    function getDuelEntries(uint256 _start, uint256 _end) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata)[]);
    function getDuelEntry(uint256 _id) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata));
    function getDuelHistory(address _profile) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[100]);
    function getDuelIndexP1(uint256 _duelId) view returns (uint256);
    function getDuelRewards(uint256 _id) view returns (tuple(address item, address recipient, uint256 qty)[]);
    function getDuelTurns(uint256 _id) view returns (tuple(uint16 turn, uint256 player1HeroId, uint256 player2HeroId, uint8 stat, uint8 background, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 equipmentBonus, uint16 total, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) hero1Score, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 equipmentBonus, uint16 total, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) hero2Score, uint256 winnerHeroId, address winnerPlayer, tuple(uint256 petId, uint8 petRarity) hero1Snapshot, tuple(uint256 petId, uint8 petRarity) hero2Snapshot)[]);
    function getDuels(uint256 _start, uint256 _end) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getHeroAddress(uint256[] _heroIds) view returns (address[]);
    function getHeroDuel(uint256 _heroId) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange));
    function getHeroDuelCountForDay(uint256[] _heroIds, uint256 _duelType) view returns (uint256[]);
    function getHeroDuelEntry(uint256 _heroId) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata));
    function getHeroLastTimePlayed(uint256 _heroId) view returns (uint256);
    function getHeroRechargeInfo(uint256 _heroId, uint256 _lobby) view returns (uint256 _rechargeCount, uint256 _rechargeCost, uint256 _day, uint64 _secondsUntilNextDay);
    function getHighestScore(uint256 _type) view returns (uint64);
    function getLeaderboard(uint256 _type, uint256 _start, uint256 _end) view returns (address[] _addresses, uint256[] _scores, uint256[] _totalDuels, uint256[] _totalWins);
    function getLeaderboardRank(uint64 _score, uint256 _type) view returns (uint256);
    function getNumRanks(uint256 _type) pure returns (uint256);
    function getPlayerDuelEntries(address _profile) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata)[]);
    function getPlayerInfo(address _profile) view returns (uint64[] _scores, uint256[] _ranks, uint64[] _totalWins, uint32[] _winStreaks, uint64[] _totalDuels, uint256[] _lbRanks);
    function getPlayerRank(address _profile, uint256 _type) view returns (uint256);
    function getPlayerScore(address _profile, uint256 _type) view returns (uint64);
    function getPracticeEntry(uint256 _type, uint8 _rank) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata));
    function getRankLevels(uint256 _type) pure returns (uint16[]);
    function getSeasonInfo() view returns (uint256, uint256);
    function getTotalDuelEntries() view returns (uint256);
    function getTotalDuelEntriesByType(uint256 _type) view returns (uint256);
    function getTotalDuels() view returns (uint256);
    function getTotalDuelsByType(uint256 _type) view returns (uint256);
    function getTotalOpenDuelEntries(uint256 _lobby) view returns (uint256);
    function getTotalPlayerDuels(address _profile, uint256 _type) view returns (uint64);
    function getTotalPlayerWins(address _profile, uint256 _type) view returns (uint64);
    function getWinStreaks(address _player, uint256 _type) view returns (uint256);
    function getDuelEntryMatch(uint256 _id, uint256 _randomDistance) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched, tuple(uint256 boostedBackground, uint256 boostedStat) metadata));
    
}
```

#### Season 3

```solidity
interface IDFKDuelS3 {

    event DuelCompleted(uint256 indexed duelId, address indexed player1, address indexed player2, tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange) duel);
    event DuelCreated(uint256 indexed duelId, address indexed player1, address indexed player2, tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange) duel);
    event DuelEntryCreated(uint256 id, address indexed player, uint256[] heroIds);
    event DuelEntryMatched(uint256 indexed duelId, uint256 indexed duelEntryId, address indexed player1, address player2);
    event DuelMatchReshuffle(uint256 indexed duelEntryId, uint256 indexed duelType);
    event FeeDeferred(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event HeroLockedToWallet(uint256 heroId, address indexed lastHeroDuelOwner, uint256 indexed lastHeroDuelTime);
    event PassiveEntryRemoved(uint256 indexed duelEntryId, uint256 indexed duelType);
    event PlayerScoreChanged(uint256 indexed duelId, address indexed player, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) playerScoreChange);
    event TurnOutcome(uint256 indexed duelId, uint256 indexed player1HeroId, uint256 indexed player2HeroId, tuple(uint16 turn, uint256 player1HeroId, uint256 player2HeroId, uint8 stat, uint8 background, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 total) hero1Score, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 total) hero2Score, uint256 winnerHeroId, address winnerPlayer) turnResult);
    event UpdatedCrossChainData(uint256 indexed _heroId, address indexed _address, uint256 indexed time);
    
    function acceptChallenge(uint256 _duelId, uint256[] _heroIds, uint8 _background, uint8 _stat);
    function cancelPrivateDuel(uint256 _duelId);
    function completeDuel(uint256 _duelId);
    function completeDuels(uint256 _numToComplete);
    function enterDuelLobby(uint256 _type, uint256[] _heroIds, uint256 _tokenFee, uint8 _background, uint8 _stat, uint8 _entries);
    function enterDuelLobbyWithLocked(uint256 _type, uint256[] _heroIds, uint256 _tokenFee, uint8 _background, uint8 _stat, uint8 _entries);
    function getActiveDuels(address _address) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getChallenges(address _profile) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getCurrentClassBonuses() view returns (uint8[6][2]);
    function getCurrentHeroScoreDuelId(uint256 _heroId) view returns (uint256);
    function getDuel(uint256 _id) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange));
    function getDuelEntries(uint256 _start, uint256 _end) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched)[]);
    function getDuelEntry(uint256 _id) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched));
    function getDuelHistory(address _profile) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[100]);
    function getDuelIndexP1(uint256 _duelId) view returns (uint256);
    function getDuelRewards(uint256 _id) view returns (tuple(address item, address recipient, uint256 qty)[]);
    function getDuelTurns(uint256 _id) view returns (tuple(uint16 turn, uint256 player1HeroId, uint256 player2HeroId, uint8 stat, uint8 background, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 total) hero1Score, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 total) hero2Score, uint256 winnerHeroId, address winnerPlayer)[]);
    function getDuels(uint256 _start, uint256 _end) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getHeroAddress(uint256[] _heroIds) view returns (address[]);
    function getHeroDuel(uint256 _heroId) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange));
    function getHeroDuelCountForDay(uint256[] _heroIds, uint256 _duelType) view returns (uint256[]);
    function getHeroDuelEntry(uint256 _heroId) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched));
    function getHeroLastTimePlayed(uint256 _heroId) view returns (uint256);
    function getHighestScore(uint256 _type) view returns (uint64);
    function getLeaderboard(uint256 _type, uint256 _start, uint256 _end) view returns (address[] _addresses, uint256[] _scores, uint256[] _totalDuels, uint256[] _totalWins);
    function getLeaderboardRank(uint64 _score, uint256 _type) view returns (uint256);
    function getNumRanks(uint256 _type) pure returns (uint256);
    function getPlayerDuelEntries(address _profile) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched)[]);
    function getPlayerInfo(address _profile) view returns (uint64[] _scores, uint256[] _ranks, uint64[] _totalWins, uint32[] _winStreaks, uint64[] _totalDuels, uint256[] _lbRanks);
    function getPlayerRank(address _profile, uint256 _type) view returns (uint256);
    function getPlayerScore(address _profile, uint256 _type) view returns (uint64);
    function getPracticeEntry(uint256 _type, uint8 _rank) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak, bool useLockedTokens, uint8 numEntries, uint8 matched));
    function getRankLevels(uint256 _type) pure returns (uint16[]);
    function getSeasonInfo() view returns (uint256, uint256);
    function getTotalDuelEntries() view returns (uint256);
    function getTotalDuels() view returns (uint256);
    function getTotalOpenDuelEntries(uint256 _lobby) view returns (uint256);
    function getTotalPlayerDuels(address _profile, uint256 _type) view returns (uint64);
    function getTotalPlayerWins(address _profile, uint256 _type) view returns (uint64);
    function getWinStreaks(address _player, uint256 _type) view returns (uint256);
    function matchMake(uint256 _lobby);
    function startPracticeDuel(uint256 _type, uint256[] _heroIds, uint8 _rank, uint8 _background, uint8 _stat);
    function startPrivateDuel(uint256 _type, uint256[] _heroIds, address _opponent, uint8 _background, uint8 _stat);

}
```

#### Season 2

```solidity
interface IDFKDuelS2 {

    event DuelCompleted(uint256 indexed duelId, address indexed player1, address indexed player2, tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange) duel);
    event DuelCreated(uint256 indexed duelId, address indexed player1, address indexed player2, tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange) duel);
    event DuelEntryCreated(uint256 id, address indexed player, uint256[] heroIds);
    event DuelEntryMatched(uint256 indexed duelId, uint256 indexed duelEntryId, address indexed player1, address player2);
    event DuelMatchReshuffle(uint256 indexed duelEntryId, uint256 indexed duelType);
    event HeroLockedToWallet(uint256 heroId, address indexed lastHeroDuelOwner, uint256 indexed lastHeroDuelTime);
    event PassiveEntryRemoved(uint256 indexed duelEntryId, uint256 indexed duelType);
    event PlayerScoreChanged(uint256 indexed duelId, address indexed player, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) playerScoreChange);
    event TurnOutcome(uint256 indexed duelId, uint256 indexed player1HeroId, uint256 indexed player2HeroId, tuple(uint16 turn, uint256 player1HeroId, uint256 player2HeroId, uint8 stat, uint8 background, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 total) hero1Score, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 total) hero2Score, uint256 winnerHeroId, address winnerPlayer) turnResult);
    event UpdatedCrossChainData(uint256 indexed _heroId, address indexed _address, uint256 indexed time);

    function acceptChallenge(uint256 _duelId, uint256[] _heroIds, uint8 _background, uint8 _stat);
    function completeDuel(uint256 _duelId);
    function enterDuelLobby(uint256 _type, uint256[] _heroIds, uint256 _tokenFee, uint8 _background, uint8 _stat);
    function getActiveDuels(address _address) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getChallenges(address _profile) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getCurrentClassBonuses() view returns (uint8[6][2]);
    function getCurrentHeroScoreDuelId(uint256 _heroId) view returns (uint256);
    function getDuel(uint256 _id) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange));
    function getDuelEntries(uint256 _start, uint256 _end) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak)[]);
    function getDuelEntry(uint256 _id) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak));
    function getDuelHistory(address _profile) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[100]);
    function getDuelIndexP1(uint256 _duelId) view returns (uint256);
    function getDuelRewards(uint256 _id) view returns (tuple(address item, address recipient, uint256 qty)[]);
    function getDuelTurns(uint256 _id) view returns (tuple(uint16 turn, uint256 player1HeroId, uint256 player2HeroId, uint8 stat, uint8 background, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 total) hero1Score, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 classBonus, uint16 subclassBonus, uint16 total) hero2Score, uint256 winnerHeroId, address winnerPlayer)[]);
    function getDuels(uint256 _start, uint256 _end) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getHeroAddress(uint256[] _heroIds) view returns (address[]);
    function getHeroDuel(uint256 _heroId) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange));
    function getHeroDuelCountForDay(uint256[] _heroIds, uint256 _duelType) view returns (uint256[]);
    function getHeroDuelEntry(uint256 _heroId) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak));
    function getHeroLastTimePlayed(uint256 _heroId) view returns (uint256);
    function getHighestScore(uint256 _type) view returns (uint64);
    function getNumRanks(uint256 _type) pure returns (uint256);
    function getPlayerDuelEntries(address _profile) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak)[]);
    function getPlayerRank(address _profile, uint256 _type) view returns (uint256);
    function getPlayerScore(address _profile, uint256 _type) view returns (uint64);
    function getPracticeEntry(uint256 _type, uint8 _rank) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak));
    function getRankLevels(uint256 _type) view returns (uint16[]);
    function getSeasonInfo() view returns (uint256, uint256);
    function getTotalDuelEntries() view returns (uint256);
    function getTotalDuels() view returns (uint256);
    function getTotalOpenDuelEntries(uint256 _lobby) view returns (uint256);
    function getTotalPlayerDuels(address _profile, uint256 _type) view returns (uint64);
    function getTotalPlayerWins(address _profile, uint256 _type) view returns (uint64);
    function getWinStreaks(address _player, uint256 _type) view returns (uint256);
    function matchMake(uint256 _lobby);
    function startPracticeDuel(uint256 _type, uint256[] _heroIds, uint8 _rank, uint8 _background, uint8 _stat);
    function startPrivateDuel(uint256 _type, uint256[] _heroIds, address _opponent, uint8 _background, uint8 _stat);

}
```

#### Season 1

```solidity
interface IDFKDuelS1 {

    event DuelCompleted(uint256 indexed duelId, address indexed player1, address indexed player2, tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange) duel);
    event DuelCreated(uint256 indexed duelId, address indexed player1, address indexed player2, tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange) duel);
    event DuelEntryCreated(uint256 id, address indexed player, uint256[] heroIds);
    event DuelEntryMatched(uint256 indexed duelId, uint256 indexed duelEntryId, address indexed player1, address player2);
    event PlayerScoreChanged(uint256 indexed duelId, address indexed player, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter));
    event TurnOutcome(uint256 indexed duelId, uint256 indexed player1HeroId, uint256 indexed player2HeroId, tuple(uint16 turn, uint256 player1HeroId, uint256 player2HeroId, uint8 stat, uint8 background, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 total) hero1Score, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 total) hero2Score, uint256 winnerHeroId, address winnerPlayer) turnResult);
    
    function acceptChallenge(uint256 _duelId, uint256[] _heroIds, uint8 _background, uint8 _stat);
    function completeDuel(uint256 _duelId);
    function enterDuelLobby(uint256 _type, uint256[] _heroIds, uint256 _tokenFee, uint8 _background, uint8 _stat);
    function getActiveDuels(address _address) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getChallenges(address _profile) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[]);
    function getCurrentHeroScoreDuelId(uint256 _heroId) view returns (uint256);
    function getDuel(uint256 _id) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange));
    function getDuelEntry(uint256 _id) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak));
    function getDuelHistory(address _profile) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange)[100]);
    function getDuelIndexP1(uint256 _duelId) view returns (uint256);
    function getDuelRewards(uint256 _id) view returns (tuple(address item, address recipient, uint256 qty)[]);
    function getDuelTurns(uint256 _id) view returns (tuple(uint16 turn, uint256 player1HeroId, uint256 player2HeroId, uint8 stat, uint8 background, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 total) hero1Score, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 total) hero2Score, uint256 winnerHeroId, address winnerPlayer)[]);
    function getHeroDuel(uint256 _heroId) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status, tuple(uint256 duelId, uint16 base, uint32 streakBonus, uint16 miscBonus, uint32 diffBonus, uint64 scoreBefore, uint64 scoreAfter) player1ScoreChange));
    function getHeroDuelEntry(uint256 _heroId) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak));
    function getHighestScore(uint256 _type) view returns (uint64);
    function getPlayerDuelEntries(address _profile) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak)[]);
    function getPlayerScore(address _profile, uint256 _type) view returns (uint64);
    function getPracticeEntry(uint256 _type, uint8 _rank) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 heroPower, uint256 score, uint256 scoreAfter, uint256 tokenFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status, uint64 winStreak, uint64 loseStreak));
    function getTotalDuelEntries() view returns (uint256);
    function getTotalDuels() view returns (uint256);
    function getTotalOpenDuelEntries(uint256 _lobby) view returns (uint256);
    function getTotalPlayerDuels(address _profile, uint256 _type) view returns (uint64);
    function getTotalPlayerWins(address _profile, uint256 _type) view returns (uint64);
    function getWinStreaks(address _player, uint256 _type) view returns (uint256);
    function matchMake(uint256 _lobby);
    function startPracticeDuel(uint256 _type, uint256[] _heroIds, uint8 _rank, uint8 _background, uint8 _stat);
    function startPrivateDuel(uint256 _type, uint256[] _heroIds, address _opponent, uint8 _background, uint8 _stat);

}
```

#### Pre-Season

```solidity
interface IDFKDuel {

  event DuelCompleted(uint256 indexed duelId, address indexed player1, address indexed player2, tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status) duel);
  event DuelCreated(uint256 indexed duelId, address indexed player1, address indexed player2, tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status) duel);
  event DuelEntryCreated(uint256 id, address indexed player, uint256[] heroIds);
  event DuelEntryMatched(uint256 indexed duelId, uint256 indexed duelEntryId, address indexed player1, address player2);
  event TurnOutcome(uint256 indexed duelId, uint256 indexed player1HeroId, uint256 indexed player2HeroId, tuple(uint16 turn, uint256 player1HeroId, uint256 player2HeroId, uint8 stat, uint8 background, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 total) hero1Score, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 total) hero2Score, uint256 winnerHeroId, address winnerPlayer) turnResult);

  function completeDuel(uint256 _duelId);
  function enterDuelLobby(uint256 _type, uint256[] _heroIds, uint256 _jewelFee, uint8 _background, uint8 _stat);  
  function getActiveDuels(address _address) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status)[]);
  function getChallenges(address _profile) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status)[]);
  function getDuel(uint256 _id) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status));
  function getDuelEntry(uint256 _id) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 score, uint256 scoreAfter, uint256 jewelFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status));
  function getDuelHistory(address _profile) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status)[100]);
  function getDuelIndexP1(uint256 _duelId) view returns (uint256);
  function getDuelRewards(uint256 _id) view returns (tuple(address item, address recipient, uint256 qty)[]);
  function getDuelTurns(uint256 _id) view returns (tuple(uint16 turn, uint256 player1HeroId, uint256 player2HeroId, uint8 stat, uint8 background, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 total) hero1Score, tuple(uint8 roll, uint16 elementBonus, uint16 statValue, uint16 backgroundBonus, uint16 total) hero2Score, uint256 winnerHeroId, address winnerPlayer)[]);
  function getHeroDuel(uint256 _heroId) view returns (tuple(uint256 id, address player1, address player2, uint256 player1DuelEntry, uint256 player2DuelEntry, address winner, uint256[] player1Heroes, uint256[] player2Heroes, uint256 startBlock, uint8 duelType, uint8 status));
  function getHighestScore() view returns (uint64);
  function getPlayerDuelEntries(address _profile) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 score, uint256 scoreAfter, uint256 jewelFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status)[]);
  function getPlayerScore(address _profile) view returns (uint64);
  function getPracticeEntry(uint256 _type, uint8 _rank) view returns (tuple(uint256 id, address player, uint256[] heroes, uint256 startBlock, uint256 score, uint256 scoreAfter, uint256 jewelFee, uint256 duelId, uint256 custom1, uint256 custom2, uint8 duelType, uint8 status));
  function getTotalDuelEntries() view returns (uint256);
  function getTotalDuels() view returns (uint256);
  function getTotalOpenDuelEntries(uint256 _lobby) view returns (uint256);
  function getTotalPlayerDuels(address _profile) view returns (uint64);
  function getTotalPlayerWins(address _profile) view returns (uint64);
  function _heroMMScore(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) _hero) view returns (uint64);
  function _partyMMScore(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions)[] _heroes) view returns (uint64);
  function matchMake(uint256 _lobby);
  function acceptChallenge(uint256 _duelId, uint256[] _heroIds, uint8 _background, uint8 _stat);
  function startPracticeDuel(uint256 _type, uint256[] _heroIds, uint8 _rank, uint8 _background, uint8 _stat);
  function startPrivateDuel(uint256 _type, uint256[] _heroIds, address _opponent, uint8 _background, uint8 _stat);

}
```

### ABIs

{% file src="/files/TcHSt4xFw8g2kw67dd2t" %}

{% file src="/files/vrM0goNr91HKbdHbc19i" %}

{% file src="/files/7UgD5Kn4u34BlyApRt2A" %}

{% file src="/files/C74Xx3AWTXY0GzWr68xb" %}

{% file src="/files/UubVwbnBIxZzs7AqajKy" %}

{% file src="/files/1VAIZHDUvt9espsGUbFz" %}


# Raffle Master

## Contracts

### Addresses

#### DFK Chain

| Name          | Mainnet                                      | Testnet                                      |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| Raffle Master | `0xd8D7CE8921490b75EC489bd076AD0f27DC765675` | `0xffBaE4e33107D14452e83CF1F7B92B04627CbE01` |
| Gold Pot      | `0x2DC1b89d20878aD9dc06e7e165f340d6CCa78475` | `0xb6D1C4e5b131FA52Cfa48e5477aAe386B63B6fD6` |

#### Klaytn

| Name          | Mainnet                                      | Testnet                                      |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| Raffle Master | `0x9aE38Ba1A4bB847E6D77e29Db235B0037A0cfB30` | `0xdFe913aa8b8b3c678C83b958F5e4997EAF3Fdc8f` |
| Gold Pot      | `0xEF8ce3a8308401Cd04B658830C53621561EeF138` | `0x5b5570C416a87e49c09dB0990751bF825C4A5045` |

### Interfaces

```solidity
interface IRaffleMaster {

    event RaffleClosed(uint256 indexed raffleId);
    event RaffleDrawn(uint256 indexed raffleId, address indexed winner);
    event RaffleEntered(address indexed user, uint256 indexed raffleId, uint256 tickets);
    event RaffleStarted(uint256 indexed raffleId, tuple(uint256 id, address[] rewards, uint256[] rewardAmounts, uint256 maxWinners, uint64 duration) raffleType);
    event RaffleTypeActivated(uint256 indexed raffleTypeId, uint256 bucket);
    event RaffleTypeAdded(uint256 indexed id, tuple(uint256 id, address[] rewards, uint256[] rewardAmounts, uint256 maxWinners, uint64 duration) raffleType);
    event RaffleTypeDeactivated(uint256 indexed raffleTypeId, uint256 bucket);
    
    function activeRaffleTypes(uint256, uint256) view returns (uint256);
    function addActiveRaffleType(uint256 _id, uint256 _bucket);
    function addAndActivateRaffleType(address[] _rewards, uint256[] _rewardAmounts, uint256 _maxWinners, uint64 _duration, uint256[] _buckets);
    function addRaffleType(address[] _rewards, uint256[] _rewardAmounts, uint256 _maxWinners, uint64 _duration);
    function closeRaffles();
    function createRaffle(uint256 _raffleTypeId, uint256 _bucket);
    function currentRaffleBuckets(uint256) view returns (uint256);
    function drawWinners();
    function enterRaffle(uint256 _raffleId, uint256 _tickets);
    function entries(uint256, uint256) view returns (address);
    function getCurrentRaffleBuckets() view returns (uint256[]);
    function getCurrentRaffleData() view returns (tuple(uint256 id, uint256 raffleType, uint256 startTime, uint256 totalEntries, uint256 endTime, uint256 closedBlock, address[] winners, uint8 status)[], tuple(uint256 id, address[] rewards, uint256[] rewardAmounts, uint256 maxWinners, uint64 duration)[], uint256[], uint256[]);
    function getLastRaffleBuckets() view returns (uint256[]);
    function getPreviousRaffleData() view returns (tuple(uint256 id, uint256 raffleType, uint256 startTime, uint256 totalEntries, uint256 endTime, uint256 closedBlock, address[] winners, uint8 status)[], tuple(uint256 id, address[] rewards, uint256[] rewardAmounts, uint256 maxWinners, uint64 duration)[], uint256[], uint256[]);
    function getRaffleList(uint256[] _raffleBuckets) view returns (tuple(uint256 id, uint256 raffleType, uint256 startTime, uint256 totalEntries, uint256 endTime, uint256 closedBlock, address[] winners, uint8 status)[]);
    function getRaffleTicketsAllowanceList(uint256[] _raffleBuckets) view returns (uint256[]);
    function getRaffleTicketsList(uint256[] _raffleBuckets) view returns (uint256[]);
    function getRaffleTypesList(uint256[] _raffleBuckets) view returns (tuple(uint256 id, address[] rewards, uint256[] rewardAmounts, uint256 maxWinners, uint64 duration)[]);
    function getTicketAllowance(address _user, uint256 _raffleId) view returns (uint256);
    function lastRaffleBuckets(uint256) view returns (uint256);
    function playerEntries(uint256, address) view returns (uint256);
    function raffleTypes(uint256) view returns (uint256 id, uint256 maxWinners, uint64 duration);
    function raffles(uint256) view returns (uint256 id, uint256 raffleType, uint256 startTime, uint256 totalEntries, uint256 endTime, uint256 closedBlock, uint8 status);
    function removeActiveRaffleType(uint256 _index, uint256 _bucket);
    function setRaffleType(uint256 _raffleTypeId, address[] _rewards, uint256[] _rewardAmounts, uint256 _maxWinners, uint64 _duration);
    function startRandomRaffle(uint256 _bucket);
    function startRandomRaffles(uint256[] _buckets);
    function timePerTicket() view returns (uint256);
    function totalRaffleTypes() view returns (uint256);
    function totalRaffles() view returns (uint256);
  
}
```

```solidity
interface IGoldPot {

    event Claim(address _from, uint256 _period, uint256 _amount);
    event Deposit(address _from, uint256 _period, uint256 _amount);
    event Enter(address _from, uint256 _period, uint256 _amount);
    event NewPeriod(uint256 _period);
    
    function claim(uint256 _period);
    function currentPeriod() view returns (uint256);
    function deposit(uint256 _amount);
    function enter(uint256 _tickets);
    function getCurrentData() view returns (uint256, uint256, uint256, uint256, uint256, uint256);
    function getCurrentPeriod() returns (uint256);
    function getPeriodStartTime(uint256 _period) view returns (uint256);
    function getTicketAllowance(address _user, uint256 _period) view returns (uint256);
    function getUnclaimedPeriods(address _user) view returns (uint256[]);
    function periodDuration() view returns (uint256);
    function periodTotalGold(uint256) view returns (uint256);
    function periodTotalTickets(uint256) view returns (uint256);
    function timePerTicket() view returns (uint256);
  
}
```

### ABIs

{% file src="/files/Imz0jESPS9cxG6BS8VCE" %}

{% file src="/files/T1kHJKsfzKmATIlMthDg" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### Harmony

| Name          | Mainnet                                      | Testnet                                      |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| Raffle Master | `0x6a56222A67df18FC282CD58dCDF12e61Be812f97` | `0xbA3eeE168F92c6A092544C0b8702D6B80085E562` |
| Gold Pot      | `0xd3f98a53fd4388b9297f6bd0d63b75a023adf7e5` | `0x9d8Af1831B2D5984De82C803562441Ef9f6e76c1` |

## Related Contracts

{% content-ref url="/pages/m2dpAEE5I7HUpLg8cYUQ" %}
[DFK Duel](/contracts/dfk-duel)
{% endcontent-ref %}

{% content-ref url="/pages/AivVnFE2kGEYbeLFQZ28" %}
[Locked Token Raffle](/contracts/miscellaneous/locked-token-raffle)
{% endcontent-ref %}

{% content-ref url="/pages/QJfkuQQDjlHvajMZCd8R" %}
[Raffle Tickets](/tokens/miscellaneous-tokens/raffle-tickets)
{% endcontent-ref %}


# Events


# Gen0 Reroll

## Stat Mappings

The Gen0 Reroll contract uses the following mappings for stats:

{% hint style="warning" %}
Note that the order of these mappings is different from those found on the [HeroCore](/nfts/heroes) contract, which uses `[Str, Int, Wis, Lck, Agi, Vit, End, Dex]` as the canonical order for Hero Stats and Stat Growth values. We hope to align these values in the future.
{% endhint %}

```json
{
    0: "Strength",
    1: "Agility",
    2: "Intelligence",
    3: "Wisdom",
    4: "Luck",
    5: "Vitality",
    6: "Endurance",
    7: "Dexterity"
}
```

## Contracts

### Addresses

#### DFK Chain

| Name        | Mainnet                                      | Testnet                                      |
| ----------- | -------------------------------------------- | -------------------------------------------- |
| Gen0 Reroll | `0x51577EC9644853c5d1B99d5045C133BBfa9a6a60` | `0xbf9AD3451955EAf8D0E1Bf0b34DdF8A9efd4027F` |

### Interfaces

{% hint style="info" %}
The `HeroRerollStarted` event was added for DFK Chain, and is not present in the Harmony Contract.
{% endhint %}

```solidity
interface IGen0Reroll {

    event HeroReroll(uint256 indexed heroId, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) heroBefore, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) heroAfter, uint8 indexed choice);
    event HeroRerollStarted(uint256 indexed heroId, uint8 indexed choice);
    event RewardMinted(address indexed player, uint256 indexed heroId, address indexed rewardAddress, uint256 amount);
    event StatUp(address indexed player, uint256 indexed heroId, uint256 indexed stat, uint8 increase, uint8 updateType);
    event SummonsReset(uint256 indexed heroId, uint32 oldSummonCount, uint32 newSummonCount);
    event XpUp(address indexed player, uint256 indexed heroId, uint256 increase);
    
    function campaign() view returns (uint256);
    function cancelReroll(uint256 _heroId);
    function crystals(uint256) view returns (address);
    function endRoll(uint256 _heroId);
    function endTime() view returns (uint256);
    function heroToRerollData(uint256) view returns (uint256 campaign, uint256 seedblock, uint8 choice, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) beforeHero, uint8 status, uint256 finishTime);
    function initialize(uint256 _startTime, uint256 _endTime, address _heroCoreAddress, address _statScienceAddress, address _flagStorageAddress, address _assistingAuction, address _rerollModifier);
    function startRoll(uint256 _heroId, uint8 _choice);
    function startTime() view returns (uint256);
    function stones(uint256) view returns (address);

}
```

### ABIs

{% file src="/files/HUSTEnNCcbCIqbjPzSyR" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### Harmony

| Name        | Mainnet                                      | Testnet                                      |
| ----------- | -------------------------------------------- | -------------------------------------------- |
| Gen0 Reroll | `0x74934378840D77E36AeF1f031D301549b4e1a225` | `0x25F67e57349AF9CcC188D8F5e1f64363c8A0973f` |


# Gene Reroll

## Stat Mappings

The Gene Reroll contract uses the following mappings for stats:

{% hint style="warning" %}
Note that the order of these mappings is different from those found on the [HeroCore](/nfts/heroes) contract, which uses `[Str, Int, Wis, Lck, Agi, Vit, End, Dex]` as the canonical order for Hero Stats and Stat Growth values. We hope to align these values in the future.
{% endhint %}

```json
{
    0: "Strength",
    1: "Agility",
    2: "Intelligence",
    3: "Wisdom",
    4: "Luck",
    5: "Vitality",
    6: "Endurance",
    7: "Dexterity"
}
```

{% hint style="info" %}
Stat Mappings for Crafting Genes can be found [here](/nfts/heroes#crafting).
{% endhint %}

## Contracts

### Addresses

#### DFK Chain

<table><thead><tr><th width="195.33333333333331">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>DFK Chain</td><td><code>0x4b98f4C73fadA8E9C3f573502713FCebfA5a98AC</code></td><td><code>0xC40d1fBE39EF7dc65B96ADb697a67726Df2E10c4</code></td></tr><tr><td>Klaytn</td><td><code>0xD0E292bAfBB1F691fEAFa7ddE1050EAEa923b2e3</code></td><td><code>0x0c39F60C073c128B1eC90EAc8869B3d6cb8dEAc8</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IGeneReroll {

    event CraftingGenesRerolled(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) beforeHero, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) afterHero, bool craftingGenesRerolled);
    event HeroRerollStarted(uint256 indexed heroId);
    event HeroRerolled(uint256 indexed heroId, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) heroBefore, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) heroAfter);
    event StatUp(address indexed player, uint256 indexed heroId, uint256 indexed stat, uint8 increase, uint8 updateType);
    event TaintedGenesRerolled(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) beforeHero, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) afterHero, uint8[] geneIndex, uint8[] rankType);
    
    function cancelReroll(uint256 _heroId);
    function endRoll(uint256 _heroId);
    function heroToRerollData(uint256) view returns (tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) beforeHero, uint256 seedblock, uint256 finishTime, bool rerollStarted);
    function multiEndRoll(uint256[] _heroIds);
    function multiStartRoll(uint256[] _heroIds);
    function startRoll(uint256 _heroId);

}
```

### ABIs

{% file src="/files/3d4ZpvHPYSFrg6aVISmp" %}


# Perilous Journey

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### Harmony

| Name                           | Mainnet                                    | Testnet                                    |
| ------------------------------ | ------------------------------------------ | ------------------------------------------ |
| Perilous Journey (Crystalvale) | 0xE92Db3bb6E4B21a8b9123e7FdAdD887133C64bb7 | 0x795F6AF5Aa45Ec351A8fC74705F0874CA5f67F42 |

### Interfaces

```solidity
interface IJourney {

    event HeroClaimed(address indexed player, uint256 heroId, uint256 submissionId, uint256 indexed groupId, bool isGenZero, bool addedSurvivalChance, bool indexed heroSurvived, uint16 heroLevel, uint256 crystalAmount, uint256 jewelAmount);
    event HeroSubmitted(address indexed player, uint256 heroId, uint256 submissionId, uint256 groupId, bool isGenZero, bool submittedWithGenZero);
    event JourneyReward(uint256 indexed heroId, address indexed player, address rewardItem, uint256 itemQuantity);
    event StatUp(address indexed player, uint256 indexed heroId, uint256 stat, uint8 increase, uint8 updateType);
    
    function applySurvivalStatBonus(uint256 _heroId, uint8 stat1, uint8 stat2, uint8 stat3);
    function assistingAuction() view returns (address);
    function cancelSubmission(uint256 _heroId);
    function claimEnd() view returns (uint64);
    function claimHero(uint256 _heroId);
    function claimHeroes(uint256[] _heroes);
    function claimStart() view returns (uint64);
    function crystals(uint256) view returns (address);
    function flagStorage() view returns (address);
    function getHeroSubmission(uint256 _heroId) view returns (tuple(uint256 id, address owner, uint256 groupId, uint256 heroId, uint256 startBlock, bool addedSurvivalChance));
    function getSubmission(uint256 _id) view returns (tuple(uint256 id, address owner, uint256 groupId, uint256 heroId, uint256 startBlock, bool addedSurvivalChance));
    function getUserSubmissions(address _address) view returns (tuple(uint256 id, address owner, uint256 groupId, uint256 heroId, uint256 startBlock, bool addedSurvivalChance)[]);
    function graveyard() view returns (address);
    function heroCore() view returns (address);
    function heroToSubmission(uint256) view returns (uint256);
    function paused() view returns (bool);
    function profileUserSubmissions(address, uint256) view returns (uint256 id, address owner, uint256 groupId, uint256 heroId, uint256 startBlock, bool addedSurvivalChance);
    function questFund() view returns (address);
    function runes(uint256) view returns (address);
    function statBonusEnd() view returns (uint64);
    function stones(uint256) view returns (address);
    function submissionEnd() view returns (uint64);
    function submissionStart() view returns (uint64);
    function submitHeroes(uint256[] _heroIds);
    function submitHeroesWithGenZero(uint256 genZeroId, uint256[] _heroIds);
    
}
```

### ABIs

{% file src="/files/oLar7yocYX4Ycigop39y" %}

## Related Contracts

{% content-ref url="/pages/UPDPwyYapDkXsoTyK4TQ" %}
[Graveyard](/contracts/miscellaneous/graveyard)
{% endcontent-ref %}


# Bridging


# Hero Bridge (Synapse)

### Chain ID

{% hint style="danger" %}
Hero Bridging is not available directly between Harmony and Kaia and must go through DFK Chain first. Any Heroes sent incorrectly may be permanently lost.

Hero Bridging back to Harmony is no longer available.
{% endhint %}

Use the following destination Chain IDs for the Hero Bridge:

* Harmony: 1666600000
* DFK Chain: 53935
* Kaia: 8217

### Fees

Bridging has a fee associated with each transaction. This fee must be included in the `value` field of the transaction. The fees for bridging Heroes are as follows:

* Harmony to DFK Chain: 0.016 ONE
* DFK Chain to Kaia: 0.105 JEWEL
* Kaia to DFK Chain: 0.0063 KLAY

### Contract Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| Harmony   | `0x573e407Be90a50EAbA28748cbb62Ff9d6038A3e9` | `0xe21a31315ddeA8200d73945AA06ACBb15DB92bFb` |
| DFK Chain | `0x739B1666c2956f601f095298132773074c3E184b` | `0xE7a90d1E7638A977fC8892896D81596E1694f3CF` |
| Kaia      | `0xEE258eF5F4338B37E9BA9dE6a56382AdB32056E2` | `0x519cbdA25d7335DE1B32b6A7E662581baC6524A0` |

### Interfaces

```solidity
interface IHeroBridge {

    event HeroArrived(uint256 indexed heroId, uint256 arrivalChainId);
    event HeroSent(uint256 indexed heroId, uint256 arrivalChainId);
    
    function assistingAuction() view returns (address);
    function heroes() view returns (address);
    function sendHero(uint256 _heroId, uint256 _dstChainId) payable;

}
```

### ABIs

{% file src="/files/W7BbIlYYXvmu9Un6Ym1P" %}


# Hero Bridge (LayerZero)

The LayerZero Hero Bridge processes the cross-chain bridging of Hero NFTs. It is available between **DFK Chain and Metis**, and between **Kaia and Metis** only. Bridging a Hero will also send any Pets or Equipment that are attached to the Hero.

{% hint style="info" %}
The Hero Bridge is built in partnership with [Layer Zero](https://layerzero.network/) using their V2 Messaging protocol. For more information, visit their documentation at: <https://layerzero.gitbook.io/docs/>.

Use [Layer Zero Scan](https://layerzeroscan.com/) (<https://layerzeroscan.com/>) to track the progress of bridged items.
{% endhint %}

### Chain ID

Use the following mainnet destination Chain IDs for the Hero Bridge:

* DFK Chain: `53935`
* Kaia: `8217`
* Metis: `1088`

{% hint style="warning" %}
Bridging Heroes from Metis requires that they are sent back to the same Chain ID that they first arrived from. This realm can be found in the `realmId` field on the `HeroV4` contract, with the following mappings:

DFK Chain: `1` (Testnet: 20)

Kaia: `2` (Testnet: 21)
{% endhint %}

### Fees

Bridging has a fee associated with each transaction. This fee must be included in the `value` field of the transaction. Fees can be estimated by calling `estimateHero` or `estimateHeroes`.

### Contract Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| DFK Chain | `0x49F7541b4308A2332afcA5dc5830a3a5f93F18bC` | `0xe2d5CD6384D54E73722A2caE2b00f1348B1F2B59` |
| Kaia      | `0x12af2AD0b90E08d0d70449E5d0b14afd14F9a24c` | `0x590e1060Eb2DB33D6A46Fb6927C08FD930A023D5` |
| Metis     | `0xDA53A7251f08ac9D59E977D0032a1521832A6Ac9` | `0xb5722C7ED74bD8D829754383C0E65f9F7e9bacD6` |

### Interfaces

```solidity
interface IHeroBridgeLZ {

    event HeroArrived(uint256 indexed heroId, uint256 arrivalChainId);
    event HeroLZBridgeReceived(uint32 srcEid, address sender, address receiver, uint256 heroId);
    event HeroLZBridgeSent(uint32 srcEid, address sender, address receiver, uint256 heroId);
    event HeroSent(uint256 indexed heroId, uint256 arrivalChainId);

    function bridgeHero(uint32 _dstChainId, address _receiver, uint256 _heroId) payable;
    function bridgeHeroes(uint32 _dstChainId, address _receiver, uint256[] _heroIds) payable;
    function estimateHero(uint32 _dstChainId, address _receiver, uint256 _heroId) view returns (tuple(uint256 nativeFee, uint256 lzTokenFee) fee);
    function estimateHeroes(uint32 _dstChainId, address _receiver, uint256[] _heroIds) view returns (tuple(uint256 nativeFee, uint256 lzTokenFee) fee);

}
```

### ABIs

{% file src="/files/KUrW6jL4NSUoaWdPRfp4" %}


# Equipment Bridge (Synapse)

The **Equipment Bridge** (formerly the Pet Bridge) processes the cross-chain bridging of all Pet and Equipment NFTs.

### Chain ID

{% hint style="danger" %}
Bridging Pets is not available directly between Harmony and Kaia and must go through DFK Chain first. Pets cannot be sent to Harmony. Any Pets sent incorrectly may be permanently lost.
{% endhint %}

Use the following destination Chain IDs for the Equipment Bridge:

* DFK Chain: 53935
* Kaia: 8217

### Fees

Bridging has a fee associated with each transaction. This fee must be included in the `value` field of the transaction. The fees for bridging Pets/Equipment are as follows:

* Harmony to DFK Chain: 0.016 ONE
* DFK Chain to Kaia: 0.03 JEWEL
* Kaia to DFK Chain: 0.0018 KLAY

### Equipment Contract Mapping

Use the following mappings for the `_equipmentCore` input on the `sendEquipment` function:

* Weapon: `1`
* Accessory/Offhand: `2`
* Armor: `3`
* Pet: `4`

### Contract Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| Harmony   | `0x4e8e955E40C1Dc09BAfb685ecAdE418214068c42` | N/A                                          |
| DFK Chain | `0x36829ba54e6A0f11fB6e5A45aC5aD2742ec86a0B` | `0xfD5FE9415F82374a05f6f4B47745917723577f5C` |
| Kaia      | `0x5EcB820B32b60cCEd4506bd3b06C80BaFb879446` | `0x8f6F50CfdAB5710102b7B4240B5c97ec0AfcDf4c` |

### Interfaces

```solidity
interface IEquipmentBridge {

    event EquipmentArrived(uint256 indexed equipmentId, uint16 indexed equipmentType, uint256 arrivalChainId);
    event EquipmentSent(uint256 indexed equipmentId, uint16 indexed equipmentType, uint256 arrivalChainId);
    event PetArrived(uint256 indexed petId, uint256 arrivalChainId);
    event PetSent(uint256 indexed petId, uint256 arrivalChainId);

    function equipmentTypes(uint16) view returns (address);
    function heroBridgeAddress() view returns (address);
    function pets() view returns (address);
    function sendEquipment(uint256 _equipmentId, uint16 _equipmentCore, uint256 _dstChainId) payable;
    function sendPet(uint256 _petId, uint256 _dstChainId) payable;

}
```

### ABIs

{% file src="/files/5inbi6vDJoQIhs64YwfR" %}


# Equipment Bridge (LayerZero)

The **LayerZero Equipment Bridge**  processes the cross-chain bridging of Pet and Equipment NFTs. It is available between **DFK Chain and Metis**, and between **Kaia and Metis** only.

{% hint style="info" %}
The Equipment Bridge is built in partnership with [Layer Zero](https://layerzero.network/) using their V2 Messaging protocol. For more information, visit their documentation at: <https://layerzero.gitbook.io/docs/>.

Use [Layer Zero Scan](https://layerzeroscan.com/) (<https://layerzeroscan.com/>) to track the progress of bridged items.
{% endhint %}

### Chain ID

Use the following destination Chain IDs for the Equipment Bridge:

* DFK Chain: `53935`
* Kaia: `8217`
* Metis: `1088`

### Fees

Bridging has a fee associated with each transaction. This fee must be included in the `value` field of the transaction. Fees can be estimated by calling `estimateEquipment`.

### Equipment Contract Mapping

Use the following mappings for the `_equipmentType` input on the `sendEquipment` function:

* Weapon: `1`
* Accessory/Offhand: `2`
* Armor: `3`
* Pet: `4`

### Contract Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| DFK Chain | `0x3f6cc9B0E342386618cDc5785Fd4DF82CfB32CCF` | `0x9B1CaACC71672D4843B06cde9AA47B50d7691E0c` |
| Kaia      | `0xfb065ef4257719A99Ce7f1d03A6C22bd28983b77` | `0x5982f5FA37a2d9Da8DB8a76Cb89FA655A17bEcf0` |
| Metis     | `0xBeA7c8BDBc5ab4D5752C597A8DA896C0BD94F6bf` | `0x30e643B8ce2d3B055086bA1AD05dA62d81b79BD5` |

### Interfaces

```solidity
interface IEquipmentBridgeLZ {

    event EquipmentArrived(uint256 indexed equipmentId, uint16 indexed equipmentType, uint256 arrivalChainId);
    event EquipmentSent(uint256 indexed equipmentId, uint16 indexed equipmentType, uint256 arrivalChainId);
    event LZMessageSent(tuple(bytes32 guid, uint64 nonce, tuple(uint256 nativeFee, uint256 lzTokenFee) fee) receipt);
    event PetArrived(uint256 indexed petId, uint256 arrivalChainId);
    event PetSent(uint256 indexed petId, uint256 arrivalChainId);

    function bridgeEquipment(uint32 _dstChainId, address _receiver, uint256 _equipmentId, uint16 _equipmentType) payable;
    function estimateEquipment(uint32 _dstChainId, address _receiver, uint256 _equipmentId, uint16 _equipmentType) view returns (tuple(uint256 nativeFee, uint256 lzTokenFee) fee);

}
```

### ABIs

{% file src="/files/JULN7X7OLoQaGwUIGRHQ" %}


# Item Bridge V2

The **LayerZeroV2 Item Bridge** processes the cross-chain bridging of ERC-20 and ERC-1155 tokens. It is available between **DFK Chain, Kaia, and Metis**.

{% hint style="info" %}
The Item Bridge is built in partnership with [Layer Zero](https://layerzero.network/) using their V2 Messaging protocol. For more information, visit their documentation at: <https://layerzero.gitbook.io/docs/>.

Use [Layer Zero Scan](https://layerzeroscan.com/) (<https://layerzeroscan.com/>) to track the progress of bridged items.
{% endhint %}

### Chain ID

Use the following mainnet destination Chain IDs for the Item Bridge:

* DFK Chain: `53935`
* Kaia: `8217`
* Metis: `1088`

### Fees

Bridging has a fee associated with each transaction. This fee must be included in the `value` field of the transaction. The fees for bridging Items are as follows:

* ERC-20: Use `estimateFeeSendERC20` or `multiEstimateFeeSendERC20`
* ERC-1155: Use `estimateFeeSendERC1155`

### Contract Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| DFK Chain | `0x409E6CDE3119584074E162dcCC6C86433251C36f` | `0x46B76162C36D97a8347C21fd85fd662e87F6ea28` |
| Kaia      | `0x1679b50950aFF40983716b91862BB49eeE9718b9` | `0xc209aDB7d839921060CF425bA7F72524A356EcFd` |
| Metis     | `0x3E5b5826A8670DB5157c257d5e001F9C73141514` | `0x82995f66e9c6eC23069eE040Dc86dfcc1A2fa5fD` |

### Interfaces

```solidity
interface IItemBridgeLZ {

    event ERC1155Received(uint32 _srcChainId, address _srcAddress, address receiver, address item, uint256 amount, uint256 id);
    event ERC1155Sent(uint32 _dstChainId, address sender, address item, uint256 amount, uint256 id);
    event ItemReceived(uint32 _srcChainId, address _srcAddress, address receiver, address item, uint256 amount);
    event ItemSent(uint32 _dstChainId, address sender, address item, uint256 amount);

    function estimateFeeSendERC1155(uint16 _dstChainId, address _receiver, address _item, uint256 _amount, uint256 _id) view returns (tuple(uint256 nativeFee, uint256 lzTokenFee) fee);
    function estimateFeeSendERC20(uint16 _dstChainId, address _receiver, address _item, uint256 _amount) view returns (tuple(uint256 nativeFee, uint256 lzTokenFee) fee);
    function multiEstimateFeeSendERC20(uint16 _dstChainId, address _receiver, address[] _items, uint256[] _amounts) view returns (tuple(uint256 nativeFee, uint256 lzTokenFee) fee);
    function multiSendERC1155(uint16 _dstChainId, address _receiver, address[] _items, uint256[] _amounts, uint256[] _ids) payable;
    function multiSendERC20(uint16 _dstChainId, address _receiver, address[] _items, uint256[] _amounts) payable;
    function sendERC1155(uint16 _dstChainId, address _receiver, address _item, uint256 _amount, uint256 _id) payable;
    function sendERC20(uint16 _dstChainId, address _receiver, address _item, uint256 _amount) payable;

    
}
```

### ABIs

{% file src="/files/blPnXNhAkRYE88yzGxcX" %}


# Item Bridge V1 (Deprecated)

{% hint style="info" %}
The Item Bridge is built in partnership with [Layer Zero](https://layerzero.network/). For more information, visit their documentation at: <https://layerzero.gitbook.io/docs/>.
{% endhint %}

{% hint style="info" %}
Layer Zero has released [Layer Zero Scan](https://layerzeroscan.com/) (<https://layerzeroscan.com/>), a message explorer that can be used to track the progress of bridged items.
{% endhint %}

{% hint style="warning" %}
The Item Bridge from Harmony only allows bridging to DFK Chain, but not in the other direction.
{% endhint %}

### Chain ID

Use the following destination Chain IDs for the Item Bridge:

* DFK Chain Mainnet: `115` / Testnet: `10015`
* Klaytn Mainnet: `150` / Testnet: `10050`

### Fees

Bridging has a fee associated with each transaction. This fee must be included in the `value` field of the transaction. The fees for bridging Items are as follows:

* ERC-20: Use `estimateFeeSendERC20`
* ERC-1155: Use `estimateFeeSendERC1155`

### Contract Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| Harmony   | `0x091cfc85d2e20b110Cd754c6c410A67c925C55ED` | N/A                                          |
| DFK Chain | `0x501CdC4ef10b63219704Bf6aDb785dfccb06deE2` | `0xDA02dC6419A1CcEF04C041Cd792A6fe5AF327a44` |
| Klaytn    | `0x6d5B86EaC9097EA4a94B2b69Cd4854678B89f839` | `0x3D9d84801A0580a9C17B5FfAE0D7AcD73C8a3Ff7` |

### Interfaces

```solidity
interface IItemBridge {

    event ERC1155Received(uint16 _srcChainId, bytes _srcAddress, address receiver, address item, uint256 amount, uint256 id);
    event ItemReceived(uint16 _srcChainId, bytes _srcAddress, address receiver, address item, uint256 amount);
    event MessageFailed(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload);
    event SetTrustedRemote(uint16 _srcChainId, bytes _srcAddress);

    function estimateFeeSendERC1155(uint16 _dstChainId, address _receiver, address _item, uint256 _amount, uint256 _id, bool _useZro, bytes _adapterParams) view returns (uint256);
    function estimateFeeSendERC1155(uint16 _dstChainId, address _receiver, address _item, uint256 _amount, uint256 _id) view returns (uint256);
    function estimateFeeSendERC20(uint16 _dstChainId, address _receiver, address _item, uint256 _amount) view returns (uint256);
    function estimateFeeSendERC20(uint16 _dstChainId, address _receiver, address _item, uint256 _amount, bool _useZro, bytes _adapterParams) view returns (uint256);
    function lzEndpoint() view returns (address);
    function owner() view returns (address);
    function paused() view returns (bool);
    function sendERC1155(uint16 _dstChainId, address _receiver, address _item, uint256 _amount, uint256 _id, address _zroPaymentAddress, bytes _adapterParams) payable;
    function sendERC1155(uint16 _dstChainId, address _receiver, address _item, uint256 _amount, uint256 _id) payable;
    function sendERC20(uint16 _dstChainId, address _receiver, address _item, uint256 _amount, address _zroPaymentAddress, bytes _adapterParams) payable;
    function sendERC20(uint16 _dstChainId, address _receiver, address _item, uint256 _amount) payable;

}
```

### ABIs

{% file src="/files/lfgqX6FkLBo6Fn8FzoyH" %}


# Gaia's Tear Bridge

{% hint style="danger" %}
With the release of the [Item Bridge](/contracts/bridging/item-bridge-v2), the Gaia's Tear bridge has been deprecated and should no longer be used. Only [Gaia's Tears V1](/tokens/currencies/gaias-tears) were bridgeable between Harmony and DFK Chain through this contract.
{% endhint %}

### Chain ID

Use the following destination Chain IDs for the Tear Bridge:

* Harmony: 1666600000
* DFK Chain: 53935

### Fees

Bridging has a fee associated with each transaction. This fee must be included in the `value` field of the transaction. The fees for bridging Tears are as follows:

* Harmony to DFK Chain: 0.016 ONE
* DFK Chain to Harmony: 0.004 JEWEL

### Contract Addresses

| Name      | Mainnet                                    | Testnet                                    |
| --------- | ------------------------------------------ | ------------------------------------------ |
| Harmony   | 0x27B7C0C87B9ecA92E5101852709e63685bF9d299 | 0xD2666441443DAa61492FFe0F37717578714a4521 |
| DFK Chain | 0x6a00Dc976a7291a1E9F5380FE6F96fE006dCdD3c | 0xB68281c60352529595c9ed7E845262f608985D7c |

### Interfaces

```solidity
interface ITearBridge {

    event GaiaArrived(address indexed dstUser, uint256 arrivalChainId);
    event GaiaSent(address indexed dstUser, uint256 arrivalChainId);
    
    function gaiaTears() view returns (address);
    function msgGasLimit() view returns (uint256);
    function sendTear(uint256 _tearsAmount, uint256 _dstChainId) payable;

}
```

### ABIs

{% file src="/files/BqYjIioOdqRwCQfSRGkH" %}


# Miscellaneous


# Airdrops

## Contracts

### Addresses

#### DFK Chain

| Name         | Mainnet                                      | Testnet                                      |
| ------------ | -------------------------------------------- | -------------------------------------------- |
| AirdropClaim | `0x947873092dc57C1A70704033c41cB110f4462a8B` | `0x77f376aCc4FB5B9B8e965be16e12623A0567ff14` |

#### Klaytn

| Name         | Mainnet                                      | Testnet                                      |
| ------------ | -------------------------------------------- | -------------------------------------------- |
| AirdropClaim | `0x86B70Cd6A405B84d1790021dC4F8c24B50727EA6` | `0x4E05bBA3C97131E25461Ee8786F61835C7bBbdFD` |

### Interfaces

```solidity
interface IAirdropClaim {

    event Claimed(address recipient, address token, uint256 amount);
    event Dropped(address recipient, address token, uint256 amount);
    event Withdrawal(address tokenAddress, address recipient, uint256 amount);
    
    function claimAirdrop(uint256 _dropId);
    function claimAirdrops(uint256 _amountToClaim);
    function createAirdropsWithTokens(address _tokenAddress, address[] memory _recipients, uint256[] memory _amounts, string memory _note)
    function enabled() view returns (bool);
    function tokenToPendingAmount(address) view returns (uint256);
    function viewAirdrops() view returns (tuple(address tokenAddress, uint256 amount, uint256 time, string note)[]);
    function viewUserAirdrops(address player) view returns (tuple(address tokenAddress, uint256 amount, uint256 time, string note)[]);
    function withdrawTokens(address _tokenAddress, address _recipient, uint256 _amount);

}
```

### ABIs

{% file src="/files/dSCl16RKsGCJ4bK5AbNY" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

{% hint style="info" %}
The AirdropClaim contract on Harmony was upgraded from V1 on 1/14/2022.
{% endhint %}

#### Harmony

| Name           | Mainnet                                      | Testnet                                      |
| -------------- | -------------------------------------------- | -------------------------------------------- |
| AirdropClaimV2 | `0x8AbEbcDBF5AF9FC602814Eabf6Fbf952acF682A2` | `0x3CC701CD8A4D3Cb137c7dd933480C4A67e10aC90` |
| AirdropClaimV1 | `0xa678d193fEcC677e137a00FEFb43a9ccffA53210` | N/A                                          |

### Interfaces

```solidity
interface IAirdropClaimV1 {

    event Claimed(address recipient, uint256 amount);
    
    function balances(address) view returns (uint256);
    function claimAirdrop();
    function setAirdrops(address[] _recipients, uint256[] _amounts);
    function transferTokens(address _address, uint256 _amount);

}
```

### ABIs

{% file src="/files/rCvceao6hS8NLTXGlqfa" %}


# Charity

{% hint style="info" %}
The Charity contracts are only available in-game during specific Charity Drive events.&#x20;
{% endhint %}

## Contracts

### Addresses

#### DFK Chain

| Name         | Mainnet                                      | Testnet                                      |
| ------------ | -------------------------------------------- | -------------------------------------------- |
| Charity Fund | `0xABABB0A2c42274D0e81417B824CABca464F5c16C` | `0xEE7d3642687ab561E2eea37bB936DDbB1565A037` |

### Interfaces

```solidity
interface ICharityFund {

    event Donation(address indexed account, address indexed token, uint256 amount);
    event Withdrawal(address indexed token, uint256 amount);
    
    function accepted(address) view returns (bool);
    function campaignId() view returns (uint8);
    function donateNativeToken() payable;
    function donateToken(address _token, uint256 _wei);
    function donationTotals(address) view returns (uint256);
    function getInfo() view returns (tuple(bool accepted, address token, string name, string symbol, uint256 decimals, uint256 total, uint256 balance, uint256 userDonation)[]);
    function multisig() view returns (address);
    function owner() view returns (address);
    function tokens(uint256) view returns (address);
    function withdraw(address _token);
    function withdrawAll();
    function withdrawNative();

}
```

### ABIs

{% file src="/files/27lzcJV0f8OIs0NVJLTb" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

| Name         | Mainnet                                      | Testnet                                      |
| ------------ | -------------------------------------------- | -------------------------------------------- |
| Charity Fund | `0x51477E2E1481BcAE1a17DdbA777931d55c980Ecf` | `0x5238310E4115e85522A60d9e3B39D88bEA89FBA4` |


# Flag Storage

{% hint style="info" %}
The Flag Storage contract is used to store supplemental information about Heroes and Wallets that is not contained in other contracts.

The V1 version of this contract, which primarily stored data about the Perilous Journey and CV Gen0 Rerolls, has been deprecated in favor of V2.

Pertinent information that is still stored in the V1 contract will be migrated to the V2 system in the future.
{% endhint %}

## Contracts

### Addresses

#### DFK Chain

| Name          | Mainnet                                      | Testnet                                      |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| FlagStorageV2 | `0x75d8ba2E4725633FcdcC165332dCA04c107915cA` | `0x49b145D2164B137a398951a76D069118F2EAfe4a` |

#### Klaytn

| Name          | Mainnet                                      | Testnet                                      |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| FlagStorageV2 | `0xeb9ff38209dCC4236DBFb3C275c0AAeEBf0B92Cf` | `0x3f81c3a28c4802E2B1966A5590beEAb895cC01DD` |

### Interfaces

```solidity
interface IFlagStorageV2 {

    event CraftingGenesStorageSet(uint256 heroId, bool value);
    event DarkSummoningStorageSet(uint256 heroId, tuple(uint32 levelCarryover) values);
    
    // The first reroll that took place on Harmony for the CV release
    event Gen0RerollCVStorageSet(uint256 heroId, tuple(address player, uint32 summonRecord, bool rerolledGameGenes, bool rerolledAppearanceGenes) values);
    // The second reroll that took place on CV for the SD2.0 release
    event Gen0RerollSDStorageSet(uint256 heroId, tuple(address player, uint32 summonRecord, bool rerolledGameGenes, bool rerolledAppearanceGenes) values);
    event PerilousJourneyStorageSet(uint256 heroId, address value);
    event HeroPendingReviewAdded(uint256 heroId);
    event HeroTaintedGeneStorageDeleted(uint256 heroId);
    event HeroTaintedGeneStorageSet(uint256 heroId, tuple(uint256 heroId, uint8[] geneIndex, uint8[] rankType, bool hasTaintedGenes, bool mayHaveTaintedGenes) geneValues);
    event HeroesPendingReviewCleared();
    
    function getCraftingGeneFlag(uint256 _heroId) view returns (bool);
    function getCraftingGeneFlags(uint256[] _heroIds) view returns (uint256[], bool[]);
    function getDarkSummoningStorage(uint256 _heroId) view returns (tuple(uint32 levelCarryover));
    // The first reroll that took place on Harmony for the CV release
    function getGen0RerollCVStorage(uint256 _heroId) view returns (tuple(address player, uint32 summonRecord, bool rerolledGameGenes, bool rerolledAppearanceGenes));
    // The second reroll that took place on CV for the SD2.0 release
    function getGen0RerollSDStorage(uint256 _heroId) view returns (tuple(address player, uint32 summonRecord, bool rerolledGameGenes, bool rerolledAppearanceGenes));
    function getPJStorage(uint256 _heroId) view returns (address);

}
```

### ABIs

{% file src="/files/gVpIHDe9GN00XjgmUrdV" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### DFK Chain

| Name          | Mainnet                                      | Testnet                                      |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| FlagStorageV1 | `0x659D6F1Ba11c388A55091dc83e77808081201D5D` | `0xfD892302248D97626bF61Ea5C4308cFaF2b4dA1C` |

#### Harmony

| Name          | Mainnet                                      | Testnet                                      |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| FlagStorageV1 | `0x284F756A212Afd072E5a6033Ace9BE0Eed1d8811` | `0x2e0B652a5BBc6547DD11aA7A25235dd92d2Fde23` |

### Interfaces

```solidity
interface IFlagStorageV1 {

    event UpdatedHeroStorage(uint256 indexed heroId, uint256 indexed storageId, uint32[] data);
    event UpdatedWalletStorage(address indexed wallet, uint256 indexed storageId, uint32[] data);

    function getHeroStorageData(uint256 _heroId, uint256 _storageId) view returns (uint32[]);
    function getHeroStorageDataAtIndex(uint256 _heroId, uint256 _storageId, uint256 _index) view returns (uint32);
    function getHeroStorageFlag(uint256 _heroId, uint256 _storageId, uint256 _dataIndex, uint8 _bitIndex) view returns (bool);
    function getHeroStorageLower16BitValue(uint256 _heroId, uint256 _storageId, uint256 _index) view returns (uint32);
    function getHeroStorageUpper16BitValue(uint256 _heroId, uint256 _storageId, uint256 _index) view returns (uint32);
    function getHeroStorageWalletAddress(uint256 _heroId, uint256 _storageId, uint256 _startIndex) view returns (address);
    function getWalletStorageData(address _wallet, uint256 _storageId) view returns (uint32[]);
    function getWalletStorageDataAtIndex(address _wallet, uint256 _storageId, uint256 _index) view returns (uint32);
    function getWalletStorageFlag(address _wallet, uint256 _storageId, uint256 _dataIndex, uint8 _bitIndex) view returns (bool);
    function getWalletStorageLower16BitValue(address _wallet, uint256 _storageId, uint256 _index) view returns (uint32);
    function getWalletStorageUpper16BitValue(address _wallet, uint256 _storageId, uint256 _index) view returns (uint32);, uint32 summonRecord, bool rerolledGameGenes, bool rerolledAppearanceGenes));

}
```

### ABIs

{% file src="/files/qpJEXzBqvxxWL4GohFXO" %}

### FlagStorageV1

The V1 FlagStorage system is constructed from a two layer mapping, where the first layer is indexed by keys that correspond to wallet addresses or Hero IDs. The second layer is indexed by storage IDs and return an array of `uint32` values. These `uint` values can be broken down into their individual bits for `boolean` storage, or split into lower and upper `uint16` values.

To retrieve this data, use `getWalletStorageFlag` or `getHeroStorageFlag` for `boolean` values, and `getWallet`/`HeroStorageLower`/`Upper16BitValue` for `uint16` values.

This is not a complete list of Flag Storage data, as the remainder can be retrieved from the [Perilous Journey](/contracts/events/perilous-journey) and [Gen0 Reroll](/contracts/events/gen0-reroll) contracts. All relevant data will eventually be migrated to the V2 contract.

#### Wallet Storage

<table><thead><tr><th width="131.33333333333331">Storage ID</th><th width="75">Index</th><th width="64">Bits</th><th width="116">DataType</th><th width="242">Data</th><th>Network</th></tr></thead><tbody><tr><td>2</td><td>1</td><td>0</td><td><code>boolean</code></td><td>Donated to Philippines hurricane relief (2021)</td><td>Harmony</td></tr><tr><td>2</td><td>1</td><td>1</td><td><code>boolean</code></td><td>Donated to UNICEF campaign (April 2022)</td><td>Harmony<br>DFK Chain</td></tr></tbody></table>

#### Hero Storage

<table><thead><tr><th width="133.33333333333331">Storage ID</th><th width="77">Index</th><th width="65">Bits</th><th width="112">DataType</th><th width="245">Data</th><th>Network</th></tr></thead><tbody><tr><td>4</td><td>0</td><td>0</td><td><code>boolean</code></td><td>Perilous Journey Survivor</td><td>Harmony</td></tr><tr><td>4</td><td>0</td><td>1</td><td><code>boolean</code></td><td>Gen0 Reroll (CV) Game Genes</td><td>Harmony</td></tr><tr><td>4</td><td>0</td><td>2</td><td><code>boolean</code></td><td>Gen0 Reroll (CV) Visual Genes</td><td>Harmony</td></tr><tr><td>5</td><td>0</td><td>0</td><td><code>boolean</code></td><td>Hero survived the Perilous Journey</td><td>Harmony</td></tr><tr><td>5</td><td>0</td><td>1</td><td><code>boolean</code></td><td>Hero died on the Perilous Journey</td><td>Harmony</td></tr><tr><td>5</td><td>0</td><td>2</td><td><code>boolean</code></td><td>Hero is eligible for 3x +5 Stat Ups from the Perilous Journey</td><td>Harmony</td></tr><tr><td>5</td><td>0</td><td>3</td><td><code>boolean</code></td><td>Hero received 3x +5 Stat Ups from the Perilous Journey</td><td>Harmony</td></tr></tbody></table>


# Gen0 Airdrop (Harmony)

{% hint style="info" %}
This contract was used for airdropping 75 Serendale Gen0 Hero crystals on Harmony to winners of the original Gen0 raffle and other partners and influencers. It is listed here for data analysis and tracking purposes only.
{% endhint %}

## Historical Contracts

### Addresses

#### Harmony

| Name        | Mainnet                                      | Testnet                                      |
| ----------- | -------------------------------------------- | -------------------------------------------- |
| Gen0Airdrop | `0xBd1f65e7f350C614d364AEFeB2d87F829b0E465d` | `0x631E44cf093F7B532Fed94C50f32F1025ad92BFa` |

### Interfaces

```solidity
interface IGen0Airdrop {

    event CrystalAirdrop(address indexed owner, uint256 crystalId, uint256 createdBlock);
    event CrystalOpen(address indexed owner, uint256 crystalId, uint256 heroId);
    
    function airdropCrystal(address _recipient);
    function crystals(uint256) view returns (address owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint256 heroId, uint8 summonerTears, uint8 assistantTears, address bonusItem, uint32 maxSummons, uint32 firstName, uint32 lastName, uint8 shinyStyle);
    function enabled() view returns (bool);
    function extractNumber(uint256 randomNumber, uint256 digits, uint256 offset) pure returns (uint256 result);
    function getCrystal(uint256 _crystalId) view returns (tuple(address owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint256 heroId, uint8 summonerTears, uint8 assistantTears, address bonusItem, uint32 maxSummons, uint32 firstName, uint32 lastName, uint8 shinyStyle));
    function getUserCrystals(address _address) view returns (uint256[]);
    function open(uint256 _crystalId) returns (uint256);
    function userCrystals(address, uint256) view returns (uint256);
    function vrf(uint256 blockNumber) view returns (bytes32 result);

}
```

### ABIs

{% file src="/files/o0WQ0ywAp0EPfwzfkzXz" %}


# Gen0 Sale (Harmony)

{% hint style="info" %}
This contract was used for the original sale of 2000 Serendale Gen0 Heroes on Harmony. It is listed here for data analysis and tracking purposes only.
{% endhint %}

## Historical Contracts

### Addresses

#### Harmony

| Name     | Mainnet                                      | Testnet                                      |
| -------- | -------------------------------------------- | -------------------------------------------- |
| Gen0Sale | `0xdF0Bf714e80F5e6C994F16B05b7fFcbCB83b89e9` | `0x4E8b1f13A64C0B7735FA0f9f4C7e4Af38b502988` |

### Interfaces

```solidity
interface IGen0Sale {

    event CrystalOpen(address indexed owner, uint256 crystalId, uint256 heroId);
    event Gen0Purchase(address indexed owner, uint256 crystalId, uint256 createdBlock, uint256 purchasePrice);
    
    function amountSold() view returns (uint256);
    function crystals(uint256) view returns (address owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint256 heroId, uint8 summonerTears, uint8 assistantTears, address bonusItem, uint32 maxSummons, uint32 firstName, uint32 lastName, uint8 shinyStyle);
    function enabled() view returns (bool);
    function getCrystal(uint256 _crystalId) view returns (tuple(address owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint256 heroId, uint8 summonerTears, uint8 assistantTears, address bonusItem, uint32 maxSummons, uint32 firstName, uint32 lastName, uint8 shinyStyle));
    function getUserCrystals(address _address) view returns (uint256[]);
    function increase() view returns (uint256);
    function jewelToken() view returns (address);
    function lastPurchase(address) view returns (uint256);
    function maxQuantity() view returns (uint256);
    function nextPrice() view returns (uint256);
    function open(uint256 _crystalId) returns (uint256);
    function purchase(uint256 _limit);
    function startCost() view returns (uint256);
    function userCrystals(address, uint256) view returns (uint256);
    function vrf(uint256 blockNumber) view returns (bytes32 result);
  
}
```

### ABIs

{% file src="/files/7mlthL9delYSWvi7acnR" %}


# Graveyard

{% hint style="danger" %}
The Graveyard should only be used by community members for READ operations. Burying heroes is an `ACCESS_CONTROL` operation. Sending heroes to this address through a general transfer function will leave the Hero locked in the contract but will not set the correct data parameters to be viewed in the in-game graveyard.
{% endhint %}

## Contracts

### Addresses

#### DFK Chain

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| Graveyard | `0x280F9Bf2ae2B1AdCe6Cc611F6FD7AE3817888762` | `0x75b11708B6eB68692C7EE01DFeFe216C359Ab9b7` |

### Interfaces

```solidity
interface IGraveyard {

    event DeathRecorded(uint256 heroId, string indexed deathReason, uint256 deathTime);
    
    function buryHero(address _holder, uint256 _heroId, string _deathReason, address _previousOwner);
    function deadHeroes(uint256) view returns (uint256 id, uint256 heroId, uint64 deathTime, string deathReason, address previousOwner);
    function getDeadHero(uint256 _heroId) view returns (tuple(uint256 id, uint256 heroId, uint64 deathTime, string deathReason, address previousOwner));
    function getDeadHeroes() view returns (tuple(uint256 id, uint256 heroId, uint64 deathTime, string deathReason, address previousOwner)[]);
    function getProfileDeadHero(address _profile, uint256 _index) view returns (tuple(uint256 id, uint256 heroId, uint64 deathTime, string deathReason, address previousOwner));
    function getProfileDeadHeroes(address _profile) view returns (tuple(uint256 id, uint256 heroId, uint64 deathTime, string deathReason, address previousOwner)[]);
    function heroCore() view returns (address);
    function heroToDeadHero(uint256) view returns (uint256);
    function profileDeadHeroes(address, uint256) view returns (uint256 id, uint256 heroId, uint64 deathTime, string deathReason, address previousOwner);
    
}
```

### ABIs

{% file src="/files/TvZnZcj1W1e7pLnf4wik" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### Harmony

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| Graveyard | `0x9CC714059943D5A726fAD11087Bb6d9Ab811A2E3` | `0xACebA5E9b4D6848fDe33853A0cfDA7414a840006` |

## Related Contracts

{% content-ref url="/pages/onSCYq1ddXIRp1syDDKg" %}
[Dark Summoning](/contracts/summoning/hero-summoning/dark-summoning)
{% endcontent-ref %}

{% content-ref url="/pages/7ukYI8Cv1S3Ou82fBux6" %}
[Perilous Journey](/contracts/events/perilous-journey)
{% endcontent-ref %}


# Locked Token Claim

{% hint style="info" %}
The Locked Token Claim contract is used for airdropped Locked Tokens. These include:

#### DFK Chain

* Locked CRYSTAL

#### Klaytn

* Locked JADE
  {% endhint %}

## Contracts

### Addresses

<table><thead><tr><th width="188.33333333333331">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>DFK Chain</td><td><code>0x6ec0194675354142fFEBA7B3195B57BC083f9719</code></td><td><code>0x301769Af06DFf900aec3C97808de78da52b17751</code></td></tr><tr><td>Klaytn</td><td><code>0x4FedD4E88B75186bD3ca72f688c4B4621732191C</code></td><td><code>0x20FC4ECF7811d5E3Db6E990E5975aB2cf7202B95</code></td></tr></tbody></table>

### Interfaces

```solidity
interface ILockedTokenClaim {

    event Claimed(address recipient, uint256 amount);
    event Dropped(address recipient, uint256 amount);
    event Withdrawal(address recipient, uint256 amount);
    
    function claimAirdrop(uint256 _dropId);
    function tokenClaimedAmount(address) view returns (uint256);
    function tokenPendingAmount(address) view returns (uint256);
    function tokenTotalClaimedAmount() view returns (uint256);
    function tokenTotalPendingAmount() view returns (uint256);
    function viewAirdrops() view returns (tuple(uint256 amount, uint256 time, string note)[]);
    function viewUserAirdrops(address player) view returns (tuple(uint256 amount, uint256 time, string note)[]);

}
```

### ABIs

{% file src="/files/m6fyT3EIeWAyn0GSVg3Y" %}


# Locked Token Raffle

## Contracts

### Addresses

#### DFK Chain

| Name              | Mainnet                                      | Testnet                                      |
| ----------------- | -------------------------------------------- | -------------------------------------------- |
| LockedTokenRaffle | `0xeD1194F75180bb623231D2489071fE9c3e1e04e0` | `0x251eb22DBD0B04cA3bAA3dBCb85B03523Cc341C0` |

### Interfaces

```solidity
interface ILockedTokenRaffle {

    event RaffleClosed(uint256 indexed raffleId);
    event RaffleDrawn(uint256 indexed raffleId, address indexed winner);
    event RaffleEntered(address indexed user, uint256 indexed raffleId, uint256 tickets);
    event RaffleStarted(uint256 indexed raffleId, tuple(uint256 id, address[] rewards, uint256[] rewardAmounts, uint256 maxWinners, uint64 duration) raffleType);
    event RaffleTypeActivated(uint256 indexed raffleTypeId, uint256 bucket);
    event RaffleTypeAdded(uint256 indexed id, tuple(uint256 id, address[] rewards, uint256[] rewardAmounts, uint256 maxWinners, uint64 duration) raffleType);
    event RaffleTypeDeactivated(uint256 indexed raffleTypeId, uint256 bucket);
    
    function activeRaffleTypes(uint256, uint256) view returns (uint256);
    function bucketActive(uint256) view returns (bool);
    function burnAddress() view returns (address);
    function closeRaffles();
    function currentRaffleBuckets(uint256) view returns (uint256);
    function drawWinners();
    function enterRaffle(uint256 _raffleId, uint256 _tickets);
    function enterRaffleWithLocked(uint256 _raffleId, uint256 _tickets);
    function entries(uint256, uint256) view returns (address);
    function getCurrentRaffleBuckets() view returns (uint256[]);
    function getCurrentRaffleData() view returns (tuple(uint256 id, uint256 raffleType, uint256 startTime, uint256 totalEntries, uint256 endTime, uint256 closedBlock, address[] winners, uint8 status, uint256[] winningIndexes, uint256 lastEntryChecked, uint256 lastEntryTicketsCount)[], tuple(uint256 id, address[] rewards, uint256[] rewardAmounts, uint256 maxWinners, uint64 duration)[], uint256[], uint256[]);
    function getLastRaffleBuckets() view returns (uint256[]);
    function getPreviousRaffleData() view returns (tuple(uint256 id, uint256 raffleType, uint256 startTime, uint256 totalEntries, uint256 endTime, uint256 closedBlock, address[] winners, uint8 status, uint256[] winningIndexes, uint256 lastEntryChecked, uint256 lastEntryTicketsCount)[], tuple(uint256 id, address[] rewards, uint256[] rewardAmounts, uint256 maxWinners, uint64 duration)[], uint256[], uint256[]);
    function getRaffleList(uint256[] _raffleBuckets) view returns (tuple(uint256 id, uint256 raffleType, uint256 startTime, uint256 totalEntries, uint256 endTime, uint256 closedBlock, address[] winners, uint8 status, uint256[] winningIndexes, uint256 lastEntryChecked, uint256 lastEntryTicketsCount)[]);
    function getRaffleTicketsAllowanceList(uint256[] _raffleBuckets) view returns (uint256[]);
    function getRaffleTicketsList(uint256[] _raffleBuckets) view returns (uint256[]);
    function getRaffleTypesList(uint256[] _raffleBuckets) view returns (tuple(uint256 id, address[] rewards, uint256[] rewardAmounts, uint256 maxWinners, uint64 duration)[]);
    function getTicketAllowance(address _user, uint256 _raffleId) view returns (uint256);
    function lastRaffleBuckets(uint256) view returns (uint256);
    function paused() view returns (bool);
    function playerEntries(uint256, address) view returns (uint256);
    function playerEntryIndexes(uint256, address) view returns (uint256);
    function playerEntryObjects(uint256, uint256) view returns (address player, uint256 tickets);
    function powerToken() view returns (address);
    function questFund() view returns (address);
    function raffleTypes(uint256) view returns (uint256 id, uint256 maxWinners, uint64 duration);
    function raffles(uint256) view returns (uint256 id, uint256 raffleType, uint256 startTime, uint256 totalEntries, uint256 endTime, uint256 closedBlock, uint8 status, uint256 lastEntryChecked, uint256 lastEntryTicketsCount);
    function ticketPrice() view returns (uint256);
    function ticketPriceIncrease() view returns (uint256);
    function timePerTicket() view returns (uint256);
    function totalRaffleTypes() view returns (uint256);
    function totalRaffles() view returns (uint256);

}
```

### ABIs

{% file src="/files/h1XrD5OPYh2FD0S6Dqcl" %}


# Token Disburse

{% hint style="info" %}
The Token Disburse contract is used for airdropped and vested tokens. These include:

#### DFK Chain

* Airdropped and vested xCRYSTAL
* Vested JEWEL

#### Klaytn

* Vested and Liquid JADE
  {% endhint %}

## Contracts

### Addresses

#### DFK Chain

| Name                     | Mainnet                                      | Testnet                                      |
| ------------------------ | -------------------------------------------- | -------------------------------------------- |
| TokenDisburse (xCRYSTAL) | `0x123165B3a30fdA3655B30cfC10135C1CA3C21bFC` | `0x2173A8153B4b88735A6E77E910e86cdB122BDd18` |
| TokenDisburse (JEWEL)    | `0x9a7C710A6E3A86c69F2FE704AD223Ce76934bb37` | `0x0C77D26bDd421B3d5c4a37F111910B7E57B53E8B` |

#### Klaytn

| Name                 | Mainnet                                      | Testnet                                      |
| -------------------- | -------------------------------------------- | -------------------------------------------- |
| TokenDisburse (JADE) | `0x33da18a92cB717ACcdA5d453B6ddB7Ee61000F81` | `0x9d05F8289F0eA7D1993B316F45b8e6E29F7e5D16` |

### Interfaces

```solidity
interface ITokenDisburse {

    event DisbursementAdded(uint256 id, address recipient, uint256 amount, uint64 startTime, uint64 duration);
    event DisbursementClaim(uint256 id, address recipient, uint256 amount);
    event DisbursementUpdated(uint256 id, uint256 reduction, uint64 startTime, uint64 duration);
    
    function addDisbursement(address _recipient, uint256 _amount, uint64 _startTime, uint64 _duration, string _note);
    function addDisbursements(address[] _recipients, uint256[] _amounts, uint64 _startTime, uint64 _duration, string _note);
    function claim(uint256 _amount);
    function disbursements(uint256) view returns (uint256 id, address recipient, string note, uint256 total, uint256 claimed, uint256 balance, uint64 createdTime, uint64 startTime, uint64 duration);
    function getDisbursementIds(address _recipient) view returns (uint256[]);
    function globalStartTime() view returns (uint256);
    function reservedToken() view returns (uint256);
    function totalClaimed(address _recipient) view returns (uint256);
    function totalUnvested(address _recipient) view returns (uint256);
    function totalVested(address _recipient) view returns (uint256);
    function updateDisbursement(uint256 _disbursementId, uint256 _reduction, uint64 _startTime, uint64 _duration);
    
}
```

### ABIs

{% file src="/files/PeBACWKpn9wN87CW1mrp" %}


# Heroes

{% hint style="info" %}
**ERC721:** The HeroCore contract is based on the ERC721 standard. For more detailed information please view the documentation by OpenZeppelin. <https://docs.openzeppelin.com/contracts/4.x/erc721>
{% endhint %}

## Contracts

{% hint style="warning" %}
The **HeroCore** contract was upgraded to an ERC2535 Diamond in May 2023 with the addition of new items to the Hero struct. At this time, methods and events using the new struct began to migrate to V2 versions. Legacy methods have been left in place, but will not return the new data.

In December 2023, the Hero struct and HeroEquipment structs were upgraded to V3 and V2 versions, respectively. Legacy methods remain in place.

The contract addresses did not change during these upgrades.
{% endhint %}

{% hint style="info" %}
The Hero contract on Metis uses a separate ABI and interface. See [HeroV4](https://app.gitbook.com/o/-MfzWIcQKNVkQQhxiNQM/s/lZLlRJsOJCqm10zUsKr6/~/changes/146/nfts/heroes/herov4-metis) for details.
{% endhint %}

### Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| DFK Chain | `0xEb9B61B145D6489Be575D3603F4a704810e143dF` | `0x3bcaCBeAFefed260d877dbE36378008D4e714c8E` |
| Klaytn    | `0x268CC8248FFB72Cd5F3e73A9a20Fa2FF40EfbA61` | `0x38bDed7C399bbD214a19De35260766b130cAFd2F` |
| Metis     | `0xc7681698B14a2381d9f1eD69FC3D27F33965b53B` | `0xb2bC817C100a6bd60e8bf8a79dBAD607cE9C3cF2` |

### Interfaces

```solidity
interface IHeroCoreDiamond {

    // Events
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
    event HeroDarkSummoned(address indexed owner, uint256 heroId, uint256 summonerId, uint256 assistantId, uint256 statGenes, uint256 visualGenes);
    event HeroEquipmentSet(uint256 indexed heroId, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment);
    event HeroEquipmentSetV2(uint256 indexed heroId, tuple(uint256 equippedSlots, uint256 petId, uint128 weapon1Id, uint128 weapon1VisageId, uint128 weapon2Id, uint128 weapon2VisageId, uint128 offhand1Id, uint128 offhand1VisageId, uint128 offhand2Id, uint128 offhand2VisageId, uint128 armorId, uint128 armorVisageId, uint128 accessoryId, uint128 accessoryVisageId) equipment);
    event HeroQuestCompleteUpdated(address indexed owner, uint256 heroId, uint256 staminaFullAt, uint64 xp, uint16 fishing, uint16 foraging, uint16 gardening, uint16 mining);
    event HeroQuestUpdated(address indexed owner, uint256 heroId, address quest);
    event HeroStaminaFullAtUpdated(address indexed owner, uint256 heroId, uint256 staminaFullAt);
    event HeroStateUpdated(address indexed owner, uint256 heroId, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) heroState);
    event HeroSummoned(address indexed owner, uint256 heroId, uint256 summonerId, uint256 assistantId, uint256 statGenes, uint256 visualGenes);
    event HeroUpdated(address indexed owner, uint256 heroId, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) hero);
    event HeroUpdatedV2(address indexed owner, uint256 heroId, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing, uint16 craft1, uint16 craft2) professions, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) hero);
    event HeroUpdatedV3(address indexed owner, uint256 heroId, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing, uint16 craft1, uint16 craft2) professions, tuple(uint256 equippedSlots, uint256 petId, uint128 weapon1Id, uint128 weapon1VisageId, uint128 weapon2Id, uint128 weapon2VisageId, uint128 offhand1Id, uint128 offhand1VisageId, uint128 offhand2Id, uint128 offhand2VisageId, uint128 armorId, uint128 armorVisageId, uint128 accessoryId, uint128 accessoryVisageId) equipment) hero);
    event PetEquipped(uint256 indexed heroId, uint256 indexed petId);
    event PetUnequipped(uint256 indexed heroId, uint256 indexed petId);
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
    
    // View Methods
    function accessoryCoreAddress() view returns (address);
    function armorCoreAddress() view returns (address);
    function balanceOf(address owner) view returns (uint256);
    function getApproved(uint256 tokenId) view returns (address);
    function isApprovedForAll(address owner, address operator) view returns (bool);
    function name() view returns (string);
    function nextHeroId() view returns (uint256);
    function ownerOf(uint256 tokenId) view returns (address);
    function paused() view returns (bool);
    function petCoreAddress() view returns (address);
    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 weaponCoreAddress() view returns (address);

    // Hero Getters
    function getHero(uint256 _id) view returns (tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions));
    function getHeroV2(uint256 _id) view returns (tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing, uint16 craft1, uint16 craft2) professions, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment));
    function getHeroV3(uint256 _id) view returns (tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing, uint16 craft1, uint16 craft2) professions, tuple(uint256 equippedSlots, uint256 petId, uint128 weapon1Id, uint128 weapon1VisageId, uint128 weapon2Id, uint128 weapon2VisageId, uint128 offhand1Id, uint128 offhand1VisageId, uint128 offhand2Id, uint128 offhand2VisageId, uint128 armorId, uint128 armorVisageId, uint128 accessoryId, uint128 accessoryVisageId) equipment));        
    function getHeroesV2(uint256[] _ids) view returns (tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing, uint16 craft1, uint16 craft2) professions, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment)[]);
    function getHeroesV3(uint256[] _ids) view returns (tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing, uint16 craft1, uint16 craft2) professions, tuple(uint256 equippedSlots, uint256 petId, uint128 weapon1Id, uint128 weapon1VisageId, uint128 weapon2Id, uint128 weapon2VisageId, uint128 offhand1Id, uint128 offhand1VisageId, uint128 offhand2Id, uint128 offhand2VisageId, uint128 armorId, uint128 armorVisageId, uint128 accessoryId, uint128 accessoryVisageId) equipment)[]);        
    function getHeroDuelInfo(uint256 _id, uint8 _stat) view returns (tuple(uint16 statValue, uint8 class, uint8 subClass, uint8 element, uint8 background) heroDuelInfo);
    function getHeroDuelInfos(uint256[] _ids, uint8[] _stats) view returns (tuple(uint16 statValue, uint8 class, uint8 subClass, uint8 element, uint8 background)[] heroDuelInfos);
    function getHeroDuelSnapshot(uint256 _id) view returns (tuple(tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, uint8 class, uint8 subClass, uint8 element, uint8 background, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) heroDuelSnapshot);
    function getHeroDuelSnapshots(uint256[] _ids) view returns (tuple(tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, uint8 class, uint8 subClass, uint8 element, uint8 background, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment)[] heroDuelSnapshots);      
    function getHeroEquipment(uint256 _id) view returns (tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId));
    function getHeroEquipmentV2(uint256 _id) view returns (tuple(uint256 equippedSlots, uint256 petId, uint128 weapon1Id, uint128 weapon1VisageId, uint128 weapon2Id, uint128 weapon2VisageId, uint128 offhand1Id, uint128 offhand1VisageId, uint128 offhand2Id, uint128 offhand2VisageId, uint128 armorId, uint128 armorVisageId, uint128 accessoryId, uint128 accessoryVisageId));
    function getHeroInfo(uint256 _id) view returns (tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass));
    function getHeroPrimaryStatGrowth(uint256 _id) view returns (tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg));
    function getHeroProfessionsV2(uint256 _id) view returns (tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing, uint16 craft1, uint16 craft2));
    function getHeroSecondaryStatGrowth(uint256 _id) view returns (tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg));
    function getHeroState(uint256 _id) view returns (tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status));
    function getHeroStats(uint256 _id) view returns (tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina));
    function getHeroSummoningInfo(uint256 _id) view returns (tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons));
    function getUserHeroes(address _address) view returns (uint256[]);
    function heroesAreOwnedByAddress(uint256[] _heroIds, address _address) view returns (bool);
    
    // State-Changing Functions
    function approve(address to, uint256 tokenId);
    function changeEquipment(tuple(uint256 heroId, uint256 equipmentId, uint8 slot) _input);
    function multiChangeEquipment(tuple(uint256 heroId, uint256 equipmentId, uint8 slot)[] _inputs);
    function multiSafeTransferFrom(address _from, address _newOwner, uint256[] heroIds);
    function multiTransferHeroAndEquipmentFrom(address _from, address _newOwner, uint256[] heroIds);
    function safeTransferFrom(address from, address to, uint256 tokenId);
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data);
    function transferFrom(address from, address to, uint256 tokenId);
    function transferHeroAndEquipmentFrom(address _from, address _newOwner, uint256 _heroId);
    
}
```

### ABIs

{% file src="/files/fNWElIqLj8vOguFdcnAH" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### Harmony

| Name     | Mainnet                                      | Testnet                                      |
| -------- | -------------------------------------------- | -------------------------------------------- |
| HeroCore | `0x5F753dcDf9b1AD9AabC1346614D1f4746fd6Ce5C` | `0xC57971c3EC0Fc2450FC5CC9c4398ac08ff09e6ED` |

### Interfaces

```solidity
interface IHeroCore {

    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
    event HeroDarkSummoned(address indexed owner, uint256 heroId, uint256 summonerId, uint256 assistantId, uint256 statGenes, uint256 visualGenes);
    event HeroSummoned(address indexed owner, uint256 heroId, uint256 summonerId, uint256 assistantId, uint256 statGenes, uint256 visualGenes);
    event HeroUpdated(address indexed owner, uint256 heroId, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) hero);
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
    
    function approve(address to, uint256 tokenId);
    function balanceOf(address owner) view returns (uint256);
    function bridgeMint(uint256 _id, address _to);
    function createHero(uint256 _statGenes, uint256 _visualGenes, uint8 _rarity, bool _shiny, tuple(address owner, uint256 summonerId, uint256 assistantId, uint16 generation, uint256 createdBlock, uint256 heroId, uint8 summonerTears, uint8 assistantTears, address enhancementStone, uint32 maxSummons, uint32 firstName, uint32 lastName, uint8 shinyStyle, bool darkSummoned, uint8 rarityBonusCharges) _crystal, uint256 _crystalId) returns (uint256);
    function getApproved(uint256 tokenId) view returns (address);
    function getHero(uint256 _id) view returns (tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions));
    function getUserHeroes(address _address) view returns (uint256[]);
    function heroes(uint256) view returns (uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions);
    function isApprovedForAll(address owner, address operator) view returns (bool);
    function name() view returns (string);
    function nextHeroId() view returns (uint256);
    function ownerOf(uint256 tokenId) view returns (address);
    function paused() view returns (bool);
    function safeTransferFrom(address from, address to, uint256 tokenId);
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data);
    function setApprovalForAll(address operator, bool approved)
    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);
    function updateHero(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) _hero)

}
```

### ABIs

{% file src="/files/6fr6vq6UHKhYYdTo8Cxw" %}

## Data Tables

Use these tables to parse the blockchain and API Hero data.

### Hero Info

#### Class

```json
{
    0: "Warrior",
    1: "Knight",
    2: "Thief",
    3: "Archer",
    4: "Priest",
    5: "Wizard",
    6: "Monk",
    7: "Pirate",
    8: "Berserker",
    9: "Seer",
    10: "Legionnaire",
    11: "Scholar",
    16: "Paladin",
    17: "DarkKnight",
    18: "Summoner",
    19: "Ninja",
    20: "Shapeshifter",
    21: "Bard",
    24: "Dragoon",
    25: "Sage",
    26: "SpellBow",
    28: "DreadKnight"
}
```

#### Rarity

```json
{
    0: "Common",
    1: "Uncommon",
    2: "Rare",
    3: "Legendary",
    4: "Mythic"
}
```

#### Profession

```json
{
    0: "Mining",
    2: "Gardening",
    4: "Fishing",
    6: "Foraging"
}
```

#### Stats

{% hint style="warning" %}
The mapping below is currently used for the `StatBoost` genes and is the same order (but not mapping) in other contracts modifying Hero stats ([MeditationCircle](/contracts/meditation-circle), [Gen0Reroll](/contracts/events/gen0-reroll), etc.). Technically, this is a bug, as the Hero contract itself uses `[Str, Int, Wis, Lck, Agi, Vit, End, Dex]` as the canonical order for Hero Stats and Stat Growth values. We hope to align these values in the future.
{% endhint %}

```json
{
    0: "Strength",
    2: "Agility",
    4: "Intelligence",
    6: "Wisdom",
    8: "Luck",
    10: "Vitality",
    12: "Endurance",
    14: "Dexterity"
}
```

### Stat Traits

#### Stat Traits

```json
{
    0: "Class",
    1: "SubClass",
    2: "Profession",
    3: "Passive1",
    4: "Passive2",
    5: "Active1",
    6: "Active2",
    7: "StatBoost1",
    8: "StatBoost2",
    9: "Crafting1",
    10: "Element",
    11: "Crafting2"
}
```

#### Active/Passive Ability

```json
{
    0: "Basic1",
    1: "Basic2",
    2: "Basic3",
    3: "Basic4",
    4: "Basic5",
    5: "Basic6",
    6: "Basic7",
    7: "Basic8",
    16: "Advanced1",
    17: "Advanced2",
    18: "Advanced3",
    19: "Advanced4",
    24: "Elite1",
    25: "Elite2",
    28: "Exalted1"
}
```

#### Element

```json
{
    0: "Fire",
    2: "Water",
    4: "Earth",
    6: "Wind",
    8: "Lightning",
    10: "Ice",
    12: "Light",
    14: "Dark"
}
```

#### Crafting

```json
{
    0: "Blacksmithing",
    2: "Goldsmithing",
    4: "Armorsmithing",
    6: "Woodworking",
    8: "Leatherworking",
    10: "Tailoring",
    12: "Enchanting",
    14: "Alchemy"
}
```

### Visual Traits

#### Visual Traits

```json
{
    0: "Gender",
    1: "HeadAppendage",
    2: "BackAppendage",
    3: "Background",
    4: "HairStyle",
    5: "HairColor",
    6: "VisualUnknown1",
    7: "EyeColor",
    8: "SkinColor",
    9: "AppendageColor",
    10: "BackAppendageColor",
    11: "VisualUnknown2"
}
```

#### Gender

```json
{
    1: "Male",
    3: "Female"
}
```

#### Head Appendage

```json
{
    0: "None",
    1: "Kitsune Ears",
    2: "Satyr Horns",
    3: "Ram Horns",
    4: "Imp Horns",
    5: "Cat Ears",
    6: "Minotaur Horns",
    7: "Faun Horns",
    8: "Draconic Horns",
    9: "Fae Circlet",
    10: "Ragfly Antennae",
    11: "Royal Crown",
    16: "Jagged Horns",
    17: "Spindle Horns",
    18: "Bear Ears",
    19: "Antennae",
    20: "Fallen Angel Coronet",
    21: "Power Horn",
    24: "Wood Elf Ears",
    25: "Snow Elf Ears",
    26: "Cranial Wings",
    28: "Insight Jewel"
}
```

#### Back Appendage

```json
{
    0: "None",
    1: "Monkey Tail",
    2: "Cat Tail",
    3: "Imp Tail",
    4: "Minotaur Tail",
    5: "Daishō",
    6: "Kitsune Tail",
    7: "Zweihänder",
    8: "Skeletal Wings",
    9: "Skeletal Tail",
    10: "Afflicted Spikes",
    11: "Traveler's Pack",
    16: "Gryphon Wings",
    17: "Draconic Wings",
    18: "Butterfly Wings",
    19: "Phoenix Wings",
    20: "Fallen Angel",
    21: "Crystal Wings",
    24: "Aura of the Inner Grove",
    25: "Ancient Orbs",
    26: "Arachnid Legs",
    28: "Cecaelia Tentacles"
}
```

#### Background

```json
{
    0: "Desert",
    2: "Forest",
    4: "Plains",
    6: "Island",
    8: "Swamp",
    10: "Mountains",
    12: "City",
    14: "Arctic"
}
```

#### Hair Style

```json
{
  "male": {
    0: "Battle Hawk",
    1: "Wolf Mane",
    2: "Enchanter",
    3: "Wild Growth",
    4: "Pixel",
    5: "Sunrise",
    6: "Bouffant",
    7: "Agleam Spike",
    8: "Wayfinder",
    9: "Faded Topknot",
    10: "Side Shave",
    11: "Ronin",
    16: "Gruff",
    17: "Rogue Locs",
    18: "Stone Cold",
    19: "Zinra's Tail",
    20: "Hedgehog",
    21: "Delinquent",
    24: "Skegg",
    25: "Shinobi",
    26: "Sanjo",
    28: "Perfect Form"
  },
  
  "female": {
    0: "Windswept",
    1: "Fauna",
    2: "Enchantress",
    3: "Pineapple Top",
    4: "Pixie",
    5: "Darkweave Plait",
    6: "Dejanira",
    7: "Courtly Updo",
    8: "Centaur Tail",
    9: "Lamia",
    10: "Casual Ponytail",
    11: "Wild Ponytail",
    16: "Vogue Locs",
    17: "Twin Vine Loops",
    18: "Sweeping Willow",
    19: "Odango",
    20: "Goddess Locks",
    21: "Lioness",
    24: "Ethereal Waterfall",
    25: "Kunoichi",
    26: "Bowlcut",
    28: "Lunar Light Odango"
  }
}
```

#### Hair Color

```json
{
    0: "#ab9159",
    1: "#af3853",
    2: "#578761",
    3: "#068483",
    4: "#48321e",
    5: "#66489e",
    6: "#ca93a7",
    7: "#62a7e6",
    8: "#c34b1e",
    9: "#326988",
    10: "#513f4f",
    11: "#d48b41",
    16: "#d7bc65",
    17: "#9b68ab",
    18: "#8d6b3a",
    19: "#566377",
    20: "#275435",
    21: "#77b23c",
    24: "#880016",
    25: "#353132",
    26: "#dbfbf5",
    28: "#8f9bb3"
}
```

#### Eye Color

```json
{
    0: "#203997",
    2: "#896693",
    4: "#bb3f55",
    6: "#0d7634",
    8: "#8d7136",
    10: "#613d8a",
    12: "#2494a2",
    14: "#a41e12"
}
```

#### Skin Color

```json
{
    0: "#c58135",
    2: "#f1ca9e",
    4: "#985e1c",
    6: "#57340c",
    8: "#e6a861",
    10: "#7b4a11",
    12: "#e5ac91",
    14: "#aa5c38",
    16: "#7db44f", // Limited: "Plague-Touched"
    18: "#7786b8" // Limited: "Void-Touched"
}
```

#### Appendage Color

The mappings are the same for both `HeadAppendageColor` and `BackAppendageColor`.

```json
{ 
    0: "#c5bfa7",
    1: "#a88b47",
    2: "#58381e",
    3: "#566f7d",
    4: "#2a386d",
    5: "#3f2e40",
    6: "#830e18",
    7: "#6f3a3c",
    8: "#cddef0",
    9: "#df7126",
    10: "#835138",
    11: "#86a637",
    16: "#6b173c",
    17: "#a0304d",
    18: "#78547c",
    19: "#352a51",
    20: "#147256",
    21: "#cf7794",
    24: "#c29d35",
    25: "#211f1f",
    26: "#77b5cf",
    28: "#d7d7d7"
}
```

### Equipment

The Equipment slot enum used to equip and unequip equipment is as follows:

```solidity
enum HeroEquipmentSlot {
    NONE,
    PET,
    PREMIUM_PET,
    WEAPON1,
    WEAPON2,
    OFFHAND1,
    OFFHAND2,
    ARMOR,
    ACCESSORY,
    WEAPON1_VISAGE,
    WEAPON2_VISAGE,
    OFFHAND1_VISAGE,
    OFFHAND2_VISAGE,
    ARMOR_VISAGE,
    ACCESSORY_VISAGE
}
```

### Names

{% file src="/files/sbCKkuLpcRJ1uXrqxUOC" %}

{% file src="/files/HmeQcLJO6k7Qf81uL6o5" %}

{% file src="/files/9KxZEKZZuFA0ul8bvQlD" %}

## Related Contracts

{% content-ref url="/pages/VQipJ4xZiNKOTwnyWJpf" %}
[Hero Summoning](/contracts/summoning/hero-summoning)
{% endcontent-ref %}

{% content-ref url="/pages/xV0olsFwR7e0EhC0FiRB" %}
[Hero Auction](/contracts/sales-and-rentals/hero-auction)
{% endcontent-ref %}

{% content-ref url="/pages/ldDsli8fdYLq1cIxkUoW" %}
[Meditation Circle](/contracts/meditation-circle)
{% endcontent-ref %}

{% content-ref url="/pages/YEcxiXRb3Xtu7SYZb28w" %}
[Flag Storage](/contracts/miscellaneous/flag-storage)
{% endcontent-ref %}


# HeroV4 (Metis)

The Hero contract on Metis uses a separate ABI and interface for Heroes, that is significantly compressed from what is available on other chains.

Additionally, this Diamond contract is bundled with other functions for [PVP Combat](/contracts/pvp-combat), the [Influence/Spectating](/contracts/influence-system) system, Patrols, and [Meditations](/contracts/meditation-circle).

{% hint style="info" %}
While many of the functions and events on this Diamond use the same interface as the standard HeroCore contract, some getters and events on this contract are emitted as packed bits and must be unpacked in order to read their data.
{% endhint %}

## Contract

### Addresses

| Name  | Mainnet                                      | Testnet                                      |
| ----- | -------------------------------------------- | -------------------------------------------- |
| Metis | `0xc7681698B14a2381d9f1eD69FC3D27F33965b53B` | `0xb2bC817C100a6bd60e8bf8a79dBAD607cE9C3cF2` |

### Interfaces

```solidity
interface IHeroV4 {
    // HEROCORE BASE
    // Events
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
    event HeroArrived(uint256 indexed heroId, uint256 arrivalChainId);
    event HeroCreatedV4(address indexed owner, uint256 indexed heroId, tuple(uint256 heroV4Pt1, uint256 heroV4Pt2, uint256 heroV4Pt3, uint256 heroV4Pt4, uint256 heroV4Pt5) hero);
    event HeroLZBridgeReceived(uint32 srcEid, bytes32 sender, address receiver, uint256 heroId);
    event HeroLZBridgeSent(uint32 dstEid, address sender, address receiver, uint256 heroId);
    event HeroSent(uint256 indexed heroId, uint256 arrivalChainId);
    event HeroUpdatedV4(uint256 indexed heroId, tuple(uint256 heroV4Pt1, uint256 heroV4Pt2, uint256 heroV4Pt3, uint256 heroV4Pt4, uint256 heroV4Pt5) hero);
    event HeroUpdatedV4Pt1(uint256 indexed heroId, uint256 heroPt1);
    event HeroUpdatedV4Pt2(uint256 indexed heroId, uint256 heroPt2);
    event HeroUpdatedV4Pt3(uint256 indexed heroId, uint256 heroPt3);
    event HeroUpdatedV4Pt4(uint256 indexed heroId, uint256 heroPt4);
    event HeroUpdatedV4Pt5(uint256 indexed heroId, uint256 heroPt5);
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    // Hero Getters
    function balanceOf(address _owner) view returns (uint256);
    function getApproved(uint256 _tokenId) view returns (address);
    function isApprovedForAll(address _owner, address _operator) view returns (bool);
    function getHero(uint256 _heroId) view returns (tuple(uint256 id, uint256 realmId, uint256 xp, uint256 level, uint256 class, uint256 subclass, uint256 rarity, uint256 summonsRemaining, uint256 hpSmallGrowth, uint256 hpMediumGrowth, uint256 hpLargeGrowth, uint256 equippedSlots, uint256 petId, uint8 state, uint256 strength, uint256 dexterity, uint256 agility, uint256 vitality, uint256 endurance, uint256 intelligence, uint256 wisdom, uint256 luck, uint256 hp, uint256 mp, uint256 baseSTR, uint256 baseDEX, uint256 baseAGI, uint256 baseVIT, uint256 baseEND, uint256 baseINT, uint256 baseWIS, uint256 baseLCK, uint256 baseHP, uint256 baseMP, uint256 lesserCrystals, uint256 regularCrystals, uint256 greaterCrystals, uint256 stoneTier, uint256 levelResets, uint256 resetFrom, uint256 rerollCost, uint256 levelCarryover, bool perilousJourneySurvivor, uint256 strengthPGrowth, uint256 strengthSGrowth, uint256 dexterityPGrowth, uint256 dexteritySGrowth, uint256 agilityPGrowth, uint256 agilitySGrowth, uint256 vitalityPGrowth, uint256 vitalitySGrowth, uint256 endurancePGrowth, uint256 enduranceSGrowth, uint256 intelligencePGrowth, uint256 intelligenceSGrowth, uint256 wisdomPGrowth, uint256 wisdomSGrowth, uint256 luckPGrowth, uint256 luckSGrowth, uint256 mpSmallGrowth, uint256 mpMediumGrowth, uint256 mpLargeGrowth, uint256 weapon1Id, uint256 weapon1VisageId, uint256 weapon2Id, uint256 weapon2VisageId, uint256 offhand1Id, uint256 offhand1VisageId, uint256 offhand2Id, uint256 offhand2VisageId, uint256 armorId, uint256 armorVisageId, uint256 accessoryId, uint256 accessoryVisageId));
    function getHeroState(uint256 _heroId) view returns (tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) heroState);
    function getHeroV4Packed(uint256 _heroId) view returns (tuple(uint256 heroV4Pt1, uint256 heroV4Pt2, uint256 heroV4Pt3, uint256 heroV4Pt4, uint256 heroV4Pt5));
    function getHeroes(uint256[] _heroIds) view returns (tuple(uint256 id, uint256 realmId, uint256 xp, uint256 level, uint256 class, uint256 subclass, uint256 rarity, uint256 summonsRemaining, uint256 hpSmallGrowth, uint256 hpMediumGrowth, uint256 hpLargeGrowth, uint256 equippedSlots, uint256 petId, uint8 state, uint256 strength, uint256 dexterity, uint256 agility, uint256 vitality, uint256 endurance, uint256 intelligence, uint256 wisdom, uint256 luck, uint256 hp, uint256 mp, uint256 baseSTR, uint256 baseDEX, uint256 baseAGI, uint256 baseVIT, uint256 baseEND, uint256 baseINT, uint256 baseWIS, uint256 baseLCK, uint256 baseHP, uint256 baseMP, uint256 lesserCrystals, uint256 regularCrystals, uint256 greaterCrystals, uint256 stoneTier, uint256 levelResets, uint256 resetFrom, uint256 rerollCost, uint256 levelCarryover, bool perilousJourneySurvivor, uint256 strengthPGrowth, uint256 strengthSGrowth, uint256 dexterityPGrowth, uint256 dexteritySGrowth, uint256 agilityPGrowth, uint256 agilitySGrowth, uint256 vitalityPGrowth, uint256 vitalitySGrowth, uint256 endurancePGrowth, uint256 enduranceSGrowth, uint256 intelligencePGrowth, uint256 intelligenceSGrowth, uint256 wisdomPGrowth, uint256 wisdomSGrowth, uint256 luckPGrowth, uint256 luckSGrowth, uint256 mpSmallGrowth, uint256 mpMediumGrowth, uint256 mpLargeGrowth, uint256 weapon1Id, uint256 weapon1VisageId, uint256 weapon2Id, uint256 weapon2VisageId, uint256 offhand1Id, uint256 offhand1VisageId, uint256 offhand2Id, uint256 offhand2VisageId, uint256 armorId, uint256 armorVisageId, uint256 accessoryId, uint256 accessoryVisageId)[]);
    function getHeroesPt1(uint256[] _heroIds) view returns (tuple(uint256 id, uint256 realmId, uint256 xp, uint256 level, uint256 class, uint256 subclass, uint256 rarity, uint256 summonsRemaining, uint256 hpSmallGrowth, uint256 hpMediumGrowth, uint256 hpLargeGrowth, uint256 equippedSlots, uint256 petId, uint8 state)[]);
    function heroExists(uint256 _heroId) view returns (bool);
    function ownerOf(uint256 _tokenId) view returns (address);

    // State-Changing Functions
    function approve(address _approved, uint256 _tokenId) payable;
    function multiTransferHeroAndEquipmentFrom(address _from, address _newOwner, uint256[] heroIds);
    function safeTransferFrom(address _from, address _to, uint256 _tokenId) payable;
    function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes) payable;
    function setApprovalForAll(address _operator, bool _approved);
    function transferFrom(address _from, address _to, uint256 _tokenId) payable;
    function transferHeroAndEquipmentFrom(address _from, address _newOwner, uint256 _heroId);
   
    // EQUIPMENT FUNCTIONS
    // Events
    event HeroEquipmentSetV2(uint256 indexed heroId, tuple(uint256 equippedSlots, uint256 petId, uint128 weapon1Id, uint128 weapon1VisageId, uint128 weapon2Id, uint128 weapon2VisageId, uint128 offhand1Id, uint128 offhand1VisageId, uint128 offhand2Id, uint128 offhand2VisageId, uint128 armorId, uint128 armorVisageId, uint128 accessoryId, uint128 accessoryVisageId) equipment);
    event PetEquipped(uint256 indexed heroId, uint256 indexed petId);
    event PetUnequipped(uint256 indexed heroId, uint256 indexed petId);
   
    // State-Changing Functions
    function changeEquipment(tuple(uint256 heroId, uint256 equipmentId, uint8 slot) _input);
    function changeEquipmentOnBehalf(tuple(uint256 heroId, uint256 equipmentId, uint8 slot) _input, address _account);
    function getHeroEquipmentV2(uint256 _heroId) view returns (tuple(uint256 equippedSlots, uint256 petId, uint128 weapon1Id, uint128 weapon1VisageId, uint128 weapon2Id, uint128 weapon2VisageId, uint128 offhand1Id, uint128 offhand1VisageId, uint128 offhand2Id, uint128 offhand2VisageId, uint128 armorId, uint128 armorVisageId, uint128 accessoryId, uint128 accessoryVisageId));
    function multiChangeEquipment(tuple(uint256 heroId, uint256 equipmentId, uint8 slot)[] _inputs);

    // GOVERNANCE FUNCTIONS
    function getCombinedVotingPower(address _player) view returns (uint256);
    function getVotingPower(address _player, uint256 _votingType) view returns (uint256);
         
}
```

### ABIs

{% file src="/files/Qlo0WbRlefVzNNDjRmd6" %}

{% file src="/files/Qv1tOe7vHjZWDIdXeE2Z" %}

## Types

### HeroV4

```solidity
struct HeroV4 {
    uint256 id;
    uint256 realmId;
    uint256 xp;
    uint256 level;
    uint256 class;
    uint256 subclass;
    uint256 rarity;
    uint256 summonsRemaining; // a value of 11 means Gen0
    uint256 hpSmallGrowth;
    uint256 hpMediumGrowth;
    uint256 hpLargeGrowth;
    uint256 equippedSlots;
    uint256 petId;
    State state;
    uint256 strength;
    uint256 dexterity;
    uint256 agility;
    uint256 vitality;
    uint256 endurance;
    uint256 intelligence;
    uint256 wisdom;
    uint256 luck;
    uint256 hp;
    uint256 mp;
    uint256 baseSTR;
    uint256 baseDEX;
    uint256 baseAGI;
    uint256 baseVIT;
    uint256 baseEND;
    uint256 baseINT;
    uint256 baseWIS;
    uint256 baseLCK;
    uint256 baseHP;
    uint256 baseMP;
    uint256 lesserCrystals;
    uint256 regularCrystals;
    uint256 greaterCrystals;
    uint256 stoneTier;
    uint256 levelResets;
    uint256 resetFrom;
    uint256 rerollCost;
    uint256 levelCarryover; // levelCarryover > 0 means darkSummoned
    bool perilousJourneySurvivor;
    uint256 strengthPGrowth;
    uint256 strengthSGrowth;
    uint256 dexterityPGrowth;
    uint256 dexteritySGrowth;
    uint256 agilityPGrowth;
    uint256 agilitySGrowth;
    uint256 vitalityPGrowth;
    uint256 vitalitySGrowth;
    uint256 endurancePGrowth;
    uint256 enduranceSGrowth;
    uint256 intelligencePGrowth;
    uint256 intelligenceSGrowth;
    uint256 wisdomPGrowth;
    uint256 wisdomSGrowth;
    uint256 luckPGrowth;
    uint256 luckSGrowth;
    uint256 mpSmallGrowth;
    uint256 mpMediumGrowth;
    uint256 mpLargeGrowth;
    uint256 weapon1Id;
    uint256 weapon1VisageId;
    uint256 weapon2Id;
    uint256 weapon2VisageId;
    uint256 offhand1Id;
    uint256 offhand1VisageId;
    uint256 offhand2Id;
    uint256 offhand2VisageId;
    uint256 armorId;
    uint256 armorVisageId;
    uint256 accessoryId;
    uint256 accessoryVisageId;
}
```

### HeroV4Pt1

```solidity
struct HeroV4Pt1 {
    uint256 id;
    uint256 realmId;
    uint256 xp;
    uint256 level;
    uint256 class;
    uint256 subclass;
    uint256 rarity;
    uint256 summonsRemaining;
    uint256 hpSmallGrowth;
    uint256 hpMediumGrowth;
    uint256 hpLargeGrowth;
    uint256 equippedSlots;
    uint256 petId;
    State state;
}
```

{% hint style="info" %}
See [State](#state) for details about this enum value.
{% endhint %}

#### Parsing

Use the following function to parse packed HeroV4Pt1 data:

```javascript
function parseHeroV4Pt1(heroId: string, packedData: string) {
  const h = BigInt(packedData)

  return {
    id: heroId,
    realmId: Number((h >> 248n) & 255n),
    xp: Number((h >> 224n) & 16777215n),
    level: Number((h >> 217n) & 127n),
    class: Number((h >> 212n) & 31n),
    subclass: Number((h >> 207n) & 31n),
    rarity: Number((h >> 204n) & 7n),
    summonsRemaining: Number((h >> 200n) & 15n),
    hpSmallGrowth: Number((h >> 187n) & 8191n),
    hpMediumGrowth: Number((h >> 174n) & 8191n),
    hpLargeGrowth: Number((h >> 161n) & 8191n),
    equippedSlots: Number((h >> 157n) & 15n),
    petId: Number((h >> 115n) & 4398046511103n),
    pvpStatus: Number((h >> 110n) & 31n),
  }
}
```

### HeroV4Pt2

```solidity
struct HeroV4Pt2 {
    uint256 strength;
    uint256 dexterity;
    uint256 agility;
    uint256 vitality;
    uint256 endurance;
    uint256 intelligence;
    uint256 wisdom;
    uint256 luck;
    uint256 hp;
    uint256 mp;
    uint256 baseSTR;
    uint256 baseDEX;
    uint256 baseAGI;
    uint256 baseVIT;
    uint256 baseEND;
    uint256 baseINT;
    uint256 baseWIS;
    uint256 baseLCK;
    uint256 baseHP;
    uint256 baseMP;
    uint256 lesserCrystals;
    uint256 regularCrystals;
    uint256 greaterCrystals;
    uint256 stoneTier;
    uint256 levelResets;
    uint256 resetFrom;
    uint256 rerollCost;
    uint256 levelCarryover;
    bool perilousJourneySurvivor;
}
```

### HeroV4Pt3

```solidity
struct HeroV4Pt3 {
    uint256 strengthPGrowth;
    uint256 strengthSGrowth;
    uint256 dexterityPGrowth;
    uint256 dexteritySGrowth;
    uint256 agilityPGrowth;
    uint256 agilitySGrowth;
    uint256 vitalityPGrowth;
    uint256 vitalitySGrowth;
    uint256 endurancePGrowth;
    uint256 enduranceSGrowth;
    uint256 intelligencePGrowth;
    uint256 intelligenceSGrowth;
    uint256 wisdomPGrowth;
    uint256 wisdomSGrowth;
    uint256 luckPGrowth;
    uint256 luckSGrowth;
    uint256 mpSmallGrowth;
    uint256 mpMediumGrowth;
    uint256 mpLargeGrowth;
}
```

### HeroV4Pt4

```solidity
struct HeroV4Pt4 {
    uint256 weapon1Id;
    uint256 weapon1VisageId;
    uint256 weapon2Id;
    uint256 weapon2VisageId;
    uint256 offhand1Id;
    uint256 offhand1VisageId;
}
```

### HeroV4Pt5

```solidity
struct HeroV4Pt5 {
    uint256 offhand2Id;
    uint256 offhand2VisageId;
    uint256 armorId;
    uint256 armorVisageId;
    uint256 accessoryId;
    uint256 accessoryVisageId;
}
```

### State

This enum represents the Hero's activity status on Metis. It acts in a similar way to `currentQuest` on HeroCoreV3, in that the Hero will be restricted from certain activities when this value is set.

```solidity
enum State {
    IDLE,
    FIGHTING,
    MEDITATING,
    SPECTATING,
    SPECTATOR_FIGHTING,
    SPECTATOR_MEDITATING
}
```


# Equipment

### Contracts

DeFi Kingdoms Equipment NFTs are divided into three contracts:

* [WeaponCore](/nfts/equipment/weapons)
* [ArmorCore](/nfts/equipment/armor)
* [AccessoryCore](/nfts/equipment/accessories)

The first two correspond to Weapon and Armor NFTs, respectively, while AccessoryCore contains data for both Offhand and Accessory Hero Equipment slots.

An additional contract, [CacheCore](/nfts/equipment/cachecore), serves as a container for unopened equipment (from any of the three contracts), similar to Hero Crystals and incubated Pet Eggs.

### Mappings

Mappings that are shared between the contracts are found in [Shared Equipment Mappings](/nfts/equipment/shared-equipment-mappings), while those that are unique to each contract are enumerated with the rest of that contract's data.

### API

Data for NFTs from all three contracts is accessible through the [Community GraphQL API](/api/community-graphql-api).


# Weapons

## Contracts

### Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| DFK Chain | `0x41A73e10B92d6e81D758D74b0c8eB7a8DD3df9a8` | `0x0d75F786ec7D0554311aE3DcA45CF5B9DABE642D` |
| Kaia      | `0x4b5629B044248185bDc2C829AF460D2D9ded0b47` | `0xa87a43B1EB0478512Ff1c62C946f195C1dd8902a` |
| Metis     | `0xA4f8D1b4F8f1363F0FC8d6189089ff068c800AB4` | `0x5e33cd66876dBE739f7Af430559E1CC856a3Ff2d` |

### Interface

```solidity
interface IWeaponCoreDiamond {

    event Approval(address indexed owner, address indexed operator, uint256 indexed tokenId);
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
    event BonusInfoPhysicalAttackUpdated(address indexed owner, uint256 weaponId, (uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 baseDamage, uint8 accuracyRequirement, uint16 pAccuracyAtRequirement, uint8 pScalarStat1, uint8 pScalarStat2, uint8 pScalarStat3, uint8 pScalarValue1, uint8 pScalarValue2, uint8 pScalarValue3, uint16 pScalarMax1, uint16 pScalarMax2, uint16 pScalarMax3, uint16 uniqueSettings, uint8 speedModifier) bonusInfoPhysicalAttack);
    event DisplayInfoMagicAttackUpdated(address indexed owner, uint256 weaponId, (uint8 weaponType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 basePotency, uint8 focusRequirement, uint16 mAccuracyAtRequirement, uint8 mScalarStat1, uint8 mScalarStat2, uint8 mScalarStat3, uint8 mScalarValue1, uint8 mScalarValue2, uint8 mScalarValue3, uint16 mScalarMax1, uint16 mScalarMax2, uint16 mScalarMax3, uint8 restorationCount) displayInfoMagicAttack);
    event StateEnchantmentsUpdated(address indexed owner, uint256 weaponId, (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 WeaponCreated(address indexed owner, uint256 indexed weaponId, (uint256 id, (uint8 weaponType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 basePotency, uint8 focusRequirement, uint16 mAccuracyAtRequirement, uint8 mScalarStat1, uint8 mScalarStat2, uint8 mScalarStat3, uint8 mScalarValue1, uint8 mScalarValue2, uint8 mScalarValue3, uint16 mScalarMax1, uint16 mScalarMax2, uint16 mScalarMax3, uint8 restorationCount) displayInfoMagicAttack, (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, (uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 baseDamage, uint8 accuracyRequirement, uint16 pAccuracyAtRequirement, uint8 pScalarStat1, uint8 pScalarStat2, uint8 pScalarStat3, uint8 pScalarValue1, uint8 pScalarValue2, uint8 pScalarValue3, uint16 pScalarMax1, uint16 pScalarMax2, uint16 pScalarMax3, uint16 uniqueSettings, uint8 speedModifier) bonusInfoPhysicalAttack) weapon);
    event WeaponUpdated(address indexed owner, uint256 indexed weaponId, (uint256 id, (uint8 weaponType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 basePotency, uint8 focusRequirement, uint16 mAccuracyAtRequirement, uint8 mScalarStat1, uint8 mScalarStat2, uint8 mScalarStat3, uint8 mScalarValue1, uint8 mScalarValue2, uint8 mScalarValue3, uint16 mScalarMax1, uint16 mScalarMax2, uint16 mScalarMax3, uint8 restorationCount) displayInfoMagicAttack, (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, (uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 baseDamage, uint8 accuracyRequirement, uint16 pAccuracyAtRequirement, uint8 pScalarStat1, uint8 pScalarStat2, uint8 pScalarStat3, uint8 pScalarValue1, uint8 pScalarValue2, uint8 pScalarValue3, uint16 pScalarMax1, uint16 pScalarMax2, uint16 pScalarMax3, uint16 uniqueSettings, uint8 speedModifier) bonusInfoPhysicalAttack) weapon);

    // View Functions
    function balanceOf(address account) view returns (uint256);
    function getApproved(uint256 tokenId) view returns (address);
    function getStateEnchantments(uint256 _id) view returns ((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 getUserWeaponIds(address _address) view returns (uint256[]);
    function getUserWeapons(address _address) view returns ((uint256 id, (uint8 weaponType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 basePotency, uint8 focusRequirement, uint16 mAccuracyAtRequirement, uint8 mScalarStat1, uint8 mScalarStat2, uint8 mScalarStat3, uint8 mScalarValue1, uint8 mScalarValue2, uint8 mScalarValue3, uint16 mScalarMax1, uint16 mScalarMax2, uint16 mScalarMax3, uint8 restorationCount) displayInfoMagicAttack, (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, (uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 baseDamage, uint8 accuracyRequirement, uint16 pAccuracyAtRequirement, uint8 pScalarStat1, uint8 pScalarStat2, uint8 pScalarStat3, uint8 pScalarValue1, uint8 pScalarValue2, uint8 pScalarValue3, uint16 pScalarMax1, uint16 pScalarMax2, uint16 pScalarMax3, uint16 uniqueSettings, uint8 speedModifier) bonusInfoPhysicalAttack)[]);
    function getWeapon(uint256 _id) view returns ((uint256 id, (uint8 weaponType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 basePotency, uint8 focusRequirement, uint16 mAccuracyAtRequirement, uint8 mScalarStat1, uint8 mScalarStat2, uint8 mScalarStat3, uint8 mScalarValue1, uint8 mScalarValue2, uint8 mScalarValue3, uint16 mScalarMax1, uint16 mScalarMax2, uint16 mScalarMax3, uint8 restorationCount) displayInfoMagicAttack, (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, (uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 baseDamage, uint8 accuracyRequirement, uint16 pAccuracyAtRequirement, uint8 pScalarStat1, uint8 pScalarStat2, uint8 pScalarStat3, uint8 pScalarValue1, uint8 pScalarValue2, uint8 pScalarValue3, uint16 pScalarMax1, uint16 pScalarMax2, uint16 pScalarMax3, uint16 uniqueSettings, uint8 speedModifier) bonusInfoPhysicalAttack));
    function getWeapons(uint256[] _ids) view returns ((uint256 id, (uint8 weaponType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 basePotency, uint8 focusRequirement, uint16 mAccuracyAtRequirement, uint8 mScalarStat1, uint8 mScalarStat2, uint8 mScalarStat3, uint8 mScalarValue1, uint8 mScalarValue2, uint8 mScalarValue3, uint16 mScalarMax1, uint16 mScalarMax2, uint16 mScalarMax3, uint8 restorationCount) displayInfoMagicAttack, (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, (uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 baseDamage, uint8 accuracyRequirement, uint16 pAccuracyAtRequirement, uint8 pScalarStat1, uint8 pScalarStat2, uint8 pScalarStat3, uint8 pScalarValue1, uint8 pScalarValue2, uint8 pScalarValue3, uint16 pScalarMax1, uint16 pScalarMax2, uint16 pScalarMax3, uint16 uniqueSettings, uint8 speedModifier) bonusInfoPhysicalAttack)[]);
    function isApprovedForAll(address account, address operator) view returns (bool);
    function name() view returns (string);
    function ownerOf(uint256 tokenId) view returns (address);
    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 validateEquipmentVisageTypeMatch(uint256 _equipmentId, uint256 _visageId) view returns (bool);
    function validateEquipping((uint256 id, (uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, (uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, (uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, (uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, (uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, (uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, (uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing, uint16 craft1, uint16 craft2) professions, (uint256 equippedSlots, uint256 petId, uint128 weapon1Id, uint128 weapon1VisageId, uint128 weapon2Id, uint128 weapon2VisageId, uint128 offhand1Id, uint128 offhand1VisageId, uint128 offhand2Id, uint128 offhand2VisageId, uint128 armorId, uint128 armorVisageId, uint128 accessoryId, uint128 accessoryVisageId) equipment) _hero, uint256 _equipmentId, uint8 _slot) view returns (bool);

    // State-Changing Functions
    function approve(address operator, uint256 tokenId) payable;
    function safeTransferFrom(address from, address to, uint256 tokenId) payable;
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) payable;
    function setApprovalForAll(address operator, bool status);
    function transferFrom(address from, address to, uint256 tokenId) payable;

}
```

### ABI

{% file src="/files/9C2vzwhE0m4qGHWLmol2" %}

{% file src="/files/vx3Loli2HagJyCHZYaUO" %}

## Types

### Weapon

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

```solidity
struct Weapon {
    uint256 id;
    DisplayInfoMagicAttack displayInfoMagicAttack;
    StateEnchantments stateEnchantments;
    BonusInfoPhysicalAttack bonusInfoPhysicalAttack;
}
```

### DisplayInfoMagicAttack

```solidity
struct DisplayInfoMagicAttack {
    WeaponType weaponType;
    uint16 displayId;
    uint8 rarity;
    uint64 craftedBy;
    uint8 dye1;
    uint8 dye2;
    uint16 basePotency;
    uint8 focusRequirement;
    uint16 mAccuracyAtRequirement;
    uint8 mScalarStat1;
    uint8 mScalarStat2;
    uint8 mScalarStat3;
    uint8 mScalarValue1;
    uint8 mScalarValue2;
    uint8 mScalarValue3;
    uint16 mScalarMax1;
    uint16 mScalarMax2;
    uint16 mScalarMax3;
    uint8 restorationCount;
}
```

<table data-full-width="true"><thead><tr><th width="267.3333333333333">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>weaponType</code></strong></td><td><a href="#weapontype"><code>WeaponType</code></a></td><td>The numeric ID defining the weapon type (e.g. <code>1</code> = One-Handed Axe, etc.)</td></tr><tr><td><strong><code>displayId</code></strong></td><td><code>uint16</code></td><td>Defines the item's base appearance</td></tr><tr><td><strong><code>rarity</code></strong></td><td><code>uint16</code></td><td>The item's rarity (<code>0</code>-<code>12</code>). See <a href="/pages/hWGZbJUj7sUW8SapAXIm#rarity">Rarity</a>.</td></tr><tr><td><strong><code>craftedBy</code></strong></td><td><code>uint64</code></td><td>The Hero ID of the crafting Hero, or a unique ID for dropped items. See <a href="/pages/hWGZbJUj7sUW8SapAXIm#craftedby">CraftedBy</a>.</td></tr><tr><td><strong><code>dye1</code></strong></td><td><code>uint8</code></td><td>A unique mapping indicating the primary color variation for some items (<code>0</code> = no dye). See <a href="/pages/hWGZbJUj7sUW8SapAXIm#dye1">Dye1</a>.</td></tr><tr><td><strong><code>dye2</code></strong></td><td><code>uint8</code></td><td>A unique mapping indicating the secondary color variation for some items (<code>0</code> = no dye). See <a href="/pages/hWGZbJUj7sUW8SapAXIm#dye2">Dye2</a>.</td></tr><tr><td><strong><code>basePotency</code></strong></td><td><code>uint16</code></td><td>The base <code>Potency</code> of the weapon</td></tr><tr><td><strong><code>focusRequirement</code></strong></td><td><code>uint8</code></td><td>The required <code>Focus</code> for a Hero to meet the base Magical Accuracy of the weapon (one-decimal precision)</td></tr><tr><td><strong><code>mAccuracyAtRequirement</code></strong></td><td><code>uint8</code></td><td>The base Magical Accuracy of the weapon when the Hero meets the given <code>focusRequirement</code> (one-decimal precision)</td></tr><tr><td><strong><code>mScalarStat1</code></strong></td><td><code>uint8</code></td><td>Magical damage Scalar Stat mapping (<code>0</code> = <code>none</code>)</td></tr><tr><td><strong><code>mScalarStat2</code></strong></td><td><code>uint8</code></td><td>Magical damage Scalar Stat mapping (<code>0</code> = <code>none</code>)</td></tr><tr><td><strong><code>mScalarStat3</code></strong></td><td><code>uint8</code></td><td>Magical damage Scalar Stat mapping (<code>0</code> = <code>none</code>)</td></tr><tr><td><strong><code>mScalarValue1</code></strong></td><td><code>uint8</code></td><td>The scalar value for <code>mScalarStat1</code> (one-decimal precision multiplier, e.g. <code>5</code> = <code>0.5x</code>)</td></tr><tr><td><strong><code>mScalarValue2</code></strong></td><td><code>uint8</code></td><td>The scalar value for <code>mScalarStat2</code> (one-decimal precision multiplier, e.g. <code>5</code> = <code>0.5x</code>)</td></tr><tr><td><strong><code>mScalarValue3</code></strong></td><td><code>uint8</code></td><td>The scalar value for <code>mScalarStat3</code> (one-decimal precision multiplier, e.g. <code>5</code> = <code>0.5x</code>)</td></tr><tr><td><strong><code>mScalarMax1</code></strong></td><td><code>uint16</code></td><td>The maximum value that can be obtained from the Hero's <code>mScalarStat1 * mScalarValue1</code> </td></tr><tr><td><strong><code>mScalarMax2</code></strong></td><td><code>uint16</code></td><td>The maximum value that can be obtained from the Hero's <code>mScalarStat2 * mScalarValue2</code> </td></tr><tr><td><strong><code>mScalarMax3</code></strong></td><td><code>uint16</code></td><td>The maximum value that can be obtained from the Hero's <code>mScalarStat3 * mScalarValue3</code> </td></tr><tr><td><strong><code>restorationCount</code></strong></td><td><code>uint8</code></td><td>The number of times the item's <code>remainingRepairs</code> have been restored</td></tr></tbody></table>

### StateEnchantments

```solidity
struct StateEnchantments {
    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;
}
```

<table data-full-width="true"><thead><tr><th width="267.3333333333333">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>equippedTo</code></strong></td><td><code>uint64</code></td><td>The Hero ID of the Hero that the item is equipped to</td></tr><tr><td><strong><code>equippableAt</code></strong></td><td><code>uint64</code></td><td>The Unix timestamp when the item is next equippable</td></tr><tr><td><strong><code>maxDurability</code></strong></td><td><code>uint16</code></td><td>The maximum durability of the item</td></tr><tr><td><strong><code>durability</code></strong></td><td><code>uint16</code></td><td>The current durability of the item</td></tr><tr><td><strong><code>maxRepairs</code></strong></td><td><code>uint8</code></td><td>The maximum number of repairs for the item</td></tr><tr><td><strong><code>remainingRepairs</code></strong></td><td><code>uint8</code></td><td>The remaining number of repairs for the item</td></tr><tr><td><strong><code>equipRequirement</code></strong></td><td><code>uint8</code></td><td>The Strength requirement to equip the item</td></tr><tr><td><strong><code>enchantmentType1</code></strong></td><td><code>uint8</code></td><td><p>A mapping of the enchantment type:</p><ul><li><code>0</code> = no enchantment slot available</li><li><code>1</code> = empty enchantment slot</li></ul></td></tr><tr><td><strong><code>enchantmentType2</code></strong></td><td><code>uint8</code></td><td><p>A mapping of the enchantment type:</p><ul><li><code>0</code> = no enchantment slot available</li><li><code>1</code> = empty enchantment slot</li></ul></td></tr><tr><td><strong><code>enchantmentType3</code></strong></td><td><code>uint8</code></td><td><p>A mapping of the enchantment type:</p><ul><li><code>0</code> = no enchantment slot available</li><li><code>1</code> = empty enchantment slot</li></ul></td></tr><tr><td><strong><code>enchantmentScalar1</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding enchantment</td></tr><tr><td><strong><code>enchantmentScalar2</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding enchantment</td></tr><tr><td><strong><code>enchantmentScalar3</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding enchantment</td></tr></tbody></table>

### BonusInfoPhysicalAttack

```solidity
struct BonusInfoPhysicalAttack {
    uint8 bonus1;
    uint8 bonus2;
    uint8 bonus3;
    uint8 bonus4;
    uint16 bonusScalar1;
    uint16 bonusScalar2;
    uint16 bonusScalar3;
    uint16 bonusScalar4;
    uint16 baseDamage;
    uint8 accuracyRequirement;
    uint16 pAccuracyAtRequirement;
    uint8 pScalarStat1;
    uint8 pScalarStat2;
    uint8 pScalarStat3;
    uint8 pScalarValue1;
    uint8 pScalarValue2;
    uint8 pScalarValue3;
    uint16 pScalarMax1;
    uint16 pScalarMax2;
    uint16 pScalarMax3;
    uint16 uniqueSettings;
    uint8 speedModifier;
}
```

<table data-full-width="true"><thead><tr><th width="267.3333333333333">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>bonus1</code></strong></td><td><code>uint8</code></td><td>A mapping of an item bonus ID (<code>0</code> = no bonus)</td></tr><tr><td><strong><code>bonus2</code></strong></td><td><code>uint8</code></td><td>A mapping of an item bonus ID (<code>0</code> = no bonus)</td></tr><tr><td><strong><code>bonus3</code></strong></td><td><code>uint8</code></td><td>A mapping of an item bonus ID (<code>0</code> = no bonus)</td></tr><tr><td><strong><code>bonus4</code></strong></td><td><code>uint8</code></td><td>A mapping of an item bonus ID (<code>0</code> = no bonus)</td></tr><tr><td><strong><code>bonus1Scalar</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding bonus</td></tr><tr><td><strong><code>bonus2Scalar</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding bonus</td></tr><tr><td><strong><code>bonus3Scalar</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding bonus</td></tr><tr><td><strong><code>bonus4Scalar</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding bonus</td></tr><tr><td><strong><code>baseDamage</code></strong></td><td><code>uint16</code></td><td>The base damage of the weapon</td></tr><tr><td><strong><code>accuracyRequirement</code></strong></td><td><code>uint8</code></td><td>The required <code>Accuracy</code> for a Hero to meet the base Physical Accuracy of the weapon (one-decimal precision)</td></tr><tr><td><strong><code>pAccuracyAtRequirement</code></strong></td><td><code>uint16</code></td><td>The base Accuracy of the weapon when the Hero meets the given <code>accuracyRequirement</code> (one-decimal precision)</td></tr><tr><td><strong><code>pScalarStat1</code></strong></td><td><code>uint16</code></td><td>Physical damage Scalar Stat mapping (<code>0</code> = <code>none</code>)</td></tr><tr><td><strong><code>pScalarStat2</code></strong></td><td><code>uint16</code></td><td>Physical damage Scalar Stat mapping (<code>0</code> = <code>none</code>)</td></tr><tr><td><strong><code>pScalarStat3</code></strong></td><td><code>uint16</code></td><td>Physical damage Scalar Stat mapping (<code>0</code> = <code>none</code>)</td></tr><tr><td><strong><code>pScalarValue1</code></strong></td><td><code>uint8</code></td><td>The scalar value for <code>pScalarStat1</code> (one-decimal precision multiplier, e.g. <code>5</code> = <code>0.5x</code>)</td></tr><tr><td><strong><code>pScalarValue2</code></strong></td><td><code>uint8</code></td><td>The scalar value for <code>pScalarStat2</code> (one-decimal precision multiplier, e.g. <code>5</code> = <code>0.5x</code>)</td></tr><tr><td><strong><code>pScalarValue3</code></strong></td><td><code>uint8</code></td><td>The scalar value for <code>pScalarStat3</code> (one-decimal precision multiplier, e.g. <code>5</code> = <code>0.5x</code>)</td></tr><tr><td><strong><code>pScalarMax1</code></strong></td><td><code>uint8</code></td><td>The maximum value that can be obtained from the Hero's <code>pScalarStat1 * pScalarValue1</code> </td></tr><tr><td><strong><code>pScalarMax2</code></strong></td><td><code>uint8</code></td><td>The maximum value that can be obtained from the Hero's <code>pScalarStat2 * pScalarValue2</code> </td></tr><tr><td><strong><code>pScalarMax3</code></strong></td><td><code>uint8</code></td><td>The maximum value that can be obtained from the Hero's <code>pScalarStat3 * pScalarValue3</code> </td></tr><tr><td><strong><code>uniqueSettings</code></strong></td><td><code>uint16</code></td><td>Currently unused</td></tr><tr><td><strong><code>speedModifier</code></strong></td><td><code>uint8</code></td><td>Modifies the Hero's <code>speed</code> by the given percent While wielding the Weapon. Zero-decimal precision with range of -128% to 128%.<br><br>Conversion logic is: <code>(1 - 2 * floor(speedModifier / 128)) * (speedModifier % 128)</code>.</td></tr></tbody></table>

### WeaponType

```solidity
enum WeaponType {
    None,
    OneHandedAxe,
    TwoHandedAxe,
    Bow,
    Dagger,
    Gloves,
    OneHandedMace,
    TwoHandedMace,
    OneHandedSpear,
    TwoHandedSpear,
    Staff,
    OneHandedSword,
    TwoHandedSword,
    Wand
}
```

<table data-full-width="true"><thead><tr><th width="191.33333333333331">Name</th><th width="90">Value</th><th width="186">Description</th><th width="85" data-type="number">Hands</th><th>Usable By</th></tr></thead><tbody><tr><td><strong><code>None</code></strong></td><td><code>0</code></td><td>None (unused)</td><td>0</td><td>N/A</td></tr><tr><td><strong><code>OneHandedAxe</code></strong></td><td><code>1</code></td><td>One-Handed Axe</td><td>1</td><td><ul><li>Pirate</li><li>Warrior</li></ul></td></tr><tr><td><strong><code>TwoHandedAxe</code></strong></td><td><code>2</code></td><td>Two-Handed Axe</td><td>2</td><td><ul><li>Berserker</li><li>DarkKnight</li><li>DreadKnight</li><li>Warrior</li></ul></td></tr><tr><td><strong><code>Bow</code></strong></td><td><code>3</code></td><td>Bow</td><td>2</td><td><ul><li>Archer</li><li>Bard</li><li>SpellBow</li></ul></td></tr><tr><td><strong><code>Dagger</code></strong></td><td><code>4</code></td><td>Dagger</td><td>1</td><td><ul><li>Bard</li><li>Ninja</li><li>Pirate</li><li>Thief</li><li>Warrior</li></ul></td></tr><tr><td><strong><code>Gloves</code></strong></td><td><code>5</code></td><td>Gloves</td><td>2</td><td><ul><li>Monk</li><li>Shapeshifter</li></ul></td></tr><tr><td><strong><code>OneHandedMace</code></strong></td><td><code>6</code></td><td>One-Handed Mace</td><td>1</td><td><ul><li>Knight</li><li>Paladin</li><li>Pirate</li><li>Priest</li><li>Warrior</li></ul></td></tr><tr><td><strong><code>TwoHandedMace</code></strong></td><td><code>7</code></td><td>Two-Handed Mace</td><td>2</td><td><ul><li>Berserker</li><li>DarkKnight</li><li>DreadKnight</li><li>Paladin</li><li>Warrior</li></ul></td></tr><tr><td><strong><code>OneHandedSpear</code></strong></td><td><code>8</code></td><td>One-Handed Spear</td><td>1</td><td><ul><li>Legionnaire</li></ul></td></tr><tr><td><strong><code>TwoHandedSpear</code></strong></td><td><code>9</code></td><td>Two-Handed Spear</td><td>2</td><td><ul><li>Dragoon</li></ul></td></tr><tr><td><strong><code>Staff</code></strong></td><td><code>10</code></td><td>Staff</td><td>2</td><td><ul><li>Priest</li><li>Sage</li><li>Summoner</li><li>Wizard</li></ul></td></tr><tr><td><strong><code>OneHandedSword</code></strong></td><td><code>11</code></td><td>One-Handed Sword</td><td>1</td><td><ul><li>Bard</li><li>Knight</li><li>Ninja</li><li>Paladin</li><li>Pirate</li><li>Warrior</li></ul></td></tr><tr><td><strong><code>TwoHandedSword</code></strong></td><td><code>12</code></td><td>Two-Handed Sword</td><td>2</td><td><ul><li>Berserker</li><li>DarkKnight</li><li>DreadKnight</li><li>Paladin</li><li>Warrior</li></ul></td></tr><tr><td><strong><code>Wand</code></strong></td><td><code>13</code></td><td>Wand</td><td>1</td><td><ul><li>Sage</li><li>Scholar</li><li>Seer</li><li>Summoner</li><li>Wizard</li></ul></td></tr></tbody></table>

## Mappings

### Weapon Details

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

```json
{
  "2": {
    "1": {
      "name": "Gore Axe",
      "description": "A formidable axe fashioned from the spine and rib cage of a mighty boar."
    },
    "2": {
      "name": "Savage Axe",
      "description": "A double blade made from battlefield salvage and attached to a bedpost."
    },
    "3": {
      "name": "Bronze Half-Moon Axe",
      "description": "A peculiar bronze great-axe that is conveniently shaped for digging graves..."
    },
    "4": {
      "name": "Squire's Halbard",
      "description": "A favorite for castle-guards, the giant halberd doubles as a combat deterrant."
    },
    "5": {
      "name": "Leviathan's Rage",
      "description": "A massive coral cleaver that hums with ancient fury."
    },
    "50000": {
      "name": "Miner's Pickaxe",
      "description": "You can pick your friends. You can pick your foes. And with this sturdy weapon, you can even pickaxe your friend's foes!"
    }
  },
  "3": {
    "1": {
      "name": "Gore Bow",
      "description": "A crude recurve bow fashioned from the bones of a mighty boar."
    },
    "2": {
      "name": "Stick 'n String",
      "description": "A crude branch-bow with leaves (and berries?) still attached. Blubs beware!"
    },
    "3": {
      "name": "Maple Longbow",
      "description": "A stiff bow made of treated maple wood. A bun-hunter's dream!"
    },
    "4": {
      "name": "Squire's Recurve Bow",
      "description": "A standard military-issue recurve bow, strung to provide additonal energy on release."
    },
    "5": {
      "name": "Gore Longbow",
      "description": "A crude recurve longbow fashioned from the bones of a mighty boar."
    },
    "6": {
      "name": "Farstriker",
      "description": "A gilded composite bow crafted from Submersian Coral."
    }
  },
  "4": {
    "1": {
      "name": "Flint Knife",
      "description": "Technically a knife, but more accurately a bit of sharp flint attached to a handle with string."
    },
    "2": {
      "name": "Bronze Gladius",
      "description": "A bronze small-sword. A popular weapon for gladiators."
    },
    "3": {
      "name": "Squire's Dagger",
      "description": "A handy iron dagger designed sturdy for parrying and stabbing."
    },
    "4": {
      "name": "Ripfang",
      "description": "A razor-sharp Submersian Coral dagger with an edge that never dulls."
    },
    "50000": {
      "name": "Gardening Trowel",
      "description": "This perfectly balanced gardening trowel has been sharpened to a fine point. Dig a hole and bury your enemies in the dirt!"
    }
  },
  "5": {
    "1": {
      "name": "Wooden Knuckles",
      "description": "Protect your fists with something slightly softer than your fists!"
    },
    "2": {
      "name": "Bronze Caesti",
      "description": "Heavy bronze plated gloves reinforced for punching armor."
    },
    "3": {
      "name": "Squire's Gloves",
      "description": "Comfortable fitted gloves with sharpened iron knuckle reinforcements."
    }
  },
  "6": {
    "1": {
      "name": "Driftwood Shillelagh",
      "description": "Colloquially known as a bonk-stick, it gets the job done... if the job is bonking."
    },
    "2": {
      "name": "Maple Club",
      "description": "A favorite among trolodytes and goblins."
    },
    "3": {
      "name": "Squire's Mace",
      "description": "A hard iron mace designed to concuss beasts and men alike."
    },
    "4": {
      "name": "Claw Cudgel",
      "description": "The repurposed claw of a lumbering crusted crab. It smells... buttery?"
    },
    "5": {
      "name": "Deepmaul",
      "description": "A wicked mace barbed with razor-sharp Submersian Coral."
    }
  },
  "8": {
    "1": {
      "name": "Sharpened Stick",
      "description": "It's a stick. Try not to poke your eye out."
    },
    "2": {
      "name": "Bronze Shortspear",
      "description": "A bronze bladed spear that can be easily wielded with a shield."
    },
    "3": {
      "name": "Squire's Light Spear",
      "description": "A sharp tipped iron shortspear that is light enough to use with one hand."
    }
  },
  "9": {
    "1": {
      "name": "Driftwood Pike",
      "description": "Someone has sharpened a shabby piece of driftwood for some reason."
    },
    "2": {
      "name": "Bronze Longspear",
      "description": "A bronze spear with a triangular blade. Long enough to get the job done."
    },
    "3": {
      "name": "Squire's Heavy Spear",
      "description": "An iron longspear that really helps get your point across."
    }
  },
  "10": {
    "1": {
      "name": "Gore Staff",
      "description": "A long and savage staff fashioned out of several bones bound with tanned leather."
    },
    "2": {
      "name": "Gnarled Staff",
      "description": "A long knobby tree branch that has been whittled down and taped for comfort."
    },
    "3": {
      "name": "Maple Staff",
      "description": "A wooden staff that forks to hold an orb of natural peridot. Great for beginners!"
    },
    "4": {
      "name": "Squire's Staff",
      "description": "A sturdy staff with metal embellishments and topped with an amethyst focus."
    },
    "5": {
      "name": "Corrupted Staff",
      "description": "A gnarled branch wrapped in the luminescent tentacle of some corrupted eldritch horror."
    },
    "6": {
      "name": "Sirensong",
      "description": "A staff with a massive lustrous pearl mounted in Submersian Coral."
    },
    "50000": {
      "name": "Walking Stick",
      "description": "A sturdy and perfectly balanced oak walking stick. An essential accessory for lengthy foraging trips or fighting off territorial basilisks."
    }
  },
  "11": {
    "1": {
      "name": "Gore Blade",
      "description": "A blade fashioned from the sharpened rib bone of a massive boar."
    },
    "2": {
      "name": "Toy Sword",
      "description": "A hastily assembled dull wooden sword. Strikes fear into schoolyard bullies!"
    },
    "3": {
      "name": "Bronze Spatha",
      "description": "A broad blade of bronze with a heavy pommel and good balance."
    },
    "4": {
      "name": "Squire's Sword",
      "description": "A plain looking iron longsword with a crossguard."
    },
    "5": {
      "name": "Coralbrand",
      "description": "An ornate one-handed blade made from fine Submersian Coral."
    },
    "50000": {
      "name": "Fishing Rod",
      "description": "A sleek fishing rod designed for two purposes: catching fish and kicking ass. And you already caught all the fish."
    }
  },
  "12": {
    "1": {
      "name": "Eggscalibur",
      "description": "A finely crafted greatsword fashioned from the sturdy, sharpened feathers of a hardened rocboc."
    },
    "2": {
      "name": "Igneous Butcher",
      "description": "As a joke someone has attached a boulder to a sword hilt. Hard to swing."
    },
    "3": {
      "name": "Bronze Greatsword",
      "description": "An extremely heavy bronze blade forged in a single mold, blade and all."
    },
    "4": {
      "name": "Squire's Greatsword",
      "description": "A well-crafted iron claymore. The handle is long enough to hold in both hands."
    },
    "5": {
      "name": "Living Blade",
      "description": "A massive blade purloined from the remains of a now very dead suit of armor."
    },
    "6": {
      "name": "Tidecleaver",
      "description": "A colossal blade made from venomous Submersian Coral."
    }
  },
  "13": {
    "1": {
      "name": "Demon's Drumstick",
      "description": "A true oddity of craftsmanship that is equally mouth-watering and powerful."
    },
    "2": {
      "name": "Gnarled Wand",
      "description": "A suspicious wand. Why do all the nearby trees seem so bare?"
    },
    "3": {
      "name": "Maple Wand",
      "description": "A lacquered maple branch fitted with a small peridot for focusing magic."
    },
    "4": {
      "name": "Squire's Wand",
      "description": "An amethyst topped wand. It looks sturdy."
    },
    "5": {
      "name": "Hydra's Gaze",
      "description": "A pearl-topped wand made from Submersian Coral."
    }
  }
}

```

### Weapon Bonuses

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

```json
{
    1: "Gain X% chance to inflict Banish on hit",
    2: "Gain X% chance to inflict Bleed on hit",
    3: "Gain X% chance to inflict Blind on hit",
    4: "Gain X% chance to inflict Burn on hit",
    5: "Gain X% chance to inflict Chill on hit",
    6: "Gain X% chance to inflict Confuse on hit",
    7: "Gain X% chance to inflict Daze on hit",
    8: "Gain X% chance to inflict Disarm on hit",
    9: "Gain X% chance to inflict Fear on hit",
    10: "Gain X% chance to inflict Intimidate on hit",
    11: "Gain X% chance to inflict Poison on hit",
    12: "Gain X% chance to inflict Pull on hit",
    13: "Gain X% chance to inflict Push on hit",
    14: "Gain X% chance to inflict Silence on hit",
    15: "Gain X% chance to inflict Sleep on hit",
    16: "Gain X% chance to inflict Slow on hit",
    17: "Gain X% chance to inflict Stun on hit",
    18: "Gain X% chance to inflict Taunt on hit",
    19: "Gain X% chance to inflict Daze on basic attack when targeting a channeling enemy",
    20: "Increase Block chance by +X%",
    21: "Increase Spell Block chance by +X%",
    22: "Increase Critical Hit damage multiplier by +X",
    23: "Increase Critical Hit chance by +X%",
    24: "Critical Hits gain X% Lifesteal",
    25: "Gain X% Pierce",
    26: "Increase Block damage reduction by X%",
    27: "Increase Spell Block damage reduction by X%",
    28: "Increase Magical Damage dealt and reduce Healing Potency by X% each",
    29: "Increase Healing Potency and reduce Magical Damage dealt by X% each",
    30: "Decrease Physical and Magical Defense by X% each",
    31: "Decrease Healing Potency by X%",
    32: "Increase Magical Damage by X%",
    33: "Increase Physical Damage by X%",
    34: "Gain X% chance to Retaliate 1 upon receiving damage.",
    35: "Gain X% chance to Retaliate 1 upon receiving physical damage.",
    36: "Gain X% chance to Retaliate 1 upon receiving magical damage.",
    37: "Critical Hits gain X% chance to inflict Bleed",
    38: "Critical Hits gain X% chance to inflict Poison",
    39: "Critical Hits gain X% chance to inflict Daze",
    40: "Critical Heals gain X% chance to Cleanse",
    41: "Increase Critical Heal chance by +X%"
}
```

## See Also

{% content-ref url="/pages/hWGZbJUj7sUW8SapAXIm" %}
[Shared Equipment Mappings](/nfts/equipment/shared-equipment-mappings)
{% endcontent-ref %}


# Armor

## Contracts

### Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| DFK Chain | `0xE60480B4083cA9F4d07034Eb30Bc7894114adAC1` | `0x630706B99c053C727094C952ca685637dFE89c0a` |
| Kaia      | `0x8740c7509dC22Fc1a2e1Da7d0067A563E4A66f63` | `0xF7dD05C65537Bb289Ecd737868b4dc978569cc1F` |
| Metis     | `0x4Bc4BBDF294eeb3017FB4bD7806b6D61D74e85bb` | `0x7Cb74b35eeE262ca1960E67Dcac6fd47ECbbA6bF` |

### Interface

```solidity
interface IArmorCoreDiamond {

    // Events
    event Approval(address indexed owner, address indexed operator, uint256 indexed tokenId);
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
    event ArmorCreated(address indexed owner, uint256 indexed armorId, tuple(uint256 id, tuple(uint8 armorType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 rawPhysDefense, uint16 physDefScalar, uint16 pDefScalarMax, uint16 rawMagicDefense, uint16 magicDefScalar, uint16 mDefScalarMax, uint16 evasion, uint16 spare1, uint16 spare2) displayDefenseInfo, 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, tuple(uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount, uint16 misc1, uint32 misc2, uint32 misc3, uint32 misc4) bonusInfoExtras) armor);
    event ArmorUpdated(address indexed owner, uint256 indexed armorId, tuple(uint256 id, tuple(uint8 armorType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 rawPhysDefense, uint16 physDefScalar, uint16 pDefScalarMax, uint16 rawMagicDefense, uint16 magicDefScalar, uint16 mDefScalarMax, uint16 evasion, uint16 spare1, uint16 spare2) displayDefenseInfo, 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, tuple(uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount, uint16 misc1, uint32 misc2, uint32 misc3, uint32 misc4) bonusInfoExtras) armor);
    event BonusInfoExtrasUpdated(address indexed owner, uint256 armorId, tuple(uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount, uint16 misc1, uint32 misc2, uint32 misc3, uint32 misc4) bonusInfoExtras);
    event DisplayDefenseInfoUpdated(address indexed owner, uint256 armorId, tuple(uint8 armorType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 rawPhysDefense, uint16 physDefScalar, uint16 pDefScalarMax, uint16 rawMagicDefense, uint16 magicDefScalar, uint16 mDefScalarMax, uint16 evasion, uint16 spare1, uint16 spare2) displayDefenseInfo);
    event Paused(address account);
    event StateEnchantmentsUpdated(address indexed owner, uint256 armorId, 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 getApproved(uint256 tokenId) view returns (address);
    function getArmor(uint256 _id) view returns (tuple(uint256 id, tuple(uint8 armorType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 rawPhysDefense, uint16 physDefScalar, uint16 pDefScalarMax, uint16 rawMagicDefense, uint16 magicDefScalar, uint16 mDefScalarMax, uint16 evasion, uint16 spare1, uint16 spare2) displayDefenseInfo, 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, tuple(uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount, uint16 misc1, uint32 misc2, uint32 misc3, uint32 misc4) bonusInfoExtras));
    function getArmors(uint256[] _ids) view returns (tuple(uint256 id, tuple(uint8 armorType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 rawPhysDefense, uint16 physDefScalar, uint16 pDefScalarMax, uint16 rawMagicDefense, uint16 magicDefScalar, uint16 mDefScalarMax, uint16 evasion, uint16 spare1, uint16 spare2) displayDefenseInfo, 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, tuple(uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount, uint16 misc1, uint32 misc2, uint32 misc3, uint32 misc4) bonusInfoExtras)[]);
    function getEquipmentBytes(uint256 _id) view returns (tuple(uint256 id, uint16 equipmentCore, bytes generic1, bytes enchantments, bytes generic3));
    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 getUserArmors(address _address) view returns (tuple(uint256 id, tuple(uint8 armorType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 rawPhysDefense, uint16 physDefScalar, uint16 pDefScalarMax, uint16 rawMagicDefense, uint16 magicDefScalar, uint16 mDefScalarMax, uint16 evasion, uint16 spare1, uint16 spare2) displayDefenseInfo, 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, tuple(uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount, uint16 misc1, uint32 misc2, uint32 misc3, uint32 misc4) bonusInfoExtras)[]);
    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();
    function validateEquipping(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing, uint16 craft1, uint16 craft2) professions, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) _hero, uint256 _equipmentId, uint8) view returns (bool);
    
}
```

### ABI

{% file src="/files/wilQ1LXS4x8zDLnqtS6C" %}

## Types

### Armor

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

```solidity
struct Armor {
    uint256 id;
    DisplayDefenseInfo displayDefenseInfo;
    StateEnchantments stateEnchantments;
    BonusInfoExtras bonusInfoExtras;
}
```

### DisplayDefenseInfo

```solidity
struct DisplayDefenseInfo {
    ArmorType armorType;
    uint16 displayId;
    uint8 rarity;
    uint64 craftedBy;
    uint8 dye1;
    uint8 dye2;
    uint16 rawPhysDefense;
    uint16 physDefScalar;
    uint16 pDefScalarMax;
    uint16 rawMagicDefense;
    uint16 magicDefScalar;
    uint16 mDefScalarMax;
    uint16 evasion;
    uint16 spare1;
    uint16 spare2;
}
```

<table data-full-width="true"><thead><tr><th width="267.3333333333333">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>armorType</code></strong></td><td><a href="#armortype"><code>ArmorType</code></a></td><td>The numeric ID defining the armor type (e.g. <code>1</code> = Light Armor, etc.)</td></tr><tr><td><strong><code>displayId</code></strong></td><td><code>uint16</code></td><td>Defines the item's base appearance</td></tr><tr><td><strong><code>rarity</code></strong></td><td><code>uint16</code></td><td>The item's rarity (<code>0</code>-<code>12</code>). See <a href="/pages/hWGZbJUj7sUW8SapAXIm#rarity">Rarity</a>.</td></tr><tr><td><strong><code>craftedBy</code></strong></td><td><code>uint64</code></td><td>The Hero ID of the crafting Hero, or a unique ID for dropped items. See <a href="/pages/hWGZbJUj7sUW8SapAXIm#craftedby">CraftedBy</a>.</td></tr><tr><td><strong><code>dye1</code></strong></td><td><code>uint8</code></td><td>A unique mapping indicating the primary color variation for some items (<code>0</code> = no dye). See <a href="/pages/hWGZbJUj7sUW8SapAXIm#dye1">Dye1</a>.</td></tr><tr><td><strong><code>dye2</code></strong></td><td><code>uint8</code></td><td>A unique mapping indicating the secondary color variation for some items (<code>0</code> = no dye). See <a href="/pages/hWGZbJUj7sUW8SapAXIm#dye2">Dye2</a>.</td></tr><tr><td><strong><code>rawPhysDefense</code></strong></td><td><code>uint16</code></td><td>The base <code>P.DEF</code> of the armor</td></tr><tr><td><strong><code>physDefScalar</code></strong></td><td><code>uint16</code></td><td>The scalar value for <code>rawPhysDefense</code> (two-decimal precision multiplier, e.g. <code>5</code> = <code>0.05x</code>)</td></tr><tr><td><strong><code>pDefScalarMax</code></strong></td><td><code>uint16</code></td><td>The maximum value that can be obtained from the Hero's <code>END * physDefScalar</code></td></tr><tr><td><strong><code>rawMagicDefense</code></strong></td><td><code>uint16</code></td><td>The base <code>M.DEF</code> of the armor</td></tr><tr><td><strong><code>magicDefScalar</code></strong></td><td><code>uint16</code></td><td>The scalar value for <code>rawMagicDefense</code> (two-decimal precision multiplier, e.g. <code>5</code> = <code>0.05x</code>)</td></tr><tr><td><strong><code>mDefScalarMax</code></strong></td><td><code>uint16</code></td><td>The maximum value that can be obtained from the Hero's <code>WIS * magicDefScalar</code></td></tr><tr><td><strong><code>evasion</code></strong></td><td><code>uint16</code></td><td>The base <code>evasion</code> percent granted by the armor. Two-decimal precision with range of -327.67% to 327.67%.<br><br>Conversion logic is: <code>(1 - 2 * floor(evasion / 32768)) * (evasion % 32768)</code>.</td></tr><tr><td><strong><code>spare1</code></strong></td><td><code>uint16</code></td><td>Currently unused</td></tr><tr><td><strong><code>spare2</code></strong></td><td><code>uint16</code></td><td>Currently unused</td></tr></tbody></table>

### StateEnchantments

```solidity
struct StateEnchantments {
    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;
}
```

<table data-full-width="true"><thead><tr><th width="267.3333333333333">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>equippedTo</code></strong></td><td><code>uint64</code></td><td>The Hero ID of the Hero that the item is equipped to</td></tr><tr><td><strong><code>equippableAt</code></strong></td><td><code>uint64</code></td><td>The Unix timestamp when the item is next equippable</td></tr><tr><td><strong><code>maxDurability</code></strong></td><td><code>uint16</code></td><td>The maximum durability of the item</td></tr><tr><td><strong><code>durability</code></strong></td><td><code>uint16</code></td><td>The current durability of the item</td></tr><tr><td><strong><code>maxRepairs</code></strong></td><td><code>uint8</code></td><td>The maximum number of repairs for the item</td></tr><tr><td><strong><code>remainingRepairs</code></strong></td><td><code>uint8</code></td><td>The remaining number of repairs for the item</td></tr><tr><td><strong><code>equipRequirement</code></strong></td><td><code>uint8</code></td><td>The Level requirement to equip the item</td></tr><tr><td><strong><code>enchantmentType1</code></strong></td><td><code>uint8</code></td><td><p>A mapping of the enchantment type:</p><ul><li><code>0</code> = no enchantment slot available</li><li><code>1</code> = empty enchantment slot</li></ul></td></tr><tr><td><strong><code>enchantmentType2</code></strong></td><td><code>uint8</code></td><td><p>A mapping of the enchantment type:</p><ul><li><code>0</code> = no enchantment slot available</li><li><code>1</code> = empty enchantment slot</li></ul></td></tr><tr><td><strong><code>enchantmentType3</code></strong></td><td><code>uint8</code></td><td><p>A mapping of the enchantment type:</p><ul><li><code>0</code> = no enchantment slot available</li><li><code>1</code> = empty enchantment slot</li></ul></td></tr><tr><td><strong><code>enchantmentScalar1</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding enchantment</td></tr><tr><td><strong><code>enchantmentScalar2</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding enchantment</td></tr><tr><td><strong><code>enchantmentScalar3</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding enchantment</td></tr></tbody></table>

### BonusInfoExtras

```solidity
struct BonusInfoExtras {
    uint8 bonus1;
    uint8 bonus2;
    uint8 bonus3;
    uint8 bonus4;
    uint8 bonus5;
    uint16 bonusScalar1;
    uint16 bonusScalar2;
    uint16 bonusScalar3;
    uint16 bonusScalar4;
    uint16 bonusScalar5;
    uint16 uniqueSettings;
    uint8 restorationCount;
    uint16 misc1;
    uint32 misc2;
    uint32 misc3;
    uint32 misc4;
}
```

<table data-full-width="true"><thead><tr><th width="267.3333333333333">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>bonus1</code></strong></td><td><code>uint8</code></td><td>A mapping of an item bonus ID (<code>0</code> = no bonus)</td></tr><tr><td><strong><code>bonus2</code></strong></td><td><code>uint8</code></td><td>A mapping of an item bonus ID (<code>0</code> = no bonus)</td></tr><tr><td><strong><code>bonus3</code></strong></td><td><code>uint8</code></td><td>A mapping of an item bonus ID (<code>0</code> = no bonus)</td></tr><tr><td><strong><code>bonus4</code></strong></td><td><code>uint8</code></td><td>A mapping of an item bonus ID (<code>0</code> = no bonus)</td></tr><tr><td><strong><code>bonus5</code></strong></td><td><code>uint8</code></td><td>A mapping of an item bonus ID (<code>0</code> = no bonus)</td></tr><tr><td><strong><code>bonus1Scalar</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding bonus</td></tr><tr><td><strong><code>bonus2Scalar</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding bonus</td></tr><tr><td><strong><code>bonus3Scalar</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding bonus</td></tr><tr><td><strong><code>bonus4Scalar</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding bonus</td></tr><tr><td><strong><code>bonus5Scalar</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding bonus</td></tr><tr><td><strong><code>uniqueSettings</code></strong></td><td><code>uint16</code></td><td>Currently unused</td></tr><tr><td><strong><code>restorationCount</code></strong></td><td><code>uint8</code></td><td>The number of times the item's <code>remainingRepairs</code> have been restored</td></tr><tr><td><strong><code>misc1</code></strong></td><td><code>uint16</code></td><td>Currently unused</td></tr><tr><td><strong><code>misc2</code></strong></td><td><code>uint32</code></td><td>Currently unused</td></tr><tr><td><strong><code>misc3</code></strong></td><td><code>uint32</code></td><td>Currently unused</td></tr><tr><td><strong><code>misc4</code></strong></td><td><code>uint32</code></td><td>Currently unused</td></tr></tbody></table>

### ArmorType

```solidity
enum ArmorType {
    None,
    Light,
    Medium,
    Heavy
}
```

<table><thead><tr><th width="217">Armor Type</th><th width="140">Value</th><th>Usable By</th></tr></thead><tbody><tr><td>Light</td><td><code>1</code></td><td><ul><li>All Classes</li></ul></td></tr><tr><td>Medium</td><td><code>2</code></td><td><ul><li>Archer</li><li>Bard</li><li>Berserker</li><li>DarkKnight</li><li>Dragoon</li><li>DreadKnight</li><li>Knight</li><li>Legionnaire</li><li>Paladin</li><li>Pirate</li><li>Shapeshifter</li><li>SpellBow</li><li>Warrior</li></ul></td></tr><tr><td>Heavy</td><td><code>3</code></td><td><ul><li>DarkKnight</li><li>Dragoon</li><li>DreadKnight</li><li>Knight</li><li>Legionnaire</li><li>Paladin</li><li>Warrior</li></ul></td></tr></tbody></table>

{% hint style="info" %}
All Visages are considered Light Armor, and can by used by any class, regardless of what type of Armor that Hero may be wearing.
{% endhint %}

## Mappings

### Armor Details

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

```json
{
  "1": {
    "1": {
      "name": "Feather Duster",
      "description": "A lightweight armor fashioned from the feathers of a ravenous and cunning rocboc."
    },
    "2": {
      "name": "Hempen Jacket",
      "description": "Light and breathable. The bare minimum to protect you from the elements."
    },
    "3": {
      "name": "Reinforced Toga",
      "description": "A fashionable toga reinforced with bronze studs in key locations."
    },
    "4": {
      "name": "Squire's Light Armor",
      "description": "Layered comfortable garments that are great for adventures or a night on the town."
    },
    "5": {
      "name": "Rags of the Nameless",
      "description": "A pile of discolored and frayed wrappings worn by the acolytes of the Nameless God."
    },
    "6": {
      "name": "Abyssal Tunic",
      "description": "A light tunic interwoven with Submersian Coral."
    },
    "50000": {
      "name": "Bloater Suit",
      "description": "A fashionable fish fit that shows just the right amount of skin. Perfect camo against the realm's least threatening creature."
    },
    "50001": {
      "name": "Karate Gi",
      "description": "This elegant gi provides the comfort and flexibility to kick ass, take names, and get home in time for dinner. Popular amongst masters of Togwan Do."
    },
    "50002": {
      "name": "Super Blub Defender: Red Suit",
      "description": "A suit made by the Super Blub Defender (SBD) Fan Club. This one represents the Red Defender, who is known for his bravery, virtue, and mastery of Togwan-do."
    },
    "50003": {
      "name": "Super Blub Defender: Pink Suit",
      "description": "A suit made by the Super Blub Defender (SBD) Fan Club. This one represents the Pink Defender, who is known for her biting wit, nibbling charm, and chomping mastication."
    },
    "50004": {
      "name": "Super Blub Defender: Blue Suit",
      "description": "A suit made by the Super Blub Defender (SBD) Fan Club. This one represents the Blue Defender, who is known for his honesty, compassion, and excellent taste in music."
    },
    "50005": {
      "name": "Super Blub Defender: Yellow Suit",
      "description": "A suit made by the Super Blub Defender (SBD) Fan Club. This one represents the Yellow Defender, who is known for her lucky dodges, uncanny lunges, and otherwordly Bloater cakes."
    },
    "50006": {
      "name": "Super Blub Defender: Black Suit",
      "description": "A suit made by the Super Blub Defender (SBD) Fan Club. This one represents the Black Defender, who is known for his firm handshake, next-level stealth, and unprompted backflips."
    },
    "50007": {
      "name": "Super Blub Defender: Green Suit",
      "description": "A suit made by the Super Blub Defender (SBD) Fan Club. This one represents the Green Defender, who is known for his boastfulness, gambling acumen, and violently unfunny dad jokes."
    },
    "50008": {
      "name": "Yellow Panther Suit",
      "description": "The mysterious Yellow Panther Clan lives and fights in the shadows. Don their ceremonial armor and join the movement."
    },
    "50009": {
      "name": "Chef Suit",
      "description": "A chef should always be prepared for furious fighting or fierce fileting. This is the perfect outfit for adventures both in and out of the kitchen."
    },
    "50010": {
      "name": "Dark Summoner Suit",
      "description": "When they're not sacrificing Heroes in a nonstop stream of dark rituals that push Gaia further and further towards an inescapable corruption, the Dark Summoner is looking fit and fancy-free in this sleek jumper wrap."
    },
    "50011": {
      "name": "Champion Gi",
      "description": "This champion gi provides the comfort and flexibility to kick ass, take names, and get home in time for dinner. Popular amongst masters of Togwan Do."
    },
    "50012": {
      "name": "Fishing Vest",
      "description": "Brought to you by Tom Threads™, this dapper fishing vest is both fashionable and functional. It strikes fear in the hearts of bloaters everywhere."
    },
    "50013": {
      "name": "Padded Archivist Tunic",
      "description": "Stay comfortable and organized with this stylish archivist tunic, meticulously crafted with padded lining for extended wear. Complete the ensemble with a pair of vibrant green gloves that will make any archival task seem trivial."
    },
    "50014": {
      "name": "Doug Hype Fur Coat",
      "description": "Bring the hype with every step you take in these immaculate duds."
    },
    "50015": {
      "name": "Foraging Raiments",
      "description": "Fashioned by Druids and beloved by outdoorsmen, these comfortable raiments truly embrace the elegance of the natural world."
    },
    "50016": {
      "name": "Frost Bloater Suit",
      "description": "Cold as ice and twice as nice, this frozen fish fit channels the least threatening creature in the frozen tundras of Crystalvale."
    },
    "50017": {
      "name": "Gardening Gear",
      "description": "Don this tactical gardening gear to truly embody the qualities of a green thumb: patience, resolve, and the ability to squash errant blubs."
    },
    "50018": {
      "name": "Axolotl Suit",
      "description": "A musty Axolotl suit that has gained popularity amongst certain fringe groups. It is very... pink."
    },
    "50019": {
      "name": "Metisian Toga",
      "description": "This lightweight toga fashioned by the gods transforms its wearer into an agile and extremely comfortable warrior."
    },
    "50020": {
      "name": "Hercules Muscle Suit",
      "description": "Get the body you want without all the effort! This snug rubber muscle suit shows that you're not afraid of a little exercise, even if that exercise happens to be squeezing into a tight rubber muscle suit."
    },
    "50021": {
      "name": "Miner's Overalls",
      "description": "Don't even think about hiding these chic mining overalls underground! Show the surface world you mean business with a style they'll dig."
    },
    "50022": {
      "name": "Fungal Frock",
      "description": "Skip the damp and the dark with this stylish frock modeled after the bright plumage of the infamous manshroom."
    },
    "50023": {
      "name": "God of the Arena Suit",
      "description": "HIS FINS WILL CUT THE SKY, HIS ARMS WILL LIFT THE WORLD! Wear this suit to channel your inner Sharkules, the undisputed God of the Arena."
    },
    "50024": {
      "name": "Yield Guild Garb",
      "description": "Lightweight and stylish armor imbued with a powerful symbol of community and cooperation."
    },
    "50024": {
      "name": "Metisian Gladiator Raiments",
      "description": "The fearless gladiators of the colosseum don these fashionable yet functional raiments to aid them in combat."
    }
  },
  "2": {
    "1": {
      "name": "Wishbone Breastplate",
      "description": "A fine armor fashioned from the feathers of a ravenous rocboc and cured leather."
    },
    "2": {
      "name": "Leather Jerkin",
      "description": "A shabby leather vest with cloth accents for easy mobility."
    },
    "3": {
      "name": "Leather Cingulum",
      "description": "A thick leather belt with bronze studs and plates to protect vital organs."
    },
    "4": {
      "name": "Squire's Medium Armor",
      "description": "Studded leather armor that protects your body without slowing you down."
    },
    "5": {
      "name": "Seawarden's Mail",
      "description": "A gilded leather vest adorned with protective Submersian Coral."
    }
  },
  "3": {
    "1": {
      "name": "Boc-Knight Mail",
      "description": "Fashioned from the feathers and beak of a massive rocboc, this heavy armor allows its wearer to take a beating and keep on flapping."
    },
    "2": {
      "name": "Tin Plate",
      "description": "A shabby (and heavy) plate draped over your torso. It appears to flex as you poke it."
    },
    "3": {
      "name": "Bronze Cuirass",
      "description": "Bronze armor that is molded to look like you have abs. Easier than the gym."
    },
    "4": {
      "name": "Squire's Heavy Armor",
      "description": "Imposing iron armor to protect you on the battlefield."
    },
    "5": {
      "name": "Armor of the Drowned",
      "description": "A rusty heap of platemail with the left arm missing. It serves as a poignant reminder of the unforgiving perils of the sea."
    },
    "6": {
      "name": "Coral Brigandine",
      "description": "A golden breastplate covered in several layers of durable Submersian Coral."
    }
  }
}

```

### Armor Bonuses

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

```json
{
    1: "Increase Block chance by +X%",
    2: "Increase Spell Block chance by +X%",
    3: "Increase Block damage reduction by X%",
    4: "Increase Spell Block damage reduction by X%",
    5: "Increase Physical Accuracy by +X%",
    6: "Increase Magical Accuracy by +X%",
    7: "Increase Speed by X%",
    8: "Increase Evasion by X%",
    9: "Increase Status Effect Resistance by +X%",
    10: "Increase Banish Resistance by +X%",
    11: "Increase Bleed Resistance by +X%",
    12: "Increase Blind Resistance by +X%",
    13: "Increase Burn Resistance by +X%",
    14: "Increase Chill Resistance by +X%",
    15: "Increase Confuse Resistance by +X%",
    16: "Increase Daze Resistance by +X%",
    17: "Increase Disarm Resistance by +X%",
    18: "Increase Fear Resistance by +X%",
    19: "Increase Intimidate Resistance by +X%",
    20: "Increase Poison Resistance by +X%",
    21: "Increase Pull Resistance by +X%",
    22: "Increase Push Resistance by +X%",
    23: "Increase Silence Resistance by +X%",
    24: "Increase Sleep Resistance by +X%",
    25: "Increase Slow Resistance by +X%",
    26: "Increase Stun Resistance by +X%",
    27: "Increase Taunt Resistance by +X%",
    28: "Increase Critical Hit Multiplier by +X",
    29: "Increase Physical Defense by +X%",
    30: "Increase Magical Defense by +X%",
    31: "Decrease Physical Accuracy by -X%",
    32: "Decrease Magical Accuracy by -X%",
    33: "Increase Physical Damage by +X%",
    34: "Increase Magical Damage by +X%",
    35: "Gain +X% Riposte",
    36: "Double the bonuses above this bonus when equipped with X accessory.",
    37: "Double the bonuses above this bonus when equipped with X off-hand.",
    38: "Double the bonuses above this bonus when equipped with X 1H Sword.",
    39: "Gain X% chance to Retaliate 1 upon receiving physical damage.",
    40: "Gain X Initiative after each successful Block",
    41: "Increase Recovery chance by +X%",
    42: "Double the bonuses above this bonus when equipped with X 2H Sword.",
    43: "Double the bonuses above this bonus when equipped with X 1H Axe.",
    44: "Double the bonuses above this bonus when equipped with X 2H Axe.",
    45: "Double the bonuses above this bonus when equipped with X 1H Mace.",
    46: "Double the bonuses above this bonus when equipped with X 2H Mace.",
    47: "Double the bonuses above this bonus when equipped with X 1H Spear.",
    48: "Double the bonuses above this bonus when equipped with X 2H Spear.",
    49: "Double the bonuses above this bonus when equipped with X Wand.",
    50: "Double the bonuses above this bonus when equipped with X Staff.",
    51: "Double the bonuses above this bonus when equipped with X Gloves.",
    52: "Double the bonuses above this bonus when equipped with X Bow.",
    53: "Double the bonuses above this bonus when equipped with X Dagger.",
    54: "Decrease Speed by X%",
    55:	"Decrease Healing Potency by X%",
    56:	"Critical Hits gain X% Lifesteal",
    57:	"Increase Critical Hit chance by +X%",
    58: "Reduce Channeling times by X%"
}
```


# 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

```solidity
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

{% file src="/files/W37F4p3MxfCZF6ha05uq" %}

## Types

### Accessory

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

```solidity
struct Accessory {
    uint256 id;
    DisplayBonusInfo displayBonusInfo;
    StateEnchantments stateEnchantments;
}
```

### DisplayBonusInfo

```solidity
struct DisplayBonusInfo {
    EquipmentType 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;
}
```

<table data-full-width="true"><thead><tr><th width="235.33333333333331">Name</th><th width="188">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>EquipmentType</code></strong></td><td><a href="#equipmenttype"><code>EquipmentType</code></a></td><td>The numeric ID defining the equipment type (e.g. <code>1</code> = Accessory, etc.)</td></tr><tr><td><strong><code>displayId</code></strong></td><td><code>uint16</code></td><td>Defines the item's base appearance</td></tr><tr><td><strong><code>rarity</code></strong></td><td><code>uint8</code></td><td>The item's rarity (<code>0</code>-<code>12</code>). See <a href="/pages/hWGZbJUj7sUW8SapAXIm#rarity">Rarity</a>.</td></tr><tr><td><strong><code>craftedBy</code></strong></td><td><code>uint64</code></td><td>The Hero ID of the crafting Hero, or a unique ID for dropped items. See <a href="/pages/hWGZbJUj7sUW8SapAXIm#craftedby">CraftedBy</a>.</td></tr><tr><td><strong><code>dye1</code></strong></td><td><code>uint8</code></td><td>A unique mapping indicating the primary color variation for some items (<code>0</code> = no dye). See <a href="/pages/hWGZbJUj7sUW8SapAXIm#dye1">Dye1</a>.</td></tr><tr><td><strong><code>dye2</code></strong></td><td><code>uint8</code></td><td>A unique mapping indicating the secondary color variation for some items (<code>0</code> = no dye). See <a href="/pages/hWGZbJUj7sUW8SapAXIm#dye2">Dye2</a>.</td></tr><tr><td><strong><code>bonus1</code></strong></td><td><code>uint8</code></td><td>A mapping of an item bonus ID (<code>0</code> = no bonus)</td></tr><tr><td><strong><code>bonus2</code></strong></td><td><code>uint8</code></td><td>A mapping of an item bonus ID (<code>0</code> = no bonus)</td></tr><tr><td><strong><code>bonus3</code></strong></td><td><code>uint8</code></td><td>A mapping of an item bonus ID (<code>0</code> = no bonus)</td></tr><tr><td><strong><code>bonus4</code></strong></td><td><code>uint8</code></td><td>A mapping of an item bonus ID (<code>0</code> = no bonus)</td></tr><tr><td><strong><code>bonus5</code></strong></td><td><code>uint8</code></td><td>A mapping of an item bonus ID (<code>0</code> = no bonus)</td></tr><tr><td><strong><code>bonusScalar1</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding bonus</td></tr><tr><td><strong><code>bonusScalar2</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding bonus</td></tr><tr><td><strong><code>bonusScalar3</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding bonus</td></tr><tr><td><strong><code>bonusScalar4</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding bonus</td></tr><tr><td><strong><code>bonusScalar5</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding bonus</td></tr><tr><td><strong><code>uniqueSettings</code></strong></td><td><code>uint16</code></td><td>Currently unused</td></tr><tr><td><strong><code>restorationCount</code></strong></td><td><code>uint8</code></td><td>The number of times the item's <code>remainingRepairs</code> have been restored</td></tr></tbody></table>

### StateEnchantments

```solidity
struct StateEnchantments {
    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;
}
```

<table data-full-width="true"><thead><tr><th width="267.3333333333333">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>equippedTo</code></strong></td><td><code>uint64</code></td><td>The Hero ID of the Hero that the item is equipped to</td></tr><tr><td><strong><code>equippableAt</code></strong></td><td><code>uint64</code></td><td>The Unix timestamp when the item is next equippable</td></tr><tr><td><strong><code>maxDurability</code></strong></td><td><code>uint16</code></td><td>The maximum durability of the item</td></tr><tr><td><strong><code>durability</code></strong></td><td><code>uint16</code></td><td>The current durability of the item</td></tr><tr><td><strong><code>maxRepairs</code></strong></td><td><code>uint8</code></td><td>The maximum number of repairs for the item</td></tr><tr><td><strong><code>remainingRepairs</code></strong></td><td><code>uint8</code></td><td>The remaining number of repairs for the item</td></tr><tr><td><strong><code>equipRequirement</code></strong></td><td><code>uint8</code></td><td>The Level requirement to equip the item</td></tr><tr><td><strong><code>enchantmentType1</code></strong></td><td><code>uint8</code></td><td><p>A mapping of the enchantment type:</p><ul><li><code>0</code> = no enchantment slot available</li><li><code>1</code> = empty enchantment slot</li></ul></td></tr><tr><td><strong><code>enchantmentType2</code></strong></td><td><code>uint8</code></td><td><p>A mapping of the enchantment type:</p><ul><li><code>0</code> = no enchantment slot available</li><li><code>1</code> = empty enchantment slot</li></ul></td></tr><tr><td><strong><code>enchantmentType3</code></strong></td><td><code>uint8</code></td><td><p>A mapping of the enchantment type:</p><ul><li><code>0</code> = no enchantment slot available</li><li><code>1</code> = empty enchantment slot</li></ul></td></tr><tr><td><strong><code>enchantmentScalar1</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding enchantment</td></tr><tr><td><strong><code>enchantmentScalar2</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding enchantment</td></tr><tr><td><strong><code>enchantmentScalar3</code></strong></td><td><code>uint16</code></td><td>The scalar value of the corresponding enchantment</td></tr></tbody></table>

### EquipmentType

```solidity
enum EquipmentType {
    None,
    Accessory,
    Shield,
    Focus
}
```

<table data-full-width="true"><thead><tr><th width="175.33333333333331">Name</th><th width="90">Value</th><th width="149">Description</th><th width="127">Type</th><th>Usable By</th></tr></thead><tbody><tr><td><strong><code>None</code></strong></td><td><code>0</code></td><td>None</td><td>N/A</td><td>N/A</td></tr><tr><td><strong><code>Accessory</code></strong></td><td><code>1</code></td><td>Accessory</td><td>Accessory</td><td><ul><li>All Classes</li></ul></td></tr><tr><td><strong><code>Shield</code></strong></td><td><code>2</code></td><td>Shield</td><td>Offhand</td><td><ul><li>Knight</li><li>Legionnaire</li><li>Paladin</li><li>Warrior</li></ul></td></tr><tr><td><strong><code>Focus</code></strong></td><td><code>3</code></td><td>Focus</td><td>Offhand</td><td><ul><li>Paladin</li><li>Priest</li><li>Sage</li><li>Scholar</li><li>Seer</li><li>Summoner</li><li>Wizard</li></ul></td></tr></tbody></table>

## 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:

```json
{
  "1": {
    "1": {
      "name": "Skali's Eye",
      "description": "An ancient medallion fashioned from the fragments of an emerald blessed by Skali herself. Your vision seems to sharpen while wearing it..."
    },
    "2": {
      "name": "Tal's Curio",
      "description": "A silver medallion worn by Tal's Disciples that wards off evil."
    },
    "3": {
      "name": "Elgrin's Aegis",
      "description": "Elgrin's High Priests were considered invulnerable in battle while wielding enchanted totems. Similarly, this Aegis hardens the skin of anyone who wears it."
    },
    "4": {
      "name": "Secondhand Pants",
      "description": "A fine pair of pre-digested pants. They're a bit loose around the waist."
    },
    "5": {
      "name": "Charger's Mask",
      "description": "Even with decreased visibility, this mask fills the wearer with an overpowering thirst for vengeance. Its style could most appropriately be categorized as \"crazy chic\"."
    },
    "6": {
      "name": "Conical Cap of Remembrance",
      "description": "A ceremonial hat worn at parties, celebrations and, less appropriately, in battle."
    },
    "7": {
      "name": "Gored Gourd",
      "description": "A gourd gored by a bored boar."
    },
    "8": {
      "name": "Ring of Dueling",
      "description": "A lustrous gold ring which surrounds its wearer with a palpable aura of luck."
    },
    "9": {
      "name": "Bronze Champion's Crown",
      "description": "A prized emerald-hued crown awarded to the Duel Champion with the third-longest Champion streak for the season. Heroes adorned with this accessory seem to have greater control over their environments."
    },
    "10": {
      "name": "Silver Champion's Crown",
      "description": "A prized royal blue crown awarded to the Duel Champion with the second-longest Champion streak for the season. Heroes adorned with this accessory seem to have greater control over their environments."
    },
    "11": {
      "name": "Gold Champion's Crown",
      "description": "A prized burgundy crown awarded to the Duel Champion with the longest Champion streak for the season. Heroes adorned with this accessory appear to have greater control over their environments."
    },
    "12": {
      "name": "Champion's Medal",
      "description": "A badge of honor for those brave enough to claim it and a warning for those foolish enough to challenge them."
    },
    "13": {
      "name": "Cooler Head",
      "description": "Its wearers always seem to prevail."
    },
    "14": {
      "name": "Boc-Knight Helm",
      "description": "This protective headgear fashioned from the beak of a mighty rocboc fills its wearer with the inexplicable urge to peck."
    },
    "15": {
      "name": "Ancient Wood Dragon Mask",
      "description": "This lovingly crafted mask celebrates the enduring spirit of Gaia's fierce and primal dragon warriors from ages long past."
    },
    "16": {
      "name": "Bunbun Bonnet",
      "description": "An exquisite bonnet made from the finest faux fur and featured in Yara's latest line of bunbun fashions."
    },
    "17": {
      "name": "Melville's Spectacular Spectacles",
      "description": "A truly spectacular feat of engineering, these unique spectacles provide modest protection from the sun and a myriad of sharp objects."
    },
    "18": {
      "name": "Mister Birthday",
      "description": "An austere cake that exudes confidence and longevity. A strange force seems to invite you to place it atop your head."
    },
    "19": {
      "name": "Swearing Hat",
      "description": "On cold, moonless nights, this hat whispers curses in a long-forgotten tongue."
    },
    "20": {
      "name": "Drunkard's Bandana",
      "description": "This old red rag smells like a brothel and fits like a glove... on your head... like a hat."
    },
    "21": {
      "name": "Octohood",
      "description": "The limp and mangled corpse of an octopilot who, even in death, is still along for the ride."
    },
    "22": {
      "name": "Cowl of Eternal Hunger",
      "description": "Wearing this hood makes you feel hollow and... desperately hungry."
    },
    "23": {
      "name": "Crown of Submersia",
      "description": "Only legendary champions of the Colosseum receive the coveted Crown of Submersia, an intricate coral crown reflecting the pioneering spirit of Submersians past and present."
    },
    "24": {
      "name": "Shellmet",
      "description": "You can take the Hero out of the egg but you can't take the egg off the Hero."
    },
    "25": {
      "name": "Cerulean Helm of Ascension",
      "description": "A cerulean ceremonial headdress worn by the priestesses of ascension and those who follow their teachings."
    },
    "50000": {
      "name": "Bloater Mask",
      "description": "This iconic fish mask exudes an air of sophistication and mystique. No bloaters were harmed in the making of this item."
    },
    "50001": {
      "name": "Plague Mask",
      "description": "A clever mask designed to keep the plague out and the good vibes in."
    },
    "50002": {
      "name": "Super Blub Defender: Red Mask",
      "description": "A mask made by the Super Blub Defender (SBD) Fan Club. This one represents the Red Defender, who is known for his bravery, virtue, and mastery of Togwan-do."
    },
    "50003": {
      "name": "Super Blub Defender: Pink Mask",
      "description": "A mask made by the Super Blub Defender (SBD) Fan Club. This one represents the Pink Defender, who is known for her biting wit, nibbling charm, and chomping mastication."
    },
    "50004": {
      "name": "Super Blub Defender: Blue Mask",
      "description": "A mask made by the Super Blub Defender (SBD) Fan Club. This one represents the Blue Defender, who is known for his honesty, compassion, and excellent taste in music."
    },
    "50005": {
      "name": "Super Blub Defender: Yellow Mask",
      "description": "A mask made by the Super Blub Defender (SBD) Fan Club. This one represents the Yellow Defender, who is known for her lucky dodges, uncanny lunges, and otherwordly Bloater cakes."
    },
    "50006": {
      "name": "Super Blub Defender: Black Mask",
      "description": "A mask made by the Super Blub Defender (SBD) Fan Club. This one represents the Black Defender, who is known for his firm handshake, next-level stealth, and unprompted backflips."
    },
    "50007": {
      "name": "Super Blub Defender: Green Mask",
      "description": "A mask made by the Super Blub Defender (SBD) Fan Club. This one represents the Green Defender, who is known for his boastfulness, gambling acumen, and violently unfunny dad jokes."
    },
    "50008": {
      "name": "Yellow Panther Mask",
      "description": "The mysterious Yellow Panther Clan lives and fights in the shadows. Don their ceremonial mask and join the movement."
    },
    "50009": {
      "name": "Chef Hat",
      "description": "A chef should always be prepared for furious fighting or fierce fileting. This is the perfect hat for adventures both in and out of the kitchen."
    },
    "50010": {
      "name": "Dark Summoner Mask",
      "description": "When they're not sacrificing Heroes in a nonstop stream of dark rituals that push Gaia further and further towards an inescapable corruption, the Dark Summoner is looking fit and fancy-free in this sleek mask wrap."
    },
    "50011": {
      "name": "Rolando Mask",
      "description": "Show your Rolando pride by walking a mile in his head! Perfect for adding a ribbit of fun to any occasion."
    },
    "50012": {
      "name": "Doug Hype Shades",
      "description": "Get a fresh view of the world with these stylish, hype-tinted glasses."
    },
    "50013": {
      "name": "Big Red Bear Head",
      "description": "It's big, it's red, it's beautiful! Don this furry fashion statement before battle for a healthy dose of ursine intimidation."
    },
    "50014": {
      "name": "Frost Bloater Mask",
      "description": "Cold as ice and twice as nice, this frozen fish mask channels the least threatening creature in the frozen tundras of Crystalvale."
    },
    "50015": {
      "name": "Axolotl Mask",
      "description": "A musty Axolotl mask with bulging eyes that has gained popularity amongst certain fringe groups. It is very... pink."
    },
    "50016": {
      "name": "Crown of Wisdom",
      "description": "A laurel leaf crown of immense power that imbues wisdom and light."
    },
    "50017": {
      "name": "Mannish Cap",
      "description": "Instead of letting a manshroom get inside your head, wear its head on your head! Be the fungi you've always dreamt of being."
    },
    "50018": {
      "name": "God of the Arena Mask",
      "description": "This mask contains the sacred visage of the God of the Arena himself, the venerable and forever respected Sharkules."
    },
    "50019": {
      "name": "Metisian Gladiator Helm",
      "description": "The most skilled gladiators in the colosseum wear this classic Metisian helmet to strike fear into the hearts of their foes."
    }
  },
  "2": {
    "1": {
      "name": "Yolked Bockler",
      "description": "A mysterious shield whose dubious origin raises questions about its durability and usefulness."
    },
    "2": {
      "name": "Cutting Board",
      "description": "Repurposed wooden planks trying to pass as a shield."
    },
    "3": {
      "name": "Bronze Shield",
      "description": "A bronze round-shield with gaps designed to allow a spear or sword to pass through comfortably."
    },
    "4": {
      "name": "Squire's Shield",
      "description": "A simple heater shield made of iron. Blocks everything but criticism."
    },
    "5": {
      "name": "Reefwall",
      "description": "A sturdy yet light shield made from interlocking coral and supported by a gold-plated frame."
    }
  }
}

```

### Accessory Bonuses

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

{% hint style="info" %}
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`
  {% endhint %}

```json
{
    1: "Increase Physical Accuracy by +X%",
    2: "Increase Magical Accuracy by +X%",
    3: "Increase Block chance by +X%",
    4: "Increase Spell Block chance by +X%",
    5: "Increase Speed by X%",
    6: "Increase Evasion by X%",
    7: "Increase Status Effect Resistance by +X%",
    8: "Increase Banish Resistance by +X%",
    9: "Increase Bleed Resistance by +X%",
    10: "Increase Blind Resistance by +X%",
    11: "Increase Burn Resistance by +X%",
    12: "Increase Chill Resistance by +X%",
    13: "Increase Confuse Resistance by +X%",
    14: "Increase Daze Resistance by +X%",
    15: "Increase Disarm Resistance by +X%",
    16: "Increase Fear Resistance by +X%",
    17: "Increase Intimidate Resistance by +X%",
    18: "Increase Poison Resistance by +X%",
    19: "Increase Pull Resistance by +X%",
    20: "Increase Push Resistance by +X%",
    21: "Increase Silence Resistance by +X%",
    22: "Increase Sleep Resistance by +X%",
    23: "Increase Slow Resistance by +X%",
    24: "Increase Stun Resistance by +X%",
    25: "Increase Taunt Resistance by +X%",
    26: "Increase Critical Hit Multiplier by +X",
    27: "Increase Physical Defense by +X%",
    28: "Increase Magical Defense by +X%",
    29: "Decrease Physical Accuracy by -X%",
    30: "Decrease Magical Accuracy by -X%",
    31: "Increase Physical Damage by +X%",
    32: "Increase Magical Damage by +X%",
    33: "Gain +X% Riposte",
    34:	"Increase ATTACK by +X%",
    35:	"Increase SPELL by +X%",
    36: "Gain Ability: X",
    37: "Increase Physical Damage Reduction by +X%",
    38: "Increase Magical Damage Reduction by +X%",
    39: "Gain X% chance to reduce the battle budget cost of any consumable used by this Hero by 2.",
    230: "Add +X to Duel Score when Dueling",
    231: "Gain a roll for +X-Y added to Duel Score when Dueling",
    232: "Gain +X% chance for matching background to appear when defending Duel champion",
    233: "Add +X to Duel Score when defending Duel champion",
    234: "Gain a roll for +X-Y added to Duel Score when defending Duel champion"
}
```

### Offhand Bonuses

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

```json
{
    1: "Increase Block chance by +X%",
    2: "Increase Block damage reduction by +X%",
    3: "Increase Spell Block chance by +X%",
    4: "Increase Spell Block damage reduction by +X%",
    5: "Gain +X% Riposte",
    6: "Increase P.DEF by X",
    7: "Increase M.DEF by X",
    8: "Increase Pull Resistance by +X%",
    9: "Increase Push Resistance by +X%"
}
```


# Shared Equipment Mappings

All three equipment contracts share the following mappings.

## Mappings

### Rarity

```json
{
    0: "Common",
    2: "Rare",
    4: "Mythic",
    10: "Premium Visage",
    11: "Promotional Visage",
    12: "Creator Visage"
}
```

### CraftedBy

The `craftedBy` field contains a Hero ID for items that were crafting, or one of the following mappings for item drops and other sources:

```json
{
    "9000000000000": "The Gods", // Testing
    "9000000000001": "Visage Merchant",	// Direct Offer
    "9000000000002": "Tiltproof Tuesday", // Community Promo
    "9000000000003": "Karate Combat Promo", // Direct Offer
    "9000000000005": "Doug Hype Promo", // Direct Offer
    "9000000000004": "Yellow Panther Promo", // Direct Offer
    "9000000000005": "Doug Hype Promo", // Direct Offer
    "9000000000006": "Big Red Promo", // Direct Offer
    "9000000000007": "Hercules Promo", // Direct Offer
    "9000000000008": "Metis Promo", // Direct Offer
    "9000000001000": "Vithraven (Crystalvale) Blacksmith", // Direct Offer
    "9000000002000": "Transcendence Beginnings Event", // Raffle
    "9000000010000": "Kingdom Builder Promo", // Kingdom Builders
    "9000000020000": "Void Hunt - Mad Boar", // Hunts
    "9000000020001": "Mad Boar - 2023 Halloween Event", // Hunts
    "9000000020002": "Mad Boar - 2023 Winter Event", // Hunts
    "9000000020020": "Void Hunt - Bad Motherclucker", // Hunts
    "9000000028000": "Void Hunt - 2024 Lunar New Year Event", // Hunts
    "9000000028001": "Void Hunt - 2024 Gaia's Song Event", // Hunts
    "9000000028002": "Void Hunt - 2024 Summer Event", // Hunts
    "9000000028003": "Void Hunt - DFK Third Birthday Event", // Hunts
    "9000000028004": "Void Hunt - 2024 Halloween Event", // Hunts
    "9000000028005": "Void Hunt - 2025 Gaia's Song Event", // Hunts
    "9000000030000": "DFK Duel S6 Rank Rewards", // DFK Duel
    "9000000030001": "DFK Duel S6 Champion Rewards", // DFK Duel
    "9000000030002": "DFK Duel S6 Top Champion Rewards", // DFK Duel
    "9000000030007": "DFK Duel S7 Rank Rewards", // DFK Duel
    "9000000030008": "DFK Duel S8 Rank Rewards", // DFK Duel
    "9000000030009": "DFK Duel S9 Rank Rewards", // DFK Duel
    "9000000030010": "DFK Duel S10 Rank Rewards", // DFK Duel
    "9000000030011": "DFK Duel S11 Rank Rewards", // DFK Duel
    "9000000030012": "DFK Duel S12 Rank Rewards", // DFK Duel
    "9000000031007": "DFK Duel S7 Champion Rewards", // DFK Duel
    "9000000031008": "DFK Duel S8 Champion Rewards", // DFK Duel
    "9000000031009": "DFK Duel S9 Champion Rewards", // DFK Duel
    "9000000031010": "DFK Duel S10 Champion Rewards", // DFK Duel
    "9000000031011": "DFK Duel S11 Champion Rewards", // DFK Duel
    "9000000031012": "DFK Duel S12 Champion Rewards", // DFK Duel
    "9000000032007": "DFK Duel S7 Top Champion Rewards", // DFK Duel
    "9000000032008": "DFK Duel S8 Top Champion Rewards", // DFK Duel
    "9000000032009": "DFK Duel S9 Top Champion Rewards", // DFK Duel
    "9000000032010": "DFK Duel S10 Top Champion Rewards", // DFK Duel
    "9000000032011": "DFK Duel S11 Top Champion Rewards", // DFK Duel
    "9000000032012": "DFK Duel S12 Top Champion Rewards", // DFK Duel
    "9000000040000": "xJEWEL Raffle", // Airdrop
    "9000000040001": "Level Up Raffle", // Airdrop
    "9000000040002": "Second Birthday Event", // Airdrop
    "9000000040003": "Void Hunt Veteran Reward", // Airdrop
    "9000000050001": "Submersia Patrol", // Patrols
    "9000000051002": "YGG GAP Season 9 Premium Quest", // Event
    "9000000051003": "Tournament Participation Reward", // Tournaments
    "9000000060001": "Submersian Chest", // Treasure Chest
    "9000000060002": "Gilded Chest", // Treasure Chest
    "9000000060003": "Coral Chest", // Treasure Chest
    "9000000060004": "Sunken Chest", // Treasure Chest
    "9000000060005": "Banded Chest", // Treasure Chest
    "9000000060006": "Lost Chest", // Treasure Chest
    "9000000060007": "Stone Chest" // Treasure Chest
}
```

### Dye1

```json
{
    1: "#847d7d",
    2: "#df5121",
    3: "#dfad21",
    4: "#8abf1a",
    5: "#20b28c",
    6: "#1c8dd6",
    7: "#a92de3",
    8: "#d9d1d1",
    9: "#474b55",
    10: "#a24b20"
}
```

### Dye2

```json
{
    1: "#855b3c",
    2: "#a35241",
    3: "#9a7d4a",
    4: "#5e6d3f",
    5: "#4b7775",
    6: "#446689",
    7: "#704e7f",
    8: "#9da9c5",
    9: "#282423",
    10: "#a24b20"
}
```


# CacheCore

The CacheCore contract is used to open Equipment "Caches," similar to Hero Crystals or incubated Pet Eggs. It is used for equipment airdrops and will be used for crafting in the future.

## Contracts

### Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| DFK Chain | `0x15436d3f5dc3D6799b841c46D8a0bD14eC924651` | `0x60489f6712617055f00e9F7bCF2A0BCa8EafFe2f` |
| Klaytn    | `0xe4E368119A858Ca80750269D4490Bc1978260766` | `0x430546a6f3923B4607DB51E9A82758Cd19F5Fb06` |

### Interface

```solidity
interface ICacheCoreDiamond {

    // Events
    event CacheCreated(address indexed owner, uint256 indexed cacheId, address equipmentContract, uint8 equipmentType, uint16 displayId, uint8 rarity, uint256 createdBlock, uint64 craftedBy);
    event CacheOpened(address indexed owner, uint256 indexed cacheId, uint256 indexed equipmentId, address equipmentContract, uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy);
    event Paused(address account);
    event Unpaused(address account);

    // State-Changing Functions
    function multiOpen(uint256[] _cacheIds);
    function open(uint256 _cacheId) returns (uint256);

    // View Functions
    function getCache(uint256 _cacheId) view returns (tuple(address owner, uint256 createdBlock, address equipmentContract, uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy));
    function getUserCaches(address _address) view returns (uint256[]);
    function getUserCachesData(address _address) view returns (uint256[], tuple(address owner, uint256 createdBlock, address equipmentContract, uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy)[]);
    function nextCacheId() view returns (uint256);
    function paused() view returns (bool);
    function totalCaches() view returns (uint256);

}
```

### ABI

{% file src="/files/w5ltNWFYLq4hfXGKOU9W" %}


# Equipment Shop

## Contracts

### Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| DFK Chain | `0xEbaD9CD534aEEe4d8661599321018dAb20cDCE95` | `0x2eBa843E834D68d81e3AC02F540B3cc4e707c8ad` |

### Interface

```solidity
interface IVisageShop {

    // Events
    event ItemAdded(address indexed equipmentAddress, uint8 equipmentType, uint16 displayId, uint8 rarity, uint256 startingPrice, uint256 minPrice, uint256 deltaPriceIncrease, uint256 decreaseRate, uint64 priceIncreaseDecay);
    event ItemTraded(address indexed player, address indexed equipmentAddress, uint8 equipmentType, uint16 displayId, uint8 rarity, uint256 boughtQty, address soldItem, uint256 soldQty);
    event ItemUpdated(address indexed equipmentAddress, uint8 equipmentType, uint16 displayId, uint8 rarity, uint256 currentPrice, uint256 minPrice, uint256 deltaPriceIncrease, uint256 decreaseRate, uint64 priceIncreaseDecay, uint8 status);

    // Functions
    function buyItem(address _equipmentContract, uint8 _equipmentType, uint16 _displayId, uint8 _rarity, uint256 _quantity, uint256 _maxPrice);
    function equipmentToShopItemId(address, uint8, uint16, uint8) view returns (uint256);
    function getNextPrice(address _equipmentContract, uint8 _equipmentType, uint16 _displayId, uint8 _rarity, uint256 _quantity) view returns (uint256);
    function getShopItem(uint256 _id) view returns (tuple(uint256 id, address equipmentContract, uint8 equipmentType, uint16 displayId, uint8 rarity, uint256 currentPrice, uint256 minPrice, uint256 deltaPriceIncrease, uint256 decreaseRate, uint256 priceIncreaseDecay, uint256 lastPurchaseTimestamp, uint8 status));
    function getShopItemByEquipment(address _equipmentContract, uint8 _equipmentType, uint16 _displayId, uint8 _rarity) view returns (tuple(uint256 id, address equipmentContract, uint8 equipmentType, uint16 displayId, uint8 rarity, uint256 currentPrice, uint256 minPrice, uint256 deltaPriceIncrease, uint256 decreaseRate, uint256 priceIncreaseDecay, uint256 lastPurchaseTimestamp, uint8 status));
    function getShopItems() view returns (tuple(uint256 id, address equipmentContract, uint8 equipmentType, uint16 displayId, uint8 rarity, uint256 currentPrice, uint256 minPrice, uint256 deltaPriceIncrease, uint256 decreaseRate, uint256 priceIncreaseDecay, uint256 lastPurchaseTimestamp, uint8 status)[]);

}
```

### ABI

{% file src="/files/vXVaMRhBVR2Itfw7NkTb" %}


# Visage Shop

## Contracts

### Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| DFK Chain | `0x4Ada1D06177D76C431C6A1d41Ef3f6fe193A5B4A` | `0x0A6b3Cbd3b4FD912bBFB164b3a8eC85049540e64` |
| Klaytn    | `0xab2F4b26E1c15ac7276C9F870c5877c0858DCe93` | `0x234ED0Ac7Aa41669B524d79645104F78f445d2a4` |

### Interface

```solidity
interface IVisageShop {

    // Events
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event OfferingPurchased(address indexed player, uint256 indexed offeringId, uint128 price, uint16 quantity, address paymentToken, tuple(address equipmentContract, uint8 equipmentType, uint16 displayId, uint8 rarity)[] items);
    event PromoMessage(uint256 indexed offeringId, string message);

    // Functions
    function buyOfferingWithGovToken(uint256 _offeringId, uint16 _quantity, uint256 _govTokenAmountMax, uint256 _deadline, address _mintTo) payable;
    function buyOfferingWithStablecoin(uint256 _offeringId, uint16 _quantity, address _mintTo);
    function buyOfferingsWithStablecoin(uint256[] _offeringIds, uint16[] _quantities, address _mintTo);
    function buyPromoOfferingWithGovToken(uint256 _offeringId, uint16 _quantity, uint256 _govTokenAmountMax, uint256 _deadline, address _mintTo, string _message) payable;
    function buyPromoOfferingWithStablecoin(uint256 _offeringId, uint16 _quantity, address _mintTo, string _message);
    function getGovTokenPrice() view returns (uint256);
    function getOffering(uint256 _offeringId) view returns (tuple(uint32 id, uint128 price, uint32 maxAvailable, uint64 craftedBy, uint64 startTime, uint64 endTime, bool isPromo, bool isFeatured, tuple(address equipmentContract, uint8 equipmentType, uint16 displayId, uint8 rarity)[] items, uint16 groupId));
    function getOfferingIds() view returns (uint256[]);
    function getOfferings() view returns (tuple(uint32 id, uint128 price, uint32 maxAvailable, uint64 craftedBy, uint64 startTime, uint64 endTime, bool isPromo, bool isFeatured, tuple(address equipmentContract, uint8 equipmentType, uint16 displayId, uint8 rarity)[] items, uint16 groupId)[]);
    function paused() view returns (bool);
    function purchaseCounts(uint256) view returns (uint32);

}
```

### ABI

{% file src="/files/mgtPw5nbJI6Zfspt8qpB" %}


# Pets

{% hint style="info" %}
**ERC721:** The PetCore contract is based on the ERC721 standard. For more detailed information please view the documentation by OpenZeppelin. <https://docs.openzeppelin.com/contracts/4.x/erc721>
{% endhint %}

## Contracts

{% hint style="warning" %}
The **PetCore** contract was upgraded to an ERC-2535 Diamond in May 2023 with the addition of new items to the Pet struct. At this time, methods and events using the new struct began to migrate to V2 versions. Legacy methods have been left in place, but will not return the new data.

The contract addresses did not change during this upgrade.
{% endhint %}

### Addresses

| Name      | Mainnet                                      | Testnet                                      |
| --------- | -------------------------------------------- | -------------------------------------------- |
| DFK Chain | `0x1990F87d6BC9D9385917E3EDa0A7674411C3Cd7F` | `0x5C827fa180B26d61DA3c89DD39D1b945DfBA7Dda` |
| Kaia      | `0x6362b205b539afb5FC369277365441c1dC6fAa28` | `0x71901994A6269aC8F787F70FAC7c5783C1e0B0B2` |
| Metis     | `0x74cE6E7cEF79F5ae6363c6CB1F6c2b528E92D7c7` | `0x0FAD77111b78B1dF31B12522Fb9298171bb2c55f` |

### Interfaces

<pre class="language-solidity"><code class="lang-solidity">interface IPetCoreDiamond {

    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
    event PetHatched(address indexed owner, uint256 indexed petId, tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo) pet);
    event PetHatchedV2(address indexed owner, uint256 indexed petId, tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo, address fedBy, uint8 foodType) pet);
    event PetUpdated(address indexed owner, uint256 indexed petId, tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo) pet);
    event PetUpdatedV2(address indexed owner, uint256 indexed petId, tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo, address fedBy, uint8 foodType) pet);
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    function approve(address to, uint256 tokenId);
    function balanceOf(address owner) view returns (uint256);
    function baseHungryTime() view returns (uint64);
    function bonusCount() view returns (uint32);
    function getApproved(uint256 tokenId) view returns (address);
    function getDuelPetData(uint256[] _heroIds) view returns (uint256[], uint8[]);
    function getPet(uint256 _id) view returns (tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo));
    function getPetQuestData(uint256 _id) view returns (tuple(uint64 hungryAt, uint8 rarity, uint8 profBonus, uint8 profBonusScalar, uint8 eggType, uint8 foodType));
    function getPetV2(uint256 _id) view returns (tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo, address fedBy, uint8 foodType));
    function getPetsV2(uint256[] _ids) view returns (tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo, address fedBy, uint8 foodType)[]);
    function getUserPets(address _address) view returns (tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo)[]);
    function getUserPetsV2(address _address) view returns (tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo, address fedBy, uint8 foodType)[]);
    function gold() view returns (address);
    function heroCore() view returns (address);
    function heroToPet(uint256) view returns (uint256);
    function isApprovedForAll(address owner, address operator) view returns (bool);
    function name() view returns (string);
    function nextPetId() view returns (uint256);
    function ownerOf(uint256 tokenId) view returns (address);
    function paused() view returns (bool);
    function powerUpManager() view returns (address);
    function safeTransferFrom(address from, address to, uint256 tokenId);
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data);
    function setApprovalForAll(address operator, bool approved);
    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);

    // Pet Feeding
    event BonusTreatsAwarded(address indexed player, uint8 treatType, uint256 quantity);
    event PetFed(address indexed fedBy, uint256 petId, uint8 foodType, uint256 hungryAt);
    event TreatCrafted(address indexed player, uint8 treatType, uint256 quantity, address item1, address item2);

    function PREMIUM_PROVISIONS() view returns (uint256);
    function baseHungryTime() view returns (uint64);
    function craftTreats(tuple(uint8 treatType, uint256 treatQuantity, address item1, address item2)[] _treatData);
    function feedPets(tuple(uint256 petId, uint8 treatType)[] _feedData);
    function getPetFedState(uint256 _id) view returns (bool);
<strong>    function isHeroPetHungry(uint256 _heroId) view returns (bool);
</strong>    function isPetHungry(uint256 _petId) view returns (bool);
    function treatInfo(uint8) view returns (address treatAddress, uint256 goldCost, bool isActive);
    function treatIngredientRequirements(uint8, address) view returns (uint256);
    
}
</code></pre>

### ABIs

{% file src="/files/qyrtM4v41yHML1pYf6ba" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### Harmony

| Name    | Mainnet                                      | Testnet                                      |
| ------- | -------------------------------------------- | -------------------------------------------- |
| PetCore | `0xAC9AFb5900C8A27B766bCad3A37423DC0F4C22d3` | `0x63F0AFcb278fD6A1f8A9Fa679880f22B580B18D2` |

### Interfaces

```solidity
interface IPetCore {

    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
    event PetHatched(address indexed owner, uint256 indexed petId, tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo) pet);
    event PetUpdated(address indexed owner, uint256 indexed petId, tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo) pet);
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
    
    function approve(address to, uint256 tokenId);
    function balanceOf(address owner) view returns (uint256);
    function getApproved(uint256 tokenId) view returns (address);
    function getPet(uint256 _id) view returns (tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo));
    function getUserPets(address _address) view returns (tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo)[]);
    function hatchPet(tuple(uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny) _petOptions, address owner) returns (uint256);
    function isApprovedForAll(address owner, address operator) view returns (bool);
    function name() view returns (string);
    function nextPetId() view returns (uint256);
    function ownerOf(uint256 tokenId) view returns (address);
    function paused() view returns (bool);
    function safeTransferFrom(address from, address to, uint256 tokenId);
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data);
    function setApprovalForAll(address operator, bool approved);
    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);
    function updatePet(tuple(uint256 id, uint8 originId, string name, uint8 season, uint8 eggType, uint8 rarity, uint8 element, uint8 bonusCount, uint8 profBonus, uint8 profBonusScalar, uint8 craftBonus, uint8 craftBonusScalar, uint8 combatBonus, uint8 combatBonusScalar, uint16 appearance, uint8 background, uint8 shiny, uint64 hungryAt, uint64 equippableAt, uint256 equippedTo) _pet);

}
```

### ABIs

{% file src="/files/nijYuQpDTEHDbA5ScMa5" %}

## Data Tables

Use these tables to parse the blockchain and API Pet data.

### Pet Info

#### Egg Type

```json
{
    0: "Blue Pet Egg",
    1: "Grey Pet Egg",
    2: "Green Pet Egg",
    3: "Yellow Pet Egg",
    4: "Golden Pet Egg"
}
```

#### Rarity

```json
{
    0: "Common",
    1: "Uncommon",
    2: "Rare",
    3: "Legendary",
    4: "Mythic"
}
```

#### Element

```json
{
    0: "Fire",
    1: "Water",
    2: "Earth",
    3: "Wind",
    4: "Lightning",
    5: "Ice",
    6: "Light",
    7: "Dark"
}
```

#### Appearance / Family / Variant

{% file src="/files/Fw98y2STi594t6UBZ7fc" %}

{% file src="/files/gHLansDD63cZLruTjbH3" %}

{% file src="/files/lGNmlqvxoUPkgX2SflP9" %}

#### Background

```json
{
    0: "Stillwood Meadow",
    1: "Forest Trail",
    2: "Swamp of Eoxis",
    3: "Vithraven Outskirts",
    4: "Path of Fire",
    5: "Reyalin Mountain Pass",
    6: "Adelyn Side Street",
    7: "Bloater Falls",
    8: "Haywood Farmstead",
    9: "Inner Grove",
    10: "Vuhlmira Ruins"
}
```

### Pet Bonuses

#### Bonus Rarity

```json
{
    1: "Common",
    80: "Rare",
    160: "Mythic"
}
```

#### Gathering Profession Bonus Type

Key mapping is by [Egg Type](#egg-type).

```json
{
    0: "Fishing",
    1: "Foraging",
    2: "Gardening"
}
```

#### Gathering Profession Bonus

{% hint style="warning" %}
Note that in the API, these values are padded by `10000 * eggType`.
{% endhint %}

```json
{
    // Blue Pet Bonuses
    0: { 
        1: "Unrevealed",
        80: "Unrevealed",
        160: "Unrevealed",
        2: "Efficient Angler",
        81: "Efficient Angler",
        161: "Efficient Angler",
        3: "Bountiful Catch",
        82: "Bountiful Catch",
        162: "Bountiful Catch",
        4: "Keen Eye",
        83: "Keen Eye",
        163: "Keen Eye",
        5: "Fortune Seeker",
        84: "Fortune Seeker",
        164: "Fortune Seeker",
        6: "Clutch Collector",
        85: "Clutch Collector",
        165: "Clutch Collector",
        7: "Runic Discoveries",
        86: "Runic Discoveries",
        166: "Runic Discoveries",
        8: "Skilled Angler",
        87: "Skilled Angler",
        167: "Skilled Angler",
        9: "Astute Angler",
        88: "Astute Angler",
        168: "Astute Angler",
        10: "Bonus Bounty",
        89: "Bonus Bounty",
        169: "Bonus Bounty",
        11: "Gaia's Chosen",
        90: "Gaia's Chosen",
        170: "Gaia's Chosen",
        171: "Innate Angler"
    },

    // Grey Pet Bonuses
    1: {
        1: "Unrevealed",
        80: "Unrevealed",
        160: "Unrevealed",
        2: "Efficient Scavenger",
        81: "Efficient Scavenger",
        161: "Efficient Scavenger",
        3: "Bountiful Haul",
        82: "Bountiful Haul",
        162: "Bountiful Haul",
        4: "Keen Eye",
        83: "Keen Eye",
        163: "Keen Eye",
        5: "Fortune Seeker",
        84: "Fortune Seeker",
        164: "Fortune Seeker",
        6: "Clutch Collector",
        85: "Clutch Collector",
        165: "Clutch Collector",
        7: "Runic Discoveries",
        86: "Runic Discoveries",
        166: "Runic Discoveries",
        8: "Skilled Scavenger",
        87: "Skilled Scavenger",
        167: "Skilled Scavenger",
        9: "Astute Scavenger",
        88: "Astute Scavenger",
        168: "Astute Scavenger",
        10: "Bonus Bounty",
        89: "Bonus Bounty",
        169: "Bonus Bounty",
        11: "Gaia's Chosen",
        90: "Gaia's Chosen",
        170: "Gaia's Chosen",
        171: "Innate Scavenger"
    },

    // Green Pet Bonuses
    2: {
        1: "Unrevealed",
        80: "Unrevealed",
        160: "Unrevealed",
        2: "Efficient Greenskeeper",
        81: "Efficient Greenskeeper",
        161: "Efficient Greenskeeper",
        3: "Bountiful Harvest",
        82: "Bountiful Harvest",
        162: "Bountiful Harvest",
        4: "Second Chance",
        83: "Second Chance",
        163: "Second Chance",
        5: "Clutch Collector",
        84: "Clutch Collector",
        164: "Clutch Collector",
        6: "Runic Discoveries",
        85: "Runic Discoveries",
        165: "Runic Discoveries",
        7: "Skilled Greenskeeper",
        86: "Skilled Greenskeeper",
        166: "Skilled Greenskeeper",
        8: "Astute Greenskeeper",
        87: "Astute Greenskeeper",
        167: "Astute Greenskeeper",
        9: "Bonus Bounty",
        88: "Bonus Bounty",
        168: "Bonus Bounty",
        10: "Gaia's Chosen",
        89: "Gaia's Chosen",
        169: "Gaia's Chosen",
        90: "Power Surge",
        170: "Power Surge",
        171: "Innate Greenskeeper"
    }
}
```

#### Crafting Bonus Type

Key mapping is by [Element](#element).

```json
{  
    0: "Blacksmithing",
    1: "Goldsmithing",
    2: "Armorsmithing",
    3: "Woodworking",
    4: "Leatherworking",
    5: "Tailoring",
    6: "Enchanting",
    7: "Alchemy"
}
```

#### Crafting Bonus

{% hint style="warning" %}
Note that in the API, these values are padded by `10000 * element`.
{% endhint %}

```json
{
    0: "None",
    1: "Undefined Common",
    80: "Undefined Rare",
    160: "Undefined Mythic"
}
```

### Pet Lore

#### Pet Descriptions

{% file src="/files/7cSaVVINCNxrIVf41yWR" %}

#### Pet Rarity Descriptors

{% file src="/files/nBgapj0DYEAPsaYFwAMI" %}

## Related Contracts

{% content-ref url="/pages/6QBc31Mb4Pslz5weaknb" %}
[Pet Hatching](/contracts/summoning/pet-hatching)
{% endcontent-ref %}

{% content-ref url="/pages/GBOgX1xoW4ICk9sTxtfU" %}
[Pet Exchange](/nfts/pets/pet-exchange)
{% endcontent-ref %}

{% content-ref url="/pages/5JO76C8WtGImBJRWyS2t" %}
[Pet Auction](/contracts/sales-and-rentals/pet-auction)
{% endcontent-ref %}

{% content-ref url="/pages/eN20ge2suvEWs00kkNM8" %}
[Pet Eggs](/collections/pet-eggs)
{% endcontent-ref %}

{% content-ref url="/pages/Nwx7cA57nGOLKaHfZwvN" %}
[Nutritionist](/crafting/nutritionist)
{% endcontent-ref %}

{% content-ref url="/pages/mI7ULr73G0wwaljyEWQF" %}
[Pet Treats](/collections/pet-treats)
{% endcontent-ref %}


# Pet Exchange

## Contracts

### Addresses

#### DFK Chain

| Name        | Mainnet                                      | Testnet                                      |
| ----------- | -------------------------------------------- | -------------------------------------------- |
| PetExchange | `0x50142D9e3FA508C424B3ef37BD195b4086CC3DCA` | `0xcF884770B942118d1d2df5A1CdC121e789056901` |
| Pasture     | `0xE959cbddB8616BDFFa5464279664CCbb9EA10317` | `0x1263B2a59F17b829D2a53d18a2f459EB77f6801c` |

#### Klaytn

| Name        | Mainnet                                      | Testnet                                      |
| ----------- | -------------------------------------------- | -------------------------------------------- |
| PetExchange | `0xe5D563F7e4144955FCFa8b90da45825426a05bD4` | `0x87924b65065B80f856873efFB38626fa6ce80f67` |
| Pasture     | `0x4aBb1cDe7a0C55850495E80E1806993b1B92F742` | `0x244BCc7a02b07Ae56B549A6181e353d8D69Fc4Cc` |

### Interfaces

```solidity
interface IPetExchange {

    event CompletedPetExchange(address indexed owner, uint256 indexed eggId1, uint256 indexed eggId2, uint8 eggTypeRecieved, uint256 exchangeId);
    event StartedPetExchange(address indexed owner, uint256 indexed eggId1, uint256 indexed eggId2, uint256 exchangeId);
    
    function completeExchange(uint256 _exchangeId);
    function eggs(uint256) view returns (address);
    function getPetExchange(uint256 _exchangeId) view returns (tuple(uint256 id, address owner, uint256 petId1, uint256 petId2, uint256 seedblock, uint256 finishTime, uint8 status));
    function getUserPetExchanges(address _address) view returns (tuple(uint256 id, address owner, uint256 petId1, uint256 petId2, uint256 seedblock, uint256 finishTime, uint8 status)[]);
    function idToPetExchange(uint256) view returns (uint256 id, address owner, uint256 petId1, uint256 petId2, uint256 seedblock, uint256 finishTime, uint8 status);
    function paused() view returns (bool);
    function profileExchangedPets(address, uint256) view returns (uint256 id, address owner, uint256 petId1, uint256 petId2, uint256 seedblock, uint256 finishTime, uint8 status);
    function startExchange(uint256 _petId1, uint256 _petId2);
    function totalExchanges() view returns (uint256);

}
```

```solidity
interface IPasture {

    event PetReleased(uint256 petId, string indexed releaseReason, uint256 releaseTime);
    
    function getProfileReleasedPet(address _profile, uint256 _index) view returns (tuple(uint256 id, uint256 petId, uint64 releaseTime, string releaseReason, address previousOwner));
    function getProfileReleasedPets(address _profile) view returns (tuple(uint256 id, uint256 petId, uint64 releaseTime, string releaseReason, address previousOwner)[]);
    function getReleasedPet(uint256 _petId) view returns (tuple(uint256 id, uint256 petId, uint64 releaseTime, string releaseReason, address previousOwner));
    function getReleasedPets() view returns (tuple(uint256 id, uint256 petId, uint64 releaseTime, string releaseReason, address previousOwner)[]);
    function petCore() view returns (address);
    function petToReleasedPet(uint256) view returns (uint256);
    function profileReleasedPets(address, uint256) view returns (uint256 id, uint256 petId, uint64 releaseTime, string releaseReason, address previousOwner);
    function releasePet(address _holder, uint256 _petId, string _releaseReason, address _previousOwner);
    function releasedPets(uint256) view returns (uint256 id, uint256 petId, uint64 releaseTime, string releaseReason, address previousOwner);

}
```

### ABIs

{% file src="/files/RnGaLhvhVSTp4i2BGhwv" %}

{% file src="/files/iN8l7rwz7LfEdkCZxGuz" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### Harmony

| Name        | Mainnet                                      | Testnet                                      |
| ----------- | -------------------------------------------- | -------------------------------------------- |
| PetExchange | `0xeaF833A0Ae97897f6F69a728C9c17916296cecCA` | `0x8e307808546922f09Ad1b6bc0677cF8Db7E3b558` |
| Pasture     | `0xE408814828f2b51649473c1a05B861495516B920` | `0x782bA5bfA06e8b5537e95AeaD2784cc7B920facb` |

### Interfaces

```solidity
interface IPetExchangeHarmony {

    event PetExchangeCompleted(address indexed owner, uint256 indexed eggId1, uint256 indexed eggId2, uint8 eggTypeRecieved);
    event PetExchangeStarted(address indexed owner, uint256 indexed eggId1, uint256 indexed eggId2);
    
    function completeExchange(uint256 _exchangeId);
    function eggs(uint256) view returns (address);
    function getPetExchange(uint256 _exchangeId) view returns (tuple(uint256 id, address owner, uint256 petId1, uint256 petId2, uint256 seedblock, uint256 finishTime, uint8 status));
    function getUserPetExchanges(address _address) view returns (tuple(uint256 id, address owner, uint256 petId1, uint256 petId2, uint256 seedblock, uint256 finishTime, uint8 status)[]);
    function idToPetExchange(uint256) view returns (uint256 id, address owner, uint256 petId1, uint256 petId2, uint256 seedblock, uint256 finishTime, uint8 status);
    function paused() view returns (bool);
    function profileExchangedPets(address, uint256) view returns (uint256 id, address owner, uint256 petId1, uint256 petId2, uint256 seedblock, uint256 finishTime, uint8 status);
    function startExchange(uint256 _petId1, uint256 _petId2);
    function totalExchanges() view returns (uint256);

}
```

### ABIs

{% file src="/files/xSNUV4ep9zRU2ZdMDiBL" %}

## Related Contracts

{% content-ref url="/pages/eN20ge2suvEWs00kkNM8" %}
[Pet Eggs](/collections/pet-eggs)
{% endcontent-ref %}


# Lands

{% hint style="info" %}
**ERC721:** The LandCore contract is based on the ERC721 standard. For more detailed information please view the documentation by OpenZeppelin. <https://docs.openzeppelin.com/contracts/4.x/erc721>
{% endhint %}

## Contracts

### Addresses

#### Klaytn

| Name     | Mainnet                                      | Testnet                                      |
| -------- | -------------------------------------------- | -------------------------------------------- |
| LandCore | `0x07520d5b2a7bf2DD0d48Bf08311Ac598F9ab4D4A` | `0xb719271c689fACC7FbAa7C5546ffb2178655e749` |

### Interfaces

```solidity
interface ILandCore {

    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
    event LandClaimed(address indexed owner, uint256 landId, uint256 indexed region);
    event LandMoved(uint256 landId, uint256 oldRegion, uint256 newRegion);
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
    
    function approve(address to, uint256 tokenId);
    function balanceOf(address owner) view returns (uint256);
    function claimLand(address _to, uint256 _tokenId);
    function getAccountLands(address _account) view returns (tuple(uint256 landId, string name, address owner, uint256 region, uint8 level, uint256 steward, uint64 score)[]);
    function getAllLands() view returns (tuple(uint256 landId, string name, address owner, uint256 region, uint8 level, uint256 steward, uint64 score)[]);
    function getApproved(uint256 tokenId) view returns (address);
    function getLand(uint256 _landId) view returns (tuple(uint256 landId, string name, address owner, uint256 region, uint8 level, uint256 steward, uint64 score));
    function getLandsByRegion(uint32 _region) view returns (tuple(uint256 landId, string name, address owner, uint256 region, uint8 level, uint256 steward, uint64 score)[]);
    function isApprovedForAll(address owner, address operator) view returns (bool);
    function landIdToMeta(uint256) view returns (uint256 landId, string name, address owner, uint256 region, uint8 level, uint256 steward, uint64 score);
    function name() view returns (string);
    function onERC721Received(address, address, uint256, bytes) pure returns (bytes4);
    function ownerOf(uint256 tokenId) view returns (address);
    function paused() view returns (bool);
    function regionToLandCount(uint256) view returns (uint256);
    function regionToLands(uint256, uint256) view returns (uint256);
    function safeMint(address _owner, uint256 _landId, string _name, uint32 _region);
    function safeTransferFrom(address from, address to, uint256 tokenId);
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data);
    function setApprovalForAll(address operator, bool approved);
    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);
    function updateLandRegion(uint256 _landId, uint256 _region, uint256 _oldLandIndex);

}
```

### ABIs

{% file src="/files/kWSfUI9xqwCIVw5OU8IW" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Addresses

#### Harmony

| Name     | Mainnet                                      | Testnet                                      |
| -------- | -------------------------------------------- | -------------------------------------------- |
| LandCore | `0xD5f5bE1037e457727e011ADE9Ca54d21c21a3F8A` | `0xDb4C51C17564a2382A17aeCBe9f17e2E64DFB45b` |

## Related Contracts

{% content-ref url="/pages/9g6r22tkHsI44noZcZ0P" %}
[Land Auction](/contracts/sales-and-rentals/land-auction)
{% endcontent-ref %}


# Ecosystem Token

{% hint style="success" %}
The JEWEL Token is a fully verified contract on Harmony: <https://explorer.harmony.one/address/0x72cb10c6bfa5624dd07ef608027e366bd690048f?activeTab=7>
{% endhint %}

{% hint style="warning" %}
When interacting with bridges and bridged tokens, always be mindful of liquidity.
{% endhint %}

## Contracts

### Addresses

#### Harmony

| Name                                                                                                           | Mainnet                                      | Testnet                                      |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/tokens/jewel_token_x2.png" alt="" data-size="line"> JEWEL | `0x72Cb10C6bfA5624dD07Ef608027E366bd690048F` | `0x63882d0438AdA0dD76ed2E6B7C2D53A55284A557` |
| synJEWEL ([Synapse](https://synapseprotocol.com/))                                                             | `0x28b42698Caf46B4B012CF38b6C75867E0762186D` | N/A                                          |

#### DFK Chain

{% hint style="info" %}
In addition to wJEWEL listed below, JEWEL is the native gas token on DFK Chain, which does not have its own separate contract address.
{% endhint %}

| Name                                                                                                            | Mainnet                                      | Testnet                                      |
| --------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/tokens/jewel_token_x2.png" alt="" data-size="line"> wJEWEL | `0xCCb93dABD71c8Dad03Fc4CE5559dC3D89F67a260` | `0x602daa4Db4778Cb958b161F11574b4A206606b4B` |

#### Kaia

| Name                                                                                                           | Mainnet                                      | Testnet                                      |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/tokens/jewel_token_x2.png" alt="" data-size="line"> JEWEL | `0x30C103f8f5A3A732DFe2dCE1Cc9446f545527b43` | `0xbb227Fcf45F9Dc5deF87208C534EAB1006d8Cc8d` |

#### Avalanche C-Chain

{% hint style="danger" %}
Note: The multiJEWEL token has been deprecated and is no longer in use. The Multichain bridge has shut down, and these tokens can no longer be redeemed off of C-Chain. Use caution when trading with this token.
{% endhint %}

| Name                                                   | Mainnet                                      | Testnet |
| ------------------------------------------------------ | -------------------------------------------- | ------- |
| synJEWEL ([Synapse](https://synapseprotocol.com/))     | `0x997Ddaa07d716995DE90577C123Db411584E5E46` | N/A     |
| multiJEWEL ([Multichain](https://app.multichain.org/)) | `0x4f60a160D8C2DDdaAfe16FCC57566dB84D674BD6` | N/A     |

#### Metis

| Name                                                                                                           | Mainnet                                      | Testnet                                      |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/tokens/jewel_token_x2.png" alt="" data-size="line"> JEWEL | `0x17C09cfC96C865CF546d73365Cedb6dC66986963` | `0xBBd856826174307285149457Cc58f4ff443371Dc` |

#### Ethereum Mainnet

| Name                                                                                                           | Mainnet                                      | Testnet |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/tokens/jewel_token_x2.png" alt="" data-size="line"> JEWEL | `0x12f79f8c1A6e47a9b5F0796FDb008Bdc182fa19e` | `N/A`   |

### Interfaces

```solidity
interface IJewelToken {
    
  event Approval(address indexed owner, address indexed spender, uint256 value);
  event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
  event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance);
  event Lock(address indexed to, uint256 value);
  event Transfer(address indexed from, address indexed to, uint256 value);
  event Unlock(address indexed to, uint256 value);

  function allowance(address owner, address spender) view returns (uint256);
  function approve(address spender, uint256 amount) returns (bool);
  function balanceOf(address account) view returns (uint256);
  function decimals() view returns (uint8);
  function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
  function increaseAllowance(address spender, uint256 addedValue) returns (bool);
  function lockFromBlock() view returns (uint256);
  function lockToBlock() view returns (uint256);
  function miner() view returns (address);
  function name() view returns (string);
  function owner() view returns (address);
  function symbol() view returns (string);
  function totalSupply() view returns (uint256);
  function transfer(address recipient, uint256 amount) returns (bool);
  function transferFrom(address sender, address recipient, uint256 amount) returns (bool);
  function cap() view returns (uint256);
  function lockFromUpdate(uint256 _newLockFrom);
  function lockToUpdate(uint256 _newLockTo);
  function unlockedSupply() view returns (uint256);
  function lockedSupply() view returns (uint256);
  function circulatingSupply() view returns (uint256);
  function totalLock() view returns (uint256);
  function totalBalanceOf(address _holder) view returns (uint256);
  function lockOf(address _holder) view returns (uint256);
  function lastUnlockBlock(address _holder) view returns (uint256);
  function lock(address _holder, uint256 _amount);
  function canUnlockAmount(address _holder) view returns (uint256);
  function unlockForUser(address account, uint256 amount);
  function unlock();
  function transferAll(address _to;
  function getCurrentVotes(address account) view returns (uint256);
  function getPriorVotes(address account, uint256 blockNumber) view returns (uint256);
  function maxTransferAmount() view returns (uint256);

}
```

```solidity
// Wrapped JEWEL (wJEWEL) on DFK Chain

interface IWrappedNativeToken {
    
    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function deposit() payable;
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function name() view returns (string);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    function withdraw(uint256 _amount)

}
```

### ABIs

{% file src="/files/rGDQHy9iQeeGMuKAc5cb" %}

{% file src="/files/m74p9AN1xLyswGjk8Ihf" %}


# Power Tokens

{% hint style="info" %}
**ERC20:** Power Tokens are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin: <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

### Suggested Use Cases

* Exchange Fees
* NFT Fees
* Transaction Fees
* Staking
* Escrow
* Purchases
* Governance
* Lending

## Contracts

### Addresses

#### DFK Chain

| Name                                                                                                               | Mainnet                                      | Testnet                                      |
| ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/tokens/crystal_token_x2.png" alt="" data-size="line"> CRYSTAL | `0x04b9dA42306B023f3572e106B11D82aAd9D32EBb` | `0xa5c47B4bEb35215fB0CF0Ea6516F9921591c3aCE` |

#### Klaytn

| Name                                                                 | Mainnet                                      | Testnet                                      |
| -------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="/files/YuvtycOjRU8wU3TMX6P9" alt="" data-size="line"> JADE | `0xB3F5867E277798b50ba7A71C0b24FDcA03045eDF` | `0x4dDD03B3850794534e01F2C95C93a45855058e19` |

### Interfaces

```solidity
interface ICrystalToken {
    
  event Approval(address indexed owner, address indexed spender, uint256 value);
  event Lock(address indexed to, uint256 value);
  event Transfer(address indexed from, address indexed to, uint256 value);
  event Unlock(address indexed to, uint256 value);

  function allowance(address owner, address spender) external view returns (uint256);
  function approve(address spender, uint256 amount) external returns (bool);
  function balanceOf(address account) external view returns (uint256);
  function canUnlockAmount(address _holder) external view returns (uint256);
  function cap() external view returns (uint256);
  function circulatingSupply() external view returns (uint256);
  function decimals() external view returns (uint8);
  function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);
  function increaseAllowance(address spender, uint256 addedValue) external returns (bool);
  function lastUnlockTime(address) external view returns (uint256);
  function lock(address _holder, uint256 _amount) external;
  function lockFromTime() external view returns (uint256);
  function lockOf(address _holder) external view returns (uint256);
  function lockToTime() external view returns (uint256);
  function name() external view returns (string memory);
  function owner() external view returns (address);
  function symbol() external view returns (string memory);
  function totalBalanceOf(address _holder) external view returns (uint256);
  function totalLock() external view returns (uint256);
  function totalSupply() external view returns (uint256);
  function transfer(address to, uint256 amount) external returns (bool);
  function transferAll(address _to) external;
  function transferAllInterval() external view returns (uint256);
  function transferAllTracker(address) external view returns (uint256);
  function transferFrom(address from, address to, uint256 amount) external returns (bool);
  function unlock() external;
  function unlockedSupply() external view returns (uint256);

}
```

### ABIs

{% file src="/files/AUGihK6iF62nQ8t936Li" %}


# Governance Tokens

{% hint style="info" %}
**ERC20:** Governance Tokens are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin: <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

### Suggested Use Case

* Governance Votes

## Contracts

### Addresses

#### DFK Chain

| Name                                                                                                            | Mainnet                                      | Testnet                                      |
| --------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/tokens/jewel_token_x2.png" alt="" data-size="line"> cJEWEL | `0x9ed2c155632C042CB8bC20634571fF1CA26f5742` | `0x1A956C4911218DDB2d4Fe78fD37b1884EC844a16` |

#### Klaytn

| Name                                                                                                            | Mainnet                                      | Testnet                                      |
| --------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/tokens/jewel_token_x2.png" alt="" data-size="line"> sJEWEL | `0xaA8548665bCC12C202d5d0C700093123F2463EA6` | `0x4419F44043301a38Ae6b6384c454740fe4DfB6eA` |

### Interfaces & ABIs

{% content-ref url="/pages/Z5n4cFVkwQvw7AULh6jf" %}
[Jeweler 2.0](/contracts/jeweler-2.0)
{% endcontent-ref %}

## Historical Contracts

{% hint style="info" %}
xJEWEL was retired as a Governance token on 11/4/2022. This change was passed [by community vote](https://vote.defikingdoms.com/#/proposal/0x8b74fefcfbd5b6751c190361577fd65ff79084b5250ed3265a14a16140d67fba) on 10/14/2022.
{% endhint %}

{% hint style="info" %}
xCRYSTAL was retired as a Governance token [by community vote](https://vote.defikingdoms.com/#/proposal/0x2a83ec79bf88a5d8170b831b4c941a934e47ca0c569a40bb8d240666978b73e6) on 9/1/2022.
{% endhint %}

#### Harmony

| Name                                                                                                                   | Mainnet                                      | Testnet                                      |
| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/tokens/jewel_token_x2.png" alt="" data-size="line"> xJEWEL (Bank) | `0xA9cE83507D872C5e1273E745aBcfDa849DAA654F` | `0x9bBD946ED9b6e9EA4FD85f3Fa9ADB9CC6f03c2BE` |

#### DFK Chain

| Name                                                                                                                       | Mainnet                                      | Testnet                                      |
| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/tokens/crystal_token_x2.png" alt="" data-size="line"> xCRYSTAL (Bank) | `0x6E7185872BCDf3F7a6cBbE81356e50DAFFB002d2` | `0x1A516207ABe4A0A636C6bB1C083c9EB46a026131` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/tokens/jewel_token_x2.png" alt="" data-size="line"> xJEWEL            | `0x77f2656d04E158f915bC22f07B779D94c1DC47Ff` | `0x3C351E1afdd1b1BC44e931E12D4E05D6125eaeCa` |

### Interfaces & ABIs

{% content-ref url="/pages/w7fV888JSgBy04xhTc3i" %}
[Jeweler 1.0](/contracts/jeweler-2.0/jeweler-1.0)
{% endcontent-ref %}


# Currencies

Currencies are in-game tokens that are earned and used in the general Play-to-Earn fashion.


# DFK Gold

Description

{% hint style="info" %}
**ERC20:** Currencies are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin: <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

{% hint style="warning" %}
DFK Gold has 3 decimals vs the standard 18 for ERC20s and the standard 0 for Inventory Items.
{% endhint %}

### Suggested Use Cases

* In-game Transactions
* Game Fees
* Crafting Fees

## Contracts

### Addresses

#### DFK Chain

| Name                                                                                                              | Mainnet                                      | Testnet                                      |
| ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/gold-pile.png" alt="" data-size="line"> Gold (DFKGOLD) | `0x576C260513204392F0eC0bc865450872025CB1cA` | `0xeCCC54b836cD5bf114daec723de1c0d89B0C2A7b` |

#### Kaia

| Name                                                                                                              | Mainnet                                      | Testnet                                      |
| ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/gold-pile.png" alt="" data-size="line"> Gold (DFKGOLD) | `0xe7a1B580942148451E47b92e95aEB8d31B0acA37` | `0x74852982B2371004b97584A5AAFeF71F7A5196B9` |

#### Metis

| Name                                                                                                              | Mainnet                                      | Testnet                                      |
| ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/gold-pile.png" alt="" data-size="line"> Gold (DFKGOLD) | `0xDeaF0ED1851accD469F0A42Ff9e9CC6804a619c5` | `0x67601BeBAa7fc8e2B699bE88501a02d2bd971258` |

### Interfaces

```solidity
interface IInventoryItem {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn(uint256 amount);
    function burnFrom(address account, uint256 amount);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function name() view returns (string);
    function paused() view returns (bool);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    
}
```

### ABIs

{% file src="/files/a1WUZVAHA5MNWuVe4aEw" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

| Name                                                                                                              | Mainnet                                      | Testnet                                      |
| ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/gold-pile.png" alt="" data-size="line"> Gold (DFKGOLD) | `0x3a4EDcf3312f44EF027acfd8c21382a5259936e7` | `0x24B46b91E0862221D39dd30FAAd63999717860Ab` |


# Gaia's Tears

Description

{% hint style="info" %}
**ERC20:** Currencies are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin: <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

{% hint style="warning" %}
Gaia's Tears has 0 decimals.
{% endhint %}

{% hint style="warning" %}
A new version of Gaia’s Tears was introduced on DFK Chain. Summoning on DFK Chain uses the new V2 token. V1 tokens can be migrated through the in-game inventory or the TokenMigrator contract. V2 Gaia's Tears cannot be bridged back to Harmony.
{% endhint %}

### Suggested Use Cases

* RNG-based fees for Gaia's blessings
* Anything to do with summoning NFTs

## Contracts

### Addresses

#### DFK Chain

| Name                                                                                                                              | Mainnet                                      | Testnet                                      |
| --------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/gaias-tear.png" alt="" data-size="line"> Gaia's Tears (DFKTEARS) \[V2] | `0x79fE1fCF16Cc0F7E28b4d7B97387452E3084b6dA` | `0xbE191ba492b5B2B9845A4801Ebd1940B5f772EE2` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/gaias-tear.png" alt="" data-size="line"> Gaia's Tears (DFKTEARS)       | `0x58E63A9bbb2047cd9Ba7E6bB4490C238d271c278` | `0x5829A860284f4c800a60ccDa4157e8dde0C32D30` |
| TokenMigrator                                                                                                                     | `0xBF956B8B9cBE8af30CE923dF24C339ecA7589a61` | `0x8487C9eB554F88e2e40FF32654b5A44BBB575875` |

#### Kaia

| Name                                                                                                                        | Mainnet                                      | Testnet                                      |
| --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/gaias-tear.png" alt="" data-size="line"> Gaia's Tears (DFKTEARS) | `0x8Be0cbA3c8c8F392408364ef21dfCF714A918234` | `0xbb8ac0BB95E433204217b0478B3f6d815EcB2d8C` |

#### Metis

| Name                                                                                                                        | Mainnet                                      | Testnet                                      |
| --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/gaias-tear.png" alt="" data-size="line"> Gaia's Tears (DFKTEARS) | `0x9d05F8289F0eA7D1993B316F45b8e6E29F7e5D16` | `0x02F334C88C6811d5B7609716a02fa6F4415e518d` |

### Interfaces

```solidity
interface IInventoryItem {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn(uint256 amount);
    function burnFrom(address account, uint256 amount);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function name() view returns (string);
    function paused() view returns (bool);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    
}
```

```solidity
interface ITokenMigrator {

    event TokensMigrated(address indexed account, address indexed token1, address indexed token2, uint256 amount);
    
    function migrate();
    function tokenV1() view returns (address);
    function tokenV2() view returns (address);
    
}
```

### ABIs

{% file src="/files/mlVxdmt7IRnIdVja03Hl" %}

{% file src="/files/7zC6QW2hVTBuTzYeW79Q" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

| Name                                                                                                                        | Mainnet                                      | Testnet                                      |
| --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/gaias-tear.png" alt="" data-size="line"> Gaia's Tears (DFKTEARS) | `0x24eA0D436d3c2602fbfEfBe6a16bBc304C963D04` | `0xf0e28E7c46F307954490fB1134c8D437e23D55fb` |


# Inventory Items

{% hint style="info" %}
**ERC20:** Inventory Items are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin: <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

{% hint style="warning" %}
Inventory Items have 0 decimals.
{% endhint %}

### Suggested Use Cases

* Ingredients
* Crafting
* Burning/Consumption
* Game Bonuses
* Trade

## Contracts

### Addresses

#### DFK Chain

<table><thead><tr><th width="261.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/ambertaffy.png" alt="" data-size="line"> Ambertaffy (DFKAMBRTFY)</td><td><code>0xB78d5580d6D897DE60E1A942A5C1dc07Bc716943</code></td><td><code>0x59Dc45470b495abF790e62a9a0bE935965FeE4cb</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/bluestem.png" alt="" data-size="line"> Bluestem (DFKBLUESTEM)</td><td><code>0x0776b936344DE7bd58A4738306a6c76835ce5D3F</code></td><td><code>0x360b42353FDF7Fd71Ad52509ae38F85cB638BDD1</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/darkweed.png" alt="" data-size="line"> Darkweed (DFKDRKWD)</td><td><code>0x848Ac8ddC199221Be3dD4e4124c462B806B6C4Fd</code></td><td><code>0xBe149BAE45c5b4EFd4b49a88cb90A4b671124a23</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/ironscale.png" alt="" data-size="line"> Ironscale (DFKIRONSCALE)</td><td><code>0x04B43D632F34ba4D4D72B0Dc2DC4B30402e5Cf88</code></td><td><code>0x434619b18466dEAA26475f97467754135aB8f3AF</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/lanterneye.png" alt="" data-size="line"> Lanterneye (DFKLANTERNEYE)</td><td><code>0xc2Ff93228441Ff4DD904c60Ecbc1CfA2886C76eB</code></td><td><code>0xc75E787AD4249df104D5632CdC1b5C238c0FD2d8</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/milkweed.png" alt="" data-size="line"> Milkweed (DFKMILKWEED)</td><td><code>0xA2cef1763e59198025259d76Ce8F9E60d27B17B5</code></td><td><code>0x0C735d4C724a99948b004815142482E1A7967822</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/rockroot.png" alt="" data-size="line"> Rockroot (DFKRCKRT)</td><td><code>0x60170664b52c035Fcb32CF5c9694b22b47882e5F</code></td><td><code>0x144132767a353f7485Fe09D19faAE19ca3905E61</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/sailfish.png" alt="" data-size="line"> Sailfish (DFKSAILFISH)</td><td><code>0x7f46E45f6e0361e7B9304f338404DA85CB94E33D</code></td><td><code>0x954296fd7563f737BD502e3DdbAdA3f5223F92f1</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/shimmerskin.png" alt="" data-size="line"> Shimmerskin (DFKSHIMMERSKIN)</td><td><code>0xd44ee492889C078934662cfeEc790883DCe245f3</code></td><td><code>0x4Cb69F1385D1ec1acEF351a98f67De5a56C74226</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/skunkShade.png" alt="" data-size="line"> Skunk Shade (DFKSKNSHADE)</td><td><code>0xc6030Afa09EDec1fd8e63a1dE10fC00E0146DaF3</code></td><td><code>0xb086584f476Ad21B40aF0672f385a67334A0b294</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/spider-fruit.png" alt="" data-size="line"> Spiderfruit (DFKSPIDRFRT)</td><td><code>0x3E022D84D397F18743a90155934aBAC421D5FA4C</code></td><td><code>0x22a20A56b9162B155BE51ACdD14051B142CF1a35</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swift-thistle.png" alt="" data-size="line"> Swift-Thistle (DFKSWFTHSL)</td><td><code>0x97b25DE9F61BBBA2aD51F1b706D4D7C04257f33A</code></td><td><code>0xd467f3cE950663b0195C25e615D6C7B2BC49699a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/threeEyedEel.png" alt="" data-size="line"> Three-Eyed Eel (DFKTHREEL)</td><td><code>0x6513757978E89e822772c16B60AE033781A29A4F</code></td><td><code>0x98c3ADd5c94C7d21a542107a61a2423730363F05</code></td></tr></tbody></table>

#### Kaia

<table><thead><tr><th width="261.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/ambertaffy.png" alt="" data-size="line"> Ambertaffy (DFKAMBRTFY)</td><td><code>0x75E8D8676d774C9429FbB148b30E304b5542aC3d</code></td><td><code>0x90924Dc4fc09FecEC2011C2b482284BEa0635d1f</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/bluestem.png" alt="" data-size="line"> Bluestem (DFKBLUESTEM)</td><td><code>0xDbd4fA2D2C62C6c60957a126970e412Ed6AC1bD6</code></td><td><code>0x8450F986dF4e3db6f015B5eF0BC1605CA2D5062d</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/darkweed.png" alt="" data-size="line"> Darkweed (DFKDRKWD)</td><td><code>0xEDFBe9EEf42FfAf8909EC9Ce0d79850BA0C232FE</code></td><td><code>0x257A82f9A5CdABA7A13bcc539917c2135D7Ef4f7</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/ironscale.png" alt="" data-size="line"> Ironscale (DFKIRONSCALE)</td><td><code>0xBcdD90034eB73e7Aec2598ea9082d381a285f63b</code></td><td><code>0x483de947758f264c8A68D6Ace3D9e0394FBb4547</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/lanterneye.png" alt="" data-size="line"> Lanterneye (DFKLANTERNEYE)</td><td><code>0x80A42Dc2909C0873294c5E359e8DF49cf21c74E4</code></td><td><code>0x59f4C8678e8359580DBE69De34e5bF12275a5fD0</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/milkweed.png" alt="" data-size="line"> Milkweed (DFKMILKWEED)</td><td><code>0xE408814828f2b51649473c1a05B861495516B920</code></td><td><code>0xBEDe2e252963025b7A4214F854226C5D42A675eF</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/rockroot.png" alt="" data-size="line"> Rockroot (DFKRCKRT)</td><td><code>0xf2D479DaEdE7F9e270a90615F8b1C52F3C487bC7</code></td><td><code>0x5B9a6275EEdaDc91d3AFAA3462600EF75aB1EB55</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/sailfish.png" alt="" data-size="line"> Sailfish (DFKSAILFISH)</td><td><code>0xc6030Afa09EDec1fd8e63a1dE10fC00E0146DaF3</code></td><td><code>0x54DaD24dDc2cC6E7616438816DE0EeFCad79B625</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/shimmerskin.png" alt="" data-size="line"> Shimmerskin (DFKSHIMMERSKIN)</td><td><code>0xa61Bac689AD6867a605633520D70C49e1dCce853</code></td><td><code>0x6A6d815D201361C9e0a008a3d49fceF92cA592FD</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/skunkShade.png" alt="" data-size="line"> Skunk Shade (DFKSKNSHADE)</td><td><code>0x874FC0015ece1d77ba3D5668F16c46ba72913239</code></td><td><code>0xd56FaEF679Dd814E552Ca3728ca11Aea80e696fB</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/spider-fruit.png" alt="" data-size="line"> Spiderfruit (DFKSPIDRFRT)</td><td><code>0x08D93Db24B783F8eBb68D7604bF358F5027330A6</code></td><td><code>0x1fd5FCA58293856e2a70adEC9a46Ed66394FFFB3</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swift-thistle.png" alt="" data-size="line"> Swift-Thistle (DFKSWFTHSL)</td><td><code>0xCd2192521BD8e33559b0CA24f3260fE6A26C28e4</code></td><td><code>0x0D977329743a48b8Dc787D5fD36352B94581d9ff</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/threeEyedEel.png" alt="" data-size="line"> Three-Eyed Eel (DFKTHREEL)</td><td><code>0x7E1298EBF3a8B259561df6E797Ff8561756E50EA</code></td><td><code>0x4A32c4125E8C61624EE3E4951db50B3E36023556</code></td></tr></tbody></table>

#### Metis

<table><thead><tr><th width="261.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/ambertaffy.png" alt="" data-size="line"> Ambertaffy (DFKAMBRTFY)</td><td><code>0xb6D1C4e5b131FA52Cfa48e5477aAe386B63B6fD6</code></td><td><code>0x27C6d743a1306E8f0c9BEb29443DDFC83bAe598e</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/bluestem.png" alt="" data-size="line"> Bluestem (DFKBLUESTEM)</td><td><code>0xd0C48d91b3a52C27C89548FC04e4b11891946CFB</code></td><td><code>0x9d1bd11762c26842adA4E5E3227f47B0e1C58428</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/darkweed.png" alt="" data-size="line"> Darkweed (DFKDRKWD)</td><td><code>0xe099eCbdd066636d19557d9509CF24bEdC1A5dF5</code></td><td><code>0x90fdE1546F64681Ff40f78Ee2D21d6b47076F89e</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/ironscale.png" alt="" data-size="line"> Ironscale (DFKIRONSCALE)</td><td><code>0x4419F44043301a38Ae6b6384c454740fe4DfB6eA</code></td><td><code>0xcB0012e4E56F682C6DF37484255EEb90f6D2eD72</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/lanterneye.png" alt="" data-size="line"> Lanterneye (DFKLANTERNEYE)</td><td><code>0x1a9c734AbBC91219eD383Bb9161302C54A4d5177</code></td><td><code>0x558D6304798Bee173f8Bc560BDc74B379841916c</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/milkweed.png" alt="" data-size="line"> Milkweed (DFKMILKWEED)</td><td><code>0x996a584676F14F1A58214AE20175d56b93cB1798</code></td><td><code>0x98A0077Fc43a596f408D1D4dCad05F1Cb079e24F</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/rockroot.png" alt="" data-size="line"> Rockroot (DFKRCKRT)</td><td><code>0x1dD6dcDd7E4191cC775259482E28454B7D6c85B0</code></td><td><code>0x231f471672eEBF8ef4bC5807AC582f7054027750</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/sailfish.png" alt="" data-size="line"> Sailfish (DFKSAILFISH)</td><td><code>0x55b5eC593b4BfD7441F2AB7cfD125FEDdB0a5526</code></td><td><code>0x4d4f6aCDE99298bB2FcEA7c807ed29F97D1A57fB</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/shimmerskin.png" alt="" data-size="line"> Shimmerskin (DFKSHIMMERSKIN)</td><td><code>0x16E11802d79d48eAdE94F8E0bd568fE4EA5CdA01</code></td><td><code>0xe5948bbe98e77CF192050a0e2A849A8B01595025</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/skunkShade.png" alt="" data-size="line"> Skunk Shade (DFKSKNSHADE)</td><td><code>0xDD3b10eA8217fA727AAe5A52cF7f04dc9b3911A9</code></td><td><code>0x451cEedFc189D573Ad00a22e5928B6e799300CC0</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/spider-fruit.png" alt="" data-size="line"> Spiderfruit (DFKSPIDRFRT)</td><td><code>0xEb88910Ad7B07b5cB0DEc521138d4E451b369A89</code></td><td><code>0x2D22395Bd97bADAFE7F848C6973A0D26DB260700</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swift-thistle.png" alt="" data-size="line"> Swift-Thistle (DFKSWFTHSL)</td><td><code>0xBB69DF1fcE676743c64ECBd2ad4D2C22Eb856BE0</code></td><td><code>0x838c96dd1BACa9bd023cC746a3A2DDF7aC5bD625</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/threeEyedEel.png" alt="" data-size="line"> Three-Eyed Eel (DFKTHREEL)</td><td><code>0xb2bC817C100a6bd60e8bf8a79dBAD607cE9C3cF2</code></td><td><code>0x61514958CB699373BDc9b4a0dbc6985CCbC94132</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IInventoryItem {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn(uint256 amount);
    function burnFrom(address account, uint256 amount);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function name() view returns (string);
    function paused() view returns (bool);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    
}
```

### ABIs

{% file src="/files/RJR1RKbI8ng4TjIUVki1" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

<table><thead><tr><th width="264.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/ambertaffy.png" alt="" data-size="line"> Ambertaffy (DFKAMBRTFY)</td><td><code>0x6e1bC01Cc52D165B357c42042cF608159A2B81c1</code></td><td><code>0xf644bc484724f964531242992178BC6C5B33C4a3</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/bluestem.png" alt="" data-size="line"> Bluestem (DFKBLUESTEM)</td><td><code>0xAC5c49Ff7E813dE1947DC74bbb1720c353079ac9</code></td><td><code>0xF7C247D04A346f86CCE9Afa8919CbE2B365187C1</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/darkweed.png" alt="" data-size="line"> Darkweed (DFKDRKWD)</td><td><code>0x68EA4640C5ce6cC0c9A1F17B7b882cB1cBEACcd7</code></td><td><code>0x70E1EF5418448EA3f2AfCd8D22CBC1cb53988A9a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/ironscale.png" alt="" data-size="line"> Ironscale (DFKIRONSCALE)</td><td><code>0xe4Cfee5bF05CeF3418DA74CFB89727D8E4fEE9FA</code></td><td><code>0x9578C39Dd4B56407C36aF3718D90a54e8422a706</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/lanterneye.png" alt="" data-size="line"> Lanterneye (DFKLANTERNEYE)</td><td><code>0x8Bf4A0888451C6b5412bCaD3D9dA3DCf5c6CA7BE</code></td><td><code>0x555174F89aF046F3972607b1a39dE8949d26c4E0</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/milkweed.png" alt="" data-size="line"> Milkweed (DFKMILKWEED)</td><td><code>0xc0214b37FCD01511E6283Af5423CF24C96BB9808</code></td><td><code>0x17A1d68BEDd3aBE09ddB0551baF97386fDd5dbEB</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/rockroot.png" alt="" data-size="line"> Rockroot (DFKRCKRT)</td><td><code>0x6B10Ad6E3b99090De20bF9f95F960addC35eF3E2</code></td><td><code>0x449C417faB9a54e9343Bb48667CB7A495fC7ac25</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/sailfish.png" alt="" data-size="line"> Sailfish (DFKSAILFISH)</td><td><code>0xb80A07e13240C31ec6dc0B5D72Af79d461dA3A70</code></td><td><code>0x9b794f8a2E89Ad6954ACe9454E832d467121F48a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/shimmerskin.png" alt="" data-size="line"> Shimmerskin (DFKSHIMMERSKIN)</td><td><code>0x372CaF681353758f985597A35266f7b330a2A44D</code></td><td><code>0xced132D80E18c8553aF415E27e9f79f32f3E4De3</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/spider-fruit.png" alt="" data-size="line"> Spiderfruit (DFKSPIDRFRT)</td><td><code>0x19B9F05cdE7A61ab7aae5b0ed91aA62FF51CF881</code></td><td><code>0x8808b672760db9fFc87aB26682D8368d31d29e54</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swift-thistle.png" alt="" data-size="line"> Swift-Thistle (DFKSWFTHSL)</td><td><code>0xCdfFe898E687E941b124dfB7d24983266492eF1d</code></td><td><code>0x3dc5DbE4eB979762Bbed0C559D0bfB4778582357</code></td></tr></tbody></table>


# Gold Crops

Gold Crops are a type of Inventory Item whose primary use case is being sold for Gold. Some of them may nevertheless be used in crafting or have additional utility.

{% hint style="info" %}
**ERC20:** Gold Crops are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin: <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

{% hint style="warning" %}
Gold Crops have 0 decimals
{% endhint %}

### Suggested Use Cases

* Trade for Gold
* Crafting
* Memes

## Contracts

### Addresses

#### DFK Chain

| Name                                                                                                                               | Mainnet                                      | Testnet                                      |
| ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/bloater.png" alt="" data-size="line"> Bloater (DFKBLOATER)              | `0x268CC8248FFB72Cd5F3e73A9a20Fa2FF40EfbA61` | `0x3C0B9C87b1747C47D0B73910f995A08D75D81Af1` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/frost-bloater.png" alt="" data-size="line"> Frost Bloater (DFKFBLOATER) | `0x3bcb9A3DaB194C6D8D44B424AF383E7Db51C82BD` | `0xeD5bA0739Bf175879A4b2d5E8AE2Ba537cB64703` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/frost-drum.png" alt="" data-size="line"> Frost Drum (DFKFROSTDRM)       | `0xe7a1B580942148451E47b92e95aEB8d31B0acA37` | `0x5b8ECf34d29eD2407E704150b44E04D21eF8e252` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/goldvein.png" alt="" data-size="line"> Goldvein (DFKGLDVN)              | `0x0096ffda7A8f8E00e9F8Bbd1cF082c14FA9d642e` | `0xd82eB52448476F634Fb6236E4925710Bd70f6Fd6` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/king-pincer.png" alt="" data-size="line"> King Pincer (DFKKINGPNCR)     | `0x60A3810a3963f23Fa70591435bbe93BF8786E202` | `0xcCba062c4e110D12E1d1aC272FfaCC19dF24C709` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/knaproot.png" alt="" data-size="line"> Knaproot (DFKKNAPROOT)           | `0xBcdD90034eB73e7Aec2598ea9082d381a285f63b` | `0x24DEbA3A73ACF76eDCfcafD75683a6064e01E77c` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/ragweed.png" alt="" data-size="line"> Ragweed (DFKRGWD)                 | `0x137995beEEec688296B0118131C1052546475fF3` | `0xe1b8C354BE50357c2ab90A962254526d08aF0D2D` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/redgill.png" alt="" data-size="line"> Redgill (DFKREDGILL)              | `0x68eE50dD7F1573423EE0Ed9c66Fc1A696f937e81` | `0x67E49492717b1c9683aab85FCcB0D4f0590F0e24` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/redleaf.png" alt="" data-size="line"> Redleaf (DFKRDLF)                 | `0x473A41e71618dD0709Ba56518256793371427d79` | `0xA396793Eb5895B914Cb6743E692A938325DdDeCB` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/shaggyCaps.png" alt="" data-size="line"> Shaggy Caps (DFKSHAGCAP)       | `0x80A42Dc2909C0873294c5E359e8DF49cf21c74E4` | `0x9CC41BD986A03bFbFeA7836e9B677dd51F466363` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/silverfin.png" alt="" data-size="line"> Silverfin (DFKSILVERFIN)        | `0xA7CFd21223151700FB82684Cd9c693596267375D` | `0x9A587bBD01D5B2745b20A89ddd9B83268129fEda` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/speckle-tail.png" alt="" data-size="line"> Speckle Tail (DFKSPCKLTL)    | `0xE7CB27ad646C49dC1671Cb9207176D864922C431` | `0x488D0EddbAfd98dFE97afF5187562D019bbb3245` |

#### Kaia

| Name                                                                                                                               | Mainnet                                      | Testnet                                      |
| ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/bloater.png" alt="" data-size="line"> Bloater (DFKBLOATER)              | `0x72F860bF73ffa3FC42B97BbcF43Ae80280CFcdc3` | `0xcEa07Fad1b5b5270b50085695c1e7efc3C09fa1a` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/frost-bloater.png" alt="" data-size="line"> Frost Bloater (DFKFBLOATER) | `0x18cB286EeCE992f79f601E49acde1D1F5dE32a30` | `0x22a3bdDD28DC255B230FD583E0Ee472eCD4fF9e3` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/frost-drum.png" alt="" data-size="line"> Frost Drum (DFKFROSTDRM)       | `0xD69542aBE74413242e387Efb9e55BE6A4863ca10` | `0xBCC526C5aCD9F23F2a9f85E9b72C7ca793b6a6FD` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/goldvein.png" alt="" data-size="line"> Goldvein (DFKGLDVN)              | `0xeaF833A0Ae97897f6F69a728C9c17916296cecCA` | `0x7ae57434B743e93D1beC1539afF31834a2208D40` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/king-pincer.png" alt="" data-size="line"> King Pincer (DFKKINGPNCR)     | `0xB4A516bf36e44c0CE9E3E6769D3BA87341Cd9959` | `0x1B3B7986d284762aA494dc9f177ac9605CCB9967` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/knaproot.png" alt="" data-size="line"> Knaproot (DFKKNAPROOT)           | `0xFceFA4Abcb18a7053393526f75Ad33fac5F25dc9` | `0x1FFEE1384dFcD98794BB536bac2A78D28F31dDF0` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/ragweed.png" alt="" data-size="line"> Ragweed (DFKRGWD)                 | `0x4cD7025BD6e1b77105b90928362e6715101d0b5a` | `0x46F036B26870188aD69877621815238D2b81bef1` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/redgill.png" alt="" data-size="line"> Redgill (DFKREDGILL)              | `0x8D2bC53106063A37bb3DDFCa8CfC1D262a9BDCeB` | `0x846cf306Dee35172e597b89cF6F7894BE63845e5` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/redleaf.png" alt="" data-size="line"> Redleaf (DFKRDLF)                 | `0xadbF23Fe3B47857614940dF31B28179685aE9B0c` | `0x1A03Cf9524605B3F5B1809632A6A41BE57f8B12A` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/shaggyCaps.png" alt="" data-size="line"> Shaggy Caps (DFKSHAGCAP)       | `0xCe370D379f0CCf746B3426E3BD3923f3aDF0DC1a` | `0x2A54e44Ade8E3077FC65A621a2216a46a3e1064D` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/silverfin.png" alt="" data-size="line"> Silverfin (DFKSILVERFIN)        | `0x7E121418cC5080C96d967cf6A033B0E541935097` | `0x6060759334739f1DB18BCBB92b4304a2D949d8c4` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/speckle-tail.png" alt="" data-size="line"> Speckle Tail (DFKSPCKLTL)    | `0x48d9fC80A47cee2d52DE950898Bc6aBF54223F81` | `0x52f7Cec2967B492b60CF2186067F89b4E4E245c5` |

#### Metis

| Name                                                                                                                               | Mainnet                                      | Testnet                                      |
| ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/bloater.png" alt="" data-size="line"> Bloater (DFKBLOATER)              | `0x170b348830099E3D4080975616248d45B83bAD0E` | `0x7E3Bf4A053500a3f0A976528F2e78Df0538c1dbF` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/frost-bloater.png" alt="" data-size="line"> Frost Bloater (DFKFBLOATER) | `0xCFeAd2748e845AB3Cacb9a54E19217172767744f` | `0x858101339753FC84e0a174f26A36a356cffBd25f` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/frost-drum.png" alt="" data-size="line"> Frost Drum (DFKFROSTDRM)       | `0xc67047E590054804b4a439CD04555fe05e709350` | `0xBe0684619D6f6520baA141f2183688067b973C3f` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/goldvein.png" alt="" data-size="line"> Goldvein (DFKGLDVN)              | `0xC0708d02e4F24368d445Acf0733d8380a1101d16` | `0xbEb0ffa168e0Ba6978b3A26FE78E4471b541afBe` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/king-pincer.png" alt="" data-size="line"> King Pincer (DFKKINGPNCR)     | `0x296255163Bd2cD44e5D6903fB90E797BAedA158c` | `0x3ED400Eb9b7B4850BEbf8B720fF584f18bA67068` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/knaproot.png" alt="" data-size="line"> Knaproot (DFKKNAPROOT)           | `0x1399cd3bA4Ca85026B360a158a6E048c0ae5E814` | `0x8F515A45376cFf6493e1b6B7f6dc3e9E6DcE9BA5` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/ragweed.png" alt="" data-size="line"> Ragweed (DFKRGWD)                 | `0x1430364f07aAF9f406E926af37609feeA9E8F7c6` | `0x31D2459eB2407E4b9af4E8716957263Cd5882Ce1` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/redgill.png" alt="" data-size="line"> Redgill (DFKREDGILL)              | `0xf724FE22b45D519D149477aA2eC5348Cee08Cae3` | `0x82561A789c8531Fd0a7Fb12C9E4FE08617980cA7` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/redleaf.png" alt="" data-size="line"> Redleaf (DFKRDLF)                 | `0xd774bA5c82be822b37B6198F12Bb1017e34fe232` | `0x4E593A0864C4B8E1A3FD35d471f99776915E9aDA` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/shaggyCaps.png" alt="" data-size="line"> Shaggy Caps (DFKSHAGCAP)       | `0x8464ec1908648C7d09DCbc43e949A6746B941F83` | `0x0b1eA445BC5E0506806a70854655b8F838061290` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/silverfin.png" alt="" data-size="line"> Silverfin (DFKSILVERFIN)        | `0x87B3E8A2A755aDe019E882DE42D5eA4e64D586dd` | `0x94F8bA841407c2f2af966BE6279121e40567cb15` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/speckle-tail.png" alt="" data-size="line"> Speckle Tail (DFKSPCKLTL)    | `0xBeFB707Aba26608C701bc4705F26eB8C2EEc8302` | `0x46119706eC292c4187B14ec59ea085fDC0148065` |

### Interfaces

```solidity
interface IInventoryItem {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn(uint256 amount);
    function burnFrom(address account, uint256 amount);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function name() view returns (string);
    function paused() view returns (bool);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    
}
```

### ABIs

{% file src="/files/RJR1RKbI8ng4TjIUVki1" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

| Name                                                                                                                        | Mainnet                                      | Testnet                                      |
| --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/bloater.png" alt="" data-size="line"> Bloater (DFKBLOATER)       | `0x78aED65A2Cc40C7D8B0dF1554Da60b38AD351432` | `0x87543cC8E5120fe9494B09d4908cAe7dADB7C90a` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/goldvein.png" alt="" data-size="line"> Goldvein (DFKGLDVN)       | `0x600541aD6Ce0a8b5dae68f086D46361534D20E80` | `0xCDDbE7Aeb5a87C5b815abDf07e25D0aA024C9E68` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/ragweed.png" alt="" data-size="line"> Ragweed (DFKRGWD)          | `0x043F9bd9Bb17dFc90dE3D416422695Dd8fa44486` | `0xa81D367C63F3e737688337fcbF4236Ce91f05347` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/redgill.png" alt="" data-size="line"> Redgill (DFKREDGILL)       | `0xc5891912718ccFFcC9732D1942cCD98d5934C2e1` | `0x59d94005ea7E8E5d44c265Fa64de7A5A34BD6F13` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/redleaf.png" alt="" data-size="line"> Redleaf (DFKRDLF)          | `0x094243DfABfBB3E6F71814618ace53f07362a84c` | `0x219f1576Ff3CaD0Eb12FC9C52E66656Db164b330` |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/items/silverfin.png" alt="" data-size="line"> Silverfin (DFKSILVERFIN) | `0x2493cfDAcc0f9c07240B5B1C4BE08c62b8eEff69` | `0xD6a6fc0279f915BCA59bf9BCf6F8619aa9eda756` |


# Combat Items

{% hint style="info" %}
**ERC20:** Combat Items are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin: <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

{% hint style="danger" %}
Combat Items are non-transferrable; they can only be burned after receiving permission from the user.
{% endhint %}

## Contracts

### Addresses

#### DFK Chain

<table data-full-width="true"><thead><tr><th width="285.3333333333333">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/void.gif" alt="" data-size="original"> Void Shard (DFKVOID)</td><td><code>0xBCd74403f82c61E247f2ba2A546EB3d0D2296936</code></td><td><code>0xC9307404C76D712A7f126ac2d3AF4C27dAA9Cd24</code></td></tr></tbody></table>

#### Klaytn

<table data-full-width="true"><thead><tr><th width="285.3333333333333">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/void.gif" alt="" data-size="original"> Void Shard (DFKVOID)</td><td><code>0x93B9a4aA929076404271f459a6140Cb46D94df5A</code></td><td><code>0xa6749aCfACC4FD7142F2D47040015D24D5C07941</code></td></tr></tbody></table>

### Interfaces

```solidity
interface INonTransferableInventoryItem {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn(uint256 amount);
    function burnFrom(address account, uint256 amount);
    function burnable() view returns (bool);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function name() view returns (string);
    function paused() view returns (bool);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    
}
```

### ABIs

{% file src="/files/EVnxnreYc75pHZqR1VRg" %}


# Miscellaneous Tokens


# Collectible Items

Description

{% hint style="info" %}
**ERC20:** Collectible Items are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin: <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

{% hint style="danger" %}
Collectible Items are non-transferrable; they can only be burned after receiving permission from the user.
{% endhint %}

## Contracts

### Addresses

#### DFK Chain

<table data-full-width="true"><thead><tr><th width="267.3333333333333">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/birthday-cake.gif" alt="" data-size="line"> DFK 1 Year Birthday Cake (DFKBDAY1)</td><td><code>0x184223A0921B58F5a0ddFD6448d8b2715EcC87a7</code></td><td><code>0x2C5911d6570F4AbbBe4E436e9aC9731C01Cddf7e</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/duel-participation-trophy.png" alt="" data-size="line"> Duel Season 0 Participation Trophy (DFKDS0PT)</td><td><code>0x69B4B9F339F9da27f28f610A395f2dE1F1A24141</code></td><td><code>0xcA99419602F77F8471A642b3be6Bd642c5654F34</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s1-solo-trophy.png" alt="" data-size="line"> Duel Season 1 Participation Trophy - Solo (DFKDS1T1PT)</td><td><code>0x4Aa517d7DAadD2e22d2b6d90F19a7BB01498116b</code></td><td><code>0xDEe87e6bD04a7D60dC9fcb05fE72141bA0f378a0</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s1-squad-trophy.png" alt="" data-size="line"> Duel Season 1 Participation Trophy - Squad (DFKDS1T3PT)</td><td><code>0xeC744dae4d68735d5AEA5FDB766FcE51D9A256a5</code></td><td><code>0x8B977F440Abe740e794E31b354f069B2F6822247</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s1-warr-trophy.png" alt="" data-size="line"> Duel Season 1 Participation Trophy - Warr (DFKDS1T9PT)</td><td><code>0x6EAD9B5d7Ae26c12CC40E393749999CB1707af5f</code></td><td><code>0xcc7968a0A7Dce9eb17Ca5F4DBCA01cb612607307</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s2-solo-trophy.png" alt="" data-size="line"> Duel Season 2 Participation Trophy - Solo (DFKDS2T1PT)</td><td><code>0x694D5bfe9EC280708891B34ef17eA8A0d3a6B1aF</code></td><td><code>0x471ED47e659488Cd7ac2713d3F704BF716d27801</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s2-squad-trophy.png" alt="" data-size="line"> Duel Season 2 Participation Trophy - Squad (DFKDS2T3PT)</td><td><code>0x7532Bbf5ea43cc2B561893dd0f72a6Ac1E03f193</code></td><td><code>0xb543C11ecBc5ac4a80f3F14d918bC5E9235d591e</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s2-warr-trophy.png" alt="" data-size="line"> Duel Season 2 Participation Trophy - Warr (DFKDS2T9PT)</td><td><code>0x9d12adfbF8884D320Bc36393AF661DfFA3E78aB8</code></td><td><code>0x679977dB868A0d0870fd3EC3A640707527655e1D</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s3-solo-trophy.png" alt="" data-size="line"> Duel Season 3 Participation Trophy - Solo (DFKDS3T1PT)</td><td><code>0x6dc8DA6c5dD94F3ACA1dDBd77fe482c0f428AfeF</code></td><td><code>0x0d00f91419c22C2053C6E8A8108A7396f225C305</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s3-squad-trophy.png" alt="" data-size="line"> Duel Season 3 Participation Trophy - Squad (DFKDS3T3PT)</td><td><code>0x5728F8613DB86F741a6aA1f8E3B290586435d276</code></td><td><code>0x8C5c07E5E66DCAe83CF165D73232eE5479045CdF</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s3-warr-trophy.png" alt="" data-size="line"> Duel Season 3 Participation Trophy - Warr (DFKDS3T9PT)</td><td><code>0x6d3b2C9e3B208Cb0f8a20392FdeD04C55c33CE6E</code></td><td><code>0x1451292280E0137a9e916c056390a7fbfe8bDA4E</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s4-solo-trophy.png" alt="" data-size="line"> Duel Season 4 Participation Trophy - Solo (DFKDS4T1PT)</td><td><code>0x0ca8DD915547c1Ba0EbE2a736d10aC079a259c10</code></td><td><code>0xEe63CDa177d8bAD814B069d49F5dD2Cc0274B57F</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s4-squad-trophy.png" alt="" data-size="line"> Duel Season 4 Participation Trophy - Squad (DFKDS4T3PT)</td><td><code>0x2917999397b7c901C31DD20a06C5C1197A66A564</code></td><td><code>0xcB9e3f1Bec5292355304d0A6e5D3F189F617B27A</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s4-warr-trophy.png" alt="" data-size="line"> Duel Season 4 Participation Trophy - Warr (DFKDS4T9PT)</td><td><code>0x4C14cc99Bd8E7B696a0c6383023dcD4c98B70f62</code></td><td><code>0x1495c2d56338aF530c5bb33D7DA67eCb2672953F</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s5-solo-trophy.png" alt="" data-size="line"> Duel Season 5 Participation Trophy - Solo (DFKDS5T1PT)</td><td><code>0x6FCfa7c5F14de887d574895D04034FA179559c77</code></td><td><code>0x89386609EeD3A87a7d9b4F2750bBdf147D446145</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s5-squad-trophy.png" alt="" data-size="line"> Duel Season 5 Participation Trophy - Squad (DFKDS5T3PT)</td><td><code>0x7646e21932C6769cf719d91c674Ad559B9Ef1cBD</code></td><td><code>0x1D8f0463b618C3Ab2ec3C84F0Ae79E83a5E1c529</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s5-warr-trophy.png" alt="" data-size="line"> Duel Season 5 Participation Trophy - Warr (DFKDS5T9PT)</td><td><code>0x758c9EB8927a1d80CA0391c34c45645f3abEc7ad</code></td><td><code>0xE61f1F4fFF8190CC5B028AeC22a12Bef70D1D5Dc</code></td></tr></tbody></table>

#### Klaytn

<table data-full-width="true"><thead><tr><th width="267.3333333333333">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s2-solo-trophy.png" alt="" data-size="line"> Duel Season 2 Participation Trophy - Solo (DFKDS2T1PT)</td><td><code>0xe52fceF6083e3d2E43D1113FC06caA6bAc9D3db9</code></td><td><code>0x3633F956410163A98D58D2D928B38C64A488654e</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s2-squad-trophy.png" alt="" data-size="line"> Duel Season 2 Participation Trophy - Squad (DFKDS1T3PT)</td><td><code>0xE7d77E157672864B500727551633E4Cc453964A9</code></td><td><code>0x17Fa96ba9d9C29e4B96d29A7e89a4E7B240E3343</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s2-warr-trophy.png" alt="" data-size="line"> Duel Season 2 Participation Trophy - Warr (DFKDS1T9PT)</td><td><code>0x2C9A39E85D4b3900a63B903113DE103FB448e578</code></td><td><code>0x9D71Bb9C781FC2eBdD3d6cb709438e3c71200149</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s3-solo-trophy.png" alt="" data-size="line"> Duel Season 3 Participation Trophy - Solo (DFKDS3T1PT)</td><td><code>0x1090ebCEaDDdA1e4dE6dE05a2C158751016b5a4b</code></td><td><code>0x6b1BA57ec8473C9ab9eeB56A322a4E5c8E51acc6</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s3-squad-trophy.png" alt="" data-size="line"> Duel Season 3 Participation Trophy - Squad (DFKDS3T3PT)</td><td><code>0x9428013ed7CEeeFFe97D3EceE43531781461dbFD</code></td><td><code>0xc4b7Ee47d4F3D53953Bed22556f8eDFE961545b2</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s3-warr-trophy.png" alt="" data-size="line"> Duel Season 3 Participation Trophy - Warr (DFKDS3T9PT)</td><td><code>0x576C7752989Ef12Ed4460E7297Ac78488056f8c6</code></td><td><code>0xae3F9C2cB387EEcA99BD15a7FE4F6950c1b9fc06</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s4-solo-trophy.png" alt="" data-size="line"> Duel Season 4 Participation Trophy - Solo (DFKDS4T1PT)</td><td><code>0x8B165dc793468422cd0C4C414f503bbBcded19Cd</code></td><td><code>0xD775764003781C1Fc75E23d9ED64B61C3e4b4624</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s4-squad-trophy.png" alt="" data-size="line"> Duel Season 4 Participation Trophy - Squad (DFKDS4T3PT)</td><td><code>0x91469f593Ae5C47C953f9132Ed9b322Dd4baF75c</code></td><td><code>0xcb1E597ed34fcf0CB3fA432671257C541c602288</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s4-warr-trophy.png" alt="" data-size="line"> Duel Season 4 Participation Trophy - Warr (DFKDS4T9PT)</td><td><code>0xCA30692b44d113364e6A0C06158194e642910B4D</code></td><td><code>0x4e9e8b824E474512f093068831Fa9545f3c671F7</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s5-solo-trophy.png" alt="" data-size="line"> Duel Season 5 Participation Trophy - Solo (DFKDS5T1PT)</td><td><code>0xAdE8f21d33654444b0A6f01647994682eB69ab4e</code></td><td><code>0x4d171a3F9f156f76fEA7A0c9B8ba0458d58c7F3f</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s5-squad-trophy.png" alt="" data-size="line"> Duel Season 5 Participation Trophy - Squad (DFKDS5T3PT)</td><td><code>0x168cE065510c2494AAE61159B41B0abf70315eCF</code></td><td><code>0x7aE0694252ED341Cf41B18a78Ec51EE5C5f73d15</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/s5-warr-trophy.png" alt="" data-size="line"> Duel Season 5 Participation Trophy - Warr (DFKDS5T9PT)</td><td><code>0x569cA77E2dCa320a6043f1365813cA1c72A5CeaD</code></td><td><code>0x9DEC629bD9C1ccFFDE1621E543afa030B48a8de8</code></td></tr></tbody></table>

### Interfaces

```solidity
interface INonTransferableInventoryItem {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn(uint256 amount);
    function burnFrom(address account, uint256 amount);
    function burnable() view returns (bool);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function name() view returns (string);
    function paused() view returns (bool);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    
}
```

### ABIs

{% file src="/files/EVnxnreYc75pHZqR1VRg" %}


# Raffle Tickets

Description

{% hint style="info" %}
**ERC20:** The Raffle Tickets are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin: <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

{% hint style="danger" %}
Raffle Tickets are non-transferrable except by bridging; they can only be burned after receiving permission from the user.
{% endhint %}

### Suggested Use Cases

* 3rd-party games can wholesale buy Raffle Tickets to award as prizes
* Game Rewards

To be eligible to wholesale purchase Raffle Tickets, submit a Master Raffle Application at: <https://build.defikingdoms.com/>.

## Contracts

### Addresses

#### DFK Chain

| Name             | Mainnet                                      | Testnet                                      |
| ---------------- | -------------------------------------------- | -------------------------------------------- |
| Raffle Ticket    | `0xBbd7c4Be2e54fF5e013471162e1ABAD7AB74c3C3` | `0x1ac602641F578A4Ec6705888Cc705C544cD8dd33` |
| Raffle Wholesale | `0x6e473afad39150ffdc18aab5d436c0cce06d44b2` | `0x87B3E8A2A755aDe019E882DE42D5eA4e64D586dd` |

#### Kaia

| Name             | Mainnet                                      | Testnet                                      |
| ---------------- | -------------------------------------------- | -------------------------------------------- |
| Raffle Ticket    | `0x3E5081337d1a12F261b013Bc08745fB3cd756Eb3` | `0x9ceAAF10e2353a31FB4715C48d22bCB7fD90EcE5` |
| Raffle Wholesale | `0xF455E000C75Bc92492e3FDc332DC3c6d1Ee83490` | `0x939Ea05C81aAC48F7C10BdB08615082B82C80c63` |

#### Metis

| Name                                                                                                                                      | Mainnet                                      | Testnet                                      |
| ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://defi-kingdoms.b-cdn.net/art-assets/tokens/submersian-shell.png" alt="" data-size="line"> Submersian Shell (DFKSUBSHELL) | `0x628ded2aB1741e6005ea3b99c070BB5AFd9d27AE` | `0x92162d9Fdca9D0b191Fd9A358412BE3F612a06fB` |

### Interfaces

```solidity
interface INonTransferableInventoryItem {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn(uint256 amount);
    function burnFrom(address account, uint256 amount);
    function burnable() view returns (bool);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function mint(address to, uint256 amount);
    function name() view returns (string);
    function paused() view returns (bool);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    
}
```

```solidity
interface IRaffleWholesale {

    event FeeAddressAdded(address indexed feeAddress, uint256 indexed feePercent);
    event FeeDeferred(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeDisbursed(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event FeeLockedBurned(address indexed source, address indexed from, address indexed to, address token, uint256 amount, uint64 timestamp);
    event LimitSet(address indexed wholesaler, uint256 limit);
    event PricingSet(address indexed wholesaler, tuple(uint256[] levels, uint256[] prices, uint256 periodLimit, uint256 method, uint256 startPeriod) pricing);
    event RefundClaimed(address indexed wholesaler, uint256 period, uint256 amount, uint256 refundableTickets);
    event TicketsPurchased(address indexed wholesaler, address indexed recipient, uint256 tickets);

    function claimRefund(uint256 _period);
    function costPerTicket() view returns (uint256);
    function currentPeriod() view returns (uint256);
    function feeAddresses(uint256) view returns (address);
    function feePercents(uint256) view returns (uint256);
    function getCurrentPeriod() returns (uint256);
    function paused() view returns (bool);
    function periodDuration() view returns (uint256);
    function periodLimit(address) view returns (uint256);
    function potentialRefundableTickets(address, uint256) view returns (uint256);
    function powerToken() view returns (address);
    function purchaseTickets(address _recipient, uint256 _tickets);
    function purchaseTicketsWithLocked(address _recipient, uint256 _tickets);
    function raffleTickets() view returns (address);
    function ticketsPurchased(address, uint256) view returns (uint256);
    function userPricing(address) view returns (uint256 periodLimit, uint256 method, uint256 startPeriod);

}
```

### ABIs

{% file src="/files/ZOY1Kz3xAk5pGoyM2Nxd" %}

{% file src="/files/JL96C3TPpww17hT2N2SF" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

| Name          | Mainnet                                      | Testnet                                      |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| Raffle Ticket | `0x0405f1b828C7C9462877cC70A9f266887FF55adA` | `0x262f3D1C9D6A0A99871f9Fc9BE6E1797D0ADbae4` |

## Related Contracts

{% content-ref url="/pages/m2dpAEE5I7HUpLg8cYUQ" %}
[DFK Duel](/contracts/dfk-duel)
{% endcontent-ref %}


# Alchemist

The Alchemist is a one-stop-shop for producing [Potions](/collections/potions-and-consumables), which can be used on your Heroes, or as reagents in [Stone Carving](/crafting/stone-carver).

## Contracts

### Addresses

#### DFK Chain

<table><thead><tr><th width="266.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>Alchemist (The Burned Man)</td><td><code>0x2542e1Ce063FED3b5Aa81936c5a8f6Eeccaa6B4A</code></td><td><code>0x91413C1e14381353a40bAB1b72C1D0b8755695Cb</code></td></tr></tbody></table>

#### Klaytn

<table><thead><tr><th width="268.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>Alchemist (Herbert)</td><td><code>0x696BECc6ddD5589a9a3Bb93fAc3A53D26b7cb819</code></td><td><code>0x5b0227Cf2f2C3b7d4847bE4fC56852f60DF52FD5</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IAlchemist {
    
    event PotionAdded(address indexed potionAddress, address[] requiredResources, uint32[] requiredQuantities);
    event PotionCreated(address indexed player, address potionAddress, uint256 quantity, address[] requiredResources, uint32[] requiredQuantities);
    event PotionUpdated(address indexed potionAddress, address[] requiredResources, uint32[] requiredQuantities, uint8 status);
    
    function addPotion( address _potionAddress, address[] _requiredResources, uint32[] _requiredQuantities );
    function addressToPotionId(address) external view returns (uint256);
    function createPotion(address _potionAddress, uint256 _quantity) external;
    function getPotion(address _potionAddress) external view returns (tuple(address potionAddress, address[] requiredResources, uint32[] requiredQuantities, uint8 status));
    function getPotions() external view returns (tuple(address potionAddress, address[] requiredResources, uint32[] requiredQuantities, uint8 status)[]);
    function paused() external view returns (bool);
    function potions(uint256) external view returns (address potionAddress, uint8 status);
    function updatePotion(address _potionAddress, address[] _requiredResources, uint32[] _requiredQuantities, uint8 _status) external;

}
```

### ABIs

{% file src="/files/KNEjpFWmflLibb9sRGSo" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

<table><thead><tr><th width="254.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>Alchemist (Herbert)</td><td><code>0x87CBa8F998F902f2fff990efFa1E261F35932e57</code></td><td><code>0x638C716b5aF694Cee4B0639826EAEbaAD03C2f66</code></td></tr></tbody></table>

## Recipes

Coming Soon


# Nutritionist

The Nutritionist assists users in crafting [Pet Treats](/collections/pet-treats) used in feeding [Pets](/nfts/pets). This contract is a facet on the [PetCore](/nfts/pets) diamond.

## Contracts

### Addresses

<table><thead><tr><th width="226.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>DFK Chain</td><td><code>0x1990F87d6BC9D9385917E3EDa0A7674411C3Cd7F</code></td><td><code>0x5C827fa180B26d61DA3c89DD39D1b945DfBA7Dda</code></td></tr><tr><td>Kaia</td><td><code>0x6362b205b539afb5FC369277365441c1dC6fAa28</code></td><td><code>0x71901994A6269aC8F787F70FAC7c5783C1e0B0B2</code></td></tr><tr><td>Metis</td><td><code>0x74cE6E7cEF79F5ae6363c6CB1F6c2b528E92D7c7</code></td><td><code>0x0FAD77111b78B1dF31B12522Fb9298171bb2c55f</code></td></tr></tbody></table>

### Interfaces

```solidity
interface INutritionist {

    event BonusTreatsAwarded(address indexed player, uint8 treatType, uint256 quantity);
    event PetFed(address indexed fedBy, uint256 petId, uint8 foodType, uint256 hungryAt);
    event TreatCrafted(address indexed player, uint8 treatType, uint256 quantity, address item1, address item2);
    
    function craftTreats(tuple(uint8 treatType, uint256 treatQuantity, address item1, address item2)[] _treatData);
    function feedPets(tuple(uint256 petId, uint8 treatType)[] _feedData);
    function treatInfo(uint8) view returns (address treatAddress, uint256 goldCost, bool isActive);
    function treatIngredientRequirements(uint8, address) view returns (uint256);

}
```

### ABIs

{% file src="/files/2UAkCbGQ47VYEve1RFFH" %}

## Types

### Treat Type

Use the following Treat Types when crafting Pet Treats and feeding Pets.

```solidity
enum TreatType {
    REGULAR,
    PREMIUM
}
```

## Related Contracts

{% content-ref url="/pages/ko1qoh2zncFAVdAaOBzk" %}
[Pets](/nfts/pets)
{% endcontent-ref %}

{% content-ref url="/pages/mI7ULr73G0wwaljyEWQF" %}
[Pet Treats](/collections/pet-treats)
{% endcontent-ref %}


# Stone Carver

The Stone Carver assists users in creating [Enhancement Stones](/collections/enhancement-stones) for use during Summoning.

## Contracts

### Addresses

#### DFK Chain

<table><thead><tr><th width="226.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>Stone Carver</td><td><code>0xc32A0e963e50AAAED273A75425fC39902b0d0b3b</code></td><td><code>0x70d70549fa208bEcB11946111216e8E687cDE452</code></td></tr></tbody></table>

#### Klaytn

<table><thead><tr><th width="226.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>Stone Carver</td><td><code>0x2A4906925b168C6983BdD777B034e566675ac7B3</code></td><td><code>0x75d8ba2E4725633FcdcC165332dCA04c107915cA</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IStoneCarver {

    event CrosschainUpdate(uint256 awayUntil);
    event RecipeSet(address indexed stoneAddress, address[] requiredResources, uint32[] requiredQuantities, bool active);
    event ShopSetUp(uint256 workingUntil, uint256 awayUntil);
    event StoneCarved(address indexed player, address stoneAddress, uint256 quantity);
    
    function awayUntil() view returns (uint256);
    function carveStone(address _stoneAddress, uint256 _quantity);
    function getAvailability() view returns (uint256, uint256);
    function getRecipe(address stoneAddress) view returns (tuple(address[] requiredResources, uint32[] requiredQuantities, bool active));
    function minClosedTime() view returns (uint256);
    function minOpenTime() view returns (uint256);
    function paused() view returns (bool);
    function recipes(address) view returns (bool active);
    function setUpShop();
    function varClosedTime() view returns (uint256);
    function varOpenTime() view returns (uint256);
    function workingUntil() view returns (uint256);

}
```

### ABIs

{% file src="/files/cajwFWfICgSIhTH1IzXF" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

<table><thead><tr><th width="227.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>Stone Carver</td><td><code>0xfFB8a55676edA75954AB45a6Ce16F88b119dC511</code></td><td><code>0xeAe7c8121eF9626362369b398B9F0Ee5E05fDA72</code></td></tr></tbody></table>

## Recipes

Coming soon


# Vendor (Item Gold Trader)

The Vendor (Item Gold Trader) is a stable trading system for [Inventory Items](/tokens/inventory-items) so that users can exchange [Gold](/tokens/currencies/dfk-gold) for needed items or [Gold Crops](/tokens/gold-crops) for Gold.&#x20;

## Contracts

### Addresses

#### DFK Chain

| Name                    | Mainnet                                      | Testnet                                      |
| ----------------------- | -------------------------------------------- | -------------------------------------------- |
| ItemGoldTraderV2 (Eevi) | `0x0f85fdf6c561C42d6b46d0E27ea6Aa9Bf9476B3f` | `0x9E721454207FA0FD6E3a362dAb66912EF004E958` |

#### Klaytn

| Name                    | Mainnet                                      | Testnet                                      |
| ----------------------- | -------------------------------------------- | -------------------------------------------- |
| ItemGoldTraderV2 (Zada) | `0x3Eab8a8F71dDA3e6c907C74302B734805C4f3278` | `0xEac3517251339877426cec94B245c0D8D83D7cb5` |

### Interfaces

```solidity
interface IItemGoldTraderV2 {

    event ItemAdded(address indexed item, uint256 startingPrice, uint256 playerSellPrice, uint256 minPrice, uint256 deltaPriceIncrease, uint256 decreaseRate, uint64 priceIncreaseDecay);
    event ItemTraded(address indexed player, address boughtItem, uint256 boughtQty, address soldItem, uint256 soldQty);
    event ItemUpdated(address indexed item, uint256 currentPrice, uint256 playerSellPrice, uint256 minPrice, uint256 deltaPriceIncrease, uint256 decreaseRate, uint64 priceIncreaseDecay, uint8 status);
    
    function addressToTradeItemId(address) view returns (uint256);
    function buyItem(address _itemAddress, uint256 _quantity, uint256 _maxPrice);
    function getNextPrice(address _itemAddress, uint256 _quantity) view returns (uint256);
    function getTradeItem(uint256 _id) view returns (tuple(uint256 id, address item, uint256 currentPrice, uint256 playerSellPrice, uint256 minPrice, uint256 deltaPriceIncrease, uint256 decreaseRate, uint64 priceIncreaseDecay, uint64 lastPurchaseTimestamp, uint8 status));
    function getTradeItemByAddress(address _itemAddress) view returns (tuple(uint256 id, address item, uint256 currentPrice, uint256 playerSellPrice, uint256 minPrice, uint256 deltaPriceIncrease, uint256 decreaseRate, uint64 priceIncreaseDecay, uint64 lastPurchaseTimestamp, uint8 status));
    function getTradeItems() view returns (tuple(uint256 id, address item, uint256 currentPrice, uint256 playerSellPrice, uint256 minPrice, uint256 deltaPriceIncrease, uint256 decreaseRate, uint64 priceIncreaseDecay, uint64 lastPurchaseTimestamp, uint8 status)[]);
    function paused() view returns (bool);
    function sellItem(address _itemAddress, uint256 _quantity);
    function tradeItems(uint256) view returns (uint256 id, address item, uint256 currentPrice, uint256 playerSellPrice, uint256 minPrice, uint256 deltaPriceIncrease, uint256 decreaseRate, uint64 priceIncreaseDecay, uint64 lastPurchaseTimestamp, uint8 status);
    
}
```

### ABIs

{% file src="/files/AYEFbOs1ryJLSK85RusL" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

{% hint style="info" %}
On 8/10/2022, the `ItemGoldTrader` contract was upgraded to V2 with the inclusion of dynamic pricing.&#x20;
{% endhint %}

### Addresses

#### Harmony

<table><thead><tr><th width="261.19811106064157">Name</th><th width="238.76239783644866">Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>ItemGoldTraderV2 (Zada)</td><td><code>0x5BDa5c3258c72c4890E6c1EA16f4F9E394FF3fB4</code></td><td>N/A</td></tr><tr><td>ItemGoldTrader (Zada)</td><td><code>0xe53BF78F8b99B6d356F93F41aFB9951168cca2c6</code></td><td><code>0x65D232da83d69A76189dA008Eb03BCFB211A1612</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IItemGoldTrader {

  event ItemAdded(address indexed item, uint256 buyPrice, uint256 sellPrice);
  event ItemTraded(address indexed player, address boughtItem, uint256 boughtQty, address soldItem, uint256 soldQty);
  event ItemUpdated(address indexed item, uint256 buyPrice, uint256 sellPrice, uint8 status);

  function addressToTradeItemId( address ) external view returns ( uint256 );
  function buyItem( address _itemAddress, uint256 _quantity ) external;
  function getTradeItems(  ) external view returns ( tuple[] );
  function paused(  ) external view returns ( bool );
  function sellItem( address _itemAddress, uint256 _quantity ) external;
  function tradeItems( uint256 ) external view returns ( uint256 id, address item, uint256 buyPrice, uint256 sellPrice, uint8 status );
  
}
```

### ABIs

{% file src="/files/ArctGNvOxP2VfunK7G9B" %}


# Runes

Runes are high-value assets that are needed to upgrade a Hero through the Meditation Circle and used for crafting. Additional Rune types will be released as Heroes progress in level.

{% hint style="info" %}
**ERC20:** Runes are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin:  <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

{% hint style="warning" %}
Runes have 0 decimals
{% endhint %}

## Contracts

### Addresses

#### DFK Chain

<table><thead><tr><th width="267.9646238371216">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/shvas-rune.gif" alt="" data-size="line"> Shvās Rune (DFKSHVAS)</td><td><code>0x75E8D8676d774C9429FbB148b30E304b5542aC3d</code></td><td><code>0xB5526A47A2858C2B29dCe89F3BD2B0726dcf5d18</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/moksha-rune.gif" alt="" data-size="line"> Moksha Rune (DFKMOKSHA)</td><td><code>0xCd2192521BD8e33559b0CA24f3260fE6A26C28e4</code></td><td><code>0xe9BfCc80800EB77a1eAF6881825936770aF83Eb6</code></td></tr></tbody></table>

#### Kaia

<table><thead><tr><th width="267.9646238371216">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/shvas-rune.gif" alt="" data-size="line"> Shvās Rune (DFKSHVAS)</td><td><code>0x907a98319AEB249e387246637149f4B2e7D21dB7</code></td><td><code>0xCE7ac1a4ea53CCB0C9fb855c13447a932A4A4471</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/moksha-rune.gif" alt="" data-size="line"> Moksha Rune (DFKMOKSHA)</td><td><code>0xd0223143057Eb44065e789b202E03A5869a6006C</code></td><td><code>0xD438F751DfBe682875dB0A3514f9237274C5383E</code></td></tr></tbody></table>

#### Metis

<table><thead><tr><th width="267.9646238371216">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/shvas-rune.gif" alt="" data-size="line"> Shvās Rune (DFKSHVAS)</td><td><code>0xFEd84c0C6a2517f1f48FdC5f1A2Ed00836826aa6</code></td><td><code>0x5477D7f1539aDC67787AEA54306700196B81E7c4</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/moksha-rune.gif" alt="" data-size="line"> Moksha Rune (DFKMOKSHA)</td><td><code>0x5fb51dff65eFf32644001981856f578120b8aE66</code></td><td><code>0x0202Ad2C873bCFfa0Fb23a52fA4eC1Db74e56F66</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IInventoryItem {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn(uint256 amount);
    function burnFrom(address account, uint256 amount);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function name() view returns (string);
    function paused() view returns (bool);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    
}
```

### ABIs

{% file src="/files/RJR1RKbI8ng4TjIUVki1" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

<table><thead><tr><th width="267.21333393332526">Name</th><th width="240.09206342742226">Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/shvas-rune.gif" alt="" data-size="line"> Shvās Rune (DFKSHVAS)</td><td><code>0x66F5BfD910cd83d3766c4B39d13730C911b2D286</code></td><td><code>0x457A99042D3ba3b61A036f3dC801243670c87c51</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/moksha-rune.gif" alt="" data-size="line"> Moksha Rune (DFKMOKSHA)</td><td><code>0x8F655142104478724bbC72664042EA09EBbF7B38</code></td><td><code>0x3e36768498A678bF3b36D2aF5d3d5974dC6d209a</code></td></tr></tbody></table>


# Pet Eggs

Pet Eggs are rare items that are used to hatch into [Pets](/nfts/pets).

{% hint style="info" %}
**ERC20:** Eggs are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin: <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

{% hint style="warning" %}
Eggs have 0 decimals
{% endhint %}

## Contracts

### Addresses

#### DFK Chain

<table><thead><tr><th width="263.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-blue.png" alt="" data-size="line"> Blue Pet Egg (DFKBLUEEGG)</td><td><code>0xa61Bac689AD6867a605633520D70C49e1dCce853</code></td><td><code>0xC6b00B4005883C1Ff09fa1351B0f49027bCAB71a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-golden.gif" alt="" data-size="line"> Golden Pet Egg (DFKGOLDEGG)</td><td><code>0xf2D479DaEdE7F9e270a90615F8b1C52F3C487bC7</code></td><td><code>0xdbEE8C336B06f2d30a6d2bB3817a3Ae0E34f4900</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-green.png" alt="" data-size="line"> Green Pet Egg (DFKGREENEGG)</td><td><code>0x8D2bC53106063A37bb3DDFCa8CfC1D262a9BDCeB</code></td><td><code>0xA9A8cc1AC7e7505a69cAca2E068716395CebE562</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-grey.png" alt="" data-size="line"> Grey Pet Egg (DFKGREGG)</td><td><code>0x7E121418cC5080C96d967cf6A033B0E541935097</code></td><td><code>0xC2198E513A341DA3Fb26b9dAf8d5b6C5480ceAB4</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-yellow.png" alt="" data-size="line"> Yellow Pet Egg (DFKYELOWEGG)</td><td><code>0x72F860bF73ffa3FC42B97BbcF43Ae80280CFcdc3</code></td><td><code>0x53b14727E0EdDDFc2958D65Ec6F86D1A3329e72F</code></td></tr></tbody></table>

#### Kaia

<table><thead><tr><th width="263.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-blue.png" alt="" data-size="line"> Blue Pet Egg (DFKBLUEEGG)</td><td><code>0x29ADd7D022c591D56eb4aFd262075dA900C67ab1</code></td><td><code>0xc9518D678Ea37488E8901b0687C02056CFe88C13</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-golden.gif" alt="" data-size="line"> Golden Pet Egg (DFKGOLDEGG)</td><td><code>0xc9731BE04F217543E3010cCbf903E858EFde840f</code></td><td><code>0xDEe702F3a2284B8Dbd1C3f7C85E6bda967DC566D</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-green.png" alt="" data-size="line"> Green Pet Egg (DFKGREENEGG)</td><td><code>0xb1Ec534fBBfEBd4563A4B0055E744286CE490f26</code></td><td><code>0xF2143c7c8Dfca976415bDf7d37dfa63aed8Ef741</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-grey.png" alt="" data-size="line"> Grey Pet Egg (DFKGREGG)</td><td><code>0xfd29ebdE0dd1331C19BBF54518df94b442ACb38C</code></td><td><code>0xBed733A13D2cF00A807427a47B4556Faa649984B</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-yellow.png" alt="" data-size="line"> Yellow Pet Egg (DFKYELOWEGG)</td><td><code>0x0A73aF98781bad9BCb80A71241F129EA877eF1b7</code></td><td><code>0x7E235f17c4ec372F9DD42916Cbd19C5b73d4C22E</code></td></tr></tbody></table>

#### Metis

<table><thead><tr><th width="263.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-blue.png" alt="" data-size="line"> Blue Pet Egg (DFKBLUEEGG)</td><td>0x9A3E3bF38C2a338d0a658a4b2c220A429a37f2c1</td><td>0x564fF09b5009d3DdD34071a3AC28d7F356Df83b4</td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-golden.gif" alt="" data-size="line"> Golden Pet Egg (DFKGOLDEGG)</td><td>0xC4a3D06B3E5D1244863285f439FA7A0711a1CD9f</td><td>0x397b9701FC224619f97702dD031A6629bbAc64e7</td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-green.png" alt="" data-size="line"> Green Pet Egg (DFKGREENEGG)</td><td>0x2DAC4d6461a383A66009846f0Dd9de976Ea5CE17</td><td>0x68F9705751DD348317e97F558Afc0973d45297b7</td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-grey.png" alt="" data-size="line"> Grey Pet Egg (DFKGREGG)</td><td>0x842DFd5E453eF385Dc276a2B7818ffaa9FBbfed6</td><td>0x640fc05E7c485a5f4A6f917B6373f3ec92b0d1E4</td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-yellow.png" alt="" data-size="line"> Yellow Pet Egg (DFKYELOWEGG)</td><td>0x1302718474bdAFe5a85f516836B4027e37B10abE</td><td>0x78AcA3345663E8A90328f3135C41D49F91879426</td></tr></tbody></table>

### Interfaces

```solidity
interface IInventoryItem {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn(uint256 amount);
    function burnFrom(address account, uint256 amount);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function name() view returns (string);
    function paused() view returns (bool);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    
}
```

### ABIs

{% file src="/files/RJR1RKbI8ng4TjIUVki1" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

<table><thead><tr><th width="264.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-blue.png" alt="" data-size="line"> Blue Pet Egg (DFKBLUEEGG)</td><td><code>0x9678518e04Fe02FB30b55e2D0e554E26306d0892</code></td><td><code>0x9D9675170946eAffb3A750DB75AB4B559cC91668</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-golden.gif" alt="" data-size="line"> Golden Pet Egg (DFKGOLDEGG)</td><td><code>0x9edb3Da18be4B03857f3d39F83e5C6AAD67bc148</code></td><td><code>0x7b81c426162977525084dEe06Cb9D73F8A9fD77e</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-green.png" alt="" data-size="line"> Green Pet Egg (DFKGREENEGG)</td><td><code>0x6d605303e9Ac53C59A3Da1ecE36C9660c7A71da5</code></td><td><code>0xa5fFbff0b47B05cAd7Ab217Ea103F546a4Dae31F</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-grey.png" alt="" data-size="line"> Grey Pet Egg (DFKGREGG)</td><td><code>0x95d02C1Dc58F05A015275eB49E107137D9Ee81Dc</code></td><td><code>0x2dd97351F41411B2fAf0FbEb4235737815c7857b</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-egg-yellow.png" alt="" data-size="line"> Yellow Pet Egg (DFKYELOWEGG)</td><td><code>0x3dB1fd0Ad479A46216919758144FD15A21C3e93c</code></td><td><code>0x6D02EF7f7686c3330a40A0AD9218b66A957C9405</code></td></tr></tbody></table>


# Pet Treats

Pet Treats are crafted by the [Nutritionist](/crafting/nutritionist) and are used to feed [Pets](/nfts/pets).

{% hint style="info" %}
**ERC20:** Pet Treats are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin: <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

{% hint style="warning" %}
Pet Treats have 0 decimals
{% endhint %}

## Contracts

### Addresses

#### DFK Chain

<table><thead><tr><th width="263.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-treat-regular.png" alt="" data-size="line"> Regular Pet Treat (DFKREGTRT)</td><td><code>0xAcDa84fAb3d3cdB38078b04901a26c103C37E7F4</code></td><td><code>0xCB2Fe6D2384b359a4362F4368525417F3002205D</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-treat-premium.png" alt="" data-size="line">Premium Pet Treat (DFKPRMTRT)</td><td><code>0x8Df3fFa5a677ba9737CE8Afcb8dd15Bd74085adD</code></td><td><code>0xb76D191B884b5c91fDD33864a14Ee87BE665Ad32</code></td></tr></tbody></table>

#### Kaia

<table><thead><tr><th width="263.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-treat-regular.png" alt="" data-size="line"> Regular Pet Treat (DFKREGTRT)</td><td><code>0x2F11e335224C5aBd3418B99922A9fe442F5696E9</code></td><td><code>0xA6A3fDD363A6c0a2FC0e50A4204c52cB5Dc06D7a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-treat-premium.png" alt="" data-size="line">Premium Pet Treat (DFKPRMTRT)</td><td><code>0xEec86C39e061B3Dec44f608Ff0ADA8053B8fFaDb</code></td><td><code>0x3d4a28AFbef326364DBA99aAaB87A5A31115de8B</code></td></tr></tbody></table>

#### Metis

<table><thead><tr><th width="263.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-treat-regular.png" alt="" data-size="line"> Regular Pet Treat (DFKREGTRT)</td><td><code>0x3a2b951de05B4A86A8eA8d23a51F75Edf4340E68</code></td><td><code>0x1526A8c1b6D09E38aaa2a2A8532C77291B94B7f7</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/pet-treat-premium.png" alt="" data-size="line">Premium Pet Treat (DFKPRMTRT)</td><td><code>0xc559206640FFb92b1b0C731c91CeFc1fD6a71DaC</code></td><td><code>0xCe7C5f89bA446eD97ee614AdfcC4CBeefFE2B5b2</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IInventoryItem {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn(uint256 amount);
    function burnFrom(address account, uint256 amount);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function name() view returns (string);
    function paused() view returns (bool);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    
}
```

### ABIs

{% file src="/files/RJR1RKbI8ng4TjIUVki1" %}

## Related Contracts

{% content-ref url="/pages/Nwx7cA57nGOLKaHfZwvN" %}
[Nutritionist](/crafting/nutritionist)
{% endcontent-ref %}

{% content-ref url="/pages/ko1qoh2zncFAVdAaOBzk" %}
[Pets](/nfts/pets)
{% endcontent-ref %}


# Potions & Consumables

Potions are a consumable items that will replenish a Hero's missing HP or MP, restore used Stamina, and provide bonuses during combat. Potions are craftable at the [Alchemist](/crafting/alchemist), and usable through the [ItemConsumer](/collections/potions-and-consumables/item-consumer) contract.

{% hint style="info" %}
**ERC20:** Potions are based on the ERC20 standard. For more information you can view the docs by OpenZeppelin. <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

{% hint style="warning" %}
Potions have 0 decimals
{% endhint %}

## Contracts

### Potions

#### DFK Chain

<table><thead><tr><th width="268.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/blindness-potion.png" alt="" data-size="line"> Anti-Blind Potion (DFKANTBLND)</td><td><code>0xe6Fd594437c4B91e8bd36475977593C98Bf089a4</code></td><td><code>0x580AC6618688eFfd12BC3eF15E6DE6Cdba19E677</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/antipoison-potion.png" alt="" data-size="line"> Anti-Poison Potion (DFKANTPSN)</td><td><code>0x84B252A4930A3656a469c6b360FcBEE991D555Bd</code></td><td><code>0xe7015821dBb19DFEA3a018B75fCDe31A6c3D36BC</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/health-potion-large.png" alt="" data-size="line"> Full Health Potion (DFKFHLTHPTN)</td><td><code>0xA0c2Fbbb3f52bCbCAb2600322a6fBC2653518E00</code></td><td><code>0x0589B7C8fC653342FE3f217CdeA7636a55817f17</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/mana-potion-large.png" alt="" data-size="line"> Full Mana Potion (DFKFMNPTN)</td><td><code>0x27bdc0f62DA17b13Cb134102dEf58dD9d578Ee10</code></td><td><code>0xd52E34bBAf8bf5b4c98B100ac17333C34C39F097</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/health-potion.png" alt="" data-size="line"> Health Vial (DFKHLTHVIAL)</td><td><code>0xc974f3f154FD19C8D03F6dbbA1775129f93c80cb</code></td><td><code>0xfDe4a5a4D07a28b8F39F48FCc1A0A63Bbc1B4eb6</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/magic-resist-potion.png" alt="" data-size="line"> Magic Resistance Potion (DFKMGCRSPTN)</td><td><code>0x4ED3e1b8D1212b2839dBB1f0EFA029792d92c90f</code></td><td><code>0xB60A5E6354620623945B1458c3ebf64a55E8B9ab</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/mana-potion.png" alt="" data-size="line"> Mana Vial (DFKMNVIAL)</td><td><code>0xBb9dEdfD96234315dD4899b438f9C41cD75dFdc6</code></td><td><code>0xaA6F8D27fDd633f67130c7a944475B15648D516a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/smoke-bomb.png" alt="" data-size="line"> Smoke Bomb (DFKSMOKBOMB)</td><td><code>0x52D8cac705430eaBd746e2bFdD7993333b6A3A07</code></td><td><code>0xc9E237889d4275671f4cd53a3Bd0A77363E45709</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/stamina-potion.png" alt="" data-size="line"> Stamina Vial (DFKSTMNPTN)</td><td><code>0x242078edFDca25ef2A497C8D9f256Fd641472E5F</code></td><td><code>0xe606f6548Ae34DA9065B4fee88990F239b445403</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-potion.png" alt="" data-size="line"> Swiftness Potion (DFKSWFTPTN)</td><td><code>0x1Ae5c72601AAF4C67C6a6004C4C2788D9EB5510C</code></td><td><code>0xDA5De41fBDDaa3a86e81CcBee9c024E74A3590f1</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/toughness-potion.png" alt="" data-size="line"> Toughness Potion (DFKTFNSPTN)</td><td><code>0x79d656A96139ED23CDf531d0dC34c000A0979c03</code></td><td><code>0x432cF215CfB21a9f8E4A1059E833932B7F8422Db</code></td></tr></tbody></table>

#### Kaia

<table><thead><tr><th width="268.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/blindness-potion.png" alt="" data-size="line"> Anti-Blind Potion (DFKANTBLND)</td><td><code>0xaa60922B48D75967486F5dded85144aa09dA680C</code></td><td><code>0x68Df730b7e420675A600513dd47314634f4fd6D8</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/antipoison-potion.png" alt="" data-size="line"> Anti-Poison Potion (DFKANTPSN)</td><td><code>0xe66A66D47A184A3acEbfd3f84E41Ac8535499ca9</code></td><td><code>0x6033264d5058a6FAb1Ae0f266A8e09278b220f3b</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/health-potion-large.png" alt="" data-size="line"> Full Health Potion (DFKFHLTHPTN)</td><td><code>0x8a9A5f9Cfe5dA00a077DF2E01a29a0c4EDadb174</code></td><td><code>0x5d748DB2e7Ea322232c04C34AE1c232c1d33A1Ef</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/mana-potion-large.png" alt="" data-size="line"> Full Mana Potion (DFKFMNPTN)</td><td><code>0xf371B19b7B9C990c8c72cC96a992558f40a85525</code></td><td><code>0xD3C018FA060a9dE0641900747AE8D54F0f0EfC22</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/health-potion.png" alt="" data-size="line"> Health Vial (DFKHLTHVIAL)</td><td><code>0xf0f001A44c895C6A3237fb4785648E9A9E8960fe</code></td><td><code>0x923DEb3ba0B8CCC9cb2E34486dbA1110520DBEdA</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/magic-resist-potion.png" alt="" data-size="line"> Magic Resistance Potion (DFKMGCRSPTN)</td><td><code>0xEeCafa01cebd3f38511dcF431d1bE86Abf044661</code></td><td><code>0xC257fa153018b1ee0888F9db9356a8997C85DaCe</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/mana-potion.png" alt="" data-size="line"> Mana Vial (DFKMNVIAL)</td><td><code>0x3634CaEbD0481abe98d1Cb29fD8Cc492382c3755</code></td><td><code>0x2d70Bd938272d0fc0795730bc96A1528d4785B95</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/smoke-bomb.png" alt="" data-size="line"> Smoke Bomb (DFKSMOKBOMB)</td><td><code>0x30162A9b8A97CEa2Bc482f8155A69a975536e9dc</code></td><td><code>0xd9B89F59b54548f84afDF9Fa46217E14E6d45851</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/stamina-potion.png" alt="" data-size="line"> Stamina Vial (DFKSTMNPTN)</td><td><code>0x4546DBaAb48Bf1BF2ad7B56d04952d946Ab6e2a7</code></td><td><code>0xdb79649De0Ebf772Cd0F2AD9b9d3784e6b0a0E14</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-potion.png" alt="" data-size="line"> Swiftness Potion (DFKSWFTPTN)</td><td><code>0x61F57C50fD281BfeAfcdFf812c24fAA555919a19</code></td><td><code>0xdD49F202a757B708C73bA261F82B0bFcdb2A5463</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/toughness-potion.png" alt="" data-size="line"> Toughness Potion (DFKTFNSPTN)</td><td><code>0x78279946215E5Bc8CE087bDd5C6DA6314408ecD7</code></td><td><code>0xD4A129449cfeEa442A55D8FD57A3EE60Ab8acB79</code></td></tr></tbody></table>

#### Metis

<table><thead><tr><th width="268.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/blindness-potion.png" alt="" data-size="line"> Anti-Blind Potion (DFKANTBLND)</td><td><code>0x6E473afAD39150FfDC18Aab5D436C0cce06D44B2</code></td><td><code>0x15150Ea04eccF40D9f619BeB558CA022E9AbA0Fe</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/antipoison-potion.png" alt="" data-size="line"> Anti-Poison Potion (DFKANTPSN)</td><td><code>0x04b2890C7241bced2006984C5a3F85C99FABFd0c</code></td><td><code>0x75Be67DA5ebfcA744087CBc3e9493C2EA74C18f0</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/health-potion-large.png" alt="" data-size="line"> Full Health Potion (DFKFHLTHPTN)</td><td><code>0x4E3c1463454ABaa87441C3206d48125715ceB2B3</code></td><td><code>0xfcE425b1ba36e7652568Fd2DdD001fAB72886145</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/mana-potion-large.png" alt="" data-size="line"> Full Mana Potion (DFKFMNPTN)</td><td><code>0x82b999269E4d2C1Dd1fbac4fb1a00eE82458fB56</code></td><td><code>0xB40e807E21Dc6aCbb490FC30cBfe72e975Ee0ec3</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/health-potion.png" alt="" data-size="line"> Health Vial (DFKHLTHVIAL)</td><td><code>0xD9551F2A44DE25E833e103eb9217F096f9d09eab</code></td><td><code>0xc84e7B45Aa6Fd51C60fD480B073a4d43444cFC4b</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/magic-resist-potion.png" alt="" data-size="line"> Magic Resistance Potion (DFKMGCRSPTN)</td><td><code>0xf5895209781ea575be5cF6286cbA2275bE577734</code></td><td><code>0x51267E51628A46ee1502913cA006CFd95Fa4e2Ed</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/mana-potion.png" alt="" data-size="line"> Mana Vial (DFKMNVIAL)</td><td><code>0xEf4bE4fb3E03D173F29DbFE8F8f2Da26fDA95932</code></td><td><code>0x9e75D73E2AF493832d2ed85900DC6fe66528A836</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/smoke-bomb.png" alt="" data-size="line"> Smoke Bomb (DFKSMOKBOMB)</td><td><code>0x932049DF7f09DeE7cF5Aefe03f373810EBbdDDc7</code></td><td><code>0x8fe8510667eB5E4dBDD51020Bf802D1AAb3D709C</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/stamina-potion.png" alt="" data-size="line"> Stamina Vial (DFKSTMNPTN)</td><td><code>0x2DC1b89d20878aD9dc06e7e165f340d6CCa78475</code></td><td><code>0xbf8bE9075D5B81bd57bA2476293f96027c79901A</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-potion.png" alt="" data-size="line"> Swiftness Potion (DFKSWFTPTN)</td><td><code>0x797b89420A898Df912fadfD7CfE7840f7f19cD52</code></td><td><code>0x81EbEF672E6923Cbd2925D1CA37F233a3f7ACD9B</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/toughness-potion.png" alt="" data-size="line"> Toughness Potion (DFKTFNSPTN)</td><td><code>0x1360de63Ce2c34ac3c49aa4fa99046e8F3E86380</code></td><td><code>0x14215E4D0A946CE1396F1cD49FF1deB6F10bD648</code></td></tr></tbody></table>

### Potion Crates

#### DFK Chain

<table><thead><tr><th width="268.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-anti-blindness-potion.png" alt="" data-size="line"> Anti-Blind Potion Crate (DFKANTBLNDCRT)</td><td><code>0x5986045e7c221c8AD40A736B6434D82E29687aeB</code></td><td><code>0x9a5F30808f7b608c1d68915AeC8fA9180D9a7bDa</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-anti-poison.png" alt="" data-size="line"> Anti-Poison Potion Crate (DFKANTPSNCRT)</td><td><code>0x449eB718e351a86718A090A1a8Db3FD561306d9b</code></td><td><code>0x1AB2D40bA223fBfD3B0f734Ba3a0597c213A3277</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-full-health.png" alt="" data-size="line"> Full Health Potion Crate (DFKFHLTHCRT)</td><td><code>0x5948dd8Df6afEFE05B033AD8f3ae513a9Cd4F1Dc</code></td><td><code>0xd56FaEF679Dd814E552Ca3728ca11Aea80e696fB</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-full-mana.png" alt="" data-size="line"> Full Mana Potion Crate (DFKFMNCRT)</td><td><code>0xf17FD21bDF6713a1Dfed668b97835b21e32651e8</code></td><td><code>0x7E235f17c4ec372F9DD42916Cbd19C5b73d4C22E</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-health-vial.png" alt="" data-size="line"> Health Vial Crate (DFKHLTHCRT)</td><td><code>0x591853e01EcFDcF1Bdc9f093423C197BfBBd1A4f</code></td><td><code>0x1ffee1384dfcd98794bb536bac2a78d28f31ddf0</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-magic-resistance-potion.png" alt="" data-size="line"> Magic Resistance Potion Crate (DFKMGCRSCRT)</td><td><code>0xFADCb72aAE2713975a890b59FF47231D1A552De3</code></td><td><code>0xB0e402ef0cdE9387f1EC21994392f95561624d3f</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-mana-vial.png" alt="" data-size="line"> Mana Vial Crate (DFKMNCRT)</td><td><code>0x240da5314B05E84392e868aC8f2b80ad6becadd4</code></td><td><code>0xBed733A13D2cF00A807427a47B4556Faa649984B</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-swiftness-potion.png" alt="" data-size="line"> Swiftness Potion Crate (DFKSWFTCRT)</td><td><code>0x84246Ce3988742D46fC00d9b8b2AFb5CDBDaE660</code></td><td><code>0x74852982B2371004b97584A5AAFeF71F7A5196B9</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-toughness-potion.png" alt="" data-size="line"> Toughness Potion Crate (DFKTFNSCRT)</td><td><code>0x2dfFf745d2c7ddCAD4E97b80DF33705B1a95A172</code></td><td><code>0x542a3903c7F2dD47a7F31b08Bd1C6791e3C43784</code></td></tr></tbody></table>

#### Klaytn

<table><thead><tr><th width="268.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-anti-blindness-potion.png" alt="" data-size="line"> Anti-Blind Potion Crate (DFKANTBLNDCRT)</td><td><code>0x5FB537aF1d929af7BDD7935C289158c940782ed6</code></td><td><code>0xEd19C45869d89c6A8060D7D3ff4D1FF70f649dd1</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-anti-poison.png" alt="" data-size="line"> Anti-Poison Potion Crate (DFKANTPSNCRT)</td><td><code>0xE34a733fA92B41A1CA4241da9D2d5834Cc8D1011</code></td><td><code>0xfe8dd988FcC3Feed86468E2A8FA586fFbD1E39EF</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-full-health.png" alt="" data-size="line"> Full Health Potion Crate (DFKFHLTHCRT)</td><td><code>0xf710244462431b9962706B46826AFB3B38376c7b</code></td><td><code>0x201Ec729782c79F62070E0b5F2016bB51700de87</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-full-mana.png" alt="" data-size="line"> Full Mana Potion Crate (DFKFMNCRT)</td><td><code>0x108D31E23bC6540878E6532F3376b3EC982e1C58</code></td><td><code>0xF3b3921c7b4F8e512bACb3Caf71e39E36A599469</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-health-vial.png" alt="" data-size="line"> Health Vial Crate (DFKHLTHCRT)</td><td><code>0xa27C1429a676db902B9f0360686eDbB57d0A7B01</code></td><td><code>0x2282F63D9997D0C0Fc81Fd9DA11467dd1F35a140</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-magic-resistance-potion.png" alt="" data-size="line"> Magic Resistance Potion Crate (DFKMGCRSCRT)</td><td><code>0x9c8A0C6a7ad8Be153773070D434CDbeA5176D2ff</code></td><td><code>0xDE05399Ba5DcAe574833Da62405425D162231EA9</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-mana-vial.png" alt="" data-size="line"> Mana Vial Crate (DFKMNCRT)</td><td><code>0x8639d64A2088500EC4f20fB5C41A995fE4f1d85a</code></td><td><code>0x4A437018E6aEC50e76713d1631F877E9973a87ae</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-swiftness-potion.png" alt="" data-size="line"> Swiftness Potion Crate (DFKSWFTCRT)</td><td><code>0xcb7aA7cA9357DAF9F2b78D262A4f89cDfE5abC70</code></td><td><code>0x3E97B4d382E2D110f22E9aB5d2Ba569eda5e9bd2</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-toughness-potion.png" alt="" data-size="line"> Toughness Potion Crate (DFKTFNSCRT)</td><td><code>0xf757a7F4ffF29e7F7b4aCCe6Ffb04E59e91EFDA8</code></td><td><code>0xBb0D45043451d0126BbA61eDF88d445465A37e01</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IInventoryItem {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn(uint256 amount);
    function burnFrom(address account, uint256 amount);
    function consume(address player, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) _hero) returns (tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions));
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function name() view returns (string);
    function paused() view returns (bool);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
  
}
```

### ABIs

{% file src="/files/GqKO6dye265FylPJo5l8" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

<table><thead><tr><th width="266.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-anti-blindness-potion.png" alt="" data-size="line"> Anti-Blind Potion Crate (DFKANTBLNDCRT)</td><td><code>0x1771dEc8D9A29F30d82443dE0a69e7b6824e2F53</code></td><td><code>0x9D2C253a10738A8b2762b4cd17F3F98F39F86167</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-anti-poison.png" alt="" data-size="line"> Anti-Poison Potion Crate (DFKANTPSNCRT)</td><td><code>0xA1f8b0E88c51a45E152934686270DDF4E3356278</code></td><td><code>0xaf278b61cdF5B5119b5386f4E91F8D0a1495b864</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-full-health.png" alt="" data-size="line"> Full Health Potion Crate (DFKFHLTHCRT)</td><td><code>0x87361363A75c9A6303ce813D0B2656c34B68FF52</code></td><td><code>0xbD1CF764D09378b387B0f052099978fD7f658B60</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-full-mana.png" alt="" data-size="line"> Full Mana Potion Crate (DFKFMNCRT)</td><td><code>0xDc2C698aF26Ff935cD1c50Eef3a4A933C62AF18D</code></td><td><code>0xaf4cB190B6Ec0c63706B2158a0A73071C1599d18</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-health-vial.png" alt="" data-size="line"> Health Vial Crate (DFKHLTHCRT)</td><td><code>0x2789F04d22a845dC854145d3c289240517f2BcF0</code></td><td><code>0x2314891F7c5EccF899d1Dc6c35A971c23e7E9c31</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-magic-resistance-potion.png" alt="" data-size="line"> Magic Resistance Potion Crate (DFKMGCRSCRT)</td><td><code>0x7e120334D9AFFc0982719A4eacC045F78BF41C68</code></td><td><code>0x9B589B52Ed702197b4A793B435cc119AAC1c376d</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-mana-vial.png" alt="" data-size="line"> Mana Vial Crate (DFKMNCRT)</td><td><code>0x19b020001AB0C12Ffa93e1FDeF90c7C37C8C71ef</code></td><td><code>0x7457513C38089CC565fe543268DEe85aB0C738A3</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/stamina-potion.png" alt="" data-size="line"> Stamina Vial (DFKSTMNPTN)</td><td><code>0x959ba19508827d1ed2333B1b503Bd5ab006C710e</code></td><td><code>0x4b8a24950c91886d49B8156B24fb3DB4f90D7930</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-swiftness-potion.png" alt="" data-size="line"> Swiftness Potion Crate (DFKSWFTCRT)</td><td><code>0x872dD1595544CE22ad1e0174449C7ECE6F0bb01b</code></td><td><code>0x2724b01CcCE03e9c10B8a8Dfa4e850A22B4e908B</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/crate-toughness-potion.png" alt="" data-size="line"> Toughness Potion Crate (DFKTFNSCRT)</td><td><code>0xFb03c364969a0bB572Ce62b8Cd616A7DDEb4c09A</code></td><td><code>0xdF0bD83eA9D7ffA04f9515383E24Cd607b0DD932</code></td></tr></tbody></table>


# Item Consumer

The ItemConsumer contract takes consumable items like [Potions](/collections/potions-and-consumables), and uses them on a specified Hero.

{% hint style="info" %}
A consumable item will need to be approved to the ItemConsumer contract before calling the `consumeItem` function.
{% endhint %}

## Contracts

### Addresses

#### DFK Chain

<table><thead><tr><th width="150">Name</th><th width="189.73336520775536">Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>ItemConsumer</td><td><code>0xc9A9F352Aa188f422A8f8902B547FB3E59D37210</code></td><td><code>0xA71a120931526fC98f1AcC9f769b6b0d690fB8f0</code></td></tr></tbody></table>

#### Klaytn

<table><thead><tr><th width="150">Name</th><th width="189.73336520775536">Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>ItemConsumer</td><td><code>0xF78cA21d7Da3227457138714F5bEd08D2604A156</code></td><td><code>0xB6fF23fC946C37720DE4c5682c2f123E44A8Be3B</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IItemConsumer {

    event ItemConsumed(address player, address item, uint256 heroId, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) oldHero, tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) newHero);
    
    function consumeItem(address _consumableAddress, uint256 _heroId);
    function consumeItems(address[] _consumableAddresses, uint256[] _heroIds);
    
}
```

### ABIs

{% file src="/files/Wjhs2XYOpbylc2Rez8lV" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

<table><thead><tr><th width="150">Name</th><th width="189.73336520775536">Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>ItemConsumer</td><td><code>0x38e76972BD173901B5E5E43BA5cB464293B80C31</code></td><td><code>0x65A7560d2D3ecD3DA4Fc42cBd11A762F10b1036c</code></td></tr></tbody></table>


# Potion Migrator

The PotionMigrator contract converts Potion Crates into 4x of the specified [Potion](/collections/potions-and-consumables).

{% hint style="info" %}
A Potion Crate will need to be approved to the PotionMigrator contract before calling the `migrate` function.
{% endhint %}

## Contracts

### Addresses

<table><thead><tr><th width="150">Name</th><th width="189.73336520775536">Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td>DFK Chain</td><td><code>0x6755dEBef85929aC4cd541c81147Bc17C4F0CD0e</code></td><td><code>0x5EA8D5021a29814B6B4077b55e673aa1FdCC6Fcd</code></td></tr><tr><td>Klaytn</td><td><code>0x8050156C08b2525D2a83Cb237abD3a7533F06355</code></td><td><code>0x9504EB8c9b6e84eC4659BD14427a6A6352468fb1</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IPotionMigrator {

    event TokensMigrated(address indexed account, address indexed token1, address indexed token2, uint256 amount);
    
    function migrate(address _tokenToMigrate);
    function tokenMappings(address) view returns (address);
    
}
```

### ABIs

{% file src="/files/NSiFGelF8dHbVHeLle4X" %}


# Enhancement Stones

Enhancement Stones are rare items that are used during [Summoning](/contracts/summoning/hero-summoning) to permanently increase the summoned Hero's stats.

These stones can be crafted by the [Stone Carver](/crafting/stone-carver).

{% hint style="info" %}
**ERC20:** Enhancement Stones are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin: <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

{% hint style="warning" %}
Enhancement Stones have 0 decimals
{% endhint %}

## Contracts

### Lesser Enhancement Stones

#### DFK Chain

<table><thead><tr><th width="262.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-stone-lesser.gif" alt="" data-size="line"> Lesser Chaos Stone (DFKLCHSST)</td><td><code>0x7643ADB5AaF129A424390CB055d6e23231fFd690</code></td><td><code>0xAb9aC94E6d7c8CDF4e1f0147Eb201Eb7CC89a48d</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-stone-lesser.gif" alt="" data-size="line"> Lesser Finesse Stone (DFKLFINST)</td><td><code>0xF1D53fa23C562246B9d8EC591eEa12Ec0288a888</code></td><td><code>0x49744F76caA3B63CccE9CE7de5C8282C92c891e5</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-stone-lesser.gif" alt="" data-size="line"> Lesser Fortitude Stone (DFKLFRTIST)</td><td><code>0xf599Ae2c925D3287a7fF64DC1b55C7Ea6EE3AA8f</code></td><td><code>0xFD1FDF97F32709F3Cb03d3c6979E03417e7c1BB3</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-stone-lesser.gif" alt="" data-size="line"> Lesser Fortune Stone (DFKLFRTUST)</td><td><code>0x934e3e2a433F37cC2D02855A43fD7Ed475EA7451</code></td><td><code>0x1C3B5c108DCF7A76510913A4ce53b71144C99a7D</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-stone-lesser.gif" alt="" data-size="line"> Lesser Insight Stone (DFKLINSST)</td><td><code>0x3D112747ff2463802Afa240B62ade8F1cc4a5c7d</code></td><td><code>0xD6B97C92f9fB7166a703E6049C67378921368C45</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-stone-lesser.gif" alt="" data-size="line"> Lesser Might Stone (DFKLMGHTST)</td><td><code>0xf345b884eA45aEcb3E46CeEaEDB9CE993Ba3615a</code></td><td><code>0xBe6C276C51276990C7F1d74a1402A49ff866CC33</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-stone-lesser.gif" alt="" data-size="line"> Lesser Swiftness Stone (DFKLSWFTST)</td><td><code>0xd37aCbAC3C25a543B30aa16208637cfa6EB97eDd</code></td><td><code>0x8A375fDd8c417Eb5e32503c7A88B2f2C86CC3829</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-stone-lesser.gif" alt="" data-size="line"> Lesser Vigor Stone (DFKLVGRST)</td><td><code>0x63891e0fcfEe0cEB12dE5fb96F43ADf9DbEC20a3</code></td><td><code>0xbA2904B8c880F1790307771F059c6E04435c9672</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-stone-lesser.gif" alt="" data-size="line"> Lesser Wit Stone (DFKLWITST)</td><td><code>0xFC943eBd19112D6c6098412238E4E8319641B3d8</code></td><td><code>0x23E040b047dcD8BD3E6E2dbdB2c06e672206FEe1</code></td></tr></tbody></table>

#### Kaia

<table><thead><tr><th width="267.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-stone-lesser.gif" alt="" data-size="line"> Lesser Chaos Stone (DFKLCHSST)</td><td><code>0x38bDed7C399bbD214a19De35260766b130cAFd2F</code></td><td><code>0xbCEa0cA22e8B92A0fA0794485FAb1Ea9EDf754cC</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-stone-lesser.gif" alt="" data-size="line"> Lesser Finesse Stone (DFKLFINST)</td><td><code>0x784bd01e3882b80aa837f6A3041Cd386eC54a501</code></td><td><code>0x2815A280df4dD4FC429ad2F5f7846f6756fEfD2D</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-stone-lesser.gif" alt="" data-size="line"> Lesser Fortitude Stone (DFKLFRTIST)</td><td><code>0xBC5248B4f50f4c7D2F9A67Be1f1d4b8be44ffc75</code></td><td><code>0x020b7ECB3fAd450c906Ebf7853d3d407FDf7ca84</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-stone-lesser.gif" alt="" data-size="line"> Lesser Fortune Stone (DFKLFRTUST)</td><td><code>0x816E22125021530535364390a3E2fA305a436247</code></td><td><code>0x79fE1fCF16Cc0F7E28b4d7B97387452E3084b6dA</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-stone-lesser.gif" alt="" data-size="line"> Lesser Insight Stone (DFKLINSST)</td><td><code>0xfC66cF68505F8E95C52C4F7f84936436DBd52e9B</code></td><td><code>0xBF956B8B9cBE8af30CE923dF24C339ecA7589a61</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-stone-lesser.gif" alt="" data-size="line"> Lesser Might Stone (DFKLMGHTST)</td><td><code>0xbb8ac0BB95E433204217b0478B3f6d815EcB2d8C</code></td><td><code>0x88fa48c72d63e65a35A979e0d363dd167B4002a5</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-stone-lesser.gif" alt="" data-size="line"> Lesser Swiftness Stone (DFKLSWFTST)</td><td><code>0xAd51199B453075C73FA106aFcAAD59f705EF7872</code></td><td><code>0x1e09e45E35F5Dcf8028f50ED3fb13eAd16Df973f</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-stone-lesser.gif" alt="" data-size="line"> Lesser Vigor Stone (DFKLVGRST)</td><td><code>0x50F683acefA41b226CEfAdc0dd2ea6fFBfED56A0</code></td><td><code>0xe5f337814c419FC82Fb03011f506484E68Ee26e8</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-stone-lesser.gif" alt="" data-size="line"> Lesser Wit Stone (DFKLWITST)</td><td><code>0x5903F478e456DD4Ce5387caBE3984DfEf93D0A46</code></td><td><code>0xd9E5a3dedF1E5E529102B7E76D9F9D5A1A9faCb5</code></td></tr></tbody></table>

#### Metis

<table><thead><tr><th width="267.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-stone-lesser.gif" alt="" data-size="line"> Lesser Chaos Stone (DFKLCHSST)</td><td><code>0x8F0a4EaFe3d860c67E906B743905261BD2982230</code></td><td><code>0xb21B203252026fe98Cd92a4C94E6D0f57f4BB137</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-stone-lesser.gif" alt="" data-size="line"> Lesser Finesse Stone (DFKLFINST)</td><td><code>0x930f1bFfD69e9eb167702FdCfaC0C5F64E7B0f3A</code></td><td><code>0xCf6123AF0Ab56991cb158aAA0277648E8933b7eb</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-stone-lesser.gif" alt="" data-size="line"> Lesser Fortitude Stone (DFKLFRTIST)</td><td><code>0xa2D001C829328aa06a2DB2740c05ceE1bFA3c6bb</code></td><td><code>0xdc96B286e9996e9839531A90ba7e1fb9138a850B</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-stone-lesser.gif" alt="" data-size="line"> Lesser Fortune Stone (DFKLFRTUST)</td><td><code>0x0A473d7BDAe9423019dB124bD40F818cb535582B</code></td><td><code>0x39B6a0ddDc68c3b96344208DFBb428012f6725bc</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-stone-lesser.gif" alt="" data-size="line"> Lesser Insight Stone (DFKLINSST)</td><td><code>0xE01fd3BA8794e6248D7aa556ec9a12abE2aa6D8F</code></td><td><code>0x93507C784152467F6a45A429a73677E15AA4Cc29</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-stone-lesser.gif" alt="" data-size="line"> Lesser Might Stone (DFKLMGHTST)</td><td><code>0x12b88D696f3b8603FeCD42b1f2DCC5987e344718</code></td><td><code>0xE3993c1553e022a8e0d4ccC9CA81cB80FdEC9756</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-stone-lesser.gif" alt="" data-size="line"> Lesser Swiftness Stone (DFKLSWFTST)</td><td><code>0xD95825adB5F74669A9D4554a088F28a220544C69</code></td><td><code>0x1Fc4c41072F7522f19CE18A5FE49aDf88cB01a46</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-stone-lesser.gif" alt="" data-size="line"> Lesser Vigor Stone (DFKLVGRST)</td><td><code>0x351D1dE49AA3f6e33645d705c4fA9cf20068e850</code></td><td><code>0x9609240Fd1cDe2930931006E2C72f2bb269A6a99</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-stone-lesser.gif" alt="" data-size="line"> Lesser Wit Stone (DFKLWITST)</td><td><code>0x94CDcbC6c23A66e74cED160a54BB2dEf9c7e7245</code></td><td><code>0xC839907F3341540C29F1F583e65A111847cc9203</code></td></tr></tbody></table>

### Enhancement Stones

#### DFK Chain

<table><thead><tr><th width="261.1629542790152">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-stone.gif" alt="" data-size="line"> Chaos Stone (DFKCHSST)</td><td><code>0x1ED1a6Ed588945C59227f7a0c622Ad564229d3d6</code></td><td><code>0xeA33d009DA0d5d5A46d099C3220c152F29685772</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-stone.gif" alt="" data-size="line"> Finesse Stone (DFKFINST)</td><td><code>0xe2C357ECB698C5ee97c49CCCfA8117c4b943C7B9</code></td><td><code>0x611811494E0EAA6048C1AF2C52C2fcDe7fcFe309</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-stone.gif" alt="" data-size="line"> Fortitude Stone (DFKFRTIST)</td><td><code>0x05305c97e9A2FDC0F5Ea23824c1348DEeD9Aff04</code></td><td><code>0xC575970728AE06fcD252fC128cEf3f5385AD67c9</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-stone.gif" alt="" data-size="line"> Fortune Stone (DFKFRTUST)</td><td><code>0xd647D8b52981eDE13ac6a5B7Ad04e212Ac38fdFb</code></td><td><code>0xfFf9760521C05A288e8813A0d483cA7BCC4F044c</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-stone.gif" alt="" data-size="line"> Insight Stone (DFKINSST)</td><td><code>0x74CFf096C9B027104fb1a0C2E0e265D123eA47De</code></td><td><code>0x3F7AE7263ea3870f8d9D2428B94847cA386ECa0b</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-stone.gif" alt="" data-size="line"> Might Stone (DFKMGHTST)</td><td><code>0x37bAa710391c1D6e22396E4B7F78477F0fF2fFA7</code></td><td><code>0x161F57A3367a06DbeF3032Bd534f9AB55805B647</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-stone.gif" alt="" data-size="line"> Swiftness Stone (DFKSWFTST)</td><td><code>0x4F95D51fB8eF93704aF8C39A080c794cdA08f853</code></td><td><code>0xd2E023f86b74853FBA1C6d108D622f51aB004B00</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-stone.gif" alt="" data-size="line"> Vigor Stone (DFKVGRST)</td><td><code>0xA71a120931526fC98f1AcC9f769b6b0d690fB8f0</code></td><td><code>0xa73D3130883b458C7808dAac1b779d7B45415d09</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-stone.gif" alt="" data-size="line"> Wit Stone (DFKWITST)</td><td><code>0x3971212Ec22147EE8808cB84F743DD852Be92f9C</code></td><td><code>0xc32A0e963e50AAAED273A75425fC39902b0d0b3b</code></td></tr></tbody></table>

#### Kaia

<table><thead><tr><th width="262.1629542790152">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-stone.gif" alt="" data-size="line"> Chaos Stone (DFKCHSST)</td><td><code>0x880cb941AAb394775f54F2b6468035bbdD0B81dF</code></td><td><code>0x98aef3E357394D395b2d6661f87fBBD9dc739176</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-stone.gif" alt="" data-size="line"> Finesse Stone (DFKFINST)</td><td><code>0x31eb3b534E29D10Db08109A1fa50ccB081d10816</code></td><td><code>0x95C82b70c2bAe419c5729E092464790880579037</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-stone.gif" alt="" data-size="line"> Fortitude Stone (DFKFRTIST)</td><td><code>0x254787d3b87d8c21A300Ab8D5A06C01426CE40c0</code></td><td><code>0xb9341B432A15C7d9C361a675b1FBeE5301f9828A</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-stone.gif" alt="" data-size="line"> Fortune Stone (DFKFRTUST)</td><td><code>0xf0cBbd41652d9A93A899f070669186F0c8475F7D</code></td><td><code>0x5BDa5c3258c72c4890E6c1EA16f4F9E394FF3fB4</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-stone.gif" alt="" data-size="line"> Insight Stone (DFKINSST)</td><td><code>0x22A92428605a3B5b66695A60e96b683E98a9a035</code></td><td><code>0x4a737026ba0f4e4c75675AEaE46E97A2A8F649D1</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-stone.gif" alt="" data-size="line"> Might Stone (DFKMGHTST)</td><td><code>0x532bce28c28616552a4BcDdb5D4B4126Dea35f66</code></td><td><code>0x91Ec320554C80753166513B40A842939460c1787</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-stone.gif" alt="" data-size="line"> Swiftness Stone (DFKSWFTST)</td><td><code>0xf200597430eAc3e22B4566D1BCd70A3b63804B24</code></td><td><code>0xeCCC54b836cD5bf114daec723de1c0d89B0C2A7b</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-stone.gif" alt="" data-size="line"> Vigor Stone (DFKVGRST)</td><td><code>0xA0c89fB3cbb115cf86EdcB4319578312D026A07a</code></td><td><code>0xc75E787AD4249df104D5632CdC1b5C238c0FD2d8</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-stone.gif" alt="" data-size="line"> Wit Stone (DFKWITST)</td><td><code>0x3BaEFAfF21Fa2F06Ad3899903B7A899a91B5915A</code></td><td><code>0x4Cb69F1385D1ec1acEF351a98f67De5a56C74226</code></td></tr></tbody></table>

#### Metis

<table><thead><tr><th width="262.1629542790152">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-stone.gif" alt="" data-size="line"> Chaos Stone (DFKCHSST)</td><td><code>0xBedaCD6E21d9386f49335c63A32710E37b5b96Ab</code></td><td><code>0xdfAfb55371Bbd1000377AD7bEbC0E807b70ac88f</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-stone.gif" alt="" data-size="line"> Finesse Stone (DFKFINST)</td><td><code>0x5a1d6f841b6Bb8758c6C853736da6339758689F8</code></td><td><code>0xfC58C975E01cE459C4c12f59e20d1D775a068CCc</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-stone.gif" alt="" data-size="line"> Fortitude Stone (DFKFRTIST)</td><td><code>0xb497d9177117B8afCb2A72567701e443A29CBa15</code></td><td><code>0x8d151910d81De5ac9ecA36E6DcaAc2CC2Cc80155</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-stone.gif" alt="" data-size="line"> Fortune Stone (DFKFRTUST)</td><td><code>0x87993136E323561B305EB958447ab234698BEFb8</code></td><td><code>0x9Dc7AED5Ae1bdB7de5754D16a43fFe3b05e9F802</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-stone.gif" alt="" data-size="line"> Insight Stone (DFKINSST)</td><td><code>0xC55ee74FDBA1eB7A0c8457fcA569830276456c48</code></td><td><code>0x0F8C7da63c73C328311F79Bb90305cE63564f18a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-stone.gif" alt="" data-size="line"> Might Stone (DFKMGHTST)</td><td><code>0x6B5Eb5C0505006F8887e62dc9ce3200919e967eE</code></td><td><code>0x0D9C95D92B3E1d92DA4b39dCf45F66e5c770B5cB</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-stone.gif" alt="" data-size="line"> Swiftness Stone (DFKSWFTST)</td><td><code>0x23a14dCd662F9dfFb3E918707567C34cB399AB70</code></td><td><code>0x0Adb0e44E933432c85DC3C7cAE851F384bb2e4Dd</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-stone.gif" alt="" data-size="line"> Vigor Stone (DFKVGRST)</td><td><code>0x66108b50aA60F22FE99518867342bF2bFEDb7A02</code></td><td><code>0x7782586fC00Bc62D10dE5bA3869A48F58176cEa2</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-stone.gif" alt="" data-size="line"> Wit Stone (DFKWITST)</td><td><code>0xcB0012e4E56F682C6DF37484255EEb90f6D2eD72</code></td><td><code>0x9CDdA691FfF2EB5609c7c0187e8533b209e6c736</code></td></tr></tbody></table>

### Greater Enhancement Stones

#### DFK Chain

<table><thead><tr><th width="269.1629542790152">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-stone-greater.gif" alt="" data-size="line"> Greater Chaos Stone (DFKGCHSST)</td><td><code>0xEd4Bf3008afE47FE01CcC7a6648a24E326667eee</code></td><td><code>0x295f859B5865715c9A0E82E0B12c23a25d2BC604</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-stone-greater.gif" alt="" data-size="line"> Greater Finesse Stone (DFKGFINST)</td><td><code>0xF35D4f749C6ADCd4AEfE1720C5890cD38129d128</code></td><td><code>0x7b89F43080804C0484895D202bdB6C5412DE905F</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-stone-greater.gif" alt="" data-size="line"> Greater Fortitude Stone (DFKGFRTIST)</td><td><code>0xc2eF7E4f659272ca2DaE9d3df05680783b299Cd0</code></td><td><code>0x2e20a79b720485b2f0eD4d76C39e4cD92682Aa9a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-stone-greater.gif" alt="" data-size="line"> Greater Fortune Stone (DFKGFRTUST)</td><td><code>0x8FfF0f5A660b4D38441DDF6127bca42D7a2755a9</code></td><td><code>0xddF52625874610aABC183310EfaE8e6Da1AFcc4a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-stone-greater.gif" alt="" data-size="line"> Greater Insight Stone (DFKGINSST)</td><td><code>0x3198f51A1c8cFC5f1FeaD58feaa19E6dFc8e9737</code></td><td><code>0x7dF5cf8e9Eb4719a98B48Fa6a85B519cA5882663</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-stone-greater.gif" alt="" data-size="line"> Greater Might Stone (DFKGMGHTST)</td><td><code>0xA0851F6368AfA693a6654e9fdaf76CB6F160B837</code></td><td><code>0xb079f4cFfCd4FCe45B07feFa4D320cD44F8F8EB1</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-stone-greater.gif" alt="" data-size="line"> Greater Swiftness Stone (DFKGSWFTST)</td><td><code>0x40D2c135a3E5a6f6546626795DEc67f818f0352a</code></td><td><code>0x9248822C9F4e38EB5aF003C2520973Ae11067Bc3</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-stone-greater.gif" alt="" data-size="line"> Greater Vigor Stone (DFKGVGRST)</td><td><code>0x0A5985574369EDE9Bd871fbdad61613D4C11Dac4</code></td><td><code>0x1F2C2cC6786088C5F363c585698fBB1E00b860BF</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-stone-greater.gif" alt="" data-size="line"> Greater Wit Stone (DFKGWITST)</td><td><code>0xa1BD7683fA348e256a2de8a9dDB55E5ea01eB048</code></td><td><code>0x3f7E4Eb919EEab34b478B4890c99C2d7F107afB3</code></td></tr></tbody></table>

#### Kaia

<table><thead><tr><th width="268.1629542790152">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-stone-greater.gif" alt="" data-size="line"> Greater Chaos Stone (DFKGCHSST)</td><td><code>0x932049DF7f09DeE7cF5Aefe03f373810EBbdDDc7</code></td><td><code>0x67E49492717b1c9683aab85FCcB0D4f0590F0e24</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-stone-greater.gif" alt="" data-size="line"> Greater Finesse Stone (DFKGFINST)</td><td><code>0xFE4ac39174C2637537711f0cb3112EaD47E77D37</code></td><td><code>0x144132767a353f7485Fe09D19faAE19ca3905E61</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-stone-greater.gif" alt="" data-size="line"> Greater Fortitude Stone (DFKGFRTIST)</td><td><code>0x3D0EA055081e62e40257fde3A2036a557af6Ff77</code></td><td><code>0xd467f3cE950663b0195C25e615D6C7B2BC49699a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-stone-greater.gif" alt="" data-size="line"> Greater Fortune Stone (DFKGFRTUST)</td><td><code>0x91aced74b0CEE03EF8902f13E97F6e308941E6Bd</code></td><td><code>0x22a20A56b9162B155BE51ACdD14051B142CF1a35</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-stone-greater.gif" alt="" data-size="line"> Greater Insight Stone (DFKGINSST)</td><td><code>0xF861104131825320C3d0D9B7bd373Ea0549f0587</code></td><td><code>0x360b42353FDF7Fd71Ad52509ae38F85cB638BDD1</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-stone-greater.gif" alt="" data-size="line"> Greater Might Stone (DFKGMGHTST)</td><td><code>0x434619b18466dEAA26475f97467754135aB8f3AF</code></td><td><code>0x468976C792B567466cD0271DDF9a03C3394F2EC9</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-stone-greater.gif" alt="" data-size="line"> Greater Swiftness Stone (DFKGSWFTST)</td><td><code>0x954296fd7563f737BD502e3DdbAdA3f5223F92f1</code></td><td><code>0x358a399C9a600F3B375fa02E9A3e661bFb8bCafb</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-stone-greater.gif" alt="" data-size="line"> Greater Vigor Stone (DFKGVGRST)</td><td><code>0x9A587bBD01D5B2745b20A89ddd9B83268129fEda</code></td><td><code>0x614e5082CB195B3Ac55DA9Aaed9dc9AD75A24Cef</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-stone-greater.gif" alt="" data-size="line"> Greater Wit Stone (DFKGWITST)</td><td><code>0x3C0B9C87b1747C47D0B73910f995A08D75D81Af1</code></td><td><code>0x471C15Edce14B90762E7a4903b6303C401b9961b</code></td></tr></tbody></table>

#### Metis

<table><thead><tr><th width="268.1629542790152">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-stone-greater.gif" alt="" data-size="line"> Greater Chaos Stone (DFKGCHSST)</td><td><code>0x4d4f6aCDE99298bB2FcEA7c807ed29F97D1A57fB</code></td><td><code>0xAE85007610dD949BebdB0004A7A3491A4f2da1CF</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-stone-greater.gif" alt="" data-size="line"> Greater Finesse Stone (DFKGFINST)</td><td><code>0x94F8bA841407c2f2af966BE6279121e40567cb15</code></td><td><code>0x20F5Eb4267B8ecF8F2dCc021Ea657eC02C7ac49C</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-stone-greater.gif" alt="" data-size="line"> Greater Fortitude Stone (DFKGFRTIST)</td><td><code>0x7E3Bf4A053500a3f0A976528F2e78Df0538c1dbF</code></td><td><code>0x78fB30CF671A87548aBe40F62ec66Fd4dd93a671</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-stone-greater.gif" alt="" data-size="line"> Greater Fortune Stone (DFKGFRTUST)</td><td><code>0x27C6d743a1306E8f0c9BEb29443DDFC83bAe598e</code></td><td><code>0x386a5Cc8477cCc7BF2aee6333a7c52053d675588</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-stone-greater.gif" alt="" data-size="line"> Greater Insight Stone (DFKGINSST)</td><td><code>0x90fdE1546F64681Ff40f78Ee2D21d6b47076F89e</code></td><td><code>0xe778393b134D7c7242Fdd692632C827BfD04444a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-stone-greater.gif" alt="" data-size="line"> Greater Might Stone (DFKGMGHTST)</td><td><code>0x98A0077Fc43a596f408D1D4dCad05F1Cb079e24F</code></td><td><code>0x3fADf451bc65bD981758bfD4A52F60f454b395Ff</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-stone-greater.gif" alt="" data-size="line"> Greater Swiftness Stone (DFKGSWFTST)</td><td><code>0xbEb0ffa168e0Ba6978b3A26FE78E4471b541afBe</code></td><td><code>0x04bFd9401210445d6E9835dC6322154fe418D2C2</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-stone-greater.gif" alt="" data-size="line"> Greater Vigor Stone (DFKGVGRST)</td><td><code>0x31D2459eB2407E4b9af4E8716957263Cd5882Ce1</code></td><td><code>0x646D129619f6a3232213C2B90A507e39d5671928</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-stone-greater.gif" alt="" data-size="line"> Greater Wit Stone (DFKGWITST)</td><td><code>0x46119706eC292c4187B14ec59ea085fDC0148065</code></td><td><code>0xfCb0eD9e44c53cd2173CD8CAFF9a6fC7e5af8f51</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IEnhancementStone {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function applyBonus(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) _hero, uint256) returns (tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions));
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn(uint256 amount);
    function burnFrom(address account, uint256 amount);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function name() view returns (string);
    function paused() view returns (bool);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    function use() returns (bool);

}
```

### ABIs

{% file src="/files/uSZbXOryyOMZ4dxRlRId" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Lesser Enhancement Stones

#### Harmony

<table><thead><tr><th width="269.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-stone-lesser.gif" alt="" data-size="line"> Lesser Chaos Stone (DFKLCHSST)</td><td><code>0x6D4f4bC32df561a35C05866051CbE9C92759Da29</code></td><td><code>0x971f32b88Afa7981894a51cE7e19d997A291062a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-stone-lesser.gif" alt="" data-size="line"> Lesser Finesse Stone (DFKLFINST)</td><td><code>0xbb5614D466b77d50DdEd994892DFe6F0ACA4eEbb</code></td><td><code>0x7F8037ce1973E8DE88640B86bD40B8F79e08E39E</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-stone-lesser.gif" alt="" data-size="line"> Lesser Fortitude Stone (DFKLFRTIST)</td><td><code>0x1f57eb682377f5Ad6276b9315412920BdF9530f6</code></td><td><code>0xF71c3fe9388DebDE97798ddA84939c70CFEa516D</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-stone-lesser.gif" alt="" data-size="line"> Lesser Fortune Stone (DFKLFRTUST)</td><td><code>0x6D6eA1D2Dc1Df6Eaa2153f212d25Cf92d13Be628</code></td><td><code>0x8B460a535f5Ac6D056b2F1CeBC44792eFE80a8CC</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-stone-lesser.gif" alt="" data-size="line"> Lesser Insight Stone (DFKLINSST)</td><td><code>0x762b98B3758d0A5Eb95B3E4A1E2914Ce0A80D99c</code></td><td><code>0x2cB6b2Cb1976F2c964C39614c5D549280482fd9f</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-stone-lesser.gif" alt="" data-size="line"> Lesser Might Stone (DFKLMGHTST)</td><td><code>0xe4E7C0c693d8A7FC159776a993495378705464A7</code></td><td><code>0x6382781FE94CAadC71027c0457c9CbEff06e204c</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-stone-lesser.gif" alt="" data-size="line"> Lesser Swiftness Stone (DFKLSWFTST)</td><td><code>0xd9A8abC0Ce1ADC23F1c1813986c9a9C21C9e7510</code></td><td><code>0x9c5CED9F39C196B8d4bB1cB32d76fd18598f77cD</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-stone-lesser.gif" alt="" data-size="line"> Lesser Vigor Stone (DFKLVGRST)</td><td><code>0xB00CbF5Cd5e7b321436C2D3d8078773522D2F073</code></td><td><code>0x0ff7A912CA06607531d25F31B586822aAc997405</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-stone-lesser.gif" alt="" data-size="line"> Lesser Wit Stone (DFKLWITST)</td><td><code>0x4Ff7A020ec1100D36d5C81F3D4815F2e9C704b59</code></td><td><code>0xc8FF011e1cE1FC3F4450730FCec45c1b4CF5f00f</code></td></tr></tbody></table>

### Enhancement Stones

#### Harmony

<table><thead><tr><th width="268.1629542790152">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-stone.gif" alt="" data-size="line"> Chaos Stone (DFKCHSST)</td><td><code>0x3633F956410163A98D58D2D928B38C64A488654e</code></td><td><code>0x564C20F0E257531464B3c1AB9e827b74C95BC9e2</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-stone.gif" alt="" data-size="line"> Finesse Stone (DFKFINST)</td><td><code>0xD0B689Cb5DE0c15792Aa456C89D64038C1F2EedC</code></td><td><code>0x16cc1683243CAEB45B840720aF86b24916457EB9</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-stone.gif" alt="" data-size="line"> Fortitude Stone (DFKFRTIST)</td><td><code>0x17Fa96ba9d9C29e4B96d29A7e89a4E7B240E3343</code></td><td><code>0xD7D89A1457B40570166e46c449CabD661Dbe0e76</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-stone.gif" alt="" data-size="line"> Fortune Stone (DFKFRTUST)</td><td><code>0x5da2EffE9857DcEcB786E13566Ff37B92e1E6862</code></td><td><code>0x7EE9e78557c10B0aE149506f51104D88a73B957f</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-stone.gif" alt="" data-size="line"> Insight Stone (DFKINSST)</td><td><code>0x9D71Bb9C781FC2eBdD3d6cb709438e3c71200149</code></td><td><code>0x9138b74BeE92AC3c45BbA24389BF913BA3a42Ba2</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-stone.gif" alt="" data-size="line"> Might Stone (DFKMGHTST)</td><td><code>0xE7F6ea1cE7BbEbC9F2Cf080010dd938d2D8D8B1b</code></td><td><code>0x677028bcDbdb4A5bCDc49fEa97517566b0021C0f</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-stone.gif" alt="" data-size="line"> Swiftness Stone (DFKSWFTST)</td><td><code>0x08f362517aD4119d93bBCd20825c2E4119abB495</code></td><td><code>0xB33dD42899864a9C01f680f95Fb86C4bbC65e2FA</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-stone.gif" alt="" data-size="line"> Vigor Stone (DFKVGRST)</td><td><code>0x9df75917aC9747B4A70fa033E4b0182d85B62857</code></td><td><code>0xDa8a43B05196A9235c81508e90f0393c4C88201c</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-stone.gif" alt="" data-size="line"> Wit Stone (DFKWITST)</td><td><code>0x939Ea05C81aAC48F7C10BdB08615082B82C80c63</code></td><td><code>0x3287a5E500E2131D972f67cB04b113483277d339</code></td></tr></tbody></table>

### Greater Enhancement Stones

#### Harmony

<table><thead><tr><th width="268.1629542790152">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-stone-greater.gif" alt="" data-size="line"> Greater Chaos Stone (DFKGCHSST)</td><td><code>0x2fB31FF9E9945c5c1911386865cD666b2C5dfeB6</code></td><td><code>0xBf52D66907BE64B904081670D246375e828581e8</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-stone-greater.gif" alt="" data-size="line"> Greater Finesse Stone (DFKGFINST)</td><td><code>0x20f10ef23Cdc11Fa55E6B3703d88f19A7B345D15</code></td><td><code>0x4F5815d68fab431431Ee36c1a18dA41d36125bB1</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-stone-greater.gif" alt="" data-size="line"> Greater Fortitude Stone (DFKGFRTIST)</td><td><code>0x27AF2A00B42Dcc0084A6Dc99169efbFE98eb140C</code></td><td><code>0x90D1f603BdAd4eC33aA385406Fe79d3C28832C5d</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-stone-greater.gif" alt="" data-size="line"> Greater Fortune Stone (DFKGFRTUST)</td><td><code>0x7f26CB2BBBcFCE8e5866cc02a887A591E1Adc02A</code></td><td><code>0x4FaaCc95D81E861016051dA3dcCC525C89098B0c</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-stone-greater.gif" alt="" data-size="line"> Greater Insight Stone (DFKGINSST)</td><td><code>0x40654Da5a038963fA9750AF352ae9d3b1da2baD0</code></td><td><code>0x706820E32fbdCdc52d2866dB096E6dF8C1b6175A</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-stone-greater.gif" alt="" data-size="line"> Greater Might Stone (DFKGMGHTST)</td><td><code>0x2bc05bf05E273a2276F19a8Bd6738e742A5685b3</code></td><td><code>0x0513f27Af88cCc9cFEB0093A3e370fE793BF0F94</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-stone-greater.gif" alt="" data-size="line"> Greater Swiftness Stone (DFKGSWFTST)</td><td><code>0xA1a56D20e4ba3fd2FB91c80f611ECa43c1311Afe</code></td><td><code>0x5686Aab9729ef000d25889c49db5EEeDF555988e</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-stone-greater.gif" alt="" data-size="line"> Greater Vigor Stone (DFKGVGRST)</td><td><code>0x00a2E2F8Feb81FDB7205992B5Abd2a801b419394</code></td><td><code>0x9d02e773D0AAe3601c0baC2f0a8a199D50162F12</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-stone-greater.gif" alt="" data-size="line"> Greater Wit Stone (DFKGWITST)</td><td><code>0xa6e86F2b43Ae73cfB09A3bA779AeB8Fd48417ba0</code></td><td><code>0xc4B03E7432FADc938994588b9f78f6667a5d0eF9</code></td></tr></tbody></table>


# Attunement Crystals

Attunement Crystals are rare items that are using during Hero Meditation to enhance the chance of the Hero's stats increasing.

{% hint style="info" %}
**ERC20:** Attunement Crystals are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin: <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

{% hint style="warning" %}
Attunement Crystals have 0 decimals
{% endhint %}

## Contracts

### Lesser Attunement Crystals

#### DFK Chain

<table><thead><tr><th width="268.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-crystal-lesser.gif" alt="" data-size="line"> Lesser Chaos Crystal (DFKLCHSCR)</td><td><code>0xeEe5b16Cc49e7cef65391Fe7325cea17f787e245</code></td><td><code>0xfFA8754977187308E28d8C47Caa3CB821E40C7Eb</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-crystal-lesser.gif" alt="" data-size="line"> Lesser Finesse Crystal (DFKLFINCR)</td><td><code>0x9d9ef1Bf6A46b8413bf6b1b54F6A7aAb53c6b1b6</code></td><td><code>0x85106b1aF8B0337CB39a9aacDa87849B882a3170</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-crystal-lesser.gif" alt="" data-size="line"> Lesser Fortitude Crystal (DFKLFRTICR)</td><td><code>0xbd2677c06C9448534A851bdD25dF045872b87cb1</code></td><td><code>0x55dAAbebf9d7e6e4BbD19c0d4A5e2CD73C7A9cE1</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-crystal-lesser.gif" alt="" data-size="line"> Lesser Fortune Crystal (DFKLFRTUCR)</td><td><code>0xE410b2BE2Ce1508E15009118567d02C6d7A7038e</code></td><td><code>0xdad4450A1546640383C6f6Df70A35889373727aF</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-crystal-lesser.gif" alt="" data-size="line"> Lesser Insight Crystal (DFKLINSCR)</td><td><code>0xbb5F97358F60cCBa262883A3Ff0C637393FE3aB8</code></td><td><code>0x6EDF99328BFe253Bd8caF458fCEcad55eA90D8DE</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-crystal-lesser.gif" alt="" data-size="line"> Lesser Might Crystal (DFKLMGHTCR)</td><td><code>0x5bAC3cAd961B01Ef9510C8e6c5402A2bB1542831</code></td><td><code>0xD801Aaa938696F6b0a69BF94432436313895299a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-crystal-lesser.gif" alt="" data-size="line"> Lesser Swiftness Crystal (DFKLSWFTCR)</td><td><code>0x6BCA53314dADdA7f4De30A95413f75a93bfAfecF</code></td><td><code>0x77DE6a4299441f6A2d4b96628D29E0523F9160A0</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-crystal-lesser.gif" alt="" data-size="line"> Lesser Vigor Crystal (DFKLVGRCR)</td><td><code>0x5e4Cf6907CB5fBe2F642E399F6d07E567155d1F8</code></td><td><code>0xc82c435920043526c5a93cCd3724653EeEc86D52</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-crystal-lesser.gif" alt="" data-size="line"> Lesser Wit Crystal (DFKLWITCR)</td><td><code>0xC989c916F189D2A2BE0322c020942d7c43aEa830</code></td><td><code>0x065A4A023869a1123fE17883A015eC51d6ae5Dec</code></td></tr></tbody></table>

#### Kaia

<table><thead><tr><th width="267.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-crystal-lesser.gif" alt="" data-size="line"> Lesser Chaos Crystal (DFKLCHSCR)</td><td><code>0x537E800b8fD22Dc76A438Af8b9923986A5487853</code></td><td><code>0x39a06D3e1b6b1B24C477d90770F317abb4B8f928</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-crystal-lesser.gif" alt="" data-size="line"> Lesser Finesse Crystal (DFKLFINCR)</td><td><code>0xC3B36a02f360c3d18042bF3533be602cb775007A</code></td><td><code>0xb606c5973Ff498Ddf68E4a77116A00b9Ea892F84</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-crystal-lesser.gif" alt="" data-size="line"> Lesser Fortitude Crystal (DFKLFRTICR)</td><td><code>0x1E672a8385b39E13267efA2Fb39f574a2a23AE9F</code></td><td><code>0x7695b62E7e318f3BC7ac347894Dae52A3CD3f2e1</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-crystal-lesser.gif" alt="" data-size="line"> Lesser Fortune Crystal (DFKLFRTUCR)</td><td><code>0x8baD15B5C531d119b328d0F716a6B9D90CeDa88A</code></td><td><code>0x64CdCFEDFfB26A395C55E2018485E895C775C18c</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-crystal-lesser.gif" alt="" data-size="line"> Lesser Insight Crystal (DFKLINSCR)</td><td><code>0x5f967E325E91977B42D2591Fc2f57da75Ee4490B</code></td><td><code>0x5986045e7c221c8AD40A736B6434D82E29687aeB</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-crystal-lesser.gif" alt="" data-size="line"> Lesser Might Crystal (DFKLMGHTCR)</td><td><code>0x80Ab38fc9fA0a484b98d5600147e7C695627747D</code></td><td><code>0x2dfFf745d2c7ddCAD4E97b80DF33705B1a95A172</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-crystal-lesser.gif" alt="" data-size="line"> Lesser Swiftness Crystal (DFKLSWFTCR)</td><td><code>0x32Cbbfd741EB7634818aa2e3E8502367cB6602BE</code></td><td><code>0x3A2D8173d1AFB8BE5575CA6B850245860eF5276a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-crystal-lesser.gif" alt="" data-size="line"> Lesser Vigor Crystal (DFKLVGRCR)</td><td><code>0x6C7AF7483b050a00b5fbC4241eD06944c5f0bD77</code></td><td><code>0x035ebEb91c633d79f2ef665eB20f9D268cC006ec</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-crystal-lesser.gif" alt="" data-size="line"> Lesser Wit Crystal (DFKLWITCR)</td><td><code>0xf15035b5eD13Feb18f63D829ABc1c3139041e7C2</code></td><td><code>0x32887A94430C9e139A8DC611b8E9208EA8DA8965</code></td></tr></tbody></table>

#### Metis

<table><thead><tr><th width="267.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-crystal-lesser.gif" alt="" data-size="line"> Lesser Chaos Crystal (DFKLCHSCR)</td><td><code>0xD676439D9f7E2aEaeE1bEe465adE545812851DCf</code></td><td><code>0x5b631ed825590a7dbF1d95d446551858Cc874Fb7</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-crystal-lesser.gif" alt="" data-size="line"> Lesser Finesse Crystal (DFKLFINCR)</td><td><code>0x51f2932cb25fD1C8411985c30AC27C4199d6151D</code></td><td><code>0x452b196904c2db0c7f86Dc4D3F16bcfec2B0aDd2</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-crystal-lesser.gif" alt="" data-size="line"> Lesser Fortitude Crystal (DFKLFRTICR)</td><td><code>0x1f09508fD945F94Cec4401538FD6d3F712971a3A</code></td><td><code>0x3B6d726bBF0D64996BdDD6A21B508016654b030F</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-crystal-lesser.gif" alt="" data-size="line"> Lesser Fortune Crystal (DFKLFRTUCR)</td><td><code>0xdB510ea5f73828aa949bc63b76CAa37E1717637F</code></td><td><code>0x478E0D01C34B60e4103c1167f5b26D8f73c53b05</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-crystal-lesser.gif" alt="" data-size="line"> Lesser Insight Crystal (DFKLINSCR)</td><td><code>0x82a237e12b4bD4Db62e4f3c41249c870b3c47f48</code></td><td><code>0xaE7113Ac4029e212cad4d3c26223E9A2D771Fec1</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-crystal-lesser.gif" alt="" data-size="line"> Lesser Might Crystal (DFKLMGHTCR)</td><td><code>0x4C3b021BBC0B3Bb5f60140059CF856bEAE95F832</code></td><td><code>0x5F574E639f3755B645781ff8FE5359326aE9133B</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-crystal-lesser.gif" alt="" data-size="line"> Lesser Swiftness Crystal (DFKLSWFTCR)</td><td><code>0xa755d4728B74ae0D76ecA76d0a36D4Ffc1544122</code></td><td><code>0x79d2D0b2F4C8eA5905817976Ce4886eF894fC83c</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-crystal-lesser.gif" alt="" data-size="line"> Lesser Vigor Crystal (DFKLVGRCR)</td><td><code>0x82568117fD15E376F9183a327c0e9b03D0fdebEb</code></td><td><code>0xD1ce54F5463D1b4739d8C6F5706741608397e603</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-crystal-lesser.gif" alt="" data-size="line"> Lesser Wit Crystal (DFKLWITCR)</td><td><code>0x15A22966976538f50482477eE84FB1cbF3B6cBc0</code></td><td><code>0x92A4605dB8025E4e8d0033d60A20C8E3171f9C8D</code></td></tr></tbody></table>

### Attunement Crystals

#### DFK Chain

<table><thead><tr><th width="269.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-crystal.gif" alt="" data-size="line"> Chaos Crystal (DFKCHSCR)</td><td><code>0xC6b00B4005883C1Ff09fa1351B0f49027bCAB71a</code></td><td><code>0x4d5afDaD6Cfc1D603635B61a036CC1D29d63829F</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-crystal.gif" alt="" data-size="line"> Finesse Crystal (DFKFINCR)</td><td><code>0xA9A8cc1AC7e7505a69cAca2E068716395CebE562</code></td><td><code>0xDD1EC3228e854D6B159a3438F9D65c6c42Cf4cc7</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-crystal.gif" alt="" data-size="line"> Fortitude Crystal (DFKFRTICR)</td><td><code>0xdbEE8C336B06f2d30a6d2bB3817a3Ae0E34f4900</code></td><td><code>0x8Bb052D91895868a13fde5698814Bbbbc497497F</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-crystal.gif" alt="" data-size="line"> Fortune Crystal (DFKFRTUCR)</td><td><code>0xe9BfCc80800EB77a1eAF6881825936770aF83Eb6</code></td><td><code>0xA96e8794c21A690a910e62E9245d0C79054aaF2c</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-crystal.gif" alt="" data-size="line"> Insight Crystal (DFKINSCR)</td><td><code>0x03e56Ded72C3a974295773355EadB38c0A85cF9D</code></td><td><code>0x6EDF99328BFe253Bd8caF458fCEcad55eA90D8DE</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-crystal.gif" alt="" data-size="line"> Might Crystal (DFKMGHTCR)</td><td><code>0x234dCf10Db6817185F5A3b430a8CAF2B4a35e9E9</code></td><td><code>0x5Ee8F510c1C7E82c48b22915016f3F70fEbff3C0</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-crystal.gif" alt="" data-size="line"> Swiftness Crystal (DFKSWFTCR)</td><td><code>0x3e664eB15b35783B9D3EF06702044820F08bB45B</code></td><td><code>0x87C15559458c7ef129a348c7eE2c6DE084aFa4Aa</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-crystal.gif" alt="" data-size="line"> Vigor Crystal (DFKVGRCR)</td><td><code>0xcD9201F50e5Be84ECE3D8F603dcd3e9DD5e88ea2</code></td><td><code>0x2a02cDd480861E351f02E694e864C081E94b8F48</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-crystal.gif" alt="" data-size="line"> Wit Crystal (DFKWITCR)</td><td><code>0xAeb5b59c8B90D4F078046550Cc8F9f08dC127253</code></td><td><code>0x6319c563B82D04dd66318fd3067450f8d21022fB</code></td></tr></tbody></table>

#### Kaia

<table><thead><tr><th width="266.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-crystal.gif" alt="" data-size="line"> Chaos Crystal (DFKCHSCR)</td><td><code>0xE078C782fF0cC1789D0608834A3cD5076896e4FC</code></td><td><code>0x1905045E35fBb7F7bdc70664C67525510224f77B</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-crystal.gif" alt="" data-size="line"> Finesse Crystal (DFKFINCR)</td><td><code>0x15E77beB33D3B09aB7da529daB1E556b955fECf6</code></td><td><code>0x4A99198B4EeF4dD6de990a523B50736C1BEA444c</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-crystal.gif" alt="" data-size="line"> Fortitude Crystal (DFKFRTICR)</td><td><code>0xA844059503289B781854aEdcA04E5bB13290bd86</code></td><td><code>0x839cfB0Cc3c741c37fbC5c404b07fdf218442085</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-crystal.gif" alt="" data-size="line"> Fortune Crystal (DFKFRTUCR)</td><td><code>0x02d27BC195E58498C687A82d96188A8EF282a1e1</code></td><td><code>0x116396E54302f91e00273E3821Da3b609DEF4771</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-crystal.gif" alt="" data-size="line"> Insight Crystal (DFKINSCR)</td><td><code>0xAd7fBD9EDDE05227964104Bb23Ff8d171D4c90C8</code></td><td><code>0x45A27A0Adb9550239D3088aBcfd86836840A262f</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-crystal.gif" alt="" data-size="line"> Might Crystal (DFKMGHTCR)</td><td><code>0xa3907dEA6f16f1918B4BcDd178c2928c7e6A571D</code></td><td><code>0x656e6Ec534e8973a8Dc611222d3cD44F1568DE10</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-crystal.gif" alt="" data-size="line"> Swiftness Crystal (DFKSWFTCR)</td><td><code>0xc2Ff16F357b51E070c977501563A01a70F3B7BF5</code></td><td><code>0x12AFE4a36e796Dc7214ff22b1392F3FE8d3b5108</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-crystal.gif" alt="" data-size="line"> Vigor Crystal (DFKVGRCR)</td><td><code>0x14a9D5a75799E4C6B4BfA65C8293a75e02DD5339</code></td><td><code>0x3aFE9B141DC7a822dB178ED28b981F2946aBe231</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-crystal.gif" alt="" data-size="line"> Wit Crystal (DFKWITCR)</td><td><code>0xf30214D43E55BE1cbaC712b49A75d4D3220302a7</code></td><td><code>0xC3dC34F0BeDFfaE564616271061a151Edb2950E5</code></td></tr></tbody></table>

#### Metis

<table><thead><tr><th width="266.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-crystal.gif" alt="" data-size="line"> Chaos Crystal (DFKCHSCR)</td><td><code>0x9bBD946ED9b6e9EA4FD85f3Fa9ADB9CC6f03c2BE</code></td><td><code>0x47dfFD90d9bFDC417581E921CA960BC7987aC13e</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-crystal.gif" alt="" data-size="line"> Finesse Crystal (DFKFINCR)</td><td><code>0xE15A227cC569e8fcB1C01f066c2215F0305439e1</code></td><td><code>0xcE9d1Bce7FcC1092486716042CAF9C48563D1e13</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-crystal.gif" alt="" data-size="line"> Fortitude Crystal (DFKFRTICR)</td><td><code>0xbE6C7099ca0578e64Ea529b3bf50b1a7D500a620</code></td><td><code>0xbbebfcb255823f89bC2A6a9Cedda69BeabBEa88B</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-crystal.gif" alt="" data-size="line"> Fortune Crystal (DFKFRTUCR)</td><td><code>0x1c248Aa70ce3d82Aa6106A0e6C6C4C3473E666f9</code></td><td><code>0x7ECbE60776545340645e117Ed73E811B6b755e2b</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-crystal.gif" alt="" data-size="line"> Insight Crystal (DFKINSCR)</td><td><code>0x7378D09e9e2b47d1F601E71A2329C3356F6c56Cd</code></td><td><code>0x4d4319d1768cbA673E3d0269A4c69EfD6E446493</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-crystal.gif" alt="" data-size="line"> Might Crystal (DFKMGHTCR)</td><td><code>0x0Bfa7D64D692638B86c2e4a7cCDaEF3B9453EBc4</code></td><td><code>0x0613cF081D0c15Bc10d930B48C0D06443E204188</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-crystal.gif" alt="" data-size="line"> Swiftness Crystal (DFKSWFTCR)</td><td><code>0xbED31d3cE3632d2179799adB8781Dfdd104FE63A</code></td><td><code>0x9E90c46723642F9E4DeBe9A428192f64c909187c</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-crystal.gif" alt="" data-size="line"> Vigor Crystal (DFKVGRCR)</td><td><code>0x3e8f6b1bCe1fa3C96E89F95E6aB06Dc092bA7b09</code></td><td><code>0xE14907aE499B5DF8BFC3e85Be8AC367B8227dC8B</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-crystal.gif" alt="" data-size="line"> Wit Crystal (DFKWITCR)</td><td><code>0xEfB57B24589954CFc95592e23B12Ef6fcBb6454A</code></td><td><code>0x3f5f9f30965B9941841FF8A5CD93bBa56eF88673</code></td></tr></tbody></table>

### Greater Attunement Crystals

#### DFK Chain

<table><thead><tr><th width="269.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-crystal-greater.gif" alt="" data-size="line"> Greater Chaos Crystal (DFKGCHSCR)</td><td><code>0xb0155Fdb7B6972717C4774Fa2AEAEe9D6c0040b9</code></td><td><code>0xB0deE206Dd196563C5c651D9fCcc364f651C3810</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-crystal-greater.gif" alt="" data-size="line"> Greater Finesse Crystal (DFKGFINCR)</td><td><code>0xdA16b191D1431746b6661D428A223b72c178765A</code></td><td><code>0x33BE31DEf86BdB0f8A83b7bf16721f4780B1bfAb</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-crystal-greater.gif" alt="" data-size="line"> Greater Fortitude Crystal (DFKGFRTICR)</td><td><code>0x3e1c80c3B916C93748Ae642c885d4BFb5D6a6BFe</code></td><td><code>0x7bEeb7193b030e0aB962Db1c95FeeccEbD98eC60</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-crystal-greater.gif" alt="" data-size="line"> Greater Fortune Crystal (DFKGFRTUCR)</td><td><code>0x64C7D12D85050F5F0DcD075f038E5D616f30a404</code></td><td><code>0x10fAa10b5CF8cCEf3F8E65358B56f22a3B42AEDF</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-crystal-greater.gif" alt="" data-size="line"> Greater Insight Crystal (DFKGINSCR)</td><td><code>0xB3F5867E277798b50ba7A71C0b24FDcA03045eDF</code></td><td><code>0x257d9aE525c6C0c79e0459A59041816EB33833dB</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-crystal-greater.gif" alt="" data-size="line"> Greater Might Crystal (DFKGMGHTCR)</td><td><code>0x438A4e0673b7084D6b2379a362627789D845399c</code></td><td><code>0xf409935D9404a2FaEe43474aF254Dc8A6ef155Aa</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-crystal-greater.gif" alt="" data-size="line"> Greater Swiftness Crystal (DFKGSWFTCR)</td><td><code>0x1459c662F516D63216491DC34F7d9d35b00dF25A</code></td><td><code>0x9801F1c3d83F380054851BA3846Ee87A93f3ad24</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-crystal-greater.gif" alt="" data-size="line"> Greater Vigor Crystal (DFKGVGRCR)</td><td><code>0x8780c4aa8bd0D15493D63C884bd9D427199Cf2cf</code></td><td><code>0x568eaB26dA8Bfa3Cd77949E152e1e3dAC032681D</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-crystal-greater.gif" alt="" data-size="line"> Greater Wit Crystal (DFKGWITCR</td><td><code>0x9d1f44b0EC7BB80656FC8Fcd65152513f29a606D</code></td><td><code>0xbdB16F223240dC103DCD179C945b4d27bF4b25FF</code></td></tr></tbody></table>

#### Kaia

<table><thead><tr><th width="268.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-crystal-greater.gif" alt="" data-size="line"> Greater Chaos Crystal (DFKGCHSCR)</td><td><code>0x9e185426354AA53aAC07De79c2fa1e0B50490fdd</code></td><td><code>0x8003E752dc60Dc0159bf0E10aadA803dE11BB2D0</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-crystal-greater.gif" alt="" data-size="line"> Greater Finesse Crystal (DFKGFINCR)</td><td><code>0x616df872971A3f31dffC9a2B55BF55C760B966bF</code></td><td><code>0xAbBf6016aBDc04Ab76bf8F23bDbed984609DD896</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-crystal-greater.gif" alt="" data-size="line"> Greater Fortitude Crystal (DFKGFRTICR)</td><td><code>0x147b3263F1C4ca729B13Ca1D2A7148c32Aa1d8d0</code></td><td><code>0x75912145f5cFEfb980616FA47B2f103210FaAb94</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-crystal-greater.gif" alt="" data-size="line"> Greater Fortune Crystal (DFKGFRTUCR)</td><td><code>0x0d2ea025007995e9Bb1815864CD4e7B98B47DF7c</code></td><td><code>0x06d58D10Eff6f7FB88b24D04dfa4DEb1A5D0A632</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-crystal-greater.gif" alt="" data-size="line"> Greater Insight Crystal (DFKGINSCR)</td><td><code>0x17bb680872D7631e3056136d7e15eC5f6570976a</code></td><td><code>0x8e0E196d2dA1EAE06185bf55C71E64ce0E9B7178</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-crystal-greater.gif" alt="" data-size="line"> Greater Might Crystal (DFKGMGHTCR)</td><td><code>0x1F93421DaE2f8de79C3Fd197a227ec5EE3Eef71b</code></td><td><code>0xfd8B140393CB8308eE739B834808998f04e6441C</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-crystal-greater.gif" alt="" data-size="line"> Greater Swiftness Crystal (DFKGSWFTCR)</td><td><code>0xa5CC44e60F5a898e5c776952E66D1c9905077608</code></td><td><code>0x0ff56FE11859E44A25ef850bD691Bb244abE3d6F</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-crystal-greater.gif" alt="" data-size="line"> Greater Vigor Crystal (DFKGVGRCR)</td><td><code>0x73286f76E05aAa7A73F896DE0Ebc745021Cb50F2</code></td><td><code>0x697FfB63c5bd3ef1F43AC7D50c08188C22FB90B1</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-crystal-greater.gif" alt="" data-size="line"> Greater Wit Crystal (DFKGWITCR</td><td><code>0x5F8A485ed5B4B13c1fc3c1C7fe82164E8e534060</code></td><td><code>0x9e044d9fA05894549aEae5151a33FeDc42C2C59f</code></td></tr></tbody></table>

#### Metis

<table><thead><tr><th width="268.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-crystal-greater.gif" alt="" data-size="line"> Greater Chaos Crystal (DFKGCHSCR)</td><td><code>0x82B62202B92Cb552B2cbDf3f99d88F9BE376D6d9</code></td><td><code>0x2DBE3871277B40C0fd3F99FB98BF3088a458D70C</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-crystal-greater.gif" alt="" data-size="line"> Greater Finesse Crystal (DFKGFINCR)</td><td><code>0x21259a49fE6d6348B1cdC7bbd6CA7D8EDbd6E3d5</code></td><td><code>0x9d5e12B814949878D731BeDAb68651BF1F957F34</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-crystal-greater.gif" alt="" data-size="line"> Greater Fortitude Crystal (DFKGFRTICR)</td><td><code>0x0163CCEFa1905aebE5A39902849689e925570204</code></td><td><code>0x9E1EAF0444A8ff240E71bAD6a256Bd3edf284EBd</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-crystal-greater.gif" alt="" data-size="line"> Greater Fortune Crystal (DFKGFRTUCR)</td><td><code>0xC2F45C216B0A22607Bd810beE9B6f5a57431d1fe</code></td><td><code>0xCAe713cfF49a34b1b725931Ea0A7bBee8c79485a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-crystal-greater.gif" alt="" data-size="line"> Greater Insight Crystal (DFKGINSCR)</td><td><code>0xf55d8deF02DB239A24b6b032C2d421276d5894b1</code></td><td><code>0xb99C0E68e88121542082Cc40C18cd77D1111b196</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-crystal-greater.gif" alt="" data-size="line"> Greater Might Crystal (DFKGMGHTCR)</td><td><code>0x6D48b676a54742b1a7503da3FC39E0AFA4093059</code></td><td><code>0xf018652059C94e9E2F14Dbbd96CeB1E679dc4CA7</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-crystal-greater.gif" alt="" data-size="line"> Greater Swiftness Crystal (DFKGSWFTCR)</td><td><code>0xe2af67B024B043E8de97899385056DBFBFc4d9d3</code></td><td><code>0xD2Bc547ABF9fb2D813D9286A27374e6aceb17625</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-crystal-greater.gif" alt="" data-size="line"> Greater Vigor Crystal (DFKGVGRCR)</td><td><code>0x8c537c46585f083B7F5180E2b8F0118377855459</code></td><td><code>0x0731158229BeFB3e3b4BBb89d8b680137528fE8A</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-crystal-greater.gif" alt="" data-size="line"> Greater Wit Crystal (DFKGWITCR</td><td><code>0xd873E3FC7833aA0ffe2B3880D33C6a1552155AA6</code></td><td><code>0x9631f39F50AA0D39E5F47775820b19A37e232E0C</code></td></tr></tbody></table>

### Interfaces

```solidity
interface IAttunementCrystal {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function applyBonus(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) _hero, uint256) returns (tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions));
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn(uint256 amount);
    function burnFrom(address account, uint256 amount);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function modifyStatGrowth(tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) _statGrowth, bool, uint256) returns (tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg));
    function name() view returns (string);
    function paused() view returns (bool);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    function use(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions));
    
}
```

### ABIs

{% file src="/files/HRr1PSXk1BHD5BhMLIIt" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

### Lesser Attunement Crystals

#### Harmony

<table><thead><tr><th width="267.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-crystal-lesser.gif" alt="" data-size="line"> Lesser Chaos Crystal (DFKLCHSCR)</td><td><code>0xa509c34306AdF6168268A213Cc47D336630bf101</code></td><td><code>0xF71c52DABB711f2cdaf2e6dA68654f2E927dbb23</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-crystal-lesser.gif" alt="" data-size="line"> Lesser Finesse Crystal (DFKLFINCR)</td><td><code>0x39927A2CEE5580d63A163bc402946C7600300373</code></td><td><code>0x25117B22Ee77fEE82813A864785704cfEd9e37C5</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-crystal-lesser.gif" alt="" data-size="line"> Lesser Fortitude Crystal (DFKLFRTICR)</td><td><code>0x3017609B9A59B77B708D783835B6fF94a3D9E337</code></td><td><code>0x5a57Ca33DEc5A63132235d9a0e3dac3cdc5c5003</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-crystal-lesser.gif" alt="" data-size="line"> Lesser Fortune Crystal (DFKLFRTUCR)</td><td><code>0x13AF184aEA970Fe79E3BB7A1B0B156B195fB1f40</code></td><td><code>0xD36Ce1d217F2Bb548a0bf256686380619Fe897cC</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-crystal-lesser.gif" alt="" data-size="line"> Lesser Insight Crystal (DFKLINSCR)</td><td><code>0xc63b76f710e9973b8989678eb16234CfADc8D9DB</code></td><td><code>0x26Bd14dE3ad724E5E889cE5726Cc374463Ecee9D</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-crystal-lesser.gif" alt="" data-size="line"> Lesser Might Crystal (DFKLMGHTCR)</td><td><code>0xaB464901AFBc61bAC440a97Fa568aC42885Da58B</code></td><td><code>0x2DE38B2cd4E76E8ff2d03515363480df69531511</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-crystal-lesser.gif" alt="" data-size="line"> Lesser Swiftness Crystal (DFKLSWFTCR)</td><td><code>0xf5c26F2F34E9245C3A9ea0B0e7Ea7B33E6404Da0</code></td><td><code>0x6371C5c57C6169d39e6460891cB55b2647197785</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-crystal-lesser.gif" alt="" data-size="line"> Lesser Vigor Crystal (DFKLVGRCR)</td><td><code>0x0d8403E47445DB9E316E36F476dacD5827220Bdd</code></td><td><code>0xc4BEBAE1e32E49f5851fA20797EB5892d8FA52A0</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-crystal-lesser.gif" alt="" data-size="line"> Lesser Wit Crystal (DFKLWITCR)</td><td><code>0x17ff2016c9ecCFBF4Fc4DA6EF95Fe646D2c9104F</code></td><td><code>0x436Aa99f5024DbeD2BeF82aB4B1b675ed1746A96</code></td></tr></tbody></table>

### Attunement Crystals

#### Harmony

<table><thead><tr><th width="263.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-crystal.gif" alt="" data-size="line"> Chaos Crystal (DFKCHSCR)</td><td><code>0x45B53E55b5c0A10fdd4fE2079a562d5702F3A033</code></td><td><code>0x0c60d9A0a69E7c50f8113a98f9bAB30AD66614a3</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-crystal.gif" alt="" data-size="line"> Finesse Crystal (DFKFINCR)</td><td><code>0xc6A58eFc320A7aFDB1cD662eaf6de10Ee17103F2</code></td><td><code>0x720412b43E6eA9f061Cd6D89B491F29D415ab4ff</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-crystal.gif" alt="" data-size="line"> Fortitude Crystal (DFKFRTICR)</td><td><code>0x603919AEB55EB13F9CDE94274fC54ab2Bd2DecE7</code></td><td><code>0x352E42f246a9ca79139D4Cfc7817494DC7EDaCf7</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-crystal.gif" alt="" data-size="line"> Fortune Crystal (DFKFRTUCR)</td><td><code>0x6D777C64f0320d8A5b31BE0FdeB694007Fc3ed45</code></td><td><code>0x554f36cA3aEffC9792E7368af516F687F94c22Cb</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-crystal.gif" alt="" data-size="line"> Insight Crystal (DFKINSCR)</td><td><code>0x117E60775584CdfA4f414E22b075F31cC9c3207C</code></td><td><code>0xD2c6C2caC41Ef18816f439c048B323cd202Af45b</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-crystal.gif" alt="" data-size="line"> Might Crystal (DFKMGHTCR)</td><td><code>0xb368f69bE6eDa74700763672AEB2Ae63f3d20AE6</code></td><td><code>0x26b31ECe9BfdC5b1692a3D4362DB654607598236</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-crystal.gif" alt="" data-size="line"> Swiftness Crystal (DFKSWFTCR)</td><td><code>0x5d7f20e3B0f1406Bf038175218eA7e9B4838908c</code></td><td><code>0x9D3180dbd920a0148e256A330bc371437A6C2Ca4</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-crystal.gif" alt="" data-size="line"> Vigor Crystal (DFKVGRCR)</td><td><code>0xBbA50bD111DC586Fd1f2B1476B6eC505800A3FD0</code></td><td><code>0xFe168C31fa552a3164e1CC9914bCb7A2f6F3ee25</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-crystal.gif" alt="" data-size="line"> Wit Crystal (DFKWITCR)</td><td><code>0x3619fc2386FbBC19DDC39d29A72457e758CFAD69</code></td><td><code>0xC1bb514E55b861afEff2E9413Cd37638e3994186</code></td></tr></tbody></table>

### Greater Attunement Crystals

#### Harmony

<table><thead><tr><th width="261.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/chaos-crystal-greater.gif" alt="" data-size="line"> Greater Chaos Crystal (DFKGCHSCR)</td><td><code>0x423bbec25e4888967baeDB7B4EC5b0465Fa3B87D</code></td><td><code>0xe7BE74dB003E74427Fd0C74b9f9B8D72A7a7E83E</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/finesse-crystal-greater.gif" alt="" data-size="line"> Greater Finesse Crystal (DFKGFINCR)</td><td><code>0xd1f789f6f8a3ee3fb94adBE3e82f43AAb51759Ee</code></td><td><code>0x83228013148950efB09f042fc096E4177Abb080a</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortitude-crystal-greater.gif" alt="" data-size="line"> Greater Fortitude Crystal (DFKGFRTICR)</td><td><code>0xFE41BFf925eD88f688332b12746ef1Da68FD4CF2</code></td><td><code>0x148EDF7473fB413e9c37896Fc6De1b5dA24f946F</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/fortune-crystal-greater.gif" alt="" data-size="line"> Greater Fortune Crystal (DFKGFRTUCR)</td><td><code>0x2bC1112337B90bF8c5b9422bC1e98193a9C3d1f4</code></td><td><code>0x670fB2d0cD645BD094aEcdDfEcbfA68Ab01A5aEf</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/insight-crystal-greater.gif" alt="" data-size="line"> Greater Insight Crystal (DFKGINSCR)</td><td><code>0x90454DbF13846CF960abc0F583c319B06aB3F280</code></td><td><code>0xf9a37D029bE5D96A33C9D6e985F1F896804ee3F6</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/might-crystal-greater.gif" alt="" data-size="line"> Greater Might Crystal (DFKGMGHTCR)</td><td><code>0xdFA5aE156AD4590A0061E9c4E8cc5bd60bc775c7</code></td><td><code>0x026CaD2dc3d83E8D5E4390bD6e0FaE147eDda9aD</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/swiftness-crystal-greater.gif" alt="" data-size="line"> Greater Swiftness Crystal (DFKGSWFTCR)</td><td><code>0x1e38e63227D52CBaDA2f0c11bE04feD64154ea37</code></td><td><code>0x46f743832447f621a34472C69E0456836820520c</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/vigor-crystal-greater.gif" alt="" data-size="line"> Greater Vigor Crystal (DFKGVGRCR)</td><td><code>0x5292dbce7eC2e10dd500984A163A5aE8abA585Ce</code></td><td><code>0x6881d8c1628C15d7BfcBe52098db175AF4eA936e</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/wit-crystal-greater.gif" alt="" data-size="line"> Greater Wit Crystal (DFKGWITCR)</td><td><code>0xbaAb8dB69a2FdC0b88B2B3F6F75Fa8899680c43B</code></td><td><code>0x070f589f24BCCef071a99BedD1737e0CF0919DaE</code></td></tr></tbody></table>


# Atonement Crystals

Atonement Crystals are a **subset of Attunement Crystals** that are used during Hero Meditation. These items are limited in quantity and are meant to make players whole if and when bugs are found in the leveling process that impact Hero stat gains.

{% hint style="info" %}
**ERC20:** Atonement Crystals are based on the ERC20 standard. For more information, please view the documentation by OpenZeppelin: <https://docs.openzeppelin.com/contracts/4.x/erc20>
{% endhint %}

{% hint style="warning" %}
Atonement Crystals have 0 decimals
{% endhint %}

{% hint style="danger" %}
Since Atonement Crystals only exist in limited quantities, these item contracts should only be used for data analysis and tracking purposes.
{% endhint %}

## Contracts

### Addresses

#### DFK Chain

<table><thead><tr><th width="251.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/atonement-crystal-lesser.gif" alt="" data-size="line"> Lesser Atonement Crystal (DFKLATONECR)</td><td><code>0xbFa812214a16EcA7814e5F5c270d7f8F37A110B5</code></td><td><code>0x9D33339a0384418d5964B005EB9E9e75C5103800</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/atonement-crystal.gif" alt="" data-size="line"> Atonement Crystal (DFKATONECR)</td><td><code>0xab2B495902f9A6652c382e5f289423929FFF2E65</code></td><td><code>0x2e49740f19f8A0fD3864C45c42883e55DC01f058</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/atonement-crystal-greater.gif" alt="" data-size="line"> Greater Atonement Crystal (DFKGATONECR)</td><td><code>0x3A28E0D4eCF7558e1ba7357070032C5A6105B0C2</code></td><td><code>0x653D32bEB4D78F698Ed044C9220833b985CAB269</code></td></tr></tbody></table>

### Interfaces

{% hint style="info" %}
Atonement Crystals use the Attunement Crystal Interfaces and ABI, with the addition of the `usedCrystals()` function, which takes a Hero ID, and returns a `bool` for whether the Hero has used that particular Atonement Crystal.
{% endhint %}

```solidity
interface IAtonementCrystal {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) view returns (uint256);
    function applyBonus(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions) _hero, uint256) returns (tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions));
    function approve(address spender, uint256 amount) returns (bool);
    function balanceOf(address account) view returns (uint256);
    function burn(uint256 amount);
    function burnFrom(address account, uint256 amount);
    function decimals() view returns (uint8);
    function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) returns (bool);
    function modifyStatGrowth(tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) _statGrowth, bool, uint256) returns (tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg));
    function name() view returns (string);
    function paused() view returns (bool);
    function symbol() view returns (string);
    function totalSupply() view returns (uint256);
    function transfer(address to, uint256 amount) returns (bool);
    function transferFrom(address from, address to, uint256 amount) returns (bool);
    function use(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing) professions));
    function usedCrystals(uint256) view returns (bool);
    
}
```

### ABIs

{% file src="/files/6rUOOqtNqvFVtH5BMN5d" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

<table><thead><tr><th width="261.64356435643566">Name</th><th>Mainnet</th><th>Testnet</th></tr></thead><tbody><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/atonement-crystal-lesser.gif" alt="" data-size="line"> Lesser Atonement Crystal (DFKLATONECR)</td><td><code>0x1f3F655079b70190cb79cE5bc5AE5F19dAf2A6Cf</code></td><td><code>0x351D17791c396128163185a8512aC9edC820C03A</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/atonement-crystal.gif" alt="" data-size="line"> Atonement Crystal (DFKATONECR)</td><td><code>0x27dC6AaaD95580EdF25F8B9676f1B984e09e413d</code></td><td><code>0x0F798BDA7777F59138Ef8E7Ad03DC98EFa3D207d</code></td></tr><tr><td><img src="https://defi-kingdoms.b-cdn.net/art-assets/items/atonement-crystal-greater.gif" alt="" data-size="line"> Greater Atonement Crystal (DFKGATONECR)</td><td><code>0x17f3B5240C4A71a3BBF379710f6fA66B9b51f224</code></td><td><code>0xE02A5D2b8d08D9Da01164669A4838f7aC040DAEF</code></td></tr></tbody></table>


# Pages of the Eternal Story

Pages of the Eternal Story are lore-based items that will be upgradable into a collectable NFT.

{% hint style="info" %}
**ERC1155:** Pages of the Eternal Story are based on the ER1155 standard. For more information you can view the docs by OpenZeppelin. <https://docs.openzeppelin.com/contracts/4.x/erc1155>
{% endhint %}

{% hint style="info" %}
Individual Pages are indexed sequentially with a URI beginning at 0.
{% endhint %}

## Contracts

### Addresses

#### DFK Chain

| Name                                                                                                                                                      | Mainnet                                      | Testnet                                      |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://game.defikingdoms.com/static/media/eternal-story-page-1.5a5c934a.png" alt="" data-size="line"> Pages of the Eternal Story (DFKETRNLSTY) | `0xA37851cCE4B2b65c0b290AA4cC2DFF00314ec85a` | `0xa03f472F72dc0A5928096521e935fdA7c6342E96` |

#### Klaytn

| Name                                                                                                                                                      | Mainnet                                      | Testnet                                      |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://game.defikingdoms.com/static/media/eternal-story-page-1.5a5c934a.png" alt="" data-size="line"> Pages of the Eternal Story (DFKETRNLSTY) | `0x26bdcB310313eFf8D580e43762e2020B23f3e728` | `0xe606f6548Ae34DA9065B4fee88990F239b445403` |

### Interfaces

```solidity
interface IEternalStory {

    event ApprovalForAll(address indexed account, address indexed operator, bool approved);
    event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values);
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
    event URI(string value, uint256 indexed id);
    
    function balanceOf(address account, uint256 id) view returns (uint256);
    function balanceOfBatch(address[] accounts, uint256[] ids) view returns (uint256[]);
    function burn(address account, uint256 id, uint256 value);
    function burnBatch(address account, uint256[] ids, uint256[] values);
    function decimals() view returns (uint8);
    function isApprovedForAll(address account, address operator) view returns (bool);
    function name() view returns (string);
    function paused() view returns (bool);
    function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data);
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data);
    function setApprovalForAll(address operator, bool approved);
    function symbol() view returns (string);
    function uri(uint256) view returns (string);

}
```

### ABIs

{% file src="/files/8cXo99BuxOlYGAGDQqpu" %}

## Historical Contracts

{% hint style="danger" %}
These contracts have been deprecated and should not be used. They are listed here for data analysis and tracking purposes only.
{% endhint %}

#### Harmony

| Name                                                                                                                                                      | Mainnet                                      | Testnet                                      |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| <img src="https://game.defikingdoms.com/static/media/eternal-story-page-1.5a5c934a.png" alt="" data-size="line"> Pages of the Eternal Story (DFKETRNLSTY) | `0x909EF175d58d0e17d3Ceb005EeCF24C1E5C6F390` | `0x241fEEb8B29e2A46C08b1C3ceefc632085baFc6B` |


# Community GraphQL API

DeFi Kingdoms maintains a community [GraphQL](https://graphql.org/) API endpoint at:

[`https://api.defikingdoms.com/graphql`](https://api.defikingdoms.com/graphql)

This endpoint can be used to query data about Heroes, Hero Sales and Rentals, Equipment, Pets, Pet Sales, Profiles, and the Bazaar.

{% content-ref url="/pages/rL5al0K8PoTR17Fz58WP" %}
[Getting Started](/api/community-graphql-api/getting-started)
{% endcontent-ref %}

{% content-ref url="/pages/IMHLUreVQPATfJexHA6q" %}
[Heroes](/api/community-graphql-api/heroes)
{% endcontent-ref %}

{% content-ref url="/pages/ZA29RYL2xJ4fywsRuzO9" %}
[Pets](/api/community-graphql-api/pets)
{% endcontent-ref %}

{% content-ref url="/pages/3mQRF6BToBsSAX0Gu4Sy" %}
[Auctions](/api/community-graphql-api/auctions)
{% endcontent-ref %}

{% content-ref url="/pages/wXgERZEnmRqohAdJgUPN" %}
[Profiles](/api/community-graphql-api/profiles)
{% endcontent-ref %}

{% content-ref url="/pages/zcWw5HYUjNNTn8srcE6n" %}
[Bazaar](/api/community-graphql-api/bazaar)
{% endcontent-ref %}


# Getting Started

## Usage

The GraphQL API can be queried either through a GUI interface or programmatically.

### Graph*i*QL (GUI)

The Graphical User Interface maintained at <https://api.defikingdoms.com/graphql> is a great way to get started using the API and learning its syntax, as well as for quick lookups.

![GraphiQL interface for the community API](/files/ZPkloJwCu8zK15h34ZPN)

The `Docs` section in the top right-hand corner contains the full schema for the API, and the code editor will auto-complete.

### Javascript

Basic query implementation using the [`graphql-request`](https://github.com/prisma-labs/graphql-request) library.

```javascript
import { GraphQLClient, gql } from 'graphql-request'

const url = 'https://api.defikingdoms.com/graphql'
const query = gql`
  query getHero($heroId: ID!){
    hero(id: $heroId) {
      id
      mainClass
      owner {
        id
        name
      }
    }
  }`
const variables = {heroId: 1}

const client = new GraphQLClient(url)
client.request(query, variables).then((data) => console.log(data))
```

### Python

Basic query implementation using the [`requests`](https://pypi.org/project/requests/) library.

```python
import requests

url = 'https://api.defikingdoms.com/graphql'
query = """
  query getHero($heroId: ID!){
    hero(id: $heroId) {
      id
      mainClass
      owner {
        id
        name
      }
    }
  }
"""
variables = {'heroId': 1}

result = requests.post(url, json={'query': query, 'variables': variables})
print(result.json())
```

## Syntax

### Basic Query Syntax

```graphql
{
  queryField(arg1: argument, arg2: argument) {
    subfield1
    subfield2
    subfield3 {
      sub-subfield1
      sub-subfield2
    }
  }
}
```

Example query on the `hero` object:

```graphql
{
  hero(id: 1) {
    id
    mainClass
    owner {
      id
      name
    }
  }
}
```

{% hint style="info" %}
Because subfields may be an *object* type themselves (e.g. `Hero`, `Profile`), you can access the object's own fields without multiple queries or cumbersome joins, as in the example above, where `owner` is a `Profile` object.
{% endhint %}

{% hint style="warning" %}
Note that the GraphQL server has a recursion limit on accessing object type subfields, in most cases limited to 3 levels of depth.
{% endhint %}

### Arguments

All top-level query fields take arguments, set by the particular field. Every operation has two varieties: one that returns a single result and one that returns multiple results (e.g. `hero`/`heroes`, `saleAuction`/`saleAuctions`).

{% hint style="info" %}
*Only* top-level query fields can take arguments.
{% endhint %}

#### **Single-Result** Queries

These fields only take a single argument:

* `id`: `Int`/`String` - the id of the `Hero`, `Auction`, `Pet`, or `Profile`.

#### **Multiple-Result Queries**

These fields take any of the following *optional* arguments:

* `first`: `Int` - the number of requested results. Default: `1000`; Max: `1000`.
* `skip`: `Int` - skip the first *x* results. Default: `0`. Use to iterate beyond the 1000 result maximum per query.
* `orderBy`: `Subfield` - the subfield to order results by. Default: `id`.
* `orderDirection`: `asc`/`desc` - the order direction of the results. Default: `asc`.
* `where`: {`ObjectArray`} - Adds a [Filter](#filters) to the results.

*Example:* a `heroes` query using default arguments

```graphql
{
  heroes(first: 1000, skip: 0, orderBy: id, orderDirection: asc) {
    id
  }
}
```

### Filters

The optional `where` argument on a multi-result query allows for a high degree of flexibility. Any number of field/value pairs can be added to the array, with optional operators using the following syntax: `field_operator: value`.

{% hint style="info" %}
A filter used on an object field (e.g. `Hero`, `Auction`, `Pet`) will filter on that object's `id`, and cannot be used to access any of its other subfields.
{% endhint %}

#### **Operators**

* \[`none`] - equal to
* `_not` - not equal to
* `_gt` - greater than
* `_gte` - greater than or equal to
* `_lt` - less than
* `_lte` - less than or equal to
* `_in` - found in `[List]`
* `_not_in` - not found in `[List]`

*Example:* the Top 5 Ninja/Thief Heroes with the Fishing gene (ordered descending by Fishing skill)

```graphql
{
  heroes(
    first: 5, 
    orderBy: fishing, 
    orderDirection: desc, 
    where: {
      profession: "fishing", 
      mainClassStr_in: ["Ninja", "Thief"]
    })
  {
    id
    fishing
  }
}
```

### Variables

To add a variable to a query, three things are required:

1. Replace the static value in the query with `$variableName`
2. Declare `$variableName` as one of the variables accepted by the query and assign it a type (e.g. `ID`, `Int`, `String`, `Boolean`)
3. Pass `variableName: value` in a separate variables dictionary

```graphql
# Query with declared variable
query getHero($heroId: ID!) {
  hero(id: $heroId) {
    id
    mainClass
  }
}

# Variable passed as dictionary
{
  "heroId": 1
}
```

The example above also includes an expanded syntax beginning with the `query` *operation type*, and a user-declared *operation name* (`getHero`) for the function. The operation type is required to use variables, while the operation name is optional.

### Aliases and Fragments

#### Aliases

Using an *alias* allows you to include the same field type in your query multiple times with different arguments.&#x20;

*Example:* a single query that separately returns Pets hatched from Blue and Grey Eggs, respectively.

```graphql
{
  blueEggs: pets(where: {eggType: 0}) {
    id
  }
  greyEggs: pets(where: {eggType: 1}) {
    id
  }
}
```

#### Fragments

*Fragments* allow you to reuse the same subfields on multiple operations in a single query, without having to re-type them for each instance.

*Example:* expanding on the previous query to request a range of fields for each operation.

```graphql
query {
  blueEggs: pets(where: {eggType: 0}) {
    ...petInfo
  }
  greyEggs: pets(where: {eggType: 1}) {
    ...petInfo
  }
}

fragment petInfo on Pet {
  id
  rarity
  appearance
  owner {
    name
  }
}
```

{% hint style="info" %}
For more on Aliases, Fragments, and other advanced syntax like Mutations and Directives, see the [GraphQL Documentation](https://graphql.org/learn/).
{% endhint %}


# Auctions

## Queries

### `saleAuction`

Returns a single Sale Auction according to its `id`.

```graphql
saleAuction(id: ID!): Auction
```

### `saleAuctions`

Returns multiple Sale Auctions according to the [arguments](/api/community-graphql-api/getting-started#arguments) passed.

```graphql
saleAuctions(
  skip: Int
  first: Int
  orderBy: AuctionOrderBy
  orderDirection: OrderDirection
  where: AuctionFilter
): [Auction]!
```

### `assistingAuction`

Returns a single Assisting Auction according to its `id`.

```graphql
assistingAuction(id: ID!): Auction
```

### `assistingAuctions`

Returns multiple Assisting Auctions according to the [arguments](/api/community-graphql-api/getting-started#arguments) passed.

```graphql
assistingAuctions(
  skip: Int
  first: Int
  orderBy: AuctionOrderBy
  orderDirection: OrderDirection
  where: AuctionFilter
): [Auction]!
```

### `petAuction`

Returns a single Pet Auction according to its `id`.

```graphql
petAuction(id: ID!): PetAuction
```

### `petAuctions`

Returns multiple Pet Auctions according to the [arguments](/api/community-graphql-api/getting-started#arguments) passed.

```graphql
petAuctions(
  skip: Int
  first: Int
  orderBy: AuctionOrderBy
  orderDirection: OrderDirection
  where: AuctionFilter
): [PetAuction]!
```

## Object Types

### `Auction`

The `Auction` object type contains the following fields:

#### Basic Information

* `id`: `ID` - the Auction ID. Crystalvale IDs are padded by `10000000000000` (ten trillion), and Serendale (Klaytn) IDs are padded by `20000000000000` (twenty trillion).
* `seller`: `Profile` - the `Profile` of the Auction seller
* `tokenId`: `Hero` - the `Hero` being Sold/Rented

{% hint style="warning" %}
The `tokenId` field will return **current** values for the Hero, not its historical values at the time of the Auction.
{% endhint %}

* `startingPrice`: `String` - the price set at the start of the Auction in wei
* `endingPrice`: `String` - the price at the end of the Auction in wei
* `duration`: `Int` - the duration of the Auction in seconds; not currently in use
* `startedAt`: `Int` - the Unix timestamp of the Auction start
* `winner`: `Profile` - the `Profile` of the Auction winner; will be pre-filled for Private Auctions, even when `open`
* `endedAt`: `Int` - the Unix timestamp of the Auction end
* `open`: `Boolean` - whether the Auction is open or not
* `purchasePrice`: `String` - the price paid by the `winner` in wei

### `PetAuction`

The `PetAuction` object type contains the following fields:

#### Basic Information

* `id`: `ID` - the Auction ID
* `seller`: `Profile` - the `Profile` of the Auction seller
* `tokenId`: `Pet` - the `Pet` being Sold
* `startingPrice`: `String` - the price set at the start of the Auction in wei
* `endingPrice`: `String` - the price at the end of the Auction in wei
* `duration`: `Int` - the duration of the Auction in seconds; not currently in use
* `startedAt`: `Int` - the Unix timestamp of the Auction start
* `winner`: `Profile` - the `Profile` of the Auction winner; will be pre-filled for Private Auctions, even when `open`
* `endedAt`: `Int` - the Unix timestamp of the Auction end
* `open`: `Boolean` - whether the Auction is open or not
* `purchasePrice`: `String` - the price paid by the `winner` in wei

## Examples

#### Example 1

The first 100 open, non-private Sale Auctions sorted by lowest priced Hero:

```graphql
{
  saleAuctions(first: 100, orderBy: startingPrice, orderDirection: asc, where: {endedAt: null, winner: null}) {
    id
    startingPrice
    open
    tokenId {
      id
      mainClass
    }
    seller {
      name
    }
  }
}
```

{% hint style="info" %}
Using `where: {open: true`} would generally work as well, but a handful of completed Auctions got stuck with the `open` flag set to `True` and will appear in results otherwise.
{% endhint %}

#### Example 2

The five most expensive Pet sales that were successfully completed:

```graphql
{
  petAuctions(first: 5, orderBy: purchasePrice, orderDirection: desc, where: {purchasePrice_not: null}) {
    id
    tokenId {
      id
    }
    purchasePrice
    winner {
      name
    }
  }
}
```

#### Example 3

The entire Sale history (successful or not) of an individual Hero:

```graphql
{
  saleAuctions(where: {tokenId: 420}) {
    id
    startingPrice
    purchasePrice
    endedAt
    seller {
      name
    }
    winner {
      name
    }
  }
}
```

#### Example 4

All successful Rentals (Assisting Auctions) *purchased* by an individual player:

```graphql
{
  assistingAuctions(where: {winner: "0x2E7669F61eA77F02445A015FBdcFe2DE47083E02"}) {
    id
    purchasePrice
    endedAt
    tokenId {
      id
    }
    seller {
      name
    }
  }
}

```

{% hint style="info" %}
Note that the `tokenId` in this example is that of the Hero that was Hired out, not the one it was *paired* with during summoning, or the Id of the Hero summoned by the transaction.&#x20;
{% endhint %}


# Bazaar

## Queries

### `bazaarOrder`

Returns a single Bazaar Order according to its `orderId`.

```graphql
bazaarOrder(orderId: ID!): BazaarOrder
```

### `bazaarOrders`

Returns multiple Bazaar Orders according to the [arguments](/api/community-graphql-api/getting-started#arguments) passed.

```graphql
bazaarOrders(
  skip: Int
  first: Int
  orderBy: BazaarOrderOrderBy
  orderDirection: OrderDirection
  where: BazaarOrderFilter
): [BazaarOrder]!
```

### `bazaarTransactions`

Returns multiple Bazaar Transactions according to the [arguments](/api/community-graphql-api/getting-started#arguments) passed.

```graphql
bazaarTransactions(
  skip: Int
  first: Int
  orderBy: BazaarTransactionOrderBy
  orderDirection: OrderDirection
  where: BazaarTransactionFilter
): [BazaarTransaction]!
```

## Object Types

### `BazaarOrder`

The `BazaarOrder` object type contains the following fields:

* `orderId`: `ID` - the order ID - Crystalvale IDs are padded by `1000000000000` (one trillion), and Serendale (Klaytn) IDs are padded by `2000000000000` (two trillion).
* `network`: `String` - the network of the order, either `dfk` or `kla`
* `open`: `Boolean` - whether the order is currently open (`true`) or closed (`false`)
* `cancelledStamp`: `Int` - if the order was cancelled, the Unix timestamp of the cancellation
* `createdStamp`: `Int` - the Unix timestamp at which the order was created
* `tokenAddress`: `String` - the contract address of the order token
* `tokenId`: `Int` - for ERC-1155 tokens, the `tokenId`; for ERC-20 tokens, `0`
* `isErc20`: `Boolean` - whether the order token is an ERC-20 token (`true`) or an ERC-1155 token (`false`)
* `side`: `Int` - whether the order is submitted to the buy (`0`) or sell (`1`) side of the order book
* `price`: `String` - the `pricePerUnit (in wei) * 10^12`

{% hint style="info" %}
Note: The JEWEL Price per Unit (in ether) is equal to: `price / 10^30`.
{% endhint %}

* `initialQuantity`: `String` - the quantity of tokens initially submitted with the order
* `remainingQuantity`: `String` - the remaining quantity of items that are unfulfilled in the order
* `baseTokenAddress`: `String` - the contract address of the base token (always JEWEL)
* `owner`: `Profile` - the `Profile` of the owner/creator of the order

### `Bazaar Transaction`

The `BazaarTransaction` object type contains the following fields:

* `orderId`: `ID` - the order ID that is being transacted upon - Crystalvale IDs are padded by `1000000000000` (one trillion), and Serendale (Klaytn) IDs are padded by `2000000000000` (two trillion).
* `network`: `String` - the network of the order/transaction, either `dfk` or `kla`
* `txHash`: `String` - the blockchain transaction hash of the transaction
* `executedStamp`: `Int` - the Unix timestamp at which the transaction was executed
* `quantity`: `String` - the quantity of tokens executed in the transaction
* `price`: `String` - the `pricePerUnit (in wei) * 10^12`

{% hint style="info" %}
Note: The JEWEL Price per Unit (in ether) is equal to: `price / 10^30`.
{% endhint %}

* `side`: `Int` - whether the order being transacted upon is on the buy (`0`) or sell (`1`) side of the order book
* `tokenAddress`: `String` - the contract address of the transacted token
* `tokenId`: `Int` - for ERC-1155 tokens, the `tokenId`; for ERC-20 tokens, `0`
* `initiator`: `Profile` - the `Profile` of the initiator of the transaction
* `owner`: `Profile` - the `Profile` of the owner/creator of the order that is being transacted upon

## Examples

#### Example 1

The first 100 open Bazaar Orders sorted by most recently created:

```graphql
{
  bazaarOrders(
    first: 100,
    orderBy: createdStamp,
    orderDirection: desc,
    where: {
      open: true
    }
  ) {
    orderId
    tokenAddress
    price
    side
  }
}
```

#### Example 2

All Bazaar Transactions for Bloaters executed against buy orders on DFK Chain

```graphql
{
  bazaarTransactions(
    where: {
      network: "dfk",
      side: 0,
      tokenAddress: "0x268CC8248FFB72Cd5F3e73A9a20Fa2FF40EfbA61"
    }
  ) {
    orderId
    price
    executedStamp
    quantity
  }
}
```

{% hint style="info" %}
Note: The results returned will be for *sell* transactions (side `1`), since they are being executed *against* open buy orders (side `0`).
{% endhint %}


# Heroes

## Queries

### `hero`

Returns a single Hero according to its `id`.

```graphql
hero(id: ID!): Hero
```

### `heroes`

Returns multiple Heroes according to the [arguments](/api/community-graphql-api/getting-started#arguments) passed.

```graphql
heroes(
  skip: Int
  first: Int
  orderBy: HeroOrderBy
  orderDirection: OrderDirection
  where: HeroFilter
): [Hero]!
```

## Object Types

### `Hero`

The `Hero` object type contains the following fields:

#### Basic Information

* `id`: `ID` - the Hero's ID. Crystalvale Hero IDs are padded by `1000000000000` (one trillion), and Serendale (Klaytn) IDs are padded by `2000000000000` (two trillion).
* `numberId`: `String` - deprecated, as `id` now sorts as `Int.`
* `normalizedId`: `String` - the ID that appears in-game without realm padding.
* `owner`: `Profile` - the current owner of the Hero. Heroes held in the [Tavern contract](/contracts/sales-and-rentals/hero-auction) will still return the Profile of their owner.
* `previousOwner`: `Profile` - the most immediate recent owner of the Hero. May return `null` if the Hero has not changed wallets since the Perilous Journey.
* `creator`: `Profile`  - currently not in use and will return `null`
* `network`: `String` - the current network of the Hero; returns `hmy`, `dfk`, or `kla`
* `originRealm`: `String` - the origin realm of the Hero; returns `SER`, `CRY`, or `SER2`
* `statGenes`: `String` - the encrypted string of the Hero's dominant and recessive stat genes
* `visualGenes`: `String` - the encrypted string of the Hero's dominant and recessive visual genes
* `rarity`: `Int` - maps from `0` (Common) to `4` (Mythic)
* `shiny`: `Boolean`&#x20;
* `generation`: `Int`&#x20;
* `firstName`: `Int` - parsed by the Hero First Name tables according to `gender`
* `lastName`: `Int` - parsed by the Hero Last Name table
* `shinyStyle`: `Int` - ranging from `0` to `13`
* `mainClassStr`: `String`&#x20;
* `subClassStr`: `String`
* `professionStr`: `String`

#### Summoning Details

* `summonedTime`: `Int` - the Unix timestamp of the Hero's summoning
* `nextSummonTime`: `Int` - the Unix timestamp of the Hero's next available summon
* `summonerId`: `Hero` - the `Hero` object of the Hero's Summoner
* `assistantId`: `Hero` - the `Hero` object of the Hero's Assistant Summoner
* `summons`: `Int` - the number of summons used by the Hero
* `maxSummons`: `Int` - the maximum number of summons by the Hero; returns `11` for Gen0 Heroes
* `summonsRemaining`: `Int` - the number of summons remaining for the Hero; returns `11` for Gen0 Heroes
* `darkSummoned`: `Bool` - whether the Hero was Dark Summoned or not
* `darkSummonLevels`: `Int` - the maximum level a Hero can attain from Dark Summoning level boosts (Default: 1 for Dark Summoned Heroes; 0 for non-DS Heroes)

#### Hero State

* `staminaFullAt`: `Int` - the Unix timestamp when the Hero's Stamina will be full
* `hpFullAt`: `Int` - the Unix timestamp when the Hero's HP will be full; not currently in use
* `mpFullAt`: `Int` - the Unix timestamp when the Hero's MP will be full; not currently in use
* `level`: `Int`
* `xp`: `Int` - the Hero's current XP toward their next level
* `currentQuest`: `String` - the [contract address](/contracts/quests) of the Hero's current quest
* `sp`: `Int` - not currently in use
* `status`: `String` - not currently in use

#### Stats and Stat Growth

**Hero Stats**

* `strength`: `Int`&#x20;
* `intelligence`: `Int`&#x20;
* `wisdom`: `Int`&#x20;
* `luck`: `Int`&#x20;
* `agility`: `Int`&#x20;
* `vitality`: `Int`&#x20;
* `endurance`: `Int`&#x20;
* `dexterity`: `Int`&#x20;
* `hp`: `Int`&#x20;
* `mp`: `Int`&#x20;
* `stamina`: `Int` - the Hero's maximum stamina

**Primary Stat Growth**

{% hint style="info" %}
Stat Growth, HP Growth, and MP Growth Values are returned as integers representing percentage values to two decimal places of precision (e.g. `1725` is 17.25%). To convert these values to percents represented in decimals, divide by 10000 (ten thousand).
{% endhint %}

* `strengthGrowthP`: `Int`&#x20;
* `intelligenceGrowthP`: `Int`&#x20;
* `wisdomGrowthP`: `Int`&#x20;
* `luckGrowthP`: `Int`&#x20;
* `agilityGrowthP`: `Int`
* `vitalityGrowthP`: `Int`
* `enduranceGrowthP`: `Int`
* `dexterityGrowthP`: `Int`

**Secondary Stat Growth**

* `strengthGrowthS`: `Int`
* `intelligenceGrowthS`: `Int`
* `wisdomGrowthS`: `Int`
* `luckGrowthS`: `Int`
* `agilityGrowthS`: `Int`
* `vitalityGrowthS`: `Int`
* `enduranceGrowthS`: `Int`
* `dexterityGrowthS`: `Int`

**HP and MP Growth**

* `hpSmGrowth`: `Int`
* `hpRgGrowth`: `Int`&#x20;
* `hpLgGrowth`: `Int`&#x20;
* `mpSmGrowth`: `Int`
* `mpRgGrowth`: `Int`
* `mpLgGrowth`: `Int`&#x20;

#### Profession Skills

{% hint style="info" %}
Profession Skill values are stored as integers and should be divided by 10 to return the value on the back of the Hero card.
{% endhint %}

* `mining`: `Int`&#x20;
* `gardening`: `Int`
* `foraging`: `Int`
* `fishing`: `Int`

#### Stat Genes

* `hasValidCraftingGenes`: `Bool` - whether the Hero has valid Crafting Genes (e.g. `StatsUnknown1` and `StatsUnknown2` are rolled correctly for crafting)

{% hint style="info" %}
The API only displays the Hero's dominant genes. Recessive stat genes must be parsed from the Hero's `statGenes` string.
{% endhint %}

* `mainClass`: `Int`
* `subClass`: `Int`
* `profession`: `Int`
* `passive1`: `Int`
* `passive2`: `Int`
* `active1`: `Int`
* `active2`: `Int`
* `statBoost1`: `Int`
* `statBoost2`: `Int`
* `statsUnknown1`: `Int`
* `element`: `Int`
* `statsUnknown2`: `Int`

#### Visual Genes

{% hint style="info" %}
The API only displays the Hero's dominant genes. Recessive visual genes must be parsed from the Hero's `visualGenes` string.
{% endhint %}

* `gender`: `Int`
* `headAppendage`: `Int`
* `backAppendage`: `Int`
* `background`: `Int`
* `hairStyle`: `Int`
* `hairColor`: `Int`
* `visualUnknown1`: `Int`
* `eyeColor`: `Int`
* `skinColor`: `Int`
* `appendageColor`: `Int`
* `backAppendageColor`: `Int`
* `visualUnknown2`: `Int`

#### Auction Details

* `assistingAuction`: `Auction` - if the Hero is currently placed for Hire, returns the corresponding `Auction`
* `assistingPrice`: `String` - if the Hero is currently placed for Hire, returns the Hire price in wei
* `saleAuction`: `Auction` - if the Hero is currently placed for Sale, returns the corresponding `Auction`
* `salePrice`: `String` - if the Hero is currently placed for Sale, returns the Sale price in wei
* `privateAuctionProfile`: `Profile` - if the Hero is currently placed for Private Sale or Hire, returns the corresponding `Profile` of the future buyer/renter

#### Perilous Journey

* `pjStatus`: `String` - the Perilous Journey status of the Hero; returns `null`, `SURVIVED`, `ON_JOURNEY`, or `DIED`
* `pjLevel`: `Int` - the Level of the Hero when & if it was sent on the Perilous Journey
* `pjOwner`: `Profile` - the `Profile` of the player who sent the Hero on the Perilous Journey
* `pjClaimStamp`: `Int` - the Unix timestamp of the Hero's Perilous Journey claim transaction

## Examples

#### Example 1

All Heroes owned by an individual user:

```graphql
{
  heroes(where: {owner: "0x2E7669F61eA77F02445A015FBdcFe2DE47083E02"}) {
    id
    mainClass
    rarity
  }
}
```

#### Example 2

All Level 1, Gen0 Heroes currently located on the Harmony network:

```graphql
{
  heroes(where: {generation: 0, level: 1, network: "hmy"}) {
    id
    mainClass
    owner {
      name
    }
  }
}
```

#### Example 3

All Heroes with at least 23 Endurance that died on the Perilous Journey

```graphql
{
  heroes(orderBy: endurance, orderDirection: desc, where: {endurance_gte: 23, pjStatus: "DIED"}) {
    id
    mainClass
    endurance
    pjStatus
  }
}
```

#### Example 4

All Paladins currently for Sale that were summoned with a Might Enhancement Stone (assumes that Primary Strength Growth rate is at least 83%), sorted by ascending Sale Price:

```graphql
{
  heroes(orderBy: salePrice, orderDirection: asc, where: {mainClass: "Paladin", strengthGrowthP_gte: 8300, salePrice_not: null}) {
    id
    rarity
    level
    strengthGrowthP
    statBoost2
    salePrice
  }
}
```

{% hint style="info" %}
Because `Auction` and `PetAuction` queries can't filter on subfields of `tokenId`, use complex `Heroes` and `Pets` queries with a `salePrice_not: null` filter instead.
{% endhint %}

#### Example 5

The Top 3 Heroes of each profession ordered by that profession skill, using *aliases* and *fragments*:

```graphql
query topProfessionHeroes {
  foraging: heroes(first: 3, orderBy: foraging, orderDirection: desc) {
    ...heroDetails
    foraging
  }
  fishing: heroes(first: 3, orderBy: fishing, orderDirection: desc) {
    ...heroDetails
    fishing
  }
  gardening: heroes(first: 3, orderBy: gardening, orderDirection: desc) {
    ...heroDetails
    gardening
  }
  mining: heroes(first: 3, orderBy: mining, orderDirection: desc) {
    ...heroDetails
    mining
  }
}

fragment heroDetails on Hero {
  id
  mainClass
  rarity
  level
  owner {
    name
  }
}
```




---

[Next Page](/llms-full.txt/1)

