import { Interface, Contract, type Signer, type Provider } from "ethers";
import {
  AXIE_PROXY,
  ERC_721_BATCH_TRANSFER,
  MARKETPLACE_GATEWAY_V_2,
  USD_COIN,
  WRAPPED_ETHER,
  ATIAS_BLESSING,
} from "@roninbuilders/contracts";

export function getAxieContract(signerOrProvider?: Signer | Provider) {
  const address = AXIE_PROXY.address;
  const abi = [
    {
      inputs: [],
      stateMutability: "nonpayable",
      type: "constructor"
    },
    {
      inputs: [],
      name: "AccessControlBadConfirmation",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "account",
          type: "address"
        },
        {
          internalType: "bytes32",
          name: "neededRole",
          type: "bytes32"
        }
      ],
      name: "AccessControlUnauthorizedAccount",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "axieId",
          type: "uint256"
        },
        {
          internalType: "enum IAxie.AxieStage",
          name: "stage",
          type: "uint8"
        },
        {
          internalType: "uint256",
          name: "neededDuration",
          type: "uint256"
        }
      ],
      name: "AxieStageNotReadyToGrow",
      type: "error"
    },
    {
      inputs: [],
      name: "EmptyGenes",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "hoppingAxieId",
          type: "uint256"
        }
      ],
      name: "HoppingAxieAlreadyOwned",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "axieId",
          type: "uint256"
        },
        {
          internalType: "uint256",
          name: "hoppingAxieId",
          type: "uint256"
        }
      ],
      name: "InvalidHoppingAxieId",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "bytes4",
          name: "sig",
          type: "bytes4"
        }
      ],
      name: "InvalidLength",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "axieId",
          type: "uint256"
        }
      ],
      name: "NonExistentAxie",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "NonExistentToken",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "axieId",
          type: "uint256"
        }
      ],
      name: "NotAxieAdult",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "axieId",
          type: "uint256"
        }
      ],
      name: "NotAxiegg",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "REP15AlreadyAttachedContext",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "address",
          name: "delegatee",
          type: "address"
        },
        {
          internalType: "uint64",
          name: "until",
          type: "uint64"
        }
      ],
      name: "REP15AlreadyDelegatedOwnership",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint64",
          name: "detachingDuration",
          type: "uint64"
        }
      ],
      name: "REP15ExceededMaxDetachingDuration",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        }
      ],
      name: "REP15ExistentContext",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "REP15InactiveOwnershipDelegation",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "operator",
          type: "address"
        },
        {
          internalType: "address",
          name: "delegatee",
          type: "address"
        }
      ],
      name: "REP15InsufficientApproval",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "bytes4",
          name: "sig",
          type: "bytes4"
        }
      ],
      name: "REP15InvalidBatchLength",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "controller",
          type: "address"
        }
      ],
      name: "REP15InvalidController",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "delegatee",
          type: "address"
        }
      ],
      name: "REP15InvalidDelegatee",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint64",
          name: "until",
          type: "uint64"
        }
      ],
      name: "REP15InvalidDelegationExpiration",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "REP15NonexistentAttachedContext",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        }
      ],
      name: "REP15NonexistentContext",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "REP15NonexistentPendingOwnershipDelegation",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "REP15NotRequestedForDetachment",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "REP15RequestedForDetachment",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "uint64",
          name: "current",
          type: "uint64"
        },
        {
          internalType: "uint64",
          name: "readyAt",
          type: "uint64"
        }
      ],
      name: "REP15UnreadyForDetachment",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "address",
          name: "operator",
          type: "address"
        },
        {
          internalType: "bytes4",
          name: "sig",
          type: "bytes4"
        }
      ],
      name: "UnauthorizedOperator",
      type: "error"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "address",
          name: "_owner",
          type: "address"
        },
        {
          indexed: true,
          internalType: "address",
          name: "_approved",
          type: "address"
        },
        {
          indexed: true,
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        }
      ],
      name: "Approval",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "address",
          name: "_owner",
          type: "address"
        },
        {
          indexed: true,
          internalType: "address",
          name: "_operator",
          type: "address"
        },
        {
          indexed: false,
          internalType: "bool",
          name: "_approved",
          type: "bool"
        }
      ],
      name: "ApprovalForAll",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "uint256",
          name: "_axieId",
          type: "uint256"
        },
        {
          components: [
            {
              internalType: "uint256",
              name: "x",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "y",
              type: "uint256"
            }
          ],
          indexed: false,
          internalType: "struct AxieGenetics.Genes",
          name: "_genes",
          type: "tuple"
        }
      ],
      name: "AxieEvolved",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "uint256",
          name: "axieId",
          type: "uint256"
        },
        {
          indexed: false,
          internalType: "uint256",
          name: "level",
          type: "uint256"
        }
      ],
      name: "AxieLevelUpdated",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "uint256",
          name: "_axieId",
          type: "uint256"
        },
        {
          components: [
            {
              internalType: "uint256",
              name: "sireId",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "matronId",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "birthDate",
              type: "uint256"
            },
            {
              components: [
                {
                  internalType: "uint256",
                  name: "x",
                  type: "uint256"
                },
                {
                  internalType: "uint256",
                  name: "y",
                  type: "uint256"
                }
              ],
              internalType: "struct AxieGenetics.Genes",
              name: "genes",
              type: "tuple"
            },
            {
              internalType: "uint8",
              name: "breedCount",
              type: "uint8"
            },
            {
              internalType: "uint16",
              name: "level",
              type: "uint16"
            }
          ],
          indexed: false,
          internalType: "struct IAxie.Axie",
          name: "_axie",
          type: "tuple"
        }
      ],
      name: "AxieMinted",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "uint256",
          name: "_axieId",
          type: "uint256"
        },
        {
          components: [
            {
              internalType: "uint256",
              name: "sireId",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "matronId",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "birthDate",
              type: "uint256"
            },
            {
              components: [
                {
                  internalType: "uint256",
                  name: "x",
                  type: "uint256"
                },
                {
                  internalType: "uint256",
                  name: "y",
                  type: "uint256"
                }
              ],
              internalType: "struct AxieGenetics.Genes",
              name: "genes",
              type: "tuple"
            },
            {
              internalType: "uint8",
              name: "breedCount",
              type: "uint8"
            },
            {
              internalType: "uint16",
              name: "level",
              type: "uint16"
            }
          ],
          indexed: false,
          internalType: "struct IAxie.Axie",
          name: "_axie",
          type: "tuple"
        },
        {
          components: [
            {
              components: [
                {
                  internalType: "uint256",
                  name: "x",
                  type: "uint256"
                },
                {
                  internalType: "uint256",
                  name: "y",
                  type: "uint256"
                }
              ],
              internalType: "struct AxieGenetics.Genes",
              name: "sireGenes",
              type: "tuple"
            },
            {
              components: [
                {
                  internalType: "uint256",
                  name: "x",
                  type: "uint256"
                },
                {
                  internalType: "uint256",
                  name: "y",
                  type: "uint256"
                }
              ],
              internalType: "struct AxieGenetics.Genes",
              name: "matronGenes",
              type: "tuple"
            }
          ],
          indexed: false,
          internalType: "struct IAxie.Axiegg",
          name: "_axiegg",
          type: "tuple"
        }
      ],
      name: "AxieggMinted",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "uint256",
          name: "sireId",
          type: "uint256"
        },
        {
          indexed: true,
          internalType: "uint256",
          name: "matronId",
          type: "uint256"
        },
        {
          indexed: true,
          internalType: "uint256",
          name: "axieId",
          type: "uint256"
        },
        {
          indexed: false,
          internalType: "uint8",
          name: "sireBreedCount",
          type: "uint8"
        },
        {
          indexed: false,
          internalType: "uint8",
          name: "matronBreedCount",
          type: "uint8"
        },
        {
          components: [
            {
              components: [
                {
                  internalType: "uint256",
                  name: "x",
                  type: "uint256"
                },
                {
                  internalType: "uint256",
                  name: "y",
                  type: "uint256"
                }
              ],
              internalType: "struct AxieGenetics.Genes",
              name: "sireGenes",
              type: "tuple"
            },
            {
              components: [
                {
                  internalType: "uint256",
                  name: "x",
                  type: "uint256"
                },
                {
                  internalType: "uint256",
                  name: "y",
                  type: "uint256"
                }
              ],
              internalType: "struct AxieGenetics.Genes",
              name: "matronGenes",
              type: "tuple"
            }
          ],
          indexed: false,
          internalType: "struct IAxie.Axiegg",
          name: "axiegg",
          type: "tuple"
        }
      ],
      name: "BreedingInfoUpdated",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          indexed: true,
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "ContextAttached",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          indexed: true,
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "ContextDetached",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          indexed: true,
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "ContextDetachmentRequested",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          indexed: true,
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          indexed: false,
          internalType: "bool",
          name: "locked",
          type: "bool"
        }
      ],
      name: "ContextLockUpdated",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          indexed: true,
          internalType: "address",
          name: "controller",
          type: "address"
        },
        {
          indexed: false,
          internalType: "uint64",
          name: "detachingDuration",
          type: "uint64"
        }
      ],
      name: "ContextUpdated",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          indexed: true,
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          indexed: true,
          internalType: "address",
          name: "user",
          type: "address"
        }
      ],
      name: "ContextUserAssigned",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: false,
          internalType: "uint8",
          name: "version",
          type: "uint8"
        }
      ],
      name: "Initialized",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        },
        {
          indexed: true,
          internalType: "uint256",
          name: "_nonce",
          type: "uint256"
        }
      ],
      name: "NonceUpdated",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          indexed: true,
          internalType: "address",
          name: "delegatee",
          type: "address"
        },
        {
          indexed: false,
          internalType: "uint64",
          name: "until",
          type: "uint64"
        }
      ],
      name: "OwnershipDelegationAccepted",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          indexed: true,
          internalType: "address",
          name: "delegatee",
          type: "address"
        },
        {
          indexed: false,
          internalType: "uint64",
          name: "until",
          type: "uint64"
        }
      ],
      name: "OwnershipDelegationStarted",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          indexed: true,
          internalType: "address",
          name: "delegatee",
          type: "address"
        }
      ],
      name: "OwnershipDelegationStopped",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [],
      name: "Paused",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: false,
          internalType: "address",
          name: "_owner",
          type: "address"
        },
        {
          indexed: false,
          internalType: "address",
          name: "_operator",
          type: "address"
        },
        {
          indexed: false,
          internalType: "bytes4",
          name: "_funcSig",
          type: "bytes4"
        },
        {
          indexed: false,
          internalType: "bool",
          name: "_approved",
          type: "bool"
        }
      ],
      name: "PermissionSet",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: false,
          internalType: "address",
          name: "_owner",
          type: "address"
        },
        {
          indexed: false,
          internalType: "address",
          name: "_operator",
          type: "address"
        },
        {
          indexed: false,
          internalType: "bool",
          name: "_approved",
          type: "bool"
        }
      ],
      name: "PermissionSetAll",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          indexed: true,
          internalType: "bytes32",
          name: "previousAdminRole",
          type: "bytes32"
        },
        {
          indexed: true,
          internalType: "bytes32",
          name: "newAdminRole",
          type: "bytes32"
        }
      ],
      name: "RoleAdminChanged",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          indexed: true,
          internalType: "address",
          name: "account",
          type: "address"
        },
        {
          indexed: true,
          internalType: "address",
          name: "sender",
          type: "address"
        }
      ],
      name: "RoleGranted",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          indexed: true,
          internalType: "address",
          name: "account",
          type: "address"
        },
        {
          indexed: true,
          internalType: "address",
          name: "sender",
          type: "address"
        }
      ],
      name: "RoleRevoked",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "address",
          name: "_spender",
          type: "address"
        }
      ],
      name: "SpenderUnwhitelisted",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "address",
          name: "_spender",
          type: "address"
        }
      ],
      name: "SpenderWhitelisted",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: false,
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        },
        {
          indexed: false,
          internalType: "address",
          name: "_operator",
          type: "address"
        },
        {
          indexed: false,
          internalType: "bool",
          name: "_approved",
          type: "bool"
        }
      ],
      name: "TokenOperatorSet",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: false,
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        },
        {
          indexed: false,
          internalType: "address",
          name: "_operator",
          type: "address"
        },
        {
          indexed: false,
          internalType: "bytes4",
          name: "_funcSig",
          type: "bytes4"
        },
        {
          indexed: false,
          internalType: "bool",
          name: "_approved",
          type: "bool"
        }
      ],
      name: "TokenPermissionSet",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "address",
          name: "_from",
          type: "address"
        },
        {
          indexed: true,
          internalType: "address",
          name: "_to",
          type: "address"
        },
        {
          indexed: true,
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        }
      ],
      name: "Transfer",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [],
      name: "Unpaused",
      type: "event"
    },
    {
      inputs: [],
      name: "DEFAULT_ADMIN_ROLE",
      outputs: [
        {
          internalType: "bytes32",
          name: "",
          type: "bytes32"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [],
      name: "DOMAIN_SEPARATOR",
      outputs: [
        {
          internalType: "bytes32",
          name: "",
          type: "bytes32"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [],
      name: "DOMAIN_TYPEHASH",
      outputs: [
        {
          internalType: "bytes32",
          name: "",
          type: "bytes32"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [],
      name: "MINTER_ROLE",
      outputs: [
        {
          internalType: "bytes32",
          name: "",
          type: "bytes32"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [],
      name: "SEEDER_ROLE",
      outputs: [
        {
          internalType: "bytes32",
          name: "",
          type: "bytes32"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "acceptOwnershipDelegation",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [],
      name: "admin",
      outputs: [
        {
          internalType: "address",
          name: "",
          type: "address"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_to",
          type: "address"
        },
        {
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        }
      ],
      name: "approve",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "bytes",
          name: "data",
          type: "bytes"
        }
      ],
      name: "attachContext",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "",
          type: "uint256"
        }
      ],
      name: "axie",
      outputs: [
        {
          internalType: "uint256",
          name: "sireId",
          type: "uint256"
        },
        {
          internalType: "uint256",
          name: "matronId",
          type: "uint256"
        },
        {
          internalType: "uint256",
          name: "birthDate",
          type: "uint256"
        },
        {
          components: [
            {
              internalType: "uint256",
              name: "x",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "y",
              type: "uint256"
            }
          ],
          internalType: "struct AxieGenetics.Genes",
          name: "genes",
          type: "tuple"
        },
        {
          internalType: "uint8",
          name: "breedCount",
          type: "uint8"
        },
        {
          internalType: "uint16",
          name: "level",
          type: "uint16"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "",
          type: "uint256"
        }
      ],
      name: "axiegg",
      outputs: [
        {
          components: [
            {
              internalType: "uint256",
              name: "x",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "y",
              type: "uint256"
            }
          ],
          internalType: "struct AxieGenetics.Genes",
          name: "sireGenes",
          type: "tuple"
        },
        {
          components: [
            {
              internalType: "uint256",
              name: "x",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "y",
              type: "uint256"
            }
          ],
          internalType: "struct AxieGenetics.Genes",
          name: "matronGenes",
          type: "tuple"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_owner",
          type: "address"
        }
      ],
      name: "balanceOf",
      outputs: [
        {
          internalType: "uint256",
          name: "_balance",
          type: "uint256"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [],
      name: "baseTokenURI",
      outputs: [
        {
          internalType: "string",
          name: "",
          type: "string"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32[]",
          name: "ctxHashes",
          type: "bytes32[]"
        },
        {
          internalType: "uint256[]",
          name: "tokenIds",
          type: "uint256[]"
        },
        {
          internalType: "bytes[]",
          name: "data",
          type: "bytes[]"
        }
      ],
      name: "batchAttachContexts",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256[]",
          name: "_axieIds",
          type: "uint256[]"
        },
        {
          internalType: "uint256[]",
          name: "_seeds",
          type: "uint256[]"
        }
      ],
      name: "batchGrowAxieggsToAdults",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256[]",
          name: "_ids",
          type: "uint256[]"
        },
        {
          internalType: "bytes[]",
          name: "_packages",
          type: "bytes[]"
        },
        {
          internalType: "address",
          name: "_owner",
          type: "address"
        }
      ],
      name: "batchMintAxies",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "controller",
          type: "address"
        },
        {
          internalType: "uint64",
          name: "detachingDuration",
          type: "uint64"
        },
        {
          internalType: "bytes",
          name: "ctxMsg",
          type: "bytes"
        }
      ],
      name: "createContext",
      outputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        }
      ],
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [],
      name: "currentAxieId",
      outputs: [
        {
          internalType: "uint256",
          name: "",
          type: "uint256"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "_axieId",
          type: "uint256"
        },
        {
          components: [
            {
              internalType: "uint256",
              name: "x",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "y",
              type: "uint256"
            }
          ],
          internalType: "struct AxieGenetics.Genes",
          name: "_genes",
          type: "tuple"
        }
      ],
      name: "evolveAxie",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "bytes",
          name: "data",
          type: "bytes"
        }
      ],
      name: "execDetachContext",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [],
      name: "geneBrewerContract",
      outputs: [
        {
          internalType: "contract IAxieGeneBrewer",
          name: "",
          type: "address"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        }
      ],
      name: "getApproved",
      outputs: [
        {
          internalType: "address",
          name: "",
          type: "address"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "_axieId",
          type: "uint256"
        }
      ],
      name: "getAxie",
      outputs: [
        {
          components: [
            {
              internalType: "uint256",
              name: "sireId",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "matronId",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "birthDate",
              type: "uint256"
            },
            {
              components: [
                {
                  internalType: "uint256",
                  name: "x",
                  type: "uint256"
                },
                {
                  internalType: "uint256",
                  name: "y",
                  type: "uint256"
                }
              ],
              internalType: "struct AxieGenetics.Genes",
              name: "genes",
              type: "tuple"
            },
            {
              internalType: "uint8",
              name: "breedCount",
              type: "uint8"
            },
            {
              internalType: "uint16",
              name: "level",
              type: "uint16"
            }
          ],
          internalType: "struct IAxie.Axie",
          name: "",
          type: "tuple"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "_axieId",
          type: "uint256"
        }
      ],
      name: "getAxiegg",
      outputs: [
        {
          components: [
            {
              components: [
                {
                  internalType: "uint256",
                  name: "x",
                  type: "uint256"
                },
                {
                  internalType: "uint256",
                  name: "y",
                  type: "uint256"
                }
              ],
              internalType: "struct AxieGenetics.Genes",
              name: "sireGenes",
              type: "tuple"
            },
            {
              components: [
                {
                  internalType: "uint256",
                  name: "x",
                  type: "uint256"
                },
                {
                  internalType: "uint256",
                  name: "y",
                  type: "uint256"
                }
              ],
              internalType: "struct AxieGenetics.Genes",
              name: "matronGenes",
              type: "tuple"
            }
          ],
          internalType: "struct IAxie.Axiegg",
          name: "",
          type: "tuple"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        }
      ],
      name: "getContext",
      outputs: [
        {
          internalType: "address",
          name: "controller",
          type: "address"
        },
        {
          internalType: "uint64",
          name: "detachingDuration",
          type: "uint64"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "getContextUser",
      outputs: [
        {
          internalType: "address",
          name: "user",
          type: "address"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "getOwnershipDelegatee",
      outputs: [
        {
          internalType: "address",
          name: "delegatee",
          type: "address"
        },
        {
          internalType: "uint64",
          name: "until",
          type: "uint64"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "getOwnershipManager",
      outputs: [
        {
          internalType: "address",
          name: "manager",
          type: "address"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        }
      ],
      name: "getRoleAdmin",
      outputs: [
        {
          internalType: "bytes32",
          name: "",
          type: "bytes32"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "index",
          type: "uint256"
        }
      ],
      name: "getRoleMember",
      outputs: [
        {
          internalType: "address",
          name: "",
          type: "address"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        }
      ],
      name: "getRoleMemberCount",
      outputs: [
        {
          internalType: "uint256",
          name: "",
          type: "uint256"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          internalType: "address",
          name: "account",
          type: "address"
        }
      ],
      name: "grantRole",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          internalType: "address",
          name: "account",
          type: "address"
        }
      ],
      name: "hasRole",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "",
          type: "uint256"
        }
      ],
      name: "hoppingAxieId",
      outputs: [
        {
          internalType: "uint256",
          name: "",
          type: "uint256"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_owner",
          type: "address"
        },
        {
          internalType: "address",
          name: "_operator",
          type: "address"
        }
      ],
      name: "isApprovedForAll",
      outputs: [
        {
          internalType: "bool",
          name: "_approved",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "isAttachedWithContext",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_operator",
          type: "address"
        },
        {
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        },
        {
          internalType: "bytes4",
          name: "_funcSig",
          type: "bytes4"
        }
      ],
      name: "isAuthorized",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        },
        {
          internalType: "address",
          name: "_operator",
          type: "address"
        },
        {
          internalType: "bytes4",
          name: "_funcSig",
          type: "bytes4"
        }
      ],
      name: "isFunctionOperatorOfToken",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "addr",
          type: "address"
        }
      ],
      name: "isMinter",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_owner",
          type: "address"
        },
        {
          internalType: "address",
          name: "_operator",
          type: "address"
        },
        {
          internalType: "bytes4",
          name: "_funcSig",
          type: "bytes4"
        }
      ],
      name: "isPermissionSet",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_owner",
          type: "address"
        },
        {
          internalType: "address",
          name: "_operator",
          type: "address"
        }
      ],
      name: "isPermissionSetAll",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "isTokenContextLocked",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        },
        {
          internalType: "address",
          name: "_operator",
          type: "address"
        }
      ],
      name: "isTokenOperator",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [],
      name: "maxDetachingDuration",
      outputs: [
        {
          internalType: "uint64",
          name: "",
          type: "uint64"
        }
      ],
      stateMutability: "pure",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_to",
          type: "address"
        },
        {
          components: [
            {
              internalType: "uint256",
              name: "sireId",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "matronId",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "birthDate",
              type: "uint256"
            },
            {
              components: [
                {
                  internalType: "uint256",
                  name: "x",
                  type: "uint256"
                },
                {
                  internalType: "uint256",
                  name: "y",
                  type: "uint256"
                }
              ],
              internalType: "struct AxieGenetics.Genes",
              name: "genes",
              type: "tuple"
            },
            {
              internalType: "uint8",
              name: "breedCount",
              type: "uint8"
            },
            {
              internalType: "uint16",
              name: "level",
              type: "uint16"
            }
          ],
          internalType: "struct IAxie.Axie",
          name: "_axie",
          type: "tuple"
        }
      ],
      name: "mintAxie",
      outputs: [
        {
          internalType: "uint256",
          name: "_axieId",
          type: "uint256"
        }
      ],
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "addr",
          type: "address"
        }
      ],
      name: "minter",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "index",
          type: "uint256"
        }
      ],
      name: "minters",
      outputs: [
        {
          internalType: "address",
          name: "",
          type: "address"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [],
      name: "name",
      outputs: [
        {
          internalType: "string",
          name: "",
          type: "string"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "",
          type: "uint256"
        }
      ],
      name: "nonces",
      outputs: [
        {
          internalType: "uint256",
          name: "",
          type: "uint256"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "",
          type: "address"
        },
        {
          internalType: "address",
          name: "",
          type: "address"
        },
        {
          internalType: "bytes4",
          name: "",
          type: "bytes4"
        }
      ],
      name: "operatorPermission",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        }
      ],
      name: "ownerOf",
      outputs: [
        {
          internalType: "address",
          name: "_owner",
          type: "address"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [],
      name: "pause",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [],
      name: "paused",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "pendingOwnershipDelegatee",
      outputs: [
        {
          internalType: "address",
          name: "delegatee",
          type: "address"
        },
        {
          internalType: "uint64",
          name: "until",
          type: "uint64"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          internalType: "address",
          name: "callerConfirmation",
          type: "address"
        }
      ],
      name: "renounceRole",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "bytes",
          name: "data",
          type: "bytes"
        }
      ],
      name: "requestDetachContext",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          internalType: "address",
          name: "account",
          type: "address"
        }
      ],
      name: "revokeRole",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_from",
          type: "address"
        },
        {
          internalType: "address",
          name: "_to",
          type: "address"
        },
        {
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        }
      ],
      name: "safeTransferFrom",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_from",
          type: "address"
        },
        {
          internalType: "address",
          name: "_to",
          type: "address"
        },
        {
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        },
        {
          internalType: "bytes",
          name: "_data",
          type: "bytes"
        }
      ],
      name: "safeTransferFrom",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "addr",
          type: "address"
        }
      ],
      name: "seeder",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "index",
          type: "uint256"
        }
      ],
      name: "seeders",
      outputs: [
        {
          internalType: "address",
          name: "",
          type: "address"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "_toAdultDuration",
          type: "uint256"
        }
      ],
      name: "setAdultDuration",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_operator",
          type: "address"
        },
        {
          internalType: "bool",
          name: "_approved",
          type: "bool"
        }
      ],
      name: "setAllPermissionFor",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_operator",
          type: "address"
        },
        {
          internalType: "bool",
          name: "_approved",
          type: "bool"
        }
      ],
      name: "setApprovalForAll",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "axieId",
          type: "uint256"
        },
        {
          internalType: "uint16",
          name: "level",
          type: "uint16"
        }
      ],
      name: "setAxieLevel",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "axieId",
          type: "uint256"
        },
        {
          components: [
            {
              internalType: "uint256",
              name: "x",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "y",
              type: "uint256"
            }
          ],
          internalType: "struct AxieGenetics.Genes",
          name: "newGene",
          type: "tuple"
        }
      ],
      name: "setAxiePartsStage",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "string",
          name: "_baseTokenURI",
          type: "string"
        }
      ],
      name: "setBaseTokenURI",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "axieId",
          type: "uint256"
        },
        {
          components: [
            {
              internalType: "uint256",
              name: "x",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "y",
              type: "uint256"
            }
          ],
          internalType: "struct AxieGenetics.Genes",
          name: "newGene",
          type: "tuple"
        }
      ],
      name: "setBodySkin",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "sireId",
          type: "uint256"
        },
        {
          internalType: "uint256",
          name: "matronId",
          type: "uint256"
        },
        {
          internalType: "uint256",
          name: "axieId",
          type: "uint256"
        }
      ],
      name: "setBreedingInfo",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "bool",
          name: "lock",
          type: "bool"
        }
      ],
      name: "setContextLock",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "address",
          name: "user",
          type: "address"
        }
      ],
      name: "setContextUser",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "_currentAxieId",
          type: "uint256"
        }
      ],
      name: "setCurrentAxieId",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        },
        {
          internalType: "address",
          name: "_operator",
          type: "address"
        },
        {
          internalType: "bytes4",
          name: "_funcSig",
          type: "bytes4"
        },
        {
          internalType: "bool",
          name: "_approved",
          type: "bool"
        }
      ],
      name: "setFunctionOperatorForToken",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "contract IAxieGeneBrewer",
          name: "_geneBrewerContract",
          type: "address"
        }
      ],
      name: "setGeneBrewerContract",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256[]",
          name: "_axieIds",
          type: "uint256[]"
        },
        {
          internalType: "uint256[]",
          name: "_hoppingAxieIds",
          type: "uint256[]"
        }
      ],
      name: "setHoppingAxieIds",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "axieId",
          type: "uint256"
        },
        {
          components: [
            {
              internalType: "uint256",
              name: "x",
              type: "uint256"
            },
            {
              internalType: "uint256",
              name: "y",
              type: "uint256"
            }
          ],
          internalType: "struct AxieGenetics.Genes",
          name: "newGene",
          type: "tuple"
        }
      ],
      name: "setPartSkin",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_operator",
          type: "address"
        },
        {
          internalType: "bytes4",
          name: "_funcSig",
          type: "bytes4"
        },
        {
          internalType: "bool",
          name: "_approved",
          type: "bool"
        }
      ],
      name: "setPermissionFor",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        },
        {
          internalType: "address",
          name: "_operator",
          type: "address"
        },
        {
          internalType: "bool",
          name: "_approved",
          type: "bool"
        }
      ],
      name: "setTokenOperator",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "_axieId",
          type: "uint256"
        }
      ],
      name: "stageOf",
      outputs: [
        {
          internalType: "enum IAxie.AxieStage",
          name: "",
          type: "uint8"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "address",
          name: "delegatee",
          type: "address"
        },
        {
          internalType: "uint64",
          name: "until",
          type: "uint64"
        }
      ],
      name: "startDelegateOwnership",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "stateOf",
      outputs: [
        {
          internalType: "bytes",
          name: "",
          type: "bytes"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "stopOwnershipDelegation",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes4",
          name: "interfaceId",
          type: "bytes4"
        }
      ],
      name: "supportsInterface",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [],
      name: "symbol",
      outputs: [
        {
          internalType: "string",
          name: "",
          type: "string"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [],
      name: "toAdultDuration",
      outputs: [
        {
          internalType: "uint256",
          name: "",
          type: "uint256"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "_index",
          type: "uint256"
        }
      ],
      name: "tokenByIndex",
      outputs: [
        {
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_owner",
          type: "address"
        },
        {
          internalType: "uint256",
          name: "_index",
          type: "uint256"
        }
      ],
      name: "tokenOfOwnerByIndex",
      outputs: [
        {
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "",
          type: "uint256"
        },
        {
          internalType: "address",
          name: "",
          type: "address"
        },
        {
          internalType: "bytes4",
          name: "",
          type: "bytes4"
        }
      ],
      name: "tokenPermission",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "",
          type: "uint256"
        },
        {
          internalType: "uint256",
          name: "",
          type: "uint256"
        }
      ],
      name: "tokenPermissionInfos",
      outputs: [
        {
          internalType: "address",
          name: "operator",
          type: "address"
        },
        {
          internalType: "bytes4",
          name: "funcSig",
          type: "bytes4"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        }
      ],
      name: "tokenURI",
      outputs: [
        {
          internalType: "string",
          name: "_uri",
          type: "string"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [],
      name: "totalSupply",
      outputs: [
        {
          internalType: "uint256",
          name: "_supply",
          type: "uint256"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_from",
          type: "address"
        },
        {
          internalType: "address",
          name: "_to",
          type: "address"
        },
        {
          internalType: "uint256",
          name: "_tokenId",
          type: "uint256"
        }
      ],
      name: "transferFrom",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [],
      name: "unpause",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_spender",
          type: "address"
        }
      ],
      name: "unwhitelist",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "address",
          name: "newController",
          type: "address"
        },
        {
          internalType: "uint64",
          name: "newDetachingDuration",
          type: "uint64"
        }
      ],
      name: "updateContext",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [],
      name: "version",
      outputs: [
        {
          internalType: "uint8",
          name: "",
          type: "uint8"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "_spender",
          type: "address"
        }
      ],
      name: "whitelist",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "",
          type: "address"
        }
      ],
      name: "whitelisted",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    }
  ] as const;
  return new Contract(address, abi, signerOrProvider);
}

