Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 396 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Open Box | 11870200 | 1445 days ago | IN | 0 ETH | 0.09559811 | ||||
Get Box | 11870194 | 1445 days ago | IN | 0.0386 ETH | 0.02333624 | ||||
Open Box | 11676561 | 1475 days ago | IN | 0 ETH | 0.0340081 | ||||
Get Box | 11676551 | 1475 days ago | IN | 0.0386 ETH | 0.00734074 | ||||
Open Box | 11676537 | 1475 days ago | IN | 0 ETH | 0.03448623 | ||||
Get Box | 11676526 | 1475 days ago | IN | 0.0386 ETH | 0.00610812 | ||||
Open Box | 11676518 | 1475 days ago | IN | 0 ETH | 0.02839449 | ||||
Get Box | 11676508 | 1475 days ago | IN | 0.0386 ETH | 0.00660879 | ||||
Open Box | 11676502 | 1475 days ago | IN | 0 ETH | 0.03127566 | ||||
Get Box | 11676496 | 1475 days ago | IN | 0.0386 ETH | 0.00694033 | ||||
Open Box | 11676381 | 1475 days ago | IN | 0 ETH | 0.02598414 | ||||
Get Box | 11676376 | 1475 days ago | IN | 0.0386 ETH | 0.00547218 | ||||
Open Box | 11676363 | 1475 days ago | IN | 0 ETH | 0.02708205 | ||||
Get Box | 11676359 | 1475 days ago | IN | 0.0386 ETH | 0.00726861 | ||||
Open Box | 11665117 | 1477 days ago | IN | 0 ETH | 0.02314696 | ||||
Get Box | 11665099 | 1477 days ago | IN | 0.0386 ETH | 0.00516267 | ||||
Open Box | 11665019 | 1477 days ago | IN | 0 ETH | 0.02345798 | ||||
Get Box | 11665007 | 1477 days ago | IN | 0.0386 ETH | 0.00590779 | ||||
Open Box | 11573784 | 1491 days ago | IN | 0 ETH | 0.02455198 | ||||
Get Box | 11573778 | 1491 days ago | IN | 0.0386 ETH | 0.00599755 | ||||
Open Box | 11572922 | 1491 days ago | IN | 0 ETH | 0.02066585 | ||||
Get Box | 11572917 | 1491 days ago | IN | 0.0386 ETH | 0.00499464 | ||||
Open Box | 11572895 | 1491 days ago | IN | 0 ETH | 0.01971198 | ||||
Get Box | 11572887 | 1491 days ago | IN | 0.0386 ETH | 0.00554839 | ||||
Get Box | 11567113 | 1492 days ago | IN | 0.0386 ETH | 0.00138746 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
11870194 | 1445 days ago | 0.0386 ETH | ||||
11676551 | 1475 days ago | 0.0386 ETH | ||||
11676526 | 1475 days ago | 0.0386 ETH | ||||
11676508 | 1475 days ago | 0.0386 ETH | ||||
11676496 | 1475 days ago | 0.0386 ETH | ||||
11676376 | 1475 days ago | 0.0386 ETH | ||||
11676359 | 1475 days ago | 0.0386 ETH | ||||
11665099 | 1477 days ago | 0.0386 ETH | ||||
11665007 | 1477 days ago | 0.0386 ETH | ||||
11573778 | 1491 days ago | 0.0386 ETH | ||||
11572917 | 1491 days ago | 0.0386 ETH | ||||
11572887 | 1491 days ago | 0.0386 ETH | ||||
11566700 | 1492 days ago | 0.0386 ETH | ||||
11558710 | 1493 days ago | 0.0386 ETH | ||||
11543683 | 1496 days ago | 0.0386 ETH | ||||
11543315 | 1496 days ago | 0.0386 ETH | ||||
11540407 | 1496 days ago | 0.0386 ETH | ||||
11524700 | 1499 days ago | 0.0386 ETH | ||||
11524526 | 1499 days ago | 0.0386 ETH | ||||
11520833 | 1499 days ago | 0.0386 ETH | ||||
11520816 | 1499 days ago | 0.0386 ETH | ||||
11520794 | 1499 days ago | 0.0386 ETH | ||||
11520779 | 1499 days ago | 0.0386 ETH | ||||
11520767 | 1499 days ago | 0.0386 ETH | ||||
11520748 | 1499 days ago | 0.0386 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
JoysLotteryNew
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/utils/SafeCast.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "../JoysToken.sol"; import "../JoysNFT.sol"; import "./JoysLotteryMeta.sol"; import "./UniformRandomNumber.sol"; /// @title Joys lottery /// @notice lottery joys hero and weapon with access control contract JoysLotteryNew is ReentrancyGuard, Pausable, Ownable { using Counters for Counters.Counter; using SafeMath for uint256; using SafeMath for uint32; using Address for address; using SafeERC20 for IERC20; using SafeCast for uint256; // high level hero and weapon amount uint8 public constant HL_HERO = 99; uint8 public constant HL_WEAPON = 99; uint8 public hlHero; uint8 public hlWeapon; // claim hero and weapon fee uint256 public heroClaimFee = 50 * 1e18; uint256 public weaponClaimFee = 50 * 1e18; JoysToken public joys; // address of joys token contract JoysNFT public joysHero; // address of joys hero contract JoysNFT public joysWeapon; // address of joys weapon contract JoysLotteryMeta public heroMeta; // address of joys hero meta contract JoysLotteryMeta public weaponMeta; // address of joys weapon meta contract address public nftJackpot; // jackpot from 50% of draw enum Operation { crowdSaleClaim, inviteClaim, freeClaim, notFreeDrawHero, notFreeDrawWeapon } enum BoxState { Init, CanOpen, Opened, Expired } struct RequestInfo { // The operation of request. // 0:crowd sale claim, 1:invite claim, 2:free claim, // 3:not free draw hero, 4:not free draw weapon Operation operation; // internal counter uint32 reqID; // Block number of request tx. uint40 blockNumber; uint32 a; uint32 b; uint256 c; uint timestamp; BoxState state; } // mapping user request mapping(address => RequestInfo[]) public reqBox; Counters.Counter public reqIdTracker; uint constant REQ_EXPIRATION_BLOCKS = 250; uint constant REQ_DELAY_BLOCKS = 3; /// @dev A list of random numbers from past requests mapped by address and request id mapping(uint256 => uint256) public randomNumbers; uint256 public lotteryFee = 0.03 * 1e18; address payable[] public lotteryRole; event DrawHero(address indexed to, uint32 level, uint32 strength, uint32 intelligence, uint32 agility); event DrawWeapon(address indexed to, uint32 level, uint32 strength, uint32 intelligence, uint32 agility); /* * @notice JoysLottery constructor pause lottery before add hero and weapon */ constructor(address _joys, address _joysHero, address _joysWeapon, address _heroMeta, address _weaponMeta, address _jackpot ) public { joys = JoysToken(_joys); joysHero = JoysNFT(_joysHero); joysWeapon = JoysNFT(_joysWeapon); heroMeta = JoysLotteryMeta(_heroMeta); weaponMeta = JoysLotteryMeta(_weaponMeta); nftJackpot = _jackpot; } function lotteryMemberCount() public view returns (uint256) { return lotteryRole.length; } function getRoleMember(uint256 index) public view returns (address payable) { require(lotteryMemberCount() > index, "JoysLottery: lottery role index out of bounds"); return lotteryRole[index]; } function hasRole(address account) private view returns (bool) { for(uint256 i = 0; i < lotteryMemberCount(); ++i) { if (getRoleMember(i) == account) { return true; } } return false; } function grantLotteryRole(address payable[] memory _account) onlyOwner public { for(uint32 idx = 0; idx < _account.length; ++idx) { lotteryRole.push(_account[idx]); } } function revokeLotteryRole(address payable account) onlyOwner public { for(uint256 i = 0; i < lotteryMemberCount(); ++i) { if (getRoleMember(i) == account) { address payable last = getRoleMember(lotteryMemberCount() -1); lotteryRole[i] = last; lotteryRole.pop(); } } } function setLotteryFee(uint256 _fee) onlyOwner public { require(lotteryFee != _fee, "JoysLottery:same fee."); lotteryFee = _fee; } function _randN(uint256 _seed, uint256 _min, uint256 _max, uint256 _offset) internal pure returns (uint256) { require(_max > _min, "JoysLottery:randN condition"); return UniformRandomNumber.uniform(_seed + _offset, (_max - _min).div(2)).add(_min); } function _randLevel(uint256 _seed, uint256 _max) internal pure returns (uint256) { return UniformRandomNumber.uniform(_seed, _max); } function _weightSlice(JoysLotteryMeta _meta, uint32 _step) private view returns (uint256 _sum) { uint32 idx = 0; for (uint32 i = _meta.length(); i > 0; i--) { idx++; uint256 w; (, , , , , , , w) = _meta.meta(i-1); _sum += w; if (idx >= _step) { break; } } return _sum; } function _parseLevel(uint256 _weight, JoysLotteryMeta _meta) private view returns(uint32) { // cal weight uint256[] memory calWeight = new uint256[](_meta.length()+1); for(uint32 i = 0; i < _meta.length(); i++) { calWeight[i] = _weightSlice(_meta, _meta.length()-i); } uint32 level; for (uint32 i = 0; i < calWeight.length; ++i) { uint256 w = calWeight[i]; level = i; if(_weight >= w) { if(i == 0) { // level = i + 1; return 1; } break; } if(_weight < w) { continue; } } return level; } function _draw(address _address, uint32 _requestId, JoysLotteryMeta _meta) private returns (uint32 level, uint32 strength, uint32 intelligence, uint32 agility) { uint256 weight; for (uint256 idx = 0; idx < _meta.length(); ++idx) { uint256 w; ( , , , , , , , w) = _meta.meta(idx); weight += w; } uint256 seed = randomNumber(_address, _requestId); // parse level level = _parseLevel(_randLevel(seed, weight), _meta); require(level > 0, "JoysLottery: with error level."); uint32 sMin; uint32 sMax; uint32 iMin; uint32 iMax; uint32 aMin; uint32 aMax; (, sMin, sMax, iMin, iMax, aMin, aMax, ) = _meta.meta(level-1); strength = _randN(seed, uint256(sMin), uint256(sMax), block.timestamp).toUint32(); intelligence = _randN(seed, uint256(iMin), uint256(iMax), block.gaslimit).toUint32(); agility = _randN(seed, uint256(aMin), uint256(aMax), block.difficulty).toUint32(); } // lottery hero function drawHero(address _address, uint32 _requestId) private returns (uint32, uint32, uint256) { uint32 a; uint32 b; uint32 c; uint32 d; (a,b,c,d) = _draw(_address, _requestId, heroMeta); joysHero.mint(_address, a, b, c, d); return (a, 0, 0); } // lottery weapon function drawWeapon(address _address, uint32 _requestId) private returns (uint32, uint32, uint256) { uint32 a; uint32 b; uint32 c; uint32 d; (a,b,c,d) = _draw(_address, _requestId, weaponMeta); joysWeapon.mint(_address, a, b, c, d); return (0, a, 0); } function setFee(uint256 _hero, uint256 _weapon) public onlyOwner { require(heroClaimFee != _hero || weaponClaimFee != _weapon, "JoysLottery: no need"); heroClaimFee = _hero; weaponClaimFee = _weapon; } function mintHero(uint32 _level, uint32 _strength, uint32 _intelligence, uint32 _agility) public onlyOwner { require(hlHero < HL_HERO, "JoysLottery: max high level hero."); require(_level <= heroMeta.length(), "JoysLottery: wrong level."); joysHero.mint(_msgSender(), _level, _strength, _intelligence, _agility); hlHero++; } function mintWeapon(uint32 _level, uint32 _strength, uint32 _intelligence, uint32 _agility) public onlyOwner { require(hlWeapon < HL_HERO, "JoysLottery: max high level weapon."); require(_level <= weaponMeta.length(), "JoysLottery: wrong level."); joysWeapon.mint(_msgSender(), _level, _strength, _intelligence, _agility); hlWeapon++; } /// @dev Gets the next consecutive request ID to be used /// @return requestId The ID to be used for the next request function _getNextRequestId() internal view returns (uint32 requestId) { uint256 len = reqBox[_msgSender()].length; requestId = len <= 0 ? 1 : reqBox[_msgSender()][len - 1].reqID.add(1).toUint32(); } /// @notice Checks if the request for randomness from the 3rd-party service has completed /// @dev For time-delayed requests, this function is used to check/confirm completion /// @param _requestId The ID of the request used to get the results of the RNG service /// @return state 0:not complete. 1:complete 2:expired function requestState(address _address, uint32 _requestId) public view returns (BoxState) { require(_address != address(0), "JoysLottery: invalid address."); require(_requestId > 0, "JoysLottery: zero request id."); uint256 len = requestCount(_address); require(len > 0, "JoysLottery: have no request."); require(_requestId <= len, "JoysLottery: invalid request id."); bool flag = false; uint256 idx = 0; for(uint256 i = len; i > 0; i--) { if (reqBox[_address][i-1].reqID == _requestId) { flag = true; idx = i-1; break; } } require(flag, "JoysLottery: don't have the special request id."); RequestInfo storage r = reqBox[_address][idx]; uint40 blockNumber = r.blockNumber; if (r.state == BoxState.Init) { if(block.number > blockNumber + REQ_DELAY_BLOCKS && block.number <= blockNumber + REQ_EXPIRATION_BLOCKS) { return BoxState.CanOpen; } else { return BoxState.Expired; } } return r.state; } /// @dev Gets a seed for a random number from the latest available blockhash /// @return seed The seed to be used for generating a random number function _getSeed(address _address, uint32 _requestId) internal virtual view returns (uint256 seed) { uint256 len = requestCount(_address); bool flag = false; uint256 idx = 0; for(uint256 i = len; i > 0; i--) { if (reqBox[_address][i-1].reqID == _requestId) { flag = true; idx = i-1; break; } } require(flag, "JoysLottery: gen seed error, no request id."); RequestInfo storage r = reqBox[_address][idx]; seed = uint256(blockhash(r.blockNumber + REQ_DELAY_BLOCKS)) + uint256(_address)+ _requestId; } /// @dev Stores the latest random number by request ID and logs the event /// @param _requestId The key of the special address request to store the random number /// @param _result The random number for the special key function _storeResult(address _address, uint32 _requestId, uint256 _result) internal returns (uint256) { // Store random value uint256 key = (uint256(_address) + _requestId); if (randomNumbers[key] == 0) { randomNumbers[key] = _result; } return randomNumbers[key]; } /// @notice Gets the random number produced by the 3rd-party service /// @param _requestId The ID of the request used to get the results of the RNG service /// @return randomNum The random number function randomNumber(address _address, uint32 _requestId) internal returns (uint256 randomNum) { return _storeResult(_address, _requestId, _getSeed(_address, _requestId)); } /** * @dev getBox. * * @notice request a box according to '_op' operation * @param _op The operation. */ function getBox(Operation _op) whenNotPaused nonReentrant public payable { require(msg.value >= lotteryFee, "JoysLottery: lottery fee limit."); require(lotteryMemberCount() > 0, "JoysLottery: no lottery role."); uint32 requestId = _getNextRequestId(); uint40 lockBlock = uint40(block.number); if(requestId > 1) { uint32 lastRequest = requestId -1; BoxState state = requestState(_msgSender(), lastRequest); require(state == BoxState.Opened || state == BoxState.Expired, "JoysLottery: invalid request."); if(state == BoxState.Expired) { for(uint256 i = reqBox[_msgSender()].length; i > 0; i--) { if(reqBox[_msgSender()][i-1].reqID == lastRequest) { reqBox[_msgSender()][i-1].state = BoxState.Expired; break; } } } } if (_op == Operation.notFreeDrawHero) { require(joys.balanceOf(_msgSender()) >= heroClaimFee, "JoysLottery: Insufficient joys token."); joys.transferFrom(_msgSender(), address(this), heroClaimFee); joys.burn(heroClaimFee.div(2)); joys.transfer(nftJackpot, heroClaimFee.div(2)); } else if (_op == Operation.notFreeDrawWeapon) { require(joys.balanceOf(_msgSender()) >= weaponClaimFee, "JoysLottery: Insufficient joys token."); joys.transferFrom(_msgSender(), address(this), weaponClaimFee); joys.burn(weaponClaimFee.div(2)); joys.transfer(nftJackpot, weaponClaimFee.div(2)); } else { require(false, "JoysLottery: invalid operation."); } // receive fee reqIdTracker.increment(); uint256 idx = reqIdTracker.current().mod(lotteryMemberCount()); _receive(getRoleMember(idx)); reqBox[_msgSender()].push(RequestInfo({ operation: _op, reqID: requestId, blockNumber: lockBlock, a:0, b:0, c:0, timestamp: 0, state: BoxState.Init })); } function _receive(address payable _address) private { _address.transfer(msg.value); } /** * @dev openBox. * * @notice request open box according to '_requestId', only lottery role. */ function openBox(address _address) public { require(hasRole(_msgSender()), "JoysLottery: have no privilege."); uint256 len = requestCount(_address); require(len > 0, "JoysLottery: have no box."); uint256 idx = len - 1; RequestInfo storage req = reqBox[_address][idx]; uint32 _requestId = req.reqID; require(requestState(_address, _requestId) == BoxState.CanOpen, "JoysLottery: invalid request state."); uint32 a; uint32 b; uint256 c; Operation _op = req.operation; if (_op == Operation.notFreeDrawHero) { (a, b, c) = drawHero(_address, _requestId); } else if (_op == Operation.notFreeDrawWeapon) { (a, b, c) = drawWeapon(_address, _requestId); } else { require(false, "JoysLottery: invalid operation."); } // update request box reqBox[_address][idx].a = a; reqBox[_address][idx].b = b; reqBox[_address][idx].c = c; reqBox[_address][idx].timestamp = block.timestamp; reqBox[_address][idx].state = BoxState.Opened; } function requestCount(address _address) public view returns (uint256){ return reqBox[_address].length; } function setAddress(address _joys, address _joysHero, address _joysWeapon, address _heroMeta, address _weaponMeta, address _jackpot ) public onlyOwner { joys = JoysToken(_joys); joysHero = JoysHero(_joysHero); joysWeapon = JoysWeapon(_joysWeapon); heroMeta = JoysLotteryMeta(_heroMeta); weaponMeta = JoysLotteryMeta(_weaponMeta); nftJackpot = _jackpot; } function recycleJoysToken(address _address) public onlyOwner { require(_address != address(0), "JoysLottery:Invalid address"); require(joys.balanceOf(address(this)) > 0, "JoysLottery:no JOYS"); joys.transfer(_address, joys.balanceOf(address(this))); } function transferJoysOwnership(address _address) public onlyOwner { require(_address != address(0), "JoysLottery:Invalid address"); joys.transferOwnership(_address); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; // JoysToken with Governance. contract JoysToken is ERC20("JoysToken", "JOYS"), Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // @notice Copied and modified from YAM code: // https://github.com/yam-finance/yam-protocol/blob/master/contracts/token/YAMGovernanceStorage.sol // https://github.com/yam-finance/yam-protocol/blob/master/contracts/token/YAMGovernance.sol // Which is copied and modified from COMPOUND: // https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/Comp.sol /// @dev A record of each accounts delegate mapping (address => address) internal _delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint256 votes; } /// @notice A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; /// @notice An event thats emitted when an account changes its delegate event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); /** * @notice JoysToken constructor with total supply 30 million */ constructor() public { uint256 totalSupply = 300000000 * 1e18; _mint(_msgSender(), totalSupply); } /** * @notice Burn _amount joys * @param _amount of Joys token to burn */ function burn(uint256 _amount) public onlyOwner { _burn(_msgSender(), _amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal override { _moveDelegates(_delegates[from], _delegates[to], amount); } /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegator The address to get delegatee for */ function delegates(address delegator) external view returns (address) { return _delegates[delegator]; } /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */ function delegate(address delegatee) external { return _delegate(msg.sender, delegatee); } /** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function delegateBySig( address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())), getChainId(), address(this) ) ); bytes32 structHash = keccak256( abi.encode( DELEGATION_TYPEHASH, delegatee, nonce, expiry ) ); bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", domainSeparator, structHash ) ); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "JOYS::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "JOYS::delegateBySig: invalid nonce"); require(now <= expiry, "JOYS::delegateBySig: signature expired"); return _delegate(signatory, delegatee); } /** * @notice Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */ function getCurrentVotes(address account) external view returns (uint256) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } /** * @notice Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at * @return The number of votes the account had as of the given block */ function getPriorVotes(address account, uint blockNumber) external view returns (uint256) { require(blockNumber < block.number, "JOYS::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _delegate(address delegator, address delegatee) internal { address currentDelegate = _delegates[delegator]; uint256 delegatorBalance = balanceOf(delegator); // balance of underlying JOYS (not scaled); _delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorBalance); } function _moveDelegates(address srcRep, address dstRep, uint256 amount) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { // decrease old representative uint32 srcRepNum = numCheckpoints[srcRep]; uint256 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint256 srcRepNew = srcRepOld.sub(amount); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { // increase new representative uint32 dstRepNum = numCheckpoints[dstRep]; uint256 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint256 dstRepNew = dstRepOld.add(amount); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint( address delegatee, uint32 nCheckpoints, uint256 oldVotes, uint256 newVotes ) internal { uint32 blockNumber = safe32(block.number, "JOYS::_writeCheckpoint: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function getChainId() internal pure returns (uint) { uint256 chainId; assembly { chainId := chainid() } return chainId; } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/presets/ERC721PresetMinterPauserAutoId.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract JoysNFT is ERC721PresetMinterPauserAutoId, Ownable { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // joys nft meta struct Meta { // the level of hero uint32 level; // strength uint32 sVal; // intelligence uint32 iVal; // agility uint32 aVal; } // mapping tokenID meta info mapping (uint256 => Meta) public metaSet; Counters.Counter private tokenIdTracker; /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_ROLE` to the * account that deploys the contract. * * Token URIs will be autogenerated based on `baseURI` and their token IDs. * See {ERC721-tokenURI}. */ constructor (string memory name, string memory symbol) public ERC721PresetMinterPauserAutoId(name, symbol, "") { } /** * @dev public function to set the base URI for all token IDs. It is * automatically added as a prefix to the value returned in {tokenURI}, * or to the token ID if {tokenURI} is empty. */ function setBaseURI(string memory _baseURI) onlyOwner public { _setBaseURI(_baseURI); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function setRoleAdmin(bytes32 role, bytes32 adminRole) onlyOwner public { _setRoleAdmin(role, adminRole); } /* * @dev Creates a new token for `to`. Its token ID will be automatically * assigned (and available on the emitted {IERC721-Transfer} event), and the token * URI autogenerated based on the base URI passed at construction. */ function mint(address _to, uint32 _level, uint32 _sVal, uint32 _iVal, uint32 _aVal) public { require(hasRole(MINTER_ROLE, _msgSender()), "JoysNFT: must have minter role to mint"); _mint(_to, tokenIdTracker.current()); metaSet[tokenIdTracker.current()] = Meta(_level, _sVal, _iVal, _aVal); tokenIdTracker.increment(); } /* * @dev not supported function */ function mint(address /*_to*/) public onlyOwner override(ERC721PresetMinterPauserAutoId) { require(false, "JoysNFT: not supported"); } /* * @dev query special token hero info */ function info(uint256 tokenId) public view returns (uint32, uint32, uint32, uint32) { require(_exists(tokenId), "JoysNFT: URI query for nonexistent token"); Meta storage m = metaSet[tokenId]; return (m.level, m.sVal, m.iVal, m.aVal); } } contract JoysHero is JoysNFT { /* * @notice JoysHero constructor */ constructor() public JoysNFT("JoysHero NFT", "JoysHero") { } } contract JoysWeapon is JoysNFT { /* * @notice JoysWeapon constructor */ constructor() public JoysNFT("JoysWeapon NFT", "JoysWeapon") { } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; import "@openzeppelin/contracts/access/Ownable.sol"; contract JoysLotteryMeta is Ownable { // events event LotteryMetaAdd(address indexed to, uint32 level, uint32 strengthMin, uint32 strengthMax, uint32 intelligenceMin, uint32 intelligenceMax, uint32 agilityMin, uint32 agilityMax, uint256 weight); event LotteryMetaUpdate(address indexed to, uint32 level, uint32 strengthMin, uint32 strengthMax, uint32 intelligenceMin, uint32 intelligenceMax, uint32 agilityMin, uint32 agilityMax, uint256 weight); // hero base info struct MetaInfo { // level uint32 level; // strength uint32 sMin; uint32 sMax; // intelligence uint32 iMin; uint32 iMax; // agility uint32 aMin; uint32 aMax; uint256 weight; } MetaInfo[] public metaInfo; mapping(uint32 => bool) public metaLevel; /** * @dev addMeta. * Requirements: only owner, when paused. * @notice add new meta info to contract * @param _level The meta level * @param _sMin The min strength value * @param _sMax The max strength value * @param _iMin The min intelligence value * @param _iMax The max intelligence value * @param _aMin The min agility value * @param _aMax The max agility value * @param _weight The meta weight */ function addMeta ( uint32 _level, uint32 _sMin, uint32 _sMax, uint32 _iMin, uint32 _iMax, uint32 _aMin, uint32 _aMax, uint256 _weight) onlyOwner public { require(_level > 0, "JoysLotteryMeta: The level starts at 1."); if (metaLevel[_level]) { return; } // new level must bigger than old if(metaInfo.length > 0) { require(_level > metaInfo[metaInfo.length - 1].level, "JoysLotteryMeta: new level must bigger than old"); require(_level == metaInfo[metaInfo.length - 1].level + 1, "JoysLotteryMeta: new level must bigger."); } metaInfo.push(MetaInfo({ level: _level, sMin: _sMin, sMax: _sMax, iMin: _iMin, iMax: _iMax, aMin: _aMin, aMax: _aMax, weight: _weight })); metaLevel[_level] = true; emit LotteryMetaAdd(_msgSender(), _level, _sMin, _sMax, _iMin, _iMax, _aMin, _aMax, _weight); } /** * @dev updateMeta. * Requirements: only owner, when paused. * @notice update special level meta info * @param _level The meta level * @param _sMin The min strength value * @param _sMax The max strength value * @param _iMin The min intelligence value * @param _iMax The max intelligence value * @param _aMin The min agility value * @param _aMax The max agility value * @param _weight The weight of the meta */ function updateMeta (uint32 _level, uint32 _sMin, uint32 _sMax, uint32 _iMin, uint32 _iMax, uint32 _aMin, uint32 _aMax, uint256 _weight) onlyOwner public { require(_level > 0 && _level <= length(), "JoysLotteryMeta: invalid index."); for (uint32 idx = 0; idx < metaInfo.length; ++idx) { if (metaInfo[idx].level == _level) { metaInfo[idx] = MetaInfo({ level: _level, sMin: _sMin, sMax: _sMax, iMin: _iMin, iMax: _iMax, aMin: _aMin, aMax: _aMax, weight: _weight }); break; } } emit LotteryMetaUpdate(_msgSender(), _level, _sMin, _sMax, _iMin, _iMax, _aMin, _aMax, _weight); } function length() public view returns (uint32) { return uint32(metaInfo.length); } function meta(uint256 _idx) public view returns (uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint256){ require(_idx < length(), "JoysLotteryMeta: invalid index."); MetaInfo storage m = metaInfo[_idx]; return (m.level, m.sMin, m.sMax, m.iMin, m.iMax, m.aMin, m.aMax, m.weight); } } contract JoysHeroLotteryMeta is JoysLotteryMeta { constructor() public { addMeta(1, 500, 800, 400, 600, 500, 800, 10000); addMeta(2, 1500, 1800, 1000, 1200, 1500, 1800, 5000); addMeta(3, 4000, 6000, 4000, 6000, 2500, 3500, 2000); addMeta(4, 7000, 9000, 9000, 10000, 6000, 7000, 500); addMeta(5, 10000, 11000, 10000, 12000, 9000, 10000, 100); addMeta(6, 18000, 20000, 18000, 20000, 16000, 18000, 5); } } contract JoysWeaponLotteryMeta is JoysLotteryMeta { // init weapon lottery meta constructor() public { addMeta(1, 500, 700, 600, 800, 600, 800, 10000); addMeta(2, 1800, 2000, 1600, 1800, 2000, 2200, 4000); addMeta(3, 3000, 4000, 2500, 3500, 3000, 4000, 2000); addMeta(4, 6000, 8000, 8000, 9000, 6000, 7000, 500); addMeta(5, 16000, 18000, 16000, 18000, 18000, 20000, 0); addMeta(6, 18000, 20000, 16000, 18000, 16000, 18000, 0); } }
/** Copyright 2019 PoolTogether LLC This file is part of PoolTogether. PoolTogether is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation under version 3 of the License. PoolTogether is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with PoolTogether. If not, see <https://www.gnu.org/licenses/>. */ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; /** * @author Brendan Asselstine * @notice A library that uses entropy to select a random number within a bound. Compensates for modulo bias. * @dev Thanks to https://medium.com/hownetworks/dont-waste-cycles-with-modulo-bias-35b6fdafcf94 */ library UniformRandomNumber { /// @notice Select a random number without modulo bias using a random seed and upper bound /// @param _entropy The seed for randomness /// @param _upperBound The upper bound of the desired number /// @return A random number less than the _upperBound function uniform(uint256 _entropy, uint256 _upperBound) internal pure returns (uint256) { require(_upperBound > 0, "UniformRand/min-bound"); uint256 min = -_upperBound % _upperBound; uint256 random = _entropy; while (true) { if (random >= min) { break; } random = uint256(keccak256(abi.encodePacked(random))); } return random % _upperBound; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.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.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @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) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @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 sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @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) { // 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 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts 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) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts 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) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts 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 mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "../../GSN/Context.sol"; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name, string memory symbol) public { _name = name; _symbol = symbol; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.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 GSN 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 payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "../utils/EnumerableSet.sol"; import "../utils/Address.sol"; import "../GSN/Context.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * 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 { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @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 {_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) public view returns (bool) { return _roles[role].members.contains(account); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view returns (uint256) { return _roles[role].members.length(); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view returns (address) { return _roles[role].members.at(index); } /** * @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 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 { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _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 { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _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 granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual { 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}. * ==== */ 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 { emit RoleAdminChanged(role, _roles[role].adminRole, adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "../GSN/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "../GSN/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor () internal { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!_paused, "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(_paused, "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. * * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing * all math on `uint256` and `int256` and then downcasting. */ library SafeCast { /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits"); return uint128(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits"); return uint64(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits"); return uint32(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits"); return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits. */ function toUint8(uint256 value) internal pure returns (uint8) { require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits"); return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { require(value >= 0, "SafeCast: value must be positive"); return uint256(value); } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits * * _Available since v3.1._ */ function toInt128(int256 value) internal pure returns (int128) { require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits"); return int128(value); } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits * * _Available since v3.1._ */ function toInt64(int256 value) internal pure returns (int64) { require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits"); return int64(value); } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits * * _Available since v3.1._ */ function toInt32(int256 value) internal pure returns (int32) { require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits"); return int32(value); } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits * * _Available since v3.1._ */ function toInt16(int256 value) internal pure returns (int16) { require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits"); return int16(value); } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits. * * _Available since v3.1._ */ function toInt8(int256 value) internal pure returns (int8) { require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits"); return int8(value); } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { require(value < 2**255, "SafeCast: value doesn't fit in an int256"); return int256(value); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () internal { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "../access/AccessControl.sol"; import "../GSN/Context.sol"; import "../utils/Counters.sol"; import "../token/ERC721/ERC721.sol"; import "../token/ERC721/ERC721Burnable.sol"; import "../token/ERC721/ERC721Pausable.sol"; /** * @dev {ERC721} token, including: * * - ability for holders to burn (destroy) their tokens * - a minter role that allows for token minting (creation) * - a pauser role that allows to stop all token transfers * - token ID and URI autogeneration * * This contract uses {AccessControl} to lock permissioned functions using the * different roles - head to its documentation for details. * * The account that deploys the contract will be granted the minter and pauser * roles, as well as the default admin role, which will let it grant both minter * and pauser roles to other accounts. */ contract ERC721PresetMinterPauserAutoId is Context, AccessControl, ERC721Burnable, ERC721Pausable { using Counters for Counters.Counter; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); Counters.Counter private _tokenIdTracker; /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_ROLE` to the * account that deploys the contract. * * Token URIs will be autogenerated based on `baseURI` and their token IDs. * See {ERC721-tokenURI}. */ constructor(string memory name, string memory symbol, string memory baseURI) public ERC721(name, symbol) { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(MINTER_ROLE, _msgSender()); _setupRole(PAUSER_ROLE, _msgSender()); _setBaseURI(baseURI); } /** * @dev Creates a new token for `to`. Its token ID will be automatically * assigned (and available on the emitted {IERC721-Transfer} event), and the token * URI autogenerated based on the base URI passed at construction. * * See {ERC721-_mint}. * * Requirements: * * - the caller must have the `MINTER_ROLE`. */ function mint(address to) public virtual { require(hasRole(MINTER_ROLE, _msgSender()), "ERC721PresetMinterPauserAutoId: must have minter role to mint"); // We cannot just use balanceOf to create the new tokenId because tokens // can be burned (destroyed), so we need a separate counter. _mint(to, _tokenIdTracker.current()); _tokenIdTracker.increment(); } /** * @dev Pauses all token transfers. * * See {ERC721Pausable} and {Pausable-_pause}. * * Requirements: * * - the caller must have the `PAUSER_ROLE`. */ function pause() public virtual { require(hasRole(PAUSER_ROLE, _msgSender()), "ERC721PresetMinterPauserAutoId: must have pauser role to pause"); _pause(); } /** * @dev Unpauses all token transfers. * * See {ERC721Pausable} and {Pausable-_unpause}. * * Requirements: * * - the caller must have the `PAUSER_ROLE`. */ function unpause() public virtual { require(hasRole(PAUSER_ROLE, _msgSender()), "ERC721PresetMinterPauserAutoId: must have pauser role to unpause"); _unpause(); } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override(ERC721, ERC721Pausable) { super._beforeTokenTransfer(from, to, tokenId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "../math/SafeMath.sol"; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented or decremented by one. 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;` * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath} * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never * directly accessed. */ library Counters { using SafeMath for uint256; 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 { // The {SafeMath} overflow check can be skipped here, see the comment at the top counter._value += 1; } function decrement(Counter storage counter) internal { counter._value = counter._value.sub(1); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "../../GSN/Context.sol"; import "./IERC721.sol"; import "./IERC721Metadata.sol"; import "./IERC721Enumerable.sol"; import "./IERC721Receiver.sol"; import "../../introspection/ERC165.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; import "../../utils/EnumerableSet.sol"; import "../../utils/EnumerableMap.sol"; import "../../utils/Strings.sol"; /** * @title ERC721 Non-Fungible Token Standard basic implementation * @dev see https://eips.ethereum.org/EIPS/eip-721 */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using SafeMath for uint256; using Address for address; using EnumerableSet for EnumerableSet.UintSet; using EnumerableMap for EnumerableMap.UintToAddressMap; using Strings for uint256; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` bytes4 private constant _ERC721_RECEIVED = 0x150b7a02; // Mapping from holder address to their (enumerable) set of owned tokens mapping (address => EnumerableSet.UintSet) private _holderTokens; // Enumerable mapping from token ids to their owners EnumerableMap.UintToAddressMap private _tokenOwners; // Mapping from token ID to approved address mapping (uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping (address => mapping (address => bool)) private _operatorApprovals; // Token name string private _name; // Token symbol string private _symbol; // Optional mapping for token URIs mapping (uint256 => string) private _tokenURIs; // Base URI string private _baseURI; /* * bytes4(keccak256('balanceOf(address)')) == 0x70a08231 * bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e * bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3 * bytes4(keccak256('getApproved(uint256)')) == 0x081812fc * bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465 * bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5 * bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd * bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e * bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde * * => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^ * 0xa22cb465 ^ 0xe985e9c5 ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd */ bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd; /* * bytes4(keccak256('name()')) == 0x06fdde03 * bytes4(keccak256('symbol()')) == 0x95d89b41 * bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd * * => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f */ bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f; /* * bytes4(keccak256('totalSupply()')) == 0x18160ddd * bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59 * bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7 * * => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63 */ bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor (string memory name, string memory symbol) public { _name = name; _symbol = symbol; // register the supported interfaces to conform to ERC721 via ERC165 _registerInterface(_INTERFACE_ID_ERC721); _registerInterface(_INTERFACE_ID_ERC721_METADATA); _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _holderTokens[owner].length(); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token"); } /** * @dev See {IERC721Metadata-name}. */ function name() public view override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory _tokenURI = _tokenURIs[tokenId]; // If there is no base URI, return the token URI. if (bytes(_baseURI).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). if (bytes(_tokenURI).length > 0) { return string(abi.encodePacked(_baseURI, _tokenURI)); } // If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI. return string(abi.encodePacked(_baseURI, tokenId.toString())); } /** * @dev Returns the base URI set via {_setBaseURI}. This will be * automatically added as a prefix in {tokenURI} to each token's URI, or * to the token ID if no specific URI is set for that token ID. */ function baseURI() public view returns (string memory) { return _baseURI; } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { return _holderTokens[owner].at(index); } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view override returns (uint256) { // _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds return _tokenOwners.length(); } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view override returns (uint256) { (uint256 tokenId, ) = _tokenOwners.at(index); return tokenId; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view returns (bool) { return _tokenOwners.contains(tokenId); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: d* * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual { _mint(to, tokenId); require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _holderTokens[to].add(tokenId); _tokenOwners.set(tokenId, to); emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); // Clear metadata (if any) if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } _holderTokens[owner].remove(tokenId); _tokenOwners.remove(tokenId); emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal virtual { require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _holderTokens[from].remove(tokenId); _holderTokens[to].add(tokenId); _tokenOwners.set(tokenId, to); emit Transfer(from, to, tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token"); _tokenURIs[tokenId] = _tokenURI; } /** * @dev Internal function to set the base URI for all token IDs. It is * automatically added as a prefix to the value returned in {tokenURI}, * or to the token ID if {tokenURI} is empty. */ function _setBaseURI(string memory baseURI_) internal virtual { _baseURI = baseURI_; } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) private returns (bool) { if (!to.isContract()) { return true; } bytes memory returndata = to.functionCall(abi.encodeWithSelector( IERC721Receiver(to).onERC721Received.selector, _msgSender(), from, tokenId, _data ), "ERC721: transfer to non ERC721Receiver implementer"); bytes4 retval = abi.decode(returndata, (bytes4)); return (retval == _ERC721_RECEIVED); } function _approve(address to, uint256 tokenId) private { _tokenApprovals[tokenId] = to; emit Approval(ownerOf(tokenId), to, tokenId); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; import "../../introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.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); }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; import "./IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; import "./IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts may inherit from this and call {_registerInterface} to declare * their support of an interface. */ contract ERC165 is IERC165 { /* * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7 */ bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7; /** * @dev Mapping of interface ids to whether or not it's supported. */ mapping(bytes4 => bool) private _supportedInterfaces; constructor () internal { // Derived contracts need only register support for their own interfaces, // we register support for ERC165 itself here _registerInterface(_INTERFACE_ID_ERC165); } /** * @dev See {IERC165-supportsInterface}. * * Time complexity O(1), guaranteed to always use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) public view override returns (bool) { return _supportedInterfaces[interfaceId]; } /** * @dev Registers the contract as an implementer of the interface defined by * `interfaceId`. Support of the actual ERC165 interface is automatic and * registering its interface id is not required. * * See {IERC165-supportsInterface}. * * Requirements: * * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`). */ function _registerInterface(bytes4 interfaceId) internal virtual { require(interfaceId != 0xffffffff, "ERC165: invalid interface id"); _supportedInterfaces[interfaceId] = true; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Library for managing an enumerable variant of Solidity's * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`] * type. * * Maps have the following properties: * * - Entries are added, removed, and checked for existence in constant time * (O(1)). * - Entries are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableMap for EnumerableMap.UintToAddressMap; * * // Declare a set state variable * EnumerableMap.UintToAddressMap private myMap; * } * ``` * * As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are * supported. */ library EnumerableMap { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Map type with // bytes32 keys and values. // The Map implementation uses private functions, and user-facing // implementations (such as Uint256ToAddressMap) are just wrappers around // the underlying Map. // This means that we can only create new EnumerableMaps for types that fit // in bytes32. struct MapEntry { bytes32 _key; bytes32 _value; } struct Map { // Storage of map keys and values MapEntry[] _entries; // Position of the entry defined by a key in the `entries` array, plus 1 // because index 0 means a key is not in the map. mapping (bytes32 => uint256) _indexes; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) { // We read and store the key's index to prevent multiple reads from the same storage slot uint256 keyIndex = map._indexes[key]; if (keyIndex == 0) { // Equivalent to !contains(map, key) map._entries.push(MapEntry({ _key: key, _value: value })); // The entry is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value map._indexes[key] = map._entries.length; return true; } else { map._entries[keyIndex - 1]._value = value; return false; } } /** * @dev Removes a key-value pair from a map. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function _remove(Map storage map, bytes32 key) private returns (bool) { // We read and store the key's index to prevent multiple reads from the same storage slot uint256 keyIndex = map._indexes[key]; if (keyIndex != 0) { // Equivalent to contains(map, key) // To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one // in the array, and then remove the last entry (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = keyIndex - 1; uint256 lastIndex = map._entries.length - 1; // When the entry to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. MapEntry storage lastEntry = map._entries[lastIndex]; // Move the last entry to the index where the entry to delete is map._entries[toDeleteIndex] = lastEntry; // Update the index for the moved entry map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved entry was stored map._entries.pop(); // Delete the index for the deleted slot delete map._indexes[key]; return true; } else { return false; } } /** * @dev Returns true if the key is in the map. O(1). */ function _contains(Map storage map, bytes32 key) private view returns (bool) { return map._indexes[key] != 0; } /** * @dev Returns the number of key-value pairs in the map. O(1). */ function _length(Map storage map) private view returns (uint256) { return map._entries.length; } /** * @dev Returns the key-value pair stored at position `index` in the map. O(1). * * Note that there are no guarantees on the ordering of entries inside the * array, and it may change when more entries are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) { require(map._entries.length > index, "EnumerableMap: index out of bounds"); MapEntry storage entry = map._entries[index]; return (entry._key, entry._value); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function _get(Map storage map, bytes32 key) private view returns (bytes32) { return _get(map, key, "EnumerableMap: nonexistent key"); } /** * @dev Same as {_get}, with a custom error message when `key` is not in the map. */ function _get(Map storage map, bytes32 key, string memory errorMessage) private view returns (bytes32) { uint256 keyIndex = map._indexes[key]; require(keyIndex != 0, errorMessage); // Equivalent to contains(map, key) return map._entries[keyIndex - 1]._value; // All indexes are 1-based } // UintToAddressMap struct UintToAddressMap { Map _inner; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) { return _set(map._inner, bytes32(key), bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) { return _remove(map._inner, bytes32(key)); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) { return _contains(map._inner, bytes32(key)); } /** * @dev Returns the number of elements in the map. O(1). */ function length(UintToAddressMap storage map) internal view returns (uint256) { return _length(map._inner); } /** * @dev Returns the element stored at position `index` in the set. O(1). * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) { (bytes32 key, bytes32 value) = _at(map._inner, index); return (uint256(key), address(uint256(value))); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(UintToAddressMap storage map, uint256 key) internal view returns (address) { return address(uint256(_get(map._inner, bytes32(key)))); } /** * @dev Same as {get}, with a custom error message when `key` is not in the map. */ function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) { return address(uint256(_get(map._inner, bytes32(key), errorMessage))); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev String operations. */ library Strings { /** * @dev Converts a `uint256` to its ASCII `string` 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); uint256 index = digits - 1; temp = value; while (temp != 0) { buffer[index--] = byte(uint8(48 + temp % 10)); temp /= 10; } return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "../../GSN/Context.sol"; import "./ERC721.sol"; /** * @title ERC721 Burnable Token * @dev ERC721 Token that can be irreversibly burned (destroyed). */ abstract contract ERC721Burnable is Context, ERC721 { /** * @dev Burns `tokenId`. See {ERC721-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved"); _burn(tokenId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "./ERC721.sol"; import "../../utils/Pausable.sol"; /** * @dev ERC721 token with pausable token transfers, minting and burning. * * Useful for scenarios such as preventing trades until the end of an evaluation * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. */ abstract contract ERC721Pausable is ERC721, Pausable { /** * @dev See {ERC721-_beforeTokenTransfer}. * * Requirements: * * - the contract must not be paused. */ function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); require(!paused(), "ERC721Pausable: token transfer while paused"); } }
{ "metadata": { "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_joys","type":"address"},{"internalType":"address","name":"_joysHero","type":"address"},{"internalType":"address","name":"_joysWeapon","type":"address"},{"internalType":"address","name":"_heroMeta","type":"address"},{"internalType":"address","name":"_weaponMeta","type":"address"},{"internalType":"address","name":"_jackpot","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint32","name":"level","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"strength","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"intelligence","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"agility","type":"uint32"}],"name":"DrawHero","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint32","name":"level","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"strength","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"intelligence","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"agility","type":"uint32"}],"name":"DrawWeapon","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"HL_HERO","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HL_WEAPON","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum JoysLotteryNew.Operation","name":"_op","type":"uint8"}],"name":"getBox","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable[]","name":"_account","type":"address[]"}],"name":"grantLotteryRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"heroClaimFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"heroMeta","outputs":[{"internalType":"contract JoysLotteryMeta","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hlHero","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hlWeapon","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"joys","outputs":[{"internalType":"contract JoysToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"joysHero","outputs":[{"internalType":"contract JoysNFT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"joysWeapon","outputs":[{"internalType":"contract JoysNFT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lotteryFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lotteryMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lotteryRole","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_level","type":"uint32"},{"internalType":"uint32","name":"_strength","type":"uint32"},{"internalType":"uint32","name":"_intelligence","type":"uint32"},{"internalType":"uint32","name":"_agility","type":"uint32"}],"name":"mintHero","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_level","type":"uint32"},{"internalType":"uint32","name":"_strength","type":"uint32"},{"internalType":"uint32","name":"_intelligence","type":"uint32"},{"internalType":"uint32","name":"_agility","type":"uint32"}],"name":"mintWeapon","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nftJackpot","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"openBox","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"randomNumbers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"recycleJoysToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"reqBox","outputs":[{"internalType":"enum JoysLotteryNew.Operation","name":"operation","type":"uint8"},{"internalType":"uint32","name":"reqID","type":"uint32"},{"internalType":"uint40","name":"blockNumber","type":"uint40"},{"internalType":"uint32","name":"a","type":"uint32"},{"internalType":"uint32","name":"b","type":"uint32"},{"internalType":"uint256","name":"c","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"enum JoysLotteryNew.BoxState","name":"state","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reqIdTracker","outputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"requestCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint32","name":"_requestId","type":"uint32"}],"name":"requestState","outputs":[{"internalType":"enum JoysLotteryNew.BoxState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"revokeLotteryRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_joys","type":"address"},{"internalType":"address","name":"_joysHero","type":"address"},{"internalType":"address","name":"_joysWeapon","type":"address"},{"internalType":"address","name":"_heroMeta","type":"address"},{"internalType":"address","name":"_weaponMeta","type":"address"},{"internalType":"address","name":"_jackpot","type":"address"}],"name":"setAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_hero","type":"uint256"},{"internalType":"uint256","name":"_weapon","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setLotteryFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"transferJoysOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weaponClaimFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weaponMeta","outputs":[{"internalType":"contract JoysLotteryMeta","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040526802b5e3af16b18800006002556802b5e3af16b1880000600355666a94d74f430000600d553480156200003657600080fd5b5060405162003a3238038062003a32833981810160405260c08110156200005c57600080fd5b508051602082015160408301516060840151608085015160a09095015160016000818155815460ff191690915594959394929391926200009b62000164565b60018054610100600160a81b0319166101006001600160a01b03841690810291909117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600480546001600160a01b03199081166001600160a01b039889161790915560058054821696881696909617909555600680548616948716949094179093556007805485169286169290921790915560088054841691851691909117905560098054909216921691909117905562000168565b3390565b6138ba80620001786000396000f3fe60806040526004361061020f5760003560e01c80637392ddd011610118578063ceaa4aa8116100a0578063ecdb14811161006f578063ecdb1481146107e4578063ef0dab7214610804578063efbf225f146102ed578063f2fde38b14610819578063fda725521461084c5761020f565b8063ceaa4aa81461073f578063debb9d2814610787578063e477cff6146107ba578063e4963fb3146107cf5761020f565b80639a9d60dc116100e75780639a9d60dc14610600578063aeeb7f0714610633578063c6aabdde14610666578063c79414d41461067b578063c89782cc1461072a5761020f565b80637392ddd01461059757806378aa08ed146105ac5780638da5cb5b146105c1578063916fd42e146105d65761020f565b806350515f051161019b5780635c975abb1161016a5780635c975abb146104e75780636cc1799b14610510578063715018a61461055857806371aaa27b1461056d5780637314396c146105825761020f565b806350515f0514610445578063517258d0146104785780635257cd901461048d57806352f7c988146104b75761020f565b806311c1e960116101e257806311c1e96014610349578063190625d7146103a957806328bc4bf1146103dc5780634a67fa7d146103f15780634c30215b1461041b5761020f565b806307058370146102145780630c34490d146102c65780630cab37d3146102ed57806310e2d49214610318575b600080fd5b34801561022057600080fd5b506102c46004803603602081101561023757600080fd5b81019060208101813564010000000081111561025257600080fd5b82018360208201111561026457600080fd5b8035906020019184602083028401116401000000008311171561028657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506108a7945050505050565b005b3480156102d257600080fd5b506102db610973565b60408051918252519081900360200190f35b3480156102f957600080fd5b50610302610979565b6040805160ff9092168252519081900360200190f35b34801561032457600080fd5b5061032d61097e565b604080516001600160a01b039092168252519081900360200190f35b34801561035557600080fd5b506103886004803603604081101561036c57600080fd5b5080356001600160a01b0316906020013563ffffffff1661098d565b6040518082600381111561039857fe5b815260200191505060405180910390f35b3480156103b557600080fd5b506102c4600480360360208110156103cc57600080fd5b50356001600160a01b0316610c6e565b3480156103e857600080fd5b5061032d611013565b3480156103fd57600080fd5b506102c46004803603602081101561041457600080fd5b5035611022565b34801561042757600080fd5b5061032d6004803603602081101561043e57600080fd5b50356110d3565b34801561045157600080fd5b506102c46004803603602081101561046857600080fd5b50356001600160a01b0316611144565b34801561048457600080fd5b5061032d6113c0565b34801561049957600080fd5b506102db600480360360208110156104b057600080fd5b50356113cf565b3480156104c357600080fd5b506102c4600480360360408110156104da57600080fd5b50803590602001356113e1565b3480156104f357600080fd5b506104fc6114a4565b604080519115158252519081900360200190f35b34801561051c57600080fd5b506102c46004803603608081101561053357600080fd5b5063ffffffff81358116916020810135821691604082013581169160600135166114ad565b34801561056457600080fd5b506102c46116ed565b34801561057957600080fd5b5061030261179a565b34801561058e57600080fd5b5061032d6117aa565b3480156105a357600080fd5b506102db6117b9565b3480156105b857600080fd5b506102db6117bf565b3480156105cd57600080fd5b5061032d6117c5565b3480156105e257600080fd5b5061032d600480360360208110156105f957600080fd5b50356117d9565b34801561060c57600080fd5b506102c46004803603602081101561062357600080fd5b50356001600160a01b0316611800565b34801561063f57600080fd5b506102c46004803603602081101561065657600080fd5b50356001600160a01b0316611937565b34801561067257600080fd5b506102db611a52565b34801561068757600080fd5b506106b46004803603604081101561069e57600080fd5b506001600160a01b038135169060200135611a58565b604051808960048111156106c457fe5b81526020018863ffffffff1681526020018764ffffffffff1681526020018663ffffffff1681526020018563ffffffff16815260200184815260200183815260200182600381111561071257fe5b81526020019850505050505050505060405180910390f35b34801561073657600080fd5b5061032d611ad3565b34801561074b57600080fd5b506102c46004803603608081101561076257600080fd5b5063ffffffff8135811691602081013582169160408201358116916060013516611ae2565b34801561079357600080fd5b506102db600480360360208110156107aa57600080fd5b50356001600160a01b0316611d22565b3480156107c657600080fd5b506102db611d3d565b3480156107db57600080fd5b50610302611d43565b6102c4600480360360208110156107fa57600080fd5b503560ff16611d53565b34801561081057600080fd5b5061032d6126de565b34801561082557600080fd5b506102c46004803603602081101561083c57600080fd5b50356001600160a01b03166126ed565b34801561085857600080fd5b506102c4600480360360c081101561086f57600080fd5b506001600160a01b038135811691602081013582169160408201358116916060810135821691608082013581169160a00135166127f6565b6108af6128c2565b60015461010090046001600160a01b03908116911614610904576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b60005b81518163ffffffff16101561096f57600e828263ffffffff168151811061092a57fe5b60209081029190910181015182546001808201855560009485529290932090920180546001600160a01b0319166001600160a01b039093169290921790915501610907565b5050565b60035481565b606381565b6006546001600160a01b031681565b60006001600160a01b0383166109ea576040805162461bcd60e51b815260206004820152601d60248201527f4a6f79734c6f74746572793a20696e76616c696420616464726573732e000000604482015290519081900360640190fd5b60008263ffffffff1611610a45576040805162461bcd60e51b815260206004820152601d60248201527f4a6f79734c6f74746572793a207a65726f20726571756573742069642e000000604482015290519081900360640190fd5b6000610a5084611d22565b905060008111610aa7576040805162461bcd60e51b815260206004820152601d60248201527f4a6f79734c6f74746572793a2068617665206e6f20726571756573742e000000604482015290519081900360640190fd5b808363ffffffff161115610b02576040805162461bcd60e51b815260206004820181905260248201527f4a6f79734c6f74746572793a20696e76616c696420726571756573742069642e604482015290519081900360640190fd5b600080825b8015610b78576001600160a01b0387166000908152600a60205260409020805463ffffffff881691906000198401908110610b3e57fe5b6000918252602090912060049091020154610100900463ffffffff161415610b6f5760019250600181039150610b78565b60001901610b07565b5081610bb55760405162461bcd60e51b815260040180806020018281038252602f815260200180613759602f913960400191505060405180910390fd5b6001600160a01b0386166000908152600a60205260408120805483908110610bd957fe5b600091825260208220600490910201805490925064ffffffffff600160281b909104169060038084015460ff1690811115610c1057fe5b1415610c5a5760038164ffffffffff160143118015610c39575060fa8164ffffffffff16014311155b15610c4c57600195505050505050610c68565b600395505050505050610c68565b506003015460ff1693505050505b92915050565b610c7e610c796128c2565b6128c6565b610ccf576040805162461bcd60e51b815260206004820152601f60248201527f4a6f79734c6f74746572793a2068617665206e6f2070726976696c6567652e00604482015290519081900360640190fd5b6000610cda82611d22565b905060008111610d31576040805162461bcd60e51b815260206004820152601960248201527f4a6f79734c6f74746572793a2068617665206e6f20626f782e00000000000000604482015290519081900360640190fd5b6001600160a01b0382166000908152600a602052604081208054600019840192919083908110610d5d57fe5b600091825260209091206004909102018054909150610100900463ffffffff166001610d89868361098d565b6003811115610d9457fe5b14610dd05760405162461bcd60e51b81526004018080602001828103825260238152602001806137886023913960400191505060405180910390fd5b81546000908190819060ff166003816004811115610dea57fe5b1415610e0657610dfa8986612916565b91955093509150610e71565b6004816004811115610e1457fe5b1415610e2457610dfa8986612a17565b6040805162461bcd60e51b815260206004820152601f60248201527f4a6f79734c6f74746572793a20696e76616c6964206f7065726174696f6e2e00604482015290519081900360640190fd5b6001600160a01b0389166000908152600a60205260409020805485919089908110610e9857fe5b9060005260206000209060040201600001600a6101000a81548163ffffffff021916908363ffffffff16021790555082600a60008b6001600160a01b03166001600160a01b031681526020019081526020016000208881548110610ef857fe5b9060005260206000209060040201600001600e6101000a81548163ffffffff021916908363ffffffff16021790555081600a60008b6001600160a01b03166001600160a01b031681526020019081526020016000208881548110610f5857fe5b90600052602060002090600402016001018190555042600a60008b6001600160a01b03166001600160a01b031681526020019081526020016000208881548110610f9e57fe5b6000918252602080832060026004909302018201939093556001600160a01b038c168252600a90925260409020805489908110610fd757fe5b906000526020600020906004020160030160006101000a81548160ff0219169083600381111561100357fe5b0217905550505050505050505050565b6005546001600160a01b031681565b61102a6128c2565b60015461010090046001600160a01b0390811691161461107f576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b80600d5414156110ce576040805162461bcd60e51b81526020600482015260156024820152742537bcb9a637ba3a32b93c9d39b0b6b2903332b29760591b604482015290519081900360640190fd5b600d55565b6000816110de611d3d565b1161111a5760405162461bcd60e51b815260040180806020018281038252602d815260200180613706602d913960400191505060405180910390fd5b600e828154811061112757fe5b6000918252602090912001546001600160a01b031690505b919050565b61114c6128c2565b60015461010090046001600160a01b039081169116146111a1576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b6001600160a01b0381166111fc576040805162461bcd60e51b815260206004820152601b60248201527f4a6f79734c6f74746572793a496e76616c696420616464726573730000000000604482015290519081900360640190fd5b60048054604080516370a0823160e01b81523093810193909352516000926001600160a01b03909216916370a08231916024808301926020929190829003018186803b15801561124b57600080fd5b505afa15801561125f573d6000803e3d6000fd5b505050506040513d602081101561127557600080fd5b5051116112bf576040805162461bcd60e51b81526020600482015260136024820152724a6f79734c6f74746572793a6e6f204a4f595360681b604482015290519081900360640190fd5b60048054604080516370a0823160e01b81523093810193909352516001600160a01b039091169163a9059cbb91849184916370a0823191602480820192602092909190829003018186803b15801561131657600080fd5b505afa15801561132a573d6000803e3d6000fd5b505050506040513d602081101561134057600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561139157600080fd5b505af11580156113a5573d6000803e3d6000fd5b505050506040513d60208110156113bb57600080fd5b505050565b6008546001600160a01b031681565b600c6020526000908152604090205481565b6113e96128c2565b60015461010090046001600160a01b0390811691161461143e576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b8160025414158061145157508060035414155b611499576040805162461bcd60e51b8152602060048201526014602482015273129bde5cd31bdd1d195c9e4e881b9bc81b99595960621b604482015290519081900360640190fd5b600291909155600355565b60015460ff1690565b6114b56128c2565b60015461010090046001600160a01b0390811691161461150a576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b6001546063600160b01b90910460ff16106115565760405162461bcd60e51b815260040180806020018281038252602381526020018061383d6023913960400191505060405180910390fd5b600860009054906101000a90046001600160a01b03166001600160a01b0316631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b1580156115a457600080fd5b505afa1580156115b8573d6000803e3d6000fd5b505050506040513d60208110156115ce57600080fd5b505163ffffffff908116908516111561162a576040805162461bcd60e51b81526020600482015260196024820152782537bcb9a637ba3a32b93c9d103bb937b733903632bb32b61760391b604482015290519081900360640190fd5b6006546001600160a01b0316630bf790996116436128c2565b604080516001600160e01b031960e085901b1681526001600160a01b03909216600483015263ffffffff808916602484015280881660448401528087166064840152851660848301525160a480830192600092919082900301818387803b1580156116ad57600080fd5b505af11580156116c1573d6000803e3d6000fd5b50506001805460ff600160b01b808304821684019091160260ff60b01b19909116179055505050505050565b6116f56128c2565b60015461010090046001600160a01b0390811691161461174a576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b60015460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360018054610100600160a81b0319169055565b600154600160b01b900460ff1681565b6004546001600160a01b031681565b60025481565b600d5481565b60015461010090046001600160a01b031690565b600e81815481106117e657fe5b6000918252602090912001546001600160a01b0316905081565b6118086128c2565b60015461010090046001600160a01b0390811691161461185d576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b6001600160a01b0381166118b8576040805162461bcd60e51b815260206004820152601b60248201527f4a6f79734c6f74746572793a496e76616c696420616464726573730000000000604482015290519081900360640190fd5b600460009054906101000a90046001600160a01b03166001600160a01b031663f2fde38b826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561191c57600080fd5b505af1158015611930573d6000803e3d6000fd5b5050505050565b61193f6128c2565b60015461010090046001600160a01b03908116911614611994576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b60005b61199f611d3d565b81101561096f57816001600160a01b03166119b9826110d3565b6001600160a01b03161415611a4a5760006119dd60016119d7611d3d565b036110d3565b905080600e83815481106119ed57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600e805480611a2657fe5b600082815260209020810160001990810180546001600160a01b0319169055019055505b600101611997565b600b5481565b600a6020528160005260406000208181548110611a7157fe5b6000918252602090912060049091020180546001820154600283015460039093015460ff808416965063ffffffff61010085048116965064ffffffffff600160281b86041695600160501b8604821695600160701b9004909116939290911688565b6009546001600160a01b031681565b611aea6128c2565b60015461010090046001600160a01b03908116911614611b3f576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b6001546063600160a81b90910460ff1610611b8b5760405162461bcd60e51b81526004018080602001828103825260218152602001806137d66021913960400191505060405180910390fd5b600760009054906101000a90046001600160a01b03166001600160a01b0316631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b158015611bd957600080fd5b505afa158015611bed573d6000803e3d6000fd5b505050506040513d6020811015611c0357600080fd5b505163ffffffff9081169085161115611c5f576040805162461bcd60e51b81526020600482015260196024820152782537bcb9a637ba3a32b93c9d103bb937b733903632bb32b61760391b604482015290519081900360640190fd5b6005546001600160a01b0316630bf79099611c786128c2565b604080516001600160e01b031960e085901b1681526001600160a01b03909216600483015263ffffffff808916602484015280881660448401528087166064840152851660848301525160a480830192600092919082900301818387803b158015611ce257600080fd5b505af1158015611cf6573d6000803e3d6000fd5b50506001805460ff600160a81b808304821684019091160260ff60a81b19909116179055505050505050565b6001600160a01b03166000908152600a602052604090205490565b600e5490565b600154600160a81b900460ff1681565b60015460ff1615611d9e576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b60026000541415611df6576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600055600d54341015611e52576040805162461bcd60e51b815260206004820152601f60248201527f4a6f79734c6f74746572793a206c6f747465727920666565206c696d69742e00604482015290519081900360640190fd5b6000611e5c611d3d565b11611eae576040805162461bcd60e51b815260206004820152601d60248201527f4a6f79734c6f74746572793a206e6f206c6f747465727920726f6c652e000000604482015290519081900360640190fd5b6000611eb8612b19565b905043600163ffffffff831611156120825760001982016000611ee2611edc6128c2565b8361098d565b90506002816003811115611ef257fe5b1480611f0957506003816003811115611f0757fe5b145b611f5a576040805162461bcd60e51b815260206004820152601d60248201527f4a6f79734c6f74746572793a20696e76616c696420726571756573742e000000604482015290519081900360640190fd5b6003816003811115611f6857fe5b141561207f576000600a6000611f7c6128c2565b6001600160a01b0316815260208101919091526040016000205490505b801561207d578263ffffffff16600a6000611fb26128c2565b6001600160a01b03166001600160a01b031681526020019081526020016000206001830381548110611fe057fe5b6000918252602090912060049091020154610100900463ffffffff161415612074576003600a60006120106128c2565b6001600160a01b03166001600160a01b03168152602001908152602001600020600183038154811061203e57fe5b906000526020600020906004020160030160006101000a81548160ff0219169083600381111561206a57fe5b021790555061207d565b60001901611f99565b505b50505b600383600481111561209057fe5b141561230a576002546004546001600160a01b03166370a082316120b26128c2565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156120ef57600080fd5b505afa158015612103573d6000803e3d6000fd5b505050506040513d602081101561211957600080fd5b505110156121585760405162461bcd60e51b81526004018080602001828103825260258152602001806138606025913960400191505060405180910390fd5b6004546001600160a01b03166323b872dd6121716128c2565b306002546040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050602060405180830381600087803b1580156121cb57600080fd5b505af11580156121df573d6000803e3d6000fd5b505050506040513d60208110156121f557600080fd5b5050600454600280546001600160a01b03909216916342966c689161221a9190612bc5565b6040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561225057600080fd5b505af1158015612264573d6000803e3d6000fd5b5050600454600954600280546001600160a01b03938416955063a9059cbb9450929091169161229291612bc5565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156122d857600080fd5b505af11580156122ec573d6000803e3d6000fd5b505050506040513d602081101561230257600080fd5b506125199050565b600483600481111561231857fe5b1415610e24576003546004546001600160a01b03166370a0823161233a6128c2565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561237757600080fd5b505afa15801561238b573d6000803e3d6000fd5b505050506040513d60208110156123a157600080fd5b505110156123e05760405162461bcd60e51b81526004018080602001828103825260258152602001806138606025913960400191505060405180910390fd5b6004546001600160a01b03166323b872dd6123f96128c2565b306003546040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050602060405180830381600087803b15801561245357600080fd5b505af1158015612467573d6000803e3d6000fd5b505050506040513d602081101561247d57600080fd5b50506004546003546001600160a01b03909116906342966c68906124a2906002612bc5565b6040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156124d857600080fd5b505af11580156124ec573d6000803e3d6000fd5b50506004546009546003546001600160a01b03928316945063a9059cbb9350911690612292906002612bc5565b612523600b612c0e565b6000612540612530611d3d565b61253a600b612c17565b90612c1b565b905061255361254e826110d3565b612c5d565b600a600061255f6128c2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060405180610100016040528086600481111561259757fe5b815263ffffffff8616602082015264ffffffffff851660408201526000606082018190526080820181905260a0820181905260c0820181905260e09091015281546001818101845560009384526020909320825160049283029091018054939490939192849260ff19169190849081111561260e57fe5b02179055506020820151815460408401516060850151608086015164ffffffff001990931661010063ffffffff958616021769ffffffffff00000000001916600160281b64ffffffffff909316929092029190911763ffffffff60501b1916600160501b918416919091021763ffffffff60701b1916600160701b929091169190910217815560a082015160018083019190915560c0830151600283015560e0830151600380840180549293909260ff19169184908111156126cc57fe5b02179055505060016000555050505050565b6007546001600160a01b031681565b6126f56128c2565b60015461010090046001600160a01b0390811691161461274a576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b6001600160a01b03811661278f5760405162461bcd60e51b81526004018080602001828103825260268152602001806137336026913960400191505060405180910390fd5b6001546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6127fe6128c2565b60015461010090046001600160a01b03908116911614612853576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b600480546001600160a01b03199081166001600160a01b0398891617909155600580548216968816969096179095556006805486169487169490941790935560078054851692861692909217909155600880548416918516919091179055600980549092169216919091179055565b3390565b6000805b6128d2611d3d565b81101561290d57826001600160a01b03166128ec826110d3565b6001600160a01b0316141561290557600191505061113f565b6001016128ca565b50600092915050565b60008060008060008060006129418989600760009054906101000a90046001600160a01b0316612c92565b80945081955082965083975050505050600560009054906101000a90046001600160a01b03166001600160a01b0316630bf790998a868686866040518663ffffffff1660e01b815260040180866001600160a01b031681526020018563ffffffff1681526020018463ffffffff1681526020018363ffffffff1681526020018263ffffffff16815260200195505050505050600060405180830381600087803b1580156129ed57600080fd5b505af1158015612a01573d6000803e3d6000fd5b50959b60009b508b9a5098505050505050505050565b6000806000806000806000612a428989600860009054906101000a90046001600160a01b0316612c92565b80945081955082965083975050505050600660009054906101000a90046001600160a01b03166001600160a01b0316630bf790998a868686866040518663ffffffff1660e01b815260040180866001600160a01b031681526020018563ffffffff1681526020018463ffffffff1681526020018363ffffffff1681526020018263ffffffff16815260200195505050505050600060405180830381600087803b158015612aee57600080fd5b505af1158015612b02573d6000803e3d6000fd5b5060009c969b508c9a509598505050505050505050565b600080600a6000612b286128c2565b6001600160a01b0316815260208101919091526040016000205490508015612bbc57612bb7612bb26001600a6000612b5e6128c2565b6001600160a01b03166001600160a01b031681526020019081526020016000206001850381548110612b8c57fe5b600091825260209091206004909102015463ffffffff61010090910481169190612f2616565b612f80565b612bbf565b60015b91505090565b6000612c0783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612fc9565b9392505050565b80546001019055565b5490565b6000612c0783836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f000000000000000081525061306b565b6040516001600160a01b038216903480156108fc02916000818181858888f1935050505015801561096f573d6000803e3d6000fd5b600080808080805b866001600160a01b0316631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b158015612cd357600080fd5b505afa158015612ce7573d6000803e3d6000fd5b505050506040513d6020811015612cfd57600080fd5b505163ffffffff16811015612d91576000876001600160a01b031663cd5cfdaf836040518263ffffffff1660e01b8152600401808281526020019150506101006040518083038186803b158015612d5357600080fd5b505afa158015612d67573d6000803e3d6000fd5b505050506040513d610100811015612d7e57600080fd5b5060e00151929092019150600101612c9a565b506000612d9e89896130cd565b9050612db3612dad82846130e3565b886130ef565b955060008663ffffffff1611612e10576040805162461bcd60e51b815260206004820152601e60248201527f4a6f79734c6f74746572793a2077697468206572726f72206c6576656c2e0000604482015290519081900360640190fd5b6000806000806000808c6001600160a01b031663cd5cfdaf60018e036040518263ffffffff1660e01b8152600401808263ffffffff1681526020019150506101006040518083038186803b158015612e6757600080fd5b505afa158015612e7b573d6000803e3d6000fd5b505050506040513d610100811015612e9257600080fd5b50602081015160408201516060830151608084015160a085015160c090950151939a50919850965094509092509050612ed9612bb28863ffffffff808a169089164261332d565b9a50612ef6612bb2888663ffffffff168663ffffffff164561332d565b9950612f13612bb2888463ffffffff168463ffffffff164461332d565b9850505050505050505093509350935093565b600082820183811015612c07576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006401000000008210612fc55760405162461bcd60e51b81526004018080602001828103825260268152602001806138176026913960400191505060405180910390fd5b5090565b600081836130555760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561301a578181015183820152602001613002565b50505050905090810190601f1680156130475780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161306157fe5b0495945050505050565b600081836130ba5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561301a578181015183820152602001613002565b508284816130c457fe5b06949350505050565b6000612c0783836130de86866133ae565b6134db565b6000612c07838361352c565b60006060826001600160a01b0316631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b15801561312c57600080fd5b505afa158015613140573d6000803e3d6000fd5b505050506040513d602081101561315657600080fd5b505160010163ffffffff1667ffffffffffffffff8111801561317757600080fd5b506040519080825280602002602001820160405280156131a1578160200160208202803683370190505b50905060005b836001600160a01b0316631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b1580156131e057600080fd5b505afa1580156131f4573d6000803e3d6000fd5b505050506040513d602081101561320a57600080fd5b505163ffffffff90811690821610156132b25761328d8482866001600160a01b0316631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b15801561325b57600080fd5b505afa15801561326f573d6000803e3d6000fd5b505050506040513d602081101561328557600080fd5b5051036135d2565b828263ffffffff168151811061329f57fe5b60209081029190910101526001016131a7565b506000805b82518163ffffffff161015613324576000838263ffffffff16815181106132da57fe5b6020026020010151905081925080871061330c5763ffffffff8216613306576001945050505050610c68565b50613324565b8087101561331a575061331c565b505b6001016132b7565b50949350505050565b6000838311613383576040805162461bcd60e51b815260206004820152601b60248201527f4a6f79734c6f74746572793a72616e644e20636f6e646974696f6e0000000000604482015290519081900360640190fd5b6133a58461339f87850161339a8388036002612bc5565b61352c565b90612f26565b95945050505050565b6000806133ba84611d22565b9050600080825b8015613432576001600160a01b0387166000908152600a60205260409020805463ffffffff8816919060001984019081106133f857fe5b6000918252602090912060049091020154610100900463ffffffff1614156134295760019250600181039150613432565b600019016133c1565b508161346f5760405162461bcd60e51b815260040180806020018281038252602b8152602001806137ab602b913960400191505060405180910390fd5b6001600160a01b0386166000908152600a6020526040812080548390811061349357fe5b600091825260209091206004909102015464ffffffffff600160281b90910416600301406001600160a01b039097169690960163ffffffff9095169490940195945050505050565b6001600160a01b03831663ffffffff8316016000818152600c6020526040812054909190613515576000818152600c602052604090208390555b6000908152600c6020526040902054949350505050565b600080821161357a576040805162461bcd60e51b8152602060048201526015602482015274155b9a599bdc9b54985b990bdb5a5b8b589bdd5b99605a1b604482015290519081900360640190fd5b600082836000038161358857fe5b069050835b818110613599576135bf565b60408051602080820193909352815180820384018152908201909152805191012061358d565b8381816135c857fe5b0695945050505050565b600080600090506000846001600160a01b0316631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b15801561361457600080fd5b505afa158015613628573d6000803e3d6000fd5b505050506040513d602081101561363e57600080fd5b505190505b63ffffffff8116156136fd5781806001019250506000856001600160a01b031663cd5cfdaf600184036040518263ffffffff1660e01b8152600401808263ffffffff1681526020019150506101006040518083038186803b1580156136a757600080fd5b505afa1580156136bb573d6000803e3d6000fd5b505050506040513d6101008110156136d257600080fd5b5060e0015193840193905063ffffffff808616908416106136f357506136fd565b5060001901613643565b50509291505056fe4a6f79734c6f74746572793a206c6f747465727920726f6c6520696e646578206f7574206f6620626f756e64734f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734a6f79734c6f74746572793a20646f6e2774206861766520746865207370656369616c20726571756573742069642e4a6f79734c6f74746572793a20696e76616c696420726571756573742073746174652e4a6f79734c6f74746572793a2067656e2073656564206572726f722c206e6f20726571756573742069642e4a6f79734c6f74746572793a206d61782068696768206c6576656c206865726f2e4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657253616665436173743a2076616c756520646f65736e27742066697420696e20333220626974734a6f79734c6f74746572793a206d61782068696768206c6576656c20776561706f6e2e4a6f79734c6f74746572793a20496e73756666696369656e74206a6f797320746f6b656e2ea26469706673582212209678b023273fe0cfe0112b36df7fa43979c9cdb5513a826c5fdcd82d8fdb96f264736f6c634300060c00330000000000000000000000000341049bbf89b6255723e411fa1ff8655dcd9d690000000000000000000000001c7f4a0b2ce9017d0055671c8563e8c80eccc6a5000000000000000000000000e5bd6e710da9e177acb5b4e348b94b514f9cfb4e0000000000000000000000000b87085eb661f47b3d564a990584b163ef3a3bcf000000000000000000000000058977169e0449187239e13478da9095b3d9502900000000000000000000000046fbeecba02818fa632ad5ad0b24b2ab4163f047
Deployed Bytecode
0x60806040526004361061020f5760003560e01c80637392ddd011610118578063ceaa4aa8116100a0578063ecdb14811161006f578063ecdb1481146107e4578063ef0dab7214610804578063efbf225f146102ed578063f2fde38b14610819578063fda725521461084c5761020f565b8063ceaa4aa81461073f578063debb9d2814610787578063e477cff6146107ba578063e4963fb3146107cf5761020f565b80639a9d60dc116100e75780639a9d60dc14610600578063aeeb7f0714610633578063c6aabdde14610666578063c79414d41461067b578063c89782cc1461072a5761020f565b80637392ddd01461059757806378aa08ed146105ac5780638da5cb5b146105c1578063916fd42e146105d65761020f565b806350515f051161019b5780635c975abb1161016a5780635c975abb146104e75780636cc1799b14610510578063715018a61461055857806371aaa27b1461056d5780637314396c146105825761020f565b806350515f0514610445578063517258d0146104785780635257cd901461048d57806352f7c988146104b75761020f565b806311c1e960116101e257806311c1e96014610349578063190625d7146103a957806328bc4bf1146103dc5780634a67fa7d146103f15780634c30215b1461041b5761020f565b806307058370146102145780630c34490d146102c65780630cab37d3146102ed57806310e2d49214610318575b600080fd5b34801561022057600080fd5b506102c46004803603602081101561023757600080fd5b81019060208101813564010000000081111561025257600080fd5b82018360208201111561026457600080fd5b8035906020019184602083028401116401000000008311171561028657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506108a7945050505050565b005b3480156102d257600080fd5b506102db610973565b60408051918252519081900360200190f35b3480156102f957600080fd5b50610302610979565b6040805160ff9092168252519081900360200190f35b34801561032457600080fd5b5061032d61097e565b604080516001600160a01b039092168252519081900360200190f35b34801561035557600080fd5b506103886004803603604081101561036c57600080fd5b5080356001600160a01b0316906020013563ffffffff1661098d565b6040518082600381111561039857fe5b815260200191505060405180910390f35b3480156103b557600080fd5b506102c4600480360360208110156103cc57600080fd5b50356001600160a01b0316610c6e565b3480156103e857600080fd5b5061032d611013565b3480156103fd57600080fd5b506102c46004803603602081101561041457600080fd5b5035611022565b34801561042757600080fd5b5061032d6004803603602081101561043e57600080fd5b50356110d3565b34801561045157600080fd5b506102c46004803603602081101561046857600080fd5b50356001600160a01b0316611144565b34801561048457600080fd5b5061032d6113c0565b34801561049957600080fd5b506102db600480360360208110156104b057600080fd5b50356113cf565b3480156104c357600080fd5b506102c4600480360360408110156104da57600080fd5b50803590602001356113e1565b3480156104f357600080fd5b506104fc6114a4565b604080519115158252519081900360200190f35b34801561051c57600080fd5b506102c46004803603608081101561053357600080fd5b5063ffffffff81358116916020810135821691604082013581169160600135166114ad565b34801561056457600080fd5b506102c46116ed565b34801561057957600080fd5b5061030261179a565b34801561058e57600080fd5b5061032d6117aa565b3480156105a357600080fd5b506102db6117b9565b3480156105b857600080fd5b506102db6117bf565b3480156105cd57600080fd5b5061032d6117c5565b3480156105e257600080fd5b5061032d600480360360208110156105f957600080fd5b50356117d9565b34801561060c57600080fd5b506102c46004803603602081101561062357600080fd5b50356001600160a01b0316611800565b34801561063f57600080fd5b506102c46004803603602081101561065657600080fd5b50356001600160a01b0316611937565b34801561067257600080fd5b506102db611a52565b34801561068757600080fd5b506106b46004803603604081101561069e57600080fd5b506001600160a01b038135169060200135611a58565b604051808960048111156106c457fe5b81526020018863ffffffff1681526020018764ffffffffff1681526020018663ffffffff1681526020018563ffffffff16815260200184815260200183815260200182600381111561071257fe5b81526020019850505050505050505060405180910390f35b34801561073657600080fd5b5061032d611ad3565b34801561074b57600080fd5b506102c46004803603608081101561076257600080fd5b5063ffffffff8135811691602081013582169160408201358116916060013516611ae2565b34801561079357600080fd5b506102db600480360360208110156107aa57600080fd5b50356001600160a01b0316611d22565b3480156107c657600080fd5b506102db611d3d565b3480156107db57600080fd5b50610302611d43565b6102c4600480360360208110156107fa57600080fd5b503560ff16611d53565b34801561081057600080fd5b5061032d6126de565b34801561082557600080fd5b506102c46004803603602081101561083c57600080fd5b50356001600160a01b03166126ed565b34801561085857600080fd5b506102c4600480360360c081101561086f57600080fd5b506001600160a01b038135811691602081013582169160408201358116916060810135821691608082013581169160a00135166127f6565b6108af6128c2565b60015461010090046001600160a01b03908116911614610904576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b60005b81518163ffffffff16101561096f57600e828263ffffffff168151811061092a57fe5b60209081029190910181015182546001808201855560009485529290932090920180546001600160a01b0319166001600160a01b039093169290921790915501610907565b5050565b60035481565b606381565b6006546001600160a01b031681565b60006001600160a01b0383166109ea576040805162461bcd60e51b815260206004820152601d60248201527f4a6f79734c6f74746572793a20696e76616c696420616464726573732e000000604482015290519081900360640190fd5b60008263ffffffff1611610a45576040805162461bcd60e51b815260206004820152601d60248201527f4a6f79734c6f74746572793a207a65726f20726571756573742069642e000000604482015290519081900360640190fd5b6000610a5084611d22565b905060008111610aa7576040805162461bcd60e51b815260206004820152601d60248201527f4a6f79734c6f74746572793a2068617665206e6f20726571756573742e000000604482015290519081900360640190fd5b808363ffffffff161115610b02576040805162461bcd60e51b815260206004820181905260248201527f4a6f79734c6f74746572793a20696e76616c696420726571756573742069642e604482015290519081900360640190fd5b600080825b8015610b78576001600160a01b0387166000908152600a60205260409020805463ffffffff881691906000198401908110610b3e57fe5b6000918252602090912060049091020154610100900463ffffffff161415610b6f5760019250600181039150610b78565b60001901610b07565b5081610bb55760405162461bcd60e51b815260040180806020018281038252602f815260200180613759602f913960400191505060405180910390fd5b6001600160a01b0386166000908152600a60205260408120805483908110610bd957fe5b600091825260208220600490910201805490925064ffffffffff600160281b909104169060038084015460ff1690811115610c1057fe5b1415610c5a5760038164ffffffffff160143118015610c39575060fa8164ffffffffff16014311155b15610c4c57600195505050505050610c68565b600395505050505050610c68565b506003015460ff1693505050505b92915050565b610c7e610c796128c2565b6128c6565b610ccf576040805162461bcd60e51b815260206004820152601f60248201527f4a6f79734c6f74746572793a2068617665206e6f2070726976696c6567652e00604482015290519081900360640190fd5b6000610cda82611d22565b905060008111610d31576040805162461bcd60e51b815260206004820152601960248201527f4a6f79734c6f74746572793a2068617665206e6f20626f782e00000000000000604482015290519081900360640190fd5b6001600160a01b0382166000908152600a602052604081208054600019840192919083908110610d5d57fe5b600091825260209091206004909102018054909150610100900463ffffffff166001610d89868361098d565b6003811115610d9457fe5b14610dd05760405162461bcd60e51b81526004018080602001828103825260238152602001806137886023913960400191505060405180910390fd5b81546000908190819060ff166003816004811115610dea57fe5b1415610e0657610dfa8986612916565b91955093509150610e71565b6004816004811115610e1457fe5b1415610e2457610dfa8986612a17565b6040805162461bcd60e51b815260206004820152601f60248201527f4a6f79734c6f74746572793a20696e76616c6964206f7065726174696f6e2e00604482015290519081900360640190fd5b6001600160a01b0389166000908152600a60205260409020805485919089908110610e9857fe5b9060005260206000209060040201600001600a6101000a81548163ffffffff021916908363ffffffff16021790555082600a60008b6001600160a01b03166001600160a01b031681526020019081526020016000208881548110610ef857fe5b9060005260206000209060040201600001600e6101000a81548163ffffffff021916908363ffffffff16021790555081600a60008b6001600160a01b03166001600160a01b031681526020019081526020016000208881548110610f5857fe5b90600052602060002090600402016001018190555042600a60008b6001600160a01b03166001600160a01b031681526020019081526020016000208881548110610f9e57fe5b6000918252602080832060026004909302018201939093556001600160a01b038c168252600a90925260409020805489908110610fd757fe5b906000526020600020906004020160030160006101000a81548160ff0219169083600381111561100357fe5b0217905550505050505050505050565b6005546001600160a01b031681565b61102a6128c2565b60015461010090046001600160a01b0390811691161461107f576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b80600d5414156110ce576040805162461bcd60e51b81526020600482015260156024820152742537bcb9a637ba3a32b93c9d39b0b6b2903332b29760591b604482015290519081900360640190fd5b600d55565b6000816110de611d3d565b1161111a5760405162461bcd60e51b815260040180806020018281038252602d815260200180613706602d913960400191505060405180910390fd5b600e828154811061112757fe5b6000918252602090912001546001600160a01b031690505b919050565b61114c6128c2565b60015461010090046001600160a01b039081169116146111a1576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b6001600160a01b0381166111fc576040805162461bcd60e51b815260206004820152601b60248201527f4a6f79734c6f74746572793a496e76616c696420616464726573730000000000604482015290519081900360640190fd5b60048054604080516370a0823160e01b81523093810193909352516000926001600160a01b03909216916370a08231916024808301926020929190829003018186803b15801561124b57600080fd5b505afa15801561125f573d6000803e3d6000fd5b505050506040513d602081101561127557600080fd5b5051116112bf576040805162461bcd60e51b81526020600482015260136024820152724a6f79734c6f74746572793a6e6f204a4f595360681b604482015290519081900360640190fd5b60048054604080516370a0823160e01b81523093810193909352516001600160a01b039091169163a9059cbb91849184916370a0823191602480820192602092909190829003018186803b15801561131657600080fd5b505afa15801561132a573d6000803e3d6000fd5b505050506040513d602081101561134057600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561139157600080fd5b505af11580156113a5573d6000803e3d6000fd5b505050506040513d60208110156113bb57600080fd5b505050565b6008546001600160a01b031681565b600c6020526000908152604090205481565b6113e96128c2565b60015461010090046001600160a01b0390811691161461143e576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b8160025414158061145157508060035414155b611499576040805162461bcd60e51b8152602060048201526014602482015273129bde5cd31bdd1d195c9e4e881b9bc81b99595960621b604482015290519081900360640190fd5b600291909155600355565b60015460ff1690565b6114b56128c2565b60015461010090046001600160a01b0390811691161461150a576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b6001546063600160b01b90910460ff16106115565760405162461bcd60e51b815260040180806020018281038252602381526020018061383d6023913960400191505060405180910390fd5b600860009054906101000a90046001600160a01b03166001600160a01b0316631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b1580156115a457600080fd5b505afa1580156115b8573d6000803e3d6000fd5b505050506040513d60208110156115ce57600080fd5b505163ffffffff908116908516111561162a576040805162461bcd60e51b81526020600482015260196024820152782537bcb9a637ba3a32b93c9d103bb937b733903632bb32b61760391b604482015290519081900360640190fd5b6006546001600160a01b0316630bf790996116436128c2565b604080516001600160e01b031960e085901b1681526001600160a01b03909216600483015263ffffffff808916602484015280881660448401528087166064840152851660848301525160a480830192600092919082900301818387803b1580156116ad57600080fd5b505af11580156116c1573d6000803e3d6000fd5b50506001805460ff600160b01b808304821684019091160260ff60b01b19909116179055505050505050565b6116f56128c2565b60015461010090046001600160a01b0390811691161461174a576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b60015460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360018054610100600160a81b0319169055565b600154600160b01b900460ff1681565b6004546001600160a01b031681565b60025481565b600d5481565b60015461010090046001600160a01b031690565b600e81815481106117e657fe5b6000918252602090912001546001600160a01b0316905081565b6118086128c2565b60015461010090046001600160a01b0390811691161461185d576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b6001600160a01b0381166118b8576040805162461bcd60e51b815260206004820152601b60248201527f4a6f79734c6f74746572793a496e76616c696420616464726573730000000000604482015290519081900360640190fd5b600460009054906101000a90046001600160a01b03166001600160a01b031663f2fde38b826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561191c57600080fd5b505af1158015611930573d6000803e3d6000fd5b5050505050565b61193f6128c2565b60015461010090046001600160a01b03908116911614611994576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b60005b61199f611d3d565b81101561096f57816001600160a01b03166119b9826110d3565b6001600160a01b03161415611a4a5760006119dd60016119d7611d3d565b036110d3565b905080600e83815481106119ed57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600e805480611a2657fe5b600082815260209020810160001990810180546001600160a01b0319169055019055505b600101611997565b600b5481565b600a6020528160005260406000208181548110611a7157fe5b6000918252602090912060049091020180546001820154600283015460039093015460ff808416965063ffffffff61010085048116965064ffffffffff600160281b86041695600160501b8604821695600160701b9004909116939290911688565b6009546001600160a01b031681565b611aea6128c2565b60015461010090046001600160a01b03908116911614611b3f576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b6001546063600160a81b90910460ff1610611b8b5760405162461bcd60e51b81526004018080602001828103825260218152602001806137d66021913960400191505060405180910390fd5b600760009054906101000a90046001600160a01b03166001600160a01b0316631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b158015611bd957600080fd5b505afa158015611bed573d6000803e3d6000fd5b505050506040513d6020811015611c0357600080fd5b505163ffffffff9081169085161115611c5f576040805162461bcd60e51b81526020600482015260196024820152782537bcb9a637ba3a32b93c9d103bb937b733903632bb32b61760391b604482015290519081900360640190fd5b6005546001600160a01b0316630bf79099611c786128c2565b604080516001600160e01b031960e085901b1681526001600160a01b03909216600483015263ffffffff808916602484015280881660448401528087166064840152851660848301525160a480830192600092919082900301818387803b158015611ce257600080fd5b505af1158015611cf6573d6000803e3d6000fd5b50506001805460ff600160a81b808304821684019091160260ff60a81b19909116179055505050505050565b6001600160a01b03166000908152600a602052604090205490565b600e5490565b600154600160a81b900460ff1681565b60015460ff1615611d9e576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b60026000541415611df6576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600055600d54341015611e52576040805162461bcd60e51b815260206004820152601f60248201527f4a6f79734c6f74746572793a206c6f747465727920666565206c696d69742e00604482015290519081900360640190fd5b6000611e5c611d3d565b11611eae576040805162461bcd60e51b815260206004820152601d60248201527f4a6f79734c6f74746572793a206e6f206c6f747465727920726f6c652e000000604482015290519081900360640190fd5b6000611eb8612b19565b905043600163ffffffff831611156120825760001982016000611ee2611edc6128c2565b8361098d565b90506002816003811115611ef257fe5b1480611f0957506003816003811115611f0757fe5b145b611f5a576040805162461bcd60e51b815260206004820152601d60248201527f4a6f79734c6f74746572793a20696e76616c696420726571756573742e000000604482015290519081900360640190fd5b6003816003811115611f6857fe5b141561207f576000600a6000611f7c6128c2565b6001600160a01b0316815260208101919091526040016000205490505b801561207d578263ffffffff16600a6000611fb26128c2565b6001600160a01b03166001600160a01b031681526020019081526020016000206001830381548110611fe057fe5b6000918252602090912060049091020154610100900463ffffffff161415612074576003600a60006120106128c2565b6001600160a01b03166001600160a01b03168152602001908152602001600020600183038154811061203e57fe5b906000526020600020906004020160030160006101000a81548160ff0219169083600381111561206a57fe5b021790555061207d565b60001901611f99565b505b50505b600383600481111561209057fe5b141561230a576002546004546001600160a01b03166370a082316120b26128c2565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156120ef57600080fd5b505afa158015612103573d6000803e3d6000fd5b505050506040513d602081101561211957600080fd5b505110156121585760405162461bcd60e51b81526004018080602001828103825260258152602001806138606025913960400191505060405180910390fd5b6004546001600160a01b03166323b872dd6121716128c2565b306002546040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050602060405180830381600087803b1580156121cb57600080fd5b505af11580156121df573d6000803e3d6000fd5b505050506040513d60208110156121f557600080fd5b5050600454600280546001600160a01b03909216916342966c689161221a9190612bc5565b6040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561225057600080fd5b505af1158015612264573d6000803e3d6000fd5b5050600454600954600280546001600160a01b03938416955063a9059cbb9450929091169161229291612bc5565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156122d857600080fd5b505af11580156122ec573d6000803e3d6000fd5b505050506040513d602081101561230257600080fd5b506125199050565b600483600481111561231857fe5b1415610e24576003546004546001600160a01b03166370a0823161233a6128c2565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561237757600080fd5b505afa15801561238b573d6000803e3d6000fd5b505050506040513d60208110156123a157600080fd5b505110156123e05760405162461bcd60e51b81526004018080602001828103825260258152602001806138606025913960400191505060405180910390fd5b6004546001600160a01b03166323b872dd6123f96128c2565b306003546040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050602060405180830381600087803b15801561245357600080fd5b505af1158015612467573d6000803e3d6000fd5b505050506040513d602081101561247d57600080fd5b50506004546003546001600160a01b03909116906342966c68906124a2906002612bc5565b6040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156124d857600080fd5b505af11580156124ec573d6000803e3d6000fd5b50506004546009546003546001600160a01b03928316945063a9059cbb9350911690612292906002612bc5565b612523600b612c0e565b6000612540612530611d3d565b61253a600b612c17565b90612c1b565b905061255361254e826110d3565b612c5d565b600a600061255f6128c2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060405180610100016040528086600481111561259757fe5b815263ffffffff8616602082015264ffffffffff851660408201526000606082018190526080820181905260a0820181905260c0820181905260e09091015281546001818101845560009384526020909320825160049283029091018054939490939192849260ff19169190849081111561260e57fe5b02179055506020820151815460408401516060850151608086015164ffffffff001990931661010063ffffffff958616021769ffffffffff00000000001916600160281b64ffffffffff909316929092029190911763ffffffff60501b1916600160501b918416919091021763ffffffff60701b1916600160701b929091169190910217815560a082015160018083019190915560c0830151600283015560e0830151600380840180549293909260ff19169184908111156126cc57fe5b02179055505060016000555050505050565b6007546001600160a01b031681565b6126f56128c2565b60015461010090046001600160a01b0390811691161461274a576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b6001600160a01b03811661278f5760405162461bcd60e51b81526004018080602001828103825260268152602001806137336026913960400191505060405180910390fd5b6001546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6127fe6128c2565b60015461010090046001600160a01b03908116911614612853576040805162461bcd60e51b815260206004820181905260248201526000805160206137f7833981519152604482015290519081900360640190fd5b600480546001600160a01b03199081166001600160a01b0398891617909155600580548216968816969096179095556006805486169487169490941790935560078054851692861692909217909155600880548416918516919091179055600980549092169216919091179055565b3390565b6000805b6128d2611d3d565b81101561290d57826001600160a01b03166128ec826110d3565b6001600160a01b0316141561290557600191505061113f565b6001016128ca565b50600092915050565b60008060008060008060006129418989600760009054906101000a90046001600160a01b0316612c92565b80945081955082965083975050505050600560009054906101000a90046001600160a01b03166001600160a01b0316630bf790998a868686866040518663ffffffff1660e01b815260040180866001600160a01b031681526020018563ffffffff1681526020018463ffffffff1681526020018363ffffffff1681526020018263ffffffff16815260200195505050505050600060405180830381600087803b1580156129ed57600080fd5b505af1158015612a01573d6000803e3d6000fd5b50959b60009b508b9a5098505050505050505050565b6000806000806000806000612a428989600860009054906101000a90046001600160a01b0316612c92565b80945081955082965083975050505050600660009054906101000a90046001600160a01b03166001600160a01b0316630bf790998a868686866040518663ffffffff1660e01b815260040180866001600160a01b031681526020018563ffffffff1681526020018463ffffffff1681526020018363ffffffff1681526020018263ffffffff16815260200195505050505050600060405180830381600087803b158015612aee57600080fd5b505af1158015612b02573d6000803e3d6000fd5b5060009c969b508c9a509598505050505050505050565b600080600a6000612b286128c2565b6001600160a01b0316815260208101919091526040016000205490508015612bbc57612bb7612bb26001600a6000612b5e6128c2565b6001600160a01b03166001600160a01b031681526020019081526020016000206001850381548110612b8c57fe5b600091825260209091206004909102015463ffffffff61010090910481169190612f2616565b612f80565b612bbf565b60015b91505090565b6000612c0783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612fc9565b9392505050565b80546001019055565b5490565b6000612c0783836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f000000000000000081525061306b565b6040516001600160a01b038216903480156108fc02916000818181858888f1935050505015801561096f573d6000803e3d6000fd5b600080808080805b866001600160a01b0316631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b158015612cd357600080fd5b505afa158015612ce7573d6000803e3d6000fd5b505050506040513d6020811015612cfd57600080fd5b505163ffffffff16811015612d91576000876001600160a01b031663cd5cfdaf836040518263ffffffff1660e01b8152600401808281526020019150506101006040518083038186803b158015612d5357600080fd5b505afa158015612d67573d6000803e3d6000fd5b505050506040513d610100811015612d7e57600080fd5b5060e00151929092019150600101612c9a565b506000612d9e89896130cd565b9050612db3612dad82846130e3565b886130ef565b955060008663ffffffff1611612e10576040805162461bcd60e51b815260206004820152601e60248201527f4a6f79734c6f74746572793a2077697468206572726f72206c6576656c2e0000604482015290519081900360640190fd5b6000806000806000808c6001600160a01b031663cd5cfdaf60018e036040518263ffffffff1660e01b8152600401808263ffffffff1681526020019150506101006040518083038186803b158015612e6757600080fd5b505afa158015612e7b573d6000803e3d6000fd5b505050506040513d610100811015612e9257600080fd5b50602081015160408201516060830151608084015160a085015160c090950151939a50919850965094509092509050612ed9612bb28863ffffffff808a169089164261332d565b9a50612ef6612bb2888663ffffffff168663ffffffff164561332d565b9950612f13612bb2888463ffffffff168463ffffffff164461332d565b9850505050505050505093509350935093565b600082820183811015612c07576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006401000000008210612fc55760405162461bcd60e51b81526004018080602001828103825260268152602001806138176026913960400191505060405180910390fd5b5090565b600081836130555760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561301a578181015183820152602001613002565b50505050905090810190601f1680156130475780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161306157fe5b0495945050505050565b600081836130ba5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561301a578181015183820152602001613002565b508284816130c457fe5b06949350505050565b6000612c0783836130de86866133ae565b6134db565b6000612c07838361352c565b60006060826001600160a01b0316631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b15801561312c57600080fd5b505afa158015613140573d6000803e3d6000fd5b505050506040513d602081101561315657600080fd5b505160010163ffffffff1667ffffffffffffffff8111801561317757600080fd5b506040519080825280602002602001820160405280156131a1578160200160208202803683370190505b50905060005b836001600160a01b0316631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b1580156131e057600080fd5b505afa1580156131f4573d6000803e3d6000fd5b505050506040513d602081101561320a57600080fd5b505163ffffffff90811690821610156132b25761328d8482866001600160a01b0316631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b15801561325b57600080fd5b505afa15801561326f573d6000803e3d6000fd5b505050506040513d602081101561328557600080fd5b5051036135d2565b828263ffffffff168151811061329f57fe5b60209081029190910101526001016131a7565b506000805b82518163ffffffff161015613324576000838263ffffffff16815181106132da57fe5b6020026020010151905081925080871061330c5763ffffffff8216613306576001945050505050610c68565b50613324565b8087101561331a575061331c565b505b6001016132b7565b50949350505050565b6000838311613383576040805162461bcd60e51b815260206004820152601b60248201527f4a6f79734c6f74746572793a72616e644e20636f6e646974696f6e0000000000604482015290519081900360640190fd5b6133a58461339f87850161339a8388036002612bc5565b61352c565b90612f26565b95945050505050565b6000806133ba84611d22565b9050600080825b8015613432576001600160a01b0387166000908152600a60205260409020805463ffffffff8816919060001984019081106133f857fe5b6000918252602090912060049091020154610100900463ffffffff1614156134295760019250600181039150613432565b600019016133c1565b508161346f5760405162461bcd60e51b815260040180806020018281038252602b8152602001806137ab602b913960400191505060405180910390fd5b6001600160a01b0386166000908152600a6020526040812080548390811061349357fe5b600091825260209091206004909102015464ffffffffff600160281b90910416600301406001600160a01b039097169690960163ffffffff9095169490940195945050505050565b6001600160a01b03831663ffffffff8316016000818152600c6020526040812054909190613515576000818152600c602052604090208390555b6000908152600c6020526040902054949350505050565b600080821161357a576040805162461bcd60e51b8152602060048201526015602482015274155b9a599bdc9b54985b990bdb5a5b8b589bdd5b99605a1b604482015290519081900360640190fd5b600082836000038161358857fe5b069050835b818110613599576135bf565b60408051602080820193909352815180820384018152908201909152805191012061358d565b8381816135c857fe5b0695945050505050565b600080600090506000846001600160a01b0316631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b15801561361457600080fd5b505afa158015613628573d6000803e3d6000fd5b505050506040513d602081101561363e57600080fd5b505190505b63ffffffff8116156136fd5781806001019250506000856001600160a01b031663cd5cfdaf600184036040518263ffffffff1660e01b8152600401808263ffffffff1681526020019150506101006040518083038186803b1580156136a757600080fd5b505afa1580156136bb573d6000803e3d6000fd5b505050506040513d6101008110156136d257600080fd5b5060e0015193840193905063ffffffff808616908416106136f357506136fd565b5060001901613643565b50509291505056fe4a6f79734c6f74746572793a206c6f747465727920726f6c6520696e646578206f7574206f6620626f756e64734f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734a6f79734c6f74746572793a20646f6e2774206861766520746865207370656369616c20726571756573742069642e4a6f79734c6f74746572793a20696e76616c696420726571756573742073746174652e4a6f79734c6f74746572793a2067656e2073656564206572726f722c206e6f20726571756573742069642e4a6f79734c6f74746572793a206d61782068696768206c6576656c206865726f2e4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657253616665436173743a2076616c756520646f65736e27742066697420696e20333220626974734a6f79734c6f74746572793a206d61782068696768206c6576656c20776561706f6e2e4a6f79734c6f74746572793a20496e73756666696369656e74206a6f797320746f6b656e2ea26469706673582212209678b023273fe0cfe0112b36df7fa43979c9cdb5513a826c5fdcd82d8fdb96f264736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000341049bbf89b6255723e411fa1ff8655dcd9d690000000000000000000000001c7f4a0b2ce9017d0055671c8563e8c80eccc6a5000000000000000000000000e5bd6e710da9e177acb5b4e348b94b514f9cfb4e0000000000000000000000000b87085eb661f47b3d564a990584b163ef3a3bcf000000000000000000000000058977169e0449187239e13478da9095b3d9502900000000000000000000000046fbeecba02818fa632ad5ad0b24b2ab4163f047
-----Decoded View---------------
Arg [0] : _joys (address): 0x0341049bbf89B6255723e411Fa1ff8655dcd9d69
Arg [1] : _joysHero (address): 0x1C7f4a0B2Ce9017D0055671c8563E8c80EcCC6A5
Arg [2] : _joysWeapon (address): 0xE5Bd6e710da9e177aCB5b4E348b94b514F9CfB4E
Arg [3] : _heroMeta (address): 0x0B87085EB661F47B3d564A990584b163EF3A3bcf
Arg [4] : _weaponMeta (address): 0x058977169E0449187239E13478Da9095b3D95029
Arg [5] : _jackpot (address): 0x46FBeeCba02818FA632AD5Ad0B24B2AB4163F047
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000341049bbf89b6255723e411fa1ff8655dcd9d69
Arg [1] : 0000000000000000000000001c7f4a0b2ce9017d0055671c8563e8c80eccc6a5
Arg [2] : 000000000000000000000000e5bd6e710da9e177acb5b4e348b94b514f9cfb4e
Arg [3] : 0000000000000000000000000b87085eb661f47b3d564a990584b163ef3a3bcf
Arg [4] : 000000000000000000000000058977169e0449187239e13478da9095b3d95029
Arg [5] : 00000000000000000000000046fbeecba02818fa632ad5ad0b24b2ab4163f047
Deployed Bytecode Sourcemap
663:16842:3:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4153:200;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4153:200:3;;-1:-1:-1;4153:200:3;;-1:-1:-1;;;;;4153:200:3:i;:::-;;1185:41;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;1012:36;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1388:25;;;;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;1388:25:3;;;;;;;;;;;;;;9843:1176;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9843:1176:3;;-1:-1:-1;;;;;9843:1176:3;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;15317:1129;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;15317:1129:3;-1:-1:-1;;;;;15317:1129:3;;:::i;1311:23::-;;;;;;;;;;;;;:::i;4725:150::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4725:150:3;;:::i;3676:214::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3676:214:3;;:::i;17031:279::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;17031:279:3;-1:-1:-1;;;;;17031:279:3;;:::i;1549:33::-;;;;;;;;;;;;;:::i;2678:48::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2678:48:3;;:::i;8180:229::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;8180:229:3;;;;;;;:::i;1040:76:26:-;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;8781:372:3;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;8781:372:3;;;;;;;;;;;;;;;;;;;;;;;;;:::i;1689:145:7:-;;;;;;;;;;;;;:::i;1079:21:3:-;;;;;;;;;;;;;:::i;1233:::-;;;;;;;;;;;;;:::i;1140:39::-;;;;;;;;;;;;;:::i;2733:::-;;;;;;;;;;;;;:::i;1066:77:7:-;;;;;;;;;;;;;:::i;2778:36:3:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2778:36:3;;:::i;17316:187::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;17316:187:3;-1:-1:-1;;;;;17316:187:3;;:::i;4359:360::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4359:360:3;-1:-1:-1;;;;;4359:360:3;;:::i;2457:36::-;;;;;;;;;;;;;:::i;2404:47::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2404:47:3;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1633:25;;;;;;;;;;;;;:::i;8415:360::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;8415:360:3;;;;;;;;;;;;;;;;;;;;;;;;;:::i;16452:116::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;16452:116:3;-1:-1:-1;;;;;16452:116:3;;:::i;3568:102::-;;;;;;;;;;;;;:::i;1054:19::-;;;;;;;;;;;;;:::i;12917:2169::-;;;;;;;;;;;;;;;;-1:-1:-1;12917:2169:3;;;;:::i;1467:31::-;;;;;;;;;;;;;:::i;1983:240:7:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1983:240:7;-1:-1:-1;;;;;1983:240:7;;:::i;16574:451:3:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;16574:451:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;4153:200::-;1280:12:7;:10;:12::i;:::-;1270:6;;;;;-1:-1:-1;;;;;1270:6:7;;;:22;;;1262:67;;;;;-1:-1:-1;;;1262:67:7;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1262:67:7;;;;;;;;;;;;;;;4245:10:3::1;4241:106;4267:8;:15;4261:3;:21;;;4241:106;;;4305:11;4322:8;4331:3;4322:13;;;;;;;;;;;::::0;;::::1;::::0;;;;;;;4305:31;;::::1;::::0;;::::1;::::0;;-1:-1:-1;4305:31:3;;;;;;;;;::::1;::::0;;-1:-1:-1;;;;;;4305:31:3::1;-1:-1:-1::0;;;;;4305:31:3;;::::1;::::0;;;::::1;::::0;;;4284:5:::1;4241:106;;;;4153:200:::0;:::o;1185:41::-;;;;:::o;1012:36::-;1046:2;1012:36;:::o;1388:25::-;;;-1:-1:-1;;;;;1388:25:3;;:::o;9843:1176::-;9923:8;-1:-1:-1;;;;;9951:22:3;;9943:64;;;;;-1:-1:-1;;;9943:64:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;10038:1;10025:10;:14;;;10017:56;;;;;-1:-1:-1;;;10017:56:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;10084:11;10098:22;10111:8;10098:12;:22::i;:::-;10084:36;;10144:1;10138:3;:7;10130:49;;;;;-1:-1:-1;;;10130:49:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;10211:3;10197:10;:17;;;;10189:62;;;;;-1:-1:-1;;;10189:62:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10262:9;;10330:3;10314:198;10335:5;;10314:198;;-1:-1:-1;;;;;10365:16:3;;;;;;:6;:16;;;;;:21;;:41;;;;:16;-1:-1:-1;;10382:3:3;;;10365:21;;;;;;;;;;;;;;;;;;;:27;;;;;;:41;10361:141;;;10433:4;10426:11;;10463:1;10461;:3;10455:9;;10482:5;;10361:141;-1:-1:-1;;10342:3:3;10314:198;;;;10529:4;10521:64;;;;-1:-1:-1;;;10521:64:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;10620:16:3;;10596:21;10620:16;;;:6;:16;;;;;:21;;10637:3;;10620:21;;;;;;;;;;;;;;;;;;10672:13;;10620:21;;-1:-1:-1;10672:13:3;-1:-1:-1;;;10672:13:3;;;;;10699:7;;;;;;;;:24;;;;;;;;10695:293;;;2580:1;10757:11;:30;;;10742:12;:45;:116;;;;;2538:3;10823:11;:35;;;10807:12;:51;;10742:116;10739:239;;;10885:16;10878:23;;;;;;;;;10739:239;10947:16;10940:23;;;;;;;;;10739:239;-1:-1:-1;11005:7:3;;;;;;-1:-1:-1;;;;9843:1176:3;;;;;:::o;15317:1129::-;15377:21;15385:12;:10;:12::i;:::-;15377:7;:21::i;:::-;15369:65;;;;;-1:-1:-1;;;15369:65:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;15445:11;15459:22;15472:8;15459:12;:22::i;:::-;15445:36;;15505:1;15499:3;:7;15491:45;;;;;-1:-1:-1;;;15491:45:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;15604:16:3;;15547:11;15604:16;;;:6;:16;;;;;:21;;-1:-1:-1;;15561:7:3;;;15547:11;15604:16;15561:7;;15604:21;;;;;;;;;;;;;;;;;;;15655:9;;15604:21;;-1:-1:-1;15655:9:3;;;;;;15682:34;15695:8;15705:10;15682:12;:34::i;:::-;:54;;;;;;;;;15674:102;;;;-1:-1:-1;;;15674:102:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15858:13;;15787:8;;;;;;15858:13;;15892:25;15885:3;:32;;;;;;;;;15881:303;;;15945:30;15954:8;15964:10;15945:8;:30::i;:::-;15933:42;;-1:-1:-1;15933:42:3;-1:-1:-1;15933:42:3;-1:-1:-1;15881:303:3;;;16004:27;15997:3;:34;;;;;;;;;15993:191;;;16059:32;16070:8;16080:10;16059;:32::i;15993:191::-;16123:49;;;-1:-1:-1;;;16123:49:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;16224:16:3;;;;;;:6;:16;;;;;:21;;16250:1;;16224:16;16241:3;;16224:21;;;;;;;;;;;;;;;;:23;;;:27;;;;;;;;;;;;;;;;;;16287:1;16261:6;:16;16268:8;-1:-1:-1;;;;;16261:16:3;-1:-1:-1;;;;;16261:16:3;;;;;;;;;;;;16278:3;16261:21;;;;;;;;;;;;;;;;;;:23;;;:27;;;;;;;;;;;;;;;;;;16324:1;16298:6;:16;16305:8;-1:-1:-1;;;;;16298:16:3;-1:-1:-1;;;;;16298:16:3;;;;;;;;;;;;16315:3;16298:21;;;;;;;;;;;;;;;;;;:23;;:27;;;;16369:15;16335:6;:16;16342:8;-1:-1:-1;;;;;16335:16:3;-1:-1:-1;;;;;16335:16:3;;;;;;;;;;;;16352:3;16335:21;;;;;;;;;;;;;;;;:31;:21;;;;;:31;;:49;;;;-1:-1:-1;;;;;16394:16:3;;;;:6;:16;;;;;;:21;;16411:3;;16394:21;;;;;;;;;;;;;;;;:27;;;:45;;;;;;;;;;;;;;;;;;;;;;;;15317:1129;;;;;;;;;:::o;1311:23::-;;;-1:-1:-1;;;;;1311:23:3;;:::o;4725:150::-;1280:12:7;:10;:12::i;:::-;1270:6;;;;;-1:-1:-1;;;;;1270:6:7;;;:22;;;1262:67;;;;;-1:-1:-1;;;1262:67:7;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1262:67:7;;;;;;;;;;;;;;;4811:4:3::1;4797:10;;:18;;4789:52;;;::::0;;-1:-1:-1;;;4789:52:3;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;4789:52:3;;;;;;;;;;;;;::::1;;4851:10;:17:::0;4725:150::o;3676:214::-;3735:15;3793:5;3770:20;:18;:20::i;:::-;:28;3762:86;;;;-1:-1:-1;;;3762:86:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3865:11;3877:5;3865:18;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3865:18:3;;-1:-1:-1;3676:214:3;;;;:::o;17031:279::-;1280:12:7;:10;:12::i;:::-;1270:6;;;;;-1:-1:-1;;;;;1270:6:7;;;:22;;;1262:67;;;;;-1:-1:-1;;;1262:67:7;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1262:67:7;;;;;;;;;;;;;;;-1:-1:-1;;;;;17110:22:3;::::1;17102:62;;;::::0;;-1:-1:-1;;;17102:62:3;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;17182:4;::::0;;:29:::1;::::0;;-1:-1:-1;;;17182:29:3;;17205:4:::1;17182:29:::0;;::::1;::::0;;;;;17214:1:::1;::::0;-1:-1:-1;;;;;17182:4:3;;::::1;::::0;:14:::1;::::0;:29;;;;;::::1;::::0;;;;;;;;:4;:29;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;17182:29:3;:33:::1;17174:65;;;::::0;;-1:-1:-1;;;17174:65:3;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;17174:65:3;;;;;;;;;;;;;::::1;;17249:4;::::0;;17273:29:::1;::::0;;-1:-1:-1;;;17273:29:3;;17296:4:::1;17273:29:::0;;::::1;::::0;;;;;-1:-1:-1;;;;;17249:4:3;;::::1;::::0;:13:::1;::::0;17263:8;;17249:4;;17273:14:::1;::::0;:29;;;;;::::1;::::0;;;;;;;;;17249:4;17273:29;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;17273:29:3;17249:54:::1;::::0;;-1:-1:-1;;;;;;17249:54:3::1;::::0;;;;;;-1:-1:-1;;;;;17249:54:3;;::::1;;::::0;::::1;::::0;;;;;;;;;;;;;;17273:29:::1;::::0;17249:54;;;;;;;-1:-1:-1;17249:54:3;;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;;;17031:279:3:o;1549:33::-;;;-1:-1:-1;;;;;1549:33:3;;:::o;2678:48::-;;;;;;;;;;;;;:::o;8180:229::-;1280:12:7;:10;:12::i;:::-;1270:6;;;;;-1:-1:-1;;;;;1270:6:7;;;:22;;;1262:67;;;;;-1:-1:-1;;;1262:67:7;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1262:67:7;;;;;;;;;;;;;;;8279:5:3::1;8263:12;;:21;;:50;;;;8306:7;8288:14;;:25;;8263:50;8255:83;;;::::0;;-1:-1:-1;;;8255:83:3;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;8255:83:3;;;;;;;;;;;;;::::1;;8348:12;:20:::0;;;;8378:14:::1;:24:::0;8180:229::o;1040:76:26:-;1102:7;;;;1040:76;:::o;8781:372:3:-;1280:12:7;:10;:12::i;:::-;1270:6;;;;;-1:-1:-1;;;;;1270:6:7;;;:22;;;1262:67;;;;;-1:-1:-1;;;1262:67:7;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1262:67:7;;;;;;;;;;;;;;;8908:8:3::1;::::0;1004:2:::1;-1:-1:-1::0;;;8908:8:3;;::::1;:18;:8;:18;8900:66;;;;-1:-1:-1::0;;;8900:66:3::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8994:10;;;;;;;;;-1:-1:-1::0;;;;;8994:10:3::1;-1:-1:-1::0;;;;;8994:17:3::1;;:19;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;8994:19:3;8984:29:::1;::::0;;::::1;::::0;;::::1;;;8976:67;;;::::0;;-1:-1:-1;;;8976:67:3;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;8976:67:3;;;;;;;;;;;;;::::1;;9053:10;::::0;-1:-1:-1;;;;;9053:10:3::1;:15;9069:12;:10;:12::i;:::-;9053:73;::::0;;-1:-1:-1;;;;;;9053:73:3::1;::::0;;;;;;-1:-1:-1;;;;;9053:73:3;;::::1;;::::0;::::1;::::0;::::1;::::0;;::::1;::::0;;;;;;::::1;::::0;;;;;;::::1;::::0;;;;;::::1;::::0;;;;;;;;;;-1:-1:-1;;9053:73:3;;;;;;;-1:-1:-1;9053:73:3;;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;9136:8:3::1;:10:::0;;::::1;-1:-1:-1::0;;;9136:10:3;;::::1;::::0;::::1;::::0;::::1;::::0;;::::1;;-1:-1:-1::0;;;;9136:10:3;;::::1;;::::0;;-1:-1:-1;;;;;;8781:372:3:o;1689:145:7:-;1280:12;:10;:12::i;:::-;1270:6;;;;;-1:-1:-1;;;;;1270:6:7;;;:22;;;1262:67;;;;;-1:-1:-1;;;1262:67:7;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1262:67:7;;;;;;;;;;;;;;;1779:6:::1;::::0;1758:40:::1;::::0;1795:1:::1;::::0;1779:6:::1;::::0;::::1;-1:-1:-1::0;;;;;1779:6:7::1;::::0;1758:40:::1;::::0;1795:1;;1758:40:::1;1808:6;:19:::0;;-1:-1:-1;;;;;;1808:19:7::1;::::0;;1689:145::o;1079:21:3:-;;;-1:-1:-1;;;1079:21:3;;;;;:::o;1233:::-;;;-1:-1:-1;;;;;1233:21:3;;:::o;1140:39::-;;;;:::o;2733:::-;;;;:::o;1066:77:7:-;1130:6;;;;;-1:-1:-1;;;;;1130:6:7;;1066:77::o;2778:36:3:-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2778:36:3;;-1:-1:-1;2778:36:3;:::o;17316:187::-;1280:12:7;:10;:12::i;:::-;1270:6;;;;;-1:-1:-1;;;;;1270:6:7;;;:22;;;1262:67;;;;;-1:-1:-1;;;1262:67:7;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1262:67:7;;;;;;;;;;;;;;;-1:-1:-1;;;;;17400:22:3;::::1;17392:62;;;::::0;;-1:-1:-1;;;17392:62:3;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;17464:4;;;;;;;;;-1:-1:-1::0;;;;;17464:4:3::1;-1:-1:-1::0;;;;;17464:22:3::1;;17487:8;17464:32;;;;;;;;;;;;;-1:-1:-1::0;;;;;17464:32:3::1;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;17316:187:::0;:::o;4359:360::-;1280:12:7;:10;:12::i;:::-;1270:6;;;;;-1:-1:-1;;;;;1270:6:7;;;:22;;;1262:67;;;;;-1:-1:-1;;;1262:67:7;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1262:67:7;;;;;;;;;;;;;;;4442:9:3::1;4438:275;4461:20;:18;:20::i;:::-;4457:1;:24;4438:275;;;4526:7;-1:-1:-1::0;;;;;4506:27:3::1;:16;4520:1;4506:13;:16::i;:::-;-1:-1:-1::0;;;;;4506:27:3::1;;4502:201;;;4553:20;4576:38;4612:1;4590:20;:18;:20::i;:::-;:23;4576:13;:38::i;:::-;4553:61;;4649:4;4632:11;4644:1;4632:14;;;;;;;;;;;;;;;;:21;;;;;-1:-1:-1::0;;;;;4632:21:3::1;;;;;-1:-1:-1::0;;;;;4632:21:3::1;;;;;;4671:11;:17;;;;;;;;::::0;;;::::1;::::0;;;;-1:-1:-1;;4671:17:3;;;;;-1:-1:-1;;;;;;4671:17:3::1;::::0;;;;;-1:-1:-1;4502:201:3::1;4483:3;;4438:275;;2457:36:::0;;;;:::o;2404:47::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2404:47:3;;;;;;;-1:-1:-1;2404:47:3;-1:-1:-1;;;2404:47:3;;;;-1:-1:-1;;;2404:47:3;;;;;-1:-1:-1;;;2404:47:3;;;;;;;;;;;:::o;1633:25::-;;;-1:-1:-1;;;;;1633:25:3;;:::o;8415:360::-;1280:12:7;:10;:12::i;:::-;1270:6;;;;;-1:-1:-1;;;;;1270:6:7;;;:22;;;1262:67;;;;;-1:-1:-1;;;1262:67:7;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1262:67:7;;;;;;;;;;;;;;;8540:6:3::1;::::0;1004:2:::1;-1:-1:-1::0;;;8540:6:3;;::::1;:16;:6;:16;8532:62;;;;-1:-1:-1::0;;;8532:62:3::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8622:8;;;;;;;;;-1:-1:-1::0;;;;;8622:8:3::1;-1:-1:-1::0;;;;;8622:15:3::1;;:17;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;8622:17:3;8612:27:::1;::::0;;::::1;::::0;;::::1;;;8604:65;;;::::0;;-1:-1:-1;;;8604:65:3;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;8604:65:3;;;;;;;;;;;;;::::1;;8679:8;::::0;-1:-1:-1;;;;;8679:8:3::1;:13;8693:12;:10;:12::i;:::-;8679:71;::::0;;-1:-1:-1;;;;;;8679:71:3::1;::::0;;;;;;-1:-1:-1;;;;;8679:71:3;;::::1;;::::0;::::1;::::0;::::1;::::0;;::::1;::::0;;;;;;::::1;::::0;;;;;;::::1;::::0;;;;;::::1;::::0;;;;;;;;;;-1:-1:-1;;8679:71:3;;;;;;;-1:-1:-1;8679:71:3;;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;8760:6:3::1;:8:::0;;::::1;-1:-1:-1::0;;;8760:8:3;;::::1;::::0;::::1;::::0;::::1;::::0;;::::1;;-1:-1:-1::0;;;;8760:8:3;;::::1;;::::0;;-1:-1:-1;;;;;;8415:360:3:o;16452:116::-;-1:-1:-1;;;;;16538:16:3;16513:7;16538:16;;;:6;:16;;;;;:23;;16452:116::o;3568:102::-;3645:11;:18;3568:102;:::o;1054:19::-;;;-1:-1:-1;;;1054:19:3;;;;;:::o;12917:2169::-;1346:7:26;;;;1345:8;1337:37;;;;;-1:-1:-1;;;1337:37:26;;;;;;;;;;;;-1:-1:-1;;;1337:37:26;;;;;;;;;;;;;;;1671:1:27::1;2260:7;;:19;;2252:63;;;::::0;;-1:-1:-1;;;2252:63:27;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;1671:1;2390:7;:18:::0;13021:10:3::2;::::0;13008:9:::2;:23;;13000:67;;;::::0;;-1:-1:-1;;;13000:67:3;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;::::2;::::0;;;;;;;;;;;;;::::2;;13108:1;13085:20;:18;:20::i;:::-;:24;13077:66;;;::::0;;-1:-1:-1;;;13077:66:3;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;::::2;::::0;;;;;;;;;;;;;::::2;;13154:16;13173:19;:17;:19::i;:::-;13154:38:::0;-1:-1:-1;13228:12:3::2;13267:1;13255:13;::::0;::::2;;13252:608;;;-1:-1:-1::0;;13305:12:3;;13284:18:::2;13348:39;13361:12;:10;:12::i;:::-;13375:11;13348:12;:39::i;:::-;13331:56:::0;-1:-1:-1;13418:15:3::2;13409:5;:24;;;;;;;;;:53;;;-1:-1:-1::0;13446:16:3::2;13437:5;:25;;;;;;;;;13409:53;13401:95;;;::::0;;-1:-1:-1;;;13401:95:3;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;::::2;::::0;;;;;;;;;;;;;::::2;;13522:16;13513:5;:25;;;;;;;;;13510:340;;;13562:9;13574:6;:20;13581:12;:10;:12::i;:::-;-1:-1:-1::0;;;;;13574:20:3::2;::::0;;::::2;::::0;::::2;::::0;;;;;;-1:-1:-1;13574:20:3;:27;;-1:-1:-1;13558:278:3::2;13603:5:::0;;13558:278:::2;;13675:11;13640:46;;:6;:20;13647:12;:10;:12::i;:::-;-1:-1:-1::0;;;;;13640:20:3::2;-1:-1:-1::0;;;;;13640:20:3::2;;;;;;;;;;;;13663:1;13661;:3;13640:25;;;;;;;;;::::0;;;::::2;::::0;;;::::2;::::0;;::::2;;:31:::0;::::2;::::0;::::2;;;:46;13637:181;;;13748:16;13714:6;:20;13721:12;:10;:12::i;:::-;-1:-1:-1::0;;;;;13714:20:3::2;-1:-1:-1::0;;;;;13714:20:3::2;;;;;;;;;;;;13737:1;13735;:3;13714:25;;;;;;;;;;;;;;;;;;:31;;;:50;;;;;;;;;;;;;;;;;;;;;;;;13790:5;;13637:181;-1:-1:-1::0;;13610:3:3;13558:278:::2;;;;13510:340;13252:608;;;13881:25;13874:3;:32;;;;;;;;;13870:772;;;13962:12;::::0;13930:4:::2;::::0;-1:-1:-1;;;;;13930:4:3::2;:14;13945:12;:10;:12::i;:::-;13930:28;;;;;;;;;;;;;-1:-1:-1::0;;;;;13930:28:3::2;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;13930:28:3;:44:::2;;13922:94;;;;-1:-1:-1::0;;;13922:94:3::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14031:4;::::0;-1:-1:-1;;;;;14031:4:3::2;:17;14049:12;:10;:12::i;:::-;14071:4;14078:12;;14031:60;;;;;;;;;;;;;-1:-1:-1::0;;;;;14031:60:3::2;;;;;;-1:-1:-1::0;;;;;14031:60:3::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;;14105:4:3::2;::::0;14132:1:::2;14115:12:::0;;-1:-1:-1;;;;;14105:4:3;;::::2;::::0;:9:::2;::::0;14115:19:::2;::::0;:12;:16:::2;:19::i;:::-;14105:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;-1:-1:-1::0;;14150:4:3::2;::::0;14164:10:::2;::::0;14193:1:::2;14176:12:::0;;-1:-1:-1;;;;;14150:4:3;;::::2;::::0;-1:-1:-1;14150:13:3::2;::::0;-1:-1:-1;14164:10:3;;;::::2;::::0;14176:19:::2;::::0;:16:::2;:19::i;:::-;14150:46;;;;;;;;;;;;;-1:-1:-1::0;;;;;14150:46:3::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;13870:772:3::2;::::0;-1:-1:-1;13870:772:3::2;;14225:27;14218:3;:34;;;;;;;;;14214:428;;;14308:14;::::0;14276:4:::2;::::0;-1:-1:-1;;;;;14276:4:3::2;:14;14291:12;:10;:12::i;:::-;14276:28;;;;;;;;;;;;;-1:-1:-1::0;;;;;14276:28:3::2;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;14276:28:3;:46:::2;;14268:96;;;;-1:-1:-1::0;;;14268:96:3::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14379:4;::::0;-1:-1:-1;;;;;14379:4:3::2;:17;14397:12;:10;:12::i;:::-;14419:4;14426:14;;14379:62;;;;;;;;;;;;;-1:-1:-1::0;;;;;14379:62:3::2;;;;;;-1:-1:-1::0;;;;;14379:62:3::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;;14455:4:3::2;::::0;14465:14:::2;::::0;-1:-1:-1;;;;;14455:4:3;;::::2;::::0;:9:::2;::::0;14465:21:::2;::::0;14484:1:::2;14465:18;:21::i;:::-;14455:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;-1:-1:-1::0;;14502:4:3::2;::::0;14516:10:::2;::::0;14528:14:::2;::::0;-1:-1:-1;;;;;14502:4:3;;::::2;::::0;-1:-1:-1;14502:13:3::2;::::0;-1:-1:-1;14516:10:3;::::2;::::0;14528:21:::2;::::0;14547:1:::2;14528:18;:21::i;14582:49::-;14675:24;:12;:22;:24::i;:::-;14709:11;14723:48;14750:20;:18;:20::i;:::-;14723:22;:12;:20;:22::i;:::-;:26:::0;::::2;:48::i;:::-;14709:62;;14781:28;14790:18;14804:3;14790:13;:18::i;:::-;14781:8;:28::i;:::-;14820:6;:20;14827:12;:10;:12::i;:::-;-1:-1:-1::0;;;;;14820:20:3::2;-1:-1:-1::0;;;;;14820:20:3::2;;;;;;;;;;;;14846:232;;;;;;;;14883:3;14846:232;;;;;;;;::::0;;::::2;::::0;::::2;;::::0;::::2;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;14846:232:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14820:259;;::::2;::::0;;::::2;::::0;;-1:-1:-1;14820:259:3;;;::::2;::::0;;;;;::::2;::::0;;::::2;::::0;;::::2;::::0;;;;;;;;;;-1:-1:-1;;14820:259:3::2;::::0;;;;;::::2;;;;;;;;::::0;;-1:-1:-1;14820:259:3::2;::::0;::::2;::::0;;;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;-1:-1:-1;;14820:259:3;;::::2;;;::::0;;::::2;;;-1:-1:-1::0;;14820:259:3::2;-1:-1:-1::0;;;14820:259:3::2;::::0;;::::2;::::0;;;::::2;::::0;;;::::2;-1:-1:-1::0;;;;14820:259:3::2;-1:-1:-1::0;;;14820:259:3;;::::2;::::0;;;::::2;;-1:-1:-1::0;;;;14820:259:3::2;-1:-1:-1::0;;;14820:259:3;;;::::2;::::0;;;::::2;;::::0;;::::2;::::0;::::2;::::0;-1:-1:-1;14820:259:3;;::::2;::::0;;;;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;;::::2;::::0;;;;;;-1:-1:-1;;14820:259:3::2;::::0;;;;::::2;;;;;;;;::::0;;-1:-1:-1;;1628:1:27::1;2563:7;:22:::0;-1:-1:-1;;;;;12917:2169:3:o;1467:31::-;;;-1:-1:-1;;;;;1467:31:3;;:::o;1983:240:7:-;1280:12;:10;:12::i;:::-;1270:6;;;;;-1:-1:-1;;;;;1270:6:7;;;:22;;;1262:67;;;;;-1:-1:-1;;;1262:67:7;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1262:67:7;;;;;;;;;;;;;;;-1:-1:-1;;;;;2071:22:7;::::1;2063:73;;;;-1:-1:-1::0;;;2063:73:7::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2172:6;::::0;2151:38:::1;::::0;-1:-1:-1;;;;;2151:38:7;;::::1;::::0;2172:6:::1;::::0;::::1;;::::0;2151:38:::1;::::0;;;::::1;2199:6;:17:::0;;-1:-1:-1;;;;;2199:17:7;;::::1;;;-1:-1:-1::0;;;;;;2199:17:7;;::::1;::::0;;;::::1;::::0;;1983:240::o;16574:451:3:-;1280:12:7;:10;:12::i;:::-;1270:6;;;;;-1:-1:-1;;;;;1270:6:7;;;:22;;;1262:67;;;;;-1:-1:-1;;;1262:67:7;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1262:67:7;;;;;;;;;;;;;;;16779:4:3::1;:23:::0;;-1:-1:-1;;;;;;16779:23:3;;::::1;-1:-1:-1::0;;;;;16779:23:3;;::::1;;::::0;;;16812:8:::1;:30:::0;;;::::1;::::0;;::::1;::::0;;;::::1;::::0;;;16852:10:::1;:36:::0;;;::::1;::::0;;::::1;::::0;;;::::1;::::0;;;16898:8:::1;:37:::0;;;::::1;::::0;;::::1;::::0;;;::::1;::::0;;;16945:10:::1;:41:::0;;;::::1;::::0;;::::1;::::0;;;::::1;::::0;;16997:10:::1;:21:::0;;;;::::1;::::0;::::1;::::0;;;::::1;::::0;;16574:451::o;590:104:5:-;677:10;590:104;:::o;3896:251:3:-;3952:4;;3968:151;3991:20;:18;:20::i;:::-;3987:1;:24;3968:151;;;4056:7;-1:-1:-1;;;;;4036:27:3;:16;4050:1;4036:13;:16::i;:::-;-1:-1:-1;;;;;4036:27:3;;4032:77;;;4090:4;4083:11;;;;;4032:77;4013:3;;3968:151;;;-1:-1:-1;4135:5:3;;3896:251;-1:-1:-1;;3896:251:3:o;7526:307::-;7598:6;7606;7614:7;7633:8;7651;7669;7687;7717:37;7723:8;7733:10;7745:8;;;;;;;;;-1:-1:-1;;;;;7745:8:3;7717:5;:37::i;:::-;7705:49;;;;;;;;;;;;;;;;7764:8;;;;;;;;;-1:-1:-1;;;;;7764:8:3;-1:-1:-1;;;;;7764:13:3;;7778:8;7788:1;7791;7794;7797;7764:35;;;;;;;;;;;;;-1:-1:-1;;;;;7764:35:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;7818:1:3;;7821;;-1:-1:-1;7821:1:3;;-1:-1:-1;7526:307:3;-1:-1:-1;;;;;;;;;7526:307:3:o;7861:313::-;7935:6;7943;7951:7;7970:8;7988;8006;8024;8054:39;8060:8;8070:10;8082;;;;;;;;;-1:-1:-1;;;;;8082:10:3;8054:5;:39::i;:::-;8042:51;;;;;;;;;;;;;;;;8103:10;;;;;;;;;-1:-1:-1;;;;;8103:10:3;-1:-1:-1;;;;;8103:15:3;;8119:8;8129:1;8132;8135;8138;8103:37;;;;;;;;;;;;;-1:-1:-1;;;;;8103:37:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;8159:1:3;;8162;;-1:-1:-1;8159:1:3;;-1:-1:-1;7861:313:3;;-1:-1:-1;;;;;;;;;7861:313:3:o;9285:218::-;9337:16;9365:11;9379:6;:20;9386:12;:10;:12::i;:::-;-1:-1:-1;;;;;9379:20:3;;;;;;;;;;;;-1:-1:-1;9379:20:3;:27;;-1:-1:-1;9428:8:3;;:68;;9443:53;:42;9483:1;9443:6;:20;9450:12;:10;:12::i;:::-;-1:-1:-1;;;;;9443:20:3;-1:-1:-1;;;;;9443:20:3;;;;;;;;;;;;9470:1;9464:3;:7;9443:29;;;;;;;;;;;;;;;;;;;;;:35;;;;;;;;;:42;:39;:42;:::i;:::-;:51;:53::i;:::-;9428:68;;;9439:1;9428:68;9416:80;;9285:218;;:::o;3101:130:10:-;3159:7;3185:39;3189:1;3192;3185:39;;;;;;;;;;;;;;;;;:3;:39::i;:::-;3178:46;3101:130;-1:-1:-1;;;3101:130:10:o;1216:178:23:-;1368:19;;1386:1;1368:19;;;1216:178::o;1098:112::-;1189:14;;1098:112::o;4436:128:10:-;4494:7;4520:37;4524:1;4527;4520:37;;;;;;;;;;;;;;;;;:3;:37::i;15092:97:3:-;15154:28;;-1:-1:-1;;;;;15154:17:3;;;15172:9;15154:28;;;;;;;;;15172:9;15154:17;:28;;;;;;;;;;;;;;;;;;;6455:1045;6551:12;;;;;;6653:160;6681:5;-1:-1:-1;;;;;6681:12:3;;:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6681:14:3;6675:20;;;;6653:160;;;6718:9;6762:5;-1:-1:-1;;;;;6762:10:3;;6773:3;6762:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6762:15:3;;;6791:11;;;;;-1:-1:-1;6697:5:3;;6653:160;;;;6822:12;6837:34;6850:8;6860:10;6837:12;:34::i;:::-;6822:49;;6912:44;6924:24;6935:4;6941:6;6924:10;:24::i;:::-;6950:5;6912:11;:44::i;:::-;6904:52;;6982:1;6974:5;:9;;;6966:52;;;;;-1:-1:-1;;;6966:52:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;7029:11;7050;7071;7092;7113;7134;7198:5;-1:-1:-1;;;;;7198:10:3;;7215:1;7209:5;:7;7198:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;7198:19:3;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;7198:19:3;;-1:-1:-1;7198:19:3;-1:-1:-1;7198:19:3;-1:-1:-1;7198:19:3;;-1:-1:-1;7198:19:3;-1:-1:-1;7238:70:3;:59;7245:4;7251:13;;;;;7266;;7281:15;7238:6;:59::i;:70::-;7227:81;;7333:69;:58;7340:4;7354;7346:13;;7369:4;7361:13;;7376:14;7333:6;:58::i;:69::-;7318:84;;7422:71;:60;7429:4;7443;7435:13;;7458:4;7450:13;;7465:16;7422:6;:60::i;:71::-;7412:81;;6455:1045;;;;;;;;;;;;;;;:::o;874:176:10:-;932:7;963:5;;;986:6;;;;978:46;;;;;-1:-1:-1;;;978:46:10;;;;;;;;;;;;;;;;;;;;;;;;;;;2009:176:28;2065:6;2099:5;2091;:13;2083:65;;;;-1:-1:-1;;;2083:65:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2172:5:28;2009:176::o;3713:272:10:-;3799:7;3833:12;3826:5;3818:28;;;;-1:-1:-1;;;3818:28:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3856:9;3872:1;3868;:5;;;;;;;3713:272;-1:-1:-1;;;;;3713:272:10:o;5035:163::-;5121:7;5156:12;5148:6;5140:29;;;;-1:-1:-1;;;5140:29:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5190:1;5186;:5;;;;;;;5035:163;-1:-1:-1;;;;5035:163:10:o;12591:186:3:-;12668:17;12704:66;12717:8;12727:10;12739:30;12748:8;12758:10;12739:8;:30::i;:::-;12704:12;:66::i;5156:145::-;5228:7;5254:40;5282:5;5289:4;5254:27;:40::i;5707:742::-;5789:6;5829:26;5872:5;-1:-1:-1;;;;;5872:12:3;;:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5872:14:3;5887:1;5872:16;5858:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5858:31:3;;5829:60;;5903:8;5899:120;5921:5;-1:-1:-1;;;;;5921:12:3;;:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5921:14:3;5917:18;;;;;;;;5899:120;;;5971:37;5984:5;6006:1;5991:5;-1:-1:-1;;;;;5991:12:3;;:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5991:14:3;:16;5971:12;:37::i;:::-;5956:9;5966:1;5956:12;;;;;;;;;;;;;;;;;;;:52;5937:3;;5899:120;;;-1:-1:-1;6029:12:3;;6051:370;6074:9;:16;6070:1;:20;;;6051:370;;;6111:9;6123;6133:1;6123:12;;;;;;;;;;;;;;;;6111:24;;6157:1;6149:9;;6186:1;6175:7;:12;6172:169;;6210:6;;;6207:97;;6284:1;6277:8;;;;;;;;6207:97;6321:5;;;6172:169;6367:1;6357:7;:11;6354:57;;;6388:8;;;6354:57;6051:370;;6092:3;;6051:370;;;-1:-1:-1;6437:5:3;5707:742;-1:-1:-1;;;;5707:742:3:o;4881:269::-;4980:7;5014:4;5007;:11;4999:51;;;;;-1:-1:-1;;;4999:51:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;5067:76;5138:4;5067:66;5095:15;;;5112:20;5113:11;;;5130:1;5112:17;:20::i;:::-;5067:27;:66::i;:::-;:70;;:76::i;:::-;5060:83;4881:269;-1:-1:-1;;;;;4881:269:3:o;11178:639::-;11264:12;11288:11;11302:22;11315:8;11302:12;:22::i;:::-;11288:36;-1:-1:-1;11334:9:3;;11288:36;11386:198;11407:5;;11386:198;;-1:-1:-1;;;;;11437:16:3;;;;;;:6;:16;;;;;:21;;:41;;;;:16;-1:-1:-1;;11454:3:3;;;11437:21;;;;;;;;;;;;;;;;;;;:27;;;;;;:41;11433:141;;;11505:4;11498:11;;11535:1;11533;:3;11527:9;;11554:5;;11433:141;-1:-1:-1;;11414:3:3;11386:198;;;;11601:4;11593:60;;;;-1:-1:-1;;;11593:60:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;11688:16:3;;11664:21;11688:16;;;:6;:16;;;;;:21;;11705:3;;11688:21;;;;;;;;;;;;;;;;;;;11744:13;;-1:-1:-1;;;11744:13:3;;;;2580:1;11744:32;11734:43;-1:-1:-1;;;;;11781:17:3;;;11726:72;;;;:84;;;;;;;;;11178:639;-1:-1:-1;;;;;11178:639:3:o;12054:323::-;-1:-1:-1;;;;;12212:17:3;;:30;;;;12148:7;12257:18;;;:13;:18;;;;;;12148:7;;12212:30;12253:82;;12296:18;;;;:13;:18;;;;;:28;;;12253:82;12352:18;;;;:13;:18;;;;;;;12054:323;-1:-1:-1;;;;12054:323:3:o;1245:394:4:-;1324:7;1361:1;1347:11;:15;1339:49;;;;;-1:-1:-1;;;1339:49:4;;;;;;;;;;;;-1:-1:-1;;;1339:49:4;;;;;;;;;;;;;;;1394:11;1423;1409;1408:12;;:26;;;;;;;-1:-1:-1;1457:8:4;1471:131;1506:3;1496:6;:13;1492:43;;1521:5;;1492:43;1569:24;;;;;;;;;;;;;;;;;;;;;;;;;;1559:35;;;;;1471:131;;;1623:11;1614:6;:20;;;;;;;1245:394;-1:-1:-1;;;;;1245:394:4:o;5307::3:-;5388:12;5412:10;5425:1;5412:14;;5441:8;5452:5;-1:-1:-1;;;;;5452:12:3;;:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5452:14:3;;-1:-1:-1;5436:238:3;5468:5;;;;5436:238;;5494:5;;;;;;;5513:9;5556:5;-1:-1:-1;;;;;5556:10:3;;5569:1;5567;:3;5556:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5556:15:3;;;5585:9;;;;5556:15;-1:-1:-1;5612:12:3;;;;;;;;5608:56;;5644:5;;;5608:56;-1:-1:-1;;;5475:3:3;5436:238;;;;5683:11;5307:394;;;;:::o
Swarm Source
ipfs://9678b023273fe0cfe0112b36df7fa43979c9cdb5513a826c5fdcd82d8fdb96f2
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ 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.