Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multi Chain
Multichain Addresses
N/ALatest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 7710443 | 361 days 1 hr ago | IN | Create: TherundownConsumerVerifier | 0 ETH | 0.00018096 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Txn Hash | Block | From | To | Value | ||
---|---|---|---|---|---|---|
7807528 | 344 days 6 hrs ago | 0 ETH | ||||
7807528 | 344 days 6 hrs ago | 0 ETH | ||||
7807528 | 344 days 6 hrs ago | 0 ETH | ||||
7807526 | 344 days 6 hrs ago | 0 ETH | ||||
7807526 | 344 days 6 hrs ago | 0 ETH | ||||
7807526 | 344 days 6 hrs ago | 0 ETH | ||||
7807524 | 344 days 6 hrs ago | 0 ETH | ||||
7807524 | 344 days 6 hrs ago | 0 ETH | ||||
7807524 | 344 days 6 hrs ago | 0 ETH | ||||
7807523 | 344 days 6 hrs ago | 0 ETH | ||||
7807523 | 344 days 6 hrs ago | 0 ETH | ||||
7807523 | 344 days 6 hrs ago | 0 ETH | ||||
7807522 | 344 days 6 hrs ago | 0 ETH | ||||
7807522 | 344 days 6 hrs ago | 0 ETH | ||||
7807522 | 344 days 6 hrs ago | 0 ETH | ||||
7807520 | 344 days 6 hrs ago | 0 ETH | ||||
7807520 | 344 days 6 hrs ago | 0 ETH | ||||
7807520 | 344 days 6 hrs ago | 0 ETH | ||||
7807518 | 344 days 6 hrs ago | 0 ETH | ||||
7807518 | 344 days 6 hrs ago | 0 ETH | ||||
7807518 | 344 days 6 hrs ago | 0 ETH | ||||
7807388 | 344 days 6 hrs ago | 0 ETH | ||||
7807356 | 344 days 6 hrs ago | 0 ETH | ||||
7807356 | 344 days 6 hrs ago | 0 ETH | ||||
7807355 | 344 days 6 hrs ago | 0 ETH |
Loading...
Loading
Contract Name:
TherundownConsumerVerifier
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; // internal import "../../utils/proxy/solidity-0.8.0/ProxyOwned.sol"; import "../../utils/proxy/solidity-0.8.0/ProxyPausable.sol"; // interface import "../../interfaces/ITherundownConsumer.sol"; /// @title Verifier of data which are coming from CL and stored into TherundownConsumer.sol /// @author gruja contract TherundownConsumerVerifier is Initializable, ProxyOwned, ProxyPausable { uint private constant ONE_PERCENT = 1e16; uint private constant ONE = 1e18; uint public constant CANCELLED = 0; uint public constant HOME_WIN = 1; uint public constant AWAY_WIN = 2; uint public constant RESULT_DRAW = 3; ITherundownConsumer public consumer; mapping(bytes32 => bool) public invalidName; mapping(bytes32 => bool) public supportedMarketType; uint public defaultOddsThreshold; mapping(uint => uint) public oddsThresholdForSport; /* ========== CONSTRUCTOR ========== */ function initialize( address _owner, address _consumer, string[] memory _invalidNames, string[] memory _supportedMarketTypes, uint _defaultOddsThreshold ) external initializer { setOwner(_owner); consumer = ITherundownConsumer(_consumer); _setInvalidNames(_invalidNames, true); _setSupportedMarketTypes(_supportedMarketTypes, true); defaultOddsThreshold = _defaultOddsThreshold; } /* ========== VIEW FUNCTIONS ========== */ /// @notice view function which returns names of teams/fighters are invalid /// @param _teamA team A in string (Example: Liverpool) /// @param _teamB team B in string (Example: Arsenal) /// @return bool is names invalid (true -> invalid, false -> valid) function isInvalidNames(string memory _teamA, string memory _teamB) external view returns (bool) { return keccak256(abi.encodePacked(_teamA)) == keccak256(abi.encodePacked(_teamB)) || invalidName[keccak256(abi.encodePacked(_teamA))] || invalidName[keccak256(abi.encodePacked(_teamB))]; } /// @notice view function which returns if names are the same /// @param _teamA team A in string (Example: Liverpool) /// @param _teamB team B in string (Example: Arsenal) /// @return bool is names are the same function areTeamsEqual(string memory _teamA, string memory _teamB) external view returns (bool) { return keccak256(abi.encodePacked(_teamA)) == keccak256(abi.encodePacked(_teamB)); } /// @notice view function which returns if market type is supported, checks are done in a wrapper contract /// @param _market type of market (create or resolve) /// @return bool supported or not function isSupportedMarketType(string memory _market) external view returns (bool) { return supportedMarketType[keccak256(abi.encodePacked(_market))]; } /// @notice view function which returns if odds are inside of the threshold /// @param _sportId sport id for which we get threshold /// @param _currentOddsArray current odds on a contract as array /// @param _newOddsArray new odds on a contract as array /// @param _isTwoPositionalSport is sport two positional /// @return bool true if odds are less then threshold false if above function areOddsArrayInThreshold( uint _sportId, uint[] memory _currentOddsArray, uint[] memory _newOddsArray, bool _isTwoPositionalSport ) external view returns (bool) { return areOddsInThreshold(_sportId, _currentOddsArray[0], _newOddsArray[0]) && areOddsInThreshold(_sportId, _currentOddsArray[1], _newOddsArray[1]) && (_isTwoPositionalSport || areOddsInThreshold(_sportId, _currentOddsArray[2], _newOddsArray[2])); } /// @notice view function which returns if odds are inside of the threshold /// @param _sportId sport id for which we get threshold /// @param _currentOdds current single odds on a contract /// @param _newOdds new single odds on a contract /// @return bool true if odds are less then threshold false if above function areOddsInThreshold( uint _sportId, uint _currentOdds, uint _newOdds ) public view returns (bool) { uint threshold = oddsThresholdForSport[_sportId] == 0 ? defaultOddsThreshold : oddsThresholdForSport[_sportId]; // new odds appear or it is equal if (_currentOdds == 0 || _currentOdds == _newOdds) { return true; } // if current odds is GT new one if (_newOdds > _currentOdds) { return !(((ONE * _newOdds) / _currentOdds) > (ONE + (threshold * ONE_PERCENT))); } return !(ONE - ((_newOdds * ONE) / _currentOdds) > (threshold * ONE_PERCENT)); } /// @notice view function which if odds are valid or not /// @param _isTwoPositionalSport if two positional sport dont look at draw odds /// @param _homeOdds odd for home win /// @param _awayOdds odd for away win /// @param _drawOdds odd for draw win /// @return bool true - valid, fasle - invalid function areOddsValid( bool _isTwoPositionalSport, int24 _homeOdds, int24 _awayOdds, int24 _drawOdds ) external view returns (bool) { return _areOddsValid(_isTwoPositionalSport, _homeOdds, _awayOdds, _drawOdds); } /// @notice view function which returns if outcome of a game is valid /// @param _isTwoPositionalSport if two positional sport draw now vallid /// @param _outcome home - 1, away - 2, draw - 3 (if not two positional), and cancel - 0 are valid outomes /// @return bool true - valid, fasle - invalid function isValidOutcomeForGame(bool _isTwoPositionalSport, uint _outcome) external view returns (bool) { return _isValidOutcomeForGame(_isTwoPositionalSport, _outcome); } /// @notice view function which returns if outcome is good with a score /// @param _outcome home - 1, away - 2, draw - 3 (if not two positional), and cancel - 0 are valid outomes /// @param _homeScore home team has scored in points /// @param _awayScore away team has scored in points /// @return bool true - valid, fasle - invalid function isValidOutcomeWithResult( uint _outcome, uint _homeScore, uint _awayScore ) external view returns (bool) { return _isValidOutcomeWithResult(_outcome, _homeScore, _awayScore); } /// @notice calculate normalized odds based on american odds /// @param _americanOdds american odds in array of 3 [home,away,draw] /// @return uint[] array of normalized odds function calculateAndNormalizeOdds(int[] memory _americanOdds) external view returns (uint[] memory) { return _calculateAndNormalizeOdds(_americanOdds); } /* ========== INTERNALS ========== */ function _calculateAndNormalizeOdds(int[] memory _americanOdds) internal pure returns (uint[] memory) { uint[] memory normalizedOdds = new uint[](_americanOdds.length); uint totalOdds; for (uint i = 0; i < _americanOdds.length; i++) { uint calculationOdds; if (_americanOdds[i] == 0) { normalizedOdds[i] = 0; } else if (_americanOdds[i] > 0) { calculationOdds = uint(_americanOdds[i]); normalizedOdds[i] = ((10000 * 1e18) / (calculationOdds + 10000)) * 100; } else if (_americanOdds[i] < 0) { calculationOdds = uint(-_americanOdds[i]); normalizedOdds[i] = ((calculationOdds * 1e18) / (calculationOdds + 10000)) * 100; } totalOdds += normalizedOdds[i]; } for (uint i = 0; i < normalizedOdds.length; i++) { if (totalOdds == 0) { normalizedOdds[i] = 0; } else { normalizedOdds[i] = (1e18 * normalizedOdds[i]) / totalOdds; } } return normalizedOdds; } function _areOddsValid( bool _isTwoPositionalSport, int24 _homeOdds, int24 _awayOdds, int24 _drawOdds ) internal view returns (bool) { if (_isTwoPositionalSport) { return _awayOdds != 0 && _homeOdds != 0; } else { return _awayOdds != 0 && _homeOdds != 0 && _drawOdds != 0; } } function _isValidOutcomeForGame(bool _isTwoPositionalSport, uint _outcome) internal view returns (bool) { if (_isTwoPositionalSport) { return _outcome == HOME_WIN || _outcome == AWAY_WIN || _outcome == CANCELLED; } return _outcome == HOME_WIN || _outcome == AWAY_WIN || _outcome == RESULT_DRAW || _outcome == CANCELLED; } function _isValidOutcomeWithResult( uint _outcome, uint _homeScore, uint _awayScore ) internal pure returns (bool) { if (_outcome == CANCELLED) { return _awayScore == CANCELLED && _homeScore == CANCELLED; } else if (_outcome == HOME_WIN) { return _homeScore > _awayScore; } else if (_outcome == AWAY_WIN) { return _homeScore < _awayScore; } else { return _homeScore == _awayScore; } } function _setInvalidNames(string[] memory _invalidNames, bool _isInvalid) internal { for (uint256 index = 0; index < _invalidNames.length; index++) { // only if current flag is different, if same skip it if (invalidName[keccak256(abi.encodePacked(_invalidNames[index]))] != _isInvalid) { invalidName[keccak256(abi.encodePacked(_invalidNames[index]))] = _isInvalid; emit SetInvalidName(keccak256(abi.encodePacked(_invalidNames[index])), _isInvalid); } } } function _setSupportedMarketTypes(string[] memory _supportedMarketTypes, bool _isSupported) internal { for (uint256 index = 0; index < _supportedMarketTypes.length; index++) { // only if current flag is different, if same skip it if (supportedMarketType[keccak256(abi.encodePacked(_supportedMarketTypes[index]))] != _isSupported) { supportedMarketType[keccak256(abi.encodePacked(_supportedMarketTypes[index]))] = _isSupported; emit SetSupportedMarketType(keccak256(abi.encodePacked(_supportedMarketTypes[index])), _isSupported); } } } /* ========== CONTRACT MANAGEMENT ========== */ /// @notice sets consumer address /// @param _consumer consumer address function setConsumerAddress(address _consumer) external onlyOwner { require(_consumer != address(0), "Invalid address"); consumer = ITherundownConsumer(_consumer); emit NewConsumerAddress(_consumer); } /// @notice sets invalid names /// @param _invalidNames invalid names as array of strings /// @param _isInvalid true/false (invalid or not) function setInvalidNames(string[] memory _invalidNames, bool _isInvalid) external onlyOwner { require(_invalidNames.length > 0, "Invalid input"); _setInvalidNames(_invalidNames, _isInvalid); } /// @notice sets supported market types /// @param _supportedMarketTypes supported types as array of strings /// @param _isSupported true/false (invalid or not) function setSupportedMarketTypes(string[] memory _supportedMarketTypes, bool _isSupported) external onlyOwner { require(_supportedMarketTypes.length > 0, "Invalid input"); _setSupportedMarketTypes(_supportedMarketTypes, _isSupported); } /// @notice setting default odds threshold /// @param _defaultOddsThreshold default odds threshold function setDefaultOddsThreshold(uint _defaultOddsThreshold) external onlyOwner { require(_defaultOddsThreshold > 0, "Must be more then ZERO"); defaultOddsThreshold = _defaultOddsThreshold; emit NewDefaultOddsThreshold(_defaultOddsThreshold); } /// @notice setting custom odds threshold for sport /// @param _sportId sport id /// @param _oddsThresholdForSport custom odds threshold which will be by sport function setCustomOddsThresholdForSport(uint _sportId, uint _oddsThresholdForSport) external onlyOwner { require(defaultOddsThreshold != _oddsThresholdForSport, "Same value as default value"); require(_oddsThresholdForSport > 0, "Must be more then ZERO"); require(consumer.isSupportedSport(_sportId), "SportId is not supported"); require(oddsThresholdForSport[_sportId] != _oddsThresholdForSport, "Same value as before"); oddsThresholdForSport[_sportId] = _oddsThresholdForSport; emit NewCustomOddsThresholdForSport(_sportId, _oddsThresholdForSport); } /* ========== EVENTS ========== */ event NewConsumerAddress(address _consumer); event SetInvalidName(bytes32 _invalidName, bool _isInvalid); event SetSupportedMarketType(bytes32 _supportedMarketType, bool _isSupported); event NewDefaultOddsThreshold(uint _defaultOddsThreshold); event NewCustomOddsThresholdForSport(uint _sportId, uint _oddsThresholdForSport); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Context_init_unchained(); __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // Clone of syntetix contract without constructor contract ProxyOwned { address public owner; address public nominatedOwner; bool private _initialized; bool private _transferredAtInit; function setOwner(address _owner) public { require(_owner != address(0), "Owner address cannot be 0"); require(!_initialized, "Already initialized, use nominateNewOwner"); _initialized = true; owner = _owner; emit OwnerChanged(address(0), _owner); } function nominateNewOwner(address _owner) external onlyOwner { nominatedOwner = _owner; emit OwnerNominated(_owner); } function acceptOwnership() external { require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership"); emit OwnerChanged(owner, nominatedOwner); owner = nominatedOwner; nominatedOwner = address(0); } function transferOwnershipAtInit(address proxyAddress) external onlyOwner { require(proxyAddress != address(0), "Invalid address"); require(!_transferredAtInit, "Already transferred"); owner = proxyAddress; _transferredAtInit = true; emit OwnerChanged(owner, proxyAddress); } modifier onlyOwner { _onlyOwner(); _; } function _onlyOwner() private view { require(msg.sender == owner, "Only the contract owner may perform this action"); } event OwnerNominated(address newOwner); event OwnerChanged(address oldOwner, address newOwner); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // Inheritance import "./ProxyOwned.sol"; // Clone of syntetix contract without constructor contract ProxyPausable is ProxyOwned { uint public lastPauseTime; bool public paused; /** * @notice Change the paused state of the contract * @dev Only the contract owner may call this. */ function setPaused(bool _paused) external onlyOwner { // Ensure we're actually changing the state before we do anything if (_paused == paused) { return; } // Set our paused state. paused = _paused; // If applicable, set the last pause time. if (paused) { lastPauseTime = block.timestamp; } // Let everyone know that our pause state has changed. emit PauseChanged(paused); } event PauseChanged(bool isPaused); modifier notPaused { require(!paused, "This action cannot be performed while the contract is paused"); _; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface ITherundownConsumer { // view functions function isSupportedSport(uint _sportId) external view returns (bool); function isSupportedMarketType(string memory _market) external pure returns (bool); function getNormalizedOdds(bytes32 _gameId) external view returns (uint[] memory); function getNormalizedOddsForTwoPosition(bytes32 _gameId) external view returns (uint[] memory); function getGameCreatedById(address _market) external view returns (bytes32); function getResult(bytes32 _gameId) external view returns (uint); // write functions function fulfillGamesCreated( bytes32 _requestId, bytes[] memory _games, uint _sportsId, uint _date ) external; function fulfillGamesResolved( bytes32 _requestId, bytes[] memory _games, uint _sportsId ) external; function fulfillGamesOdds( bytes32 _requestId, bytes[] memory _games, uint _date ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { __Context_init_unchained(); } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_consumer","type":"address"}],"name":"NewConsumerAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_sportId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_oddsThresholdForSport","type":"uint256"}],"name":"NewCustomOddsThresholdForSport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_defaultOddsThreshold","type":"uint256"}],"name":"NewDefaultOddsThreshold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isPaused","type":"bool"}],"name":"PauseChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_invalidName","type":"bytes32"},{"indexed":false,"internalType":"bool","name":"_isInvalid","type":"bool"}],"name":"SetInvalidName","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_supportedMarketType","type":"bytes32"},{"indexed":false,"internalType":"bool","name":"_isSupported","type":"bool"}],"name":"SetSupportedMarketType","type":"event"},{"inputs":[],"name":"AWAY_WIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CANCELLED","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HOME_WIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RESULT_DRAW","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"},{"internalType":"uint256[]","name":"_currentOddsArray","type":"uint256[]"},{"internalType":"uint256[]","name":"_newOddsArray","type":"uint256[]"},{"internalType":"bool","name":"_isTwoPositionalSport","type":"bool"}],"name":"areOddsArrayInThreshold","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"},{"internalType":"uint256","name":"_currentOdds","type":"uint256"},{"internalType":"uint256","name":"_newOdds","type":"uint256"}],"name":"areOddsInThreshold","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_isTwoPositionalSport","type":"bool"},{"internalType":"int24","name":"_homeOdds","type":"int24"},{"internalType":"int24","name":"_awayOdds","type":"int24"},{"internalType":"int24","name":"_drawOdds","type":"int24"}],"name":"areOddsValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_teamA","type":"string"},{"internalType":"string","name":"_teamB","type":"string"}],"name":"areTeamsEqual","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256[]","name":"_americanOdds","type":"int256[]"}],"name":"calculateAndNormalizeOdds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"consumer","outputs":[{"internalType":"contract ITherundownConsumer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultOddsThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_consumer","type":"address"},{"internalType":"string[]","name":"_invalidNames","type":"string[]"},{"internalType":"string[]","name":"_supportedMarketTypes","type":"string[]"},{"internalType":"uint256","name":"_defaultOddsThreshold","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"invalidName","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_teamA","type":"string"},{"internalType":"string","name":"_teamB","type":"string"}],"name":"isInvalidNames","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_market","type":"string"}],"name":"isSupportedMarketType","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_isTwoPositionalSport","type":"bool"},{"internalType":"uint256","name":"_outcome","type":"uint256"}],"name":"isValidOutcomeForGame","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_outcome","type":"uint256"},{"internalType":"uint256","name":"_homeScore","type":"uint256"},{"internalType":"uint256","name":"_awayScore","type":"uint256"}],"name":"isValidOutcomeWithResult","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastPauseTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"oddsThresholdForSport","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_consumer","type":"address"}],"name":"setConsumerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"},{"internalType":"uint256","name":"_oddsThresholdForSport","type":"uint256"}],"name":"setCustomOddsThresholdForSport","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_defaultOddsThreshold","type":"uint256"}],"name":"setDefaultOddsThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"_invalidNames","type":"string[]"},{"internalType":"bool","name":"_isInvalid","type":"bool"}],"name":"setInvalidNames","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"_supportedMarketTypes","type":"string[]"},{"internalType":"bool","name":"_isSupported","type":"bool"}],"name":"setSupportedMarketTypes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"supportedMarketType","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"proxyAddress","type":"address"}],"name":"transferOwnershipAtInit","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50612059806100206000396000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c80637fabe16b1161011a578063ae71dcdf116100ad578063c3b83f5f1161007c578063c3b83f5f14610438578063c8bbcd961461044b578063d06c14671461045e578063efe2c8a41461047e578063f595901b1461049157600080fd5b8063ae71dcdf146103e5578063b216d974146103ed578063b4fd72961461040d578063c128f77b1461042557600080fd5b806397dc205d116100e957806397dc205d1461039957806398350f9a146103ac5780639ab21a77146103bf578063abc7b988146103d257600080fd5b80637fabe16b14610351578063879c0c5e146103645780638da5cb5b1461037757806391b4ded91461039057600080fd5b8063459c0bd01161019257806353a47bb71161016157806353a47bb7146102ee5780635c975abb1461031957806377874ce21461032657806379ba50971461034957600080fd5b8063459c0bd0146102b75780634b15c920146102bf578063503005ba146102c8578063519822f6146102db57600080fd5b80632fff7020116101ce5780632fff702014610263578063300a0298146102795780633d011ac91461028157806342fa646a146102a457600080fd5b806303727eb91461020057806313af4035146102285780631627540c1461023d57806316c38b3c14610250575b600080fd5b61021361020e366004611e49565b6104a4565b60405190151581526020015b60405180910390f35b61023b610236366004611ac0565b6104bb565b005b61023b61024b366004611ac0565b6105fb565b61023b61025e366004611c47565b610651565b61026b600181565b60405190815260200161021f565b61026b600281565b61021361028f366004611cff565b60046020526000908152604090205460ff1681565b6102136102b2366004611dab565b6106c7565b61026b600381565b61026b60065481565b61023b6102d6366004611bf7565b6107e0565b61023b6102e9366004611bf7565b610837565b600154610301906001600160a01b031681565b6040516001600160a01b03909116815260200161021f565b6003546102139060ff1681565b610213610334366004611cff565b60056020526000908152604090205460ff1681565b61023b61088a565b61021361035f366004611d4a565b610987565b610213610372366004611cd4565b6109e1565b600054610301906201000090046001600160a01b031681565b61026b60025481565b6102136103a7366004611d4a565b6109ed565b61023b6103ba366004611e28565b610ace565b61023b6103cd366004611cff565b610ce1565b6102136103e0366004611c7f565b610d67565b61026b600081565b6104006103fb366004611b64565b610d75565b60405161021f9190611ead565b6003546103019061010090046001600160a01b031681565b61023b610433366004611ada565b610d80565b61023b610446366004611ac0565b610e82565b610213610459366004611d17565b610f9b565b61026b61046c366004611cff565b60076020526000908152604090205481565b61023b61048c366004611ac0565b610fe1565b61021361049f366004611e49565b611087565b60006104b184848461116f565b90505b9392505050565b6001600160a01b0381166105165760405162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f7420626520300000000000000060448201526064015b60405180910390fd5b600154600160a01b900460ff16156105825760405162461bcd60e51b815260206004820152602960248201527f416c726561647920696e697469616c697a65642c20757365206e6f6d696e617460448201526832a732bba7bbb732b960b91b606482015260840161050d565b6001805460ff60a01b1916600160a01b179055600080546001600160a01b03831662010000810262010000600160b01b03199092169190911782556040805192835260208301919091527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91015b60405180910390a150565b6106036111b6565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906020016105f0565b6106596111b6565b60035460ff161515811515141561066d5750565b6003805460ff191682151590811790915560ff161561068b57426002555b60035460405160ff909116151581527f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5906020016105f0565b50565b600061072485856000815181106106ee57634e487b7160e01b600052603260045260246000fd5b60200260200101518560008151811061071757634e487b7160e01b600052603260045260246000fd5b6020026020010151611087565b80156107795750610779858560018151811061075057634e487b7160e01b600052603260045260246000fd5b60200260200101518560018151811061071757634e487b7160e01b600052603260045260246000fd5b80156107d5575081806107d557506107d585856002815181106107ac57634e487b7160e01b600052603260045260246000fd5b60200260200101518560028151811061071757634e487b7160e01b600052603260045260246000fd5b90505b949350505050565b6107e86111b6565b60008251116108295760405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b604482015260640161050d565b6108338282611230565b5050565b61083f6111b6565b60008251116108805760405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b604482015260640161050d565b61083382826113be565b6001546001600160a01b031633146109025760405162461bcd60e51b815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527402063616e20616363657074206f776e65727368697605c1b606482015260840161050d565b60005460015460408051620100009093046001600160a01b03908116845290911660208301527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a1600180546000805462010000600160b01b0319166001600160a01b03831662010000021790556001600160a01b0319169055565b60008160405160200161099a9190611e74565b60405160208183030381529060405280519060200120836040516020016109c19190611e74565b604051602081830303815290604052805190602001201490505b92915050565b60006104b48383611547565b600081604051602001610a009190611e74565b6040516020818303038152906040528051906020012083604051602001610a279190611e74565b604051602081830303815290604052805190602001201480610a8357506004600084604051602001610a599190611e74565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff165b806104b457506004600083604051602001610a9e9190611e74565b60408051808303601f190181529181528151602092830120835290820192909252016000205460ff169392505050565b610ad66111b6565b806006541415610b285760405162461bcd60e51b815260206004820152601b60248201527f53616d652076616c75652061732064656661756c742076616c75650000000000604482015260640161050d565b60008111610b715760405162461bcd60e51b81526020600482015260166024820152754d757374206265206d6f7265207468656e205a45524f60501b604482015260640161050d565b6003546040516305fc518960e31b8152600481018490526101009091046001600160a01b031690632fe28c489060240160206040518083038186803b158015610bb957600080fd5b505afa158015610bcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf19190611c63565b610c3d5760405162461bcd60e51b815260206004820152601860248201527f53706f72744964206973206e6f7420737570706f727465640000000000000000604482015260640161050d565b600082815260076020526040902054811415610c925760405162461bcd60e51b815260206004820152601460248201527353616d652076616c7565206173206265666f726560601b604482015260640161050d565b60008281526007602090815260409182902083905581518481529081018390527f69fd20fd8a4b59cc555abc063627a7fcecd991b0cf18c48122248455bf29699f910160405180910390a15050565b610ce96111b6565b60008111610d325760405162461bcd60e51b81526020600482015260166024820152754d757374206265206d6f7265207468656e205a45524f60501b604482015260640161050d565b60068190556040518181527f69d8ae57c22ebc10935a3fccebcf33c37abcf90af05eeafdf9d47b066c7a7b1f906020016105f0565b60006107d585858585611595565b60606109db826115e8565b600054610100900460ff16610d9b5760005460ff1615610d9f565b303b155b610e025760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161050d565b600054610100900460ff16158015610e24576000805461ffff19166101011790555b610e2d866104bb565b60038054610100600160a81b0319166101006001600160a01b03881602179055610e588460016113be565b610e63836001611230565b60068290558015610e7a576000805461ff00191690555b505050505050565b610e8a6111b6565b6001600160a01b038116610ed25760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015260640161050d565b600154600160a81b900460ff1615610f225760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481d1c985b9cd9995c9c9959606a1b604482015260640161050d565b600080546001600160a01b038381166201000081810262010000600160b01b031990941693909317938490556001805460ff60a81b1916600160a81b1790556040805193909404909116825260208201527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91016105f0565b60006005600083604051602001610fb29190611e74565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff1692915050565b610fe96111b6565b6001600160a01b0381166110315760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015260640161050d565b60038054610100600160a81b0319166101006001600160a01b038416908102919091179091556040519081527f5f56489645cc15092ffab877840903cb7715aca3464f50d3e323ed6465777bbb906020016105f0565b6000838152600760205260408120548190156110b1576000858152600760205260409020546110b5565b6006545b90508315806110c357508284145b156110d25760019150506104b4565b83831115611124576110eb662386f26fc1000082611f7e565b6110fd90670de0b6b3a7640000611f46565b8461111085670de0b6b3a7640000611f7e565b61111a9190611f5e565b11159150506104b4565b611135662386f26fc1000082611f7e565b84611148670de0b6b3a764000086611f7e565b6111529190611f5e565b61116490670de0b6b3a7640000611f9d565b111595945050505050565b6000836111895781158015611182575082155b90506104b4565b600184141561119b57508082116104b4565b60028414156111ad57508082106104b4565b508181146104b4565b6000546201000090046001600160a01b0316331461122e5760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201526e37b936903a3434b99030b1ba34b7b760891b606482015260840161050d565b565b60005b82518110156113b9578115156005600085848151811061126357634e487b7160e01b600052603260045260246000fd5b602002602001015160405160200161127b9190611e74565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff161515146113a75781600560008584815181106112d057634e487b7160e01b600052603260045260246000fd5b60200260200101516040516020016112e89190611e74565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff0219169083151502179055507fa8ffdf44a3dd40e8518ed36f55dbddd07d532e8d4e62cfc9af80dabb7a93c61483828151811061136457634e487b7160e01b600052603260045260246000fd5b602002602001015160405160200161137c9190611e74565b60408051601f1981840301815282825280516020918201208352851515908301520160405180910390a15b806113b181611fb4565b915050611233565b505050565b60005b82518110156113b957811515600460008584815181106113f157634e487b7160e01b600052603260045260246000fd5b60200260200101516040516020016114099190611e74565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff1615151461153557816004600085848151811061145e57634e487b7160e01b600052603260045260246000fd5b60200260200101516040516020016114769190611e74565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff0219169083151502179055507ffe28881086408823936cdab8f3b6bb8baf3b5cfe62e5c5c136ba3fefbb5d09c28382815181106114f257634e487b7160e01b600052603260045260246000fd5b602002602001015160405160200161150a9190611e74565b60408051601f1981840301815282825280516020918201208352851515908301520160405180910390a15b8061153f81611fb4565b9150506113c1565b6000821561156e57600182148061155e5750600282145b80611567575081155b90506109db565b600182148061157d5750600282145b806115885750600382145b806104b457505015919050565b600084156115bc578260020b6000141580156115b557508360020b600014155b90506107d8565b8260020b6000141580156115d457508360020b600014155b80156115b5575050600281900b15156107d8565b60606000825167ffffffffffffffff81111561161457634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561163d578160200160208202803683370190505b5090506000805b845181101561186557600085828151811061166f57634e487b7160e01b600052603260045260246000fd5b6020026020010151600014156116b25760008483815181106116a157634e487b7160e01b600052603260045260246000fd5b60200260200101818152505061181c565b60008683815181106116d457634e487b7160e01b600052603260045260246000fd5b602002602001015113156117595785828151811061170257634e487b7160e01b600052603260045260246000fd5b602002602001015190508061271061171a9190611f46565b61172e9069021e19e0c9bab2400000611f5e565b611739906064611f7e565b8483815181106116a157634e487b7160e01b600052603260045260246000fd5b600086838151811061177b57634e487b7160e01b600052603260045260246000fd5b6020026020010151121561181c578582815181106117a957634e487b7160e01b600052603260045260246000fd5b60200260200101516117ba90611fcf565b90506117c881612710611f46565b6117da82670de0b6b3a7640000611f7e565b6117e49190611f5e565b6117ef906064611f7e565b84838151811061180f57634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b83828151811061183c57634e487b7160e01b600052603260045260246000fd5b60200260200101518361184f9190611f46565b925050808061185d90611fb4565b915050611644565b5060005b825181101561192f57816118aa57600083828151811061189957634e487b7160e01b600052603260045260246000fd5b60200260200101818152505061191d565b818382815181106118cb57634e487b7160e01b600052603260045260246000fd5b6020026020010151670de0b6b3a76400006118e69190611f7e565b6118f09190611f5e565b83828151811061191057634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b8061192781611fb4565b915050611869565b50909392505050565b80356001600160a01b038116811461194f57600080fd5b919050565b600082601f830112611964578081fd5b8135602061197961197483611f22565b611ef1565b80838252828201915082860187848660051b8901011115611998578586fd5b855b858110156119d957813567ffffffffffffffff8111156119b8578788fd5b6119c68a87838c0101611a55565b855250928401929084019060010161199a565b5090979650505050505050565b600082601f8301126119f6578081fd5b81356020611a0661197483611f22565b80838252828201915082860187848660051b8901011115611a25578586fd5b855b858110156119d957813584529284019290840190600101611a27565b8035600281900b811461194f57600080fd5b600082601f830112611a65578081fd5b813567ffffffffffffffff811115611a7f57611a7f611fff565b611a92601f8201601f1916602001611ef1565b818152846020838601011115611aa6578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215611ad1578081fd5b6104b482611938565b600080600080600060a08688031215611af1578081fd5b611afa86611938565b9450611b0860208701611938565b9350604086013567ffffffffffffffff80821115611b24578283fd5b611b3089838a01611954565b94506060880135915080821115611b45578283fd5b50611b5288828901611954565b95989497509295608001359392505050565b60006020808385031215611b76578182fd5b823567ffffffffffffffff811115611b8c578283fd5b8301601f81018513611b9c578283fd5b8035611baa61197482611f22565b80828252848201915084840188868560051b8701011115611bc9578687fd5b8694505b83851015611beb578035835260019490940193918501918501611bcd565b50979650505050505050565b60008060408385031215611c09578182fd5b823567ffffffffffffffff811115611c1f578283fd5b611c2b85828601611954565b9250506020830135611c3c81612015565b809150509250929050565b600060208284031215611c58578081fd5b81356104b481612015565b600060208284031215611c74578081fd5b81516104b481612015565b60008060008060808587031215611c94578384fd5b8435611c9f81612015565b9350611cad60208601611a43565b9250611cbb60408601611a43565b9150611cc960608601611a43565b905092959194509250565b60008060408385031215611ce6578182fd5b8235611cf181612015565b946020939093013593505050565b600060208284031215611d10578081fd5b5035919050565b600060208284031215611d28578081fd5b813567ffffffffffffffff811115611d3e578182fd5b6107d884828501611a55565b60008060408385031215611d5c578182fd5b823567ffffffffffffffff80821115611d73578384fd5b611d7f86838701611a55565b93506020850135915080821115611d94578283fd5b50611da185828601611a55565b9150509250929050565b60008060008060808587031215611dc0578182fd5b84359350602085013567ffffffffffffffff80821115611dde578384fd5b611dea888389016119e6565b94506040870135915080821115611dff578384fd5b50611e0c878288016119e6565b9250506060850135611e1d81612015565b939692955090935050565b60008060408385031215611e3a578182fd5b50508035926020909101359150565b600080600060608486031215611e5d578081fd5b505081359360208301359350604090920135919050565b60008251815b81811015611e945760208186018101518583015201611e7a565b81811115611ea25782828501525b509190910192915050565b6020808252825182820181905260009190848201906040850190845b81811015611ee557835183529284019291840191600101611ec9565b50909695505050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715611f1a57611f1a611fff565b604052919050565b600067ffffffffffffffff821115611f3c57611f3c611fff565b5060051b60200190565b60008219821115611f5957611f59611fe9565b500190565b600082611f7957634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611f9857611f98611fe9565b500290565b600082821015611faf57611faf611fe9565b500390565b6000600019821415611fc857611fc8611fe9565b5060010190565b6000600160ff1b821415611fe557611fe5611fe9565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146106c457600080fdfea26469706673582212204a36398954e59521d652ac36b63073a4fc1cd6c36bd89106f1de2dacc90b72f964736f6c63430008040033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c80637fabe16b1161011a578063ae71dcdf116100ad578063c3b83f5f1161007c578063c3b83f5f14610438578063c8bbcd961461044b578063d06c14671461045e578063efe2c8a41461047e578063f595901b1461049157600080fd5b8063ae71dcdf146103e5578063b216d974146103ed578063b4fd72961461040d578063c128f77b1461042557600080fd5b806397dc205d116100e957806397dc205d1461039957806398350f9a146103ac5780639ab21a77146103bf578063abc7b988146103d257600080fd5b80637fabe16b14610351578063879c0c5e146103645780638da5cb5b1461037757806391b4ded91461039057600080fd5b8063459c0bd01161019257806353a47bb71161016157806353a47bb7146102ee5780635c975abb1461031957806377874ce21461032657806379ba50971461034957600080fd5b8063459c0bd0146102b75780634b15c920146102bf578063503005ba146102c8578063519822f6146102db57600080fd5b80632fff7020116101ce5780632fff702014610263578063300a0298146102795780633d011ac91461028157806342fa646a146102a457600080fd5b806303727eb91461020057806313af4035146102285780631627540c1461023d57806316c38b3c14610250575b600080fd5b61021361020e366004611e49565b6104a4565b60405190151581526020015b60405180910390f35b61023b610236366004611ac0565b6104bb565b005b61023b61024b366004611ac0565b6105fb565b61023b61025e366004611c47565b610651565b61026b600181565b60405190815260200161021f565b61026b600281565b61021361028f366004611cff565b60046020526000908152604090205460ff1681565b6102136102b2366004611dab565b6106c7565b61026b600381565b61026b60065481565b61023b6102d6366004611bf7565b6107e0565b61023b6102e9366004611bf7565b610837565b600154610301906001600160a01b031681565b6040516001600160a01b03909116815260200161021f565b6003546102139060ff1681565b610213610334366004611cff565b60056020526000908152604090205460ff1681565b61023b61088a565b61021361035f366004611d4a565b610987565b610213610372366004611cd4565b6109e1565b600054610301906201000090046001600160a01b031681565b61026b60025481565b6102136103a7366004611d4a565b6109ed565b61023b6103ba366004611e28565b610ace565b61023b6103cd366004611cff565b610ce1565b6102136103e0366004611c7f565b610d67565b61026b600081565b6104006103fb366004611b64565b610d75565b60405161021f9190611ead565b6003546103019061010090046001600160a01b031681565b61023b610433366004611ada565b610d80565b61023b610446366004611ac0565b610e82565b610213610459366004611d17565b610f9b565b61026b61046c366004611cff565b60076020526000908152604090205481565b61023b61048c366004611ac0565b610fe1565b61021361049f366004611e49565b611087565b60006104b184848461116f565b90505b9392505050565b6001600160a01b0381166105165760405162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f7420626520300000000000000060448201526064015b60405180910390fd5b600154600160a01b900460ff16156105825760405162461bcd60e51b815260206004820152602960248201527f416c726561647920696e697469616c697a65642c20757365206e6f6d696e617460448201526832a732bba7bbb732b960b91b606482015260840161050d565b6001805460ff60a01b1916600160a01b179055600080546001600160a01b03831662010000810262010000600160b01b03199092169190911782556040805192835260208301919091527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91015b60405180910390a150565b6106036111b6565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906020016105f0565b6106596111b6565b60035460ff161515811515141561066d5750565b6003805460ff191682151590811790915560ff161561068b57426002555b60035460405160ff909116151581527f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5906020016105f0565b50565b600061072485856000815181106106ee57634e487b7160e01b600052603260045260246000fd5b60200260200101518560008151811061071757634e487b7160e01b600052603260045260246000fd5b6020026020010151611087565b80156107795750610779858560018151811061075057634e487b7160e01b600052603260045260246000fd5b60200260200101518560018151811061071757634e487b7160e01b600052603260045260246000fd5b80156107d5575081806107d557506107d585856002815181106107ac57634e487b7160e01b600052603260045260246000fd5b60200260200101518560028151811061071757634e487b7160e01b600052603260045260246000fd5b90505b949350505050565b6107e86111b6565b60008251116108295760405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b604482015260640161050d565b6108338282611230565b5050565b61083f6111b6565b60008251116108805760405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b604482015260640161050d565b61083382826113be565b6001546001600160a01b031633146109025760405162461bcd60e51b815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527402063616e20616363657074206f776e65727368697605c1b606482015260840161050d565b60005460015460408051620100009093046001600160a01b03908116845290911660208301527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a1600180546000805462010000600160b01b0319166001600160a01b03831662010000021790556001600160a01b0319169055565b60008160405160200161099a9190611e74565b60405160208183030381529060405280519060200120836040516020016109c19190611e74565b604051602081830303815290604052805190602001201490505b92915050565b60006104b48383611547565b600081604051602001610a009190611e74565b6040516020818303038152906040528051906020012083604051602001610a279190611e74565b604051602081830303815290604052805190602001201480610a8357506004600084604051602001610a599190611e74565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff165b806104b457506004600083604051602001610a9e9190611e74565b60408051808303601f190181529181528151602092830120835290820192909252016000205460ff169392505050565b610ad66111b6565b806006541415610b285760405162461bcd60e51b815260206004820152601b60248201527f53616d652076616c75652061732064656661756c742076616c75650000000000604482015260640161050d565b60008111610b715760405162461bcd60e51b81526020600482015260166024820152754d757374206265206d6f7265207468656e205a45524f60501b604482015260640161050d565b6003546040516305fc518960e31b8152600481018490526101009091046001600160a01b031690632fe28c489060240160206040518083038186803b158015610bb957600080fd5b505afa158015610bcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf19190611c63565b610c3d5760405162461bcd60e51b815260206004820152601860248201527f53706f72744964206973206e6f7420737570706f727465640000000000000000604482015260640161050d565b600082815260076020526040902054811415610c925760405162461bcd60e51b815260206004820152601460248201527353616d652076616c7565206173206265666f726560601b604482015260640161050d565b60008281526007602090815260409182902083905581518481529081018390527f69fd20fd8a4b59cc555abc063627a7fcecd991b0cf18c48122248455bf29699f910160405180910390a15050565b610ce96111b6565b60008111610d325760405162461bcd60e51b81526020600482015260166024820152754d757374206265206d6f7265207468656e205a45524f60501b604482015260640161050d565b60068190556040518181527f69d8ae57c22ebc10935a3fccebcf33c37abcf90af05eeafdf9d47b066c7a7b1f906020016105f0565b60006107d585858585611595565b60606109db826115e8565b600054610100900460ff16610d9b5760005460ff1615610d9f565b303b155b610e025760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161050d565b600054610100900460ff16158015610e24576000805461ffff19166101011790555b610e2d866104bb565b60038054610100600160a81b0319166101006001600160a01b03881602179055610e588460016113be565b610e63836001611230565b60068290558015610e7a576000805461ff00191690555b505050505050565b610e8a6111b6565b6001600160a01b038116610ed25760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015260640161050d565b600154600160a81b900460ff1615610f225760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481d1c985b9cd9995c9c9959606a1b604482015260640161050d565b600080546001600160a01b038381166201000081810262010000600160b01b031990941693909317938490556001805460ff60a81b1916600160a81b1790556040805193909404909116825260208201527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91016105f0565b60006005600083604051602001610fb29190611e74565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff1692915050565b610fe96111b6565b6001600160a01b0381166110315760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015260640161050d565b60038054610100600160a81b0319166101006001600160a01b038416908102919091179091556040519081527f5f56489645cc15092ffab877840903cb7715aca3464f50d3e323ed6465777bbb906020016105f0565b6000838152600760205260408120548190156110b1576000858152600760205260409020546110b5565b6006545b90508315806110c357508284145b156110d25760019150506104b4565b83831115611124576110eb662386f26fc1000082611f7e565b6110fd90670de0b6b3a7640000611f46565b8461111085670de0b6b3a7640000611f7e565b61111a9190611f5e565b11159150506104b4565b611135662386f26fc1000082611f7e565b84611148670de0b6b3a764000086611f7e565b6111529190611f5e565b61116490670de0b6b3a7640000611f9d565b111595945050505050565b6000836111895781158015611182575082155b90506104b4565b600184141561119b57508082116104b4565b60028414156111ad57508082106104b4565b508181146104b4565b6000546201000090046001600160a01b0316331461122e5760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201526e37b936903a3434b99030b1ba34b7b760891b606482015260840161050d565b565b60005b82518110156113b9578115156005600085848151811061126357634e487b7160e01b600052603260045260246000fd5b602002602001015160405160200161127b9190611e74565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff161515146113a75781600560008584815181106112d057634e487b7160e01b600052603260045260246000fd5b60200260200101516040516020016112e89190611e74565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff0219169083151502179055507fa8ffdf44a3dd40e8518ed36f55dbddd07d532e8d4e62cfc9af80dabb7a93c61483828151811061136457634e487b7160e01b600052603260045260246000fd5b602002602001015160405160200161137c9190611e74565b60408051601f1981840301815282825280516020918201208352851515908301520160405180910390a15b806113b181611fb4565b915050611233565b505050565b60005b82518110156113b957811515600460008584815181106113f157634e487b7160e01b600052603260045260246000fd5b60200260200101516040516020016114099190611e74565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff1615151461153557816004600085848151811061145e57634e487b7160e01b600052603260045260246000fd5b60200260200101516040516020016114769190611e74565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff0219169083151502179055507ffe28881086408823936cdab8f3b6bb8baf3b5cfe62e5c5c136ba3fefbb5d09c28382815181106114f257634e487b7160e01b600052603260045260246000fd5b602002602001015160405160200161150a9190611e74565b60408051601f1981840301815282825280516020918201208352851515908301520160405180910390a15b8061153f81611fb4565b9150506113c1565b6000821561156e57600182148061155e5750600282145b80611567575081155b90506109db565b600182148061157d5750600282145b806115885750600382145b806104b457505015919050565b600084156115bc578260020b6000141580156115b557508360020b600014155b90506107d8565b8260020b6000141580156115d457508360020b600014155b80156115b5575050600281900b15156107d8565b60606000825167ffffffffffffffff81111561161457634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561163d578160200160208202803683370190505b5090506000805b845181101561186557600085828151811061166f57634e487b7160e01b600052603260045260246000fd5b6020026020010151600014156116b25760008483815181106116a157634e487b7160e01b600052603260045260246000fd5b60200260200101818152505061181c565b60008683815181106116d457634e487b7160e01b600052603260045260246000fd5b602002602001015113156117595785828151811061170257634e487b7160e01b600052603260045260246000fd5b602002602001015190508061271061171a9190611f46565b61172e9069021e19e0c9bab2400000611f5e565b611739906064611f7e565b8483815181106116a157634e487b7160e01b600052603260045260246000fd5b600086838151811061177b57634e487b7160e01b600052603260045260246000fd5b6020026020010151121561181c578582815181106117a957634e487b7160e01b600052603260045260246000fd5b60200260200101516117ba90611fcf565b90506117c881612710611f46565b6117da82670de0b6b3a7640000611f7e565b6117e49190611f5e565b6117ef906064611f7e565b84838151811061180f57634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b83828151811061183c57634e487b7160e01b600052603260045260246000fd5b60200260200101518361184f9190611f46565b925050808061185d90611fb4565b915050611644565b5060005b825181101561192f57816118aa57600083828151811061189957634e487b7160e01b600052603260045260246000fd5b60200260200101818152505061191d565b818382815181106118cb57634e487b7160e01b600052603260045260246000fd5b6020026020010151670de0b6b3a76400006118e69190611f7e565b6118f09190611f5e565b83828151811061191057634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b8061192781611fb4565b915050611869565b50909392505050565b80356001600160a01b038116811461194f57600080fd5b919050565b600082601f830112611964578081fd5b8135602061197961197483611f22565b611ef1565b80838252828201915082860187848660051b8901011115611998578586fd5b855b858110156119d957813567ffffffffffffffff8111156119b8578788fd5b6119c68a87838c0101611a55565b855250928401929084019060010161199a565b5090979650505050505050565b600082601f8301126119f6578081fd5b81356020611a0661197483611f22565b80838252828201915082860187848660051b8901011115611a25578586fd5b855b858110156119d957813584529284019290840190600101611a27565b8035600281900b811461194f57600080fd5b600082601f830112611a65578081fd5b813567ffffffffffffffff811115611a7f57611a7f611fff565b611a92601f8201601f1916602001611ef1565b818152846020838601011115611aa6578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215611ad1578081fd5b6104b482611938565b600080600080600060a08688031215611af1578081fd5b611afa86611938565b9450611b0860208701611938565b9350604086013567ffffffffffffffff80821115611b24578283fd5b611b3089838a01611954565b94506060880135915080821115611b45578283fd5b50611b5288828901611954565b95989497509295608001359392505050565b60006020808385031215611b76578182fd5b823567ffffffffffffffff811115611b8c578283fd5b8301601f81018513611b9c578283fd5b8035611baa61197482611f22565b80828252848201915084840188868560051b8701011115611bc9578687fd5b8694505b83851015611beb578035835260019490940193918501918501611bcd565b50979650505050505050565b60008060408385031215611c09578182fd5b823567ffffffffffffffff811115611c1f578283fd5b611c2b85828601611954565b9250506020830135611c3c81612015565b809150509250929050565b600060208284031215611c58578081fd5b81356104b481612015565b600060208284031215611c74578081fd5b81516104b481612015565b60008060008060808587031215611c94578384fd5b8435611c9f81612015565b9350611cad60208601611a43565b9250611cbb60408601611a43565b9150611cc960608601611a43565b905092959194509250565b60008060408385031215611ce6578182fd5b8235611cf181612015565b946020939093013593505050565b600060208284031215611d10578081fd5b5035919050565b600060208284031215611d28578081fd5b813567ffffffffffffffff811115611d3e578182fd5b6107d884828501611a55565b60008060408385031215611d5c578182fd5b823567ffffffffffffffff80821115611d73578384fd5b611d7f86838701611a55565b93506020850135915080821115611d94578283fd5b50611da185828601611a55565b9150509250929050565b60008060008060808587031215611dc0578182fd5b84359350602085013567ffffffffffffffff80821115611dde578384fd5b611dea888389016119e6565b94506040870135915080821115611dff578384fd5b50611e0c878288016119e6565b9250506060850135611e1d81612015565b939692955090935050565b60008060408385031215611e3a578182fd5b50508035926020909101359150565b600080600060608486031215611e5d578081fd5b505081359360208301359350604090920135919050565b60008251815b81811015611e945760208186018101518583015201611e7a565b81811115611ea25782828501525b509190910192915050565b6020808252825182820181905260009190848201906040850190845b81811015611ee557835183529284019291840191600101611ec9565b50909695505050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715611f1a57611f1a611fff565b604052919050565b600067ffffffffffffffff821115611f3c57611f3c611fff565b5060051b60200190565b60008219821115611f5957611f59611fe9565b500190565b600082611f7957634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611f9857611f98611fe9565b500290565b600082821015611faf57611faf611fe9565b500390565b6000600019821415611fc857611fc8611fe9565b5060010190565b6000600160ff1b821415611fe557611fe5611fe9565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146106c457600080fdfea26469706673582212204a36398954e59521d652ac36b63073a4fc1cd6c36bd89106f1de2dacc90b72f964736f6c63430008040033
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.