LogoLogo
  • DFK Developer Docs
  • Contracts
    • Exchanges
      • The Trader
      • The Bazaar
    • Sales & Rentals
      • Hero Auction
      • Hero Rental
      • Equipment Auction
      • Pet Auction
      • Land Auction
    • Summoning
      • Hero Summoning
        • Dark Summoning
      • Pet Hatching
    • Meditation Circle
    • Quests
      • Quest Core
      • Historical Contracts
        • Quest Core
        • Profession Quests
        • Training Quests
    • Void Hunts
    • Patrols
    • PVP Combat
    • Influence System
    • Gardens
      • Master Gardener
    • Jeweler 2.0
      • Power-Ups
      • Jeweler 1.0
    • Profiles
    • DFK Duel
      • Previous Seasons
      • Raffle Master
    • Events
      • Gen0 Reroll
      • Gene Reroll
      • Perilous Journey
    • Bridging
      • Hero Bridge (Synapse)
      • Hero Bridge (LayerZero)
      • Equipment Bridge (Synapse)
      • Equipment Bridge (LayerZero)
      • Item Bridge V2
        • Item Bridge V1 (Deprecated)
      • Gaia's Tear Bridge
    • Miscellaneous
      • Airdrops
      • Charity
      • Flag Storage
      • Gen0 Airdrop (Harmony)
      • Gen0 Sale (Harmony)
      • Graveyard
      • Locked Token Claim
      • Locked Token Raffle
      • Token Disburse
  • NFTs
    • Heroes
      • HeroV4 (Metis)
    • Equipment
      • Weapons
      • Armor
      • Accessories
      • Shared Equipment Mappings
      • CacheCore
      • Equipment Shop
      • Visage Shop
    • Pets
      • Pet Exchange
    • Lands
  • Tokens
    • Ecosystem Token
    • Power Tokens
    • Governance Tokens
    • Currencies
      • DFK Gold
      • Gaia's Tears
    • Inventory Items
    • Gold Crops
    • Combat Items
    • Miscellaneous Tokens
      • Collectible Items
      • Raffle Tickets
  • Crafting
    • Alchemist
    • Nutritionist
    • Stone Carver
    • Vendor (Item Gold Trader)
  • Collections
    • Runes
    • Pet Eggs
    • Pet Treats
    • Potions & Consumables
      • Item Consumer
      • Potion Migrator
    • Enhancement Stones
    • Attunement Crystals
      • Atonement Crystals
    • Pages of the Eternal Story
  • API
    • Community GraphQL API
      • Getting Started
      • Auctions
      • Bazaar
      • Heroes
      • Pets
      • Profiles
    • Hero Metadata & Image API
    • Pet Metadata & Image API
    • Token Supply API
  • Community Builders
    • Kingdom Building Program
    • Developer Resources
    • Community Projects
  • DFK CHain
    • Getting Started
    • Nodes & Validators
    • Bridged Tokens
    • Ecosystem Partners
      • Covalent API
      • SupraOracles Price Feeds
      • SupraOracles VRF
    • Miscellaneous Contracts
Powered by GitBook
On this page
  • Contracts
  • Addresses
  • Interfaces
  • ABIs
  • Contract Data
  • Mappings
  1. Contracts

Patrols

PreviousVoid HuntsNextPVP Combat

Last updated 3 months ago

Patrols is part of the contract, and is combined with the , , , and facet, which all share a contract address.

Contracts

Addresses

Name
Mainnet
Testnet

Metis

0xc7681698B14a2381d9f1eD69FC3D27F33965b53B

0xb2bC817C100a6bd60e8bf8a79dBAD607cE9C3cF2

Interfaces

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

Contract Data

Mappings

Potions

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

Patrols use the same 15-item array mappings as .

PVP Diamond
HeroV4 facet
PVP facet
Influence facet
MeditationV4
Void Hunts
245KB
PVPDiamond.json
181KB
PVPDiamond-minified.json