Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 9,453 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Reclaim Token | 11480343 | 1463 days ago | IN | 0 ETH | 0.00107936 | ||||
Cancel Bettor Be... | 9915000 | 1704 days ago | IN | 0 ETH | 0.00033062 | ||||
Cancel Bettor Be... | 9914982 | 1704 days ago | IN | 0 ETH | 0.00033062 | ||||
Make Bet | 9904506 | 1706 days ago | IN | 0.01 ETH | 0.00141285 | ||||
Make Bet | 9904473 | 1706 days ago | IN | 0.00813 ETH | 0.00005438 | ||||
Make Bet | 9904473 | 1706 days ago | IN | 0.01 ETH | 0.0006293 | ||||
Cancel My Bet | 9892344 | 1708 days ago | IN | 0 ETH | 0.00012464 | ||||
Make Bet | 9892286 | 1708 days ago | IN | 0.01 ETH | 0.00031463 | ||||
Cancel My Bet | 9892282 | 1708 days ago | IN | 0 ETH | 0.00006232 | ||||
Cancel My Bet | 9885696 | 1709 days ago | IN | 0 ETH | 0.00014325 | ||||
Make Bet | 9884849 | 1709 days ago | IN | 0.01 ETH | 0.00136672 | ||||
Make Bet | 9884757 | 1709 days ago | IN | 0.01 ETH | 0.00157319 | ||||
Reward My Bet | 9884696 | 1709 days ago | IN | 0 ETH | 0.00249608 | ||||
Finish Bet Round | 9884674 | 1709 days ago | IN | 0 ETH | 0.0002949 | ||||
Set Bet Round Re... | 9884674 | 1709 days ago | IN | 0 ETH | 0.00022303 | ||||
Make Bet | 9884604 | 1709 days ago | IN | 0.01 ETH | 0.00447578 | ||||
Make Bet | 9884567 | 1709 days ago | IN | 0.01 ETH | 0.00198231 | ||||
Reward My Bet | 9878016 | 1710 days ago | IN | 0 ETH | 0.00224576 | ||||
Finish Bet Round | 9878009 | 1710 days ago | IN | 0 ETH | 0.00054065 | ||||
Set Bet Round Re... | 9878009 | 1710 days ago | IN | 0 ETH | 0.00040896 | ||||
Cancel My Bet | 9877996 | 1710 days ago | IN | 0 ETH | 0.00022662 | ||||
Finish Bet Round | 9877986 | 1710 days ago | IN | 0 ETH | 0.00044235 | ||||
Set Bet Round Re... | 9877986 | 1710 days ago | IN | 0 ETH | 0.00033477 | ||||
Make Bet | 9877944 | 1710 days ago | IN | 0.01 ETH | 0.00114419 | ||||
Make Bet | 9877942 | 1710 days ago | IN | 0.01 ETH | 0.00250352 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
11480343 | 1463 days ago | 1.1234 ETH | ||||
9915000 | 1704 days ago | 0.01 ETH | ||||
9914982 | 1704 days ago | 0.01 ETH | ||||
9892344 | 1708 days ago | 0.01 ETH | ||||
9892282 | 1708 days ago | 0.01 ETH | ||||
9885696 | 1709 days ago | 0.01 ETH | ||||
9884696 | 1709 days ago | 0.00075 ETH | ||||
9884696 | 1709 days ago | 0.019 ETH | ||||
9884696 | 1709 days ago | 0.00005 ETH | ||||
9884696 | 1709 days ago | 0.00005 ETH | ||||
9884696 | 1709 days ago | 0.00005 ETH | ||||
9884696 | 1709 days ago | 0.00005 ETH | ||||
9884696 | 1709 days ago | 0.00005 ETH | ||||
9878016 | 1710 days ago | 0.0007 ETH | ||||
9878016 | 1710 days ago | 0.019 ETH | ||||
9878016 | 1710 days ago | 0.00005 ETH | ||||
9878016 | 1710 days ago | 0.00005 ETH | ||||
9878016 | 1710 days ago | 0.00005 ETH | ||||
9878016 | 1710 days ago | 0.00005 ETH | ||||
9878016 | 1710 days ago | 0.00005 ETH | ||||
9878016 | 1710 days ago | 0.00005 ETH | ||||
9877996 | 1710 days ago | 0.01 ETH | ||||
9866088 | 1712 days ago | 0.05 ETH | ||||
9866088 | 1712 days ago | 0.01 ETH | ||||
9866088 | 1712 days ago | 0.1 ETH |
Loading...
Loading
Contract Name:
Bets
Compiler Version
v0.5.4+commit.9549d8ff
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2019-03-10 */ pragma solidity >=0.5.0 <0.6.0; // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @return the address of the owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner()); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { return msg.sender == _owner; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on 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-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: lib/CanReclaimToken.sol /** * @title Contracts that should be able to recover tokens * @author SylTi * @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner. * This will prevent any accidental loss of tokens. */ contract CanReclaimToken is Ownable { /** * @dev Reclaim all ERC20 compatible tokens * @param token ERC20 The address of the token contract */ function reclaimToken(IERC20 token) external onlyOwner { address payable owner = address(uint160(owner())); if (address(token) == address(0)) { owner.transfer(address(this).balance); return; } uint256 balance = token.balanceOf(address(this)); token.transfer(owner, balance); } } // File: lib/PPQueue.sol /** * @title PPQueue */ library PPQueue { struct Item { // uint idx; bool exists; uint prev; uint next; } struct Queue { uint length; uint first; uint last; uint counter; mapping (uint => Item) items; } /** * @dev push item to fifo queue */ function push(Queue storage queue, uint index) internal { require(!queue.items[index].exists); queue.items[index] = Item({ exists: true, prev: queue.last, next: 0 }); if (queue.length == 0) { queue.first = index; } else { queue.items[queue.last].next = index; } //save last item queue idx queue.last = index; queue.length++; } /** * @dev pop item from fifo queue */ function popf(Queue storage queue) internal returns (uint index) { index = queue.first; remove(queue, index); } /** * @dev pop item from lifo queue */ function popl(Queue storage queue) internal returns (uint index) { index = queue.last; remove(queue, index); } /** * @dev remove an item from queue */ function remove(Queue storage queue, uint index) internal { require(queue.length > 0); require(queue.items[index].exists); if (queue.items[index].prev != 0) { queue.items[queue.items[index].prev].next = queue.items[index].next; } else { //assume we delete first item queue.first = queue.items[index].next; } if (queue.items[index].next != 0) { queue.items[queue.items[index].next].prev = queue.items[index].prev; } else { //assume we delete last item queue.last = queue.items[index].prev; } //del from queue delete queue.items[index]; queue.length--; } /** * @dev get queue length * @return uint */ function len(Queue storage queue) internal view returns (uint) { //auto prevent existing of agents with updated address and same id return queue.length; } } // File: openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol /** * @title Helps contracts guard against reentrancy attacks. * @author Remco Bloemen <remco@2π.com>, Eenae <[email protected]> * @dev If you mark a function `nonReentrant`, you should also * mark it `external`. */ contract ReentrancyGuard { /// @dev counter to allow mutex lock with only one SSTORE operation uint256 private _guardCounter; constructor () internal { // The counter starts at one to prevent changing it from zero to a non-zero // value, which is a more expensive operation. _guardCounter = 1; } /** * @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() { _guardCounter += 1; uint256 localCounter = _guardCounter; _; require(localCounter == _guardCounter); } } // File: contracts/Referrals.sol interface Affiliates { function plusByCode(address _token, uint256 _affCode, uint _amount) external payable; function upAffCode(uint256 _affCode) external view returns (uint); function setUpAffCodeByAddr(address _address, uint _upAffCode) external; function getAffCode(uint256 _a) external pure returns (uint); function sendAffReward(address _token, address _address) external returns (uint); } contract Referrals is Ownable, ReentrancyGuard { using SafeMath for uint; //1% - 100, 10% - 1000 50% - 5000 uint256[] public affLevelReward; Affiliates public aff; constructor (address _aff) public { require(_aff != address(0)); aff = Affiliates(_aff); // two upper levels for each: winner and loser // total sum of level's % must be 100% //1% - 100, 10% - 1000 50% - 5000 affLevelReward.push(0); // level 0, 10% - player self - cacheback affLevelReward.push(8000); // level 1, 70% of affPool affLevelReward.push(2000); // level 2, 20% of affPool } //AFFILIATES function setAffiliateLevel(uint256 _level, uint256 _rewardPercent) external onlyOwner { require(_level < affLevelReward.length); affLevelReward[_level] = _rewardPercent; } function incAffiliateLevel(uint256 _rewardPercent) external onlyOwner { affLevelReward.push(_rewardPercent); } function decAffiliateLevel() external onlyOwner { delete affLevelReward[affLevelReward.length--]; } function affLevelsCount() external view returns (uint) { return affLevelReward.length; } function _distributeAffiliateReward(uint256 _sum, uint256 _affCode, uint256 _level, bool _cacheBack) internal { uint upAffCode = aff.upAffCode(_affCode); if (affLevelReward[_level] > 0 && _affCode != 0 && (_level > 0 || (_cacheBack && upAffCode != 0))) { uint total = _getPercent(_sum, affLevelReward[_level]); aff.plusByCode.value(total)(address(0x0), _affCode, total); } if (affLevelReward.length > ++_level) { _distributeAffiliateReward(_sum, upAffCode, _level, false); } } function getAffReward() external nonReentrant { aff.sendAffReward(address(0x0), msg.sender); } //1% - 100, 10% - 1000 50% - 5000 function _getPercent(uint256 _v, uint256 _p) internal pure returns (uint) { return _v.mul(_p) / 10000; } } // File: openzeppelin-solidity/contracts/access/Roles.sol /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; } /** * @dev remove an account's access to this role */ function remove(Role storage role, address account) internal { require(account != address(0)); require(has(role, account)); role.bearer[account] = false; } /** * @dev check if an account has this role * @return bool */ function has(Role storage role, address account) internal view returns (bool) { require(account != address(0)); return role.bearer[account]; } } // File: lib/ServiceRole.sol contract ServiceRole { using Roles for Roles.Role; event ServiceAdded(address indexed account); event ServiceRemoved(address indexed account); Roles.Role private services; constructor() internal { _addService(msg.sender); } modifier onlyService() { require(isService(msg.sender)); _; } function isService(address account) public view returns (bool) { return services.has(account); } function renounceService() public { _removeService(msg.sender); } function _addService(address account) internal { services.add(account); emit ServiceAdded(account); } function _removeService(address account) internal { services.remove(account); emit ServiceRemoved(account); } } // File: contracts/Services.sol contract Services is Ownable,ServiceRole { constructor() public{ } function addService(address account) external onlyOwner { _addService(account); } function removeService(address account) external onlyOwner { _removeService(account); } } // File: contracts/BetLevels.sol contract BetLevels is Ownable { //value => level mapping(uint => uint) betLevels; //array of avail bets values uint[] public betLevelValues; constructor () public { //zero level = 0, skip it betLevelValues.length += 8; _setBetLevel(1, 0.01 ether); _setBetLevel(2, 0.05 ether); _setBetLevel(3, 0.1 ether); _setBetLevel(4, 0.5 ether); _setBetLevel(5, 1 ether); _setBetLevel(6, 5 ether); _setBetLevel(7, 10 ether); } function addBetLevel(uint256 value) external onlyOwner { require(betLevelValues.length == 0 || betLevelValues[betLevelValues.length - 1] < value); betLevelValues.length++; _setBetLevel(betLevelValues.length - 1, value); } function _setBetLevel(uint level, uint value) internal { betLevelValues[level] = value; betLevels[value] = level; } function setBetLevel(uint level, uint value) external onlyOwner { require(betLevelValues.length > level); require(betLevelValues[level] != value); delete betLevels[betLevelValues[level]]; _setBetLevel(level, value); } function betLevelsCount() external view returns (uint) { return betLevelValues.length; } function getBetLevel(uint value) internal view returns (uint level) { level = betLevels[value]; require(level != 0); } } // File: contracts/BetIntervals.sol contract BetIntervals is Ownable { event SetInterval(uint startsFrom, uint pastCount, uint newInterval, uint newPeriod); uint public constant BetEpoch = 1550534400; //Tuesday, 19 February 2019 г., 0:00:00 struct RoundInterval { uint interval; uint from; uint count; uint period; } RoundInterval[] public intervalHistory; constructor() public{ intervalHistory.push(RoundInterval({ period : 10 * 60, from : BetEpoch, count : 0, interval : 15 * 60 })); } function setInterval(uint _interval, uint _period) external onlyOwner { RoundInterval memory i = _getRoundIntervalAt(now); uint intervalsCount = (now - i.from) / i.interval + 1; RoundInterval memory ni = RoundInterval({ interval : _interval, from : i.from + i.interval * intervalsCount, count : intervalsCount + i.count, period : _period }); intervalHistory.push(ni); emit SetInterval(ni.from, ni.count, _interval, _period); } function getCurrentRoundId() public view returns (uint) { return getRoundIdAt(now, 0); } function getNextRoundId() public view returns (uint) { return getRoundIdAt(now, 1); } function getRoundIdAt(uint _time, uint _shift) public view returns (uint) { uint intervalId = _getRoundIntervalIdAt(_time); RoundInterval memory i = intervalHistory[intervalId]; return _time > i.from ? (_time - i.from) / i.interval + i.count + _shift : 0; } function getCurrentRoundInterval() public view returns (uint interval, uint period) { return getRoundIntervalAt(now); } function getRoundIntervalAt(uint _time) public view returns (uint interval, uint period) { RoundInterval memory i = _getRoundIntervalAt(_time); interval = i.interval; period = i.period; } function getCurrentRoundInfo() public view returns ( uint roundId, uint startAt, uint finishAt ) { return getRoundInfoAt(now, 0); } function getNextRoundInfo() public view returns ( uint roundId, uint startAt, uint finishAt ) { return getRoundInfoAt(now, 1); } function getRoundInfoAt(uint _time, uint _shift) public view returns ( uint roundId, uint startAt, uint finishAt ) { RoundInterval memory i = _getRoundIntervalAt(_time); uint intervalsCount = _time > i.from ? (_time - i.from) / i.interval + _shift : 0; startAt = i.from + i.interval * intervalsCount; roundId = i.count + intervalsCount; finishAt = i.period + startAt; } function _getRoundIntervalAt(uint _time) internal view returns (RoundInterval memory) { return intervalHistory[_getRoundIntervalIdAt(_time)]; } function _getRoundIntervalIdAt(uint _time) internal view returns (uint) { require(intervalHistory.length > 0); // if (intervalHistory.length == 0) return 0; // Shortcut for the actual value if (_time >= intervalHistory[intervalHistory.length - 1].from) return intervalHistory.length - 1; if (_time < intervalHistory[0].from) return 0; // Binary search of the value in the array uint min = 0; uint max = intervalHistory.length - 1; while (max > min) { uint mid = (max + min + 1) / 2; if (intervalHistory[mid].from <= _time) { min = mid; } else { max = mid - 1; } } return min; } } // File: contracts/ReservedValue.sol contract ReservedValue is Ownable { using SafeMath for uint; event Income(address source, uint256 amount); address payable public wallet; //total reserved eth amount uint256 public totalReserved; constructor(address payable _w) public { require(_w != address(0)); wallet = _w; } function setWallet(address payable _w) external onlyOwner { require(address(_w) != address(0)); wallet = _w; } /// @notice The fallback function payable function() external payable { require(msg.value > 0); _flushBalance(); } function _flushBalance() internal { uint256 balance = address(this).balance.sub(totalReserved); if (balance > 0) { address(wallet).transfer(balance); emit Income(address(this), balance); } } function _incTotalReserved(uint value) internal { totalReserved = totalReserved.add(value); } function _decTotalReserved(uint value) internal { totalReserved = totalReserved.sub(value); } } // File: contracts/Bets.sol contract Bets is Ownable, ReservedValue, BetIntervals, BetLevels, Referrals, Services, CanReclaimToken { using SafeMath for uint; event BetCreated(address indexed bettor, uint betId, uint index, uint allyRace, uint enemyRace, uint betLevel, uint value, uint utmSource); event BetAccepted(uint betId, uint opBetId, uint roundId); event BetCanceled(uint betId); event BetRewarded(uint winBetId, uint loseBetId, uint reward, bool noWin); event BetRoundCalculated(uint roundId, uint winnerRace, uint loserRace, uint betLevel, uint pool, uint bettorCount); event StartBetRound(uint roundId, uint startAt, uint finishAt); event RoundRaceResult(uint roundId, uint raceId, int32 result); event FinishBetRound(uint roundId, uint startCheckedAt, uint finishCheckedAt); using PPQueue for PPQueue.Queue; struct Bettor { uint counter; mapping(uint => uint) bets; } struct Race { uint index; bool exists; uint count; int32 result; } struct BetRound { uint startedAt; uint finishedAt; uint startCheckedAt; uint finishCheckedAt; uint[] bets; mapping(uint => Race) races; uint[] raceList; } uint[] public roundsList; //roundId => BetRound mapping(uint => BetRound) betRounds; struct Bet { address payable bettor; uint roundId; uint allyRace; uint enemyRace; uint value; uint level; uint opBetId; uint reward; bool active; } struct BetStat { uint sum; uint pool; uint affPool; uint count; bool taxed; } uint public lastBetId; mapping(uint => Bet) bets; mapping(address => Bettor) bettors; struct BetData { mapping(uint => BetStat) stat; PPQueue.Queue queue; } //betLevel => allyRace => enemyRace => BetData mapping(uint => mapping(uint => mapping(uint => BetData))) betData; //raceId => allowed mapping(uint => bool) public allowedRace; uint public systemFeePcnt; uint public affPoolPcnt; constructor(address payable _w, address _aff) ReservedValue(_w) Referrals(_aff) public payable { // systemFee 5% (from loser sum) // affPoolPercent 5% (from loser sum) setFee(500, 500); //allow races, BTC,LTC,ETH by default allowedRace[1] = true; allowedRace[2] = true; allowedRace[4] = true; allowedRace[10] = true; allowedRace[13] = true; } function setFee(uint _systemFee, uint _affFee) public onlyOwner { systemFeePcnt = _systemFee; affPoolPcnt = _affFee; } function allowRace(uint _race, bool _allow) external onlyOwner { allowedRace[_race] = _allow; } function makeBet(uint allyRace, uint enemyRace, uint _affCode, uint _source) public payable { require(allyRace != enemyRace && allowedRace[allyRace] && allowedRace[enemyRace]); //require bet level exists uint level = getBetLevel(msg.value); Bet storage bet = bets[++lastBetId]; bet.active = true; bet.bettor = msg.sender; bet.allyRace = allyRace; bet.enemyRace = enemyRace; bet.value = msg.value; bet.level = level; //save bet to bettor list && inc. bets count bettors[bet.bettor].bets[++bettors[bet.bettor].counter] = lastBetId; emit BetCreated(bet.bettor, lastBetId, bettors[bet.bettor].counter, allyRace, enemyRace, level, msg.value, _source); //upd queue BetData storage allyData = betData[level][allyRace][enemyRace]; BetData storage enemyData = betData[level][enemyRace][allyRace]; //if there is nobody on opposite side if (enemyData.queue.len() == 0) { allyData.queue.push(lastBetId); } else { //accepting bet uint nextRoundId = _startNextRound(); uint opBetId = enemyData.queue.popf(); bet.opBetId = opBetId; bet.roundId = nextRoundId; bets[opBetId].opBetId = lastBetId; bets[opBetId].roundId = nextRoundId; //upd fight stat allyData.stat[nextRoundId].sum = allyData.stat[nextRoundId].sum.add(msg.value); allyData.stat[nextRoundId].count++; enemyData.stat[nextRoundId].sum = enemyData.stat[nextRoundId].sum.add(bets[opBetId].value); enemyData.stat[nextRoundId].count++; if (!betRounds[nextRoundId].races[allyRace].exists) { betRounds[nextRoundId].races[allyRace].exists = true; betRounds[nextRoundId].races[allyRace].index = betRounds[nextRoundId].raceList.length; betRounds[nextRoundId].raceList.push(allyRace); } betRounds[nextRoundId].races[allyRace].count++; if (!betRounds[nextRoundId].races[enemyRace].exists) { betRounds[nextRoundId].races[enemyRace].exists = true; betRounds[nextRoundId].races[enemyRace].index = betRounds[nextRoundId].raceList.length; betRounds[nextRoundId].raceList.push(enemyRace); } betRounds[nextRoundId].races[enemyRace].count++; betRounds[nextRoundId].bets.push(opBetId); betRounds[nextRoundId].bets.push(lastBetId); emit BetAccepted(opBetId, lastBetId, nextRoundId); } _incTotalReserved(msg.value); // update last affiliate aff.setUpAffCodeByAddr(bet.bettor, _affCode); } function _startNextRound() internal returns (uint nextRoundId) { uint nextStartAt; uint nextFinishAt; (nextRoundId, nextStartAt, nextFinishAt) = getNextRoundInfo(); if (betRounds[nextRoundId].startedAt == 0) { betRounds[nextRoundId].startedAt = nextStartAt; roundsList.push(nextRoundId); emit StartBetRound(nextRoundId, nextStartAt, nextFinishAt); } } function cancelBettorBet(address bettor, uint betIndex) external onlyService { _cancelBet(bettors[bettor].bets[betIndex]); } function cancelMyBet(uint betIndex) external nonReentrant { _cancelBet(bettors[msg.sender].bets[betIndex]); } function cancelBet(uint betId) external nonReentrant { require(bets[betId].bettor == msg.sender); _cancelBet(betId); } function _cancelBet(uint betId) internal { Bet storage bet = bets[betId]; require(bet.active); //can cancel only not yet accepted bets require(bet.roundId == 0); //upd queue BetData storage allyData = betData[bet.level][bet.allyRace][bet.enemyRace]; allyData.queue.remove(betId); _decTotalReserved(bet.value); bet.bettor.transfer(bet.value); emit BetCanceled(betId); // del bet delete bets[betId]; } function _calcRoundLevel(uint level, uint allyRace, uint enemyRace, uint roundId) internal returns (int32 allyResult, int32 enemyResult){ require(betRounds[roundId].startedAt != 0 && betRounds[roundId].finishedAt != 0); allyResult = betRounds[roundId].races[allyRace].result; enemyResult = betRounds[roundId].races[enemyRace].result; if (allyResult < enemyResult) { (allyRace, enemyRace) = (enemyRace, allyRace); } BetData storage winnerData = betData[level][allyRace][enemyRace]; BetData storage loserData = betData[level][enemyRace][allyRace]; if (!loserData.stat[roundId].taxed) { loserData.stat[roundId].taxed = true; //check if really winner if (allyResult != enemyResult) { //system fee uint fee = _getPercent(loserData.stat[roundId].sum, systemFeePcnt); _decTotalReserved(fee); //affiliate % winnerData.stat[roundId].affPool = _getPercent(loserData.stat[roundId].sum, affPoolPcnt); //calc pool for round winnerData.stat[roundId].pool = loserData.stat[roundId].sum - fee - winnerData.stat[roundId].affPool; emit BetRoundCalculated(roundId, allyRace, enemyRace, level, winnerData.stat[roundId].pool, winnerData.stat[roundId].count); } } if (!winnerData.stat[roundId].taxed) { winnerData.stat[roundId].taxed = true; } } function rewardBettorBet(address bettor, uint betIndex) external onlyService { _rewardBet(bettors[bettor].bets[betIndex]); } function rewardMyBet(uint betIndex) external nonReentrant { _rewardBet(bettors[msg.sender].bets[betIndex]); } function rewardBet(uint betId) external nonReentrant { require(bets[betId].bettor == msg.sender); _rewardBet(betId); } function _rewardBet(uint betId) internal { Bet storage bet = bets[betId]; require(bet.active); //only accepted bets require(bet.roundId != 0); (int32 allyResult, int32 enemyResult) = _calcRoundLevel(bet.level, bet.allyRace, bet.enemyRace, bet.roundId); //disabling bet bet.active = false; if (allyResult >= enemyResult) { bet.reward = bet.value; if (allyResult > enemyResult) { //win BetStat memory s = betData[bet.level][bet.allyRace][bet.enemyRace].stat[bet.roundId]; bet.reward = bet.reward.add(s.pool / s.count); // winner's affiliates + loser's affiliates uint affPool = s.affPool / s.count; _decTotalReserved(affPool); // affiliate pool is 1/2 of total aff. pool, per each winner and loser _distributeAffiliateReward(affPool >> 1, aff.getAffCode(uint(bet.bettor)), 0, false); //no cacheback to winner _distributeAffiliateReward(affPool >> 1, aff.getAffCode(uint(bets[bet.opBetId].bettor)), 0, true); //cacheback to looser } bet.bettor.transfer(bet.reward); _decTotalReserved(bet.reward); emit BetRewarded(betId, bet.opBetId, bet.reward, allyResult == enemyResult); } _flushBalance(); } function provisionBetReward(uint betId) public view returns (uint reward) { Bet storage bet = bets[betId]; if (!bet.active) { return 0; } int32 allyResult = betRounds[bet.roundId].races[bet.allyRace].result; int32 enemyResult = betRounds[bet.roundId].races[bet.enemyRace].result; if (allyResult < enemyResult) { return 0; } reward = bet.value; BetData storage allyData = betData[bet.level][bet.allyRace][bet.enemyRace]; BetData storage enemyData = betData[bet.level][bet.enemyRace][bet.allyRace]; if (allyResult > enemyResult) { //win if (!enemyData.stat[bet.roundId].taxed) { uint pool = enemyData.stat[bet.roundId].sum - _getPercent(enemyData.stat[bet.roundId].sum, systemFeePcnt + affPoolPcnt); reward = bet.value.add(pool / allyData.stat[bet.roundId].count); } else { reward = bet.value.add(allyData.stat[bet.roundId].pool / allyData.stat[bet.roundId].count); } } } function provisionBettorBetReward(address bettor, uint betIndex) public view returns (uint reward) { return provisionBetReward(bettors[bettor].bets[betIndex]); } function finalizeBetRound(uint betLevel, uint allyRace, uint enemyRace, uint roundId) external onlyService { _calcRoundLevel(betLevel, allyRace, enemyRace, roundId); _flushBalance(); } function roundsCount() external view returns (uint) { return roundsList.length; } function getBettorsBetCounter(address bettor) external view returns (uint) { return bettors[bettor].counter; } function getBettorsBetId(address bettor, uint betIndex) external view returns (uint betId) { return bettors[bettor].bets[betIndex]; } function getBettorsBets(address bettor) external view returns (uint[] memory betIds) { Bettor storage b = bettors[bettor]; uint j; for (uint i = 1; i <= b.counter; i++) { if (b.bets[i] != 0) { j++; } } if (j > 0) { betIds = new uint[](j); j = 0; for (uint i = 1; i <= b.counter; i++) { if (b.bets[i] != 0) { betIds[j++] = b.bets[i]; } } } } function getBet(uint betId) public view returns ( address bettor, bool active, uint roundId, uint allyRace, uint enemyRace, uint value, uint level, uint opBetId, uint reward ) { Bet memory b = bets[betId]; return (b.bettor, b.active, b.roundId, b.allyRace, b.enemyRace, b.value, b.level, b.opBetId, b.reward); } function getBetRoundStat(uint roundId, uint allyRace, uint enemyRace, uint level) public view returns ( uint sum, uint pool, uint affPool, uint count, bool taxed ) { BetStat memory bs = betData[level][allyRace][enemyRace].stat[roundId]; return (bs.sum, bs.pool, bs.affPool, bs.count, bs.taxed); } function getBetQueueLength(uint allyRace, uint enemyRace, uint level) public view returns (uint) { return betData[level][allyRace][enemyRace].queue.len(); } function getCurrentBetRound() public view returns ( uint roundId, uint startedAt, uint finishedAt, uint startCheckedAt, uint finishCheckedAt, uint betsCount, uint raceCount ) { roundId = getCurrentRoundId(); (startedAt, finishedAt, startCheckedAt, finishCheckedAt, betsCount, raceCount) = getBetRound(roundId); } function getNextBetRound() public view returns ( uint roundId, uint startedAt, uint finishedAt, uint startCheckedAt, uint finishCheckedAt, uint betsCount, uint raceCount ) { roundId = getCurrentRoundId() + 1; (startedAt, finishedAt, startCheckedAt, finishCheckedAt, betsCount, raceCount) = getBetRound(roundId); } function getBetRound(uint roundId) public view returns ( uint startedAt, uint finishedAt, uint startCheckedAt, uint finishCheckedAt, uint betsCount, uint raceCount ) { BetRound memory b = betRounds[roundId]; return (b.startedAt, b.finishedAt, b.startCheckedAt, b.finishCheckedAt, b.bets.length, b.raceList.length); } function getBetRoundBets(uint roundId) public view returns (uint[] memory betIds) { return betRounds[roundId].bets; } function getBetRoundBetId(uint roundId, uint betIndex) public view returns (uint betId) { return betRounds[roundId].bets[betIndex]; } function getBetRoundRaces(uint roundId) public view returns (uint[] memory raceIds) { return betRounds[roundId].raceList; } function getBetRoundRaceStat(uint roundId, uint raceId) external view returns ( uint index, uint count, int32 result ){ Race memory r = betRounds[roundId].races[raceId]; return (r.index, r.count, r.result); } function setBetRoundResult(uint roundId, uint count, uint[] memory packedRaces, uint[] memory packedResults) public onlyService { require(packedRaces.length == packedResults.length); require(packedRaces.length * 8 >= count); BetRound storage r = betRounds[roundId]; require(r.startedAt != 0 && r.finishedAt == 0); uint raceId; int32 result; for (uint i = 0; i < count; i++) { raceId = _upack(packedRaces[i / 8], i % 8); result = int32(_upack(packedResults[i / 8], i % 8)); r.races[raceId].result = result; emit RoundRaceResult(roundId, raceId, result); } } function finishBetRound(uint roundId, uint startCheckedAt, uint finishCheckedAt) public onlyService { BetRound storage r = betRounds[roundId]; require(r.startedAt != 0 && r.finishedAt == 0); uint finishAt; (, , finishAt) = getRoundInfoAt(r.startedAt, 0); require(now >= finishAt); r.finishedAt = finishAt; r.startCheckedAt = startCheckedAt; r.finishCheckedAt = finishCheckedAt; emit FinishBetRound(roundId, startCheckedAt, finishCheckedAt); } //extract n-th 32-bit int from uint function _upack(uint _v, uint _n) internal pure returns (uint) { // _n = _n & 7; //be sure < 8 return (_v >> (32 * _n)) & 0xFFFFFFFF; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[{"name":"betId","type":"uint256"}],"name":"getBet","outputs":[{"name":"bettor","type":"address"},{"name":"active","type":"bool"},{"name":"roundId","type":"uint256"},{"name":"allyRace","type":"uint256"},{"name":"enemyRace","type":"uint256"},{"name":"value","type":"uint256"},{"name":"level","type":"uint256"},{"name":"opBetId","type":"uint256"},{"name":"reward","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"roundId","type":"uint256"},{"name":"allyRace","type":"uint256"},{"name":"enemyRace","type":"uint256"},{"name":"level","type":"uint256"}],"name":"getBetRoundStat","outputs":[{"name":"sum","type":"uint256"},{"name":"pool","type":"uint256"},{"name":"affPool","type":"uint256"},{"name":"count","type":"uint256"},{"name":"taxed","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"betId","type":"uint256"}],"name":"rewardBet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"bettor","type":"address"},{"name":"betIndex","type":"uint256"}],"name":"cancelBettorBet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"token","type":"address"}],"name":"reclaimToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"bettor","type":"address"},{"name":"betIndex","type":"uint256"}],"name":"provisionBettorBetReward","outputs":[{"name":"reward","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"removeService","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"systemFeePcnt","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"roundId","type":"uint256"},{"name":"startCheckedAt","type":"uint256"},{"name":"finishCheckedAt","type":"uint256"}],"name":"finishBetRound","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"roundsList","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"aff","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"level","type":"uint256"},{"name":"value","type":"uint256"}],"name":"setBetLevel","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"bettor","type":"address"},{"name":"betIndex","type":"uint256"}],"name":"rewardBettorBet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"betLevelValues","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentRoundInterval","outputs":[{"name":"interval","type":"uint256"},{"name":"period","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_level","type":"uint256"},{"name":"_rewardPercent","type":"uint256"}],"name":"setAffiliateLevel","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"betId","type":"uint256"}],"name":"cancelBet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"roundId","type":"uint256"},{"name":"raceId","type":"uint256"}],"name":"getBetRoundRaceStat","outputs":[{"name":"index","type":"uint256"},{"name":"count","type":"uint256"},{"name":"result","type":"int32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"bettor","type":"address"},{"name":"betIndex","type":"uint256"}],"name":"getBettorsBetId","outputs":[{"name":"betId","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"wallet","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_systemFee","type":"uint256"},{"name":"_affFee","type":"uint256"}],"name":"setFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addService","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentRoundId","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"decAffiliateLevel","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"lastBetId","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_interval","type":"uint256"},{"name":"_period","type":"uint256"}],"name":"setInterval","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_time","type":"uint256"}],"name":"getRoundIntervalAt","outputs":[{"name":"interval","type":"uint256"},{"name":"period","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getNextRoundInfo","outputs":[{"name":"roundId","type":"uint256"},{"name":"startAt","type":"uint256"},{"name":"finishAt","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BetEpoch","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentRoundInfo","outputs":[{"name":"roundId","type":"uint256"},{"name":"startAt","type":"uint256"},{"name":"finishAt","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"getAffReward","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"roundId","type":"uint256"}],"name":"getBetRoundRaces","outputs":[{"name":"raceIds","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"betLevel","type":"uint256"},{"name":"allyRace","type":"uint256"},{"name":"enemyRace","type":"uint256"},{"name":"roundId","type":"uint256"}],"name":"finalizeBetRound","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"betIndex","type":"uint256"}],"name":"cancelMyBet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"affLevelsCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentBetRound","outputs":[{"name":"roundId","type":"uint256"},{"name":"startedAt","type":"uint256"},{"name":"finishedAt","type":"uint256"},{"name":"startCheckedAt","type":"uint256"},{"name":"finishCheckedAt","type":"uint256"},{"name":"betsCount","type":"uint256"},{"name":"raceCount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"affPoolPcnt","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"roundId","type":"uint256"},{"name":"count","type":"uint256"},{"name":"packedRaces","type":"uint256[]"},{"name":"packedResults","type":"uint256[]"}],"name":"setBetRoundResult","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"betId","type":"uint256"}],"name":"provisionBetReward","outputs":[{"name":"reward","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_rewardPercent","type":"uint256"}],"name":"incAffiliateLevel","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"roundsCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"betIndex","type":"uint256"}],"name":"rewardMyBet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"allyRace","type":"uint256"},{"name":"enemyRace","type":"uint256"},{"name":"_affCode","type":"uint256"},{"name":"_source","type":"uint256"}],"name":"makeBet","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"betLevelsCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceService","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getNextBetRound","outputs":[{"name":"roundId","type":"uint256"},{"name":"startedAt","type":"uint256"},{"name":"finishedAt","type":"uint256"},{"name":"startCheckedAt","type":"uint256"},{"name":"finishCheckedAt","type":"uint256"},{"name":"betsCount","type":"uint256"},{"name":"raceCount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"bettor","type":"address"}],"name":"getBettorsBetCounter","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_race","type":"uint256"},{"name":"_allow","type":"bool"}],"name":"allowRace","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"value","type":"uint256"}],"name":"addBetLevel","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"roundId","type":"uint256"}],"name":"getBetRound","outputs":[{"name":"startedAt","type":"uint256"},{"name":"finishedAt","type":"uint256"},{"name":"startCheckedAt","type":"uint256"},{"name":"finishCheckedAt","type":"uint256"},{"name":"betsCount","type":"uint256"},{"name":"raceCount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"bettor","type":"address"}],"name":"getBettorsBets","outputs":[{"name":"betIds","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalReserved","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getNextRoundId","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"intervalHistory","outputs":[{"name":"interval","type":"uint256"},{"name":"from","type":"uint256"},{"name":"count","type":"uint256"},{"name":"period","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"allowedRace","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_w","type":"address"}],"name":"setWallet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_time","type":"uint256"},{"name":"_shift","type":"uint256"}],"name":"getRoundInfoAt","outputs":[{"name":"roundId","type":"uint256"},{"name":"startAt","type":"uint256"},{"name":"finishAt","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_time","type":"uint256"},{"name":"_shift","type":"uint256"}],"name":"getRoundIdAt","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"roundId","type":"uint256"},{"name":"betIndex","type":"uint256"}],"name":"getBetRoundBetId","outputs":[{"name":"betId","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isService","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"allyRace","type":"uint256"},{"name":"enemyRace","type":"uint256"},{"name":"level","type":"uint256"}],"name":"getBetQueueLength","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"affLevelReward","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"roundId","type":"uint256"}],"name":"getBetRoundBets","outputs":[{"name":"betIds","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_w","type":"address"},{"name":"_aff","type":"address"}],"payable":true,"stateMutability":"payable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"bettor","type":"address"},{"indexed":false,"name":"betId","type":"uint256"},{"indexed":false,"name":"index","type":"uint256"},{"indexed":false,"name":"allyRace","type":"uint256"},{"indexed":false,"name":"enemyRace","type":"uint256"},{"indexed":false,"name":"betLevel","type":"uint256"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"utmSource","type":"uint256"}],"name":"BetCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"betId","type":"uint256"},{"indexed":false,"name":"opBetId","type":"uint256"},{"indexed":false,"name":"roundId","type":"uint256"}],"name":"BetAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"betId","type":"uint256"}],"name":"BetCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"winBetId","type":"uint256"},{"indexed":false,"name":"loseBetId","type":"uint256"},{"indexed":false,"name":"reward","type":"uint256"},{"indexed":false,"name":"noWin","type":"bool"}],"name":"BetRewarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"roundId","type":"uint256"},{"indexed":false,"name":"winnerRace","type":"uint256"},{"indexed":false,"name":"loserRace","type":"uint256"},{"indexed":false,"name":"betLevel","type":"uint256"},{"indexed":false,"name":"pool","type":"uint256"},{"indexed":false,"name":"bettorCount","type":"uint256"}],"name":"BetRoundCalculated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"roundId","type":"uint256"},{"indexed":false,"name":"startAt","type":"uint256"},{"indexed":false,"name":"finishAt","type":"uint256"}],"name":"StartBetRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"roundId","type":"uint256"},{"indexed":false,"name":"raceId","type":"uint256"},{"indexed":false,"name":"result","type":"int32"}],"name":"RoundRaceResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"roundId","type":"uint256"},{"indexed":false,"name":"startCheckedAt","type":"uint256"},{"indexed":false,"name":"finishCheckedAt","type":"uint256"}],"name":"FinishBetRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"account","type":"address"}],"name":"ServiceAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"account","type":"address"}],"name":"ServiceRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"startsFrom","type":"uint256"},{"indexed":false,"name":"pastCount","type":"uint256"},{"indexed":false,"name":"newInterval","type":"uint256"},{"indexed":false,"name":"newPeriod","type":"uint256"}],"name":"SetInterval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"source","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Income","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]
Contract Creation Code
60806040818152806200416f833981018060405260408110156200002257600080fd5b50805160209091015160008054600160a060020a031916331780825560405183928592600160a060020a0316917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600160a060020a03811615156200008a57600080fd5b60018054600160a060020a031916600160a060020a0392909216919091178155604080516080810182526103848152635c6b47006020820190815260009282018381526102586060840190815260038054968701815590945291517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b600490950294850155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c840155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d830155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e90910155600580546008019062000193908262000554565b50620001b16001662386f26fc1000064010000000062000403810204565b620001ce600266b1a2bc2ec5000064010000000062000403810204565b620001ec600367016345785d8a000064010000000062000403810204565b6200020a60046706f05b59d3b2000064010000000062000403810204565b620002286005670de0b6b3a764000064010000000062000403810204565b620002466006674563918244f4000064010000000062000403810204565b620002646007678ac7230489e8000064010000000062000403810204565b6001600655600160a060020a03811615156200027f57600080fd5b60088054600160a060020a031916600160a060020a0392909216919091179055600780546001818101835560008381527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6889283015582548082018455611f409083015582549081019092556107d0910155620003043364010000000062000433810204565b6200031b6101f48064010000000062000485810204565b505060106020527f8c6065603763fec3f5742441d3833f3f43b982453612d76adb39a885e3006b5f8054600160ff1991821681179092557f853b2fefe141400fef543280f93d98bd49996069f632d0d20236afeeed8e46a280548216831790557f1588ac671d87f82adc0e6ae8ab009c0de98f92a20243897597e566bc59b9c12680548216831790557fbbe6df1631c6a5c37158096bc15825d83d22eaca9ac1e829be6dfcdebed1d2d78054821683179055600d6000527fdfb340902d3967fa50e8165d4f7a13c9cb160eea8fb21544939c9a839ac4b6c480549091169091179055620005a1565b806005838154811015156200041457fe5b6000918252602080832090910192909255918252600490526040902055565b6200044e600982640100000000620039c1620004af82021704565b604051600160a060020a038216907fc917ab672aa101ddaa2e4db6de34f67d180098d502a2ed9e199f79b4c4333a6b90600090a250565b620004986401000000006200050a810204565b1515620004a457600080fd5b601191909155601255565b600160a060020a0381161515620004c557600080fd5b620004da82826401000000006200051c810204565b15620004e557600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600054600160a060020a031633145b90565b6000600160a060020a03821615156200053457600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b8154818355818111156200057b576000838152602090206200057b91810190830162000580565b505050565b6200051991905b808211156200059d576000815560010162000587565b5090565b613bbe80620005b16000396000f3fe608060405260043610610401576000357c0100000000000000000000000000000000000000000000000000000000900480638a361c9311610225578063b51635a211610135578063deaa59df116100c8578063e9d8dbfd11610097578063e9d8dbfd14611053578063e9e0d1bf14611086578063ef0fdc84146110bc578063f2fde38b146110e6578063f72183361461111957610401565b8063deaa59df14610f90578063e027209614610fc3578063e7134f6014610ff3578063e7598bf31461102357610401565b8063c71b0e1c11610104578063c71b0e1c14610eec578063ce76fa8114610f01578063daf52d5f14610f16578063dca734db14610f6657610401565b8063b51635a214610e00578063bb80a30c14610e32578063bf14ca8414610e5c578063c1dbe51314610eb957610401565b8063955bceaf116101b8578063a063e9fb11610187578063a063e9fb14610d5f578063a4161ec414610d8e578063a5d9e6a414610da3578063ae1b0c4d14610db8578063b208322014610dcd57610401565b8063955bceaf14610ccc5780639c09156b14610cf65780639f5cfe0314610d20578063a043a05014610d3557610401565b80638ee86e5d116101f45780638ee86e5d14610b015780638f32d59b14610b4e57806390ea2a4d14610b7757806393be927914610b8c57610401565b80638a361c9314610a715780638bc38aba14610aad5780638c335f7014610ad75780638da5cb5b14610aec57610401565b8063357401f5116103205780635ad50d87116102b35780636f491112116102825780636f491112146109a3578063715018a6146109b8578063747dff42146109cd5780638088dc5e146109e257806388e19557146109f757610401565b80635ad50d87146109015780635f17e6161461091657806364235905146109465780636b79c9f61461097057610401565b806352f7c988116102ef57806352f7c988146108745780635372a9ce146108a45780635727e25d146108d75780635843026a146108ec57610401565b8063357401f5146107a757806337c4eae3146107d157806349da2bdc14610826578063521eb2731461085f57610401565b806322ca377c116103985780632eb892a3116103675780632eb892a3146106e65780632f390b1a1461071f5780632f5cda8c14610749578063320f3dc31461077757610401565b806322ca377c1461062557806325baa5791461065b5780632840e1b3146106855780632bde4dd9146106b657610401565b806317ffc320116103d457806317ffc3201461055f5780631a00efdc146105925780631b305173146105dd57806320058b741461061057610401565b8063061e494f146104185780630c48ee5c146104935780630fad27a3146104fc5780631438e7ae14610526575b6000341161040e57600080fd5b610416611143565b005b34801561042457600080fd5b506104426004803603602081101561043b57600080fd5b50356111e0565b60408051600160a060020a03909a168a5297151560208a0152888801969096526060880194909452608087019290925260a086015260c085015260e084015261010083015251908190036101200190f35b34801561049f57600080fd5b506104cf600480360360808110156104b657600080fd5b508035906020810135906040810135906060013561129e565b60408051958652602086019490945284840192909252606084015215156080830152519081900360a00190f35b34801561050857600080fd5b506104166004803603602081101561051f57600080fd5b5035611326565b34801561053257600080fd5b506104166004803603604081101561054957600080fd5b50600160a060020a03813516906020013561136f565b34801561056b57600080fd5b506104166004803603602081101561058257600080fd5b5035600160a060020a03166113b3565b34801561059e57600080fd5b506105cb600480360360408110156105b557600080fd5b50600160a060020a03813516906020013561154e565b60408051918252519081900360200190f35b3480156105e957600080fd5b506104166004803603602081101561060057600080fd5b5035600160a060020a0316611587565b34801561061c57600080fd5b506105cb6115a3565b34801561063157600080fd5b506104166004803603606081101561064857600080fd5b50803590602081013590604001356115a9565b34801561066757600080fd5b506105cb6004803603602081101561067e57600080fd5b5035611666565b34801561069157600080fd5b5061069a611685565b60408051600160a060020a039092168252519081900360200190f35b3480156106c257600080fd5b50610416600480360360408110156106d957600080fd5b5080359060200135611694565b3480156106f257600080fd5b506104166004803603604081101561070957600080fd5b50600160a060020a038135169060200135611717565b34801561072b57600080fd5b506105cb6004803603602081101561074257600080fd5b503561175b565b34801561075557600080fd5b5061075e611769565b6040805192835260208301919091528051918290030190f35b34801561078357600080fd5b506104166004803603604081101561079a57600080fd5b508035906020013561177d565b3480156107b357600080fd5b50610416600480360360208110156107ca57600080fd5b50356117be565b3480156107dd57600080fd5b50610801600480360360408110156107f457600080fd5b50803590602001356117f5565b604080519384526020840192909252600390810b900b82820152519081900360600190f35b34801561083257600080fd5b506105cb6004803603604081101561084957600080fd5b50600160a060020a03813516906020013561186a565b34801561086b57600080fd5b5061069a611896565b34801561088057600080fd5b506104166004803603604081101561089757600080fd5b50803590602001356118a5565b3480156108b057600080fd5b50610416600480360360208110156108c757600080fd5b5035600160a060020a03166118c3565b3480156108e357600080fd5b506105cb6118df565b3480156108f857600080fd5b506104166118f2565b34801561090d57600080fd5b506105cb61192e565b34801561092257600080fd5b506104166004803603604081101561093957600080fd5b5080359060200135611934565b34801561095257600080fd5b5061075e6004803603602081101561096957600080fd5b5035611aba565b34801561097c57600080fd5b50610985611ae1565b60408051938452602084019290925282820152519081900360600190f35b3480156109af57600080fd5b506105cb611afc565b3480156109c457600080fd5b50610416611b04565b3480156109d957600080fd5b50610985611b6e565b3480156109ee57600080fd5b50610416611b7e565b348015610a0357600080fd5b50610a2160048036036020811015610a1a57600080fd5b5035611c33565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610a5d578181015183820152602001610a45565b505050509050019250505060405180910390f35b348015610a7d57600080fd5b5061041660048036036080811015610a9457600080fd5b5080359060208101359060408101359060600135611c99565b348015610ab957600080fd5b5061041660048036036020811015610ad057600080fd5b5035611cc9565b348015610ae357600080fd5b506105cb611cfb565b348015610af857600080fd5b5061069a611d01565b348015610b0d57600080fd5b50610b16611d10565b604080519788526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b348015610b5a57600080fd5b50610b63611d42565b604080519115158252519081900360200190f35b348015610b8357600080fd5b506105cb611d53565b348015610b9857600080fd5b5061041660048036036080811015610baf57600080fd5b813591602081013591810190606081016040820135640100000000811115610bd657600080fd5b820183602082011115610be857600080fd5b80359060200191846020830284011164010000000083111715610c0a57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050640100000000811115610c5a57600080fd5b820183602082011115610c6c57600080fd5b80359060200191846020830284011164010000000083111715610c8e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611d59945050505050565b348015610cd857600080fd5b506105cb60048036036020811015610cef57600080fd5b5035611e82565b348015610d0257600080fd5b5061041660048036036020811015610d1957600080fd5b5035612036565b348015610d2c57600080fd5b506105cb61207e565b348015610d4157600080fd5b5061041660048036036020811015610d5857600080fd5b5035612084565b61041660048036036080811015610d7557600080fd5b50803590602081013590604081013590606001356120b6565b348015610d9a57600080fd5b506105cb612556565b348015610daf57600080fd5b5061041661255c565b348015610dc457600080fd5b50610b16612567565b348015610dd957600080fd5b506105cb60048036036020811015610df057600080fd5b5035600160a060020a0316612588565b348015610e0c57600080fd5b5061041660048036036040811015610e2357600080fd5b508035906020013515156125a3565b348015610e3e57600080fd5b5061041660048036036020811015610e5557600080fd5b50356125d6565b348015610e6857600080fd5b50610e8660048036036020811015610e7f57600080fd5b5035612644565b604080519687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b348015610ec557600080fd5b50610a2160048036036020811015610edc57600080fd5b5035600160a060020a0316612774565b348015610ef857600080fd5b506105cb61285d565b348015610f0d57600080fd5b506105cb612863565b348015610f2257600080fd5b50610f4060048036036020811015610f3957600080fd5b5035612870565b604080519485526020850193909352838301919091526060830152519081900360800190f35b348015610f7257600080fd5b50610b6360048036036020811015610f8957600080fd5b50356128a8565b348015610f9c57600080fd5b5061041660048036036020811015610fb357600080fd5b5035600160a060020a03166128bd565b348015610fcf57600080fd5b5061098560048036036040811015610fe657600080fd5b5080359060200135612914565b348015610fff57600080fd5b506105cb6004803603604081101561101657600080fd5b5080359060200135612985565b34801561102f57600080fd5b506105cb6004803603604081101561104657600080fd5b5080359060200135612a27565b34801561105f57600080fd5b50610b636004803603602081101561107657600080fd5b5035600160a060020a0316612a57565b34801561109257600080fd5b506105cb600480360360608110156110a957600080fd5b5080359060208101359060400135612a6a565b3480156110c857600080fd5b506105cb600480360360208110156110df57600080fd5b5035612a9f565b3480156110f257600080fd5b506104166004803603602081101561110957600080fd5b5035600160a060020a0316612aad565b34801561112557600080fd5b50610a216004803603602081101561113c57600080fd5b5035612ac9565b60025460009061115b9030319063ffffffff612b2c16565b905060008111156111dd57600154604051600160a060020a039091169082156108fc029083906000818181858888f193505050501580156111a0573d6000803e3d6000fd5b50604080513081526020810183905281517f0d2e009b696be50eaeafa43283c2e91362ec7d038b2af93783ec767d536ad278929181900390910190a15b50565b60008060008060008060008060006111f6613a3a565b50505060009788525050600d60209081526040968790208751610120810189528154600160a060020a0316808252600183015493820184905260028301549982018a9052600383015460608301819052600484015460808401819052600585015460a08501819052600686015460c08601819052600787015460e0870181905260089097015460ff161515610100909601869052939d949c969b509599509097509550929350565b60008060008060006112ae613a92565b50505060009384525050600f602090815260408084209584529481528483209383529283525082812093815292815291819020815160a08101835281548082526001830154948201859052600283015493820184905260038301546060830181905260049093015460ff161515608090920182905294565b60068054600101908190556000828152600d6020526040902054600160a060020a0316331461135457600080fd5b61135d82612b41565b600654811461136b57600080fd5b5050565b61137833612a57565b151561138357600080fd5b600160a060020a0382166000908152600e6020908152604080832084845260010190915290205461136b90612e9e565b6113bb611d42565b15156113c657600080fd5b60006113d0611d01565b9050600160a060020a038216151561141f57604051600160a060020a03821690303180156108fc02916000818181858888f19350505050158015611418573d6000803e3d6000fd5b50506111dd565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600091600160a060020a038516916370a0823191602480820192602092909190829003018186803b15801561148257600080fd5b505afa158015611496573d6000803e3d6000fd5b505050506040513d60208110156114ac57600080fd5b5051604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301526024820184905291519293509085169163a9059cbb916044808201926020929091908290030181600087803b15801561151d57600080fd5b505af1158015611531573d6000803e3d6000fd5b505050506040513d602081101561154757600080fd5b5050505050565b600160a060020a0382166000908152600e6020908152604080832084845260010190915281205461157e90611e82565b90505b92915050565b61158f611d42565b151561159a57600080fd5b6111dd81612ff7565b60115481565b6115b233612a57565b15156115bd57600080fd5b6000838152600b602052604090208054158015906115dd57506001810154155b15156115e857600080fd5b60006115f982600001546000612914565b925050504281111561160a57600080fd5b600182018190556002820184905560038201839055604080518681526020810186905280820185905290517f160329fd30eb9c0fe0793afc7dd01530cf0790f1b81768ce8849dd767c20c2979181900360600190a15050505050565b600a80548290811061167457fe5b600091825260209091200154905081565b600854600160a060020a031681565b61169c611d42565b15156116a757600080fd5b60055482106116b557600080fd5b806005838154811015156116c557fe5b9060005260206000200154141515156116dd57600080fd5b600460006005848154811015156116f057fe5b906000526020600020015481526020019081526020016000206000905561136b828261303f565b61172033612a57565b151561172b57600080fd5b600160a060020a0382166000908152600e6020908152604080832084845260010190915290205461136b90612b41565b600580548290811061167457fe5b60008061177542611aba565b915091509091565b611785611d42565b151561179057600080fd5b600754821061179e57600080fd5b806007838154811015156117ae57fe5b6000918252602090912001555050565b60068054600101908190556000828152600d6020526040902054600160a060020a031633146117ec57600080fd5b61135d82612e9e565b6000806000611802613ac4565b5050506000838152600b6020908152604080832085845260050182529182902082516080810184528154808252600183015460ff161515938201939093526002820154938101849052600391820154820b820b90910b60609091018190529092509250925092565b600160a060020a03919091166000908152600e6020908152604080832093835260019093019052205490565b600154600160a060020a031681565b6118ad611d42565b15156118b857600080fd5b601191909155601255565b6118cb611d42565b15156118d657600080fd5b6111dd8161306e565b60006118ec426000612985565b90505b90565b6118fa611d42565b151561190557600080fd5b60078054611917826000198301613aeb565b8154811061192157fe5b6000918252602082200155565b600c5481565b61193c611d42565b151561194757600080fd5b61194f613b14565b611958426130b6565b9050600081600001518260200151420381151561197157fe5b04600101905061197f613b14565b506040805160808082018352868252845160208087015191860290910181840190815286850151860184860190815260608086018a81526003805460018101825560009190915287517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b60049092029182015593517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c850181905592517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d850181905590517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e90940193909355865191825292810191909152808501899052908101879052925191927f0ecae1e0866c11d699d188ac0494a0188520aceda6bdc4d6ed7713f9c77993ee929081900390910190a15050505050565b600080611ac5613b14565b611ace846130b6565b8051606090910151909590945092505050565b6000806000611af1426001612914565b925092509250909192565b635c6b470081565b611b0c611d42565b1515611b1757600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b6000806000611af1426000612914565b6006805460010190819055600854604080517f764018650000000000000000000000000000000000000000000000000000000081526000600482018190523360248301529151600160a060020a0390931692637640186592604480840193602093929083900390910190829087803b158015611bf957600080fd5b505af1158015611c0d573d6000803e3d6000fd5b505050506040513d6020811015611c2357600080fd5b505060065481146111dd57600080fd5b6000818152600b6020908152604091829020600601805483518184028101840190945280845260609392830182828015611c8c57602002820191906000526020600020905b815481526020019060010190808311611c78575b505050505090505b919050565b611ca233612a57565b1515611cad57600080fd5b611cb98484848461311c565b5050611cc3611143565b50505050565b60068054600190810191829055336000908152600e602090815260408083208684529093019052205461135d90612e9e565b60075490565b600054600160a060020a031690565b6000806000806000806000611d236118df565b9650611d2e87612644565b9b9c949b939a509198509650945092509050565b600054600160a060020a0316331490565b60125481565b611d6233612a57565b1515611d6d57600080fd5b8051825114611d7b57600080fd5b8151600802831115611d8c57600080fd5b6000848152600b60205260409020805415801590611dac57506001810154155b1515611db757600080fd5b600080805b86811015611e7857611dec866008835b04815181101515611dd957fe5b602090810290910101516008830661331f565b9250611dfa85600883611dcc565b60008481526005860160209081526040918290206003908101805485830b63ffffffff811663ffffffff199092169190911790915583518d8152928301889052900b8183015290519193507f4f82b9e87a4d4b6463370358865e30ab9562f882adf8eefb5a5c1ceb8f624e65919081900360600190a1600101611dbc565b5050505050505050565b6000818152600d60205260408120600881015460ff161515611ea8576000915050611c94565b60018101546000908152600b60209081526040808320600285015484526005019091528082206003908101548185015484529190922082015490820b9190810b9081810b9083900b1215611f025760009350505050611c94565b600483015460058401546000908152600f6020908152604080832060028801548085528184528285206003808b015487529085528386209285528386209186529352922092965090919083810b9085900b131561202c57600185015460009081526020829052604090206004015460ff161515611fec576001850154600090815260208290526040812054601254601154611f9e929101613330565b60018701546000908152602084815260408083205491879052909120600301549190039150611fe49082811515611fd157fe5b600489015491900463ffffffff61335616565b96505061202c565b60018086015460009081526020849052604090206003810154910154612029919081151561201657fe5b600488015491900463ffffffff61335616565b95505b5050505050919050565b61203e611d42565b151561204957600080fd5b600780546001810182556000919091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880155565b600a5490565b60068054600190810191829055336000908152600e602090815260408083208684529093019052205461135d90612b41565b8284141580156120d4575060008481526010602052604090205460ff165b80156120ee575060008381526010602052604090205460ff165b15156120f957600080fd5b600061210434613368565b600c805460019081018083556000908152600d6020908152604080832060088101805460ff191686179055805473ffffffffffffffffffffffffffffffffffffffff19163317808255600282018d9055600382018c90553460048301819055600583018990558754600160a060020a039283168752600e80875285882080548a018082558952909801865284872055825497549790911680865295845293829020548251968752928601929092528481018b9052606085018a90526080850186905260a085019290925260c0840187905290519394509290917f632b2af1dffd9343432fd45196947d1d63824451dac49e2fd0753aee4dd71df4919081900360e00190a26000828152600f6020908152604080832089845280835281842089855283528184209083528184208a855290925290912061224560018201613383565b151561226757600c5461226290600184019063ffffffff61338716565b6124bb565b6000612271613430565b90506000612281836001016134e4565b60068087018290556001808801859055600c546000848152600d6020908152604080832095860193909355939092018690558582529187905220549091506122cf903463ffffffff61335616565b600083815260208681526040808320938455600390930180546001019055838252600d81528282206004015485835290869052919020546123159163ffffffff61335616565b600083815260208581526040808320938455600390930180546001908101909155600b82528383208e8452600501909152919020015460ff16151561239e576000828152600b602081815260408084208e85526005810183529084206001818101805460ff19168217905560069092018054918290559383529081018355918352909120018a90555b6000828152600b602090815260408083208d8452600501909152808220600201805460019081019091558b83529120015460ff161515612422576000828152600b602081815260408084208d85526005810183529084206001818101805460ff19168217905560069092018054918290559383529081018355918352909120018990555b6000828152600b602081815260408084208d85526005810183528185206002018054600190810190915593835260040180548085018255818652838620908101879055600c8054835496870184559290965293909301929092559154815184815292830152818101849052517ff5b904f60b482287e29148f44263d7d34d78e3f71a9f9faca68fc39e409d3c249181900360600190a150505b6124c4346134f3565b6008548354604080517f8171e885000000000000000000000000000000000000000000000000000000008152600160a060020a039283166004820152602481018a905290519190921691638171e88591604480830192600092919082900301818387803b15801561253457600080fd5b505af1158015612548573d6000803e3d6000fd5b505050505050505050505050565b60055490565b61256533612ff7565b565b600080600080600080600061257a6118df565b6001019650611d2e87612644565b600160a060020a03166000908152600e602052604090205490565b6125ab611d42565b15156125b657600080fd5b600091825260106020526040909120805460ff1916911515919091179055565b6125de611d42565b15156125e957600080fd5b6005541580612615575060058054829190600019810190811061260857fe5b9060005260206000200154105b151561262057600080fd5b60058054906126329060018301613aeb565b506005546111dd90600019018261303f565b600080600080600080612655613b3d565b6000888152600b6020908152604091829020825160c081018452815481526001820154818401526002820154818501526003820154606082015260048201805485518186028101860190965280865291949293608086019392908301828280156126de57602002820191906000526020600020905b8154815260200190600101908083116126ca575b505050505081526020016006820180548060200260200160405190810160405280929190818152602001828054801561273657602002820191906000526020600020905b815481526020019060010190808311612722575b505050919092525050815160208301516040840151606085015160808601515160a09096015151939e929d50909b5099509297509550909350505050565b600160a060020a0381166000908152600e6020526040812060609160015b825481116127bf576000818152600184016020526040902054156127b7576001909101905b600101612792565b50600081111561285657806040519080825280602002602001820160405280156127f3578160200160208202803883390190505b5092506000905060015b825481116128545760008181526001840160205260409020541561284c57600081815260018085016020526040909120548551918401939091869190811061284157fe5b602090810290910101525b6001016127fd565b505b5050919050565b60025481565b60006118ec426001612985565b600380548290811061287e57fe5b60009182526020909120600490910201805460018201546002830154600390930154919350919084565b60106020526000908152604090205460ff1681565b6128c5611d42565b15156128d057600080fd5b600160a060020a03811615156128e557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000806000612921613b14565b61292a866130b6565b9050600081602001518711612940576000612959565b8582600001518360200151890381151561295657fe5b04015b905080826000015102826020015101935080826040015101945083826060015101925050509250925092565b6000806129918461350c565b905061299b613b14565b60038054839081106129a957fe5b9060005260206000209060040201608060405190810160405290816000820154815260200160018201548152602001600282015481526020016003820154815250509050806020015185116129ff576000612a1e565b838160400151826000015183602001518803811515612a1a57fe5b0401015b95945050505050565b6000828152600b60205260408120600401805483908110612a4457fe5b9060005260206000200154905092915050565b600061158160098363ffffffff6135e816565b6000818152600f6020908152604080832086845282528083208584529091528120612a9790600101613383565b949350505050565b600780548290811061167457fe5b612ab5611d42565b1515612ac057600080fd5b6111dd8161361f565b6000818152600b6020908152604091829020600401805483518184028101840190945280845260609392830182828015611c8c5760200282019190600052602060002090815481526020019060010190808311611c785750505050509050919050565b600082821115612b3b57600080fd5b50900390565b6000818152600d60205260409020600881015460ff161515612b6257600080fd5b60018101541515612b7257600080fd5b600080612b91836005015484600201548560030154866001015461311c565b60088501805460ff191690559092509050600381810b9083900b12612e965760048301546007840155600381810b9083900b1315612df057612bd1613a92565b5060058301546000908152600f60209081526040808320600280880154855290835281842060038089015486529084528285206001808a0154875290855294839020835160a08101855281548152958101549486018590529182015492850192909252908101546060840181905260049091015460ff1615156080840152612c6f91811515612c5c57fe5b600787015491900463ffffffff61335616565b60078501556060810151604082015160009190811515612c8b57fe5b049050612c978161369c565b6008548554604080517f40bc11fe000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201529051612d3993600286049316916340bc11fe916024808301926020929190829003018186803b158015612d0557600080fd5b505afa158015612d19573d6000803e3d6000fd5b505050506040513d6020811015612d2f57600080fd5b50516000806136af565b60085460068601546000908152600d60209081526040918290205482517f40bc11fe000000000000000000000000000000000000000000000000000000008152600160a060020a0391821660048201529251612ded9460028704949216926340bc11fe9260248082019391829003018186803b158015612db857600080fd5b505afa158015612dcc573d6000803e3d6000fd5b505050506040513d6020811015612de257600080fd5b5051600060016136af565b50505b82546007840154604051600160a060020a039092169181156108fc0291906000818181858888f19350505050158015612e2d573d6000803e3d6000fd5b50612e3b836007015461369c565b6006830154600784015460408051878152602081019390935282810191909152600384810b9084900b146060830152517fd2bda33d3af825f827a7f0a385136fae0489a5df5b623a44709788d10f5b54449181900360800190a15b611cc3611143565b6000818152600d60205260409020600881015460ff161515612ebf57600080fd5b600181015415612ece57600080fd5b60058101546000908152600f60209081526040808320600285015484528252808320600385015484529091529020612f0f600182018463ffffffff61386116565b612f1c826004015461369c565b81546004830154604051600160a060020a039092169181156108fc0291906000818181858888f19350505050158015612f59573d6000803e3d6000fd5b506040805184815290517f0251581e1b59903a31a6bd345b77ac977d80257865ab48261eed09027158d5619181900360200190a150506000908152600d60205260408120805473ffffffffffffffffffffffffffffffffffffffff191681556001810182905560028101829055600381018290556004810182905560058101829055600681018290556007810191909155600801805460ff19169055565b61300860098263ffffffff61397516565b604051600160a060020a038216907f29d546abb6e94f4f04d5bdccb6682316f597d43776078f47e273f000e77b2a9190600090a250565b8060058381548110151561304f57fe5b6000918252602080832090910192909255918252600490526040902055565b61307f60098263ffffffff6139c116565b604051600160a060020a038216907fc917ab672aa101ddaa2e4db6de34f67d180098d502a2ed9e199f79b4c4333a6b90600090a250565b6130be613b14565b60036130c98361350c565b815481106130d357fe5b9060005260206000209060040201608060405190810160405290816000820154815260200160018201548152602001600282015481526020016003820154815250509050919050565b6000818152600b602052604081205481901580159061314b57506000838152600b602052604090206001015415155b151561315657600080fd5b50506000818152600b602090815260408083208684526005019091528082206003908101548584529190922082015490820b9190810b9081810b9083900b121561319e579293925b6000868152600f60209081526040808320888452808352818420888552835281842090835281842089855283528184208785529283905292206004015460ff1615156132dc576000858152602082905260409020600401805460ff19166001179055600384810b9084900b146132dc5760008581526020829052604081205460115461322a9190613330565b90506132358161369c565b6000868152602083905260409020546012546132519190613330565b600087815260208581526040808320600281018590558683529281902054878352859003939093036001830181905560039092015483518a81529182018c90528184018b9052606082018d9052608082019290925260a081019190915290517f32f13e435dad46cfaa685bc90cf7d626b4431cd1470f7a35de0cfdb868b7acca9181900360c00190a1505b60008581526020839052604090206004015460ff161515613314576000858152602083905260409020600401805460ff191660011790555b505094509492505050565b60200260020a900463ffffffff1690565b6000612710613345848463ffffffff613a0f16565b81151561334e57fe5b049392505050565b60008282018381101561157e57600080fd5b600081815260046020526040902054801515611c9457600080fd5b5490565b600081815260048301602052604090205460ff16156133a557600080fd5b6040805160608101825260018082526002858101546020808501918252600085870181815288825260048a01909252959095209351845460ff191690151517845551918301919091559151910155815415156134075760018201819055613422565b60028083015460009081526004840160205260409020018190555b600282015580546001019055565b600080600061343d611ae1565b6000838152600b6020526040902054929550909350915015156134df576000838152600b60209081526040808320859055600a805460018101825593527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8909201859055815185815290810184905280820183905290517f23829bf2d5715c80876e9c093c08f42de6205b86ac6f0e156301de77611f65449181900360600190a15b505090565b6001810154611c948282613861565b600254613506908263ffffffff61335616565b60025550565b600354600090811061351d57600080fd5b60038054600019810190811061352f57fe5b90600052602060002090600402016001015482101515613556575060035460001901611c94565b60038054600090811061356557fe5b90600052602060002090600402016001015482101561358657506000611c94565b600354600090600019015b818111156135e15760038054600284840160010104918691839081106135b357fe5b9060005260206000209060040201600101541115156135d4578092506135db565b6001810391505b50613591565b5092915050565b6000600160a060020a03821615156135ff57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b600160a060020a038116151561363457600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600254613506908263ffffffff612b2c16565b600854604080517fd7e0515a000000000000000000000000000000000000000000000000000000008152600481018690529051600092600160a060020a03169163d7e0515a916024808301926020929190829003018186803b15801561371457600080fd5b505afa158015613728573d6000803e3d6000fd5b505050506040513d602081101561373e57600080fd5b5051600780549192506000918590811061375457fe5b906000526020600020015411801561376b57508315155b801561378857506000831180613788575081801561378857508015155b156138445760006137b2866007868154811015156137a257fe5b9060005260206000200154613330565b600854604080517f627911d0000000000000000000000000000000000000000000000000000000008152600060048201819052602482018a9052604482018590529151939450600160a060020a039092169263627911d0928592606480830193919282900301818588803b15801561382957600080fd5b505af115801561383d573d6000803e3d6000fd5b5050505050505b6007546001909301928310156115475761154785828560006136af565b815460001061386f57600080fd5b600081815260048301602052604090205460ff16151561388e57600080fd5b6000818152600483016020526040902060010154156138d157600081815260048301602052604080822060028082015460019092015484529190922001556138eb565b600081815260048301602052604090206002015460018301555b60008181526004830160205260409020600201541561392e5760008181526004830160205260408082206001808201546002909201548452919092200155613948565b600081815260048301602052604090206001015460028301555b60009081526004820160205260408120805460ff1916815560018101829055600201558054600019019055565b600160a060020a038116151561398a57600080fd5b61399482826135e8565b151561399f57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19169055565b600160a060020a03811615156139d657600080fd5b6139e082826135e8565b156139ea57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000821515613a2057506000611581565b828202828482811515613a2f57fe5b041461157e57600080fd5b610120604051908101604052806000600160a060020a03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581525090565b60a060405190810160405280600081526020016000815260200160008152602001600081526020016000151581525090565b60408051608081018252600080825260208201819052918101829052606081019190915290565b815481835581811115613b0f57600083815260209020613b0f918101908301613b74565b505050565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b60c0604051908101604052806000815260200160008152602001600081526020016000815260200160608152602001606081525090565b6118ef91905b80821115613b8e5760008155600101613b7a565b509056fea165627a7a723058202f30fb5acec93f19ead9e14fb0ba51e1e95e253ef66010d823220a781fb185f00029000000000000000000000000edbbdf2c29ccf6a0272b36b10eadc1b17b8d7e67000000000000000000000000e544e5250648882601f9c27674dec6b4924163c2
Deployed Bytecode
0x608060405260043610610401576000357c0100000000000000000000000000000000000000000000000000000000900480638a361c9311610225578063b51635a211610135578063deaa59df116100c8578063e9d8dbfd11610097578063e9d8dbfd14611053578063e9e0d1bf14611086578063ef0fdc84146110bc578063f2fde38b146110e6578063f72183361461111957610401565b8063deaa59df14610f90578063e027209614610fc3578063e7134f6014610ff3578063e7598bf31461102357610401565b8063c71b0e1c11610104578063c71b0e1c14610eec578063ce76fa8114610f01578063daf52d5f14610f16578063dca734db14610f6657610401565b8063b51635a214610e00578063bb80a30c14610e32578063bf14ca8414610e5c578063c1dbe51314610eb957610401565b8063955bceaf116101b8578063a063e9fb11610187578063a063e9fb14610d5f578063a4161ec414610d8e578063a5d9e6a414610da3578063ae1b0c4d14610db8578063b208322014610dcd57610401565b8063955bceaf14610ccc5780639c09156b14610cf65780639f5cfe0314610d20578063a043a05014610d3557610401565b80638ee86e5d116101f45780638ee86e5d14610b015780638f32d59b14610b4e57806390ea2a4d14610b7757806393be927914610b8c57610401565b80638a361c9314610a715780638bc38aba14610aad5780638c335f7014610ad75780638da5cb5b14610aec57610401565b8063357401f5116103205780635ad50d87116102b35780636f491112116102825780636f491112146109a3578063715018a6146109b8578063747dff42146109cd5780638088dc5e146109e257806388e19557146109f757610401565b80635ad50d87146109015780635f17e6161461091657806364235905146109465780636b79c9f61461097057610401565b806352f7c988116102ef57806352f7c988146108745780635372a9ce146108a45780635727e25d146108d75780635843026a146108ec57610401565b8063357401f5146107a757806337c4eae3146107d157806349da2bdc14610826578063521eb2731461085f57610401565b806322ca377c116103985780632eb892a3116103675780632eb892a3146106e65780632f390b1a1461071f5780632f5cda8c14610749578063320f3dc31461077757610401565b806322ca377c1461062557806325baa5791461065b5780632840e1b3146106855780632bde4dd9146106b657610401565b806317ffc320116103d457806317ffc3201461055f5780631a00efdc146105925780631b305173146105dd57806320058b741461061057610401565b8063061e494f146104185780630c48ee5c146104935780630fad27a3146104fc5780631438e7ae14610526575b6000341161040e57600080fd5b610416611143565b005b34801561042457600080fd5b506104426004803603602081101561043b57600080fd5b50356111e0565b60408051600160a060020a03909a168a5297151560208a0152888801969096526060880194909452608087019290925260a086015260c085015260e084015261010083015251908190036101200190f35b34801561049f57600080fd5b506104cf600480360360808110156104b657600080fd5b508035906020810135906040810135906060013561129e565b60408051958652602086019490945284840192909252606084015215156080830152519081900360a00190f35b34801561050857600080fd5b506104166004803603602081101561051f57600080fd5b5035611326565b34801561053257600080fd5b506104166004803603604081101561054957600080fd5b50600160a060020a03813516906020013561136f565b34801561056b57600080fd5b506104166004803603602081101561058257600080fd5b5035600160a060020a03166113b3565b34801561059e57600080fd5b506105cb600480360360408110156105b557600080fd5b50600160a060020a03813516906020013561154e565b60408051918252519081900360200190f35b3480156105e957600080fd5b506104166004803603602081101561060057600080fd5b5035600160a060020a0316611587565b34801561061c57600080fd5b506105cb6115a3565b34801561063157600080fd5b506104166004803603606081101561064857600080fd5b50803590602081013590604001356115a9565b34801561066757600080fd5b506105cb6004803603602081101561067e57600080fd5b5035611666565b34801561069157600080fd5b5061069a611685565b60408051600160a060020a039092168252519081900360200190f35b3480156106c257600080fd5b50610416600480360360408110156106d957600080fd5b5080359060200135611694565b3480156106f257600080fd5b506104166004803603604081101561070957600080fd5b50600160a060020a038135169060200135611717565b34801561072b57600080fd5b506105cb6004803603602081101561074257600080fd5b503561175b565b34801561075557600080fd5b5061075e611769565b6040805192835260208301919091528051918290030190f35b34801561078357600080fd5b506104166004803603604081101561079a57600080fd5b508035906020013561177d565b3480156107b357600080fd5b50610416600480360360208110156107ca57600080fd5b50356117be565b3480156107dd57600080fd5b50610801600480360360408110156107f457600080fd5b50803590602001356117f5565b604080519384526020840192909252600390810b900b82820152519081900360600190f35b34801561083257600080fd5b506105cb6004803603604081101561084957600080fd5b50600160a060020a03813516906020013561186a565b34801561086b57600080fd5b5061069a611896565b34801561088057600080fd5b506104166004803603604081101561089757600080fd5b50803590602001356118a5565b3480156108b057600080fd5b50610416600480360360208110156108c757600080fd5b5035600160a060020a03166118c3565b3480156108e357600080fd5b506105cb6118df565b3480156108f857600080fd5b506104166118f2565b34801561090d57600080fd5b506105cb61192e565b34801561092257600080fd5b506104166004803603604081101561093957600080fd5b5080359060200135611934565b34801561095257600080fd5b5061075e6004803603602081101561096957600080fd5b5035611aba565b34801561097c57600080fd5b50610985611ae1565b60408051938452602084019290925282820152519081900360600190f35b3480156109af57600080fd5b506105cb611afc565b3480156109c457600080fd5b50610416611b04565b3480156109d957600080fd5b50610985611b6e565b3480156109ee57600080fd5b50610416611b7e565b348015610a0357600080fd5b50610a2160048036036020811015610a1a57600080fd5b5035611c33565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610a5d578181015183820152602001610a45565b505050509050019250505060405180910390f35b348015610a7d57600080fd5b5061041660048036036080811015610a9457600080fd5b5080359060208101359060408101359060600135611c99565b348015610ab957600080fd5b5061041660048036036020811015610ad057600080fd5b5035611cc9565b348015610ae357600080fd5b506105cb611cfb565b348015610af857600080fd5b5061069a611d01565b348015610b0d57600080fd5b50610b16611d10565b604080519788526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b348015610b5a57600080fd5b50610b63611d42565b604080519115158252519081900360200190f35b348015610b8357600080fd5b506105cb611d53565b348015610b9857600080fd5b5061041660048036036080811015610baf57600080fd5b813591602081013591810190606081016040820135640100000000811115610bd657600080fd5b820183602082011115610be857600080fd5b80359060200191846020830284011164010000000083111715610c0a57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050640100000000811115610c5a57600080fd5b820183602082011115610c6c57600080fd5b80359060200191846020830284011164010000000083111715610c8e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611d59945050505050565b348015610cd857600080fd5b506105cb60048036036020811015610cef57600080fd5b5035611e82565b348015610d0257600080fd5b5061041660048036036020811015610d1957600080fd5b5035612036565b348015610d2c57600080fd5b506105cb61207e565b348015610d4157600080fd5b5061041660048036036020811015610d5857600080fd5b5035612084565b61041660048036036080811015610d7557600080fd5b50803590602081013590604081013590606001356120b6565b348015610d9a57600080fd5b506105cb612556565b348015610daf57600080fd5b5061041661255c565b348015610dc457600080fd5b50610b16612567565b348015610dd957600080fd5b506105cb60048036036020811015610df057600080fd5b5035600160a060020a0316612588565b348015610e0c57600080fd5b5061041660048036036040811015610e2357600080fd5b508035906020013515156125a3565b348015610e3e57600080fd5b5061041660048036036020811015610e5557600080fd5b50356125d6565b348015610e6857600080fd5b50610e8660048036036020811015610e7f57600080fd5b5035612644565b604080519687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b348015610ec557600080fd5b50610a2160048036036020811015610edc57600080fd5b5035600160a060020a0316612774565b348015610ef857600080fd5b506105cb61285d565b348015610f0d57600080fd5b506105cb612863565b348015610f2257600080fd5b50610f4060048036036020811015610f3957600080fd5b5035612870565b604080519485526020850193909352838301919091526060830152519081900360800190f35b348015610f7257600080fd5b50610b6360048036036020811015610f8957600080fd5b50356128a8565b348015610f9c57600080fd5b5061041660048036036020811015610fb357600080fd5b5035600160a060020a03166128bd565b348015610fcf57600080fd5b5061098560048036036040811015610fe657600080fd5b5080359060200135612914565b348015610fff57600080fd5b506105cb6004803603604081101561101657600080fd5b5080359060200135612985565b34801561102f57600080fd5b506105cb6004803603604081101561104657600080fd5b5080359060200135612a27565b34801561105f57600080fd5b50610b636004803603602081101561107657600080fd5b5035600160a060020a0316612a57565b34801561109257600080fd5b506105cb600480360360608110156110a957600080fd5b5080359060208101359060400135612a6a565b3480156110c857600080fd5b506105cb600480360360208110156110df57600080fd5b5035612a9f565b3480156110f257600080fd5b506104166004803603602081101561110957600080fd5b5035600160a060020a0316612aad565b34801561112557600080fd5b50610a216004803603602081101561113c57600080fd5b5035612ac9565b60025460009061115b9030319063ffffffff612b2c16565b905060008111156111dd57600154604051600160a060020a039091169082156108fc029083906000818181858888f193505050501580156111a0573d6000803e3d6000fd5b50604080513081526020810183905281517f0d2e009b696be50eaeafa43283c2e91362ec7d038b2af93783ec767d536ad278929181900390910190a15b50565b60008060008060008060008060006111f6613a3a565b50505060009788525050600d60209081526040968790208751610120810189528154600160a060020a0316808252600183015493820184905260028301549982018a9052600383015460608301819052600484015460808401819052600585015460a08501819052600686015460c08601819052600787015460e0870181905260089097015460ff161515610100909601869052939d949c969b509599509097509550929350565b60008060008060006112ae613a92565b50505060009384525050600f602090815260408084209584529481528483209383529283525082812093815292815291819020815160a08101835281548082526001830154948201859052600283015493820184905260038301546060830181905260049093015460ff161515608090920182905294565b60068054600101908190556000828152600d6020526040902054600160a060020a0316331461135457600080fd5b61135d82612b41565b600654811461136b57600080fd5b5050565b61137833612a57565b151561138357600080fd5b600160a060020a0382166000908152600e6020908152604080832084845260010190915290205461136b90612e9e565b6113bb611d42565b15156113c657600080fd5b60006113d0611d01565b9050600160a060020a038216151561141f57604051600160a060020a03821690303180156108fc02916000818181858888f19350505050158015611418573d6000803e3d6000fd5b50506111dd565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600091600160a060020a038516916370a0823191602480820192602092909190829003018186803b15801561148257600080fd5b505afa158015611496573d6000803e3d6000fd5b505050506040513d60208110156114ac57600080fd5b5051604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301526024820184905291519293509085169163a9059cbb916044808201926020929091908290030181600087803b15801561151d57600080fd5b505af1158015611531573d6000803e3d6000fd5b505050506040513d602081101561154757600080fd5b5050505050565b600160a060020a0382166000908152600e6020908152604080832084845260010190915281205461157e90611e82565b90505b92915050565b61158f611d42565b151561159a57600080fd5b6111dd81612ff7565b60115481565b6115b233612a57565b15156115bd57600080fd5b6000838152600b602052604090208054158015906115dd57506001810154155b15156115e857600080fd5b60006115f982600001546000612914565b925050504281111561160a57600080fd5b600182018190556002820184905560038201839055604080518681526020810186905280820185905290517f160329fd30eb9c0fe0793afc7dd01530cf0790f1b81768ce8849dd767c20c2979181900360600190a15050505050565b600a80548290811061167457fe5b600091825260209091200154905081565b600854600160a060020a031681565b61169c611d42565b15156116a757600080fd5b60055482106116b557600080fd5b806005838154811015156116c557fe5b9060005260206000200154141515156116dd57600080fd5b600460006005848154811015156116f057fe5b906000526020600020015481526020019081526020016000206000905561136b828261303f565b61172033612a57565b151561172b57600080fd5b600160a060020a0382166000908152600e6020908152604080832084845260010190915290205461136b90612b41565b600580548290811061167457fe5b60008061177542611aba565b915091509091565b611785611d42565b151561179057600080fd5b600754821061179e57600080fd5b806007838154811015156117ae57fe5b6000918252602090912001555050565b60068054600101908190556000828152600d6020526040902054600160a060020a031633146117ec57600080fd5b61135d82612e9e565b6000806000611802613ac4565b5050506000838152600b6020908152604080832085845260050182529182902082516080810184528154808252600183015460ff161515938201939093526002820154938101849052600391820154820b820b90910b60609091018190529092509250925092565b600160a060020a03919091166000908152600e6020908152604080832093835260019093019052205490565b600154600160a060020a031681565b6118ad611d42565b15156118b857600080fd5b601191909155601255565b6118cb611d42565b15156118d657600080fd5b6111dd8161306e565b60006118ec426000612985565b90505b90565b6118fa611d42565b151561190557600080fd5b60078054611917826000198301613aeb565b8154811061192157fe5b6000918252602082200155565b600c5481565b61193c611d42565b151561194757600080fd5b61194f613b14565b611958426130b6565b9050600081600001518260200151420381151561197157fe5b04600101905061197f613b14565b506040805160808082018352868252845160208087015191860290910181840190815286850151860184860190815260608086018a81526003805460018101825560009190915287517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b60049092029182015593517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c850181905592517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d850181905590517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e90940193909355865191825292810191909152808501899052908101879052925191927f0ecae1e0866c11d699d188ac0494a0188520aceda6bdc4d6ed7713f9c77993ee929081900390910190a15050505050565b600080611ac5613b14565b611ace846130b6565b8051606090910151909590945092505050565b6000806000611af1426001612914565b925092509250909192565b635c6b470081565b611b0c611d42565b1515611b1757600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b6000806000611af1426000612914565b6006805460010190819055600854604080517f764018650000000000000000000000000000000000000000000000000000000081526000600482018190523360248301529151600160a060020a0390931692637640186592604480840193602093929083900390910190829087803b158015611bf957600080fd5b505af1158015611c0d573d6000803e3d6000fd5b505050506040513d6020811015611c2357600080fd5b505060065481146111dd57600080fd5b6000818152600b6020908152604091829020600601805483518184028101840190945280845260609392830182828015611c8c57602002820191906000526020600020905b815481526020019060010190808311611c78575b505050505090505b919050565b611ca233612a57565b1515611cad57600080fd5b611cb98484848461311c565b5050611cc3611143565b50505050565b60068054600190810191829055336000908152600e602090815260408083208684529093019052205461135d90612e9e565b60075490565b600054600160a060020a031690565b6000806000806000806000611d236118df565b9650611d2e87612644565b9b9c949b939a509198509650945092509050565b600054600160a060020a0316331490565b60125481565b611d6233612a57565b1515611d6d57600080fd5b8051825114611d7b57600080fd5b8151600802831115611d8c57600080fd5b6000848152600b60205260409020805415801590611dac57506001810154155b1515611db757600080fd5b600080805b86811015611e7857611dec866008835b04815181101515611dd957fe5b602090810290910101516008830661331f565b9250611dfa85600883611dcc565b60008481526005860160209081526040918290206003908101805485830b63ffffffff811663ffffffff199092169190911790915583518d8152928301889052900b8183015290519193507f4f82b9e87a4d4b6463370358865e30ab9562f882adf8eefb5a5c1ceb8f624e65919081900360600190a1600101611dbc565b5050505050505050565b6000818152600d60205260408120600881015460ff161515611ea8576000915050611c94565b60018101546000908152600b60209081526040808320600285015484526005019091528082206003908101548185015484529190922082015490820b9190810b9081810b9083900b1215611f025760009350505050611c94565b600483015460058401546000908152600f6020908152604080832060028801548085528184528285206003808b015487529085528386209285528386209186529352922092965090919083810b9085900b131561202c57600185015460009081526020829052604090206004015460ff161515611fec576001850154600090815260208290526040812054601254601154611f9e929101613330565b60018701546000908152602084815260408083205491879052909120600301549190039150611fe49082811515611fd157fe5b600489015491900463ffffffff61335616565b96505061202c565b60018086015460009081526020849052604090206003810154910154612029919081151561201657fe5b600488015491900463ffffffff61335616565b95505b5050505050919050565b61203e611d42565b151561204957600080fd5b600780546001810182556000919091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880155565b600a5490565b60068054600190810191829055336000908152600e602090815260408083208684529093019052205461135d90612b41565b8284141580156120d4575060008481526010602052604090205460ff165b80156120ee575060008381526010602052604090205460ff165b15156120f957600080fd5b600061210434613368565b600c805460019081018083556000908152600d6020908152604080832060088101805460ff191686179055805473ffffffffffffffffffffffffffffffffffffffff19163317808255600282018d9055600382018c90553460048301819055600583018990558754600160a060020a039283168752600e80875285882080548a018082558952909801865284872055825497549790911680865295845293829020548251968752928601929092528481018b9052606085018a90526080850186905260a085019290925260c0840187905290519394509290917f632b2af1dffd9343432fd45196947d1d63824451dac49e2fd0753aee4dd71df4919081900360e00190a26000828152600f6020908152604080832089845280835281842089855283528184209083528184208a855290925290912061224560018201613383565b151561226757600c5461226290600184019063ffffffff61338716565b6124bb565b6000612271613430565b90506000612281836001016134e4565b60068087018290556001808801859055600c546000848152600d6020908152604080832095860193909355939092018690558582529187905220549091506122cf903463ffffffff61335616565b600083815260208681526040808320938455600390930180546001019055838252600d81528282206004015485835290869052919020546123159163ffffffff61335616565b600083815260208581526040808320938455600390930180546001908101909155600b82528383208e8452600501909152919020015460ff16151561239e576000828152600b602081815260408084208e85526005810183529084206001818101805460ff19168217905560069092018054918290559383529081018355918352909120018a90555b6000828152600b602090815260408083208d8452600501909152808220600201805460019081019091558b83529120015460ff161515612422576000828152600b602081815260408084208d85526005810183529084206001818101805460ff19168217905560069092018054918290559383529081018355918352909120018990555b6000828152600b602081815260408084208d85526005810183528185206002018054600190810190915593835260040180548085018255818652838620908101879055600c8054835496870184559290965293909301929092559154815184815292830152818101849052517ff5b904f60b482287e29148f44263d7d34d78e3f71a9f9faca68fc39e409d3c249181900360600190a150505b6124c4346134f3565b6008548354604080517f8171e885000000000000000000000000000000000000000000000000000000008152600160a060020a039283166004820152602481018a905290519190921691638171e88591604480830192600092919082900301818387803b15801561253457600080fd5b505af1158015612548573d6000803e3d6000fd5b505050505050505050505050565b60055490565b61256533612ff7565b565b600080600080600080600061257a6118df565b6001019650611d2e87612644565b600160a060020a03166000908152600e602052604090205490565b6125ab611d42565b15156125b657600080fd5b600091825260106020526040909120805460ff1916911515919091179055565b6125de611d42565b15156125e957600080fd5b6005541580612615575060058054829190600019810190811061260857fe5b9060005260206000200154105b151561262057600080fd5b60058054906126329060018301613aeb565b506005546111dd90600019018261303f565b600080600080600080612655613b3d565b6000888152600b6020908152604091829020825160c081018452815481526001820154818401526002820154818501526003820154606082015260048201805485518186028101860190965280865291949293608086019392908301828280156126de57602002820191906000526020600020905b8154815260200190600101908083116126ca575b505050505081526020016006820180548060200260200160405190810160405280929190818152602001828054801561273657602002820191906000526020600020905b815481526020019060010190808311612722575b505050919092525050815160208301516040840151606085015160808601515160a09096015151939e929d50909b5099509297509550909350505050565b600160a060020a0381166000908152600e6020526040812060609160015b825481116127bf576000818152600184016020526040902054156127b7576001909101905b600101612792565b50600081111561285657806040519080825280602002602001820160405280156127f3578160200160208202803883390190505b5092506000905060015b825481116128545760008181526001840160205260409020541561284c57600081815260018085016020526040909120548551918401939091869190811061284157fe5b602090810290910101525b6001016127fd565b505b5050919050565b60025481565b60006118ec426001612985565b600380548290811061287e57fe5b60009182526020909120600490910201805460018201546002830154600390930154919350919084565b60106020526000908152604090205460ff1681565b6128c5611d42565b15156128d057600080fd5b600160a060020a03811615156128e557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000806000612921613b14565b61292a866130b6565b9050600081602001518711612940576000612959565b8582600001518360200151890381151561295657fe5b04015b905080826000015102826020015101935080826040015101945083826060015101925050509250925092565b6000806129918461350c565b905061299b613b14565b60038054839081106129a957fe5b9060005260206000209060040201608060405190810160405290816000820154815260200160018201548152602001600282015481526020016003820154815250509050806020015185116129ff576000612a1e565b838160400151826000015183602001518803811515612a1a57fe5b0401015b95945050505050565b6000828152600b60205260408120600401805483908110612a4457fe5b9060005260206000200154905092915050565b600061158160098363ffffffff6135e816565b6000818152600f6020908152604080832086845282528083208584529091528120612a9790600101613383565b949350505050565b600780548290811061167457fe5b612ab5611d42565b1515612ac057600080fd5b6111dd8161361f565b6000818152600b6020908152604091829020600401805483518184028101840190945280845260609392830182828015611c8c5760200282019190600052602060002090815481526020019060010190808311611c785750505050509050919050565b600082821115612b3b57600080fd5b50900390565b6000818152600d60205260409020600881015460ff161515612b6257600080fd5b60018101541515612b7257600080fd5b600080612b91836005015484600201548560030154866001015461311c565b60088501805460ff191690559092509050600381810b9083900b12612e965760048301546007840155600381810b9083900b1315612df057612bd1613a92565b5060058301546000908152600f60209081526040808320600280880154855290835281842060038089015486529084528285206001808a0154875290855294839020835160a08101855281548152958101549486018590529182015492850192909252908101546060840181905260049091015460ff1615156080840152612c6f91811515612c5c57fe5b600787015491900463ffffffff61335616565b60078501556060810151604082015160009190811515612c8b57fe5b049050612c978161369c565b6008548554604080517f40bc11fe000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201529051612d3993600286049316916340bc11fe916024808301926020929190829003018186803b158015612d0557600080fd5b505afa158015612d19573d6000803e3d6000fd5b505050506040513d6020811015612d2f57600080fd5b50516000806136af565b60085460068601546000908152600d60209081526040918290205482517f40bc11fe000000000000000000000000000000000000000000000000000000008152600160a060020a0391821660048201529251612ded9460028704949216926340bc11fe9260248082019391829003018186803b158015612db857600080fd5b505afa158015612dcc573d6000803e3d6000fd5b505050506040513d6020811015612de257600080fd5b5051600060016136af565b50505b82546007840154604051600160a060020a039092169181156108fc0291906000818181858888f19350505050158015612e2d573d6000803e3d6000fd5b50612e3b836007015461369c565b6006830154600784015460408051878152602081019390935282810191909152600384810b9084900b146060830152517fd2bda33d3af825f827a7f0a385136fae0489a5df5b623a44709788d10f5b54449181900360800190a15b611cc3611143565b6000818152600d60205260409020600881015460ff161515612ebf57600080fd5b600181015415612ece57600080fd5b60058101546000908152600f60209081526040808320600285015484528252808320600385015484529091529020612f0f600182018463ffffffff61386116565b612f1c826004015461369c565b81546004830154604051600160a060020a039092169181156108fc0291906000818181858888f19350505050158015612f59573d6000803e3d6000fd5b506040805184815290517f0251581e1b59903a31a6bd345b77ac977d80257865ab48261eed09027158d5619181900360200190a150506000908152600d60205260408120805473ffffffffffffffffffffffffffffffffffffffff191681556001810182905560028101829055600381018290556004810182905560058101829055600681018290556007810191909155600801805460ff19169055565b61300860098263ffffffff61397516565b604051600160a060020a038216907f29d546abb6e94f4f04d5bdccb6682316f597d43776078f47e273f000e77b2a9190600090a250565b8060058381548110151561304f57fe5b6000918252602080832090910192909255918252600490526040902055565b61307f60098263ffffffff6139c116565b604051600160a060020a038216907fc917ab672aa101ddaa2e4db6de34f67d180098d502a2ed9e199f79b4c4333a6b90600090a250565b6130be613b14565b60036130c98361350c565b815481106130d357fe5b9060005260206000209060040201608060405190810160405290816000820154815260200160018201548152602001600282015481526020016003820154815250509050919050565b6000818152600b602052604081205481901580159061314b57506000838152600b602052604090206001015415155b151561315657600080fd5b50506000818152600b602090815260408083208684526005019091528082206003908101548584529190922082015490820b9190810b9081810b9083900b121561319e579293925b6000868152600f60209081526040808320888452808352818420888552835281842090835281842089855283528184208785529283905292206004015460ff1615156132dc576000858152602082905260409020600401805460ff19166001179055600384810b9084900b146132dc5760008581526020829052604081205460115461322a9190613330565b90506132358161369c565b6000868152602083905260409020546012546132519190613330565b600087815260208581526040808320600281018590558683529281902054878352859003939093036001830181905560039092015483518a81529182018c90528184018b9052606082018d9052608082019290925260a081019190915290517f32f13e435dad46cfaa685bc90cf7d626b4431cd1470f7a35de0cfdb868b7acca9181900360c00190a1505b60008581526020839052604090206004015460ff161515613314576000858152602083905260409020600401805460ff191660011790555b505094509492505050565b60200260020a900463ffffffff1690565b6000612710613345848463ffffffff613a0f16565b81151561334e57fe5b049392505050565b60008282018381101561157e57600080fd5b600081815260046020526040902054801515611c9457600080fd5b5490565b600081815260048301602052604090205460ff16156133a557600080fd5b6040805160608101825260018082526002858101546020808501918252600085870181815288825260048a01909252959095209351845460ff191690151517845551918301919091559151910155815415156134075760018201819055613422565b60028083015460009081526004840160205260409020018190555b600282015580546001019055565b600080600061343d611ae1565b6000838152600b6020526040902054929550909350915015156134df576000838152600b60209081526040808320859055600a805460018101825593527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8909201859055815185815290810184905280820183905290517f23829bf2d5715c80876e9c093c08f42de6205b86ac6f0e156301de77611f65449181900360600190a15b505090565b6001810154611c948282613861565b600254613506908263ffffffff61335616565b60025550565b600354600090811061351d57600080fd5b60038054600019810190811061352f57fe5b90600052602060002090600402016001015482101515613556575060035460001901611c94565b60038054600090811061356557fe5b90600052602060002090600402016001015482101561358657506000611c94565b600354600090600019015b818111156135e15760038054600284840160010104918691839081106135b357fe5b9060005260206000209060040201600101541115156135d4578092506135db565b6001810391505b50613591565b5092915050565b6000600160a060020a03821615156135ff57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b600160a060020a038116151561363457600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600254613506908263ffffffff612b2c16565b600854604080517fd7e0515a000000000000000000000000000000000000000000000000000000008152600481018690529051600092600160a060020a03169163d7e0515a916024808301926020929190829003018186803b15801561371457600080fd5b505afa158015613728573d6000803e3d6000fd5b505050506040513d602081101561373e57600080fd5b5051600780549192506000918590811061375457fe5b906000526020600020015411801561376b57508315155b801561378857506000831180613788575081801561378857508015155b156138445760006137b2866007868154811015156137a257fe5b9060005260206000200154613330565b600854604080517f627911d0000000000000000000000000000000000000000000000000000000008152600060048201819052602482018a9052604482018590529151939450600160a060020a039092169263627911d0928592606480830193919282900301818588803b15801561382957600080fd5b505af115801561383d573d6000803e3d6000fd5b5050505050505b6007546001909301928310156115475761154785828560006136af565b815460001061386f57600080fd5b600081815260048301602052604090205460ff16151561388e57600080fd5b6000818152600483016020526040902060010154156138d157600081815260048301602052604080822060028082015460019092015484529190922001556138eb565b600081815260048301602052604090206002015460018301555b60008181526004830160205260409020600201541561392e5760008181526004830160205260408082206001808201546002909201548452919092200155613948565b600081815260048301602052604090206001015460028301555b60009081526004820160205260408120805460ff1916815560018101829055600201558054600019019055565b600160a060020a038116151561398a57600080fd5b61399482826135e8565b151561399f57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19169055565b600160a060020a03811615156139d657600080fd5b6139e082826135e8565b156139ea57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000821515613a2057506000611581565b828202828482811515613a2f57fe5b041461157e57600080fd5b610120604051908101604052806000600160a060020a03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581525090565b60a060405190810160405280600081526020016000815260200160008152602001600081526020016000151581525090565b60408051608081018252600080825260208201819052918101829052606081019190915290565b815481835581811115613b0f57600083815260209020613b0f918101908301613b74565b505050565b608060405190810160405280600081526020016000815260200160008152602001600081525090565b60c0604051908101604052806000815260200160008152602001600081526020016000815260200160608152602001606081525090565b6118ef91905b80821115613b8e5760008155600101613b7a565b509056fea165627a7a723058202f30fb5acec93f19ead9e14fb0ba51e1e95e253ef66010d823220a781fb185f00029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000edbbdf2c29ccf6a0272b36b10eadc1b17b8d7e67000000000000000000000000e544e5250648882601f9c27674dec6b4924163c2
-----Decoded View---------------
Arg [0] : _w (address): 0xEdbBdf2c29ccf6A0272b36B10eaDC1B17b8D7e67
Arg [1] : _aff (address): 0xE544E5250648882601f9c27674Dec6B4924163C2
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000edbbdf2c29ccf6a0272b36b10eadc1b17b8d7e67
Arg [1] : 000000000000000000000000e544e5250648882601f9c27674dec6b4924163c2
Swarm Source
bzzr://2f30fb5acec93f19ead9e14fb0ba51e1e95e253ef66010d823220a781fb185f0
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.