S Price: $0.067708 (-3.02%)
Gas: 55 Gwei

Contract

0x3f790422727540aaEb9aD62FFfd11933F6737E4F

Overview

S Balance

Sonic LogoSonic LogoSonic Logo7 S

S Value

$0.47 (@ $0.07/S)

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Transfer Ownersh...426132532025-08-12 6:18:53167 days ago1754979533IN
0x3f790422...3F6737E4F
0 S0.0014764550.0001
Set Treasury Wal...426132332025-08-12 6:18:45167 days ago1754979525IN
0x3f790422...3F6737E4F
0 S0.0014881550.0001
Transfer314189552025-06-02 21:08:22237 days ago1748898502IN
0x3f790422...3F6737E4F
0 S0.00144850
Execute Battle314178822025-06-02 21:02:16237 days ago1748898136IN
0x3f790422...3F6737E4F
0 S0.0040176651.51250491
Execute Battle314178702025-06-02 21:02:12237 days ago1748898132IN
0x3f790422...3F6737E4F
0 S0.0039947351.21851688
Execute Battle314178572025-06-02 21:02:07237 days ago1748898127IN
0x3f790422...3F6737E4F
0 S0.003899750
Execute Battle314165612025-06-02 20:54:00237 days ago1748897640IN
0x3f790422...3F6737E4F
0 S0.0041857253.66733333
Execute Battle314165482025-06-02 20:53:56237 days ago1748897636IN
0x3f790422...3F6737E4F
0 S0.003899750
Execute Battle314165332025-06-02 20:53:51237 days ago1748897631IN
0x3f790422...3F6737E4F
0 S0.003899750
Execute Battle314164822025-06-02 20:53:31237 days ago1748897611IN
0x3f790422...3F6737E4F
0 S0.003899750.00000666
Execute Battle314164702025-06-02 20:53:26237 days ago1748897606IN
0x3f790422...3F6737E4F
0 S0.003899750
Execute Battle314164562025-06-02 20:53:22237 days ago1748897602IN
0x3f790422...3F6737E4F
0 S0.003899750
Execute Battle314163642025-06-02 20:52:46237 days ago1748897566IN
0x3f790422...3F6737E4F
0 S0.0039289450.37499999
Execute Battle314163502025-06-02 20:52:41237 days ago1748897561IN
0x3f790422...3F6737E4F
0 S0.003899750
Execute Battle314163362025-06-02 20:52:37237 days ago1748897557IN
0x3f790422...3F6737E4F
0 S0.003899750
Execute Battle314162772025-06-02 20:52:09237 days ago1748897529IN
0x3f790422...3F6737E4F
0 S0.0041221352.85200947
Execute Battle314162642025-06-02 20:52:05237 days ago1748897525IN
0x3f790422...3F6737E4F
0 S0.0041076852.66674
Execute Battle314162502025-06-02 20:52:00237 days ago1748897520IN
0x3f790422...3F6737E4F
0 S0.003899750
Execute Battle314160752025-06-02 20:50:55237 days ago1748897455IN
0x3f790422...3F6737E4F
0 S0.003899750
Execute Battle314160632025-06-02 20:50:50237 days ago1748897450IN
0x3f790422...3F6737E4F
0 S0.003899750
Execute Battle314160512025-06-02 20:50:46237 days ago1748897446IN
0x3f790422...3F6737E4F
0 S0.003899750
Accept Challenge314060522025-06-02 19:50:55237 days ago1748893855IN
0x3f790422...3F6737E4F
1 S0.0207313650.525
Create Basic Bat...314060372025-06-02 19:50:50237 days ago1748893850IN
0x3f790422...3F6737E4F
1 S0.0108125550
Accept Challenge314056512025-06-02 19:48:39237 days ago1748893719IN
0x3f790422...3F6737E4F
1 S0.0205159550
Create Basic Bat...314056372025-06-02 19:48:34237 days ago1748893714IN
0x3f790422...3F6737E4F
1 S0.0116675550
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PixlDogsWarzoneV4

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 6 : PixlDogsWarzoneV4.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

// Core interfaces
interface IPixlDogsNFT {
    function ownerOf(uint256 tokenId) external view returns (address);
}

interface IPixlDogsGameplayMechanics {
    struct GameplayStats {
        uint16 endurance;
        uint16 agility;
        uint16 healthScore;
        uint16 fetchSkill;
        uint16 baseSpeed;
        uint16 luck;
        uint16 happinessScore;
        uint16 treasureSense;
        uint16 potential;
        uint16 eckkoTraining;
        uint16 pixldPower;
        uint256 lastTrainedAt;
        bool statsGenerated;
    }
    
    function getDogStats(uint256 tokenId) external view returns (GameplayStats memory);
    function areStatsUnlocked(uint256 tokenId) external view returns (bool);
}

interface IPixlDogsSimpleBoost {
    function getBoostStats(uint256 tokenId) external view returns (IPixlDogsGameplayMechanics.GameplayStats memory);
}

interface IPixelDogToken {
    function recordGameActivity(uint256 tokenId, string calldata activityType, uint256 achievementPoints) external;
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
    function transfer(address to, uint256 amount) external returns (bool);
    function burn(uint256 amount) external;
    function balanceOf(address account) external view returns (uint256);
}

interface IPixlDogsBattleScenarios {
    function generateBattleScenario(uint256 battleId, bytes32 randomSeed) external returns (uint256);
    function calculateTraitBonus(uint256 battleId, uint256 tokenId) external view returns (uint16);
}

// Security and betting interfaces
interface IPixlDogsBattleBetting {
    function initializeBettingPool(uint256 battleId) external;
    function distributeBattleRewards(uint256 battleId) external;
}

interface IPixlDogsBattleSecurity {
    function depositFighterStake(uint256 battleId, address fighter, uint256 amount) external returns (bool);
    function returnFighterStakes(uint256 battleId, address fighter1, address fighter2) external;
    function lockStatsForBattle(uint256 tokenId1, uint256 tokenId2, uint256 battleId) external;
    function unlockStatsAfterBattle(uint256 tokenId1, uint256 tokenId2, uint256 battleId) external;
    function areStatsLocked(uint256 tokenId) external view returns (bool);
    function recordBattleResult(address winner, address loser, bool wasForfeit) external;
    function getSecurityStats() external view returns (
        uint256 _totalPixldStaked,
        uint256 _totalPixldSlashed,
        uint256 _totalSuspiciousAccounts,
        uint256 _fighterStakeAmount,
        uint256 _fighterStakeSlashPercent
    );
}

/**
 * @title PixlDogsWarzoneV4
 * @dev Simplified main battle contract that delegates to specialized contracts
 */