export function getMarketplaceContract(signerOrProvider?: Signer | Provider) {
  const address = MARKETPLACE_GATEWAY_V_2.address;
  const abi = new Interface(MARKETPLACE_GATEWAY_V_2.abi);
  return new Contract(address, abi, signerOrProvider);
}

export function getBatchTransferContract(signerOrProvider?: Signer | Provider) {
  const address = ERC_721_BATCH_TRANSFER.address;
  const abi = new Interface(ERC_721_BATCH_TRANSFER.abi);
  return new Contract(address, abi, signerOrProvider);
}

export function getWETHContract(signerOrProvider?: Signer | Provider) {
  const address = WRAPPED_ETHER.address;
  const abi = new Interface(WRAPPED_ETHER.abi);
  return new Contract(address, abi, signerOrProvider);
}

export function getUSDCContract(signerOrProvider?: Signer | Provider) {
  const address = USD_COIN.address;
  const abi = new Interface(USD_COIN.abi);
  return new Contract(address, abi, signerOrProvider);
}

export function getAtiaContract(signerOrProvider?: Signer | Provider) {
  const address = ATIAS_BLESSING.address;
  const abi = new Interface(ATIAS_BLESSING.proxy_abi);
  return new Contract(address, abi, signerOrProvider);
}

export function getAxieDelegationContract(signerOrProvider?: Signer | Provider) {
  const address = "0xd6d11474eb323521ada927f14a4b839b90009ac8";
  const abi = [
    {
      inputs: [],
      stateMutability: "nonpayable",
      type: "constructor"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "until",
          type: "uint256"
        }
      ],
      name: "InvalidDelegationExpiration",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "InvalidDelegationStatus",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "uint64",
          name: "expected",
          type: "uint64"
        },
        {
          internalType: "uint64",
          name: "actual",
          type: "uint64"
        }
      ],
      name: "InvalidRevokeTiming",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "bytes4",
          name: "sig",
          type: "bytes4"
        }
      ],
      name: "MismatchContextHash",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "bytes4",
          name: "sig",
          type: "bytes4"
        }
      ],
      name: "MismatchLength",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "NonexistentDelegation",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "bytes4",
          name: "sig",
          type: "bytes4"
        }
      ],
      name: "UnauthorizedCaller",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "bytes4",
          name: "sig",
          type: "bytes4"
        }
      ],
      name: "UnauthorizedREP15Callback",
      type: "error"
    },
    {
      inputs: [
        {
          internalType: "bytes4",
          name: "sig",
          type: "bytes4"
        }
      ],
      name: "ZeroAddress",
      type: "error"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          indexed: true,
          internalType: "address",
          name: "owner",
          type: "address"
        },
        {
          indexed: true,
          internalType: "address",
          name: "delegatee",
          type: "address"
        },
        {
          indexed: false,
          internalType: "uint256",
          name: "expiryTs",
          type: "uint256"
        }
      ],
      name: "AxieDelegated",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          indexed: true,
          internalType: "address",
          name: "operator",
          type: "address"
        }
      ],
      name: "DelegationRevoked",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: false,
          internalType: "uint8",
          name: "version",
          type: "uint8"
        }
      ],
      name: "Initialized",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: false,
          internalType: "uint64",
          name: "duration",
          type: "uint64"
        }
      ],
      name: "MinRevokingDurationUpdated",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          indexed: true,
          internalType: "bytes32",
          name: "previousAdminRole",
          type: "bytes32"
        },
        {
          indexed: true,
          internalType: "bytes32",
          name: "newAdminRole",
          type: "bytes32"
        }
      ],
      name: "RoleAdminChanged",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          indexed: true,
          internalType: "address",
          name: "account",
          type: "address"
        },
        {
          indexed: true,
          internalType: "address",
          name: "sender",
          type: "address"
        }
      ],
      name: "RoleGranted",
      type: "event"
    },
    {
      anonymous: false,
      inputs: [
        {
          indexed: true,
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          indexed: true,
          internalType: "address",
          name: "account",
          type: "address"
        },
        {
          indexed: true,
          internalType: "address",
          name: "sender",
          type: "address"
        }
      ],
      name: "RoleRevoked",
      type: "event"
    },
    {
      inputs: [],
      name: "DEFAULT_ADMIN_ROLE",
      outputs: [
        {
          internalType: "bytes32",
          name: "",
          type: "bytes32"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256[]",
          name: "tokenIds",
          type: "uint256[]"
        },
        {
          internalType: "address[]",
          name: "delegatees",
          type: "address[]"
        },
        {
          internalType: "uint64[]",
          name: "expiryTimes",
          type: "uint64[]"
        }
      ],
      name: "bulkDelegate",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256[]",
          name: "tokenIds",
          type: "uint256[]"
        }
      ],
      name: "bulkRevokeDelegations",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "address",
          name: "delegatee",
          type: "address"
        },
        {
          internalType: "uint64",
          name: "expiryTs",
          type: "uint64"
        }
      ],
      name: "delegate",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [],
      name: "getAxieContract",
      outputs: [
        {
          internalType: "contract IREP15",
          name: "",
          type: "address"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [],
      name: "getContextHash",
      outputs: [
        {
          internalType: "bytes32",
          name: "",
          type: "bytes32"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "getDelegationInfo",
      outputs: [
        {
          internalType: "address",
          name: "delegatee",
          type: "address"
        },
        {
          internalType: "uint64",
          name: "delegatedAt",
          type: "uint64"
        },
        {
          internalType: "uint64",
          name: "expiryTs",
          type: "uint64"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [],
      name: "getMinRevokingDuration",
      outputs: [
        {
          internalType: "uint64",
          name: "",
          type: "uint64"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        }
      ],
      name: "getRoleAdmin",
      outputs: [
        {
          internalType: "bytes32",
          name: "",
          type: "bytes32"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "index",
          type: "uint256"
        }
      ],
      name: "getRoleMember",
      outputs: [
        {
          internalType: "address",
          name: "",
          type: "address"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        }
      ],
      name: "getRoleMemberCount",
      outputs: [
        {
          internalType: "uint256",
          name: "",
          type: "uint256"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          internalType: "address",
          name: "account",
          type: "address"
        }
      ],
      name: "grantRole",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          internalType: "address",
          name: "account",
          type: "address"
        }
      ],
      name: "hasRole",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "address",
          name: "admin",
          type: "address"
        },
        {
          internalType: "address",
          name: "axieContract",
          type: "address"
        },
        {
          internalType: "uint64",
          name: "detachingDuration",
          type: "uint64"
        },
        {
          internalType: "uint64",
          name: "minRevokingDuration",
          type: "uint64"
        }
      ],
      name: "initialize",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "isDelegationActive",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "address",
          name: "user",
          type: "address"
        }
      ],
      name: "isTokenDelegatedTo",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "address",
          name: "operator",
          type: "address"
        },
        {
          internalType: "bytes",
          name: "data",
          type: "bytes"
        }
      ],
      name: "onAttached",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "address",
          name: "operator",
          type: "address"
        },
        {
          internalType: "bytes",
          name: "data",
          type: "bytes"
        }
      ],
      name: "onDetachRequested",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "ctxHash",
          type: "bytes32"
        },
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        },
        {
          internalType: "address",
          name: "operator",
          type: "address"
        },
        {
          internalType: "address",
          name: "",
          type: "address"
        },
        {
          internalType: "bytes",
          name: "",
          type: "bytes"
        }
      ],
      name: "onExecDetachContext",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          internalType: "address",
          name: "account",
          type: "address"
        }
      ],
      name: "renounceRole",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint256",
          name: "tokenId",
          type: "uint256"
        }
      ],
      name: "revokeDelegation",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes32",
          name: "role",
          type: "bytes32"
        },
        {
          internalType: "address",
          name: "account",
          type: "address"
        }
      ],
      name: "revokeRole",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint64",
          name: "duration",
          type: "uint64"
        }
      ],
      name: "setMinRevokingDuration",
      stateMutability: "nonpayable",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "bytes4",
          name: "interfaceId",
          type: "bytes4"
        }
      ],
      name: "supportsInterface",
      outputs: [
        {
          internalType: "bool",
          name: "",
          type: "bool"
        }
      ],
      stateMutability: "view",
      type: "function"
    },
    {
      inputs: [
        {
          internalType: "uint64",
          name: "detachingDuration",
          type: "uint64"
        }
      ],
      name: "updateDetachingDuration",
      stateMutability: "nonpayable",
      type: "function"
    }
  ] as const;
  return new Contract(address, abi, signerOrProvider);
}
