More Info
Private Name Tags
ContractCreator
Latest 9 from a total of 9 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Opponents | 41794799 | 594 days ago | IN | 0 POL | 0.06749316 | ||||
Withdraw1155 | 41762836 | 595 days ago | IN | 0 POL | 0.00587813 | ||||
Set Opponents | 41454086 | 603 days ago | IN | 0 POL | 0.04700268 | ||||
Set Opponents | 40987329 | 615 days ago | IN | 0 POL | 0.05724468 | ||||
Set Opponents | 40721388 | 622 days ago | IN | 0 POL | 0.07056468 | ||||
Set Moves | 40719489 | 622 days ago | IN | 0 POL | 0.766924 | ||||
Set Moves | 40719487 | 622 days ago | IN | 0 POL | 4.3220764 | ||||
Set Moves | 40719483 | 622 days ago | IN | 0 POL | 4.2970092 | ||||
Set Trusted Forw... | 40718657 | 622 days ago | IN | 0 POL | 0.00539 |
Loading...
Loading
Contract Name:
PlayToMint
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT /* . . . .cxxo. ;dxxo:cdxxdxxxxxo::dxxc. .ldxxxdxxxxxo' 'oxxxxxxxxxxxl. .cdxxl. .ldxxxxxxo::dxxxxxxxxo:cdxxxxxxxxxd:. . . .OMMX; .dNMMXkONMMMMMMMMXkONMMM0' ;0WMMMWMMWMWKc'cKWMMMMMMMMMW0; ,kWMW0; ;0WMMMMMMXkONMMMMMMMWXkONMMMMMMMMMNx' . . .OMMX; .,,,. ;OWMW0kKWMWXXWMMW0k0WMMMM0'.oXMWXdcccccc:''xNMWWKocccccc:. .cKWMNx. .oXMMXxcccldKWMWXXWWMW0k0WMWOlcccccc;. . . .OMMX: ;ONWWk. .lXWMNOkXWMN0KNWMNOkXWWMMWM0lkWMMW0occcccc,:0WWWNXOlcccccc. .xNMWKc. 'kWMW0; .lXWMNKKNWWXxxXWMMXxcccccc:. . . .OMMX: .oXMMMMO. 'kWMWKk0NMMWNNWMWKk0NMW0ONMM0kXMMMMMMMMMMMWOkWMMMMWMMMMMMMWl.:0WMWk' .cKWMWk' 'kWMMMNNWMW0:'kMMMMMMMMMMMMX; . . .OMMX:,kWMMMMMO,cKWMNOkKWMMMMMMWXOkKWMNx':XMM0ooxxxxxxONMMMNocdxxxxxxx0WMMMXodXMMXo. .xNMMMW0kxclKWMMMMMMWXx. .cxxxxxxkKWMMWO' . . .OMMN0KWMNNWMMX0NMWXkONMMKx0WMM0okNMMKl. ;XMM0:',,. 'xNMWKc..','. ,OWMWKk0WMW0; ;0WMMWWWWXkONMWKxOWMMO;.'''. .cKWMNx' . . .OMMMMMWKloNMMMMMW0kKWMWO, lNMMXXWMWO, ;XMM0kKNNk';0WMWk, lXNNo..lKWMNOkXMMNd. .oXMMXd:::cdKWMWO, cNMMx.oNNNo .dNMMXl. . . .OMMMMWO, :NMMWWXkkXWMXo. lNMMMMMXo. ;XMM0kNMMXOXMWXo. oWMWK0KNMWKkONWMWXdllll;;kWMMWKdlllxXMMXo. cNMWx'dWMW0ollo0WMWO, . . .OMMMXo. :NMMWKk0WMW0; lNMMWW0; ;XMM0kNMMMMMW0; oWMMMMMMN0kKWMMMMMMMMNOkXWMMMMMMMMMMMW0; cNMMx'dWMMMMMMMMWXo. . . .:ooo, .looc;:oooc. 'ooool. .looc:loooooc. ,ooooooo:;coooooooooo:;loooooooooooooc. 'loo;.,oooooooooo; . . .*/ pragma solidity ^0.8.17; import "../Libraries/Assigner.sol"; import "../NFightMatch/NFightMatch.sol"; import "../Libraries/GBM/tokens/IERC1155.sol"; import "../Libraries/GBM/tokens/IERC1155TokenReceiver.sol"; contract PlayToMint is Assigner, NFightMatch { struct Opponent { uint256 tokenId; uint256 packCount; address _contract; uint8 round; } uint16 internal nextMatchId; uint8 internal round; uint256 public windowClose; address public packsAddress; mapping(uint256 => uint256) internal tokenBalance; mapping(address => mapping(uint256 => Opponent)) internal opponents; mapping(address => mapping(bytes => bool)) internal victories; mapping(address => mapping(uint8 => uint8)) internal roundVictoryCount; constructor( address trustedForwarder, address vRFCoordinator, address linkToken, bytes32 keyhash, address nFight, address _packsAddress ) NFightMatch(trustedForwarder, vRFCoordinator, linkToken, keyhash, nFight) { nextMatchId = 1; packsAddress = _packsAddress; } function setOpponents(Opponent[] memory opps, uint256 _windowClose) external onlyOwner { round += 1; windowClose = _windowClose; for (uint8 i = 0; i < opps.length; ) { Opponent memory opp = opps[i]; opponents[opp._contract][opp.tokenId] = opp; unchecked { ++i; } } } function startMatch(address targetContract, uint256 targetTokenId) external onlyForwarder { require(opponents[targetContract][targetTokenId].round == round, "Invalid Opponent"); require(block.timestamp < windowClose, "Window closed"); IForwardRequest.NFT memory nft = _msgNFT(); require(nFighterRegistered(nft.chainId, nft.contractAddress, nft.tokenId), "404"); bytes32 requestId = requestRandomness(keyHash, fee); matchForRandomRequest[requestId] = nextMatchId; matches[nextMatchId] = Match({ id: nextMatchId, challengerContract: nft.contractAddress, challengerTokenId: nft.tokenId, challengerHp: 1000, challengerChainId: nft.chainId, targetContract: targetContract, targetTokenId: targetTokenId, targetHp: 1000, randomness: 0, matchType: MatchType.SinglePlayer, movesCount: 0, nextMoves: bytes("0") }); emit MatchRequested(nextMatchId, requestId, _msgSender()); ++nextMatchId; } function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override { Match storage currentMatch = matches[matchForRandomRequest[requestId]]; currentMatch.randomness = randomness; uint256[] memory nextMoves = expandIndex(currentMatch.randomness, 3); currentMatch.nextMoves = abi.encode(uint8(nextMoves[0]), uint8(nextMoves[1]), uint8(nextMoves[2])); emit MatchReady(currentMatch.id); } function onWin(Match storage _match) internal override { if (victories[_msgSender()][abi.encode(_match.targetContract, _match.targetTokenId)] == false) { victories[_msgSender()][abi.encode(_match.targetContract, _match.targetTokenId)] = true; roundVictoryCount[_msgSender()][round] += 1; if (roundVictoryCount[_msgSender()][round] == 5) { IERC1155(packsAddress).safeTransferFrom(address(this), _msgSender(), 1, 2, ""); } } } function onERC1155Received(address, address, uint256, uint256, bytes memory) public pure returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public pure returns (bytes4) { return this.onERC1155BatchReceived.selector; } function withdraw1155(uint256[] memory batch) external onlyOwner { address[] memory owner; owner[0] = address(this); owner[1] = address(this); owner[2] = address(this); uint256[] memory balances = IERC1155(packsAddress).balanceOfBatch(owner, batch); IERC1155(packsAddress).safeBatchTransferFrom(address(this), msg.sender, batch, balances, ""); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; /** * @dev Standardized event for L2 contracts enables off-chain listeners * to create signatures and perform L1 token transfers. */ abstract contract Assigner { event Assigned(address indexed minter, uint64 indexed tokenId); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol"; import "@0xessential/contracts/fwd/EssentialERC2771Context.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {INFight} from "../Interfaces/NFight/INFight.sol"; contract NFightMatch is AccessControl, EssentialERC2771Context, VRFConsumerBase { using SafeMath for uint256; bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public keyHash; uint256 public fee; event MatchRequested(uint256 matchId, bytes32 requestId, address player); event MatchReady(uint256 matchId); event MovePerformed(uint256 matchId, uint256 hpHit, string moveId); struct WrasslingMove { string id; uint256 impact; uint256 aggressionMultiplier; uint256 powerMultiplier; uint256 speedMultiplier; uint256 resilienceMultiplier; uint256 determinationMultiplier; uint256 awarenessMultiplier; uint256 powerDefenseMultiplier; uint256 speedDefenseMultiplier; uint256 resilienceDefenseMultiplier; uint256 determinationDefenseMultiplier; } mapping(uint256 => WrasslingMove) internal moves; uint8 private movesCount; enum MatchType { SinglePlayer, HeadToHead } struct Match { address challengerContract; uint256 challengerTokenId; uint16 challengerHp; uint256 challengerChainId; address targetContract; uint256 targetTokenId; uint16 targetHp; uint16 id; uint256 randomness; MatchType matchType; uint16 movesCount; bytes nextMoves; } mapping(bytes32 => uint256) internal matchForRandomRequest; mapping(uint256 => Match) public matches; INFight public nFight; constructor( address trustedForwarder, address vRFCoordinator, address linkToken, bytes32 _keyhash, address _nFight ) VRFConsumerBase(vRFCoordinator, linkToken) EssentialERC2771Context(trustedForwarder) { keyHash = _keyhash; fee = 0.0001 * 10**18; nFight = INFight(_nFight); _setupRole(ADMIN_ROLE, msg.sender); _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); } function setNFight(address nFightAddress) public onlyRole(ADMIN_ROLE) { nFight = INFight(nFightAddress); } function setMoves(WrasslingMove[] memory _moves) public onlyRole(ADMIN_ROLE) { uint256 startIndex = movesCount; uint8 newMoves = uint8(_moves.length); for (uint256 index = 0; index < newMoves; ) { moves[startIndex + index] = _moves[index]; unchecked { ++index; } } movesCount += newMoves; } function resetMoves() public onlyRole(ADMIN_ROLE) { movesCount = 0; } function calculateMove( WrasslingMove memory move, INFight.Fighter memory performer, INFight.Fighter memory defender, uint256 luckSeed ) internal pure returns (uint256 hpHit) { hpHit = move.impact.add(100); hpHit = hpHit.add(move.aggressionMultiplier.mul(performer.aggression).div(400)); hpHit = hpHit.add(move.powerMultiplier.mul(performer.power).div(400)); hpHit = hpHit.add(move.speedMultiplier.mul(performer.speed).div(400)); hpHit = hpHit.add(move.resilienceMultiplier.mul(performer.resilience).div(400)); hpHit = hpHit.add(move.determinationMultiplier.mul(performer.determination).div(400)); uint256 hpSub = 0; hpSub = hpSub.add(move.awarenessMultiplier.mul(defender.awareness).div(400)); hpSub = hpSub.add(move.powerDefenseMultiplier.mul(defender.power).div(400)); hpSub = hpSub.add(move.speedDefenseMultiplier.mul(defender.speed).div(400)); hpSub = hpSub.add(move.resilienceDefenseMultiplier.mul(defender.resilience).div(400)); hpSub = hpSub.add(move.determinationDefenseMultiplier.mul(defender.determination).div(400)); hpHit = hpHit > hpSub ? hpHit.sub(hpSub) : 0; uint256 luckAdjust = luckSeed.mod(30); if (luckAdjust >= 15) { hpHit = hpHit.add(luckAdjust.sub(15)); } if (luckAdjust < 15) { hpHit = hpHit > luckAdjust ? hpHit.sub(luckAdjust) : 0; } return hpHit; } function allGt(uint256[] memory elements, uint256 limit) internal pure returns (bool) { for (uint256 index = 0; index < elements.length; index++) { if (elements[index] <= limit) { return false; } } return true; } function performSinglePlayerTurn(uint8 moveIndex, uint256 matchId) external onlyForwarder { Match storage currentMatch = matches[matchId]; IForwardRequest.NFT memory nft = _msgNFT(); require( nft.contractAddress == currentMatch.challengerContract && nft.tokenId == currentMatch.challengerTokenId, "401" ); uint256[] memory moveIdxs = expandIndex(currentMatch.randomness, 4); uint256[] memory moveSeeds = expand(currentMatch.randomness, 2); INFight.Fighter memory player = makeWrassler( nft.chainId, currentMatch.challengerContract, currentMatch.challengerTokenId ); INFight.Fighter memory cpu = makeWrassler( block.chainid == 137 ? 1 : 5, currentMatch.targetContract, currentMatch.targetTokenId ); uint8[3] memory moveIndexes = abi.decode(currentMatch.nextMoves, (uint8[3])); WrasslingMove memory attack = moves[moveIndexes[moveIndex]]; uint256 hpHit = calculateMove(attack, player, cpu, moveSeeds[0]); emit MovePerformed(matchId, hpHit, attack.id); if (currentMatch.targetHp <= hpHit) { currentMatch.targetHp = 0; onWin(currentMatch); currentMatch.movesCount += 1; return; } currentMatch.targetHp -= uint16(hpHit); WrasslingMove memory cpuAttack = moves[moveIdxs[0]]; uint256 playerHpHit = calculateMove(cpuAttack, cpu, player, moveSeeds[1]); emit MovePerformed(matchId, playerHpHit, cpuAttack.id); if (currentMatch.challengerHp <= playerHpHit) { currentMatch.challengerHp = 0; onLoss(currentMatch); nFight.reportLoss(_msgSender()); currentMatch.movesCount += 2; return; } currentMatch.challengerHp -= uint16(playerHpHit); currentMatch.nextMoves = abi.encode(uint8(moveIdxs[1]), uint8(moveIdxs[2]), uint8(moveIdxs[3])); currentMatch.movesCount += 2; } function onWin(Match storage _match) internal virtual { nFight.reportWin(_msgSender(), _match.targetContract, _match.targetTokenId); } function onLoss(Match storage _match) internal virtual { nFight.reportLoss(_msgSender()); } /** * Callback function used by VRF Coordinator */ function fulfillRandomness(bytes32 requestId, uint256 randomness) internal virtual override {} function expand(uint256 randomValue, uint256 n) internal view returns (uint256[] memory expandedValues) { expandedValues = new uint256[](n); for (uint256 i = 0; i < n; i++) { expandedValues[i] = uint256(keccak256(abi.encode(randomValue, i, block.timestamp))); } return expandedValues; } function expandIndex(uint256 randomValue, uint256 n) internal view returns (uint256[] memory expandedValues) { expandedValues = new uint256[](n); for (uint256 i = 0; i < n; i++) { expandedValues[i] = uint256(keccak256(abi.encode(randomValue, i, block.timestamp))) % movesCount; } return expandedValues; } function nFighterRegistered( uint256 chainId, address contractAddress, uint256 tokenId ) internal view returns (bool) { (uint256 stat, , , , , ) = nFight.getFighter(contractAddress, tokenId, chainId); return stat > 0; } function makeWrassler( uint256 chainId, address contractAddress, uint256 _tokenId ) internal view returns (INFight.Fighter memory) { ( uint16 aggression, uint16 awareness, uint16 determination, uint16 resilience, uint16 speed, uint16 power ) = nFight.getFighter(contractAddress, _tokenId, chainId); require(power != 0, "WM:mW:404"); INFight.Fighter memory wrassler = INFight.Fighter({ power: power, speed: speed, aggression: aggression, determination: determination, resilience: resilience, awareness: awareness }); return wrassler; } function withdrawToken(address _tokenContract, uint256 _amount) public onlyRole(ADMIN_ROLE) { IERC20 tokenContract = IERC20(_tokenContract); tokenContract.transfer(_msgSender(), _amount); } function _msgData() internal view override(Context, EssentialERC2771Context) returns (bytes calldata) { return EssentialERC2771Context._msgData(); } function _msgSender() internal view override(Context, EssentialERC2771Context) returns (address sender) { return EssentialERC2771Context._msgSender(); } }
// SPDX-License-Identifier: CC0-1.0 pragma solidity ^0.8.17; /// @title ERC-1155 Multi Token Standard /// @dev ee https://eips.ethereum.org/EIPS/eip-1155 /// The ERC-165 identifier for this interface is 0xd9b67a26. /* is ERC165 */ interface IERC1155 { /** @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). The `_operator` argument MUST be the address of an account/contract that is approved to make the transfer (SHOULD be msg.sender). The `_from` argument MUST be the address of the holder whose balance is decreased. The `_to` argument MUST be the address of the recipient whose balance is increased. The `_id` argument MUST be the token type being transferred. The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the recipient balance is increased by. When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). */ event TransferSingle( address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value ); /** @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). The `_operator` argument MUST be the address of an account/contract that is approved to make the transfer (SHOULD be msg.sender). The `_from` argument MUST be the address of the holder whose balance is decreased. The `_to` argument MUST be the address of the recipient whose balance is increased. The `_ids` argument MUST be the list of tokens being transferred. The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified in _ids) the holder balance is decreased by and match what the recipient balance is increased by. When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). */ event TransferBatch( address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values ); /** @dev MUST emit when approval for a second party/operator address to manage all tokens for an owner address is enabled or disabled (absence of an event assumes disabled). */ event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); /** @dev MUST emit when the URI is updated for a token ID. URIs are defined in RFC 3986. The URI MUST point to a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema". */ event URI(string _value, uint256 indexed _id); /** @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if balance of holder for token `_id` is lower than the `_value` sent. MUST revert on any other error. MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard). After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _id ID of the token type @param _value Transfer amount @param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to` */ function safeTransferFrom( address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data ) external; /** @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if length of `_ids` is not the same as length of `_values`. MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient. MUST revert on any other error. MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard). Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc). After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _ids IDs of each token type (order and length must match _values array) @param _values Transfer amounts per token type (order and length must match _ids array) @param _data Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to` */ function safeBatchTransferFrom( address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data ) external; /** @notice Get the balance of an account's tokens. @param _owner The address of the token holder @param _id ID of the token @return The _owner's balance of the token type requested */ function balanceOf(address _owner, uint256 _id) external view returns (uint256); /** @notice Get the balance of multiple account/token pairs @param _owners The addresses of the token holders @param _ids ID of the tokens @return The _owner's balance of the token types requested (i.e. balance for each (owner, id) pair) */ function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory); /** @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens. @dev MUST emit the ApprovalForAll event on success. @param _operator Address to add to the set of authorized operators @param _approved True if the operator is approved, false to revoke approval */ function setApprovalForAll(address _operator, bool _approved) external; /** @notice Queries the approval status of an operator for a given owner. @param _owner The owner of the tokens @param _operator Address of authorized operator @return True if the operator is approved, false if not */ function isApprovedForAll(address _owner, address _operator) external view returns (bool); }
// SPDX-License-Identifier: CC0-1.0 pragma solidity ^0.8.17; /** Note: The ERC-165 identifier for this interface is 0x4e2312e0. */ interface IERC1155TokenReceiver { /** @notice Handle the receipt of a single ERC1155 token type. @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated. This function MUST return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61) if it accepts the transfer. This function MUST revert if it rejects the transfer. Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller. @param _operator The address which initiated the transfer (i.e. msg.sender) @param _from The address which previously owned the token @param _id The ID of the token being transferred @param _value The amount of tokens being transferred @param _data Additional data with no specified format @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` */ function onERC1155Received( address _operator, address _from, uint256 _id, uint256 _value, bytes calldata _data ) external returns (bytes4); /** @notice Handle the receipt of multiple ERC1155 token types. @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeBatchTransferFrom` after the balances have been updated. This function MUST return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81) if it accepts the transfer(s). This function MUST revert if it rejects the transfer(s). Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller. @param _operator The address which initiated the batch transfer (i.e. msg.sender) @param _from The address which previously owned the token @param _ids An array containing ids of each token being transferred (order and length must match _values array) @param _values An array containing amounts of each token being transferred (order and length must match _ids array) @param _data Additional data with no specified format @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` */ function onERC1155BatchReceived( address _operator, address _from, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/LinkTokenInterface.sol"; import "./VRFRequestIDBase.sol"; /** **************************************************************************** * @notice Interface for contracts using VRF randomness * ***************************************************************************** * @dev PURPOSE * * @dev Reggie the Random Oracle (not his real job) wants to provide randomness * @dev to Vera the verifier in such a way that Vera can be sure he's not * @dev making his output up to suit himself. Reggie provides Vera a public key * @dev to which he knows the secret key. Each time Vera provides a seed to * @dev Reggie, he gives back a value which is computed completely * @dev deterministically from the seed and the secret key. * * @dev Reggie provides a proof by which Vera can verify that the output was * @dev correctly computed once Reggie tells it to her, but without that proof, * @dev the output is indistinguishable to her from a uniform random sample * @dev from the output space. * * @dev The purpose of this contract is to make it easy for unrelated contracts * @dev to talk to Vera the verifier about the work Reggie is doing, to provide * @dev simple access to a verifiable source of randomness. * ***************************************************************************** * @dev USAGE * * @dev Calling contracts must inherit from VRFConsumerBase, and can * @dev initialize VRFConsumerBase's attributes in their constructor as * @dev shown: * * @dev contract VRFConsumer { * @dev constructor(<other arguments>, address _vrfCoordinator, address _link) * @dev VRFConsumerBase(_vrfCoordinator, _link) public { * @dev <initialization with other arguments goes here> * @dev } * @dev } * * @dev The oracle will have given you an ID for the VRF keypair they have * @dev committed to (let's call it keyHash), and have told you the minimum LINK * @dev price for VRF service. Make sure your contract has sufficient LINK, and * @dev call requestRandomness(keyHash, fee, seed), where seed is the input you * @dev want to generate randomness from. * * @dev Once the VRFCoordinator has received and validated the oracle's response * @dev to your request, it will call your contract's fulfillRandomness method. * * @dev The randomness argument to fulfillRandomness is the actual random value * @dev generated from your seed. * * @dev The requestId argument is generated from the keyHash and the seed by * @dev makeRequestId(keyHash, seed). If your contract could have concurrent * @dev requests open, you can use the requestId to track which seed is * @dev associated with which randomness. See VRFRequestIDBase.sol for more * @dev details. (See "SECURITY CONSIDERATIONS" for principles to keep in mind, * @dev if your contract could have multiple requests in flight simultaneously.) * * @dev Colliding `requestId`s are cryptographically impossible as long as seeds * @dev differ. (Which is critical to making unpredictable randomness! See the * @dev next section.) * * ***************************************************************************** * @dev SECURITY CONSIDERATIONS * * @dev A method with the ability to call your fulfillRandomness method directly * @dev could spoof a VRF response with any random value, so it's critical that * @dev it cannot be directly called by anything other than this base contract * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method). * * @dev For your users to trust that your contract's random behavior is free * @dev from malicious interference, it's best if you can write it so that all * @dev behaviors implied by a VRF response are executed *during* your * @dev fulfillRandomness method. If your contract must store the response (or * @dev anything derived from it) and use it later, you must ensure that any * @dev user-significant behavior which depends on that stored value cannot be * @dev manipulated by a subsequent VRF request. * * @dev Similarly, both miners and the VRF oracle itself have some influence * @dev over the order in which VRF responses appear on the blockchain, so if * @dev your contract could have multiple VRF requests in flight simultaneously, * @dev you must ensure that the order in which the VRF responses arrive cannot * @dev be used to manipulate your contract's user-significant behavior. * * @dev Since the ultimate input to the VRF is mixed with the block hash of the * @dev block in which the request is made, user-provided seeds have no impact * @dev on its economic security properties. They are only included for API * @dev compatability with previous versions of this contract. * * @dev Since the block hash of the block which contains the requestRandomness * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful * @dev miner could, in principle, fork the blockchain to evict the block * @dev containing the request, forcing the request to be included in a * @dev different block with a different hash, and therefore a different input * @dev to the VRF. However, such an attack would incur a substantial economic * @dev cost. This cost scales with the number of blocks the VRF oracle waits * @dev until it calls responds to a request. */ abstract contract VRFConsumerBase is VRFRequestIDBase { /** * @notice fulfillRandomness handles the VRF response. Your contract must * @notice implement it. See "SECURITY CONSIDERATIONS" above for important * @notice principles to keep in mind when implementing your fulfillRandomness * @notice method. * * @dev VRFConsumerBase expects its subcontracts to have a method with this * @dev signature, and will call it once it has verified the proof * @dev associated with the randomness. (It is triggered via a call to * @dev rawFulfillRandomness, below.) * * @param requestId The Id initially returned by requestRandomness * @param randomness the VRF output */ function fulfillRandomness(bytes32 requestId, uint256 randomness) internal virtual; /** * @dev In order to keep backwards compatibility we have kept the user * seed field around. We remove the use of it because given that the blockhash * enters later, it overrides whatever randomness the used seed provides. * Given that it adds no security, and can easily lead to misunderstandings, * we have removed it from usage and can now provide a simpler API. */ uint256 private constant USER_SEED_PLACEHOLDER = 0; /** * @notice requestRandomness initiates a request for VRF output given _seed * * @dev The fulfillRandomness method receives the output, once it's provided * @dev by the Oracle, and verified by the vrfCoordinator. * * @dev The _keyHash must already be registered with the VRFCoordinator, and * @dev the _fee must exceed the fee specified during registration of the * @dev _keyHash. * * @dev The _seed parameter is vestigial, and is kept only for API * @dev compatibility with older versions. It can't *hurt* to mix in some of * @dev your own randomness, here, but it's not necessary because the VRF * @dev oracle will mix the hash of the block containing your request into the * @dev VRF seed it ultimately uses. * * @param _keyHash ID of public key against which randomness is generated * @param _fee The amount of LINK to send with the request * * @return requestId unique ID for this request * * @dev The returned requestId can be used to distinguish responses to * @dev concurrent requests. It is passed as the first argument to * @dev fulfillRandomness. */ function requestRandomness(bytes32 _keyHash, uint256 _fee) internal returns (bytes32 requestId) { LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, USER_SEED_PLACEHOLDER)); // This is the seed passed to VRFCoordinator. The oracle will mix this with // the hash of the block containing this request to obtain the seed/input // which is finally passed to the VRF cryptographic machinery. uint256 vRFSeed = makeVRFInputSeed(_keyHash, USER_SEED_PLACEHOLDER, address(this), nonces[_keyHash]); // nonces[_keyHash] must stay in sync with // VRFCoordinator.nonces[_keyHash][this], which was incremented by the above // successful LINK.transferAndCall (in VRFCoordinator.randomnessRequest). // This provides protection against the user repeating their input seed, // which would result in a predictable/duplicate output, if multiple such // requests appeared in the same block. nonces[_keyHash] = nonces[_keyHash] + 1; return makeRequestId(_keyHash, vRFSeed); } LinkTokenInterface internal immutable LINK; address private immutable vrfCoordinator; // Nonces for each VRF key from which randomness has been requested. // // Must stay in sync with VRFCoordinator[_keyHash][this] mapping(bytes32 => uint256) /* keyHash */ /* nonce */ private nonces; /** * @param _vrfCoordinator address of VRFCoordinator contract * @param _link address of LINK token contract * * @dev https://docs.chain.link/docs/link-token-contracts */ constructor(address _vrfCoordinator, address _link) { vrfCoordinator = _vrfCoordinator; LINK = LinkTokenInterface(_link); } // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF // proof. rawFulfillRandomness then calls fulfillRandomness, after validating // the origin of the call function rawFulfillRandomness(bytes32 requestId, uint256 randomness) external { require(msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill"); fulfillRandomness(requestId, randomness); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/utils/Context.sol"; import "./IForwardRequest.sol"; /** * @dev Context variant with ERC2771 support. */ abstract contract EssentialERC2771Context is Context { address private _trustedForwarder; address public owner; modifier onlyOwner() { require(msg.sender == owner, "403"); _; } modifier onlyForwarder() { require(isTrustedForwarder(msg.sender), "EssentialContext:429"); _; } constructor(address trustedForwarder) { owner = msg.sender; _trustedForwarder = trustedForwarder; } function setTrustedForwarder(address trustedForwarder) external onlyOwner { _trustedForwarder = trustedForwarder; } function isTrustedForwarder(address forwarder) public view virtual returns (bool) { return forwarder == _trustedForwarder; } function _msgSender() internal view virtual override returns (address sender) { if (isTrustedForwarder(msg.sender)) { // The assembly code is more direct than the Solidity version using `abi.decode`. assembly { sender := shr(0x60, calldataload(sub(calldatasize(), 20))) } } else { return super._msgSender(); } } function _msgData() internal view virtual override returns (bytes calldata) { if (isTrustedForwarder(msg.sender)) { return msg.data[:msg.data.length - 72]; } else { return super._msgData(); } } function _msgNFT() internal view returns (IForwardRequest.NFT memory) { uint256 chainId; uint256 tokenId; address contractAddress; if (isTrustedForwarder(msg.sender)) { assembly { chainId := calldataload(sub(calldatasize(), 104)) contractAddress := shr(0x60, calldataload(sub(calldatasize(), 40))) tokenId := calldataload(sub(calldatasize(), 72)) } } return IForwardRequest.NFT({contractAddress: contractAddress, tokenId: tokenId, chainId: chainId}); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) 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 `amount` 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 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @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); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; interface INFight { struct Fighter { uint16 aggression; uint16 awareness; uint16 determination; uint16 power; uint16 resilience; uint16 speed; } function getFighter( address contractAddress, uint256 _tokenId, uint256 chainId ) external view returns ( uint16 power, uint16 speed, uint16 aggression, uint16 determination, uint16 resilience, uint16 awareness ); function reportWin( address player, address targetContract, uint256 tokenId ) external; function reportLoss(address player) external; function registerPolygonNFT( address contractAddress, uint256 tokenId, address owner ) external; function registerToken(address contractAddress, uint256 tokenId) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface LinkTokenInterface { function allowance(address owner, address spender) external view returns (uint256 remaining); function approve(address spender, uint256 value) external returns (bool success); function balanceOf(address owner) external view returns (uint256 balance); function decimals() external view returns (uint8 decimalPlaces); function decreaseApproval(address spender, uint256 addedValue) external returns (bool success); function increaseApproval(address spender, uint256 subtractedValue) external; function name() external view returns (string memory tokenName); function symbol() external view returns (string memory tokenSymbol); function totalSupply() external view returns (uint256 totalTokensIssued); function transfer(address to, uint256 value) external returns (bool success); function transferAndCall( address to, uint256 value, bytes calldata data ) external returns (bool success); function transferFrom( address from, address to, uint256 value ) external returns (bool success); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract VRFRequestIDBase { /** * @notice returns the seed which is actually input to the VRF coordinator * * @dev To prevent repetition of VRF output due to repetition of the * @dev user-supplied seed, that seed is combined in a hash with the * @dev user-specific nonce, and the address of the consuming contract. The * @dev risk of repetition is mostly mitigated by inclusion of a blockhash in * @dev the final seed, but the nonce does protect against repetition in * @dev requests which are included in a single block. * * @param _userSeed VRF seed input provided by user * @param _requester Address of the requesting contract * @param _nonce User-specific nonce at the time of the request */ function makeVRFInputSeed( bytes32 _keyHash, uint256 _userSeed, address _requester, uint256 _nonce ) internal pure returns (uint256) { return uint256(keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce))); } /** * @notice Returns the id for this request * @param _keyHash The serviceAgreement ID to be used for this request * @param _vRFInputSeed The seed to be passed directly to the VRF * @return The id for this request * * @dev Note that _vRFInputSeed is not the seed passed by the consuming * @dev contract, but the one generated by makeVRFInputSeed */ function makeRequestId(bytes32 _keyHash, uint256 _vRFInputSeed) internal pure returns (bytes32) { return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @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; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; interface IForwardRequest { struct ERC721ForwardRequest { address from; // Externally-owned account (EOA) signing the request. address authorizer; // Externally-owned account (EOA) that authorized from account in PlaySession. address to; // Destination address, normally a smart contract for an nFight game. address nftContract; // The address of the NFT contract for the token being used. uint256 nftTokenId; // The tokenId of the NFT being used uint256 nftChainId; // The chainId of the NFT neing used uint256 targetChainId; // The chainId where the Forwarder and implementation contract are deployed. uint256 value; // Amount of ether to transfer to the destination. uint256 gas; // Amount of gas limit to set for the execution. uint256 nonce; // On-chain tracked nonce of a transaction. bytes data; // (Call)data to be sent to the destination. } struct MetaTransaction { uint256 nonce; address from; bytes functionSignature; } struct PlaySession { address authorized; // Burner EOA that is authorized to play with NFTs by owner EOA. uint256 expiresAt; // block timestamp when the session is invalidated. } struct NFT { address contractAddress; uint256 tokenId; uint256 chainId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"trustedForwarder","type":"address"},{"internalType":"address","name":"vRFCoordinator","type":"address"},{"internalType":"address","name":"linkToken","type":"address"},{"internalType":"bytes32","name":"keyhash","type":"bytes32"},{"internalType":"address","name":"nFight","type":"address"},{"internalType":"address","name":"_packsAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":true,"internalType":"uint64","name":"tokenId","type":"uint64"}],"name":"Assigned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"matchId","type":"uint256"}],"name":"MatchReady","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"matchId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"requestId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"player","type":"address"}],"name":"MatchRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"matchId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"hpHit","type":"uint256"},{"indexed":false,"internalType":"string","name":"moveId","type":"string"}],"name":"MovePerformed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"keyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"matches","outputs":[{"internalType":"address","name":"challengerContract","type":"address"},{"internalType":"uint256","name":"challengerTokenId","type":"uint256"},{"internalType":"uint16","name":"challengerHp","type":"uint16"},{"internalType":"uint256","name":"challengerChainId","type":"uint256"},{"internalType":"address","name":"targetContract","type":"address"},{"internalType":"uint256","name":"targetTokenId","type":"uint256"},{"internalType":"uint16","name":"targetHp","type":"uint16"},{"internalType":"uint16","name":"id","type":"uint16"},{"internalType":"uint256","name":"randomness","type":"uint256"},{"internalType":"enum NFightMatch.MatchType","name":"matchType","type":"uint8"},{"internalType":"uint16","name":"movesCount","type":"uint16"},{"internalType":"bytes","name":"nextMoves","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nFight","outputs":[{"internalType":"contract INFight","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"packsAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"moveIndex","type":"uint8"},{"internalType":"uint256","name":"matchId","type":"uint256"}],"name":"performSinglePlayerTurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resetMoves","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"id","type":"string"},{"internalType":"uint256","name":"impact","type":"uint256"},{"internalType":"uint256","name":"aggressionMultiplier","type":"uint256"},{"internalType":"uint256","name":"powerMultiplier","type":"uint256"},{"internalType":"uint256","name":"speedMultiplier","type":"uint256"},{"internalType":"uint256","name":"resilienceMultiplier","type":"uint256"},{"internalType":"uint256","name":"determinationMultiplier","type":"uint256"},{"internalType":"uint256","name":"awarenessMultiplier","type":"uint256"},{"internalType":"uint256","name":"powerDefenseMultiplier","type":"uint256"},{"internalType":"uint256","name":"speedDefenseMultiplier","type":"uint256"},{"internalType":"uint256","name":"resilienceDefenseMultiplier","type":"uint256"},{"internalType":"uint256","name":"determinationDefenseMultiplier","type":"uint256"}],"internalType":"struct NFightMatch.WrasslingMove[]","name":"_moves","type":"tuple[]"}],"name":"setMoves","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nFightAddress","type":"address"}],"name":"setNFight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"packCount","type":"uint256"},{"internalType":"address","name":"_contract","type":"address"},{"internalType":"uint8","name":"round","type":"uint8"}],"internalType":"struct PlayToMint.Opponent[]","name":"opps","type":"tuple[]"},{"internalType":"uint256","name":"_windowClose","type":"uint256"}],"name":"setOpponents","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"trustedForwarder","type":"address"}],"name":"setTrustedForwarder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"targetContract","type":"address"},{"internalType":"uint256","name":"targetTokenId","type":"uint256"}],"name":"startMatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"windowClose","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"batch","type":"uint256[]"}],"name":"withdraw1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenContract","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c06040523480156200001157600080fd5b50604051620037b3380380620037b383398101604081905262000034916200023c565b60028054336001600160a01b031991821681179092556001805482166001600160a01b038a81169190911790915587811660a0528681166080526004869055655af3107a4000600555600a805490921690851617905586908690869086908690620000c1907fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217759062000115565b620000ce60003362000115565b5050600a805461ffff60a01b1916600160a01b1790555050600c80546001600160a01b039093166001600160a01b03199093169290921790915550620002b4945050505050565b62000121828262000125565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000121576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905562000183620001c7565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000620001de620001e360201b620018071760201c565b905090565b6001546000906001600160a01b0316330362000206575060131936013560601c90565b620001de6200021b60201b620018331760201c565b3390565b80516001600160a01b03811681146200023757600080fd5b919050565b60008060008060008060c087890312156200025657600080fd5b62000261876200021f565b955062000271602088016200021f565b945062000281604088016200021f565b93506060870151925062000298608088016200021f565b9150620002a860a088016200021f565b90509295509295509295565b60805160a0516134d2620002e160003960008181610c6001526119890152600061195a01526134d26000f3fe608060405234801561001057600080fd5b50600436106101c35760003560e01c806391d14854116100f9578063d547741f11610097578063dca721d511610071578063dca721d514610401578063dd6e90af14610414578063ddca3f4314610427578063f23a6e611461043057600080fd5b8063d547741f146103c8578063d5d719a5146103db578063da742228146103ee57600080fd5b80639e281a98116100d35780639e281a981461036d578063a217fddf14610380578063bc197c8114610388578063c876715c146103c057600080fd5b806391d148541461033457806394985ddd146103475780639b649aed1461035a57600080fd5b80634408103b1161016657806361728f391161014057806361728f39146102fa5780636c33300d1461030357806375b238fc1461030c5780638da5cb5b1461032157600080fd5b80634408103b1461029a5780634768d4ef146102ad578063572b6c05146102d857600080fd5b8063248a9ca3116101a2578063248a9ca31461023057806329d6a2d1146102615780632f2ff15d1461027457806336568abe1461028757600080fd5b8062907c52146101c857806301ffc9a7146101dd5780630a50590d14610205575b600080fd5b6101db6101d63660046127fd565b61044f565b005b6101f06101eb366004612831565b6105f7565b60405190151581526020015b60405180910390f35b600c54610218906001600160a01b031681565b6040516001600160a01b0390911681526020016101fc565b61025361023e36600461285b565b60009081526020819052604090206001015490565b6040519081526020016101fc565b6101db61026f366004612890565b61062e565b6101db6102823660046128ba565b610a25565b6101db6102953660046128ba565b610a57565b6101db6102a83660046128e6565b610ae5565b6102c06102bb36600461285b565b610b23565b6040516101fc9c9b9a99989796959493929190612967565b6101f06102e63660046128e6565b6001546001600160a01b0391821691161490565b61025360045481565b610253600b5481565b61025360008051602061347d83398151915281565b600254610218906001600160a01b031681565b6101f06103423660046128ba565b610c2c565b6101db610355366004612a14565b610c55565b6101db610368366004612a45565b610cd7565b6101db61037b366004612890565b61147e565b610253600081565b6103a7610396366004612ad2565b63bc197c8160e01b95945050505050565b6040516001600160e01b031990911681526020016101fc565b6101db611529565b6101db6103d63660046128ba565b611551565b6101db6103e9366004612b7b565b611579565b6101db6103fc3660046128e6565b6116ab565b600a54610218906001600160a01b031681565b6101db610422366004612ce6565b6116f7565b61025360055481565b6103a761043e366004612dc6565b63f23a6e6160e01b95945050505050565b6002546001600160a01b031633146104825760405162461bcd60e51b815260040161047990612e2a565b60405180910390fd5b6060308160008151811061049857610498612e47565b60200260200101906001600160a01b031690816001600160a01b03168152505030816001815181106104cc576104cc612e47565b60200260200101906001600160a01b031690816001600160a01b031681525050308160028151811061050057610500612e47565b6001600160a01b039283166020918202929092010152600c546040516313849cfd60e21b81526000929190911690634e1273f4906105449085908790600401612e98565b600060405180830381865afa158015610561573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105899190810190612ef8565b600c54604051631759616b60e11b81529192506001600160a01b031690632eb2c2d6906105c0903090339088908790600401612f88565b600060405180830381600087803b1580156105da57600080fd5b505af11580156105ee573d6000803e3d6000fd5b50505050505050565b60006001600160e01b03198216637965db0b60e01b148061062857506301ffc9a760e01b6001600160e01b03198316145b92915050565b6001546001600160a01b0316331461067f5760405162461bcd60e51b8152602060048201526014602482015273457373656e7469616c436f6e746578743a34323960601b6044820152606401610479565b600a546001600160a01b0383166000908152600e60209081526040808320858452909152902060020154600160a01b900460ff908116600160b01b90920416146106fe5760405162461bcd60e51b815260206004820152601060248201526f125b9d985b1a590813dc1c1bdb995b9d60821b6044820152606401610479565b600b54421061073f5760405162461bcd60e51b815260206004820152600d60248201526c15da5b991bddc818db1bdcd959609a1b6044820152606401610479565b6000610749611837565b90506107628160400151826000015183602001516118c2565b6107945760405162461bcd60e51b81526020600482015260036024820152620d0c0d60ea1b6044820152606401610479565b60006107a4600454600554611956565b600a8054600083815260086020908152604080832061ffff600160a01b95869004811690915581516101808101835289516001600160a01b0390811682528a850151948201949094526103e8818401819052928a01516060820152928b16608084015260a083018a905260c083019190915293549290920490921660e082015261010081018290529192506101208201908152600060208083018290526040805180820182526001808252600360fc1b8285015294820152600a5461ffff600160a01b909104811684526009835292819020855181546001600160a01b03199081166001600160a01b0392831617835593870151828701559186015160028201805461ffff191691861691909117905560608601516003820155608086015160048201805490941692169190911790915560a0840151600582015560c084015160068201805460e087015192851663ffffffff199091161762010000929094169190910292909217909155610100830151600782015561012083015160088201805492939192909160ff1990911690838181111561094457610944612901565b021790555061014082015160088201805461ffff9092166101000262ffff00199092169190911790556101608201516009820190610982908261306b565b5050600a547f8ca4bc79eaadabb16e050d23e879138dac0ff429f81d86b41be6e471443220349150600160a01b900461ffff16826109be611ada565b6040805161ffff909416845260208401929092526001600160a01b03169082015260600160405180910390a1600a8054601490610a0590600160a01b900461ffff16613140565b91906101000a81548161ffff021916908361ffff16021790555050505050565b600082815260208190526040902060010154610a4881610a43611ada565b611ae4565b610a528383611b48565b505050565b610a5f611ada565b6001600160a01b0316816001600160a01b031614610ad75760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610479565b610ae18282611bcd565b5050565b60008051602061347d833981519152610b0081610a43611ada565b50600a80546001600160a01b0319166001600160a01b0392909216919091179055565b600960208190526000918252604090912080546001820154600283015460038401546004850154600586015460068701546007880154600889015499890180546001600160a01b03998a169b989a61ffff9889169a9799969097169794968486169662010000909504861695939460ff81169461010090910416929091610ba990612fe3565b80601f0160208091040260200160405190810160405280929190818152602001828054610bd590612fe3565b8015610c225780601f10610bf757610100808354040283529160200191610c22565b820191906000526020600020905b815481529060010190602001808311610c0557829003601f168201915b505050505090508c565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610ccd5760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610479565b610ae18282611c50565b6001546001600160a01b03163314610d285760405162461bcd60e51b8152602060048201526014602482015273457373656e7469616c436f6e746578743a34323960601b6044820152606401610479565b600081815260096020526040812090610d3f611837565b825481519192506001600160a01b039182169116148015610d67575081600101548160200151145b610d995760405162461bcd60e51b815260206004820152600360248201526234303160e81b6044820152606401610479565b6000610daa83600701546004611d63565b90506000610dbd84600701546002611e30565b604084015185546001870154929350600092610de392916001600160a01b031690611ee3565b90506000610e2146608914610df9576005610dfc565b60015b60ff168760040160009054906101000a90046001600160a01b03168860050154611ee3565b90506000866009018054610e3490612fe3565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6090612fe3565b8015610ead5780601f10610e8257610100808354040283529160200191610ead565b820191906000526020600020905b815481529060010190602001808311610e9057829003601f168201915b5050505050806020019051810190610ec59190613161565b9050600060066000838c60ff1660038110610ee257610ee2612e47565b602002015160ff16815260200190815260200160002060405180610180016040529081600082018054610f1490612fe3565b80601f0160208091040260200160405190810160405280929190818152602001828054610f4090612fe3565b8015610f8d5780601f10610f6257610100808354040283529160200191610f8d565b820191906000526020600020905b815481529060010190602001808311610f7057829003601f168201915b50505050508152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820154815250509050600061102e8286868960008151811061102157611021612e47565b602002602001015161202d565b90507f7202a69f4a5815b4fd765367e2877e0f6401878de7a35d2ab1b397fc0d9e343b8a828460000151604051611067939291906131e7565b60405180910390a1600689015461ffff1681106110dd5760068901805461ffff1916905561109489612270565b60018960080160018282829054906101000a900461ffff166110b6919061320f565b92506101000a81548161ffff021916908361ffff1602179055505050505050505050505050565b6006890180548291906000906110f890849061ffff1661322a565b92506101000a81548161ffff021916908361ffff1602179055506000600660008960008151811061112b5761112b612e47565b602002602001015181526020019081526020016000206040518061018001604052908160008201805461115d90612fe3565b80601f016020809104026020016040519081016040528092919081815260200182805461118990612fe3565b80156111d65780601f106111ab576101008083540402835291602001916111d6565b820191906000526020600020905b8154815290600101906020018083116111b957829003601f168201915b50505050508152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820154815250509050600061126a8287898b60018151811061102157611021612e47565b90507f7202a69f4a5815b4fd765367e2877e0f6401878de7a35d2ab1b397fc0d9e343b8c8284600001516040516112a3939291906131e7565b60405180910390a160028b015461ffff16811061138c5760028b01805461ffff191690556112d08b6124bb565b600a546001600160a01b03166359dfddb06112e9611ada565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401600060405180830381600087803b15801561132a57600080fd5b505af115801561133e573d6000803e3d6000fd5b50505060088c0180546002925060019061136390849061ffff6101009091041661320f565b92506101000a81548161ffff021916908361ffff16021790555050505050505050505050505050565b60028b0180548291906000906113a790849061ffff1661322a565b92506101000a81548161ffff021916908361ffff160217905550886001815181106113d4576113d4612e47565b6020026020010151896002815181106113ef576113ef612e47565b60200260200101518a60038151811061140a5761140a612e47565b602002602001015160405160200161143c9392919060ff93841681529183166020830152909116604082015260600190565b6040516020818303038152906040528b600901908161145b919061306b565b5060028b60080160018282829054906101000a900461ffff16611363919061320f565b60008051602061347d83398151915261149981610a43611ada565b826001600160a01b03811663a9059cbb6114b1611ada565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018690526044016020604051808303816000875af11580156114fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115229190613245565b5050505050565b60008051602061347d83398151915261154481610a43611ada565b506007805460ff19169055565b60008281526020819052604090206001015461156f81610a43611ada565b610a528383611bcd565b60008051602061347d83398151915261159481610a43611ada565b600754825160ff9091169060005b8160ff16811015611674578481815181106115bf576115bf612e47565b60200260200101516006600083866115d79190613267565b81526020810191909152604001600020815181906115f5908261306b565b50602082015160018083019190915560408301516002830155606083015160038301556080830151600483015560a0830151600583015560c0830151600683015560e0830151600783015561010083015160088301556101208301516009830155610140830151600a83015561016090920151600b90910155016115a2565b506007805482919060009061168d90849060ff1661327a565b92506101000a81548160ff021916908360ff16021790555050505050565b6002546001600160a01b031633146116d55760405162461bcd60e51b815260040161047990612e2a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146117215760405162461bcd60e51b815260040161047990612e2a565b6001600a60168282829054906101000a900460ff16611740919061327a565b92506101000a81548160ff021916908360ff16021790555080600b8190555060005b82518160ff161015610a52576000838260ff168151811061178557611785612e47565b602090810291909101810151604080820180516001600160a01b039081166000908152600e865283812085518252865292909220835181559383015160018086019190915590516002909401805460609094015160ff16600160a01b026001600160a81b03199094169490921693909317919091179055919091019050611762565b6001546000906001600160a01b03163303611829575060131936013560601c90565b503390565b905090565b3390565b611864604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b600154600090819081906001600160a01b031633036118965760683603359250602836033560601c9050604836033591505b6040518060600160405280826001600160a01b0316815260200183815260200184815250935050505090565b600a5460405163211c59a160e21b81526001600160a01b0384811660048301526024820184905260448201869052600092839291169063847166849060640160c060405180830381865afa15801561191e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194291906132a5565b505050505061ffff16151595945050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f0000000000000000000000000000000000000000000000000000000000000000848660006040516020016119c6929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016119f393929190613319565b6020604051808303816000875af1158015611a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a369190613245565b50600083815260036020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a090910190925281519183019190912093879052919052611a92906001613267565b600085815260036020526040902055611ad28482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b949350505050565b600061182e611807565b611aee8282610c2c565b610ae157611b06816001600160a01b03166014612500565b611b11836020612500565b604051602001611b22929190613340565b60408051601f198184030181529082905262461bcd60e51b8252610479916004016133b5565b611b528282610c2c565b610ae1576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611b89611ada565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611bd78282610c2c565b15610ae1576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055611c0c611ada565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152600860209081526040808320548352600990915281206007810183905590611c7e836003611d63565b905080600081518110611c9357611c93612e47565b602002602001015181600181518110611cae57611cae612e47565b602002602001015182600281518110611cc957611cc9612e47565b6020026020010151604051602001611cfb9392919060ff93841681529183166020830152909116604082015260600190565b604051602081830303815290604052826009019081611d1a919061306b565b5060068201546040516201000090910461ffff1681527f8649c690e572f582bcbc0c861c490707b25b641b12c31de5d4c19dcf783909cf9060200160405180910390a150505050565b6060816001600160401b03811115611d7d57611d7d6126de565b604051908082528060200260200182016040528015611da6578160200160208202803683370190505b50905060005b82811015611e2957600754604080516020810187905290810183905242606082015260ff909116906080016040516020818303038152906040528051906020012060001c611dfa91906133de565b828281518110611e0c57611e0c612e47565b602090810291909101015280611e21816133f2565b915050611dac565b5092915050565b6060816001600160401b03811115611e4a57611e4a6126de565b604051908082528060200260200182016040528015611e73578160200160208202803683370190505b50905060005b82811015611e295760408051602081018690529081018290524260608201526080016040516020818303038152906040528051906020012060001c828281518110611ec657611ec6612e47565b602090810291909101015280611edb816133f2565b915050611e79565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152600a5460405163211c59a160e21b81526001600160a01b0385811660048301526024820185905260448201879052600092839283928392839283929091169063847166849060640160c060405180830381865afa158015611f7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f9e91906132a5565b9550955095509550955095508061ffff16600003611fea5760405162461bcd60e51b815260206004820152600960248201526815d34e9b55ce8d0c0d60ba1b6044820152606401610479565b6040805160c08101825261ffff978816815295871660208701529386169385019390935291841660608401528316608083015290911660a0820152949350505050565b60208401516000906120409060646126a2565b905061207761207061019061206a876000015161ffff1689604001516126ae90919063ffffffff16565b906126ba565b82906126a2565b90506120a161207061019061206a876060015161ffff1689606001516126ae90919063ffffffff16565b90506120cb61207061019061206a8760a0015161ffff1689608001516126ae90919063ffffffff16565b90506120f561207061019061206a876080015161ffff168960a001516126ae90919063ffffffff16565b905061211f61207061019061206a876040015161ffff168960c001516126ae90919063ffffffff16565b9050600061214b61207061019061206a876020015161ffff168a60e001516126ae90919063ffffffff16565b905061217661207061019061206a876060015161ffff168a61010001516126ae90919063ffffffff16565b90506121a161207061019061206a8760a0015161ffff168a61012001516126ae90919063ffffffff16565b90506121cc61207061019061206a876080015161ffff168a61014001516126ae90919063ffffffff16565b90506121f761207061019061206a876040015161ffff168a61016001516126ae90919063ffffffff16565b9050808211612207576000612211565b61221182826126c6565b9150600061222084601e6126d2565b9050600f81106122425761223f61223882600f6126c6565b84906126a2565b92505b600f81101561226657808311612259576000612263565b61226383826126c6565b92505b5050949350505050565b600f600061227c611ada565b6001600160a01b03908116825260208083019390935260409182016000206004850154600586015484519190931694810194909452918301529060600160408051601f19818403018152908290526122d39161340b565b9081526040519081900360200190205460ff1615156000036124b8576001600f60006122fd611ada565b6001600160a01b03908116825260208083019390935260409182016000206004860154600587015484519190931694810194909452918301529060600160408051601f19818403018152908290526123549161340b565b908152604051908190036020019020805491151560ff19909216919091179055600160106000612382611ada565b6001600160a01b0316815260208082019290925260409081016000908120600a5460ff600160b01b909104811683529352908120805490926123c69185911661327a565b92506101000a81548160ff021916908360ff160217905550601060006123ea611ada565b6001600160a01b0316815260208082019290925260409081016000908120600a5460ff600160b01b9091048116835293522054166005036124b857600c546001600160a01b031663f242432a3061243f611ada565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152600160448201526002606482015260a06084820152600060a482015260c4015b600060405180830381600087803b1580156124a457600080fd5b505af1158015611522573d6000803e3d6000fd5b50565b600a546001600160a01b03166359dfddb06124d4611ada565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240161248a565b6060600061250f836002613427565b61251a906002613267565b6001600160401b03811115612531576125316126de565b6040519080825280601f01601f19166020018201604052801561255b576020820181803683370190505b509050600360fc1b8160008151811061257657612576612e47565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106125a5576125a5612e47565b60200101906001600160f81b031916908160001a90535060006125c9846002613427565b6125d4906001613267565b90505b600181111561264c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061260857612608612e47565b1a60f81b82828151811061261e5761261e612e47565b60200101906001600160f81b031916908160001a90535060049490941c936126458161343e565b90506125d7565b50831561269b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610479565b9392505050565b600061269b8284613267565b600061269b8284613427565b600061269b8284613455565b600061269b8284613469565b600061269b82846133de565b634e487b7160e01b600052604160045260246000fd5b60405161018081016001600160401b0381118282101715612717576127176126de565b60405290565b604051608081016001600160401b0381118282101715612717576127176126de565b604051601f8201601f191681016001600160401b0381118282101715612767576127676126de565b604052919050565b60006001600160401b03821115612788576127886126de565b5060051b60200190565b600082601f8301126127a357600080fd5b813560206127b86127b38361276f565b61273f565b82815260059290921b840181019181810190868411156127d757600080fd5b8286015b848110156127f257803583529183019183016127db565b509695505050505050565b60006020828403121561280f57600080fd5b81356001600160401b0381111561282557600080fd5b611ad284828501612792565b60006020828403121561284357600080fd5b81356001600160e01b03198116811461269b57600080fd5b60006020828403121561286d57600080fd5b5035919050565b80356001600160a01b038116811461288b57600080fd5b919050565b600080604083850312156128a357600080fd5b6128ac83612874565b946020939093013593505050565b600080604083850312156128cd57600080fd5b823591506128dd60208401612874565b90509250929050565b6000602082840312156128f857600080fd5b61269b82612874565b634e487b7160e01b600052602160045260246000fd5b60005b8381101561293257818101518382015260200161291a565b50506000910152565b60008151808452612953816020860160208601612917565b601f01601f19169290920160200192915050565b6001600160a01b038d81168252602082018d905261ffff8c81166040840152606083018c9052908a16608083015260a0820189905287811660c0830152861660e082015261010081018590526000600285106129d357634e487b7160e01b600052602160045260246000fd5b846101208301526129eb61014083018561ffff169052565b610180610160830152612a0261018083018461293b565b9e9d5050505050505050505050505050565b60008060408385031215612a2757600080fd5b50508035926020909101359150565b60ff811681146124b857600080fd5b60008060408385031215612a5857600080fd5b82356128ac81612a36565b600082601f830112612a7457600080fd5b81356001600160401b03811115612a8d57612a8d6126de565b612aa0601f8201601f191660200161273f565b818152846020838601011115612ab557600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215612aea57600080fd5b612af386612874565b9450612b0160208701612874565b935060408601356001600160401b0380821115612b1d57600080fd5b612b2989838a01612792565b94506060880135915080821115612b3f57600080fd5b612b4b89838a01612792565b93506080880135915080821115612b6157600080fd5b50612b6e88828901612a63565b9150509295509295909350565b60006020808385031215612b8e57600080fd5b82356001600160401b0380821115612ba557600080fd5b818501915085601f830112612bb957600080fd5b8135612bc76127b38261276f565b81815260059190911b83018401908481019088831115612be657600080fd5b8585015b83811015612cd957803585811115612c025760008081fd5b8601610180818c03601f1901811315612c1b5760008081fd5b612c236126f4565b8983013588811115612c355760008081fd5b612c438e8c83870101612a63565b8252506040808401358b830152606080850135828401526080915081850135818401525060a0808501358284015260c0915081850135818401525060e0808501358284015261010091508185013581840152506101208085013582840152610140915081850135818401525061016080850135828401528385013581840152505080865250505086830192508681019050612bea565b5098975050505050505050565b6000806040808486031215612cfa57600080fd5b83356001600160401b03811115612d1057600080fd5b8401601f81018613612d2157600080fd5b80356020612d316127b38361276f565b82815260079290921b83018101918181019089841115612d5057600080fd5b938201935b83851015612db6576080858b031215612d6e5760008081fd5b612d7661271d565b853581528386013584820152612d8d878701612874565b87820152606080870135612da081612a36565b9082015282526080949094019390820190612d55565b9997909101359750505050505050565b600080600080600060a08688031215612dde57600080fd5b612de786612874565b9450612df560208701612874565b9350604086013592506060860135915060808601356001600160401b03811115612e1e57600080fd5b612b6e88828901612a63565b60208082526003908201526234303360e81b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b83811015612e8d57815187529582019590820190600101612e71565b509495945050505050565b604080825283519082018190526000906020906060840190828701845b82811015612eda5781516001600160a01b031684529284019290840190600101612eb5565b50505083810382850152612eee8186612e5d565b9695505050505050565b60006020808385031215612f0b57600080fd5b82516001600160401b03811115612f2157600080fd5b8301601f81018513612f3257600080fd5b8051612f406127b38261276f565b81815260059190911b82018301908381019087831115612f5f57600080fd5b928401925b82841015612f7d57835182529284019290840190612f64565b979650505050505050565b6001600160a01b0385811682528416602082015260a060408201819052600090612fb490830185612e5d565b8281036060840152612fc68185612e5d565b838103608090940193909352505060008152602001949350505050565b600181811c90821680612ff757607f821691505b60208210810361301757634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610a5257600081815260208120601f850160051c810160208610156130445750805b601f850160051c820191505b8181101561306357828155600101613050565b505050505050565b81516001600160401b03811115613084576130846126de565b613098816130928454612fe3565b8461301d565b602080601f8311600181146130cd57600084156130b55750858301515b600019600386901b1c1916600185901b178555613063565b600085815260208120601f198616915b828110156130fc578886015182559484019460019091019084016130dd565b508582101561311a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600061ffff8083168181036131575761315761312a565b6001019392505050565b60006060828403121561317357600080fd5b82601f83011261318257600080fd5b604051606081018181106001600160401b03821117156131a4576131a46126de565b6040528060608401858111156131b957600080fd5b845b818110156131dc5780516131ce81612a36565b8352602092830192016131bb565b509195945050505050565b838152826020820152606060408201526000613206606083018461293b565b95945050505050565b61ffff818116838216019080821115611e2957611e2961312a565b61ffff828116828216039080821115611e2957611e2961312a565b60006020828403121561325757600080fd5b8151801515811461269b57600080fd5b808201808211156106285761062861312a565b60ff81811683821601908111156106285761062861312a565b805161ffff8116811461288b57600080fd5b60008060008060008060c087890312156132be57600080fd5b6132c787613293565b95506132d560208801613293565b94506132e360408801613293565b93506132f160608801613293565b92506132ff60808801613293565b915061330d60a08801613293565b90509295509295509295565b60018060a01b0384168152826020820152606060408201526000613206606083018461293b565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613378816017850160208801612917565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516133a9816028840160208801612917565b01602801949350505050565b60208152600061269b602083018461293b565b634e487b7160e01b600052601260045260246000fd5b6000826133ed576133ed6133c8565b500690565b6000600182016134045761340461312a565b5060010190565b6000825161341d818460208701612917565b9190910192915050565b80820281158282048414176106285761062861312a565b60008161344d5761344d61312a565b506000190190565b600082613464576134646133c8565b500490565b818103818111156106285761062861312a56fea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a2646970667358221220cf3d295115facfaa4bff83f4c8f7cf373219b79b597233af97899b31149f7c9264736f6c634300081100330000000000000000000000000000000000498ae1a155c9b1843426e29ce419380000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae0000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1f86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da0000000000000000000000005bdf5ed7a75a2ea761ffe191d9757a414eb91ddf00000000000000000000000092cb37345afb9a84cb23bbe72eeee9e5a68d95da
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101c35760003560e01c806391d14854116100f9578063d547741f11610097578063dca721d511610071578063dca721d514610401578063dd6e90af14610414578063ddca3f4314610427578063f23a6e611461043057600080fd5b8063d547741f146103c8578063d5d719a5146103db578063da742228146103ee57600080fd5b80639e281a98116100d35780639e281a981461036d578063a217fddf14610380578063bc197c8114610388578063c876715c146103c057600080fd5b806391d148541461033457806394985ddd146103475780639b649aed1461035a57600080fd5b80634408103b1161016657806361728f391161014057806361728f39146102fa5780636c33300d1461030357806375b238fc1461030c5780638da5cb5b1461032157600080fd5b80634408103b1461029a5780634768d4ef146102ad578063572b6c05146102d857600080fd5b8063248a9ca3116101a2578063248a9ca31461023057806329d6a2d1146102615780632f2ff15d1461027457806336568abe1461028757600080fd5b8062907c52146101c857806301ffc9a7146101dd5780630a50590d14610205575b600080fd5b6101db6101d63660046127fd565b61044f565b005b6101f06101eb366004612831565b6105f7565b60405190151581526020015b60405180910390f35b600c54610218906001600160a01b031681565b6040516001600160a01b0390911681526020016101fc565b61025361023e36600461285b565b60009081526020819052604090206001015490565b6040519081526020016101fc565b6101db61026f366004612890565b61062e565b6101db6102823660046128ba565b610a25565b6101db6102953660046128ba565b610a57565b6101db6102a83660046128e6565b610ae5565b6102c06102bb36600461285b565b610b23565b6040516101fc9c9b9a99989796959493929190612967565b6101f06102e63660046128e6565b6001546001600160a01b0391821691161490565b61025360045481565b610253600b5481565b61025360008051602061347d83398151915281565b600254610218906001600160a01b031681565b6101f06103423660046128ba565b610c2c565b6101db610355366004612a14565b610c55565b6101db610368366004612a45565b610cd7565b6101db61037b366004612890565b61147e565b610253600081565b6103a7610396366004612ad2565b63bc197c8160e01b95945050505050565b6040516001600160e01b031990911681526020016101fc565b6101db611529565b6101db6103d63660046128ba565b611551565b6101db6103e9366004612b7b565b611579565b6101db6103fc3660046128e6565b6116ab565b600a54610218906001600160a01b031681565b6101db610422366004612ce6565b6116f7565b61025360055481565b6103a761043e366004612dc6565b63f23a6e6160e01b95945050505050565b6002546001600160a01b031633146104825760405162461bcd60e51b815260040161047990612e2a565b60405180910390fd5b6060308160008151811061049857610498612e47565b60200260200101906001600160a01b031690816001600160a01b03168152505030816001815181106104cc576104cc612e47565b60200260200101906001600160a01b031690816001600160a01b031681525050308160028151811061050057610500612e47565b6001600160a01b039283166020918202929092010152600c546040516313849cfd60e21b81526000929190911690634e1273f4906105449085908790600401612e98565b600060405180830381865afa158015610561573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105899190810190612ef8565b600c54604051631759616b60e11b81529192506001600160a01b031690632eb2c2d6906105c0903090339088908790600401612f88565b600060405180830381600087803b1580156105da57600080fd5b505af11580156105ee573d6000803e3d6000fd5b50505050505050565b60006001600160e01b03198216637965db0b60e01b148061062857506301ffc9a760e01b6001600160e01b03198316145b92915050565b6001546001600160a01b0316331461067f5760405162461bcd60e51b8152602060048201526014602482015273457373656e7469616c436f6e746578743a34323960601b6044820152606401610479565b600a546001600160a01b0383166000908152600e60209081526040808320858452909152902060020154600160a01b900460ff908116600160b01b90920416146106fe5760405162461bcd60e51b815260206004820152601060248201526f125b9d985b1a590813dc1c1bdb995b9d60821b6044820152606401610479565b600b54421061073f5760405162461bcd60e51b815260206004820152600d60248201526c15da5b991bddc818db1bdcd959609a1b6044820152606401610479565b6000610749611837565b90506107628160400151826000015183602001516118c2565b6107945760405162461bcd60e51b81526020600482015260036024820152620d0c0d60ea1b6044820152606401610479565b60006107a4600454600554611956565b600a8054600083815260086020908152604080832061ffff600160a01b95869004811690915581516101808101835289516001600160a01b0390811682528a850151948201949094526103e8818401819052928a01516060820152928b16608084015260a083018a905260c083019190915293549290920490921660e082015261010081018290529192506101208201908152600060208083018290526040805180820182526001808252600360fc1b8285015294820152600a5461ffff600160a01b909104811684526009835292819020855181546001600160a01b03199081166001600160a01b0392831617835593870151828701559186015160028201805461ffff191691861691909117905560608601516003820155608086015160048201805490941692169190911790915560a0840151600582015560c084015160068201805460e087015192851663ffffffff199091161762010000929094169190910292909217909155610100830151600782015561012083015160088201805492939192909160ff1990911690838181111561094457610944612901565b021790555061014082015160088201805461ffff9092166101000262ffff00199092169190911790556101608201516009820190610982908261306b565b5050600a547f8ca4bc79eaadabb16e050d23e879138dac0ff429f81d86b41be6e471443220349150600160a01b900461ffff16826109be611ada565b6040805161ffff909416845260208401929092526001600160a01b03169082015260600160405180910390a1600a8054601490610a0590600160a01b900461ffff16613140565b91906101000a81548161ffff021916908361ffff16021790555050505050565b600082815260208190526040902060010154610a4881610a43611ada565b611ae4565b610a528383611b48565b505050565b610a5f611ada565b6001600160a01b0316816001600160a01b031614610ad75760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610479565b610ae18282611bcd565b5050565b60008051602061347d833981519152610b0081610a43611ada565b50600a80546001600160a01b0319166001600160a01b0392909216919091179055565b600960208190526000918252604090912080546001820154600283015460038401546004850154600586015460068701546007880154600889015499890180546001600160a01b03998a169b989a61ffff9889169a9799969097169794968486169662010000909504861695939460ff81169461010090910416929091610ba990612fe3565b80601f0160208091040260200160405190810160405280929190818152602001828054610bd590612fe3565b8015610c225780601f10610bf757610100808354040283529160200191610c22565b820191906000526020600020905b815481529060010190602001808311610c0557829003601f168201915b505050505090508c565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b336001600160a01b037f0000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae01614610ccd5760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610479565b610ae18282611c50565b6001546001600160a01b03163314610d285760405162461bcd60e51b8152602060048201526014602482015273457373656e7469616c436f6e746578743a34323960601b6044820152606401610479565b600081815260096020526040812090610d3f611837565b825481519192506001600160a01b039182169116148015610d67575081600101548160200151145b610d995760405162461bcd60e51b815260206004820152600360248201526234303160e81b6044820152606401610479565b6000610daa83600701546004611d63565b90506000610dbd84600701546002611e30565b604084015185546001870154929350600092610de392916001600160a01b031690611ee3565b90506000610e2146608914610df9576005610dfc565b60015b60ff168760040160009054906101000a90046001600160a01b03168860050154611ee3565b90506000866009018054610e3490612fe3565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6090612fe3565b8015610ead5780601f10610e8257610100808354040283529160200191610ead565b820191906000526020600020905b815481529060010190602001808311610e9057829003601f168201915b5050505050806020019051810190610ec59190613161565b9050600060066000838c60ff1660038110610ee257610ee2612e47565b602002015160ff16815260200190815260200160002060405180610180016040529081600082018054610f1490612fe3565b80601f0160208091040260200160405190810160405280929190818152602001828054610f4090612fe3565b8015610f8d5780601f10610f6257610100808354040283529160200191610f8d565b820191906000526020600020905b815481529060010190602001808311610f7057829003601f168201915b50505050508152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820154815250509050600061102e8286868960008151811061102157611021612e47565b602002602001015161202d565b90507f7202a69f4a5815b4fd765367e2877e0f6401878de7a35d2ab1b397fc0d9e343b8a828460000151604051611067939291906131e7565b60405180910390a1600689015461ffff1681106110dd5760068901805461ffff1916905561109489612270565b60018960080160018282829054906101000a900461ffff166110b6919061320f565b92506101000a81548161ffff021916908361ffff1602179055505050505050505050505050565b6006890180548291906000906110f890849061ffff1661322a565b92506101000a81548161ffff021916908361ffff1602179055506000600660008960008151811061112b5761112b612e47565b602002602001015181526020019081526020016000206040518061018001604052908160008201805461115d90612fe3565b80601f016020809104026020016040519081016040528092919081815260200182805461118990612fe3565b80156111d65780601f106111ab576101008083540402835291602001916111d6565b820191906000526020600020905b8154815290600101906020018083116111b957829003601f168201915b50505050508152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820154815250509050600061126a8287898b60018151811061102157611021612e47565b90507f7202a69f4a5815b4fd765367e2877e0f6401878de7a35d2ab1b397fc0d9e343b8c8284600001516040516112a3939291906131e7565b60405180910390a160028b015461ffff16811061138c5760028b01805461ffff191690556112d08b6124bb565b600a546001600160a01b03166359dfddb06112e9611ada565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401600060405180830381600087803b15801561132a57600080fd5b505af115801561133e573d6000803e3d6000fd5b50505060088c0180546002925060019061136390849061ffff6101009091041661320f565b92506101000a81548161ffff021916908361ffff16021790555050505050505050505050505050565b60028b0180548291906000906113a790849061ffff1661322a565b92506101000a81548161ffff021916908361ffff160217905550886001815181106113d4576113d4612e47565b6020026020010151896002815181106113ef576113ef612e47565b60200260200101518a60038151811061140a5761140a612e47565b602002602001015160405160200161143c9392919060ff93841681529183166020830152909116604082015260600190565b6040516020818303038152906040528b600901908161145b919061306b565b5060028b60080160018282829054906101000a900461ffff16611363919061320f565b60008051602061347d83398151915261149981610a43611ada565b826001600160a01b03811663a9059cbb6114b1611ada565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018690526044016020604051808303816000875af11580156114fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115229190613245565b5050505050565b60008051602061347d83398151915261154481610a43611ada565b506007805460ff19169055565b60008281526020819052604090206001015461156f81610a43611ada565b610a528383611bcd565b60008051602061347d83398151915261159481610a43611ada565b600754825160ff9091169060005b8160ff16811015611674578481815181106115bf576115bf612e47565b60200260200101516006600083866115d79190613267565b81526020810191909152604001600020815181906115f5908261306b565b50602082015160018083019190915560408301516002830155606083015160038301556080830151600483015560a0830151600583015560c0830151600683015560e0830151600783015561010083015160088301556101208301516009830155610140830151600a83015561016090920151600b90910155016115a2565b506007805482919060009061168d90849060ff1661327a565b92506101000a81548160ff021916908360ff16021790555050505050565b6002546001600160a01b031633146116d55760405162461bcd60e51b815260040161047990612e2a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146117215760405162461bcd60e51b815260040161047990612e2a565b6001600a60168282829054906101000a900460ff16611740919061327a565b92506101000a81548160ff021916908360ff16021790555080600b8190555060005b82518160ff161015610a52576000838260ff168151811061178557611785612e47565b602090810291909101810151604080820180516001600160a01b039081166000908152600e865283812085518252865292909220835181559383015160018086019190915590516002909401805460609094015160ff16600160a01b026001600160a81b03199094169490921693909317919091179055919091019050611762565b6001546000906001600160a01b03163303611829575060131936013560601c90565b503390565b905090565b3390565b611864604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b600154600090819081906001600160a01b031633036118965760683603359250602836033560601c9050604836033591505b6040518060600160405280826001600160a01b0316815260200183815260200184815250935050505090565b600a5460405163211c59a160e21b81526001600160a01b0384811660048301526024820184905260448201869052600092839291169063847166849060640160c060405180830381865afa15801561191e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194291906132a5565b505050505061ffff16151595945050505050565b60007f000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f16001600160a01b0316634000aea07f0000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae0848660006040516020016119c6929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016119f393929190613319565b6020604051808303816000875af1158015611a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a369190613245565b50600083815260036020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a090910190925281519183019190912093879052919052611a92906001613267565b600085815260036020526040902055611ad28482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b949350505050565b600061182e611807565b611aee8282610c2c565b610ae157611b06816001600160a01b03166014612500565b611b11836020612500565b604051602001611b22929190613340565b60408051601f198184030181529082905262461bcd60e51b8252610479916004016133b5565b611b528282610c2c565b610ae1576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611b89611ada565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611bd78282610c2c565b15610ae1576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055611c0c611ada565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152600860209081526040808320548352600990915281206007810183905590611c7e836003611d63565b905080600081518110611c9357611c93612e47565b602002602001015181600181518110611cae57611cae612e47565b602002602001015182600281518110611cc957611cc9612e47565b6020026020010151604051602001611cfb9392919060ff93841681529183166020830152909116604082015260600190565b604051602081830303815290604052826009019081611d1a919061306b565b5060068201546040516201000090910461ffff1681527f8649c690e572f582bcbc0c861c490707b25b641b12c31de5d4c19dcf783909cf9060200160405180910390a150505050565b6060816001600160401b03811115611d7d57611d7d6126de565b604051908082528060200260200182016040528015611da6578160200160208202803683370190505b50905060005b82811015611e2957600754604080516020810187905290810183905242606082015260ff909116906080016040516020818303038152906040528051906020012060001c611dfa91906133de565b828281518110611e0c57611e0c612e47565b602090810291909101015280611e21816133f2565b915050611dac565b5092915050565b6060816001600160401b03811115611e4a57611e4a6126de565b604051908082528060200260200182016040528015611e73578160200160208202803683370190505b50905060005b82811015611e295760408051602081018690529081018290524260608201526080016040516020818303038152906040528051906020012060001c828281518110611ec657611ec6612e47565b602090810291909101015280611edb816133f2565b915050611e79565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152600a5460405163211c59a160e21b81526001600160a01b0385811660048301526024820185905260448201879052600092839283928392839283929091169063847166849060640160c060405180830381865afa158015611f7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f9e91906132a5565b9550955095509550955095508061ffff16600003611fea5760405162461bcd60e51b815260206004820152600960248201526815d34e9b55ce8d0c0d60ba1b6044820152606401610479565b6040805160c08101825261ffff978816815295871660208701529386169385019390935291841660608401528316608083015290911660a0820152949350505050565b60208401516000906120409060646126a2565b905061207761207061019061206a876000015161ffff1689604001516126ae90919063ffffffff16565b906126ba565b82906126a2565b90506120a161207061019061206a876060015161ffff1689606001516126ae90919063ffffffff16565b90506120cb61207061019061206a8760a0015161ffff1689608001516126ae90919063ffffffff16565b90506120f561207061019061206a876080015161ffff168960a001516126ae90919063ffffffff16565b905061211f61207061019061206a876040015161ffff168960c001516126ae90919063ffffffff16565b9050600061214b61207061019061206a876020015161ffff168a60e001516126ae90919063ffffffff16565b905061217661207061019061206a876060015161ffff168a61010001516126ae90919063ffffffff16565b90506121a161207061019061206a8760a0015161ffff168a61012001516126ae90919063ffffffff16565b90506121cc61207061019061206a876080015161ffff168a61014001516126ae90919063ffffffff16565b90506121f761207061019061206a876040015161ffff168a61016001516126ae90919063ffffffff16565b9050808211612207576000612211565b61221182826126c6565b9150600061222084601e6126d2565b9050600f81106122425761223f61223882600f6126c6565b84906126a2565b92505b600f81101561226657808311612259576000612263565b61226383826126c6565b92505b5050949350505050565b600f600061227c611ada565b6001600160a01b03908116825260208083019390935260409182016000206004850154600586015484519190931694810194909452918301529060600160408051601f19818403018152908290526122d39161340b565b9081526040519081900360200190205460ff1615156000036124b8576001600f60006122fd611ada565b6001600160a01b03908116825260208083019390935260409182016000206004860154600587015484519190931694810194909452918301529060600160408051601f19818403018152908290526123549161340b565b908152604051908190036020019020805491151560ff19909216919091179055600160106000612382611ada565b6001600160a01b0316815260208082019290925260409081016000908120600a5460ff600160b01b909104811683529352908120805490926123c69185911661327a565b92506101000a81548160ff021916908360ff160217905550601060006123ea611ada565b6001600160a01b0316815260208082019290925260409081016000908120600a5460ff600160b01b9091048116835293522054166005036124b857600c546001600160a01b031663f242432a3061243f611ada565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152600160448201526002606482015260a06084820152600060a482015260c4015b600060405180830381600087803b1580156124a457600080fd5b505af1158015611522573d6000803e3d6000fd5b50565b600a546001600160a01b03166359dfddb06124d4611ada565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240161248a565b6060600061250f836002613427565b61251a906002613267565b6001600160401b03811115612531576125316126de565b6040519080825280601f01601f19166020018201604052801561255b576020820181803683370190505b509050600360fc1b8160008151811061257657612576612e47565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106125a5576125a5612e47565b60200101906001600160f81b031916908160001a90535060006125c9846002613427565b6125d4906001613267565b90505b600181111561264c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061260857612608612e47565b1a60f81b82828151811061261e5761261e612e47565b60200101906001600160f81b031916908160001a90535060049490941c936126458161343e565b90506125d7565b50831561269b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610479565b9392505050565b600061269b8284613267565b600061269b8284613427565b600061269b8284613455565b600061269b8284613469565b600061269b82846133de565b634e487b7160e01b600052604160045260246000fd5b60405161018081016001600160401b0381118282101715612717576127176126de565b60405290565b604051608081016001600160401b0381118282101715612717576127176126de565b604051601f8201601f191681016001600160401b0381118282101715612767576127676126de565b604052919050565b60006001600160401b03821115612788576127886126de565b5060051b60200190565b600082601f8301126127a357600080fd5b813560206127b86127b38361276f565b61273f565b82815260059290921b840181019181810190868411156127d757600080fd5b8286015b848110156127f257803583529183019183016127db565b509695505050505050565b60006020828403121561280f57600080fd5b81356001600160401b0381111561282557600080fd5b611ad284828501612792565b60006020828403121561284357600080fd5b81356001600160e01b03198116811461269b57600080fd5b60006020828403121561286d57600080fd5b5035919050565b80356001600160a01b038116811461288b57600080fd5b919050565b600080604083850312156128a357600080fd5b6128ac83612874565b946020939093013593505050565b600080604083850312156128cd57600080fd5b823591506128dd60208401612874565b90509250929050565b6000602082840312156128f857600080fd5b61269b82612874565b634e487b7160e01b600052602160045260246000fd5b60005b8381101561293257818101518382015260200161291a565b50506000910152565b60008151808452612953816020860160208601612917565b601f01601f19169290920160200192915050565b6001600160a01b038d81168252602082018d905261ffff8c81166040840152606083018c9052908a16608083015260a0820189905287811660c0830152861660e082015261010081018590526000600285106129d357634e487b7160e01b600052602160045260246000fd5b846101208301526129eb61014083018561ffff169052565b610180610160830152612a0261018083018461293b565b9e9d5050505050505050505050505050565b60008060408385031215612a2757600080fd5b50508035926020909101359150565b60ff811681146124b857600080fd5b60008060408385031215612a5857600080fd5b82356128ac81612a36565b600082601f830112612a7457600080fd5b81356001600160401b03811115612a8d57612a8d6126de565b612aa0601f8201601f191660200161273f565b818152846020838601011115612ab557600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215612aea57600080fd5b612af386612874565b9450612b0160208701612874565b935060408601356001600160401b0380821115612b1d57600080fd5b612b2989838a01612792565b94506060880135915080821115612b3f57600080fd5b612b4b89838a01612792565b93506080880135915080821115612b6157600080fd5b50612b6e88828901612a63565b9150509295509295909350565b60006020808385031215612b8e57600080fd5b82356001600160401b0380821115612ba557600080fd5b818501915085601f830112612bb957600080fd5b8135612bc76127b38261276f565b81815260059190911b83018401908481019088831115612be657600080fd5b8585015b83811015612cd957803585811115612c025760008081fd5b8601610180818c03601f1901811315612c1b5760008081fd5b612c236126f4565b8983013588811115612c355760008081fd5b612c438e8c83870101612a63565b8252506040808401358b830152606080850135828401526080915081850135818401525060a0808501358284015260c0915081850135818401525060e0808501358284015261010091508185013581840152506101208085013582840152610140915081850135818401525061016080850135828401528385013581840152505080865250505086830192508681019050612bea565b5098975050505050505050565b6000806040808486031215612cfa57600080fd5b83356001600160401b03811115612d1057600080fd5b8401601f81018613612d2157600080fd5b80356020612d316127b38361276f565b82815260079290921b83018101918181019089841115612d5057600080fd5b938201935b83851015612db6576080858b031215612d6e5760008081fd5b612d7661271d565b853581528386013584820152612d8d878701612874565b87820152606080870135612da081612a36565b9082015282526080949094019390820190612d55565b9997909101359750505050505050565b600080600080600060a08688031215612dde57600080fd5b612de786612874565b9450612df560208701612874565b9350604086013592506060860135915060808601356001600160401b03811115612e1e57600080fd5b612b6e88828901612a63565b60208082526003908201526234303360e81b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b83811015612e8d57815187529582019590820190600101612e71565b509495945050505050565b604080825283519082018190526000906020906060840190828701845b82811015612eda5781516001600160a01b031684529284019290840190600101612eb5565b50505083810382850152612eee8186612e5d565b9695505050505050565b60006020808385031215612f0b57600080fd5b82516001600160401b03811115612f2157600080fd5b8301601f81018513612f3257600080fd5b8051612f406127b38261276f565b81815260059190911b82018301908381019087831115612f5f57600080fd5b928401925b82841015612f7d57835182529284019290840190612f64565b979650505050505050565b6001600160a01b0385811682528416602082015260a060408201819052600090612fb490830185612e5d565b8281036060840152612fc68185612e5d565b838103608090940193909352505060008152602001949350505050565b600181811c90821680612ff757607f821691505b60208210810361301757634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610a5257600081815260208120601f850160051c810160208610156130445750805b601f850160051c820191505b8181101561306357828155600101613050565b505050505050565b81516001600160401b03811115613084576130846126de565b613098816130928454612fe3565b8461301d565b602080601f8311600181146130cd57600084156130b55750858301515b600019600386901b1c1916600185901b178555613063565b600085815260208120601f198616915b828110156130fc578886015182559484019460019091019084016130dd565b508582101561311a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600061ffff8083168181036131575761315761312a565b6001019392505050565b60006060828403121561317357600080fd5b82601f83011261318257600080fd5b604051606081018181106001600160401b03821117156131a4576131a46126de565b6040528060608401858111156131b957600080fd5b845b818110156131dc5780516131ce81612a36565b8352602092830192016131bb565b509195945050505050565b838152826020820152606060408201526000613206606083018461293b565b95945050505050565b61ffff818116838216019080821115611e2957611e2961312a565b61ffff828116828216039080821115611e2957611e2961312a565b60006020828403121561325757600080fd5b8151801515811461269b57600080fd5b808201808211156106285761062861312a565b60ff81811683821601908111156106285761062861312a565b805161ffff8116811461288b57600080fd5b60008060008060008060c087890312156132be57600080fd5b6132c787613293565b95506132d560208801613293565b94506132e360408801613293565b93506132f160608801613293565b92506132ff60808801613293565b915061330d60a08801613293565b90509295509295509295565b60018060a01b0384168152826020820152606060408201526000613206606083018461293b565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613378816017850160208801612917565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516133a9816028840160208801612917565b01602801949350505050565b60208152600061269b602083018461293b565b634e487b7160e01b600052601260045260246000fd5b6000826133ed576133ed6133c8565b500690565b6000600182016134045761340461312a565b5060010190565b6000825161341d818460208701612917565b9190910192915050565b80820281158282048414176106285761062861312a565b60008161344d5761344d61312a565b506000190190565b600082613464576134646133c8565b500490565b818103818111156106285761062861312a56fea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a2646970667358221220cf3d295115facfaa4bff83f4c8f7cf373219b79b597233af97899b31149f7c9264736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000498ae1a155c9b1843426e29ce419380000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae0000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1f86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da0000000000000000000000005bdf5ed7a75a2ea761ffe191d9757a414eb91ddf00000000000000000000000092cb37345afb9a84cb23bbe72eeee9e5a68d95da
-----Decoded View---------------
Arg [0] : trustedForwarder (address): 0x0000000000498Ae1a155c9b1843426E29ce41938
Arg [1] : vRFCoordinator (address): 0x3d2341ADb2D31f1c5530cDC622016af293177AE0
Arg [2] : linkToken (address): 0xb0897686c545045aFc77CF20eC7A532E3120E0F1
Arg [3] : keyhash (bytes32): 0xf86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da
Arg [4] : nFight (address): 0x5BDf5ed7A75a2Ea761FfE191D9757A414Eb91Ddf
Arg [5] : _packsAddress (address): 0x92cB37345Afb9A84Cb23BBE72eEeE9e5A68D95DA
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000498ae1a155c9b1843426e29ce41938
Arg [1] : 0000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae0
Arg [2] : 000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1
Arg [3] : f86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da
Arg [4] : 0000000000000000000000005bdf5ed7a75a2ea761ffe191d9757a414eb91ddf
Arg [5] : 00000000000000000000000092cb37345afb9a84cb23bbe72eeee9e5a68d95da
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
POL | 100.00% | $23.27 | 0.0075 | $0.1745 |
[ 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.