More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 2,294 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw House S... | 6579873 | 2260 days ago | IN | 0 ETH | 0.00019361 | ||||
Pause | 6579823 | 2260 days ago | IN | 0 ETH | 0.00038884 | ||||
Server End Game | 6579781 | 2260 days ago | IN | 0 ETH | 0.00070928 | ||||
Server End Game | 6579772 | 2260 days ago | IN | 0 ETH | 0.0007671 | ||||
Create Game | 6579758 | 2260 days ago | IN | 0.11 ETH | 0.00080846 | ||||
User End Game Co... | 6579717 | 2260 days ago | IN | 0 ETH | 0.00111661 | ||||
Create Game | 6579567 | 2260 days ago | IN | 1.01 ETH | 0.00071435 | ||||
Server End Game | 6579457 | 2260 days ago | IN | 0 ETH | 0.00079587 | ||||
Create Game | 6579279 | 2260 days ago | IN | 0.02 ETH | 0.00071435 | ||||
Server End Game | 6579019 | 2260 days ago | IN | 0 ETH | 0.00084726 | ||||
Create Game | 6578997 | 2260 days ago | IN | 0.05 ETH | 0.00071492 | ||||
Server End Game ... | 6578192 | 2260 days ago | IN | 0 ETH | 0.00163379 | ||||
Server End Game | 6578062 | 2260 days ago | IN | 0 ETH | 0.00076764 | ||||
Create Game | 6577271 | 2260 days ago | IN | 0.06 ETH | 0.00052591 | ||||
Server End Game | 6577049 | 2260 days ago | IN | 0 ETH | 0.0007671 | ||||
Create Game | 6576905 | 2261 days ago | IN | 1.91 ETH | 0.000712 | ||||
Server End Game | 6576769 | 2261 days ago | IN | 0 ETH | 0.00076818 | ||||
Create Game | 6576664 | 2261 days ago | IN | 1.41 ETH | 0.00056592 | ||||
Create Game | 6576656 | 2261 days ago | IN | 0.01 ETH | 0.00067085 | ||||
Server End Game | 6576627 | 2261 days ago | IN | 0 ETH | 0.0006411 | ||||
Create Game | 6576621 | 2261 days ago | IN | 0.01 ETH | 0.0007672 | ||||
Server End Game | 6576519 | 2261 days ago | IN | 0 ETH | 0.00070869 | ||||
Server End Game | 6576484 | 2261 days ago | IN | 0 ETH | 0.0007671 | ||||
Create Game | 6576480 | 2261 days ago | IN | 1.34 ETH | 0.00064728 | ||||
Create Game | 6576469 | 2261 days ago | IN | 0.01 ETH | 0.0007672 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
6579873 | 2260 days ago | 15.92981777 ETH | ||||
6579781 | 2260 days ago | 1.12200376 ETH | ||||
6579772 | 2260 days ago | 0.11736504 ETH | ||||
6579717 | 2260 days ago | 0.0091164 ETH | ||||
6579457 | 2260 days ago | 0.0210193 ETH | ||||
6579019 | 2260 days ago | 0.0831081 ETH | ||||
6578062 | 2260 days ago | 0.06950547 ETH | ||||
6577049 | 2260 days ago | 2.0120943 ETH | ||||
6576769 | 2261 days ago | 1.51480889 ETH | ||||
6576627 | 2261 days ago | 0.0101192 ETH | ||||
6576519 | 2261 days ago | 1.41140468 ETH | ||||
6576484 | 2261 days ago | 0.01058 ETH | ||||
6576431 | 2261 days ago | 1.34195976 ETH | ||||
6576330 | 2261 days ago | 1.28179206 ETH | ||||
6576242 | 2261 days ago | 1.17107189 ETH | ||||
6576121 | 2261 days ago | 1.07213429 ETH | ||||
6576091 | 2261 days ago | 0.09707865 ETH | ||||
6575880 | 2261 days ago | 0.0100182 ETH | ||||
6575719 | 2261 days ago | 0.0407424 ETH | ||||
6575442 | 2261 days ago | 0.0411648 ETH | ||||
6575347 | 2261 days ago | 0.0093504 ETH | ||||
6575149 | 2261 days ago | 0.0201568 ETH | ||||
6574212 | 2261 days ago | 0.010102 ETH | ||||
6573912 | 2261 days ago | 1.04139179 ETH | ||||
6573812 | 2261 days ago | 0.0206064 ETH |
Loading...
Loading
Contract Name:
GameChannel
Compiler Version
v0.4.24+commit.e67f0147
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-09-06 */ pragma solidity ^0.4.24; interface ConflictResolutionInterface { function minHouseStake(uint activeGames) external pure returns(uint); function maxBalance() external pure returns(int); function conflictEndFine() external pure returns(int); function isValidBet(uint8 _gameType, uint _betNum, uint _betValue) external pure returns(bool); function endGameConflict( uint8 _gameType, uint _betNum, uint _betValue, int _balance, uint _stake, bytes32 _serverSeed, bytes32 _userSeed ) external view returns(int); function serverForceGameEnd( uint8 gameType, uint _betNum, uint _betValue, int _balance, uint _stake, uint _endInitiatedTime ) external view returns(int); function userForceGameEnd( uint8 _gameType, uint _betNum, uint _betValue, int _balance, uint _stake, uint _endInitiatedTime ) external view returns(int); } library MathUtil { /** * @dev Returns the absolute value of _val. * @param _val value * @return The absolute value of _val. */ function abs(int _val) internal pure returns(uint) { if (_val < 0) { return uint(-_val); } else { return uint(_val); } } /** * @dev Calculate maximum. */ function max(uint _val1, uint _val2) internal pure returns(uint) { return _val1 >= _val2 ? _val1 : _val2; } /** * @dev Calculate minimum. */ function min(uint _val1, uint _val2) internal pure returns(uint) { return _val1 <= _val2 ? _val1 : _val2; } } contract Ownable { address public owner; address public pendingOwner; event LogOwnerShipTransferred(address indexed previousOwner, address indexed newOwner); event LogOwnerShipTransferInitiated(address indexed previousOwner, address indexed newOwner); /** * @dev Modifier, which throws if called by other account than owner. */ modifier onlyOwner { require(msg.sender == owner); _; } /** * @dev Modifier throws if called by any account other than the pendingOwner. */ modifier onlyPendingOwner() { require(msg.sender == pendingOwner); _; } /** * @dev Set contract creator as initial owner */ constructor() public { owner = msg.sender; pendingOwner = address(0); } /** * @dev Allows the current owner to set the pendingOwner address. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { pendingOwner = _newOwner; emit LogOwnerShipTransferInitiated(owner, _newOwner); } /** * @dev PendingOwner can accept ownership. */ function claimOwnership() public onlyPendingOwner { owner = pendingOwner; pendingOwner = address(0); emit LogOwnerShipTransferred(owner, pendingOwner); } } contract Activatable is Ownable { bool public activated = false; /// @dev Event is fired if activated. event LogActive(); /// @dev Modifier, which only allows function execution if activated. modifier onlyActivated() { require(activated); _; } /// @dev Modifier, which only allows function execution if not activated. modifier onlyNotActivated() { require(!activated); _; } /// @dev activate contract, can be only called once by the contract owner. function activate() public onlyOwner onlyNotActivated { activated = true; emit LogActive(); } } contract ConflictResolutionManager is Ownable { /// @dev Conflict resolution contract. ConflictResolutionInterface public conflictRes; /// @dev New Conflict resolution contract. address public newConflictRes = 0; /// @dev Time update of new conflict resolution contract was initiated. uint public updateTime = 0; /// @dev Min time before new conflict res contract can be activated after initiating update. uint public constant MIN_TIMEOUT = 3 days; /// @dev Min time before new conflict res contract can be activated after initiating update. uint public constant MAX_TIMEOUT = 6 days; /// @dev Update of conflict resolution contract was initiated. event LogUpdatingConflictResolution(address newConflictResolutionAddress); /// @dev New conflict resolution contract is active. event LogUpdatedConflictResolution(address newConflictResolutionAddress); /** * @dev Constructor * @param _conflictResAddress conflict resolution contract address. */ constructor(address _conflictResAddress) public { conflictRes = ConflictResolutionInterface(_conflictResAddress); } /** * @dev Initiate conflict resolution contract update. * @param _newConflictResAddress New conflict resolution contract address. */ function updateConflictResolution(address _newConflictResAddress) public onlyOwner { newConflictRes = _newConflictResAddress; updateTime = block.timestamp; emit LogUpdatingConflictResolution(_newConflictResAddress); } /** * @dev Active new conflict resolution contract. */ function activateConflictResolution() public onlyOwner { require(newConflictRes != 0); require(updateTime != 0); require(updateTime + MIN_TIMEOUT <= block.timestamp && block.timestamp <= updateTime + MAX_TIMEOUT); conflictRes = ConflictResolutionInterface(newConflictRes); newConflictRes = 0; updateTime = 0; emit LogUpdatedConflictResolution(newConflictRes); } } contract Pausable is Activatable { using SafeMath for uint; /// @dev Is contract paused. Initial it is paused. bool public paused = true; /// @dev Time pause was called uint public timePaused = block.timestamp; /// @dev Modifier, which only allows function execution if not paused. modifier onlyNotPaused() { require(!paused, "paused"); _; } /// @dev Modifier, which only allows function execution if paused. modifier onlyPaused() { require(paused); _; } /// @dev Modifier, which only allows function execution if paused longer than timeSpan. modifier onlyPausedSince(uint timeSpan) { require(paused && (timePaused.add(timeSpan) <= block.timestamp)); _; } /// @dev Event is fired if paused. event LogPause(); /// @dev Event is fired if pause is ended. event LogUnpause(); /** * @dev Pause contract. No new game sessions can be created. */ function pause() public onlyOwner onlyNotPaused { paused = true; timePaused = block.timestamp; emit LogPause(); } /** * @dev Unpause contract. Initial contract is paused and can only be unpaused after activating it. */ function unpause() public onlyOwner onlyPaused onlyActivated { paused = false; timePaused = 0; emit LogUnpause(); } } contract Destroyable is Pausable { /// @dev After pausing the contract for 20 days owner can selfdestruct it. uint public constant TIMEOUT_DESTROY = 20 days; /** * @dev Destroy contract and transfer ether to owner. */ function destroy() public onlyOwner onlyPausedSince(TIMEOUT_DESTROY) { selfdestruct(owner); } } contract GameChannelBase is Destroyable, ConflictResolutionManager { using SafeCast for int; using SafeCast for uint; using SafeMath for int; using SafeMath for uint; /// @dev Different game session states. enum GameStatus { ENDED, ///< @dev Game session is ended. ACTIVE, ///< @dev Game session is active. USER_INITIATED_END, ///< @dev User initiated non regular end. SERVER_INITIATED_END ///< @dev Server initiated non regular end. } /// @dev Reason game session ended. enum ReasonEnded { REGULAR_ENDED, ///< @dev Game session is regularly ended. SERVER_FORCED_END, ///< @dev User did not respond. Server forced end. USER_FORCED_END, ///< @dev Server did not respond. User forced end. CONFLICT_ENDED ///< @dev Server or user raised conflict ans pushed game state, opponent pushed same game state. } struct Game { /// @dev Game session status. GameStatus status; /// @dev User's stake. uint128 stake; /// @dev Last game round info if not regularly ended. /// If game session is ended normally this data is not used. uint8 gameType; uint32 roundId; uint betNum; uint betValue; int balance; bytes32 userSeed; bytes32 serverSeed; uint endInitiatedTime; } /// @dev Minimal time span between profit transfer. uint public constant MIN_TRANSFER_TIMESPAN = 1 days; /// @dev Maximal time span between profit transfer. uint public constant MAX_TRANSFER_TIMSPAN = 6 * 30 days; bytes32 public constant TYPE_HASH = keccak256(abi.encodePacked( "uint32 Round Id", "uint8 Game Type", "uint16 Number", "uint Value (Wei)", "int Current Balance (Wei)", "bytes32 Server Hash", "bytes32 Player Hash", "uint Game Id", "address Contract Address" )); /// @dev Current active game sessions. uint public activeGames = 0; /// @dev Game session id counter. Points to next free game session slot. So gameIdCntr -1 is the // number of game sessions created. uint public gameIdCntr = 1; /// @dev Only this address can accept and end games. address public serverAddress; /// @dev Address to transfer profit to. address public houseAddress; /// @dev Current house stake. uint public houseStake = 0; /// @dev House profit since last profit transfer. int public houseProfit = 0; /// @dev Min value user needs to deposit for creating game session. uint128 public minStake; /// @dev Max value user can deposit for creating game session. uint128 public maxStake; /// @dev Timeout until next profit transfer is allowed. uint public profitTransferTimeSpan = 14 days; /// @dev Last time profit transferred to house. uint public lastProfitTransferTimestamp; /// @dev Maps gameId to game struct. mapping (uint => Game) public gameIdGame; /// @dev Maps user address to current user game id. mapping (address => uint) public userGameId; /// @dev Maps user address to pending returns. mapping (address => uint) public pendingReturns; /// @dev Modifier, which only allows to execute if house stake is high enough. modifier onlyValidHouseStake(uint _activeGames) { uint minHouseStake = conflictRes.minHouseStake(_activeGames); require(houseStake >= minHouseStake, "inv houseStake"); _; } /// @dev Modifier to check if value send fulfills user stake requirements. modifier onlyValidValue() { require(minStake <= msg.value && msg.value <= maxStake, "inv stake"); _; } /// @dev Modifier, which only allows server to call function. modifier onlyServer() { require(msg.sender == serverAddress); _; } /// @dev Modifier, which only allows to set valid transfer timeouts. modifier onlyValidTransferTimeSpan(uint transferTimeout) { require(transferTimeout >= MIN_TRANSFER_TIMESPAN && transferTimeout <= MAX_TRANSFER_TIMSPAN); _; } /// @dev This event is fired when user creates game session. event LogGameCreated(address indexed user, uint indexed gameId, uint128 stake, bytes32 indexed serverEndHash, bytes32 userEndHash); /// @dev This event is fired when user requests conflict end. event LogUserRequestedEnd(address indexed user, uint indexed gameId); /// @dev This event is fired when server requests conflict end. event LogServerRequestedEnd(address indexed user, uint indexed gameId); /// @dev This event is fired when game session is ended. event LogGameEnded(address indexed user, uint indexed gameId, uint32 roundId, int balance, ReasonEnded reason); /// @dev this event is fired when owner modifies user's stake limits. event LogStakeLimitsModified(uint minStake, uint maxStake); /** * @dev Contract constructor. * @param _serverAddress Server address. * @param _minStake Min value user needs to deposit to create game session. * @param _maxStake Max value user can deposit to create game session. * @param _conflictResAddress Conflict resolution contract address. * @param _houseAddress House address to move profit to. * @param _chainId Chain id for signature domain. */ constructor( address _serverAddress, uint128 _minStake, uint128 _maxStake, address _conflictResAddress, address _houseAddress, uint _chainId ) public ConflictResolutionManager(_conflictResAddress) { require(_minStake > 0 && _minStake <= _maxStake); serverAddress = _serverAddress; houseAddress = _houseAddress; lastProfitTransferTimestamp = block.timestamp; minStake = _minStake; maxStake = _maxStake; } /** * @dev Set gameIdCntr. Can be only set before activating contract. */ function setGameIdCntr(uint _gameIdCntr) public onlyOwner onlyNotActivated { require(gameIdCntr > 0); gameIdCntr = _gameIdCntr; } /** * @notice Withdraw pending returns. */ function withdraw() public { uint toTransfer = pendingReturns[msg.sender]; require(toTransfer > 0); pendingReturns[msg.sender] = 0; msg.sender.transfer(toTransfer); } /** * @notice Transfer house profit to houseAddress. */ function transferProfitToHouse() public { require(lastProfitTransferTimestamp.add(profitTransferTimeSpan) <= block.timestamp); // update last transfer timestamp lastProfitTransferTimestamp = block.timestamp; if (houseProfit <= 0) { // no profit to transfer return; } uint toTransfer = houseProfit.castToUint(); houseProfit = 0; houseStake = houseStake.sub(toTransfer); houseAddress.transfer(toTransfer); } /** * @dev Set profit transfer time span. */ function setProfitTransferTimeSpan(uint _profitTransferTimeSpan) public onlyOwner onlyValidTransferTimeSpan(_profitTransferTimeSpan) { profitTransferTimeSpan = _profitTransferTimeSpan; } /** * @dev Increase house stake by msg.value */ function addHouseStake() public payable onlyOwner { houseStake = houseStake.add(msg.value); } /** * @dev Withdraw house stake. */ function withdrawHouseStake(uint value) public onlyOwner { uint minHouseStake = conflictRes.minHouseStake(activeGames); require(value <= houseStake && houseStake.sub(value) >= minHouseStake); require(houseProfit <= 0 || houseProfit.castToUint() <= houseStake.sub(value)); houseStake = houseStake.sub(value); owner.transfer(value); } /** * @dev Withdraw house stake and profit. */ function withdrawAll() public onlyOwner onlyPausedSince(3 days) { houseProfit = 0; uint toTransfer = houseStake; houseStake = 0; owner.transfer(toTransfer); } /** * @dev Set new house address. * @param _houseAddress New house address. */ function setHouseAddress(address _houseAddress) public onlyOwner { houseAddress = _houseAddress; } /** * @dev Set stake min and max value. * @param _minStake Min stake. * @param _maxStake Max stake. */ function setStakeRequirements(uint128 _minStake, uint128 _maxStake) public onlyOwner { require(_minStake > 0 && _minStake <= _maxStake); minStake = _minStake; maxStake = _maxStake; emit LogStakeLimitsModified(minStake, maxStake); } /** * @dev Close game session. * @param _game Game session data. * @param _gameId Id of game session. * @param _userAddress User's address of game session. * @param _reason Reason for closing game session. * @param _balance Game session balance. */ function closeGame( Game storage _game, uint _gameId, uint32 _roundId, address _userAddress, ReasonEnded _reason, int _balance ) internal { _game.status = GameStatus.ENDED; activeGames = activeGames.sub(1); payOut(_userAddress, _game.stake, _balance); emit LogGameEnded(_userAddress, _gameId, _roundId, _balance, _reason); } /** * @dev End game by paying out user and server. * @param _userAddress User's address. * @param _stake User's stake. * @param _balance User's balance. */ function payOut(address _userAddress, uint128 _stake, int _balance) internal { int stakeInt = _stake; int houseStakeInt = houseStake.castToInt(); assert(_balance <= conflictRes.maxBalance()); assert((stakeInt.add(_balance)) >= 0); if (_balance > 0 && houseStakeInt < _balance) { // Should never happen! // House is bankrupt. // Payout left money. _balance = houseStakeInt; } houseProfit = houseProfit.sub(_balance); int newHouseStake = houseStakeInt.sub(_balance); houseStake = newHouseStake.castToUint(); uint valueUser = stakeInt.add(_balance).castToUint(); pendingReturns[_userAddress] += valueUser; if (pendingReturns[_userAddress] > 0) { safeSend(_userAddress); } } /** * @dev Send value of pendingReturns[_address] to _address. * @param _address Address to send value to. */ function safeSend(address _address) internal { uint valueToSend = pendingReturns[_address]; assert(valueToSend > 0); pendingReturns[_address] = 0; if (_address.send(valueToSend) == false) { pendingReturns[_address] = valueToSend; } } /** * @dev Verify signature of given data. Throws on verification failure. * @param _sig Signature of given data in the form of rsv. * @param _address Address of signature signer. */ function verifySig( uint32 _roundId, uint8 _gameType, uint _num, uint _value, int _balance, bytes32 _serverHash, bytes32 _userHash, uint _gameId, address _contractAddress, bytes _sig, address _address ) internal view { // check if this is the correct contract address contractAddress = this; require(_contractAddress == contractAddress, "inv contractAddress"); bytes32 roundHash = calcHash( _roundId, _gameType, _num, _value, _balance, _serverHash, _userHash, _gameId ); verify( roundHash, _sig, _address ); } /** * @dev Check if _sig is valid signature of _hash. Throws if invalid signature. * @param _hash Hash to check signature of. * @param _sig Signature of _hash. * @param _address Address of signer. */ function verify( bytes32 _hash, bytes _sig, address _address ) internal pure { (bytes32 r, bytes32 s, uint8 v) = signatureSplit(_sig); address addressRecover = ecrecover(_hash, v, r, s); require(addressRecover == _address, "inv sig"); } /** * @dev Calculate typed hash of given data (compare eth_signTypedData). * @return Hash of given data. */ function calcHash( uint32 _roundId, uint8 _gameType, uint _num, uint _value, int _balance, bytes32 _serverHash, bytes32 _userHash, uint _gameId ) private view returns(bytes32) { bytes32 betHash = keccak256(abi.encodePacked( _roundId, _gameType, uint16(_num), _value, _balance, _serverHash, _userHash, _gameId, address(this) )); return keccak256(abi.encodePacked( TYPE_HASH, betHash )); } /** * @dev Split the given signature of the form rsv in r s v. v is incremented with 27 if * it is below 2. * @param _signature Signature to split. * @return r s v */ function signatureSplit(bytes _signature) private pure returns (bytes32 r, bytes32 s, uint8 v) { require(_signature.length == 65, "inv sig"); assembly { r := mload(add(_signature, 32)) s := mload(add(_signature, 64)) v := and(mload(add(_signature, 65)), 0xff) } if (v < 2) { v = v + 27; } } } contract GameChannelConflict is GameChannelBase { using SafeCast for int; using SafeCast for uint; using SafeMath for int; using SafeMath for uint; /** * @dev Contract constructor. * @param _serverAddress Server address. * @param _minStake Min value user needs to deposit to create game session. * @param _maxStake Max value user can deposit to create game session. * @param _conflictResAddress Conflict resolution contract address * @param _houseAddress House address to move profit to * @param _chainId Chain id for signature domain. */ constructor( address _serverAddress, uint128 _minStake, uint128 _maxStake, address _conflictResAddress, address _houseAddress, uint _chainId ) public GameChannelBase(_serverAddress, _minStake, _maxStake, _conflictResAddress, _houseAddress, _chainId) { // nothing to do } /** * @dev Used by server if user does not end game session. * @param _roundId Round id of bet. * @param _gameType Game type of bet. * @param _num Number of bet. * @param _value Value of bet. * @param _balance Balance before this bet. * @param _serverHash Hash of server seed for this bet. * @param _userHash Hash of user seed for this bet. * @param _gameId Game session id. * @param _contractAddress Address of this contract. * @param _userSig User signature of this bet. * @param _userAddress Address of user. * @param _serverSeed Server seed for this bet. * @param _userSeed User seed for this bet. */ function serverEndGameConflict( uint32 _roundId, uint8 _gameType, uint _num, uint _value, int _balance, bytes32 _serverHash, bytes32 _userHash, uint _gameId, address _contractAddress, bytes _userSig, address _userAddress, bytes32 _serverSeed, bytes32 _userSeed ) public onlyServer { verifySig( _roundId, _gameType, _num, _value, _balance, _serverHash, _userHash, _gameId, _contractAddress, _userSig, _userAddress ); serverEndGameConflictImpl( _roundId, _gameType, _num, _value, _balance, _serverHash, _userHash, _serverSeed, _userSeed, _gameId, _userAddress ); } /** * @notice Can be used by user if server does not answer to the end game session request. * @param _roundId Round id of bet. * @param _gameType Game type of bet. * @param _num Number of bet. * @param _value Value of bet. * @param _balance Balance before this bet. * @param _serverHash Hash of server seed for this bet. * @param _userHash Hash of user seed for this bet. * @param _gameId Game session id. * @param _contractAddress Address of this contract. * @param _serverSig Server signature of this bet. * @param _userSeed User seed for this bet. */ function userEndGameConflict( uint32 _roundId, uint8 _gameType, uint _num, uint _value, int _balance, bytes32 _serverHash, bytes32 _userHash, uint _gameId, address _contractAddress, bytes _serverSig, bytes32 _userSeed ) public { verifySig( _roundId, _gameType, _num, _value, _balance, _serverHash, _userHash, _gameId, _contractAddress, _serverSig, serverAddress ); userEndGameConflictImpl( _roundId, _gameType, _num, _value, _balance, _userHash, _userSeed, _gameId, msg.sender ); } /** * @notice Cancel active game without playing. Useful if server stops responding before * one game is played. * @param _gameId Game session id. */ function userCancelActiveGame(uint _gameId) public { address userAddress = msg.sender; uint gameId = userGameId[userAddress]; Game storage game = gameIdGame[gameId]; require(gameId == _gameId, "inv gameId"); if (game.status == GameStatus.ACTIVE) { game.endInitiatedTime = block.timestamp; game.status = GameStatus.USER_INITIATED_END; emit LogUserRequestedEnd(msg.sender, gameId); } else if (game.status == GameStatus.SERVER_INITIATED_END && game.roundId == 0) { cancelActiveGame(game, gameId, userAddress); } else { revert(); } } /** * @dev Cancel active game without playing. Useful if user starts game session and * does not play. * @param _userAddress Users' address. * @param _gameId Game session id. */ function serverCancelActiveGame(address _userAddress, uint _gameId) public onlyServer { uint gameId = userGameId[_userAddress]; Game storage game = gameIdGame[gameId]; require(gameId == _gameId, "inv gameId"); if (game.status == GameStatus.ACTIVE) { game.endInitiatedTime = block.timestamp; game.status = GameStatus.SERVER_INITIATED_END; emit LogServerRequestedEnd(msg.sender, gameId); } else if (game.status == GameStatus.USER_INITIATED_END && game.roundId == 0) { cancelActiveGame(game, gameId, _userAddress); } else { revert(); } } /** * @dev Force end of game if user does not respond. Only possible after a certain period of time * to give the user a chance to respond. * @param _userAddress User's address. */ function serverForceGameEnd(address _userAddress, uint _gameId) public onlyServer { uint gameId = userGameId[_userAddress]; Game storage game = gameIdGame[gameId]; require(gameId == _gameId, "inv gameId"); require(game.status == GameStatus.SERVER_INITIATED_END, "inv status"); // theoretically we have enough data to calculate winner // but as user did not respond assume he has lost. int newBalance = conflictRes.serverForceGameEnd( game.gameType, game.betNum, game.betValue, game.balance, game.stake, game.endInitiatedTime ); closeGame(game, gameId, game.roundId, _userAddress, ReasonEnded.SERVER_FORCED_END, newBalance); } /** * @notice Force end of game if server does not respond. Only possible after a certain period of time * to give the server a chance to respond. */ function userForceGameEnd(uint _gameId) public { address userAddress = msg.sender; uint gameId = userGameId[userAddress]; Game storage game = gameIdGame[gameId]; require(gameId == _gameId, "inv gameId"); require(game.status == GameStatus.USER_INITIATED_END, "inv status"); int newBalance = conflictRes.userForceGameEnd( game.gameType, game.betNum, game.betValue, game.balance, game.stake, game.endInitiatedTime ); closeGame(game, gameId, game.roundId, userAddress, ReasonEnded.USER_FORCED_END, newBalance); } /** * @dev Conflict handling implementation. Stores game data and timestamp if game * is active. If server has already marked conflict for game session the conflict * resolution contract is used (compare conflictRes). * @param _roundId Round id of bet. * @param _gameType Game type of bet. * @param _num Number of bet. * @param _value Value of bet. * @param _balance Balance before this bet. * @param _userHash Hash of user's seed for this bet. * @param _userSeed User's seed for this bet. * @param _gameId game Game session id. * @param _userAddress User's address. */ function userEndGameConflictImpl( uint32 _roundId, uint8 _gameType, uint _num, uint _value, int _balance, bytes32 _userHash, bytes32 _userSeed, uint _gameId, address _userAddress ) private { uint gameId = userGameId[_userAddress]; Game storage game = gameIdGame[gameId]; int maxBalance = conflictRes.maxBalance(); int gameStake = game.stake; require(gameId == _gameId, "inv gameId"); require(_roundId > 0, "inv roundId"); require(keccak256(abi.encodePacked(_userSeed)) == _userHash, "inv userSeed"); require(-gameStake <= _balance && _balance <= maxBalance, "inv balance"); // game.stake save to cast as uint128 require(conflictRes.isValidBet(_gameType, _num, _value), "inv bet"); require(gameStake.add(_balance).sub(_value.castToInt()) >= 0, "value too high"); // game.stake save to cast as uint128 if (game.status == GameStatus.SERVER_INITIATED_END && game.roundId == _roundId) { game.userSeed = _userSeed; endGameConflict(game, gameId, _userAddress); } else if (game.status == GameStatus.ACTIVE || (game.status == GameStatus.SERVER_INITIATED_END && game.roundId < _roundId)) { game.status = GameStatus.USER_INITIATED_END; game.endInitiatedTime = block.timestamp; game.roundId = _roundId; game.gameType = _gameType; game.betNum = _num; game.betValue = _value; game.balance = _balance; game.userSeed = _userSeed; game.serverSeed = bytes32(0); emit LogUserRequestedEnd(msg.sender, gameId); } else { revert("inv state"); } } /** * @dev Conflict handling implementation. Stores game data and timestamp if game * is active. If user has already marked conflict for game session the conflict * resolution contract is used (compare conflictRes). * @param _roundId Round id of bet. * @param _gameType Game type of bet. * @param _num Number of bet. * @param _value Value of bet. * @param _balance Balance before this bet. * @param _serverHash Hash of server's seed for this bet. * @param _userHash Hash of user's seed for this bet. * @param _serverSeed Server's seed for this bet. * @param _userSeed User's seed for this bet. * @param _userAddress User's address. */ function serverEndGameConflictImpl( uint32 _roundId, uint8 _gameType, uint _num, uint _value, int _balance, bytes32 _serverHash, bytes32 _userHash, bytes32 _serverSeed, bytes32 _userSeed, uint _gameId, address _userAddress ) private { uint gameId = userGameId[_userAddress]; Game storage game = gameIdGame[gameId]; int maxBalance = conflictRes.maxBalance(); int gameStake = game.stake; require(gameId == _gameId, "inv gameId"); require(_roundId > 0, "inv roundId"); require(keccak256(abi.encodePacked(_serverSeed)) == _serverHash, "inv serverSeed"); require(keccak256(abi.encodePacked(_userSeed)) == _userHash, "inv userSeed"); require(-gameStake <= _balance && _balance <= maxBalance, "inv balance"); // game.stake save to cast as uint128 require(conflictRes.isValidBet(_gameType, _num, _value), "inv bet"); require(gameStake.add(_balance).sub(_value.castToInt()) >= 0, "too high value"); // game.stake save to cast as uin128 if (game.status == GameStatus.USER_INITIATED_END && game.roundId == _roundId) { game.serverSeed = _serverSeed; endGameConflict(game, gameId, _userAddress); } else if (game.status == GameStatus.ACTIVE || (game.status == GameStatus.USER_INITIATED_END && game.roundId < _roundId)) { game.status = GameStatus.SERVER_INITIATED_END; game.endInitiatedTime = block.timestamp; game.roundId = _roundId; game.gameType = _gameType; game.betNum = _num; game.betValue = _value; game.balance = _balance; game.serverSeed = _serverSeed; game.userSeed = _userSeed; emit LogServerRequestedEnd(_userAddress, gameId); } else { revert("inv state"); } } /** * @dev End conflicting game without placed bets. * @param _game Game session data. * @param _gameId Game session id. * @param _userAddress User's address. */ function cancelActiveGame(Game storage _game, uint _gameId, address _userAddress) private { // user need to pay a fee when conflict ended. // this ensures a malicious, rich user can not just generate game sessions and then wait // for us to end the game session and then confirm the session status, so // we would have to pay a high gas fee without profit. int newBalance = -conflictRes.conflictEndFine(); // do not allow balance below user stake int stake = _game.stake; if (newBalance < -stake) { newBalance = -stake; } closeGame(_game, _gameId, 0, _userAddress, ReasonEnded.CONFLICT_ENDED, newBalance); } /** * @dev End conflicting game. * @param _game Game session data. * @param _gameId Game session id. * @param _userAddress User's address. */ function endGameConflict(Game storage _game, uint _gameId, address _userAddress) private { int newBalance = conflictRes.endGameConflict( _game.gameType, _game.betNum, _game.betValue, _game.balance, _game.stake, _game.serverSeed, _game.userSeed ); closeGame(_game, _gameId, _game.roundId, _userAddress, ReasonEnded.CONFLICT_ENDED, newBalance); } } contract GameChannel is GameChannelConflict { /** * @dev contract constructor * @param _serverAddress Server address. * @param _minStake Min value user needs to deposit to create game session. * @param _maxStake Max value user can deposit to create game session. * @param _conflictResAddress Conflict resolution contract address. * @param _houseAddress House address to move profit to. * @param _chainId Chain id for signature domain. */ constructor( address _serverAddress, uint128 _minStake, uint128 _maxStake, address _conflictResAddress, address _houseAddress, uint _chainId ) public GameChannelConflict(_serverAddress, _minStake, _maxStake, _conflictResAddress, _houseAddress, _chainId) { // nothing to do } /** * @notice Create games session request. msg.value needs to be valid stake value. * @param _userEndHash Last entry of users' hash chain. * @param _previousGameId User's previous game id, initial 0. * @param _createBefore Game can be only created before this timestamp. * @param _serverEndHash Last entry of server's hash chain. * @param _serverSig Server signature. See verifyCreateSig */ function createGame( bytes32 _userEndHash, uint _previousGameId, uint _createBefore, bytes32 _serverEndHash, bytes _serverSig ) public payable onlyValidValue onlyValidHouseStake(activeGames + 1) onlyNotPaused { uint previousGameId = userGameId[msg.sender]; Game storage game = gameIdGame[previousGameId]; require(game.status == GameStatus.ENDED, "prev game not ended"); require(previousGameId == _previousGameId, "inv gamePrevGameId"); require(block.timestamp < _createBefore, "expired"); verifyCreateSig(msg.sender, _previousGameId, _createBefore, _serverEndHash, _serverSig); uint gameId = gameIdCntr++; userGameId[msg.sender] = gameId; Game storage newGame = gameIdGame[gameId]; newGame.stake = uint128(msg.value); // It's safe to cast msg.value as it is limited, see onlyValidValue newGame.status = GameStatus.ACTIVE; activeGames = activeGames.add(1); // It's safe to cast msg.value as it is limited, see onlyValidValue emit LogGameCreated(msg.sender, gameId, uint128(msg.value), _serverEndHash, _userEndHash); } /** * @dev Regular end game session. Used if user and house have both * accepted current game session state. * The game session with gameId _gameId is closed * and the user paid out. This functions is called by the server after * the user requested the termination of the current game session. * @param _roundId Round id of bet. * @param _balance Current balance. * @param _serverHash Hash of server's seed for this bet. * @param _userHash Hash of user's seed for this bet. * @param _gameId Game session id. * @param _contractAddress Address of this contract. * @param _userAddress Address of user. * @param _userSig User's signature of this bet. */ function serverEndGame( uint32 _roundId, int _balance, bytes32 _serverHash, bytes32 _userHash, uint _gameId, address _contractAddress, address _userAddress, bytes _userSig ) public onlyServer { verifySig( _roundId, 0, 0, 0, _balance, _serverHash, _userHash, _gameId, _contractAddress, _userSig, _userAddress ); regularEndGame(_userAddress, _roundId, _balance, _gameId, _contractAddress); } /** * @notice Regular end game session. Normally not needed as server ends game (@see serverEndGame). * Can be used by user if server does not end game session. * @param _roundId Round id of bet. * @param _balance Current balance. * @param _serverHash Hash of server's seed for this bet. * @param _userHash Hash of user's seed for this bet. * @param _gameId Game session id. * @param _contractAddress Address of this contract. * @param _serverSig Server's signature of this bet. */ function userEndGame( uint32 _roundId, int _balance, bytes32 _serverHash, bytes32 _userHash, uint _gameId, address _contractAddress, bytes _serverSig ) public { verifySig( _roundId, 0, 0, 0, _balance, _serverHash, _userHash, _gameId, _contractAddress, _serverSig, serverAddress ); regularEndGame(msg.sender, _roundId, _balance, _gameId, _contractAddress); } /** * @dev Verify server signature. * @param _userAddress User's address. * @param _previousGameId User's previous game id, initial 0. * @param _createBefore Game can be only created before this timestamp. * @param _serverEndHash Last entry of server's hash chain. * @param _serverSig Server signature. */ function verifyCreateSig( address _userAddress, uint _previousGameId, uint _createBefore, bytes32 _serverEndHash, bytes _serverSig ) private view { address contractAddress = this; bytes32 hash = keccak256(abi.encodePacked( contractAddress, _userAddress, _previousGameId, _createBefore, _serverEndHash )); verify(hash, _serverSig, serverAddress); } /** * @dev Regular end game session implementation. Used if user and house have both * accepted current game session state. The game session with gameId _gameId is closed * and the user paid out. * @param _userAddress Address of user. * @param _balance Current balance. * @param _gameId Game session id. * @param _contractAddress Address of this contract. */ function regularEndGame( address _userAddress, uint32 _roundId, int _balance, uint _gameId, address _contractAddress ) private { uint gameId = userGameId[_userAddress]; Game storage game = gameIdGame[gameId]; int maxBalance = conflictRes.maxBalance(); int gameStake = game.stake; require(_gameId == gameId, "inv gameId"); require(_roundId > 0, "inv roundId"); // save to cast as game.stake hash fixed range require(-gameStake <= _balance && _balance <= maxBalance, "inv balance"); require(game.status == GameStatus.ACTIVE, "inv status"); assert(_contractAddress == address(this)); closeGame(game, gameId, _roundId, _userAddress, ReasonEnded.REGULAR_ENDED, _balance); } } library SafeCast { /** * Cast unsigned a to signed a. */ function castToInt(uint a) internal pure returns(int) { assert(a < (1 << 255)); return int(a); } /** * Cast signed a to unsigned a. */ function castToUint(int a) internal pure returns(uint) { assert(a >= 0); return uint(a); } } library SafeMath { /** * @dev Multiplies two unsigned integers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting '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; } c = a * b; assert(c / a == b); return c; } /** * @dev Multiplies two signed integers, throws on overflow. */ function mul(int256 a, int256 b) internal pure returns (int256) { // Gas optimization: this is cheaper than asserting '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; } int256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two unsigned integers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Integer division of two signed integers, truncating the quotient. */ function div(int256 a, int256 b) internal pure returns (int256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // Overflow only happens when the smallest negative int is multiplied by -1. int256 INT256_MIN = int256((uint256(1) << 255)); assert(a != INT256_MIN || b != - 1); return a / b; } /** * @dev Subtracts two unsigned integers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Subtracts two signed integers, throws on overflow. */ function sub(int256 a, int256 b) internal pure returns (int256) { int256 c = a - b; assert((b >= 0 && c <= a) || (b < 0 && c > a)); return c; } /** * @dev Adds two unsigned integers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } /** * @dev Adds two signed integers, throws on overflow. */ function add(int256 a, int256 b) internal pure returns (int256) { int256 c = a + b; assert((b >= 0 && c >= a) || (b < 0 && c < a)); return c; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":false,"inputs":[],"name":"activate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"activated","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MIN_TRANSFER_TIMESPAN","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"userGameId","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"pendingReturns","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_gameIdCntr","type":"uint256"}],"name":"setGameIdCntr","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"profitTransferTimeSpan","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minStake","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_roundId","type":"uint32"},{"name":"_balance","type":"int256"},{"name":"_serverHash","type":"bytes32"},{"name":"_userHash","type":"bytes32"},{"name":"_gameId","type":"uint256"},{"name":"_contractAddress","type":"address"},{"name":"_userAddress","type":"address"},{"name":"_userSig","type":"bytes"}],"name":"serverEndGame","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"lastProfitTransferTimestamp","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"claimOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"addHouseStake","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"MIN_TIMEOUT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"timePaused","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"conflictRes","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"TYPE_HASH","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"value","type":"uint256"}],"name":"withdrawHouseStake","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"destroy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"gameIdGame","outputs":[{"name":"status","type":"uint8"},{"name":"stake","type":"uint128"},{"name":"gameType","type":"uint8"},{"name":"roundId","type":"uint32"},{"name":"betNum","type":"uint256"},{"name":"betValue","type":"uint256"},{"name":"balance","type":"int256"},{"name":"userSeed","type":"bytes32"},{"name":"serverSeed","type":"bytes32"},{"name":"endInitiatedTime","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"withdrawAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_roundId","type":"uint32"},{"name":"_gameType","type":"uint8"},{"name":"_num","type":"uint256"},{"name":"_value","type":"uint256"},{"name":"_balance","type":"int256"},{"name":"_serverHash","type":"bytes32"},{"name":"_userHash","type":"bytes32"},{"name":"_gameId","type":"uint256"},{"name":"_contractAddress","type":"address"},{"name":"_serverSig","type":"bytes"},{"name":"_userSeed","type":"bytes32"}],"name":"userEndGameConflict","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"houseProfit","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_roundId","type":"uint32"},{"name":"_gameType","type":"uint8"},{"name":"_num","type":"uint256"},{"name":"_value","type":"uint256"},{"name":"_balance","type":"int256"},{"name":"_serverHash","type":"bytes32"},{"name":"_userHash","type":"bytes32"},{"name":"_gameId","type":"uint256"},{"name":"_contractAddress","type":"address"},{"name":"_userSig","type":"bytes"},{"name":"_userAddress","type":"address"},{"name":"_serverSeed","type":"bytes32"},{"name":"_userSeed","type":"bytes32"}],"name":"serverEndGameConflict","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"MAX_TRANSFER_TIMSPAN","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_gameId","type":"uint256"}],"name":"userCancelActiveGame","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_profitTransferTimeSpan","type":"uint256"}],"name":"setProfitTransferTimeSpan","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"activateConflictResolution","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"newConflictRes","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_userAddress","type":"address"},{"name":"_gameId","type":"uint256"}],"name":"serverCancelActiveGame","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_userEndHash","type":"bytes32"},{"name":"_previousGameId","type":"uint256"},{"name":"_createBefore","type":"uint256"},{"name":"_serverEndHash","type":"bytes32"},{"name":"_serverSig","type":"bytes"}],"name":"createGame","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_gameId","type":"uint256"}],"name":"userForceGameEnd","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"TIMEOUT_DESTROY","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"houseStake","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newConflictResAddress","type":"address"}],"name":"updateConflictResolution","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_userAddress","type":"address"},{"name":"_gameId","type":"uint256"}],"name":"serverForceGameEnd","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_minStake","type":"uint128"},{"name":"_maxStake","type":"uint128"}],"name":"setStakeRequirements","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"houseAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"serverAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"updateTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_TIMEOUT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"activeGames","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_roundId","type":"uint32"},{"name":"_balance","type":"int256"},{"name":"_serverHash","type":"bytes32"},{"name":"_userHash","type":"bytes32"},{"name":"_gameId","type":"uint256"},{"name":"_contractAddress","type":"address"},{"name":"_serverSig","type":"bytes"}],"name":"userEndGame","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"maxStake","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_houseAddress","type":"address"}],"name":"setHouseAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"gameIdCntr","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"transferProfitToHouse","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_serverAddress","type":"address"},{"name":"_minStake","type":"uint128"},{"name":"_maxStake","type":"uint128"},{"name":"_conflictResAddress","type":"address"},{"name":"_houseAddress","type":"address"},{"name":"_chainId","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"user","type":"address"},{"indexed":true,"name":"gameId","type":"uint256"},{"indexed":false,"name":"stake","type":"uint128"},{"indexed":true,"name":"serverEndHash","type":"bytes32"},{"indexed":false,"name":"userEndHash","type":"bytes32"}],"name":"LogGameCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"user","type":"address"},{"indexed":true,"name":"gameId","type":"uint256"}],"name":"LogUserRequestedEnd","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"user","type":"address"},{"indexed":true,"name":"gameId","type":"uint256"}],"name":"LogServerRequestedEnd","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"user","type":"address"},{"indexed":true,"name":"gameId","type":"uint256"},{"indexed":false,"name":"roundId","type":"uint32"},{"indexed":false,"name":"balance","type":"int256"},{"indexed":false,"name":"reason","type":"uint8"}],"name":"LogGameEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"minStake","type":"uint256"},{"indexed":false,"name":"maxStake","type":"uint256"}],"name":"LogStakeLimitsModified","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newConflictResolutionAddress","type":"address"}],"name":"LogUpdatingConflictResolution","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newConflictResolutionAddress","type":"address"}],"name":"LogUpdatedConflictResolution","type":"event"},{"anonymous":false,"inputs":[],"name":"LogPause","type":"event"},{"anonymous":false,"inputs":[],"name":"LogUnpause","type":"event"},{"anonymous":false,"inputs":[],"name":"LogActive","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"LogOwnerShipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"LogOwnerShipTransferInitiated","type":"event"}]
Contract Creation Code
60806040526001805460a060020a61ffff02191675010000000000000000000000000000000000000000001781554260025560048054600160a060020a0319169055600060058190556006819055600791909155600a819055600b5562127500600d5534801561006e57600080fd5b5060405160c08062003dff83398101604090815281516020830151918301516060840151608085015160a0909501516000805433600160a060020a0319918216178255600180548216905560038054909116600160a060020a038516179055939592939192918690869086908690869086908690869086908690869086906001608060020a0386161180156101155750836001608060020a0316856001608060020a031611155b151561012057600080fd5b5060088054600160a060020a03968716600160a060020a031991821617909155600980549290961691161790935542600e55600c80546001608060020a03928316700100000000000000000000000000000000029383166001608060020a03199091161790911691909117905550505050505050505050505050613c5580620001aa6000396000f3006080604052600436106102635763ffffffff60e060020a6000350416630f15f4c08114610268578063186601ca1461027f57806319fc36ed146102a85780631b08345a146102cf57806326b387bb146102f0578063287e9fbc146103115780632c94a23514610329578063375b3c0a1461033e5780633ccfd60b1461036f5780633f4ba83a14610384578063410453ae1461039957806341b80184146104245780634e71e0c8146104395780634f739ff01461044e578063543ad1df14610456578063563c23a01461046b5780635ba2dd22146104805780635c975abb146104b157806364d4c819146104c657806381efc01d146104db57806383197ef0146104f357806383e256dc146105085780638456cb5914610599578063853828b6146105ae578063878de0ae146105c357806388fedd04146106585780638da5cb5b1461066d5780639399dd7e14610682578063947bc72d1461072a5780639b29f1331461073f5780639c0051db146107575780639f34ce141461076f578063a09f865914610784578063a8182cd314610799578063afc81953146107bd578063b064ca181461081b578063bd5c4e2414610833578063c861f3a014610848578063cbffb1ae1461085d578063d1e9dcbf1461087e578063d6e5fe98146108a2578063d7cee31e146108c9578063db420fe3146108de578063dc555090146108f3578063de38eb3a14610908578063e30c39781461091d578063e475222e14610932578063e60a33aa14610947578063ea1b28e0146109ca578063ef3aaf54146109df578063f2fde38b14610a00578063f87ffb7414610a21578063fd306ca714610a36575b600080fd5b34801561027457600080fd5b5061027d610a4b565b005b34801561028b57600080fd5b50610294610ac8565b604080519115158252519081900360200190f35b3480156102b457600080fd5b506102bd610ad8565b60408051918252519081900360200190f35b3480156102db57600080fd5b506102bd600160a060020a0360043516610adf565b3480156102fc57600080fd5b506102bd600160a060020a0360043516610af1565b34801561031d57600080fd5b5061027d600435610b03565b34801561033557600080fd5b506102bd610b45565b34801561034a57600080fd5b50610353610b4b565b604080516001608060020a039092168252519081900360200190f35b34801561037b57600080fd5b5061027d610b5a565b34801561039057600080fd5b5061027d610bb5565b3480156103a557600080fd5b50604080516020600460e43581810135601f810184900484028501840190955284845261027d94823563ffffffff1694602480359560443595606435956084359560a435600160a060020a039081169660c43590911695369561010494929391909201918190840183828082843750949750610c4b9650505050505050565b34801561043057600080fd5b506102bd610c8e565b34801561044557600080fd5b5061027d610c94565b61027d610d12565b34801561046257600080fd5b506102bd610d41565b34801561047757600080fd5b506102bd610d48565b34801561048c57600080fd5b50610495610d4e565b60408051600160a060020a039092168252519081900360200190f35b3480156104bd57600080fd5b50610294610d5d565b3480156104d257600080fd5b506102bd610d6d565b3480156104e757600080fd5b5061027d600435610f3b565b3480156104ff57600080fd5b5061027d6110a9565b34801561051457600080fd5b5061052060043561110a565b604051808b600381111561053057fe5b60ff90811682526001608060020a03909b166020820152989099166040808a019190915263ffffffff9097166060890152608088019590955260a087019390935260c086019190915260e085015261010084015261012083015251908190036101400192509050f35b3480156105a557600080fd5b5061027d61117f565b3480156105ba57600080fd5b5061027d61124c565b3480156105cf57600080fd5b50604080516020601f6101243560048181013592830184900484028501840190955281845261027d9463ffffffff8135169460ff60248035919091169560443595606435956084359560a4359560c4359560e43595600160a060020a03610104351695369561014494930191819084018382808284375094975050933594506112e79350505050565b34801561066457600080fd5b506102bd61132d565b34801561067957600080fd5b50610495611333565b34801561068e57600080fd5b50604080516020601f6101243560048181013592830184900484028501840190955281845261027d9463ffffffff8135169460ff60248035919091169560443595606435956084359560a4359560c4359560e43595600160a060020a03610104351695369561014494930191819084018382808284375094975050508335600160a060020a031694505050602082013591604001359050611342565b34801561073657600080fd5b506102bd61138e565b34801561074b57600080fd5b5061027d600435611395565b34801561076357600080fd5b5061027d600435611494565b34801561077b57600080fd5b5061027d6114d3565b34801561079057600080fd5b506104956115a5565b3480156107a557600080fd5b5061027d600160a060020a03600435166024356115b4565b604080516020601f60843560048181013592830184900484028501840190955281845261027d948035946024803595604435956064359536959460a49490939101919081908401838280828437509497506116d49650505050505050565b34801561082757600080fd5b5061027d600435611ad0565b34801561083f57600080fd5b506102bd611cb7565b34801561085457600080fd5b506102bd611cbe565b34801561086957600080fd5b5061027d600160a060020a0360043516611cc4565b34801561088a57600080fd5b5061027d600160a060020a0360043516602435611d40565b3480156108ae57600080fd5b5061027d6001608060020a0360043581169060243516611f4b565b3480156108d557600080fd5b50610495612025565b3480156108ea57600080fd5b50610495612034565b3480156108ff57600080fd5b506102bd612043565b34801561091457600080fd5b506102bd612049565b34801561092957600080fd5b50610495612050565b34801561093e57600080fd5b506102bd61205f565b34801561095357600080fd5b50604080516020601f60c43560048181013592830184900484028501840190955281845261027d9463ffffffff813516946024803595604435956064359560843595600160a060020a0360a43516953695919460e49491939092019181908401838280828437509497506120659650505050505050565b3480156109d657600080fd5b506103536120a5565b3480156109eb57600080fd5b5061027d600160a060020a03600435166120c8565b348015610a0c57600080fd5b5061027d600160a060020a036004351661210e565b348015610a2d57600080fd5b506102bd612183565b348015610a4257600080fd5b5061027d612189565b600054600160a060020a03163314610a6257600080fd5b60015460a060020a900460ff1615610a7957600080fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fc9d6bebde85c4e3348468c6af2cb34f978d1a8c6eebc438f1361c1ad5edf5f0e90600090a1565b60015460a060020a900460ff1681565b6201518081565b60106020526000908152604090205481565b60116020526000908152604090205481565b600054600160a060020a03163314610b1a57600080fd5b60015460a060020a900460ff1615610b3157600080fd5b600754600010610b4057600080fd5b600755565b600d5481565b600c546001608060020a031681565b33600090815260116020526040812054908111610b7657600080fd5b336000818152601160205260408082208290555183156108fc0291849190818181858888f19350505050158015610bb1573d6000803e3d6000fd5b5050565b600054600160a060020a03163314610bcc57600080fd5b60015460a860020a900460ff161515610be457600080fd5b60015460a060020a900460ff161515610bfc57600080fd5b6001805475ff00000000000000000000000000000000000000000019169055600060028190556040517f730c1faaa977b67dacf1e2451ef54556e04a07d577785ff79f6d31f73502efc99190a1565b600854600160a060020a03163314610c6257600080fd5b610c778860008060008b8b8b8b8b8a8c612227565b610c8482898987876122a7565b5050505050505050565b600e5481565b600154600160a060020a03163314610cab57600080fd5b6001805460008054600160a060020a0380841673ffffffffffffffffffffffffffffffffffffffff1992831617808455919093169093556040519092909116907f897d3c8bbea11029ba3b26eb993fe8edb14c2c4c0d2ecceccce41d1d83d3e359908390a3565b600054600160a060020a03163314610d2957600080fd5b600a54610d3c903463ffffffff61250816565b600a55565b6203f48081565b60025481565b600354600160a060020a031681565b60015460a860020a900460ff1681565b604080517f75696e74333220526f756e6420496400000000000000000000000000000000006020808301919091527f75696e74382047616d6520547970650000000000000000000000000000000000602f8301527f75696e743136204e756d62657200000000000000000000000000000000000000603e8301527f75696e742056616c756520285765692900000000000000000000000000000000604b8301527f696e742043757272656e742042616c616e636520285765692900000000000000605b8301527f627974657333322053657276657220486173680000000000000000000000000060748301527f6279746573333220506c6179657220486173680000000000000000000000000060878301527f75696e742047616d652049640000000000000000000000000000000000000000609a8301527f6164647265737320436f6e74726163742041646472657373000000000000000060a68301528251609e81840301815260be90920192839052815191929182918401908083835b60208310610f0b5780518252601f199092019160209182019101610eec565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902081565b60008054600160a060020a03163314610f5357600080fd5b600354600654604080517f73c4726b000000000000000000000000000000000000000000000000000000008152600481019290925251600160a060020a03909216916373c4726b916024808201926020929091908290030181600087803b158015610fbd57600080fd5b505af1158015610fd1573d6000803e3d6000fd5b505050506040513d6020811015610fe757600080fd5b5051600a5490915082118015906110115750600a54819061100e908463ffffffff61251b16565b10155b151561101c57600080fd5b6000600b5413158061104a5750600a5461103c908363ffffffff61251b16565b611047600b5461252d565b11155b151561105557600080fd5b600a54611068908363ffffffff61251b16565b600a5560008054604051600160a060020a039091169184156108fc02918591818181858888f193505050501580156110a4573d6000803e3d6000fd5b505050565b600054600160a060020a031633146110c057600080fd5b600154621a5e009060a860020a900460ff1680156110f1575060025442906110ee908363ffffffff61250816565b11155b15156110fc57600080fd5b600054600160a060020a0316ff5b600f60205260009081526040902080546001820154600283015460038401546004850154600586015460069096015460ff8087169761010088046001608060020a03169771010000000000000000000000000000000000810490921696609060020a90920463ffffffff16959194919391928a565b600054600160a060020a0316331461119657600080fd5b60015460a860020a900460ff16156111f8576040805160e560020a62461bcd02815260206004820152600660248201527f7061757365640000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6001805475ff000000000000000000000000000000000000000000191660a860020a179055426002556040517f4b314b34e912fda7f95e7d23e9c8c95f82f0aff1984e4ce592a0b005f905562490600090a1565b60008054600160a060020a0316331461126457600080fd5b6001546203f4809060a860020a900460ff16801561129557506002544290611292908363ffffffff61250816565b11155b15156112a057600080fd5b6000600b819055600a8054908290558154604051919450600160a060020a03169184156108fc02918591818181858888f193505050501580156110a4573d6000803e3d6000fd5b61130f8b8b8b8b8b8b8b8b8b8b600860009054906101000a9004600160a060020a0316612227565b6113208b8b8b8b8b8a878b3361253d565b5050505050505050505050565b600b5481565b600054600160a060020a031681565b600854600160a060020a0316331461135957600080fd5b61136c8d8d8d8d8d8d8d8d8d8d8d612227565b61137f8d8d8d8d8d8d8d89898f8d612b0f565b50505050505050505050505050565b62ed4e0081565b33600081815260106020908152604080832054808452600f9092529091208382146113f8576040805160e560020a62461bcd02815260206004820152600a6024820152600080516020613c0a833981519152604482015290519081900360640190fd5b6001815460ff16600381111561140a57fe5b141561145357426006820155805460ff19166002178155604051829033907f9b60ba122ac2e613ae737820a8eb2d8c28356ff6b03d569dacb7ce2bcdc86fed90600090a361148e565b6003815460ff16600381111561146557fe5b14801561147e57508054609060020a900463ffffffff16155b156102635761148e81838561317d565b50505050565b600054600160a060020a031633146114ab57600080fd5b806201518081101580156114c2575062ed4e008111155b15156114cd57600080fd5b50600d55565b600054600160a060020a031633146114ea57600080fd5b600454600160a060020a0316151561150157600080fd5b600554151561150f57600080fd5b426203f480600554011115801561152d57506207e900600554014211155b151561153857600080fd5b600480546003805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a038416179091551690556000600581905560408051918252517f28de3c2df3d09a8b061f86cd0c78b7d02f1f5caffcd086ff45ee12a4a51056c89181900360200190a1565b600454600160a060020a031681565b6008546000908190600160a060020a031633146115d057600080fd5b5050600160a060020a038216600090815260106020908152604080832054808452600f90925290912082821461163e576040805160e560020a62461bcd02815260206004820152600a6024820152600080516020613c0a833981519152604482015290519081900360640190fd5b6001815460ff16600381111561165057fe5b141561169957426006820155805460ff19166003178155604051829033907fdbbc392d5391708a9def7f560f8cbdef92e1bb37e5104831e78feda1488b7ab090600090a361148e565b6002815460ff1660038111156116ab57fe5b1480156116c457508054609060020a900463ffffffff16155b156102635761148e81838661317d565b600c54600090819081908190346001608060020a03909116118015906117195750600c5470010000000000000000000000000000000090046001608060020a03163411155b151561176f576040805160e560020a62461bcd02815260206004820152600960248201527f696e76207374616b650000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600654600354604080517f73c4726b00000000000000000000000000000000000000000000000000000000815260019093016004840181905290519092600092600160a060020a0316916373c4726b9160248082019260209290919082900301818787803b1580156117e057600080fd5b505af11580156117f4573d6000803e3d6000fd5b505050506040513d602081101561180a57600080fd5b5051600a54909150811115611869576040805160e560020a62461bcd02815260206004820152600e60248201527f696e7620686f7573655374616b65000000000000000000000000000000000000604482015290519081900360640190fd5b60015460a860020a900460ff16156118cb576040805160e560020a62461bcd02815260206004820152600660248201527f7061757365640000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b33600090815260106020908152604080832054808452600f90925282209097509550855460ff1660038111156118fd57fe5b14611952576040805160e560020a62461bcd02815260206004820152601360248201527f707265762067616d65206e6f7420656e64656400000000000000000000000000604482015290519081900360640190fd5b858a146119a9576040805160e560020a62461bcd02815260206004820152601260248201527f696e762067616d655072657647616d6549640000000000000000000000000000604482015290519081900360640190fd5b428911611a00576040805160e560020a62461bcd02815260206004820152600760248201527f6578706972656400000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b611a0d338b8b8b8b613239565b600780546001808201909255336000908152601060209081526040808320849055838352600f9091529020805470ffffffffffffffffffffffffffffffff001916610100346001608060020a0316021760ff1916831781556006549196509450611a7691612508565b600655604080516001608060020a0334168152602081018d905281518a92879233927fd25faca801440882fa5d7c7f70b072a2ad89621e277ee0b6f9923ccac48411b1929181900390910190a45050505050505050505050565b33600081815260106020908152604080832054808452600f90925282209091848314611b34576040805160e560020a62461bcd02815260206004820152600a6024820152600080516020613c0a833981519152604482015290519081900360640190fd5b6002825460ff166003811115611b4657fe5b14611b9b576040805160e560020a62461bcd02815260206004820152600a60248201527f696e762073746174757300000000000000000000000000000000000000000000604482015290519081900360640190fd5b60038054835460018501546002860154938601546006870154604080517f0c5ebb1a00000000000000000000000000000000000000000000000000000000815271010000000000000000000000000000000000860460ff1660048201526024810194909452604484019690965260648301919091526101009092046001608060020a0316608482015260a48101919091529151600160a060020a0390911691630c5ebb1a9160c48083019260209291908290030181600087803b158015611c6157600080fd5b505af1158015611c75573d6000803e3d6000fd5b505050506040513d6020811015611c8b57600080fd5b50518254909150611cb09083908590609060020a900463ffffffff168760028661330d565b5050505050565b621a5e0081565b600a5481565b600054600160a060020a03163314611cdb57600080fd5b60048054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911681179091554260055560408051918252517f97044e884f04922f1959ef2de012f4734423df2d4da57fd4c5eaf40cd63b525f9181900360200190a150565b60085460009081908190600160a060020a03163314611d5e57600080fd5b600160a060020a038516600090815260106020908152604080832054808452600f9092529091209093509150838314611dcf576040805160e560020a62461bcd02815260206004820152600a6024820152600080516020613c0a833981519152604482015290519081900360640190fd5b6003825460ff166003811115611de157fe5b14611e36576040805160e560020a62461bcd02815260206004820152600a60248201527f696e762073746174757300000000000000000000000000000000000000000000604482015290519081900360640190fd5b60038054835460018501546002860154938601546006870154604080517f834d42c600000000000000000000000000000000000000000000000000000000815271010000000000000000000000000000000000860460ff1660048201526024810194909452604484019690965260648301919091526101009092046001608060020a0316608482015260a48101919091529151600160a060020a039091169163834d42c69160c48083019260209291908290030181600087803b158015611efc57600080fd5b505af1158015611f10573d6000803e3d6000fd5b505050506040513d6020811015611f2657600080fd5b50518254909150611cb09083908590609060020a900463ffffffff168860018661330d565b600054600160a060020a03163314611f6257600080fd5b6000826001608060020a0316118015611f8d5750806001608060020a0316826001608060020a031611155b1515611f9857600080fd5b600c80546fffffffffffffffffffffffffffffffff19166001608060020a038481169190911781167001000000000000000000000000000000008483168102919091179283905560408051848416815291909304909116602082015281517f1ec948cac143dba0e555a87dd86ae387e2ecd4a8fee80f7dd324d5987cb3e7f8929181900390910190a15050565b600954600160a060020a031681565b600854600160a060020a031681565b60055481565b6207e90081565b600154600160a060020a031681565b60065481565b61208f8760008060008a8a8a8a8a8a600860009054906101000a9004600160a060020a0316612227565b61209c33888886866122a7565b50505050505050565b600c5470010000000000000000000000000000000090046001608060020a031681565b600054600160a060020a031633146120df57600080fd5b6009805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461212557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383811691821790925560008054604051929316917f83ada3430836f9d4bd6f7bc690ffbba5199cb19b37393dd64c229930213535969190a350565b60075481565b6000426121a3600d54600e5461250890919063ffffffff16565b11156121ae57600080fd5b42600e55600b546000126121c157612224565b6121cc600b5461252d565b6000600b55600a549091506121e7908263ffffffff61251b16565b600a55600954604051600160a060020a039091169082156108fc029083906000818181858888f19350505050158015610bb1573d6000803e3d6000fd5b50565b306000600160a060020a038516821461228a576040805160e560020a62461bcd02815260206004820152601360248201527f696e7620636f6e74726163744164647265737300000000000000000000000000604482015290519081900360640190fd5b61229a8d8d8d8d8d8d8d8d6133b6565b905061137f818585613714565b600160a060020a03808616600090815260106020908152604080832054808452600f835281842060035483517f73ad468a00000000000000000000000000000000000000000000000000000000815293519296919594859491909216926373ad468a9260048084019391929182900301818787803b15801561232857600080fd5b505af115801561233c573d6000803e3d6000fd5b505050506040513d602081101561235257600080fd5b5051835490925061010090046001608060020a031690508386146123ae576040805160e560020a62461bcd02815260206004820152600a6024820152600080516020613c0a833981519152604482015290519081900360640190fd5b600063ffffffff89161161240c576040805160e560020a62461bcd02815260206004820152600b60248201527f696e7620726f756e644964000000000000000000000000000000000000000000604482015290519081900360640190fd5b86816000031315801561241f5750818713155b1515612475576040805160e560020a62461bcd02815260206004820152600b60248201527f696e762062616c616e6365000000000000000000000000000000000000000000604482015290519081900360640190fd5b6001835460ff16600381111561248757fe5b146124dc576040805160e560020a62461bcd02815260206004820152600a60248201527f696e762073746174757300000000000000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a03851630146124ee57fe5b6124fd83858a8c60008c61330d565b505050505050505050565b8181018281101561251557fe5b92915050565b60008282111561252757fe5b50900390565b60008082121561253957fe5b5090565b600160a060020a03808216600090815260106020908152604080832054808452600f835281842060035483517f73ad468a00000000000000000000000000000000000000000000000000000000815293519296919594859491909216926373ad468a9260048084019391929182900301818787803b1580156125be57600080fd5b505af11580156125d2573d6000803e3d6000fd5b505050506040513d60208110156125e857600080fd5b5051835490925061010090046001608060020a03169050858414612644576040805160e560020a62461bcd02815260206004820152600a6024820152600080516020613c0a833981519152604482015290519081900360640190fd5b600063ffffffff8e16116126a2576040805160e560020a62461bcd02815260206004820152600b60248201527f696e7620726f756e644964000000000000000000000000000000000000000000604482015290519081900360640190fd5b6040805160208082018a90528251808303820181529183019283905281518b93918291908401908083835b602083106126ec5780518252601f1990920191602091820191016126cd565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141515612774576040805160e560020a62461bcd02815260206004820152600c60248201527f696e762075736572536565640000000000000000000000000000000000000000604482015290519081900360640190fd5b8881600003131580156127875750818913155b15156127dd576040805160e560020a62461bcd02815260206004820152600b60248201527f696e762062616c616e6365000000000000000000000000000000000000000000604482015290519081900360640190fd5b600354604080517f09eecdd700000000000000000000000000000000000000000000000000000000815260ff8f166004820152602481018e9052604481018d90529051600160a060020a03909216916309eecdd7916064808201926020929091908290030181600087803b15801561285457600080fd5b505af1158015612868573d6000803e3d6000fd5b505050506040513d602081101561287e57600080fd5b505115156128d6576040805160e560020a62461bcd02815260206004820152600760248201527f696e762062657400000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60006129006128e48c6137f6565b6128f4848d63ffffffff61382116565b9063ffffffff61385a16565b1215612956576040805160e560020a62461bcd02815260206004820152600e60248201527f76616c756520746f6f2068696768000000000000000000000000000000000000604482015290519081900360640190fd5b6003835460ff16600381111561296857fe5b1480156129855750825463ffffffff8e8116609060020a90920416145b156129a1576004830187905561299c838587613889565b61137f565b6001835460ff1660038111156129b357fe5b14806129e957506003835460ff1660038111156129cc57fe5b1480156129e95750825463ffffffff808f16609060020a90920416105b15612abf578254600290849060ff191660018302179055504283600601819055508c8360000160126101000a81548163ffffffff021916908363ffffffff1602179055508b8360000160116101000a81548160ff021916908360ff1602179055508a83600101819055508983600201819055508883600301819055508683600401816000191690555060006001028360050181600019169055508333600160a060020a03167f9b60ba122ac2e613ae737820a8eb2d8c28356ff6b03d569dacb7ce2bcdc86fed60405160405180910390a361137f565b6040805160e560020a62461bcd02815260206004820152600960248201527f696e762073746174650000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a03808216600090815260106020908152604080832054808452600f835281842060035483517f73ad468a00000000000000000000000000000000000000000000000000000000815293519296919594859491909216926373ad468a9260048084019391929182900301818787803b158015612b9057600080fd5b505af1158015612ba4573d6000803e3d6000fd5b505050506040513d6020811015612bba57600080fd5b5051835490925061010090046001608060020a03169050858414612c16576040805160e560020a62461bcd02815260206004820152600a6024820152600080516020613c0a833981519152604482015290519081900360640190fd5b60008f63ffffffff16111515612c76576040805160e560020a62461bcd02815260206004820152600b60248201527f696e7620726f756e644964000000000000000000000000000000000000000000604482015290519081900360640190fd5b6040805160208082018b90528251808303820181529183019283905281518d93918291908401908083835b60208310612cc05780518252601f199092019160209182019101612ca1565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141515612d48576040805160e560020a62461bcd02815260206004820152600e60248201527f696e762073657276657253656564000000000000000000000000000000000000604482015290519081900360640190fd5b6040805160208082018a90528251808303820181529183019283905281518c93918291908401908083835b60208310612d925780518252601f199092019160209182019101612d73565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141515612e1a576040805160e560020a62461bcd02815260206004820152600c60248201527f696e762075736572536565640000000000000000000000000000000000000000604482015290519081900360640190fd5b8a8160000313158015612e2d5750818b13155b1515612e83576040805160e560020a62461bcd02815260206004820152600b60248201527f696e762062616c616e6365000000000000000000000000000000000000000000604482015290519081900360640190fd5b600360009054906101000a9004600160a060020a0316600160a060020a03166309eecdd78f8f8f6040518463ffffffff1660e060020a028152600401808460ff1660ff1681526020018381526020018281526020019350505050602060405180830381600087803b158015612ef757600080fd5b505af1158015612f0b573d6000803e3d6000fd5b505050506040513d6020811015612f2157600080fd5b50511515612f79576040805160e560020a62461bcd02815260206004820152600760248201527f696e762062657400000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000612f97612f878e6137f6565b6128f4848f63ffffffff61382116565b1215612fed576040805160e560020a62461bcd02815260206004820152600e60248201527f746f6f20686967682076616c7565000000000000000000000000000000000000604482015290519081900360640190fd5b6002835460ff166003811115612fff57fe5b14801561302b57508e63ffffffff168360000160129054906101000a900463ffffffff1663ffffffff16145b156130475760058301889055613042838587613889565b61316c565b6001835460ff16600381111561305957fe5b148061309e57506002835460ff16600381111561307257fe5b14801561309e57508e63ffffffff168360000160129054906101000a900463ffffffff1663ffffffff16105b15612abf578254600390849060ff191660018302179055504283600601819055508e8360000160126101000a81548163ffffffff021916908363ffffffff1602179055508d8360000160116101000a81548160ff021916908360ff1602179055508c83600101819055508b83600201819055508a836003018190555087836005018160001916905550868360040181600019169055508385600160a060020a03167fdbbc392d5391708a9def7f560f8cbdef92e1bb37e5104831e78feda1488b7ab060405160405180910390a35b505050505050505050505050505050565b600080600360009054906101000a9004600160a060020a0316600160a060020a031663fcec617a6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156131d357600080fd5b505af11580156131e7573d6000803e3d6000fd5b505050506040513d60208110156131fd57600080fd5b505185546000918203935061010090046001608060020a03169150819003821215613229578060000391505b611cb0858560008660038761330d565b604080516c0100000000000000000000000030818102602080850191909152600160a060020a038a169092026034840152604883018890526068830187905260888084018790528451808503909101815260a8909301938490528251909360009392909182918401908083835b602083106132c55780518252601f1990920191602091820191016132a6565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912060085490945061209c9350849250869150600160a060020a0316613714565b855460ff1916865560065461332390600161251b565b600655855461334290849061010090046001608060020a0316836139b0565b8483600160a060020a03167f59ba0efd7d5a5d7e109fb346b50365a8d68661fc7c2c311cd29750707e1b8de5868486604051808463ffffffff1663ffffffff16815260200183815260200182600381111561339957fe5b60ff168152602001935050505060405180910390a3505050505050565b6040805160e060020a63ffffffff8b16026020808301919091527f010000000000000000000000000000000000000000000000000000000000000060ff8b160260248301527e0100000000000000000000000000000000000000000000000000000000000061ffff8a160260258301526027820188905260478201879052606782018690526087820185905260a782018490526c01000000000000000000000000300260c7830152825160bb81840301815260db909201928390528151600093849392909182918401908083835b602083106134a35780518252601f199092019160209182019101613484565b51815160209384036101000a6000190180199092169116179052604080519290940182900382207f75696e74333220526f756e642049640000000000000000000000000000000000838301527f75696e74382047616d6520547970650000000000000000000000000000000000602f8401527f75696e743136204e756d62657200000000000000000000000000000000000000603e8401527f75696e742056616c756520285765692900000000000000000000000000000000604b8401527f696e742043757272656e742042616c616e636520285765692900000000000000605b8401527f627974657333322053657276657220486173680000000000000000000000000060748401527f6279746573333220506c6179657220486173680000000000000000000000000060878401527f75696e742047616d652049640000000000000000000000000000000000000000609a8401527f6164647265737320436f6e74726163742041646472657373000000000000000060a68401528451808403609e01815260be9093019485905282519097509195509293508392850191508083835b602083106136665780518252601f199092019160209182019101613647565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208282015281840187905283518083038501815260609092019384905281519195509293508392850191508083835b602083106136da5780518252601f1990920191602091820191016136bb565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209d9c50505050505050505050505050565b60008060008061372386613b07565b60408051600080825260208083018085528e905260ff8516838501526060830187905260808301869052925195995093975091955060019360a0808401949293601f19830193908390039091019190865af1158015613786573d6000803e3d6000fd5b5050604051601f190151915050600160a060020a038082169086161461209c576040805160e560020a62461bcd02815260206004820152600760248201527f696e762073696700000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60007f8000000000000000000000000000000000000000000000000000000000000000821061253957fe5b60008282018183128015906138365750838112155b8061384b575060008312801561384b57508381125b151561385357fe5b9392505050565b600081830381831280159061386f5750838113155b8061384b575060008312801561384b575083811361385357fe5b600380548454600186015460028701549387015460058801546004808a0154604080517f2a0763ce00000000000000000000000000000000000000000000000000000000815271010000000000000000000000000000000000880460ff16938101939093526024830195909552604482019790975260648101929092526101009093046001608060020a0316608482015260a481019290925260c48201939093529151600092600160a060020a0390921691632a0763ce9160e480830192602092919082900301818787803b15801561396157600080fd5b505af1158015613975573d6000803e3d6000fd5b505050506040513d602081101561398b57600080fd5b5051845490915061148e9085908590609060020a900463ffffffff168560038661330d565b600080600080856001608060020a031693506139cd600a546137f6565b9250600360009054906101000a9004600160a060020a0316600160a060020a03166373ad468a6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015613a2257600080fd5b505af1158015613a36573d6000803e3d6000fd5b505050506040513d6020811015613a4c57600080fd5b5051851315613a5757fe5b6000613a69858763ffffffff61382116565b1215613a7157fe5b600085138015613a8057508483125b15613a89578294505b600b54613a9c908663ffffffff61385a16565b600b55613aaf838663ffffffff61385a16565b9150613aba8261252d565b600a55613ad5613ad0858763ffffffff61382116565b61252d565b600160a060020a03881660009081526011602052604081208054830190819055919250101561209c5761209c87613b90565b600080600083516041141515613b67576040805160e560020a62461bcd02815260206004820152600760248201527f696e762073696700000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b50505060208101516040820151604183015160ff166002811015613b8957601b015b9193909250565b600160a060020a038116600090815260116020526040812054908111613bb257fe5b600160a060020a0382166000818152601160205260408082208290555183156108fc0291849190818181858888f115159350610bb19250505057600160a060020a03919091166000908152601160205260409020555600696e762067616d65496400000000000000000000000000000000000000000000a165627a7a72305820b3dbad1191c96a0c71843eb8e1cc3885d622456b6fccd11d0cf9b27f6d51f7000029000000000000000000000000cef260a5fed7a896bbe07b933b3a5c17aec094d8000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000e077c00badec88e309a6f50ad1092a7cc4edd88100000000000000000000000071be1ace87248f3950bdfc4c89b4b3eed059f6f30000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x6080604052600436106102635763ffffffff60e060020a6000350416630f15f4c08114610268578063186601ca1461027f57806319fc36ed146102a85780631b08345a146102cf57806326b387bb146102f0578063287e9fbc146103115780632c94a23514610329578063375b3c0a1461033e5780633ccfd60b1461036f5780633f4ba83a14610384578063410453ae1461039957806341b80184146104245780634e71e0c8146104395780634f739ff01461044e578063543ad1df14610456578063563c23a01461046b5780635ba2dd22146104805780635c975abb146104b157806364d4c819146104c657806381efc01d146104db57806383197ef0146104f357806383e256dc146105085780638456cb5914610599578063853828b6146105ae578063878de0ae146105c357806388fedd04146106585780638da5cb5b1461066d5780639399dd7e14610682578063947bc72d1461072a5780639b29f1331461073f5780639c0051db146107575780639f34ce141461076f578063a09f865914610784578063a8182cd314610799578063afc81953146107bd578063b064ca181461081b578063bd5c4e2414610833578063c861f3a014610848578063cbffb1ae1461085d578063d1e9dcbf1461087e578063d6e5fe98146108a2578063d7cee31e146108c9578063db420fe3146108de578063dc555090146108f3578063de38eb3a14610908578063e30c39781461091d578063e475222e14610932578063e60a33aa14610947578063ea1b28e0146109ca578063ef3aaf54146109df578063f2fde38b14610a00578063f87ffb7414610a21578063fd306ca714610a36575b600080fd5b34801561027457600080fd5b5061027d610a4b565b005b34801561028b57600080fd5b50610294610ac8565b604080519115158252519081900360200190f35b3480156102b457600080fd5b506102bd610ad8565b60408051918252519081900360200190f35b3480156102db57600080fd5b506102bd600160a060020a0360043516610adf565b3480156102fc57600080fd5b506102bd600160a060020a0360043516610af1565b34801561031d57600080fd5b5061027d600435610b03565b34801561033557600080fd5b506102bd610b45565b34801561034a57600080fd5b50610353610b4b565b604080516001608060020a039092168252519081900360200190f35b34801561037b57600080fd5b5061027d610b5a565b34801561039057600080fd5b5061027d610bb5565b3480156103a557600080fd5b50604080516020600460e43581810135601f810184900484028501840190955284845261027d94823563ffffffff1694602480359560443595606435956084359560a435600160a060020a039081169660c43590911695369561010494929391909201918190840183828082843750949750610c4b9650505050505050565b34801561043057600080fd5b506102bd610c8e565b34801561044557600080fd5b5061027d610c94565b61027d610d12565b34801561046257600080fd5b506102bd610d41565b34801561047757600080fd5b506102bd610d48565b34801561048c57600080fd5b50610495610d4e565b60408051600160a060020a039092168252519081900360200190f35b3480156104bd57600080fd5b50610294610d5d565b3480156104d257600080fd5b506102bd610d6d565b3480156104e757600080fd5b5061027d600435610f3b565b3480156104ff57600080fd5b5061027d6110a9565b34801561051457600080fd5b5061052060043561110a565b604051808b600381111561053057fe5b60ff90811682526001608060020a03909b166020820152989099166040808a019190915263ffffffff9097166060890152608088019590955260a087019390935260c086019190915260e085015261010084015261012083015251908190036101400192509050f35b3480156105a557600080fd5b5061027d61117f565b3480156105ba57600080fd5b5061027d61124c565b3480156105cf57600080fd5b50604080516020601f6101243560048181013592830184900484028501840190955281845261027d9463ffffffff8135169460ff60248035919091169560443595606435956084359560a4359560c4359560e43595600160a060020a03610104351695369561014494930191819084018382808284375094975050933594506112e79350505050565b34801561066457600080fd5b506102bd61132d565b34801561067957600080fd5b50610495611333565b34801561068e57600080fd5b50604080516020601f6101243560048181013592830184900484028501840190955281845261027d9463ffffffff8135169460ff60248035919091169560443595606435956084359560a4359560c4359560e43595600160a060020a03610104351695369561014494930191819084018382808284375094975050508335600160a060020a031694505050602082013591604001359050611342565b34801561073657600080fd5b506102bd61138e565b34801561074b57600080fd5b5061027d600435611395565b34801561076357600080fd5b5061027d600435611494565b34801561077b57600080fd5b5061027d6114d3565b34801561079057600080fd5b506104956115a5565b3480156107a557600080fd5b5061027d600160a060020a03600435166024356115b4565b604080516020601f60843560048181013592830184900484028501840190955281845261027d948035946024803595604435956064359536959460a49490939101919081908401838280828437509497506116d49650505050505050565b34801561082757600080fd5b5061027d600435611ad0565b34801561083f57600080fd5b506102bd611cb7565b34801561085457600080fd5b506102bd611cbe565b34801561086957600080fd5b5061027d600160a060020a0360043516611cc4565b34801561088a57600080fd5b5061027d600160a060020a0360043516602435611d40565b3480156108ae57600080fd5b5061027d6001608060020a0360043581169060243516611f4b565b3480156108d557600080fd5b50610495612025565b3480156108ea57600080fd5b50610495612034565b3480156108ff57600080fd5b506102bd612043565b34801561091457600080fd5b506102bd612049565b34801561092957600080fd5b50610495612050565b34801561093e57600080fd5b506102bd61205f565b34801561095357600080fd5b50604080516020601f60c43560048181013592830184900484028501840190955281845261027d9463ffffffff813516946024803595604435956064359560843595600160a060020a0360a43516953695919460e49491939092019181908401838280828437509497506120659650505050505050565b3480156109d657600080fd5b506103536120a5565b3480156109eb57600080fd5b5061027d600160a060020a03600435166120c8565b348015610a0c57600080fd5b5061027d600160a060020a036004351661210e565b348015610a2d57600080fd5b506102bd612183565b348015610a4257600080fd5b5061027d612189565b600054600160a060020a03163314610a6257600080fd5b60015460a060020a900460ff1615610a7957600080fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fc9d6bebde85c4e3348468c6af2cb34f978d1a8c6eebc438f1361c1ad5edf5f0e90600090a1565b60015460a060020a900460ff1681565b6201518081565b60106020526000908152604090205481565b60116020526000908152604090205481565b600054600160a060020a03163314610b1a57600080fd5b60015460a060020a900460ff1615610b3157600080fd5b600754600010610b4057600080fd5b600755565b600d5481565b600c546001608060020a031681565b33600090815260116020526040812054908111610b7657600080fd5b336000818152601160205260408082208290555183156108fc0291849190818181858888f19350505050158015610bb1573d6000803e3d6000fd5b5050565b600054600160a060020a03163314610bcc57600080fd5b60015460a860020a900460ff161515610be457600080fd5b60015460a060020a900460ff161515610bfc57600080fd5b6001805475ff00000000000000000000000000000000000000000019169055600060028190556040517f730c1faaa977b67dacf1e2451ef54556e04a07d577785ff79f6d31f73502efc99190a1565b600854600160a060020a03163314610c6257600080fd5b610c778860008060008b8b8b8b8b8a8c612227565b610c8482898987876122a7565b5050505050505050565b600e5481565b600154600160a060020a03163314610cab57600080fd5b6001805460008054600160a060020a0380841673ffffffffffffffffffffffffffffffffffffffff1992831617808455919093169093556040519092909116907f897d3c8bbea11029ba3b26eb993fe8edb14c2c4c0d2ecceccce41d1d83d3e359908390a3565b600054600160a060020a03163314610d2957600080fd5b600a54610d3c903463ffffffff61250816565b600a55565b6203f48081565b60025481565b600354600160a060020a031681565b60015460a860020a900460ff1681565b604080517f75696e74333220526f756e6420496400000000000000000000000000000000006020808301919091527f75696e74382047616d6520547970650000000000000000000000000000000000602f8301527f75696e743136204e756d62657200000000000000000000000000000000000000603e8301527f75696e742056616c756520285765692900000000000000000000000000000000604b8301527f696e742043757272656e742042616c616e636520285765692900000000000000605b8301527f627974657333322053657276657220486173680000000000000000000000000060748301527f6279746573333220506c6179657220486173680000000000000000000000000060878301527f75696e742047616d652049640000000000000000000000000000000000000000609a8301527f6164647265737320436f6e74726163742041646472657373000000000000000060a68301528251609e81840301815260be90920192839052815191929182918401908083835b60208310610f0b5780518252601f199092019160209182019101610eec565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902081565b60008054600160a060020a03163314610f5357600080fd5b600354600654604080517f73c4726b000000000000000000000000000000000000000000000000000000008152600481019290925251600160a060020a03909216916373c4726b916024808201926020929091908290030181600087803b158015610fbd57600080fd5b505af1158015610fd1573d6000803e3d6000fd5b505050506040513d6020811015610fe757600080fd5b5051600a5490915082118015906110115750600a54819061100e908463ffffffff61251b16565b10155b151561101c57600080fd5b6000600b5413158061104a5750600a5461103c908363ffffffff61251b16565b611047600b5461252d565b11155b151561105557600080fd5b600a54611068908363ffffffff61251b16565b600a5560008054604051600160a060020a039091169184156108fc02918591818181858888f193505050501580156110a4573d6000803e3d6000fd5b505050565b600054600160a060020a031633146110c057600080fd5b600154621a5e009060a860020a900460ff1680156110f1575060025442906110ee908363ffffffff61250816565b11155b15156110fc57600080fd5b600054600160a060020a0316ff5b600f60205260009081526040902080546001820154600283015460038401546004850154600586015460069096015460ff8087169761010088046001608060020a03169771010000000000000000000000000000000000810490921696609060020a90920463ffffffff16959194919391928a565b600054600160a060020a0316331461119657600080fd5b60015460a860020a900460ff16156111f8576040805160e560020a62461bcd02815260206004820152600660248201527f7061757365640000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6001805475ff000000000000000000000000000000000000000000191660a860020a179055426002556040517f4b314b34e912fda7f95e7d23e9c8c95f82f0aff1984e4ce592a0b005f905562490600090a1565b60008054600160a060020a0316331461126457600080fd5b6001546203f4809060a860020a900460ff16801561129557506002544290611292908363ffffffff61250816565b11155b15156112a057600080fd5b6000600b819055600a8054908290558154604051919450600160a060020a03169184156108fc02918591818181858888f193505050501580156110a4573d6000803e3d6000fd5b61130f8b8b8b8b8b8b8b8b8b8b600860009054906101000a9004600160a060020a0316612227565b6113208b8b8b8b8b8a878b3361253d565b5050505050505050505050565b600b5481565b600054600160a060020a031681565b600854600160a060020a0316331461135957600080fd5b61136c8d8d8d8d8d8d8d8d8d8d8d612227565b61137f8d8d8d8d8d8d8d89898f8d612b0f565b50505050505050505050505050565b62ed4e0081565b33600081815260106020908152604080832054808452600f9092529091208382146113f8576040805160e560020a62461bcd02815260206004820152600a6024820152600080516020613c0a833981519152604482015290519081900360640190fd5b6001815460ff16600381111561140a57fe5b141561145357426006820155805460ff19166002178155604051829033907f9b60ba122ac2e613ae737820a8eb2d8c28356ff6b03d569dacb7ce2bcdc86fed90600090a361148e565b6003815460ff16600381111561146557fe5b14801561147e57508054609060020a900463ffffffff16155b156102635761148e81838561317d565b50505050565b600054600160a060020a031633146114ab57600080fd5b806201518081101580156114c2575062ed4e008111155b15156114cd57600080fd5b50600d55565b600054600160a060020a031633146114ea57600080fd5b600454600160a060020a0316151561150157600080fd5b600554151561150f57600080fd5b426203f480600554011115801561152d57506207e900600554014211155b151561153857600080fd5b600480546003805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a038416179091551690556000600581905560408051918252517f28de3c2df3d09a8b061f86cd0c78b7d02f1f5caffcd086ff45ee12a4a51056c89181900360200190a1565b600454600160a060020a031681565b6008546000908190600160a060020a031633146115d057600080fd5b5050600160a060020a038216600090815260106020908152604080832054808452600f90925290912082821461163e576040805160e560020a62461bcd02815260206004820152600a6024820152600080516020613c0a833981519152604482015290519081900360640190fd5b6001815460ff16600381111561165057fe5b141561169957426006820155805460ff19166003178155604051829033907fdbbc392d5391708a9def7f560f8cbdef92e1bb37e5104831e78feda1488b7ab090600090a361148e565b6002815460ff1660038111156116ab57fe5b1480156116c457508054609060020a900463ffffffff16155b156102635761148e81838661317d565b600c54600090819081908190346001608060020a03909116118015906117195750600c5470010000000000000000000000000000000090046001608060020a03163411155b151561176f576040805160e560020a62461bcd02815260206004820152600960248201527f696e76207374616b650000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600654600354604080517f73c4726b00000000000000000000000000000000000000000000000000000000815260019093016004840181905290519092600092600160a060020a0316916373c4726b9160248082019260209290919082900301818787803b1580156117e057600080fd5b505af11580156117f4573d6000803e3d6000fd5b505050506040513d602081101561180a57600080fd5b5051600a54909150811115611869576040805160e560020a62461bcd02815260206004820152600e60248201527f696e7620686f7573655374616b65000000000000000000000000000000000000604482015290519081900360640190fd5b60015460a860020a900460ff16156118cb576040805160e560020a62461bcd02815260206004820152600660248201527f7061757365640000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b33600090815260106020908152604080832054808452600f90925282209097509550855460ff1660038111156118fd57fe5b14611952576040805160e560020a62461bcd02815260206004820152601360248201527f707265762067616d65206e6f7420656e64656400000000000000000000000000604482015290519081900360640190fd5b858a146119a9576040805160e560020a62461bcd02815260206004820152601260248201527f696e762067616d655072657647616d6549640000000000000000000000000000604482015290519081900360640190fd5b428911611a00576040805160e560020a62461bcd02815260206004820152600760248201527f6578706972656400000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b611a0d338b8b8b8b613239565b600780546001808201909255336000908152601060209081526040808320849055838352600f9091529020805470ffffffffffffffffffffffffffffffff001916610100346001608060020a0316021760ff1916831781556006549196509450611a7691612508565b600655604080516001608060020a0334168152602081018d905281518a92879233927fd25faca801440882fa5d7c7f70b072a2ad89621e277ee0b6f9923ccac48411b1929181900390910190a45050505050505050505050565b33600081815260106020908152604080832054808452600f90925282209091848314611b34576040805160e560020a62461bcd02815260206004820152600a6024820152600080516020613c0a833981519152604482015290519081900360640190fd5b6002825460ff166003811115611b4657fe5b14611b9b576040805160e560020a62461bcd02815260206004820152600a60248201527f696e762073746174757300000000000000000000000000000000000000000000604482015290519081900360640190fd5b60038054835460018501546002860154938601546006870154604080517f0c5ebb1a00000000000000000000000000000000000000000000000000000000815271010000000000000000000000000000000000860460ff1660048201526024810194909452604484019690965260648301919091526101009092046001608060020a0316608482015260a48101919091529151600160a060020a0390911691630c5ebb1a9160c48083019260209291908290030181600087803b158015611c6157600080fd5b505af1158015611c75573d6000803e3d6000fd5b505050506040513d6020811015611c8b57600080fd5b50518254909150611cb09083908590609060020a900463ffffffff168760028661330d565b5050505050565b621a5e0081565b600a5481565b600054600160a060020a03163314611cdb57600080fd5b60048054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911681179091554260055560408051918252517f97044e884f04922f1959ef2de012f4734423df2d4da57fd4c5eaf40cd63b525f9181900360200190a150565b60085460009081908190600160a060020a03163314611d5e57600080fd5b600160a060020a038516600090815260106020908152604080832054808452600f9092529091209093509150838314611dcf576040805160e560020a62461bcd02815260206004820152600a6024820152600080516020613c0a833981519152604482015290519081900360640190fd5b6003825460ff166003811115611de157fe5b14611e36576040805160e560020a62461bcd02815260206004820152600a60248201527f696e762073746174757300000000000000000000000000000000000000000000604482015290519081900360640190fd5b60038054835460018501546002860154938601546006870154604080517f834d42c600000000000000000000000000000000000000000000000000000000815271010000000000000000000000000000000000860460ff1660048201526024810194909452604484019690965260648301919091526101009092046001608060020a0316608482015260a48101919091529151600160a060020a039091169163834d42c69160c48083019260209291908290030181600087803b158015611efc57600080fd5b505af1158015611f10573d6000803e3d6000fd5b505050506040513d6020811015611f2657600080fd5b50518254909150611cb09083908590609060020a900463ffffffff168860018661330d565b600054600160a060020a03163314611f6257600080fd5b6000826001608060020a0316118015611f8d5750806001608060020a0316826001608060020a031611155b1515611f9857600080fd5b600c80546fffffffffffffffffffffffffffffffff19166001608060020a038481169190911781167001000000000000000000000000000000008483168102919091179283905560408051848416815291909304909116602082015281517f1ec948cac143dba0e555a87dd86ae387e2ecd4a8fee80f7dd324d5987cb3e7f8929181900390910190a15050565b600954600160a060020a031681565b600854600160a060020a031681565b60055481565b6207e90081565b600154600160a060020a031681565b60065481565b61208f8760008060008a8a8a8a8a8a600860009054906101000a9004600160a060020a0316612227565b61209c33888886866122a7565b50505050505050565b600c5470010000000000000000000000000000000090046001608060020a031681565b600054600160a060020a031633146120df57600080fd5b6009805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461212557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383811691821790925560008054604051929316917f83ada3430836f9d4bd6f7bc690ffbba5199cb19b37393dd64c229930213535969190a350565b60075481565b6000426121a3600d54600e5461250890919063ffffffff16565b11156121ae57600080fd5b42600e55600b546000126121c157612224565b6121cc600b5461252d565b6000600b55600a549091506121e7908263ffffffff61251b16565b600a55600954604051600160a060020a039091169082156108fc029083906000818181858888f19350505050158015610bb1573d6000803e3d6000fd5b50565b306000600160a060020a038516821461228a576040805160e560020a62461bcd02815260206004820152601360248201527f696e7620636f6e74726163744164647265737300000000000000000000000000604482015290519081900360640190fd5b61229a8d8d8d8d8d8d8d8d6133b6565b905061137f818585613714565b600160a060020a03808616600090815260106020908152604080832054808452600f835281842060035483517f73ad468a00000000000000000000000000000000000000000000000000000000815293519296919594859491909216926373ad468a9260048084019391929182900301818787803b15801561232857600080fd5b505af115801561233c573d6000803e3d6000fd5b505050506040513d602081101561235257600080fd5b5051835490925061010090046001608060020a031690508386146123ae576040805160e560020a62461bcd02815260206004820152600a6024820152600080516020613c0a833981519152604482015290519081900360640190fd5b600063ffffffff89161161240c576040805160e560020a62461bcd02815260206004820152600b60248201527f696e7620726f756e644964000000000000000000000000000000000000000000604482015290519081900360640190fd5b86816000031315801561241f5750818713155b1515612475576040805160e560020a62461bcd02815260206004820152600b60248201527f696e762062616c616e6365000000000000000000000000000000000000000000604482015290519081900360640190fd5b6001835460ff16600381111561248757fe5b146124dc576040805160e560020a62461bcd02815260206004820152600a60248201527f696e762073746174757300000000000000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a03851630146124ee57fe5b6124fd83858a8c60008c61330d565b505050505050505050565b8181018281101561251557fe5b92915050565b60008282111561252757fe5b50900390565b60008082121561253957fe5b5090565b600160a060020a03808216600090815260106020908152604080832054808452600f835281842060035483517f73ad468a00000000000000000000000000000000000000000000000000000000815293519296919594859491909216926373ad468a9260048084019391929182900301818787803b1580156125be57600080fd5b505af11580156125d2573d6000803e3d6000fd5b505050506040513d60208110156125e857600080fd5b5051835490925061010090046001608060020a03169050858414612644576040805160e560020a62461bcd02815260206004820152600a6024820152600080516020613c0a833981519152604482015290519081900360640190fd5b600063ffffffff8e16116126a2576040805160e560020a62461bcd02815260206004820152600b60248201527f696e7620726f756e644964000000000000000000000000000000000000000000604482015290519081900360640190fd5b6040805160208082018a90528251808303820181529183019283905281518b93918291908401908083835b602083106126ec5780518252601f1990920191602091820191016126cd565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141515612774576040805160e560020a62461bcd02815260206004820152600c60248201527f696e762075736572536565640000000000000000000000000000000000000000604482015290519081900360640190fd5b8881600003131580156127875750818913155b15156127dd576040805160e560020a62461bcd02815260206004820152600b60248201527f696e762062616c616e6365000000000000000000000000000000000000000000604482015290519081900360640190fd5b600354604080517f09eecdd700000000000000000000000000000000000000000000000000000000815260ff8f166004820152602481018e9052604481018d90529051600160a060020a03909216916309eecdd7916064808201926020929091908290030181600087803b15801561285457600080fd5b505af1158015612868573d6000803e3d6000fd5b505050506040513d602081101561287e57600080fd5b505115156128d6576040805160e560020a62461bcd02815260206004820152600760248201527f696e762062657400000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60006129006128e48c6137f6565b6128f4848d63ffffffff61382116565b9063ffffffff61385a16565b1215612956576040805160e560020a62461bcd02815260206004820152600e60248201527f76616c756520746f6f2068696768000000000000000000000000000000000000604482015290519081900360640190fd5b6003835460ff16600381111561296857fe5b1480156129855750825463ffffffff8e8116609060020a90920416145b156129a1576004830187905561299c838587613889565b61137f565b6001835460ff1660038111156129b357fe5b14806129e957506003835460ff1660038111156129cc57fe5b1480156129e95750825463ffffffff808f16609060020a90920416105b15612abf578254600290849060ff191660018302179055504283600601819055508c8360000160126101000a81548163ffffffff021916908363ffffffff1602179055508b8360000160116101000a81548160ff021916908360ff1602179055508a83600101819055508983600201819055508883600301819055508683600401816000191690555060006001028360050181600019169055508333600160a060020a03167f9b60ba122ac2e613ae737820a8eb2d8c28356ff6b03d569dacb7ce2bcdc86fed60405160405180910390a361137f565b6040805160e560020a62461bcd02815260206004820152600960248201527f696e762073746174650000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a03808216600090815260106020908152604080832054808452600f835281842060035483517f73ad468a00000000000000000000000000000000000000000000000000000000815293519296919594859491909216926373ad468a9260048084019391929182900301818787803b158015612b9057600080fd5b505af1158015612ba4573d6000803e3d6000fd5b505050506040513d6020811015612bba57600080fd5b5051835490925061010090046001608060020a03169050858414612c16576040805160e560020a62461bcd02815260206004820152600a6024820152600080516020613c0a833981519152604482015290519081900360640190fd5b60008f63ffffffff16111515612c76576040805160e560020a62461bcd02815260206004820152600b60248201527f696e7620726f756e644964000000000000000000000000000000000000000000604482015290519081900360640190fd5b6040805160208082018b90528251808303820181529183019283905281518d93918291908401908083835b60208310612cc05780518252601f199092019160209182019101612ca1565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141515612d48576040805160e560020a62461bcd02815260206004820152600e60248201527f696e762073657276657253656564000000000000000000000000000000000000604482015290519081900360640190fd5b6040805160208082018a90528251808303820181529183019283905281518c93918291908401908083835b60208310612d925780518252601f199092019160209182019101612d73565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141515612e1a576040805160e560020a62461bcd02815260206004820152600c60248201527f696e762075736572536565640000000000000000000000000000000000000000604482015290519081900360640190fd5b8a8160000313158015612e2d5750818b13155b1515612e83576040805160e560020a62461bcd02815260206004820152600b60248201527f696e762062616c616e6365000000000000000000000000000000000000000000604482015290519081900360640190fd5b600360009054906101000a9004600160a060020a0316600160a060020a03166309eecdd78f8f8f6040518463ffffffff1660e060020a028152600401808460ff1660ff1681526020018381526020018281526020019350505050602060405180830381600087803b158015612ef757600080fd5b505af1158015612f0b573d6000803e3d6000fd5b505050506040513d6020811015612f2157600080fd5b50511515612f79576040805160e560020a62461bcd02815260206004820152600760248201527f696e762062657400000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000612f97612f878e6137f6565b6128f4848f63ffffffff61382116565b1215612fed576040805160e560020a62461bcd02815260206004820152600e60248201527f746f6f20686967682076616c7565000000000000000000000000000000000000604482015290519081900360640190fd5b6002835460ff166003811115612fff57fe5b14801561302b57508e63ffffffff168360000160129054906101000a900463ffffffff1663ffffffff16145b156130475760058301889055613042838587613889565b61316c565b6001835460ff16600381111561305957fe5b148061309e57506002835460ff16600381111561307257fe5b14801561309e57508e63ffffffff168360000160129054906101000a900463ffffffff1663ffffffff16105b15612abf578254600390849060ff191660018302179055504283600601819055508e8360000160126101000a81548163ffffffff021916908363ffffffff1602179055508d8360000160116101000a81548160ff021916908360ff1602179055508c83600101819055508b83600201819055508a836003018190555087836005018160001916905550868360040181600019169055508385600160a060020a03167fdbbc392d5391708a9def7f560f8cbdef92e1bb37e5104831e78feda1488b7ab060405160405180910390a35b505050505050505050505050505050565b600080600360009054906101000a9004600160a060020a0316600160a060020a031663fcec617a6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156131d357600080fd5b505af11580156131e7573d6000803e3d6000fd5b505050506040513d60208110156131fd57600080fd5b505185546000918203935061010090046001608060020a03169150819003821215613229578060000391505b611cb0858560008660038761330d565b604080516c0100000000000000000000000030818102602080850191909152600160a060020a038a169092026034840152604883018890526068830187905260888084018790528451808503909101815260a8909301938490528251909360009392909182918401908083835b602083106132c55780518252601f1990920191602091820191016132a6565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912060085490945061209c9350849250869150600160a060020a0316613714565b855460ff1916865560065461332390600161251b565b600655855461334290849061010090046001608060020a0316836139b0565b8483600160a060020a03167f59ba0efd7d5a5d7e109fb346b50365a8d68661fc7c2c311cd29750707e1b8de5868486604051808463ffffffff1663ffffffff16815260200183815260200182600381111561339957fe5b60ff168152602001935050505060405180910390a3505050505050565b6040805160e060020a63ffffffff8b16026020808301919091527f010000000000000000000000000000000000000000000000000000000000000060ff8b160260248301527e0100000000000000000000000000000000000000000000000000000000000061ffff8a160260258301526027820188905260478201879052606782018690526087820185905260a782018490526c01000000000000000000000000300260c7830152825160bb81840301815260db909201928390528151600093849392909182918401908083835b602083106134a35780518252601f199092019160209182019101613484565b51815160209384036101000a6000190180199092169116179052604080519290940182900382207f75696e74333220526f756e642049640000000000000000000000000000000000838301527f75696e74382047616d6520547970650000000000000000000000000000000000602f8401527f75696e743136204e756d62657200000000000000000000000000000000000000603e8401527f75696e742056616c756520285765692900000000000000000000000000000000604b8401527f696e742043757272656e742042616c616e636520285765692900000000000000605b8401527f627974657333322053657276657220486173680000000000000000000000000060748401527f6279746573333220506c6179657220486173680000000000000000000000000060878401527f75696e742047616d652049640000000000000000000000000000000000000000609a8401527f6164647265737320436f6e74726163742041646472657373000000000000000060a68401528451808403609e01815260be9093019485905282519097509195509293508392850191508083835b602083106136665780518252601f199092019160209182019101613647565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208282015281840187905283518083038501815260609092019384905281519195509293508392850191508083835b602083106136da5780518252601f1990920191602091820191016136bb565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209d9c50505050505050505050505050565b60008060008061372386613b07565b60408051600080825260208083018085528e905260ff8516838501526060830187905260808301869052925195995093975091955060019360a0808401949293601f19830193908390039091019190865af1158015613786573d6000803e3d6000fd5b5050604051601f190151915050600160a060020a038082169086161461209c576040805160e560020a62461bcd02815260206004820152600760248201527f696e762073696700000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60007f8000000000000000000000000000000000000000000000000000000000000000821061253957fe5b60008282018183128015906138365750838112155b8061384b575060008312801561384b57508381125b151561385357fe5b9392505050565b600081830381831280159061386f5750838113155b8061384b575060008312801561384b575083811361385357fe5b600380548454600186015460028701549387015460058801546004808a0154604080517f2a0763ce00000000000000000000000000000000000000000000000000000000815271010000000000000000000000000000000000880460ff16938101939093526024830195909552604482019790975260648101929092526101009093046001608060020a0316608482015260a481019290925260c48201939093529151600092600160a060020a0390921691632a0763ce9160e480830192602092919082900301818787803b15801561396157600080fd5b505af1158015613975573d6000803e3d6000fd5b505050506040513d602081101561398b57600080fd5b5051845490915061148e9085908590609060020a900463ffffffff168560038661330d565b600080600080856001608060020a031693506139cd600a546137f6565b9250600360009054906101000a9004600160a060020a0316600160a060020a03166373ad468a6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015613a2257600080fd5b505af1158015613a36573d6000803e3d6000fd5b505050506040513d6020811015613a4c57600080fd5b5051851315613a5757fe5b6000613a69858763ffffffff61382116565b1215613a7157fe5b600085138015613a8057508483125b15613a89578294505b600b54613a9c908663ffffffff61385a16565b600b55613aaf838663ffffffff61385a16565b9150613aba8261252d565b600a55613ad5613ad0858763ffffffff61382116565b61252d565b600160a060020a03881660009081526011602052604081208054830190819055919250101561209c5761209c87613b90565b600080600083516041141515613b67576040805160e560020a62461bcd02815260206004820152600760248201527f696e762073696700000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b50505060208101516040820151604183015160ff166002811015613b8957601b015b9193909250565b600160a060020a038116600090815260116020526040812054908111613bb257fe5b600160a060020a0382166000818152601160205260408082208290555183156108fc0291849190818181858888f115159350610bb19250505057600160a060020a03919091166000908152601160205260409020555600696e762067616d65496400000000000000000000000000000000000000000000a165627a7a72305820b3dbad1191c96a0c71843eb8e1cc3885d622456b6fccd11d0cf9b27f6d51f7000029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000cef260a5fed7a896bbe07b933b3a5c17aec094d8000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000e077c00badec88e309a6f50ad1092a7cc4edd88100000000000000000000000071be1ace87248f3950bdfc4c89b4b3eed059f6f30000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : _serverAddress (address): 0xCef260a5Fed7A896BBE07b933B3A5c17aEC094D8
Arg [1] : _minStake (uint128): 10000000000000000
Arg [2] : _maxStake (uint128): 1000000000000000000
Arg [3] : _conflictResAddress (address): 0xE077c00BADec88e309A6f50AD1092A7cc4edd881
Arg [4] : _houseAddress (address): 0x71BE1aCe87248F3950BdFc4c89b4B3EED059f6f3
Arg [5] : _chainId (uint256): 1
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000cef260a5fed7a896bbe07b933b3a5c17aec094d8
Arg [1] : 000000000000000000000000000000000000000000000000002386f26fc10000
Arg [2] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000
Arg [3] : 000000000000000000000000e077c00badec88e309a6f50ad1092a7cc4edd881
Arg [4] : 00000000000000000000000071be1ace87248f3950bdfc4c89b4b3eed059f6f3
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000001
Swarm Source
bzzr://b3dbad1191c96a0c71843eb8e1cc3885d622456b6fccd11d0cf9b27f6d51f700
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.