contract PixlDogsWarzoneV4 is Ownable, ReentrancyGuard, Pausable {
    // Contract addresses
    IPixlDogsNFT public pixlDogsNFT;
    IPixlDogsGameplayMechanics public gameplayMechanics;
    IPixlDogsSimpleBoost public boostContract;
    IPixelDogToken public pixelDogToken;
    IPixlDogsBattleScenarios public scenarioContract;
    IPixlDogsBattleBetting public bettingContract;
    IPixlDogsBattleSecurity public securityContract;
    
    // Adjustable parameters
    uint256 public minSonicWager = 10 ether;
    uint256 public maxSonicWager = 1000 ether;
    uint256 public platformFeePercent = 5;
    
    uint256 public pixldEntryFee = 100 * 1e18;
    uint256 public minPixldWager = 50 * 1e18;
    uint256 public maxPixldWager = 10000 * 1e18;
    uint256 public pixldBonusMultiplier = 120;
    uint256 public scenarioBonusMultiplier = 150;
    
    uint256 public challengeTimeout = 24 hours;
    uint256 public cooldownPeriod = 5 minutes;
    uint256 public defaultBettingWindow = 300;
    
    address public treasuryWallet;
    
    // Battle types
    enum BattleType { Basic, Premium, Scenario }
    
    // Core structures
    struct ChallengeRequest {
        address challenger;
        address targetOpponent;
        uint128 challengerTokenId;
        uint128 sonicWager;
        uint128 pixldWager;
        uint64 createdAt;
        uint64 expiresAt;
        uint8 battleType;
        uint8 status;
        bool scenarioEnabled;
        uint8 preferredScenarioId;
        BettingConditions bettingConditions;
    }
    
    struct BettingConditions {
        uint64 minBetAmount;
        uint64 maxBetAmount;
        uint32 maxBettors;
        uint32 bettingWindow;
        bool allowPublicBetting;
        bool requirePixldForBetting;
    }
    
    struct Battle {
        uint128 challengeId;
        uint64 acceptedAt;
        uint64 bettingEndsAt;
        uint64 commitPhaseEndsAt;
        uint64 revealPhaseEndsAt;
        address challenger;
        address opponent;
        uint128 challengerTokenId;
        uint128 opponentTokenId;
        uint128 sonicWager;
        uint128 pixldWager;
        uint128 pixldPrizePool;
        uint128 challengerPower;
        uint128 opponentPower;
        uint8 battleType;
        uint8 status;
        address winner;
        bytes32 randomSeed;
        uint8 scenarioId;
        uint8 challengerScenarioBonus;
        uint8 opponentScenarioBonus;
        bool challengerHasAdvantage;
        bool opponentHasAdvantage;
        BettingConditions bettingConditions;
    }
    
    struct RandomnessRequest {
        uint256 requestBlock;
        bool fulfilled;
    }
    
    enum ChallengeStatus { Open, Accepted, Rejected, Expired, Cancelled }
    enum BattleStatus { 
        WaitingForBets,
        CommitPhase,
        RevealPhase,
        Ready,
        WaitingForRandomness,
        InProgress,
        Completed,
        Cancelled
    }
    
    // State
    uint256 public nextChallengeId;
    uint256 public nextBattleId;
    
    mapping(uint256 => ChallengeRequest) public challenges;
    mapping(uint256 => Battle) public battles;
    mapping(uint256 => RandomnessRequest) public battleRandomnessRequests;
    mapping(uint256 => uint256) public lastBattleTime;
    mapping(uint256 => uint256) public winStreak;
    mapping(address => uint256) public userWins;
    mapping(address => uint256) public userLosses;
    mapping(address => uint256[]) public userChallenges;
    mapping(address => uint256[]) public userBattles;
    
    // Statistics
    uint256 public totalPixldBurned;
    uint256 public totalSonicRevenue;
    uint256 public totalBasicBattles;
    uint256 public totalPremiumBattles;
    uint256 public totalScenarioBattles;
    
    // Constants
    uint256 public constant BLOCKS_TO_WAIT = 3;
    uint256 public constant COMMIT_PHASE_PERCENT = 60;
    
    // Events
    event ChallengeCreated(
        uint256 indexed challengeId,
        address indexed challenger,
        address indexed targetOpponent,
        uint256 tokenId,
        uint256 sonicWager,
        uint256 pixldWager,
        BattleType battleType
    );
    
    event ChallengeAccepted(uint256 indexed challengeId, uint256 battleId, address acceptor, uint256 tokenId);
    event BattleStarted(uint256 indexed battleId, address challenger, address opponent);
    event BattleCompleted(uint256 indexed battleId, address winner, uint256 winnerTokenId, uint256 sonicPrize, uint256 pixldPrize);
    event PixldBurned(uint256 indexed challengeId, uint256 amount);
    event RandomnessRequested(uint256 indexed battleId, uint256 requestBlock);
    event RandomnessFulfilled(uint256 indexed battleId, uint256 randomSeed);
    
    constructor(
        address _pixlDogsNFT,
        address _gameplayMechanics,
        address _boostContract,
        address _treasuryWallet,
        address _pixelDogToken,
        address _scenarioContract
    ) Ownable(msg.sender) {
        pixlDogsNFT = IPixlDogsNFT(_pixlDogsNFT);
        gameplayMechanics = IPixlDogsGameplayMechanics(_gameplayMechanics);
        boostContract = IPixlDogsSimpleBoost(_boostContract);
        treasuryWallet = _treasuryWallet;
        pixelDogToken = IPixelDogToken(_pixelDogToken);
        scenarioContract = IPixlDogsBattleScenarios(_scenarioContract);
        
        nextChallengeId = 1;
        nextBattleId = 1;
    }
    
    // ========================================
    // BATTLE CREATION
    // ========================================
    
    function createBasicBattle(
        uint256 tokenId,
        address targetOpponent,
        BettingConditions memory bettingConditions
    ) external payable nonReentrant whenNotPaused {
        require(pixlDogsNFT.ownerOf(tokenId) == msg.sender, "!owner");
        require(gameplayMechanics.areStatsUnlocked(tokenId), "!stats");
        require(block.timestamp >= lastBattleTime[tokenId] + cooldownPeriod, "cooldown");
        require(msg.value >= minSonicWager && msg.value <= maxSonicWager, "!wager");
        
        // Check with security contract if implemented
        if (address(securityContract) != address(0)) {
            require(!securityContract.areStatsLocked(tokenId), "Stats locked");
        }
        
        _createChallenge(
            tokenId,
            targetOpponent,
            msg.value,
            0,
            BattleType.Basic,
            bettingConditions,
            false,
            0
        );
        
        totalBasicBattles++;
    }
    
    function createPremiumBattle(
        uint256 tokenId,
        address targetOpponent,
        uint256 pixldWager,
        BettingConditions memory bettingConditions
    ) external payable nonReentrant whenNotPaused {
        require(pixlDogsNFT.ownerOf(tokenId) == msg.sender, "!owner");
        require(gameplayMechanics.areStatsUnlocked(tokenId), "!stats");
        require(block.timestamp >= lastBattleTime[tokenId] + cooldownPeriod, "cooldown");
        require(msg.value >= minSonicWager && msg.value <= maxSonicWager, "!sonic");
        require(pixldWager >= minPixldWager && pixldWager <= maxPixldWager, "!pixld");
        
        if (address(securityContract) != address(0)) {
            require(!securityContract.areStatsLocked(tokenId), "Stats locked");
        }
        
        uint256 fighterStake = 0;
        if (address(securityContract) != address(0)) {
            (, , , fighterStake, ) = securityContract.getSecurityStats();
        }
        
        uint256 totalPixldNeeded = pixldEntryFee + pixldWager + fighterStake;
        require(pixelDogToken.transferFrom(msg.sender, address(this), totalPixldNeeded), "!transfer");
        
        pixelDogToken.burn(pixldEntryFee);
        totalPixldBurned += pixldEntryFee;
        
        uint256 challengeId = _createChallenge(
            tokenId,
            targetOpponent,
            msg.value,
            pixldWager,
            BattleType.Premium,
            bettingConditions,
            false,
            0
        );
        
        totalPremiumBattles++;
        emit PixldBurned(challengeId, pixldEntryFee);
    }
    
    function acceptChallenge(uint256 challengeId, uint256 tokenId) 
        external 
        payable 
        nonReentrant 
        whenNotPaused 
    {
        ChallengeRequest storage challenge = challenges[challengeId];
        
        require(challenge.status == uint8(ChallengeStatus.Open), "!avail");
        require(block.timestamp <= challenge.expiresAt, "expired");
        require(pixlDogsNFT.ownerOf(tokenId) == msg.sender, "!owner");
        require(gameplayMechanics.areStatsUnlocked(tokenId), "!stats");
        require(block.timestamp >= lastBattleTime[tokenId] + cooldownPeriod, "cooldown");
        
        if (address(securityContract) != address(0)) {
            require(!securityContract.areStatsLocked(tokenId), "Stats locked");
        }
        
        if (challenge.targetOpponent != address(0)) {
            require(challenge.targetOpponent == msg.sender, "!target");
        } else {
            require(challenge.challenger != msg.sender, "self");
        }
        
        require(msg.value == challenge.sonicWager, "!match");
        
        if (BattleType(challenge.battleType) != BattleType.Basic) {
            uint256 fighterStake = 0;
            if (address(securityContract) != address(0)) {
                (, , , fighterStake, ) = securityContract.getSecurityStats();
            }
            
            uint256 totalPixldNeeded = pixldEntryFee + challenge.pixldWager + fighterStake;
            require(pixelDogToken.transferFrom(msg.sender, address(this), totalPixldNeeded), "!pixld");
            pixelDogToken.burn(pixldEntryFee);
            totalPixldBurned += pixldEntryFee;
        }
        
        challenge.status = uint8(ChallengeStatus.Accepted);
        
        uint256 battleId = _createBattle(challengeId, tokenId, challenge);
        
        emit ChallengeAccepted(challengeId, battleId, msg.sender, tokenId);
    }
    
    // ========================================
    // BATTLE EXECUTION
    // ========================================
    
    function executeBattle(uint256 battleId) external nonReentrant whenNotPaused {
        Battle storage battle = battles[battleId];
        
        require(
            battle.status == uint8(BattleStatus.RevealPhase) || 
            battle.status == uint8(BattleStatus.Ready), 
            "!ready"
        );
        
        if (battle.status == uint8(BattleStatus.RevealPhase)) {
            require(block.timestamp >= battle.revealPhaseEndsAt, "Reveal phase not ended");
        }
        
        require(
            msg.sender == battle.challenger || 
            msg.sender == battle.opponent || 
            msg.sender == owner(),
            "!auth"
        );
        
        _executeSingleBattle(battleId);
    }
    
    function fulfillBattleRandomness(uint256 battleId) external nonReentrant {
        Battle storage battle = battles[battleId];
        RandomnessRequest storage request = battleRandomnessRequests[battleId];
        
        require(battle.status == uint8(BattleStatus.WaitingForRandomness), "!waiting");
        require(request.requestBlock > 0, "!requested");
        require(!request.fulfilled, "fulfilled");
        require(block.number >= request.requestBlock + BLOCKS_TO_WAIT, "!blocks");
        
        _fulfillBattleRandomness(battleId);
    }
    
    // ========================================
    // INTERNAL FUNCTIONS
    // ========================================
    
    function _createChallenge(
        uint256 tokenId,
        address targetOpponent,
        uint256 sonicWager,
        uint256 pixldWager,
        BattleType battleType,
        BettingConditions memory bettingConditions,
        bool scenarioEnabled,
        uint256 preferredScenarioId
    ) internal returns (uint256) {
        require(targetOpponent != msg.sender, "!self");
        
        uint256 challengeId = nextChallengeId++;
        uint256 expiresAt = block.timestamp + challengeTimeout;
        
        challenges[challengeId] = ChallengeRequest({
            challenger: msg.sender,
            targetOpponent: targetOpponent,
            challengerTokenId: uint128(tokenId),
            sonicWager: uint128(sonicWager),
            pixldWager: uint128(pixldWager),
            createdAt: uint64(block.timestamp),
            expiresAt: uint64(expiresAt),
            battleType: uint8(battleType),
            status: uint8(ChallengeStatus.Open),
            scenarioEnabled: scenarioEnabled,
            preferredScenarioId: uint8(preferredScenarioId),
            bettingConditions: bettingConditions
        });
        
        userChallenges[msg.sender].push(challengeId);
        
        emit ChallengeCreated(
            challengeId,
            msg.sender,
            targetOpponent,
            tokenId,
            sonicWager,
            pixldWager,
            battleType
        );
        
        return challengeId;
    }
    
    function _createBattle(
        uint256 challengeId,
        uint256 opponentTokenId,
        ChallengeRequest storage challenge
    ) internal returns (uint256) {
        uint256 battleId = nextBattleId++;
        uint256 bettingWindow = challenge.bettingConditions.bettingWindow;
        uint256 commitDuration = (bettingWindow * COMMIT_PHASE_PERCENT) / 100;
        uint256 revealDuration = bettingWindow - commitDuration;
        
        uint256 commitPhaseEnd = block.timestamp + commitDuration;
        uint256 revealPhaseEnd = commitPhaseEnd + revealDuration;
        uint256 bettingEndsAt = revealPhaseEnd;
        
        // Lock stats if security contract is set
        if (address(securityContract) != address(0)) {
            securityContract.lockStatsForBattle(
                challenge.challengerTokenId,
                opponentTokenId,
                battleId
            );
            
            // Handle fighter stakes
            if (BattleType(challenge.battleType) != BattleType.Basic) {
                (, , , uint256 fighterStake, ) = securityContract.getSecurityStats();
                
                // Transfer stakes to security contract
                if (fighterStake > 0) {
                    pixelDogToken.transfer(address(securityContract), fighterStake * 2);
                    securityContract.depositFighterStake(battleId, challenge.challenger, fighterStake);
                    securityContract.depositFighterStake(battleId, msg.sender, fighterStake);
                }
            }
        }
        
        uint256 pixldPrizePool = 0;
        
        if (BattleType(challenge.battleType) != BattleType.Basic) {
            pixldPrizePool = challenge.pixldWager * 2;
            
            if (BattleType(challenge.battleType) == BattleType.Premium) {
                uint256 bonusPixld = (pixldPrizePool * (pixldBonusMultiplier - 100)) / 100;
                pixldPrizePool += bonusPixld;
            } else if (BattleType(challenge.battleType) == BattleType.Scenario) {
                uint256 bonusPixld = (pixldPrizePool * (pixldBonusMultiplier - 100)) / 100;
                uint256 scenarioBonus = (pixldPrizePool * (scenarioBonusMultiplier - 100)) / 100;
                pixldPrizePool += bonusPixld + scenarioBonus;
            }
        }
        
        battles[battleId] = Battle({
            challengeId: uint128(challengeId),
            acceptedAt: uint64(block.timestamp),
            bettingEndsAt: uint64(bettingEndsAt),
            commitPhaseEndsAt: uint64(commitPhaseEnd),
            revealPhaseEndsAt: uint64(revealPhaseEnd),
            challenger: challenge.challenger,
            opponent: msg.sender,
            challengerTokenId: challenge.challengerTokenId,
            opponentTokenId: uint128(opponentTokenId),
            sonicWager: challenge.sonicWager,
            pixldWager: challenge.pixldWager,
            pixldPrizePool: uint128(pixldPrizePool),
            challengerPower: 0,
            opponentPower: 0,
            battleType: challenge.battleType,
            status: uint8(BattleStatus.CommitPhase),
            winner: address(0),
            randomSeed: bytes32(0),
            scenarioId: 0,
            challengerScenarioBonus: 100,
            opponentScenarioBonus: 100,
            challengerHasAdvantage: false,
            opponentHasAdvantage: false,
            bettingConditions: challenge.bettingConditions
        });
        
        userBattles[challenge.challenger].push(battleId);
        userBattles[msg.sender].push(battleId);
        
        // Initialize betting pool if betting contract is set
        if (address(bettingContract) != address(0) && challenge.bettingConditions.allowPublicBetting) {
            bettingContract.initializeBettingPool(battleId);
        }
        
        emit BattleStarted(battleId, challenge.challenger, msg.sender);
        
        return battleId;
    }
    
    function _executeSingleBattle(uint256 battleId) internal {
        Battle storage battle = battles[battleId];
        battle.status = uint8(BattleStatus.InProgress);
        
        _requestBattleRandomness(battleId);
    }
    
    function _requestBattleRandomness(uint256 battleId) internal {
        battleRandomnessRequests[battleId] = RandomnessRequest({
            requestBlock: block.number,
            fulfilled: false
        });
        battles[battleId].status = uint8(BattleStatus.WaitingForRandomness);
        
        emit RandomnessRequested(battleId, block.number);
    }
    
    function _fulfillBattleRandomness(uint256 battleId) internal {
        Battle storage battle = battles[battleId];
        RandomnessRequest storage request = battleRandomnessRequests[battleId];
        
        uint256 randomSeed = uint256(keccak256(abi.encodePacked(
            blockhash(request.requestBlock + 1),
            blockhash(request.requestBlock + 2),
            blockhash(request.requestBlock + 3),
            battleId,
            block.timestamp,
            block.prevrandao
        )));
        
        request.fulfilled = true;
        battle.randomSeed = bytes32(randomSeed);
        battle.status = uint8(BattleStatus.InProgress);
        
        emit RandomnessFulfilled(battleId, randomSeed);
        
        _continueBattleExecution(battleId);
    }
    
    function _continueBattleExecution(uint256 battleId) internal {
        Battle storage battle = battles[battleId];
        
        // Calculate powers
        battle.challengerPower = uint128(_calculateBattlePower(
            battle.challengerTokenId, 
            battle.randomSeed, 
            battleId, 
            true
        ));
        
        battle.opponentPower = uint128(_calculateBattlePower(
            battle.opponentTokenId, 
            battle.randomSeed, 
            battleId, 
            false
        ));
        
        _determineBattleWinner(battleId);
    }
    
    function _calculateBattlePower(
        uint256 tokenId,
        bytes32 seed,
        uint256 battleId,
        bool isChallenger
    ) internal view returns (uint256) {
        return calculateBattlePower(tokenId, seed);
    }
    
    function _determineBattleWinner(uint256 battleId) internal {
        Battle storage battle = battles[battleId];
        
        address winner;
        uint256 winnerTokenId;
        address loser;
        uint256 loserTokenId;
        
        if (battle.challengerPower > battle.opponentPower) {
            winner = battle.challenger;
            winnerTokenId = battle.challengerTokenId;
            loser = battle.opponent;
            loserTokenId = battle.opponentTokenId;
        } else if (battle.opponentPower > battle.challengerPower) {
            winner = battle.opponent;
            winnerTokenId = battle.opponentTokenId;
            loser = battle.challenger;
            loserTokenId = battle.challengerTokenId;
        } else {
            uint256 challengerLuck = uint256(keccak256(abi.encodePacked(battle.randomSeed, "challenger"))) % 100;
            uint256 opponentLuck = uint256(keccak256(abi.encodePacked(battle.randomSeed, "opponent"))) % 100;
            
            if (challengerLuck >= opponentLuck) {
                winner = battle.challenger;
                winnerTokenId = battle.challengerTokenId;
                loser = battle.opponent;
                loserTokenId = battle.opponentTokenId;
            } else {
                winner = battle.opponent;
                winnerTokenId = battle.opponentTokenId;
                loser = battle.challenger;
                loserTokenId = battle.challengerTokenId;
            }
        }
        
        battle.winner = winner;
        battle.status = uint8(BattleStatus.Completed);
        
        _completeBattle(battleId, winner, winnerTokenId, loser, loserTokenId);
    }
    
    function _completeBattle(
        uint256 battleId,
        address winner,
        uint256 winnerTokenId,
        address loser,
        uint256 loserTokenId
    ) internal {
        Battle storage battle = battles[battleId];
        
        // Update cooldowns and stats
        lastBattleTime[battle.challengerTokenId] = block.timestamp;
        lastBattleTime[battle.opponentTokenId] = block.timestamp;
        userWins[winner]++;
        userLosses[loser]++;
        winStreak[winnerTokenId]++;
        winStreak[loserTokenId] = 0;
        
        // Unlock stats and handle security
        if (address(securityContract) != address(0)) {
            securityContract.unlockStatsAfterBattle(
                battle.challengerTokenId,
                battle.opponentTokenId,
                battleId
            );
            
            securityContract.recordBattleResult(winner, loser, false);
            
            // Return fighter stakes
            if (BattleType(battle.battleType) != BattleType.Basic) {
                securityContract.returnFighterStakes(battleId, battle.challenger, battle.opponent);
            }
        }
        
        // Handle prizes
        uint256 sonicPrize = 0;
        uint256 pixldPrize = battle.pixldPrizePool;
        
        if (battle.sonicWager > 0) {
            uint256 totalSonicPot = battle.sonicWager * 2;
            uint256 sonicFee = (totalSonicPot * platformFeePercent) / 100;
            sonicPrize = totalSonicPot - sonicFee;
            
            (bool successWinner, ) = winner.call{value: sonicPrize}("");
            require(successWinner, "!sonic");
            
            (bool successTreasury, ) = treasuryWallet.call{value: sonicFee}("");
            require(successTreasury, "!treasury");
            
            totalSonicRevenue += sonicFee;
        }
        
        if (pixldPrize > 0) {
            require(pixelDogToken.transfer(winner, pixldPrize), "!pixld");
        }
        
        // Distribute betting rewards
        if (address(bettingContract) != address(0)) {
            try bettingContract.distributeBattleRewards(battleId) {} catch {}
        }
        
        // Award activity points
        _awardActivityPoints(battleId, winnerTokenId, loserTokenId);
        
        emit BattleCompleted(
            battleId, 
            winner, 
            winnerTokenId, 
            sonicPrize, 
            pixldPrize
        );
    }
    
    function _awardActivityPoints(
        uint256 battleId,
        uint256 winnerTokenId,
        uint256 loserTokenId
    ) internal {
        Battle storage battle = battles[battleId];
        
        uint256 winnerPoints = 50;
        uint256 loserPoints = 15;
        
        if (BattleType(battle.battleType) == BattleType.Basic) {
            winnerPoints = 75;
        } else if (BattleType(battle.battleType) == BattleType.Premium) {
            winnerPoints = 120;
        }
        
        if (winStreak[winnerTokenId] >= 3) {
            winnerPoints += 50;
        }
        
        if (address(pixelDogToken) != address(0)) {
            try pixelDogToken.recordGameActivity(winnerTokenId, "battle_win", winnerPoints) {} catch {}
            try pixelDogToken.recordGameActivity(loserTokenId, "battle_loss", loserPoints) {} catch {}
        }
    }
    
    // ========================================
    // POWER CALCULATION
    // ========================================
    
    function calculateBattlePower(uint256 tokenId, bytes32 seed) public view returns (uint256) {
        IPixlDogsGameplayMechanics.GameplayStats memory stats = gameplayMechanics.getDogStats(tokenId);
        
        if (address(boostContract) != address(0)) {
            try boostContract.getBoostStats(tokenId) returns (IPixlDogsGameplayMechanics.GameplayStats memory boostedStats) {
                stats = boostedStats;
            } catch {}
        }
        
        uint256 basePower = uint256(stats.endurance) * 3 + 
                           uint256(stats.agility) * 2 + 
                           uint256(stats.healthScore) * 2 +
                           uint256(stats.fetchSkill) * 1 +
                           uint256(stats.baseSpeed) * 2 +
                           uint256(stats.luck) * 1 +
                           uint256(stats.potential) * 2 +
                           uint256(stats.eckkoTraining) * 2;
        
        uint256 randomMod = uint256(keccak256(abi.encodePacked(seed, tokenId))) % 41;
        uint256 modifierValue = 80 + randomMod;
        
        return (basePower * modifierValue) / 100;
    }
    
    // ========================================
    // VIEW FUNCTIONS
    // ========================================
    
    function getBattleDetails(uint256 battleId) external view returns (
        uint128 challengeId,
        uint64 acceptedAt,
        uint64 bettingEndsAt,
        uint64 commitPhaseEndsAt,
        uint64 revealPhaseEndsAt,
        address challenger,
        address opponent,
        uint128 challengerTokenId,
        uint128 opponentTokenId,
        uint128 sonicWager,
        uint128 pixldWager,
        uint128 pixldPrizePool,
        uint128 totalFighterStakes,
        uint128 challengerPower,
        uint128 opponentPower,
        uint8 battleType,
        uint8 status,
        address winner,
        bytes32 randomSeed,
        uint8 scenarioId,
        uint8 challengerScenarioBonus,
        uint8 opponentScenarioBonus,
        bool challengerHasAdvantage,
        bool opponentHasAdvantage,
        bool statsLocked
    ) {
        Battle memory battle = battles[battleId];
        return (
            battle.challengeId,
            battle.acceptedAt,
            battle.bettingEndsAt,
            battle.commitPhaseEndsAt,
            battle.revealPhaseEndsAt,
            battle.challenger,
            battle.opponent,
            battle.challengerTokenId,
            battle.opponentTokenId,
            battle.sonicWager,
            battle.pixldWager,
            battle.pixldPrizePool,
            0, // totalFighterStakes handled by security contract
            battle.challengerPower,
            battle.opponentPower,
            battle.battleType,
            battle.status,
            battle.winner,
            battle.randomSeed,
            battle.scenarioId,
            battle.challengerScenarioBonus,
            battle.opponentScenarioBonus,
            battle.challengerHasAdvantage,
            battle.opponentHasAdvantage,
            true // statsLocked
        );
    }
    
    function isBattleResolved(uint256 battleId) external view returns (bool) {
        if (battleId >= nextBattleId) return false;
        return battles[battleId].status == uint8(BattleStatus.Completed);
    }
    
    function getBattleWinner(uint256 battleId) external view returns (address) {
        return battles[battleId].winner;
    }
    
    function getChallengeDetails(uint256 challengeId) external view returns (ChallengeRequest memory) {
        return challenges[challengeId];
    }
    
    // ========================================
    // ADMIN FUNCTIONS
    // ========================================
    
    function setBettingContract(address _bettingContract) external onlyOwner {
        bettingContract = IPixlDogsBattleBetting(_bettingContract);
    }
    
    function setSecurityContract(address _securityContract) external onlyOwner {
        securityContract = IPixlDogsBattleSecurity(_securityContract);
    }
    
    function setTreasuryWallet(address _treasuryWallet) external onlyOwner {
        treasuryWallet = _treasuryWallet;
    }
    
    function setSonicParameters(
        uint256 _minSonicWager,
        uint256 _maxSonicWager,
        uint256 _platformFeePercent
    ) external onlyOwner {
        require(_minSonicWager > 0 && _minSonicWager < _maxSonicWager, "Invalid limits");
        require(_platformFeePercent <= 20, "Fee too high");
        
        minSonicWager = _minSonicWager;
        maxSonicWager = _maxSonicWager;
        platformFeePercent = _platformFeePercent;
    }
    
    function setPixldParameters(
        uint256 _pixldEntryFee,
        uint256 _minPixldWager,
        uint256 _maxPixldWager
    ) external onlyOwner {
        pixldEntryFee = _pixldEntryFee;
        minPixldWager = _minPixldWager;
        maxPixldWager = _maxPixldWager;
    }
    
    function pause() external onlyOwner {
        _pause();
    }
    
    function unpause() external onlyOwner {
        _unpause();
    }
    
    receive() external payable {}
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    bool private _paused;

    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "viaIR": true,
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_pixlDogsNFT","type":"address"},{"internalType":"address","name":"_gameplayMechanics","type":"address"},{"internalType":"address","name":"_boostContract","type":"address"},{"internalType":"address","name":"_treasuryWallet","type":"address"},{"internalType":"address","name":"_pixelDogToken","type":"address"},{"internalType":"address","name":"_scenarioContract","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"battleId","type":"uint256"},{"indexed":false,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"winnerTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sonicPrize","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pixldPrize","type":"uint256"}],"name":"BattleCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"battleId","type":"uint256"},{"indexed":false,"internalType":"address","name":"challenger","type":"address"},{"indexed":false,"internalType":"address","name":"opponent","type":"address"}],"name":"BattleStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"challengeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"battleId","type":"uint256"},{"indexed":false,"internalType":"address","name":"acceptor","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ChallengeAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"challengeId","type":"uint256"},{"indexed":true,"internalType":"address","name":"challenger","type":"address"},{"indexed":true,"internalType":"address","name":"targetOpponent","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sonicWager","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pixldWager","type":"uint256"},{"indexed":false,"internalType":"enum PixlDogsWarzoneV4.BattleType","name":"battleType","type":"uint8"}],"name":"ChallengeCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"challengeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PixldBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"battleId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"randomSeed","type":"uint256"}],"name":"RandomnessFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"battleId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"requestBlock","type":"uint256"}],"name":"RandomnessRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"BLOCKS_TO_WAIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMMIT_PHASE_PERCENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"challengeId","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"acceptChallenge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"battleRandomnessRequests","outputs":[{"internalType":"uint256","name":"requestBlock","type":"uint256"},{"internalType":"bool","name":"fulfilled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"battles","outputs":[{"internalType":"uint128","name":"challengeId","type":"uint128"},{"internalType":"uint64","name":"acceptedAt","type":"uint64"},{"internalType":"uint64","name":"bettingEndsAt","type":"uint64"},{"internalType":"uint64","name":"commitPhaseEndsAt","type":"uint64"},{"internalType":"uint64","name":"revealPhaseEndsAt","type":"uint64"},{"internalType":"address","name":"challenger","type":"address"},{"internalType":"address","name":"opponent","type":"address"},{"internalType":"uint128","name":"challengerTokenId","type":"uint128"},{"internalType":"uint128","name":"opponentTokenId","type":"uint128"},{"internalType":"uint128","name":"sonicWager","type":"uint128"},{"internalType":"uint128","name":"pixldWager","type":"uint128"},{"internalType":"uint128","name":"pixldPrizePool","type":"uint128"},{"internalType":"uint128","name":"challengerPower","type":"uint128"},{"internalType":"uint128","name":"opponentPower","type":"uint128"},{"internalType":"uint8","name":"battleType","type":"uint8"},{"internalType":"uint8","name":"status","type":"uint8"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"bytes32","name":"randomSeed","type":"bytes32"},{"internalType":"uint8","name":"scenarioId","type":"uint8"},{"internalType":"uint8","name":"challengerScenarioBonus","type":"uint8"},{"internalType":"uint8","name":"opponentScenarioBonus","type":"uint8"},{"internalType":"bool","name":"challengerHasAdvantage","type":"bool"},{"internalType":"bool","name":"opponentHasAdvantage","type":"bool"},{"components":[{"internalType":"uint64","name":"minBetAmount","type":"uint64"},{"internalType":"uint64","name":"maxBetAmount","type":"uint64"},{"internalType":"uint32","name":"maxBettors","type":"uint32"},{"internalType":"uint32","name":"bettingWindow","type":"uint32"},{"internalType":"bool","name":"allowPublicBetting","type":"bool"},{"internalType":"bool","name":"requirePixldForBetting","type":"bool"}],"internalType":"struct PixlDogsWarzoneV4.BettingConditions","name":"bettingConditions","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bettingContract","outputs":[{"internalType":"contract IPixlDogsBattleBetting","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"boostContract","outputs":[{"internalType":"contract IPixlDogsSimpleBoost","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes32","name":"seed","type":"bytes32"}],"name":"calculateBattlePower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"challengeTimeout","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"challenges","outputs":[{"internalType":"address","name":"challenger","type":"address"},{"internalType":"address","name":"targetOpponent","type":"address"},{"internalType":"uint128","name":"challengerTokenId","type":"uint128"},{"internalType":"uint128","name":"sonicWager","type":"uint128"},{"internalType":"uint128","name":"pixldWager","type":"uint128"},{"internalType":"uint64","name":"createdAt","type":"uint64"},{"internalType":"uint64","name":"expiresAt","type":"uint64"},{"internalType":"uint8","name":"battleType","type":"uint8"},{"internalType":"uint8","name":"status","type":"uint8"},{"internalType":"bool","name":"scenarioEnabled","type":"bool"},{"internalType":"uint8","name":"preferredScenarioId","type":"uint8"},{"components":[{"internalType":"uint64","name":"minBetAmount","type":"uint64"},{"internalType":"uint64","name":"maxBetAmount","type":"uint64"},{"internalType":"uint32","name":"maxBettors","type":"uint32"},{"internalType":"uint32","name":"bettingWindow","type":"uint32"},{"internalType":"bool","name":"allowPublicBetting","type":"bool"},{"internalType":"bool","name":"requirePixldForBetting","type":"bool"}],"internalType":"struct PixlDogsWarzoneV4.BettingConditions","name":"bettingConditions","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cooldownPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"targetOpponent","type":"address"},{"components":[{"internalType":"uint64","name":"minBetAmount","type":"uint64"},{"internalType":"uint64","name":"maxBetAmount","type":"uint64"},{"internalType":"uint32","name":"maxBettors","type":"uint32"},{"internalType":"uint32","name":"bettingWindow","type":"uint32"},{"internalType":"bool","name":"allowPublicBetting","type":"bool"},{"internalType":"bool","name":"requirePixldForBetting","type":"bool"}],"internalType":"struct PixlDogsWarzoneV4.BettingConditions","name":"bettingConditions","type":"tuple"}],"name":"createBasicBattle","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"targetOpponent","type":"address"},{"internalType":"uint256","name":"pixldWager","type":"uint256"},{"components":[{"internalType":"uint64","name":"minBetAmount","type":"uint64"},{"internalType":"uint64","name":"maxBetAmount","type":"uint64"},{"internalType":"uint32","name":"maxBettors","type":"uint32"},{"internalType":"uint32","name":"bettingWindow","type":"uint32"},{"internalType":"bool","name":"allowPublicBetting","type":"bool"},{"internalType":"bool","name":"requirePixldForBetting","type":"bool"}],"internalType":"struct PixlDogsWarzoneV4.BettingConditions","name":"bettingConditions","type":"tuple"}],"name":"createPremiumBattle","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"defaultBettingWindow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"battleId","type":"uint256"}],"name":"executeBattle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"battleId","type":"uint256"}],"name":"fulfillBattleRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gameplayMechanics","outputs":[{"internalType":"contract IPixlDogsGameplayMechanics","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"battleId","type":"uint256"}],"name":"getBattleDetails","outputs":[{"internalType":"uint128","name":"challengeId","type":"uint128"},{"internalType":"uint64","name":"acceptedAt","type":"uint64"},{"internalType":"uint64","name":"bettingEndsAt","type":"uint64"},{"internalType":"uint64","name":"commitPhaseEndsAt","type":"uint64"},{"internalType":"uint64","name":"revealPhaseEndsAt","type":"uint64"},{"internalType":"address","name":"challenger","type":"address"},{"internalType":"address","name":"opponent","type":"address"},{"internalType":"uint128","name":"challengerTokenId","type":"uint128"},{"internalType":"uint128","name":"opponentTokenId","type":"uint128"},{"internalType":"uint128","name":"sonicWager","type":"uint128"},{"internalType":"uint128","name":"pixldWager","type":"uint128"},{"internalType":"uint128","name":"pixldPrizePool","type":"uint128"},{"internalType":"uint128","name":"totalFighterStakes","type":"uint128"},{"internalType":"uint128","name":"challengerPower","type":"uint128"},{"internalType":"uint128","name":"opponentPower","type":"uint128"},{"internalType":"uint8","name":"battleType","type":"uint8"},{"internalType":"uint8","name":"status","type":"uint8"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"bytes32","name":"randomSeed","type":"bytes32"},{"internalType":"uint8","name":"scenarioId","type":"uint8"},{"internalType":"uint8","name":"challengerScenarioBonus","type":"uint8"},{"internalType":"uint8","name":"opponentScenarioBonus","type":"uint8"},{"internalType":"bool","name":"challengerHasAdvantage","type":"bool"},{"internalType":"bool","name":"opponentHasAdvantage","type":"bool"},{"internalType":"bool","name":"statsLocked","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"battleId","type":"uint256"}],"name":"getBattleWinner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"challengeId","type":"uint256"}],"name":"getChallengeDetails","outputs":[{"components":[{"internalType":"address","name":"challenger","type":"address"},{"internalType":"address","name":"targetOpponent","type":"address"},{"internalType":"uint128","name":"challengerTokenId","type":"uint128"},{"internalType":"uint128","name":"sonicWager","type":"uint128"},{"internalType":"uint128","name":"pixldWager","type":"uint128"},{"internalType":"uint64","name":"createdAt","type":"uint64"},{"internalType":"uint64","name":"expiresAt","type":"uint64"},{"internalType":"uint8","name":"battleType","type":"uint8"},{"internalType":"uint8","name":"status","type":"uint8"},{"internalType":"bool","name":"scenarioEnabled","type":"bool"},{"internalType":"uint8","name":"preferredScenarioId","type":"uint8"},{"components":[{"internalType":"uint64","name":"minBetAmount","type":"uint64"},{"internalType":"uint64","name":"maxBetAmount","type":"uint64"},{"internalType":"uint32","name":"maxBettors","type":"uint32"},{"internalType":"uint32","name":"bettingWindow","type":"uint32"},{"internalType":"bool","name":"allowPublicBetting","type":"bool"},{"internalType":"bool","name":"requirePixldForBetting","type":"bool"}],"internalType":"struct PixlDogsWarzoneV4.BettingConditions","name":"bettingConditions","type":"tuple"}],"internalType":"struct PixlDogsWarzoneV4.ChallengeRequest","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"battleId","type":"uint256"}],"name":"isBattleResolved","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lastBattleTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPixldWager","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSonicWager","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPixldWager","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minSonicWager","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextBattleId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextChallengeId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pixelDogToken","outputs":[{"internalType":"contract IPixelDogToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pixlDogsNFT","outputs":[{"internalType":"contract IPixlDogsNFT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pixldBonusMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pixldEntryFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFeePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"scenarioBonusMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"scenarioContract","outputs":[{"internalType":"contract IPixlDogsBattleScenarios","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"securityContract","outputs":[{"internalType":"contract IPixlDogsBattleSecurity","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_bettingContract","type":"address"}],"name":"setBettingContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pixldEntryFee","type":"uint256"},{"internalType":"uint256","name":"_minPixldWager","type":"uint256"},{"internalType":"uint256","name":"_maxPixldWager","type":"uint256"}],"name":"setPixldParameters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_securityContract","type":"address"}],"name":"setSecurityContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minSonicWager","type":"uint256"},{"internalType":"uint256","name":"_maxSonicWager","type":"uint256"},{"internalType":"uint256","name":"_platformFeePercent","type":"uint256"}],"name":"setSonicParameters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasuryWallet","type":"address"}],"name":"setTreasuryWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalBasicBattles","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPixldBurned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPremiumBattles","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalScenarioBattles","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSonicRevenue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasuryWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userBattles","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userChallenges","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userLosses","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userWins","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"winStreak","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

608034620001d957601f620047b138819003918201601f19168301916001600160401b03831184841017620001de5780849260c094604052833981010312620001d9576200004d81620001f4565b906200005c60208201620001f4565b906200006b60408201620001f4565b906200007a60608201620001f4565b926200009760a06200008f60808501620001f4565b9301620001f4565b913315620001c0576000549560018060a01b03199533878916176000556040519760018060a01b039687809681958294833391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a360018055678ac7230489e80000600955683635c9adc5dea00000600a556005600b5568056bc75e2d63100000600c556802b5e3af16b1880000600d5569021e19e0c9bab2400000600e556078600f5560966010556201518060115561012c8060125560135560025490610100600160a81b039060081b1690610100600160a81b031916176002551689600354161760035516876004541617600455168560145416176014551683600554161760055516906006541617600655600160155560016016556145a790816200020a8239f35b604051631e4fbdf760e01b815260006004820152602490fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203620001d95756fe61020080604052600436101561001e575b50361561001c57600080fd5b005b600090813560e01c908163018116a114613c705750806304646a4914613c52578063046b750c14613c345780630576018114613bec5780631097251014613b3f57806310c11c5414613b21578063131178ac14612cef5780631504f5cd14612ae6578063152d871614612ac85780631655fe2a14612a9e5780631af441af14612a7557806321cb483114612a4c57806327a088de14612a305780632b9c696a14612a1257806330fce48b146129d257806331a6ff66146129b45780633d40a54f1461278e5780633f4ba83a14612723578063421b9ae314612225578063459a79fd146121fc5780634626402b146121d35780634cc94c26146121a657806351c54446146121885780635c975abb146121655780635f854670146116be578063606d2e961461155457806365e95cf81461151e57806370ea9f68146114f4578063715018a61461149a5780637651313a146114615780637c136cd5146114435780638456cb59146113e8578063884b63b9146113af5780638c639a85146113915780638da5cb5b1461136a5780638f1d3776146112935780639297b13f1461127557806392a8681e146112575780639f9989c81461123b578063a56ce7da14611211578063a5ff0a13146111bb578063a8602fea1461117b578063bbd6f3c31461115d578063c628fc8f14611134578063d89f69421461110b578063de103536146110cb578063dfbafa21146110a7578063dfcedeee1461107e578063e040d9f314611045578063e96b43df1461081c578063f0e26f80146103f0578063f2fde38b14610365578063f462c6e214610348578063f53768131461032a578063f63397c914610301578063fc67aa50146102e3578063fdb1b0d4146102c55763fdbac7fc0361001057346102c257806003193601126102c2576020602254604051908152f35b80fd5b50346102c257806003193601126102c2576020601354604051908152f35b50346102c257806003193601126102c2576020601554604051908152f35b50346102c257806003193601126102c2576008546040516001600160a01b039091168152602090f35b50346102c257806003193601126102c2576020602154604051908152f35b50346102c257806003193601126102c25760208054604051908152f35b50346102c25760203660031901126102c25761037f613c8c565b610387613e4c565b6001600160a01b039081169081156103d757600054826001600160601b0360a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b604051631e4fbdf760e01b815260048101849052602490fd5b50346102c25760203660031901126102c25760043581526018602052604081206040518060805261042090613d61565b80546001600160801b038116608051528060801c6001600160401b03166080516020015260c01c6080516040015260018101546001600160401b0381166080516060015260401c6001600160401b031660805160800152600160a01b6001900360028201541660805160a00152600160a01b6001900360038201541660805160c0015260048101546001600160801b03811660805160e0015260801c608051610100015260058101546001600160801b038116608051610120015260801c608051610140015260068101546001600160801b038116608051610160015260801c608051610180015260078101546001600160801b0381166080516101a001528060801c60ff166080516101c0015260881c60ff166080516101e00152600160a01b60019003600882015416608051610200015260098101546080516102200152600a81015460ff811660805161024001528060081c60ff1660805161026001528060101c60ff1660805161028001528060181c60ff1615156080516102a0015260201c60ff1615156080516102c00152600b016105bc90613df0565b6080516102e00152608051809181516001600160801b03169060208301516001600160401b03166101c05260408301516001600160401b03166101805260608301516001600160401b031660808401516001600160401b0316600160a01b6001900360a086015116600160a01b6001900360c08701511660e08701516001600160801b03166101008801516001600160801b0316916101208901516001600160801b0316936101408a01516001600160801b0316956101608b01516001600160801b0316976101808c01516001600160801b03169a6101a08d01516001600160801b03169c6101c0015160ff169d6101e081015160ff1660e052600160a01b600190036102008201511660c0526102208101516101a05261024081015160ff166101205261026081015160ff166101605261028081015160ff1660a0526102a08101511515610100526102c00151151561014052604051806101e052526101c0516101e05160200152610180516101e051604001526101e051606001526101e051608001526101e05160a001526101e05160c001526101e05160e001526101e05161010001526101e05161012001526101e05161014001526101e05161016001526101e05161018001526101e0516101a001526101e0516101c001526101e0516101e0015260e0516101e051610200015260c0516101e05161022001526101a0516101e0516102400152610120516101e0516102600152610160516101e051610280015260a0516101e0516102a00152610100516101e0516102c00152610140516101e0516102e001526101e05161030001600190526101e05161032090f35b506101203660031901126102c257610832613ca2565b60c0366063190112611040576040519061084b82613d99565b6064356001600160401b03811681036110405782526084356001600160401b038116810361104057602083015263ffffffff60a435818116810361104057604084015260c435908116810361104057606083015260e43580151581036110405760808301526101043580151581036110405760a08301526108ca613fd0565b6108d2613fb2565b6002546040516331a9108f60e11b81526004803590820152906020908290602490829060081c6001600160a01b03165afa8015610ec157610925918591611011575b506001600160a01b03163314613e97565b60035460405163b6c129af60e01b8152600480359082015290602090829060249082906001600160a01b03165afa8015610ec1578490610fd6575b61096a9150613ed9565b6004358352601a602052610990610988604085205460125490613f0e565b421015613f31565b60095434101580610fca575b6109a590613ff3565b600d54604435101580610fbc575b6109bc90614028565b60085483906001600160a01b031680610f3b575b819080610ecc575b50610a356109f56020926109f0604435600c54613f0e565b613f0e565b6005546040516323b872dd60e01b81523360048201523060248201526044810192909252909384926001600160a01b039092169183919082906064820190565b03925af1908115610ec1578491610e83575b5015610e5257600554600c5484916001600160a01b031690813b15610e43578291602483926040519485938492630852cd8d60e31b845260048401525af18015610e4757610e2f575b5050610aa0600c54602054613f0e565b6020556001600160a01b0381163314610e025760155491610ac083613fa3565b601555610acf60115442613f0e565b906001600160401b0360405192610ae584613d7d565b33845260018060a01b03851660208501526001600160801b036004351660408501526001600160801b03341660608501526001600160801b0360443516608085015281421660a08501521660c0830152600160e08301526000610100830152600061012083015260006101408301526101608201528260005260176020526101606005604060002060018060a01b038451166001600160601b0360a01b9081835416178255600182019060018060a01b0360208701511690825416179055610c6060028201610bf46001600160801b03604088015116916001600160801b031992838254161781556001600160801b036060890151166001600160801b0382549181199060801b169116179055565b60808681015160038501805460a08a015167ffffffffffffffff60801b1991909516166001600160801b0392909216919091179290911b67ffffffffffffffff60801b1691909117815560c08681015182546001600160c01b0316911b6001600160c01b031916179055565b6004810160ff60e08601511660ff19825416178155610c9860ff61010087015116829061ff0082549160081b169061ff001916179055565b6101208501511515815462ff000063ff00000061014089015160181b169260101b169063ffff0000191617179055019101516001600160401b038151166001600160401b0319835416178255610cfb6001600160401b03602083015116836140a9565b604081015190825463ffffffff60a01b606083015160a01b169060ff60c01b6080840151151560c01b169260a060ff60c81b910151151560c81b169363ffffffff60801b9060801b169069ffffffffffffffffffff60801b191617171717905533600052601e602052610d728260406000206140d1565b60405190600435825234602083015260443560408301526001606083015260018060a01b031690827f5a352104877c33c8fa244ec256f81a65d4dd402089cc441a8e725ea2f12b7ca260803393a4610dcb602354613fa3565b6023557fb1760b910e8067636e45c4072720fc5e16ed4f8040fceb2f663827b2bafa17876020600c54604051908152a26001805580f35b60405162461bcd60e51b815260206004820152600560248201526410b9b2b63360d91b6044820152606490fd5b610e3890613d4e565b610e43578238610a90565b8280fd5b6040513d84823e3d90fd5b60405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606490fd5b90506020813d602011610eb9575b81610e9e60209383613dcf565b81010312610eb557610eaf90613ecc565b38610a47565b8380fd5b3d9150610e91565b6040513d86823e3d90fd5b604051634eb620a760e01b8152915060a090829060049082905afa8015610e47576109f5610a35916020938591610f07575b509250506109d8565b610f29915060a03d60a011610f34575b610f218183613dcf565b81019061405d565b509250505038610efe565b503d610f17565b604051633c4c45d560e11b81526004803590820152602081602481855afa8015610fb1578390610f76575b610f71915015613f68565b6109d0565b506020813d602011610fa9575b81610f9060209383613dcf565b81010312610e4357610fa4610f7191613ecc565b610f66565b3d9150610f83565b6040513d85823e3d90fd5b50600e5460443511156109b3565b50600a5434111561099c565b506020813d602011611009575b81610ff060209383613dcf565b81010312610eb55761100461096a91613ecc565b610960565b3d9150610fe3565b611033915060203d602011611039575b61102b8183613dcf565b810190613e78565b38610914565b503d611021565b600080fd5b50346102c25760203660031901126102c2576020906040906001600160a01b0361106d613c8c565b168152601d83522054604051908152f35b50346102c257806003193601126102c2576004546040516001600160a01b039091168152602090f35b50346102c2576110b636613ce6565b916110bf613e4c565b600c55600d55600e5580f35b50346102c25760203660031901126102c2576110e5613c8c565b6110ed613e4c565b60018060a01b03166001600160601b0360a01b600854161760085580f35b50346102c257806003193601126102c2576005546040516001600160a01b039091168152602090f35b50346102c257806003193601126102c2576003546040516001600160a01b039091168152602090f35b50346102c257806003193601126102c2576020600a54604051908152f35b50346102c25760203660031901126102c257611195613c8c565b61119d613e4c565b60018060a01b03166001600160601b0360a01b601454161760145580f35b50346102c25760403660031901126102c2576111d5613c8c565b6001600160a01b03168152601e60205260408120805460243592908310156102c25760206112038484613cb8565b90546040519160031b1c8152f35b50346102c25760203660031901126102c25760406020916004358152601b83522054604051908152f35b50346102c257806003193601126102c257602060405160038152f35b50346102c257806003193601126102c2576020602354604051908152f35b50346102c257806003193601126102c2576020600f54604051908152f35b50346102c25760203660031901126102c257604061022091600435815260176020522061136860018060a01b039160ff83825416936001830154169160028101546003820154906112eb600560048501549401613df0565b9460405197885260208801526001600160801b0390818116604089015260801c6060880152811660808701526001600160401b038160801c1660a087015260c01c60c086015281811660e0860152818160081c16610100860152818160101c16151561012086015260181c16610140840152610160830190613d00565bf35b50346102c257806003193601126102c257546040516001600160a01b039091168152602090f35b50346102c257806003193601126102c2576020600b54604051908152f35b50346102c25760203660031901126102c25760408091600435815260196020522060ff6001825492015416825191825215156020820152f35b50346102c257806003193601126102c257611401613e4c565b611409613fb2565b600160ff1960025416176002557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a180f35b50346102c257806003193601126102c2576020600e54604051908152f35b50346102c25760203660031901126102c2576020906040906001600160a01b03611489613c8c565b168152601c83522054604051908152f35b50346102c257806003193601126102c2576114b3613e4c565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346102c25760203660031901126102c25760406020916004358152601a83522054604051908152f35b50346102c25760203660031901126102c2576020906004358152601882526008604060018060a01b039220015416604051908152f35b50346102c25760203660031901126102c25760a061136860406103a09360043581526018602052208054600182015491600180861b0391826002830154169383600384015416916004840154916005850154600686015490600787015497600888015416946009880154966115d0600b600a8b01549a01613df0565b9a6040519d8e6001600160801b0397888a1682526001600160401b039060809a82818d1c16602085015260c01c6040840152818116606084015260401c1689820152015260c08d015283811660e08d0152841c6101008c01528281166101208c0152831c6101408b01528181166101608b0152821c6101808a015285166101a08901528460ff809681931c166101c08a015260881c166101e0880152610200870152610220860152818116610240860152818160081c16610260860152818160101c16610280860152818160181c1615156102a086015260201c1615156102c08401526102e0830190613d00565b50346102c25760203660031901126102c2576116d8613fd0565b60043581526018602052604081206019602052600460ff60076040852093015460881c1603612135578054908115612103576001015460ff166120d257600381018091116120be57431061208f5760043581526018602052604081206019602052604082208054916001830180841161207b57600284019384811161206757600381018091116120675760405194602086019240835240604086015240606085015260043560808501524260a08501524460c085015260c084528360e08101106001600160401b0360e0860111176120515760e084016040819052935190206001928301805460ff191690931790925560098101829055600701805460ff60881b1916600560881b1790558152600435907f546aca7b2683440b8f02fa95faeb8efc79dd0f16af3d815a002742ea6f76116c90602090a2600435815260186020526040812060076001600160801b036118726004840182815416906118668461184760098901948554906142ad565b1660068801906001600160801b0382549181199060801b169116179055565b5460801c9054906142ad565b169101906001600160801b03198254161790556004358152601860205260408120600681015460801c906007810154916001600160801b038316808211600014611f3a5750506002810154600482015460038301546001600160a01b0392831694921692608082901c926001600160801b03909216916007905b6008830160018060a01b0388166001600160601b0360a01b825416179055600360891b9060ff60881b191617910155600435855260186020528460408120936001600160801b036004860154168252601a602052426040832055600485015460801c825242604083205560018060a01b0386168252601c602052604082206119748154613fa3565b90556001600160a01b0381168252601d60205260408220805461199690613fa3565b9055828252601b602052604082206119ae8154613fa3565b9055838252601b602052604082208290556008546001600160a01b031680611dae575b5050916001600160801b036005816006870154169501541680611cff575b5083611c61575b60075486906001600160a01b031680611c19575b5050600435865260186020526040862060ff6007603292015460801c16611a3081614084565b6003811015611c05578893929190611bc9575050604b5b838352601b602052600360408420541015611b9f575b6005546001600160a01b031680611abf575b505050506040519360018060a01b031684526020840152604083015260608201527f053511ceb7a04c099f7967bb5c95534d96e3f414917025ad12593904107dedbe608060043592a26001805580f35b803b15610eb5578380809260a46040518094819363069aa65560e41b988984528c600485015260606024850152600a6064850152693130ba3a3632afbbb4b760b11b608485015260448401525af1611b8b575b50506005546001600160a01b031691823b15610eb55760a484928360405195869485938452600484015260606024840152600b60648401526a626174746c655f6c6f737360a81b6084840152600f60448401525af1611b73575b8080611a6f565b611b7c90613d4e565b611b87578438611b6c565b8480fd5b611b9490613d4e565b610e43578238611b12565b90915060328101809111611bb557908691611a5d565b634e487b7160e01b87526011600452602487fd5b611bd591929350614084565b6003811015611bf15790600188939203611a4757506078611a47565b634e487b7160e01b88526021600452602488fd5b634e487b7160e01b89526021600452602489fd5b803b15611c5d5781809160246040518094819363409d6c7960e01b835260043560048401525af115611a0a57611c4e90613d4e565b611c59578538611a0a565b8580fd5b5080fd5b60055460405163a9059cbb60e01b81526001600160a01b038781166004830152602482018790529091602091839160449183918c91165af18015611cf4578790611cb5575b611cb09150614028565b6119f6565b506020813d602011611cec575b81611ccf60209383613dcf565b81010312611ce857611ce3611cb091613ecc565b611ca6565b8680fd5b3d9150611cc2565b6040513d89823e3d90fd5b6001600160801b03919350611d139061412b565b1691611d2e6064611d26600b548661410b565b04809461411e565b92611d4887808080888b5af1611d4261415e565b50613ff3565b868080808460018060a01b03601454165af1611d6261415e565b5015611d7d57611d7490602154613f0e565b602155386119ef565b60405162461bcd60e51b815260206004820152600960248201526821747265617375727960b81b6044820152606490fd5b6004860154813b15610eb5578391606483926040519485938492630612adb960e51b84526001600160801b038116600485015260801c602484015260043560448401525af1908115610fb1578391611f26575b50506008546001600160a01b031690813b15610e4357604051637897e26760e11b81526001600160a01b0388811660048301529091166024820152604481018390529082908290606490829084905af18015610e4757611f12575b5050611e7160ff600785015460801c16614084565b6003811015611efe57611e87575b8438806119d1565b6008546002840154600385015487926001600160a01b039081169281169116823b15610eb557606484928360405195869485936347a90a9960e01b85526004356004860152602485015260448401525af18015610e4757611eea575b5050611e7f565b611ef390613d4e565b611b87578438611ee3565b634e487b7160e01b86526021600452602486fd5b611f1b90613d4e565b611b87578438611e5c565b611f2f90613d4e565b611c5d578138611e01565b1115611f78576003810154600482015460028301546001600160a01b03928316949216926001600160801b0382169260809290921c916007906118ec565b600981015460648060405160208101908482526931b430b63632b733b2b960b11b6040820152602a8152611fab81613db4565b519020069160405160208101918252671bdc1c1bdb995b9d60c21b604082015260288152611fd881613db4565b5190200611612019576002810154600482015460038301546001600160a01b0392831694921692608082901c926001600160801b03909216916007906118ec565b6003810154600482015460028301546001600160a01b03928316949216926001600160801b0382169260809290921c916007906118ec565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b86526011600452602486fd5b634e487b7160e01b85526011600452602485fd5b60405162461bcd60e51b815260206004820152600760248201526621626c6f636b7360c81b6044820152606490fd5b634e487b7160e01b82526011600452602482fd5b60405162461bcd60e51b8152602060048201526009602482015268199d5b199a5b1b195960ba1b6044820152606490fd5b60405162461bcd60e51b815260206004820152600a602482015269085c995c5d595cdd195960b21b6044820152606490fd5b60405162461bcd60e51b81526020600482015260086024820152672177616974696e6760c01b6044820152606490fd5b50346102c257806003193601126102c257602060ff600254166040519015158152f35b50346102c257806003193601126102c2576020601154604051908152f35b50346102c257806003193601126102c25760025460405160089190911c6001600160a01b03168152602090f35b50346102c257806003193601126102c2576014546040516001600160a01b039091168152602090f35b50346102c25760203660031901126102c257602061221b600435614544565b6040519015158152f35b506101003660031901126102c25760043561223e613ca2565b9060c0366043190112611040576040519161225883613d99565b6044356001600160401b03811681036110405783526064356001600160401b038116810361104057602084015263ffffffff608435818116810361104057604085015260a435908116810361104057606084015260c435801515810361104057608084015260e43580151581036110405760a08401526122d6613fd0565b6122de613fb2565b6002546040516331a9108f60e11b815260048101849052906020908290602490829060081c6001600160a01b03165afa80156126a35761232f91869161101157506001600160a01b03163314613e97565b60035460405163b6c129af60e01b81526004810184905290602090829060249082906001600160a01b03165afa80156126a35785906126e8575b6123739150613ed9565b818452601a60205261238f610988604086205460125490613f0e565b600954341015806126dc575b156126ae576008546001600160a01b03168061262c575b506001600160a01b031691338314610e0257601554906123d182613fa3565b6015556123e060115442613f0e565b906001600160401b03604051926123f684613d7d565b33845260208085018881526001600160801b03888116604080890191825234831660608a0190815260006080808c01829052428a1660a08d01529790981660c08b015260e08a018890526101008a018890526101208a018890526101408a01889052610160808b01999099528a88526017909552909520875181546001600160a01b03199081166001600160a01b0392831617835593516001830180549095169116179092559351915190921b6001600160801b0319908116919093161760028201556005916124c590610bf4565b6004810160ff60e08601511660ff198254161781556124fd60ff61010087015116829061ff0082549160081b169061ff001916179055565b6101208501511515815462ff000063ff00000061014089015160181b169260101b169063ffff0000191617179055019101516001600160401b038151166001600160401b03198354161782556125606001600160401b03602083015116836140a9565b604081015190825463ffffffff60a01b606083015160a01b169060ff60c01b6080840151151560c01b169260a060ff60c81b910151151560c81b169363ffffffff60801b9060801b169069ffffffffffffffffffff60801b191617171717905533600052601e6020526125d78160406000206140d1565b60405191825234602083015260006040830152600060608301527f5a352104877c33c8fa244ec256f81a65d4dd402089cc441a8e725ea2f12b7ca260803393a4612622602254613fa3565b6022556001805580f35b602060249160405192838092633c4c45d560e11b82528760048301525afa80156126a3578590612668575b612662915015613f68565b386123b2565b506020813d60201161269b575b8161268260209383613dcf565b81010312611b875761269661266291613ecc565b612657565b3d9150612675565b6040513d87823e3d90fd5b60405162461bcd60e51b815260206004820152600660248201526510bbb0b3b2b960d11b6044820152606490fd5b50600a5434111561239b565b506020813d60201161271b575b8161270260209383613dcf565b81010312611b875761271661237391613ecc565b612369565b3d91506126f5565b50346102c257806003193601126102c25761273c613e4c565b60025460ff81161561277c5760ff19166002557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a180f35b604051638dfc202b60e01b8152600490fd5b50346102c25760203660031901126102c25760406102209181516127b181613d7d565b81815281602082015281838201528160608201528160808201528160a08201528160c08201528160e082015281610100820152816101208201528161014082015261016083519161280183613d99565b83835283602084015283858401528360608401528360808401528360a0840152015260043581526017602052206128e160056040519261284084613d7d565b60018060a01b03815416845260018060a01b03600182015416602085015260028101546001600160801b038116604086015260801c606085015260038101546001600160801b03811660808601526001600160401b038160801c1660a086015260c01c60c085015260ff600482015481811660e0870152818160081c16610100870152818160101c16151561012087015260181c1661014085015201613df0565b6101608201526113686101606040519260018060a01b03815116845260018060a01b0360208201511660208501526001600160801b0360408201511660408501526001600160801b0360608201511660608501526001600160801b0360808201511660808501526001600160401b0360a08201511660a08501526001600160401b0360c08201511660c085015260ff60e08201511660e085015260ff61010082015116610100850152610120810151151561012085015260ff610140820151166101408501520151610160830190613d00565b50346102c257806003193601126102c2576020601654604051908152f35b50346102c25760203660031901126102c2576129ec613c8c565b6129f4613e4c565b60018060a01b03166001600160601b0360a01b600754161760075580f35b50346102c257806003193601126102c2576020600c54604051908152f35b50346102c257806003193601126102c2576020604051603c8152f35b50346102c257806003193601126102c2576007546040516001600160a01b039091168152602090f35b50346102c257806003193601126102c2576006546040516001600160a01b039091168152602090f35b50346102c25760403660031901126102c2576020612ac06024356004356142ad565b604051908152f35b50346102c257806003193601126102c2576020602454604051908152f35b50346102c257602080600319360112611c5d5760043590612b05613fd0565b612b0d613fb2565b818352601881526040832060ff600782015460881c166002811480918115612ce4575b5015612cb657612c60575b6002810154336001600160a01b0391821614918215612c4f575b508115612c42575b5015612c1657818352601881526040808420600701805460ff60881b19908116600560881b17909155815191820192916001600160401b03841181851017612051577f3d94fecedaa4f90b8bd459797adb95f5bb11426025c5541390d9ccc1ad1b60a193604052438152600183820191878352868852601985526040882090518155019051151560ff801983541691161790556018825260076040862001906001608a1b90825416179055604051438152a26001805580f35b6064906040519062461bcd60e51b825260048201526005602482015264042c2eae8d60db1b6044820152fd5b9050835416331438612b5d565b819250600301541633149038612b55565b6001600160401b03600182015460401c16421015612b3b5760405162461bcd60e51b815260048101839052601660248201527514995d99585b081c1a185cd9481b9bdd08195b99195960521b6044820152606490fd5b60405162461bcd60e51b815260048101849052600660248201526521726561647960d01b6044820152606490fd5b600391501438612b30565b5060403660031901126102c257612d04613fd0565b612d0c613fb2565b600435815260176020526040812090600482019182549060ff8260081c16613af357600381019182548060c01c4211613ac4576002546040516331a9108f60e11b815260248035600483015290916020918391829060081c6001600160a01b03165afa9081156139585790612d9291879161101157506001600160a01b03163314613e97565b60035460405163b6c129af60e01b81526024803560048301529091602091839182906001600160a01b03165afa8015613958578690613a89575b612dd69150613ed9565b6024358552601a602052612df4610988604087205460125490613f0e565b6008546001600160a01b03169081613a13575b60018401546001600160a01b031680156139d45733036139a5575b6002840192835460801c34036139775760ff612e3e9116614084565b60038110156139635790869291613806575b5050855461ff0019166101001786555060165492612e6d84613fa3565b601655600583015463ffffffff60a082901c16603c80820282900414901517156120675790612ec8612ec1612eba846064603c63ffffffff80999860a01c16020496879160a01c1661411e565b9442613f0e565b9384613f0e565b6008549091906001600160a01b03168061354a575b5060ff8798541692612eee84614084565b6003811015611c055761340b575b91869798916001600160801b03936001600160401b038560018060a01b038a54169254935416938160405199612f318b613d61565b88600435168b5281421660208c015281831660408c01521660608a015216608088015260a08701523360c087015283811660e0870152836024351661010087015260801c6101208601526101408501521661016083015285610180830152856101a08301526101c082015260016101e082015284610200820152846102208201528461024082015260646102608201526064610280820152846102a0820152846102c0820152612fe360058301613df0565b6102e0828101919091528386526018602090815260408088208451928501519185015160c01b6001600160c01b03191667ffffffffffffffff60801b608093841b166001600160801b039094169390931792909217825560608401516001830180546001600160401b0392831667ffffffffffffffff1990911617815591850151600b93926130769291909116906140a9565b60a08401516002820180546001600160a01b03199081166001600160a01b039384161790915560c0860151600384018054909216921691909117905560e084015161010085015160801b6001600160801b0319166001600160801b039190911617600482015561012084015161014085015160801b6001600160801b0319166001600160801b039190911617600582015561016084015161018085015160801b6001600160801b0319166001600160801b0391909116176006820155600781016001600160801b036101a08601511681549060ff60801b6101c088015160801b169060ff60881b6101e089015160881b169271ffffffffffffffffffffffffffffffffffff191617171790556008810160018060a01b03610200860151166001600160601b0360a01b8254161790556102208401516009820155600a810160ff6102408601511660ff198254161781556131e960ff61026087015116829061ff0082549160081b169061ff001916179055565b610280850151815463ff0000006102a0880151151560181b169062ff000064ff000000006102c08a0151151560201b169360101b169064ffffff000019161717179055019101516001600160401b038151166001600160401b03198354161782556132616001600160401b03602083015116836140a9565b6040818101518354606084015160808086015160a09687015169ffffffffffffffffffff60801b199094169490911b63ffffffff60801b1693909317941b63ffffffff60a01b169390931790151560c01b60ff60c01b161791151560c81b60ff60c81b169190911790915581546001600160a01b03168552601f60205284206132eb9083906140d1565b338452601f60205261330082604086206140d1565b60075484906001600160a01b0316801515806133fa575b61339e575b505054604080516001600160a01b0390921682523360208301527ffee930d10a180af369f35c753cbe7758b669fd187447cae2f147a9156c0757d091a26040805191825233602083015260243590820152600435907f1039a752b56851d7f751027cfe9023deef6921b39b1281591d0f309a10679f0690606090a26001805580f35b809193503b15610e4357828091602460405180968193634397da9760e01b83528960048401525af19283156133ed5784931561331c576133e091929350613d4e565b610e43578190833861331c565b50604051903d90823e3d90fd5b5060ff600584015460c01c16613317565b97506001600160801b036134218183541661412b565b1661342b84614084565b6003811015611c055760010361349357600f548060631981011161347f57916134716001600160801b039492606461346a8b9c9d96606319018361410b565b0490613f0e565b925b91935091989750612efc565b634e487b7160e01b89526011600452602489fd5b9761349d84614084565b6003811015611c05576002146134c1575b91869798916001600160801b0393613473565b97600f5460631990818101908111613536576134df6064918461410b565b0490601054808281011161352257926135108a9b9c9593606461346a613516956001600160801b039a98018561410b565b90613f0e565b999850919092506134ae565b634e487b7160e01b8b52601160045260248bfd5b634e487b7160e01b8a52601160045260248afd5b6001600160801b03845416813b1561377c5788916064839260405194859384926385257e8d60e01b8452600484015260243560248401528c60448401525af18015613739579088916137f2575b50506135a660ff895416614084565b6003811015611bf1576135ba575b38612edd565b600854604051634eb620a760e01b8152906001600160a01b031660a082600481845afa9182156137885789926137cc575b5081159081156135fe575b5050506135b4565b6005546001600160a01b0316916002600185901b8590041417156135365760405163a9059cbb60e01b81526001600160a01b03919091166004820152600183901b602482015290602090829060449082908d905af1801561378857613793575b5060085486546040516367e3022760e11b8152600481018a90526001600160a01b0391821660248201526044810184905291602091839160649183918e91165af1801561378857613744575b506008546040516367e3022760e11b815260048101899052336024820152604481019290925260209082906001600160a01b0316818b81606481015b03925af18015613739576136fc575b80806135f6565b6020813d602011613731575b8161371560209383613dcf565b8101031261372d5761372690613ecc565b50386136f5565b8780fd5b3d9150613708565b6040513d8a823e3d90fd5b6020813d602011613780575b8161375d60209383613dcf565b8101031261377c576136e691613774602092613ecc565b5091506136aa565b8880fd5b3d9150613750565b6040513d8b823e3d90fd5b6020813d6020116137c4575b816137ac60209383613dcf565b8101031261377c576137bd90613ecc565b503861365e565b3d915061379f565b6137e691925060a03d60a011610f3457610f218183613dcf565b509250505090386135eb565b6137fb90613d4e565b611ce8578638613597565b8291806138f1575b506109f56020926109f061382f936001600160801b03600c54911690613f0e565b03925af180156126a35785906138b6575b61384a9150614028565b60018060a01b0360055416600c54813b15611c59578591602483926040519485938492630852cd8d60e31b845260048401525af180156126a3576138a3575b50613898600c54602054613f0e565b602055833880612e50565b6138af90949194613d4e565b9238613889565b506020813d6020116138e9575b816138d060209383613dcf565b81010312611b87576138e461384a91613ecc565b613840565b3d91506138c3565b60a09193506004925060405192838092634eb620a760e01b82525afa908115613958576109f587936109f060209461382f948791613935575b50945050915061380e565b61394d915060a03d8111610f3457610f218183613dcf565b50925050503861392a565b6040513d88823e3d90fd5b634e487b7160e01b87526021600452602487fd5b60405162461bcd60e51b8152602060048201526006602482015265042dac2e8c6d60d31b6044820152606490fd5b60405162461bcd60e51b8152602060048201526007602482015266085d185c99d95d60ca1b6044820152606490fd5b508354336001600160a01b0390911603612e2257606460405162461bcd60e51b815260206004820152600460248201526339b2b63360e11b6044820152fd5b604051633c4c45d560e11b81526024356004820152602081602481865afa8015611cf4578790613a4e575b613a49915015613f68565b612e07565b506020813d602011613a81575b81613a6860209383613dcf565b81010312611ce857613a7c613a4991613ecc565b613a3e565b3d9150613a5b565b506020813d602011613abc575b81613aa360209383613dcf565b81010312611c5957613ab7612dd691613ecc565b612dcc565b3d9150613a96565b60405162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b6044820152606490fd5b60405162461bcd60e51b815260206004820152600660248201526508585d985a5b60d21b6044820152606490fd5b50346102c257806003193601126102c2576020600d54604051908152f35b50346102c257613b4e36613ce6565b91613b57613e4c565b80151580613be3575b15613bad5760148311613b7957600955600a55600b5580f35b60405162461bcd60e51b815260206004820152600c60248201526b08ccaca40e8dede40d0d2ced60a31b6044820152606490fd5b60405162461bcd60e51b815260206004820152600e60248201526d496e76616c6964206c696d69747360901b6044820152606490fd5b50818110613b60565b50346102c25760403660031901126102c257613c06613c8c565b6001600160a01b03168152601f60205260408120805460243592908310156102c25760206112038484613cb8565b50346102c257806003193601126102c2576020601054604051908152f35b50346102c257806003193601126102c2576020601254604051908152f35b905034611c5d5781600319360112611c5d576020906009548152f35b600435906001600160a01b038216820361104057565b602435906001600160a01b038216820361104057565b8054821015613cd05760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b606090600319011261104057600435906024359060443590565b60a080916001600160401b03808251168552602082015116602085015263ffffffff806040830151166040860152606082015116606085015260808101511515608085015201511515910152565b6001600160401b03811161205157604052565b61030081019081106001600160401b0382111761205157604052565b61018081019081106001600160401b0382111761205157604052565b60c081019081106001600160401b0382111761205157604052565b606081019081106001600160401b0382111761205157604052565b90601f801991011681019081106001600160401b0382111761205157604052565b90604051613dfd81613d99565b60a060ff8294546001600160401b0380821685528160401c16602085015263ffffffff808260801c16604086015281841c166060850152818160c01c161515608085015260c81c161515910152565b6000546001600160a01b03163303613e6057565b60405163118cdaa760e01b8152336004820152602490fd5b9081602091031261104057516001600160a01b03811681036110405790565b15613e9e57565b60405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b6044820152606490fd5b5190811515820361104057565b15613ee057565b60405162461bcd60e51b815260206004820152600660248201526521737461747360d01b6044820152606490fd5b91908201809211613f1b57565b634e487b7160e01b600052601160045260246000fd5b15613f3857565b60405162461bcd60e51b815260206004820152600860248201526731b7b7b63237bbb760c11b6044820152606490fd5b15613f6f57565b60405162461bcd60e51b815260206004820152600c60248201526b14dd185d1cc81b1bd8dad95960a21b6044820152606490fd5b6000198114613f1b5760010190565b60ff60025416613fbe57565b60405163d93c066560e01b8152600490fd5b600260015414613fe1576002600155565b604051633ee5aeb560e01b8152600490fd5b15613ffa57565b60405162461bcd60e51b815260206004820152600660248201526521736f6e696360d01b6044820152606490fd5b1561402f57565b60405162461bcd60e51b8152602060048201526006602482015265085c1a5e1b1960d21b6044820152606490fd5b908160a0910312611040578051916020820151916040810151916080606083015192015190565b60ff1660038110156140935790565b634e487b7160e01b600052602160045260246000fd5b9067ffffffffffffffff60401b82549160401b169067ffffffffffffffff60401b1916179055565b805468010000000000000000811015612051576140f391600182018155613cb8565b819291549060031b91821b91600019901b1916179055565b81810292918115918404141715613f1b57565b91908203918211613f1b57565b60011b907001fffffffffffffffffffffffffffffffe6ffffffffffffffffffffffffffffffffe831692168203613f1b57565b3d15614198573d906001600160401b038211612051576040519161418c601f8201601f191660200184613dcf565b82523d6000602084013e565b606090565b519061ffff8216820361104057565b80916101a09283910312611040576040519182018281106001600160401b03821117612051576040526141de8161419d565b82526141ec6020820161419d565b60208301526141fd6040820161419d565b604083015261420e6060820161419d565b606083015261421f6080820161419d565b608083015261423060a0820161419d565b60a083015261424160c0820161419d565b60c083015261425260e0820161419d565b60e083015261010061426581830161419d565b9083015261012061427781830161419d565b9083015261014061428981830161419d565b9083015261016080820151908301526142a6610180809201613ecc565b9082015290565b60018060a01b0380600354169260409283519263342770bf60e01b8452838060049784898301526101a092839160249889915afa908115614539579086929160009161451c575b5092885416806144b2575b50505061ffff908181511660038102908082046003149015171561449e576020820151928084166201fffe9283600196871b16918083046002149015171561448a579061434b91613f0e565b88840151908383831692871b16918083046002149015171561448a579061437191613f0e565b816060850151169081800486148215171561448a579061439091613f0e565b6080840151908383831692871b16918083046002149015171561448a57906143b791613f0e565b8160a0850151169081800486148215171561448a57906143d691613f0e565b610100840151908383831692871b16918083046002149015171561448a576101209161440191613f0e565b930151908116931b16918083046002149015171561447657602993929161442791613f0e565b948051916020830193845281830152815261444181613db4565b51902006605001928360501161446357505060649161445f9161410b565b0490565b601190634e487b7160e01b600052526000fd5b84601188634e487b7160e01b600052526000fd5b8860118c634e487b7160e01b600052526000fd5b85601189634e487b7160e01b600052526000fd5b81908851938480926361ea767f60e01b8252888d8301525afa9182916000936144ed575b50506144e5575b8085916142ff565b9050386144dd565b61450d929350803d10614515575b6145058183613dcf565b8101906141ac565b9038806144d6565b503d6144fb565b6145339150823d8411614515576145058183613dcf565b386142f4565b87513d6000823e3d90fd5b60165481101561456b576000526018602052600660ff60076040600020015460881c161490565b5060009056fea2646970667358221220c22ce6900df22279f7a429ced9f23503c34216de00185fc8297bf6135fb18a6264736f6c63430008140033000000000000000000000000b202d84c760862dadfafbfbf39939dd75c794dff00000000000000000000000075cb5d3dfe1db6dd7ba203ed9c10c0c99d3506280000000000000000000000001132e47cbbdf0f266b11fd65766ada918a388d5d0000000000000000000000006465eacf8d5d123897a6cee5cf4149031533c2fe00000000000000000000000069e1b7157cc53ffc94e585550c946a4ff6c6850e0000000000000000000000007a52bf25bca3b89bb1207de7519f388cdfe0de25

Deployed Bytecode

0x61020080604052600436101561001e575b50361561001c57600080fd5b005b600090813560e01c908163018116a114613c705750806304646a4914613c52578063046b750c14613c345780630576018114613bec5780631097251014613b3f57806310c11c5414613b21578063131178ac14612cef5780631504f5cd14612ae6578063152d871614612ac85780631655fe2a14612a9e5780631af441af14612a7557806321cb483114612a4c57806327a088de14612a305780632b9c696a14612a1257806330fce48b146129d257806331a6ff66146129b45780633d40a54f1461278e5780633f4ba83a14612723578063421b9ae314612225578063459a79fd146121fc5780634626402b146121d35780634cc94c26146121a657806351c54446146121885780635c975abb146121655780635f854670146116be578063606d2e961461155457806365e95cf81461151e57806370ea9f68146114f4578063715018a61461149a5780637651313a146114615780637c136cd5146114435780638456cb59146113e8578063884b63b9146113af5780638c639a85146113915780638da5cb5b1461136a5780638f1d3776146112935780639297b13f1461127557806392a8681e146112575780639f9989c81461123b578063a56ce7da14611211578063a5ff0a13146111bb578063a8602fea1461117b578063bbd6f3c31461115d578063c628fc8f14611134578063d89f69421461110b578063de103536146110cb578063dfbafa21146110a7578063dfcedeee1461107e578063e040d9f314611045578063e96b43df1461081c578063f0e26f80146103f0578063f2fde38b14610365578063f462c6e214610348578063f53768131461032a578063f63397c914610301578063fc67aa50146102e3578063fdb1b0d4146102c55763fdbac7fc0361001057346102c257806003193601126102c2576020602254604051908152f35b80fd5b50346102c257806003193601126102c2576020601354604051908152f35b50346102c257806003193601126102c2576020601554604051908152f35b50346102c257806003193601126102c2576008546040516001600160a01b039091168152602090f35b50346102c257806003193601126102c2576020602154604051908152f35b50346102c257806003193601126102c25760208054604051908152f35b50346102c25760203660031901126102c25761037f613c8c565b610387613e4c565b6001600160a01b039081169081156103d757600054826001600160601b0360a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b604051631e4fbdf760e01b815260048101849052602490fd5b50346102c25760203660031901126102c25760043581526018602052604081206040518060805261042090613d61565b80546001600160801b038116608051528060801c6001600160401b03166080516020015260c01c6080516040015260018101546001600160401b0381166080516060015260401c6001600160401b031660805160800152600160a01b6001900360028201541660805160a00152600160a01b6001900360038201541660805160c0015260048101546001600160801b03811660805160e0015260801c608051610100015260058101546001600160801b038116608051610120015260801c608051610140015260068101546001600160801b038116608051610160015260801c608051610180015260078101546001600160801b0381166080516101a001528060801c60ff166080516101c0015260881c60ff166080516101e00152600160a01b60019003600882015416608051610200015260098101546080516102200152600a81015460ff811660805161024001528060081c60ff1660805161026001528060101c60ff1660805161028001528060181c60ff1615156080516102a0015260201c60ff1615156080516102c00152600b016105bc90613df0565b6080516102e00152608051809181516001600160801b03169060208301516001600160401b03166101c05260408301516001600160401b03166101805260608301516001600160401b031660808401516001600160401b0316600160a01b6001900360a086015116600160a01b6001900360c08701511660e08701516001600160801b03166101008801516001600160801b0316916101208901516001600160801b0316936101408a01516001600160801b0316956101608b01516001600160801b0316976101808c01516001600160801b03169a6101a08d01516001600160801b03169c6101c0015160ff169d6101e081015160ff1660e052600160a01b600190036102008201511660c0526102208101516101a05261024081015160ff166101205261026081015160ff166101605261028081015160ff1660a0526102a08101511515610100526102c00151151561014052604051806101e052526101c0516101e05160200152610180516101e051604001526101e051606001526101e051608001526101e05160a001526101e05160c001526101e05160e001526101e05161010001526101e05161012001526101e05161014001526101e05161016001526101e05161018001526101e0516101a001526101e0516101c001526101e0516101e0015260e0516101e051610200015260c0516101e05161022001526101a0516101e0516102400152610120516101e0516102600152610160516101e051610280015260a0516101e0516102a00152610100516101e0516102c00152610140516101e0516102e001526101e05161030001600190526101e05161032090f35b506101203660031901126102c257610832613ca2565b60c0366063190112611040576040519061084b82613d99565b6064356001600160401b03811681036110405782526084356001600160401b038116810361104057602083015263ffffffff60a435818116810361104057604084015260c435908116810361104057606083015260e43580151581036110405760808301526101043580151581036110405760a08301526108ca613fd0565b6108d2613fb2565b6002546040516331a9108f60e11b81526004803590820152906020908290602490829060081c6001600160a01b03165afa8015610ec157610925918591611011575b506001600160a01b03163314613e97565b60035460405163b6c129af60e01b8152600480359082015290602090829060249082906001600160a01b03165afa8015610ec1578490610fd6575b61096a9150613ed9565b6004358352601a602052610990610988604085205460125490613f0e565b421015613f31565b60095434101580610fca575b6109a590613ff3565b600d54604435101580610fbc575b6109bc90614028565b60085483906001600160a01b031680610f3b575b819080610ecc575b50610a356109f56020926109f0604435600c54613f0e565b613f0e565b6005546040516323b872dd60e01b81523360048201523060248201526044810192909252909384926001600160a01b039092169183919082906064820190565b03925af1908115610ec1578491610e83575b5015610e5257600554600c5484916001600160a01b031690813b15610e43578291602483926040519485938492630852cd8d60e31b845260048401525af18015610e4757610e2f575b5050610aa0600c54602054613f0e565b6020556001600160a01b0381163314610e025760155491610ac083613fa3565b601555610acf60115442613f0e565b906001600160401b0360405192610ae584613d7d565b33845260018060a01b03851660208501526001600160801b036004351660408501526001600160801b03341660608501526001600160801b0360443516608085015281421660a08501521660c0830152600160e08301526000610100830152600061012083015260006101408301526101608201528260005260176020526101606005604060002060018060a01b038451166001600160601b0360a01b9081835416178255600182019060018060a01b0360208701511690825416179055610c6060028201610bf46001600160801b03604088015116916001600160801b031992838254161781556001600160801b036060890151166001600160801b0382549181199060801b169116179055565b60808681015160038501805460a08a015167ffffffffffffffff60801b1991909516166001600160801b0392909216919091179290911b67ffffffffffffffff60801b1691909117815560c08681015182546001600160c01b0316911b6001600160c01b031916179055565b6004810160ff60e08601511660ff19825416178155610c9860ff61010087015116829061ff0082549160081b169061ff001916179055565b6101208501511515815462ff000063ff00000061014089015160181b169260101b169063ffff0000191617179055019101516001600160401b038151166001600160401b0319835416178255610cfb6001600160401b03602083015116836140a9565b604081015190825463ffffffff60a01b606083015160a01b169060ff60c01b6080840151151560c01b169260a060ff60c81b910151151560c81b169363ffffffff60801b9060801b169069ffffffffffffffffffff60801b191617171717905533600052601e602052610d728260406000206140d1565b60405190600435825234602083015260443560408301526001606083015260018060a01b031690827f5a352104877c33c8fa244ec256f81a65d4dd402089cc441a8e725ea2f12b7ca260803393a4610dcb602354613fa3565b6023557fb1760b910e8067636e45c4072720fc5e16ed4f8040fceb2f663827b2bafa17876020600c54604051908152a26001805580f35b60405162461bcd60e51b815260206004820152600560248201526410b9b2b63360d91b6044820152606490fd5b610e3890613d4e565b610e43578238610a90565b8280fd5b6040513d84823e3d90fd5b60405162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b6044820152606490fd5b90506020813d602011610eb9575b81610e9e60209383613dcf565b81010312610eb557610eaf90613ecc565b38610a47565b8380fd5b3d9150610e91565b6040513d86823e3d90fd5b604051634eb620a760e01b8152915060a090829060049082905afa8015610e47576109f5610a35916020938591610f07575b509250506109d8565b610f29915060a03d60a011610f34575b610f218183613dcf565b81019061405d565b509250505038610efe565b503d610f17565b604051633c4c45d560e11b81526004803590820152602081602481855afa8015610fb1578390610f76575b610f71915015613f68565b6109d0565b506020813d602011610fa9575b81610f9060209383613dcf565b81010312610e4357610fa4610f7191613ecc565b610f66565b3d9150610f83565b6040513d85823e3d90fd5b50600e5460443511156109b3565b50600a5434111561099c565b506020813d602011611009575b81610ff060209383613dcf565b81010312610eb55761100461096a91613ecc565b610960565b3d9150610fe3565b611033915060203d602011611039575b61102b8183613dcf565b810190613e78565b38610914565b503d611021565b600080fd5b50346102c25760203660031901126102c2576020906040906001600160a01b0361106d613c8c565b168152601d83522054604051908152f35b50346102c257806003193601126102c2576004546040516001600160a01b039091168152602090f35b50346102c2576110b636613ce6565b916110bf613e4c565b600c55600d55600e5580f35b50346102c25760203660031901126102c2576110e5613c8c565b6110ed613e4c565b60018060a01b03166001600160601b0360a01b600854161760085580f35b50346102c257806003193601126102c2576005546040516001600160a01b039091168152602090f35b50346102c257806003193601126102c2576003546040516001600160a01b039091168152602090f35b50346102c257806003193601126102c2576020600a54604051908152f35b50346102c25760203660031901126102c257611195613c8c565b61119d613e4c565b60018060a01b03166001600160601b0360a01b601454161760145580f35b50346102c25760403660031901126102c2576111d5613c8c565b6001600160a01b03168152601e60205260408120805460243592908310156102c25760206112038484613cb8565b90546040519160031b1c8152f35b50346102c25760203660031901126102c25760406020916004358152601b83522054604051908152f35b50346102c257806003193601126102c257602060405160038152f35b50346102c257806003193601126102c2576020602354604051908152f35b50346102c257806003193601126102c2576020600f54604051908152f35b50346102c25760203660031901126102c257604061022091600435815260176020522061136860018060a01b039160ff83825416936001830154169160028101546003820154906112eb600560048501549401613df0565b9460405197885260208801526001600160801b0390818116604089015260801c6060880152811660808701526001600160401b038160801c1660a087015260c01c60c086015281811660e0860152818160081c16610100860152818160101c16151561012086015260181c16610140840152610160830190613d00565bf35b50346102c257806003193601126102c257546040516001600160a01b039091168152602090f35b50346102c257806003193601126102c2576020600b54604051908152f35b50346102c25760203660031901126102c25760408091600435815260196020522060ff6001825492015416825191825215156020820152f35b50346102c257806003193601126102c257611401613e4c565b611409613fb2565b600160ff1960025416176002557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a180f35b50346102c257806003193601126102c2576020600e54604051908152f35b50346102c25760203660031901126102c2576020906040906001600160a01b03611489613c8c565b168152601c83522054604051908152f35b50346102c257806003193601126102c2576114b3613e4c565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346102c25760203660031901126102c25760406020916004358152601a83522054604051908152f35b50346102c25760203660031901126102c2576020906004358152601882526008604060018060a01b039220015416604051908152f35b50346102c25760203660031901126102c25760a061136860406103a09360043581526018602052208054600182015491600180861b0391826002830154169383600384015416916004840154916005850154600686015490600787015497600888015416946009880154966115d0600b600a8b01549a01613df0565b9a6040519d8e6001600160801b0397888a1682526001600160401b039060809a82818d1c16602085015260c01c6040840152818116606084015260401c1689820152015260c08d015283811660e08d0152841c6101008c01528281166101208c0152831c6101408b01528181166101608b0152821c6101808a015285166101a08901528460ff809681931c166101c08a015260881c166101e0880152610200870152610220860152818116610240860152818160081c16610260860152818160101c16610280860152818160181c1615156102a086015260201c1615156102c08401526102e0830190613d00565b50346102c25760203660031901126102c2576116d8613fd0565b60043581526018602052604081206019602052600460ff60076040852093015460881c1603612135578054908115612103576001015460ff166120d257600381018091116120be57431061208f5760043581526018602052604081206019602052604082208054916001830180841161207b57600284019384811161206757600381018091116120675760405194602086019240835240604086015240606085015260043560808501524260a08501524460c085015260c084528360e08101106001600160401b0360e0860111176120515760e084016040819052935190206001928301805460ff191690931790925560098101829055600701805460ff60881b1916600560881b1790558152600435907f546aca7b2683440b8f02fa95faeb8efc79dd0f16af3d815a002742ea6f76116c90602090a2600435815260186020526040812060076001600160801b036118726004840182815416906118668461184760098901948554906142ad565b1660068801906001600160801b0382549181199060801b169116179055565b5460801c9054906142ad565b169101906001600160801b03198254161790556004358152601860205260408120600681015460801c906007810154916001600160801b038316808211600014611f3a5750506002810154600482015460038301546001600160a01b0392831694921692608082901c926001600160801b03909216916007905b6008830160018060a01b0388166001600160601b0360a01b825416179055600360891b9060ff60881b191617910155600435855260186020528460408120936001600160801b036004860154168252601a602052426040832055600485015460801c825242604083205560018060a01b0386168252601c602052604082206119748154613fa3565b90556001600160a01b0381168252601d60205260408220805461199690613fa3565b9055828252601b602052604082206119ae8154613fa3565b9055838252601b602052604082208290556008546001600160a01b031680611dae575b5050916001600160801b036005816006870154169501541680611cff575b5083611c61575b60075486906001600160a01b031680611c19575b5050600435865260186020526040862060ff6007603292015460801c16611a3081614084565b6003811015611c05578893929190611bc9575050604b5b838352601b602052600360408420541015611b9f575b6005546001600160a01b031680611abf575b505050506040519360018060a01b031684526020840152604083015260608201527f053511ceb7a04c099f7967bb5c95534d96e3f414917025ad12593904107dedbe608060043592a26001805580f35b803b15610eb5578380809260a46040518094819363069aa65560e41b988984528c600485015260606024850152600a6064850152693130ba3a3632afbbb4b760b11b608485015260448401525af1611b8b575b50506005546001600160a01b031691823b15610eb55760a484928360405195869485938452600484015260606024840152600b60648401526a626174746c655f6c6f737360a81b6084840152600f60448401525af1611b73575b8080611a6f565b611b7c90613d4e565b611b87578438611b6c565b8480fd5b611b9490613d4e565b610e43578238611b12565b90915060328101809111611bb557908691611a5d565b634e487b7160e01b87526011600452602487fd5b611bd591929350614084565b6003811015611bf15790600188939203611a4757506078611a47565b634e487b7160e01b88526021600452602488fd5b634e487b7160e01b89526021600452602489fd5b803b15611c5d5781809160246040518094819363409d6c7960e01b835260043560048401525af115611a0a57611c4e90613d4e565b611c59578538611a0a565b8580fd5b5080fd5b60055460405163a9059cbb60e01b81526001600160a01b038781166004830152602482018790529091602091839160449183918c91165af18015611cf4578790611cb5575b611cb09150614028565b6119f6565b506020813d602011611cec575b81611ccf60209383613dcf565b81010312611ce857611ce3611cb091613ecc565b611ca6565b8680fd5b3d9150611cc2565b6040513d89823e3d90fd5b6001600160801b03919350611d139061412b565b1691611d2e6064611d26600b548661410b565b04809461411e565b92611d4887808080888b5af1611d4261415e565b50613ff3565b868080808460018060a01b03601454165af1611d6261415e565b5015611d7d57611d7490602154613f0e565b602155386119ef565b60405162461bcd60e51b815260206004820152600960248201526821747265617375727960b81b6044820152606490fd5b6004860154813b15610eb5578391606483926040519485938492630612adb960e51b84526001600160801b038116600485015260801c602484015260043560448401525af1908115610fb1578391611f26575b50506008546001600160a01b031690813b15610e4357604051637897e26760e11b81526001600160a01b0388811660048301529091166024820152604481018390529082908290606490829084905af18015610e4757611f12575b5050611e7160ff600785015460801c16614084565b6003811015611efe57611e87575b8438806119d1565b6008546002840154600385015487926001600160a01b039081169281169116823b15610eb557606484928360405195869485936347a90a9960e01b85526004356004860152602485015260448401525af18015610e4757611eea575b5050611e7f565b611ef390613d4e565b611b87578438611ee3565b634e487b7160e01b86526021600452602486fd5b611f1b90613d4e565b611b87578438611e5c565b611f2f90613d4e565b611c5d578138611e01565b1115611f78576003810154600482015460028301546001600160a01b03928316949216926001600160801b0382169260809290921c916007906118ec565b600981015460648060405160208101908482526931b430b63632b733b2b960b11b6040820152602a8152611fab81613db4565b519020069160405160208101918252671bdc1c1bdb995b9d60c21b604082015260288152611fd881613db4565b5190200611612019576002810154600482015460038301546001600160a01b0392831694921692608082901c926001600160801b03909216916007906118ec565b6003810154600482015460028301546001600160a01b03928316949216926001600160801b0382169260809290921c916007906118ec565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b86526011600452602486fd5b634e487b7160e01b85526011600452602485fd5b60405162461bcd60e51b815260206004820152600760248201526621626c6f636b7360c81b6044820152606490fd5b634e487b7160e01b82526011600452602482fd5b60405162461bcd60e51b8152602060048201526009602482015268199d5b199a5b1b195960ba1b6044820152606490fd5b60405162461bcd60e51b815260206004820152600a602482015269085c995c5d595cdd195960b21b6044820152606490fd5b60405162461bcd60e51b81526020600482015260086024820152672177616974696e6760c01b6044820152606490fd5b50346102c257806003193601126102c257602060ff600254166040519015158152f35b50346102c257806003193601126102c2576020601154604051908152f35b50346102c257806003193601126102c25760025460405160089190911c6001600160a01b03168152602090f35b50346102c257806003193601126102c2576014546040516001600160a01b039091168152602090f35b50346102c25760203660031901126102c257602061221b600435614544565b6040519015158152f35b506101003660031901126102c25760043561223e613ca2565b9060c0366043190112611040576040519161225883613d99565b6044356001600160401b03811681036110405783526064356001600160401b038116810361104057602084015263ffffffff608435818116810361104057604085015260a435908116810361104057606084015260c435801515810361104057608084015260e43580151581036110405760a08401526122d6613fd0565b6122de613fb2565b6002546040516331a9108f60e11b815260048101849052906020908290602490829060081c6001600160a01b03165afa80156126a35761232f91869161101157506001600160a01b03163314613e97565b60035460405163b6c129af60e01b81526004810184905290602090829060249082906001600160a01b03165afa80156126a35785906126e8575b6123739150613ed9565b818452601a60205261238f610988604086205460125490613f0e565b600954341015806126dc575b156126ae576008546001600160a01b03168061262c575b506001600160a01b031691338314610e0257601554906123d182613fa3565b6015556123e060115442613f0e565b906001600160401b03604051926123f684613d7d565b33845260208085018881526001600160801b03888116604080890191825234831660608a0190815260006080808c01829052428a1660a08d01529790981660c08b015260e08a018890526101008a018890526101208a018890526101408a01889052610160808b01999099528a88526017909552909520875181546001600160a01b03199081166001600160a01b0392831617835593516001830180549095169116179092559351915190921b6001600160801b0319908116919093161760028201556005916124c590610bf4565b6004810160ff60e08601511660ff198254161781556124fd60ff61010087015116829061ff0082549160081b169061ff001916179055565b6101208501511515815462ff000063ff00000061014089015160181b169260101b169063ffff0000191617179055019101516001600160401b038151166001600160401b03198354161782556125606001600160401b03602083015116836140a9565b604081015190825463ffffffff60a01b606083015160a01b169060ff60c01b6080840151151560c01b169260a060ff60c81b910151151560c81b169363ffffffff60801b9060801b169069ffffffffffffffffffff60801b191617171717905533600052601e6020526125d78160406000206140d1565b60405191825234602083015260006040830152600060608301527f5a352104877c33c8fa244ec256f81a65d4dd402089cc441a8e725ea2f12b7ca260803393a4612622602254613fa3565b6022556001805580f35b602060249160405192838092633c4c45d560e11b82528760048301525afa80156126a3578590612668575b612662915015613f68565b386123b2565b506020813d60201161269b575b8161268260209383613dcf565b81010312611b875761269661266291613ecc565b612657565b3d9150612675565b6040513d87823e3d90fd5b60405162461bcd60e51b815260206004820152600660248201526510bbb0b3b2b960d11b6044820152606490fd5b50600a5434111561239b565b506020813d60201161271b575b8161270260209383613dcf565b81010312611b875761271661237391613ecc565b612369565b3d91506126f5565b50346102c257806003193601126102c25761273c613e4c565b60025460ff81161561277c5760ff19166002557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a180f35b604051638dfc202b60e01b8152600490fd5b50346102c25760203660031901126102c25760406102209181516127b181613d7d565b81815281602082015281838201528160608201528160808201528160a08201528160c08201528160e082015281610100820152816101208201528161014082015261016083519161280183613d99565b83835283602084015283858401528360608401528360808401528360a0840152015260043581526017602052206128e160056040519261284084613d7d565b60018060a01b03815416845260018060a01b03600182015416602085015260028101546001600160801b038116604086015260801c606085015260038101546001600160801b03811660808601526001600160401b038160801c1660a086015260c01c60c085015260ff600482015481811660e0870152818160081c16610100870152818160101c16151561012087015260181c1661014085015201613df0565b6101608201526113686101606040519260018060a01b03815116845260018060a01b0360208201511660208501526001600160801b0360408201511660408501526001600160801b0360608201511660608501526001600160801b0360808201511660808501526001600160401b0360a08201511660a08501526001600160401b0360c08201511660c085015260ff60e08201511660e085015260ff61010082015116610100850152610120810151151561012085015260ff610140820151166101408501520151610160830190613d00565b50346102c257806003193601126102c2576020601654604051908152f35b50346102c25760203660031901126102c2576129ec613c8c565b6129f4613e4c565b60018060a01b03166001600160601b0360a01b600754161760075580f35b50346102c257806003193601126102c2576020600c54604051908152f35b50346102c257806003193601126102c2576020604051603c8152f35b50346102c257806003193601126102c2576007546040516001600160a01b039091168152602090f35b50346102c257806003193601126102c2576006546040516001600160a01b039091168152602090f35b50346102c25760403660031901126102c2576020612ac06024356004356142ad565b604051908152f35b50346102c257806003193601126102c2576020602454604051908152f35b50346102c257602080600319360112611c5d5760043590612b05613fd0565b612b0d613fb2565b818352601881526040832060ff600782015460881c166002811480918115612ce4575b5015612cb657612c60575b6002810154336001600160a01b0391821614918215612c4f575b508115612c42575b5015612c1657818352601881526040808420600701805460ff60881b19908116600560881b17909155815191820192916001600160401b03841181851017612051577f3d94fecedaa4f90b8bd459797adb95f5bb11426025c5541390d9ccc1ad1b60a193604052438152600183820191878352868852601985526040882090518155019051151560ff801983541691161790556018825260076040862001906001608a1b90825416179055604051438152a26001805580f35b6064906040519062461bcd60e51b825260048201526005602482015264042c2eae8d60db1b6044820152fd5b9050835416331438612b5d565b819250600301541633149038612b55565b6001600160401b03600182015460401c16421015612b3b5760405162461bcd60e51b815260048101839052601660248201527514995d99585b081c1a185cd9481b9bdd08195b99195960521b6044820152606490fd5b60405162461bcd60e51b815260048101849052600660248201526521726561647960d01b6044820152606490fd5b600391501438612b30565b5060403660031901126102c257612d04613fd0565b612d0c613fb2565b600435815260176020526040812090600482019182549060ff8260081c16613af357600381019182548060c01c4211613ac4576002546040516331a9108f60e11b815260248035600483015290916020918391829060081c6001600160a01b03165afa9081156139585790612d9291879161101157506001600160a01b03163314613e97565b60035460405163b6c129af60e01b81526024803560048301529091602091839182906001600160a01b03165afa8015613958578690613a89575b612dd69150613ed9565b6024358552601a602052612df4610988604087205460125490613f0e565b6008546001600160a01b03169081613a13575b60018401546001600160a01b031680156139d45733036139a5575b6002840192835460801c34036139775760ff612e3e9116614084565b60038110156139635790869291613806575b5050855461ff0019166101001786555060165492612e6d84613fa3565b601655600583015463ffffffff60a082901c16603c80820282900414901517156120675790612ec8612ec1612eba846064603c63ffffffff80999860a01c16020496879160a01c1661411e565b9442613f0e565b9384613f0e565b6008549091906001600160a01b03168061354a575b5060ff8798541692612eee84614084565b6003811015611c055761340b575b91869798916001600160801b03936001600160401b038560018060a01b038a54169254935416938160405199612f318b613d61565b88600435168b5281421660208c015281831660408c01521660608a015216608088015260a08701523360c087015283811660e0870152836024351661010087015260801c6101208601526101408501521661016083015285610180830152856101a08301526101c082015260016101e082015284610200820152846102208201528461024082015260646102608201526064610280820152846102a0820152846102c0820152612fe360058301613df0565b6102e0828101919091528386526018602090815260408088208451928501519185015160c01b6001600160c01b03191667ffffffffffffffff60801b608093841b166001600160801b039094169390931792909217825560608401516001830180546001600160401b0392831667ffffffffffffffff1990911617815591850151600b93926130769291909116906140a9565b60a08401516002820180546001600160a01b03199081166001600160a01b039384161790915560c0860151600384018054909216921691909117905560e084015161010085015160801b6001600160801b0319166001600160801b039190911617600482015561012084015161014085015160801b6001600160801b0319166001600160801b039190911617600582015561016084015161018085015160801b6001600160801b0319166001600160801b0391909116176006820155600781016001600160801b036101a08601511681549060ff60801b6101c088015160801b169060ff60881b6101e089015160881b169271ffffffffffffffffffffffffffffffffffff191617171790556008810160018060a01b03610200860151166001600160601b0360a01b8254161790556102208401516009820155600a810160ff6102408601511660ff198254161781556131e960ff61026087015116829061ff0082549160081b169061ff001916179055565b610280850151815463ff0000006102a0880151151560181b169062ff000064ff000000006102c08a0151151560201b169360101b169064ffffff000019161717179055019101516001600160401b038151166001600160401b03198354161782556132616001600160401b03602083015116836140a9565b6040818101518354606084015160808086015160a09687015169ffffffffffffffffffff60801b199094169490911b63ffffffff60801b1693909317941b63ffffffff60a01b169390931790151560c01b60ff60c01b161791151560c81b60ff60c81b169190911790915581546001600160a01b03168552601f60205284206132eb9083906140d1565b338452601f60205261330082604086206140d1565b60075484906001600160a01b0316801515806133fa575b61339e575b505054604080516001600160a01b0390921682523360208301527ffee930d10a180af369f35c753cbe7758b669fd187447cae2f147a9156c0757d091a26040805191825233602083015260243590820152600435907f1039a752b56851d7f751027cfe9023deef6921b39b1281591d0f309a10679f0690606090a26001805580f35b809193503b15610e4357828091602460405180968193634397da9760e01b83528960048401525af19283156133ed5784931561331c576133e091929350613d4e565b610e43578190833861331c565b50604051903d90823e3d90fd5b5060ff600584015460c01c16613317565b97506001600160801b036134218183541661412b565b1661342b84614084565b6003811015611c055760010361349357600f548060631981011161347f57916134716001600160801b039492606461346a8b9c9d96606319018361410b565b0490613f0e565b925b91935091989750612efc565b634e487b7160e01b89526011600452602489fd5b9761349d84614084565b6003811015611c05576002146134c1575b91869798916001600160801b0393613473565b97600f5460631990818101908111613536576134df6064918461410b565b0490601054808281011161352257926135108a9b9c9593606461346a613516956001600160801b039a98018561410b565b90613f0e565b999850919092506134ae565b634e487b7160e01b8b52601160045260248bfd5b634e487b7160e01b8a52601160045260248afd5b6001600160801b03845416813b1561377c5788916064839260405194859384926385257e8d60e01b8452600484015260243560248401528c60448401525af18015613739579088916137f2575b50506135a660ff895416614084565b6003811015611bf1576135ba575b38612edd565b600854604051634eb620a760e01b8152906001600160a01b031660a082600481845afa9182156137885789926137cc575b5081159081156135fe575b5050506135b4565b6005546001600160a01b0316916002600185901b8590041417156135365760405163a9059cbb60e01b81526001600160a01b03919091166004820152600183901b602482015290602090829060449082908d905af1801561378857613793575b5060085486546040516367e3022760e11b8152600481018a90526001600160a01b0391821660248201526044810184905291602091839160649183918e91165af1801561378857613744575b506008546040516367e3022760e11b815260048101899052336024820152604481019290925260209082906001600160a01b0316818b81606481015b03925af18015613739576136fc575b80806135f6565b6020813d602011613731575b8161371560209383613dcf565b8101031261372d5761372690613ecc565b50386136f5565b8780fd5b3d9150613708565b6040513d8a823e3d90fd5b6020813d602011613780575b8161375d60209383613dcf565b8101031261377c576136e691613774602092613ecc565b5091506136aa565b8880fd5b3d9150613750565b6040513d8b823e3d90fd5b6020813d6020116137c4575b816137ac60209383613dcf565b8101031261377c576137bd90613ecc565b503861365e565b3d915061379f565b6137e691925060a03d60a011610f3457610f218183613dcf565b509250505090386135eb565b6137fb90613d4e565b611ce8578638613597565b8291806138f1575b506109f56020926109f061382f936001600160801b03600c54911690613f0e565b03925af180156126a35785906138b6575b61384a9150614028565b60018060a01b0360055416600c54813b15611c59578591602483926040519485938492630852cd8d60e31b845260048401525af180156126a3576138a3575b50613898600c54602054613f0e565b602055833880612e50565b6138af90949194613d4e565b9238613889565b506020813d6020116138e9575b816138d060209383613dcf565b81010312611b87576138e461384a91613ecc565b613840565b3d91506138c3565b60a09193506004925060405192838092634eb620a760e01b82525afa908115613958576109f587936109f060209461382f948791613935575b50945050915061380e565b61394d915060a03d8111610f3457610f218183613dcf565b50925050503861392a565b6040513d88823e3d90fd5b634e487b7160e01b87526021600452602487fd5b60405162461bcd60e51b8152602060048201526006602482015265042dac2e8c6d60d31b6044820152606490fd5b60405162461bcd60e51b8152602060048201526007602482015266085d185c99d95d60ca1b6044820152606490fd5b508354336001600160a01b0390911603612e2257606460405162461bcd60e51b815260206004820152600460248201526339b2b63360e11b6044820152fd5b604051633c4c45d560e11b81526024356004820152602081602481865afa8015611cf4578790613a4e575b613a49915015613f68565b612e07565b506020813d602011613a81575b81613a6860209383613dcf565b81010312611ce857613a7c613a4991613ecc565b613a3e565b3d9150613a5b565b506020813d602011613abc575b81613aa360209383613dcf565b81010312611c5957613ab7612dd691613ecc565b612dcc565b3d9150613a96565b60405162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b6044820152606490fd5b60405162461bcd60e51b815260206004820152600660248201526508585d985a5b60d21b6044820152606490fd5b50346102c257806003193601126102c2576020600d54604051908152f35b50346102c257613b4e36613ce6565b91613b57613e4c565b80151580613be3575b15613bad5760148311613b7957600955600a55600b5580f35b60405162461bcd60e51b815260206004820152600c60248201526b08ccaca40e8dede40d0d2ced60a31b6044820152606490fd5b60405162461bcd60e51b815260206004820152600e60248201526d496e76616c6964206c696d69747360901b6044820152606490fd5b50818110613b60565b50346102c25760403660031901126102c257613c06613c8c565b6001600160a01b03168152601f60205260408120805460243592908310156102c25760206112038484613cb8565b50346102c257806003193601126102c2576020601054604051908152f35b50346102c257806003193601126102c2576020601254604051908152f35b905034611c5d5781600319360112611c5d576020906009548152f35b600435906001600160a01b038216820361104057565b602435906001600160a01b038216820361104057565b8054821015613cd05760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b606090600319011261104057600435906024359060443590565b60a080916001600160401b03808251168552602082015116602085015263ffffffff806040830151166040860152606082015116606085015260808101511515608085015201511515910152565b6001600160401b03811161205157604052565b61030081019081106001600160401b0382111761205157604052565b61018081019081106001600160401b0382111761205157604052565b60c081019081106001600160401b0382111761205157604052565b606081019081106001600160401b0382111761205157604052565b90601f801991011681019081106001600160401b0382111761205157604052565b90604051613dfd81613d99565b60a060ff8294546001600160401b0380821685528160401c16602085015263ffffffff808260801c16604086015281841c166060850152818160c01c161515608085015260c81c161515910152565b6000546001600160a01b03163303613e6057565b60405163118cdaa760e01b8152336004820152602490fd5b9081602091031261104057516001600160a01b03811681036110405790565b15613e9e57565b60405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b6044820152606490fd5b5190811515820361104057565b15613ee057565b60405162461bcd60e51b815260206004820152600660248201526521737461747360d01b6044820152606490fd5b91908201809211613f1b57565b634e487b7160e01b600052601160045260246000fd5b15613f3857565b60405162461bcd60e51b815260206004820152600860248201526731b7b7b63237bbb760c11b6044820152606490fd5b15613f6f57565b60405162461bcd60e51b815260206004820152600c60248201526b14dd185d1cc81b1bd8dad95960a21b6044820152606490fd5b6000198114613f1b5760010190565b60ff60025416613fbe57565b60405163d93c066560e01b8152600490fd5b600260015414613fe1576002600155565b604051633ee5aeb560e01b8152600490fd5b15613ffa57565b60405162461bcd60e51b815260206004820152600660248201526521736f6e696360d01b6044820152606490fd5b1561402f57565b60405162461bcd60e51b8152602060048201526006602482015265085c1a5e1b1960d21b6044820152606490fd5b908160a0910312611040578051916020820151916040810151916080606083015192015190565b60ff1660038110156140935790565b634e487b7160e01b600052602160045260246000fd5b9067ffffffffffffffff60401b82549160401b169067ffffffffffffffff60401b1916179055565b805468010000000000000000811015612051576140f391600182018155613cb8565b819291549060031b91821b91600019901b1916179055565b81810292918115918404141715613f1b57565b91908203918211613f1b57565b60011b907001fffffffffffffffffffffffffffffffe6ffffffffffffffffffffffffffffffffe831692168203613f1b57565b3d15614198573d906001600160401b038211612051576040519161418c601f8201601f191660200184613dcf565b82523d6000602084013e565b606090565b519061ffff8216820361104057565b80916101a09283910312611040576040519182018281106001600160401b03821117612051576040526141de8161419d565b82526141ec6020820161419d565b60208301526141fd6040820161419d565b604083015261420e6060820161419d565b606083015261421f6080820161419d565b608083015261423060a0820161419d565b60a083015261424160c0820161419d565b60c083015261425260e0820161419d565b60e083015261010061426581830161419d565b9083015261012061427781830161419d565b9083015261014061428981830161419d565b9083015261016080820151908301526142a6610180809201613ecc565b9082015290565b60018060a01b0380600354169260409283519263342770bf60e01b8452838060049784898301526101a092839160249889915afa908115614539579086929160009161451c575b5092885416806144b2575b50505061ffff908181511660038102908082046003149015171561449e576020820151928084166201fffe9283600196871b16918083046002149015171561448a579061434b91613f0e565b88840151908383831692871b16918083046002149015171561448a579061437191613f0e565b816060850151169081800486148215171561448a579061439091613f0e565b6080840151908383831692871b16918083046002149015171561448a57906143b791613f0e565b8160a0850151169081800486148215171561448a57906143d691613f0e565b610100840151908383831692871b16918083046002149015171561448a576101209161440191613f0e565b930151908116931b16918083046002149015171561447657602993929161442791613f0e565b948051916020830193845281830152815261444181613db4565b51902006605001928360501161446357505060649161445f9161410b565b0490565b601190634e487b7160e01b600052526000fd5b84601188634e487b7160e01b600052526000fd5b8860118c634e487b7160e01b600052526000fd5b85601189634e487b7160e01b600052526000fd5b81908851938480926361ea767f60e01b8252888d8301525afa9182916000936144ed575b50506144e5575b8085916142ff565b9050386144dd565b61450d929350803d10614515575b6145058183613dcf565b8101906141ac565b9038806144d6565b503d6144fb565b6145339150823d8411614515576145058183613dcf565b386142f4565b87513d6000823e3d90fd5b60165481101561456b576000526018602052600660ff60076040600020015460881c161490565b5060009056fea2646970667358221220c22ce6900df22279f7a429ced9f23503c34216de00185fc8297bf6135fb18a6264736f6c63430008140033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000b202d84c760862dadfafbfbf39939dd75c794dff00000000000000000000000075cb5d3dfe1db6dd7ba203ed9c10c0c99d3506280000000000000000000000001132e47cbbdf0f266b11fd65766ada918a388d5d0000000000000000000000006465eacf8d5d123897a6cee5cf4149031533c2fe00000000000000000000000069e1b7157cc53ffc94e585550c946a4ff6c6850e0000000000000000000000007a52bf25bca3b89bb1207de7519f388cdfe0de25

-----Decoded View---------------
Arg [0] : _pixlDogsNFT (address): 0xB202d84c760862DAdFAFbFbf39939DD75c794dfF
Arg [1] : _gameplayMechanics (address): 0x75CB5D3dfe1dB6dD7ba203Ed9C10C0C99d350628
Arg [2] : _boostContract (address): 0x1132E47cbBdF0F266B11FD65766AdA918A388D5D
Arg [3] : _treasuryWallet (address): 0x6465eacF8D5D123897a6cEE5cf4149031533C2fe
Arg [4] : _pixelDogToken (address): 0x69E1b7157Cc53FfC94e585550c946A4fF6C6850E
Arg [5] : _scenarioContract (address): 0x7A52Bf25BcA3B89BB1207De7519f388cDfE0DE25

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000b202d84c760862dadfafbfbf39939dd75c794dff
Arg [1] : 00000000000000000000000075cb5d3dfe1db6dd7ba203ed9c10c0c99d350628
Arg [2] : 0000000000000000000000001132e47cbbdf0f266b11fd65766ada918a388d5d
Arg [3] : 0000000000000000000000006465eacf8d5d123897a6cee5cf4149031533c2fe
Arg [4] : 00000000000000000000000069e1b7157cc53ffc94e585550c946a4ff6c6850e
Arg [5] : 0000000000000000000000007a52bf25bca3b89bb1207de7519f388cdfe0de25


Block Transaction Gas Used Reward
view all blocks ##produced##

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.