Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- AggregatorProxy
- Optimization enabled
- true
- Compiler version
- v0.8.6+commit.11564f7e
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2024-07-18T09:02:05.814723Z
Constructor Arguments
000000000000000000000000798df1d82009421e3497d4b1d93912138299997c
Arg [0] (address) : 0x798df1d82009421e3497d4b1d93912138299997c
contracts/AggreagatorProxy.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "@openzeppelin/contracts/access/Ownable.sol"; import "./interfaces/AggregatorV2V3Interface.sol"; /** * @title A trusted proxy for updating where current answers are read from * @notice This contract provides a consistent address for the * CurrentAnwerInterface but delegates where it reads from to the owner, who is * trusted to update it. */ contract AggregatorProxy is AggregatorV2V3Interface, Ownable { struct Phase { uint16 id; AggregatorV2V3Interface aggregator; } Phase private currentPhase; AggregatorV2V3Interface public proposedAggregator; mapping(uint16 => AggregatorV2V3Interface) public phaseAggregators; uint256 constant private PHASE_OFFSET = 64; uint256 constant private PHASE_SIZE = 16; uint256 constant private MAX_ID = 2**(PHASE_OFFSET+PHASE_SIZE) - 1; constructor(address _aggregator) { setAggregator(_aggregator); } /** * @notice Reads the current answer from aggregator delegated to. * * @dev #[deprecated] Use latestRoundData instead. This does not error if no * answer has been reached, it will simply return 0. Either wait to point to * an already answered Aggregator or use the recommended latestRoundData * instead which includes better verification information. */ function latestAnswer() public view virtual override returns (int256 answer) { return currentPhase.aggregator.latestAnswer(); } /** * @notice Reads the last updated height from aggregator delegated to. * * @dev #[deprecated] Use latestRoundData instead. This does not error if no * answer has been reached, it will simply return 0. Either wait to point to * an already answered Aggregator or use the recommended latestRoundData * instead which includes better verification information. */ function latestTimestamp() public view virtual override returns (uint256 updatedAt) { return currentPhase.aggregator.latestTimestamp(); } /** * @notice get past rounds answers * @param _roundId the answer number to retrieve the answer for * * @dev #[deprecated] Use getRoundData instead. This does not error if no * answer has been reached, it will simply return 0. Either wait to point to * an already answered Aggregator or use the recommended getRoundData * instead which includes better verification information. */ function getAnswer(uint256 _roundId) public view virtual override returns (int256 answer) { if (_roundId > MAX_ID) return 0; (uint16 phaseId, uint64 aggregatorRoundId) = parseIds(_roundId); AggregatorV2V3Interface aggregator = phaseAggregators[phaseId]; if (address(aggregator) == address(0)) return 0; return aggregator.getAnswer(aggregatorRoundId); } /** * @notice get block timestamp when an answer was last updated * @param _roundId the answer number to retrieve the updated timestamp for * * @dev #[deprecated] Use getRoundData instead. This does not error if no * answer has been reached, it will simply return 0. Either wait to point to * an already answered Aggregator or use the recommended getRoundData * instead which includes better verification information. */ function getTimestamp(uint256 _roundId) public view virtual override returns (uint256 updatedAt) { if (_roundId > MAX_ID) return 0; (uint16 phaseId, uint64 aggregatorRoundId) = parseIds(_roundId); AggregatorV2V3Interface aggregator = phaseAggregators[phaseId]; if (address(aggregator) == address(0)) return 0; return aggregator.getTimestamp(aggregatorRoundId); } /** * @notice get the latest completed round where the answer was updated. This * ID includes the proxy's phase, to make sure round IDs increase even when * switching to a newly deployed aggregator. * * @dev #[deprecated] Use latestRoundData instead. This does not error if no * answer has been reached, it will simply return 0. Either wait to point to * an already answered Aggregator or use the recommended latestRoundData * instead which includes better verification information. */ function latestRound() public view virtual override returns (uint256 roundId) { Phase memory phase = currentPhase; // cache storage reads return addPhase(phase.id, uint64(phase.aggregator.latestRound())); } /** * @notice get data about a round. Consumers are encouraged to check * that they're receiving fresh data by inspecting the updatedAt and * answeredInRound return values. * Note that different underlying implementations of AggregatorV3Interface * have slightly different semantics for some of the return values. Consumers * should determine what implementations they expect to receive * data from and validate that they can properly handle return data from all * of them. * @param _roundId the requested round ID as presented through the proxy, this * is made up of the aggregator's round ID with the phase ID encoded in the * two highest order bytes * @return roundId is the round ID from the aggregator for which the data was * retrieved combined with an phase to ensure that round IDs get larger as * time moves forward. * @return answer is the answer for the given round * @return startedAt is the timestamp when the round was started. * (Only some AggregatorV3Interface implementations return meaningful values) * @return updatedAt is the timestamp when the round last was updated (i.e. * answer was last computed) * @return answeredInRound is the round ID of the round in which the answer * was computed. * (Only some AggregatorV3Interface implementations return meaningful values) * @dev Note that answer and updatedAt may change between queries. */ function getRoundData(uint80 _roundId) public view virtual override returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ) { (uint16 phaseId, uint64 aggregatorRoundId) = parseIds(_roundId); ( roundId, answer, startedAt, updatedAt, answeredInRound ) = phaseAggregators[phaseId].getRoundData(aggregatorRoundId); return addPhaseIds(roundId, answer, startedAt, updatedAt, answeredInRound, phaseId); } /** * @notice get data about the latest round. Consumers are encouraged to check * that they're receiving fresh data by inspecting the updatedAt and * answeredInRound return values. * Note that different underlying implementations of AggregatorV3Interface * have slightly different semantics for some of the return values. Consumers * should determine what implementations they expect to receive * data from and validate that they can properly handle return data from all * of them. * @return roundId is the round ID from the aggregator for which the data was * retrieved combined with an phase to ensure that round IDs get larger as * time moves forward. * @return answer is the answer for the given round * @return startedAt is the timestamp when the round was started. * (Only some AggregatorV3Interface implementations return meaningful values) * @return updatedAt is the timestamp when the round last was updated (i.e. * answer was last computed) * @return answeredInRound is the round ID of the round in which the answer * was computed. * (Only some AggregatorV3Interface implementations return meaningful values) * @dev Note that answer and updatedAt may change between queries. */ function latestRoundData() public view virtual override returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ) { Phase memory current = currentPhase; // cache storage reads ( roundId, answer, startedAt, updatedAt, answeredInRound ) = current.aggregator.latestRoundData(); return addPhaseIds(roundId, answer, startedAt, updatedAt, answeredInRound, current.id); } /** * @notice Used if an aggregator contract has been proposed. * @param _roundId the round ID to retrieve the round data for * @return roundId is the round ID for which data was retrieved * @return answer is the answer for the given round * @return startedAt is the timestamp when the round was started. * (Only some AggregatorV3Interface implementations return meaningful values) * @return updatedAt is the timestamp when the round last was updated (i.e. * answer was last computed) * @return answeredInRound is the round ID of the round in which the answer * was computed. */ function proposedGetRoundData(uint80 _roundId) public view virtual hasProposal() returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ) { return proposedAggregator.getRoundData(_roundId); } /** * @notice Used if an aggregator contract has been proposed. * @return roundId is the round ID for which data was retrieved * @return answer is the answer for the given round * @return startedAt is the timestamp when the round was started. * (Only some AggregatorV3Interface implementations return meaningful values) * @return updatedAt is the timestamp when the round last was updated (i.e. * answer was last computed) * @return answeredInRound is the round ID of the round in which the answer * was computed. */ function proposedLatestRoundData() public view virtual hasProposal() returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ) { return proposedAggregator.latestRoundData(); } /** * @notice returns the current phase's aggregator address. */ function aggregator() external view returns (address) { return address(currentPhase.aggregator); } /** * @notice returns the current phase's ID. */ function phaseId() external view returns (uint16) { return currentPhase.id; } /** * @notice represents the number of decimals the aggregator responses represent. */ function decimals() external view override returns (uint8) { return currentPhase.aggregator.decimals(); } /** * @notice the version number representing the type of aggregator the proxy * points to. */ function version() external view override returns (uint256) { return currentPhase.aggregator.version(); } /** * @notice returns the description of the aggregator the proxy points to. */ function description() external view override returns (string memory) { return currentPhase.aggregator.description(); } /** * @notice Allows the owner to propose a new address for the aggregator * @param _aggregator The new address for the aggregator contract */ function proposeAggregator(address _aggregator) external onlyOwner() { proposedAggregator = AggregatorV2V3Interface(_aggregator); } /** * @notice Allows the owner to confirm and change the address * to the proposed aggregator * @dev Reverts if the given address doesn't match what was previously * proposed * @param _aggregator The new address for the aggregator contract */ function confirmAggregator(address _aggregator) external onlyOwner() { require(_aggregator == address(proposedAggregator), "Invalid proposed aggregator"); delete proposedAggregator; setAggregator(_aggregator); } /* * Internal */ function setAggregator(address _aggregator) internal { uint16 id = currentPhase.id + 1; currentPhase = Phase(id, AggregatorV2V3Interface(_aggregator)); phaseAggregators[id] = AggregatorV2V3Interface(_aggregator); } function addPhase( uint16 _phase, uint64 _originalId ) internal pure returns (uint80) { return uint80(uint256(_phase) << PHASE_OFFSET | _originalId); } function parseIds( uint256 _roundId ) internal pure returns (uint16, uint64) { uint16 phaseId = uint16(_roundId >> PHASE_OFFSET); uint64 aggregatorRoundId = uint64(_roundId); return (phaseId, aggregatorRoundId); } function addPhaseIds( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound, uint16 phaseId ) internal pure returns (uint80, int256, uint256, uint256, uint80) { return ( addPhase(phaseId, uint64(roundId)), answer, startedAt, updatedAt, addPhase(phaseId, uint64(answeredInRound)) ); } /* * Modifiers */ modifier hasProposal() { require(address(proposedAggregator) != address(0), "No proposed aggregator present"); _; } }
contracts/interfaces/AggregatorV2V3Interface.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "./AggregatorInterface.sol"; import "./AggregatorV3Interface.sol"; interface AggregatorV2V3Interface is AggregatorInterface, AggregatorV3Interface { }
contracts/interfaces/AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; interface AggregatorV3Interface { function decimals() external view returns ( uint8 ); function description() external view returns ( string memory ); function version() external view returns ( uint256 ); function getRoundData( uint80 _roundId ) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); }
@openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
@openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
contracts/interfaces/AggregatorInterface.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; interface AggregatorInterface { function latestAnswer() external view returns ( int256 ); function latestTimestamp() external view returns ( uint256 ); function latestRound() external view returns ( uint256 ); function getAnswer( uint256 roundId ) external view returns ( int256 ); function getTimestamp( uint256 roundId ) external view returns ( uint256 ); event AnswerUpdated( int256 indexed current, uint256 indexed roundId, uint256 updatedAt ); event NewRound( uint256 indexed roundId, address indexed startedBy, uint256 startedAt ); }
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata","devdoc","userdoc","storageLayout","evm.gasEstimates"],"":["ast"]}},"optimizer":{"runs":200,"enabled":true},"metadata":{"useLiteralContent":true},"libraries":{}}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_aggregator","internalType":"address"}]},{"type":"event","name":"AnswerUpdated","inputs":[{"type":"int256","name":"current","internalType":"int256","indexed":true},{"type":"uint256","name":"roundId","internalType":"uint256","indexed":true},{"type":"uint256","name":"updatedAt","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"NewRound","inputs":[{"type":"uint256","name":"roundId","internalType":"uint256","indexed":true},{"type":"address","name":"startedBy","internalType":"address","indexed":true},{"type":"uint256","name":"startedAt","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"aggregator","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"confirmAggregator","inputs":[{"type":"address","name":"_aggregator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"description","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"int256","name":"answer","internalType":"int256"}],"name":"getAnswer","inputs":[{"type":"uint256","name":"_roundId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint80","name":"roundId","internalType":"uint80"},{"type":"int256","name":"answer","internalType":"int256"},{"type":"uint256","name":"startedAt","internalType":"uint256"},{"type":"uint256","name":"updatedAt","internalType":"uint256"},{"type":"uint80","name":"answeredInRound","internalType":"uint80"}],"name":"getRoundData","inputs":[{"type":"uint80","name":"_roundId","internalType":"uint80"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"updatedAt","internalType":"uint256"}],"name":"getTimestamp","inputs":[{"type":"uint256","name":"_roundId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"int256","name":"answer","internalType":"int256"}],"name":"latestAnswer","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"roundId","internalType":"uint256"}],"name":"latestRound","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint80","name":"roundId","internalType":"uint80"},{"type":"int256","name":"answer","internalType":"int256"},{"type":"uint256","name":"startedAt","internalType":"uint256"},{"type":"uint256","name":"updatedAt","internalType":"uint256"},{"type":"uint80","name":"answeredInRound","internalType":"uint80"}],"name":"latestRoundData","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"updatedAt","internalType":"uint256"}],"name":"latestTimestamp","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract AggregatorV2V3Interface"}],"name":"phaseAggregators","inputs":[{"type":"uint16","name":"","internalType":"uint16"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint16","name":"","internalType":"uint16"}],"name":"phaseId","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"proposeAggregator","inputs":[{"type":"address","name":"_aggregator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract AggregatorV2V3Interface"}],"name":"proposedAggregator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint80","name":"roundId","internalType":"uint80"},{"type":"int256","name":"answer","internalType":"int256"},{"type":"uint256","name":"startedAt","internalType":"uint256"},{"type":"uint256","name":"updatedAt","internalType":"uint256"},{"type":"uint80","name":"answeredInRound","internalType":"uint80"}],"name":"proposedGetRoundData","inputs":[{"type":"uint80","name":"_roundId","internalType":"uint80"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint80","name":"roundId","internalType":"uint80"},{"type":"int256","name":"answer","internalType":"int256"},{"type":"uint256","name":"startedAt","internalType":"uint256"},{"type":"uint256","name":"updatedAt","internalType":"uint256"},{"type":"uint80","name":"answeredInRound","internalType":"uint80"}],"name":"proposedLatestRoundData","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"version","inputs":[]}]
Contract Creation Code
0x608060405234801561001057600080fd5b50604051620013583803806200135883398101604081905261003191610110565b61003a33610049565b61004381610099565b50610174565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600180546000916100ae9161ffff1690610140565b60408051808201825261ffff9092168083526001600160a01b039094166020928301819052600180546201000083026001600160b01b031990911687171790556000948552600390925290922080546001600160a01b03191690921790915550565b60006020828403121561012257600080fd5b81516001600160a01b038116811461013957600080fd5b9392505050565b600061ffff80831681851680830382111561016b57634e487b7160e01b600052601160045260246000fd5b01949350505050565b6111d480620001846000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c80638da5cb5b116100b8578063b633620c1161007c578063b633620c14610282578063c159730414610295578063e8c4be30146102be578063f2fde38b146102d1578063f8a2abd3146102e4578063feaf968c146102f757600080fd5b80638da5cb5b146102305780638f6b4d91146102415780639a6fc8f514610249578063a928c0961461025c578063b5ab58dc1461026f57600080fd5b80636001ac53116100ff5780636001ac53146101ba578063668a0f0214610201578063715018a6146102095780637284e416146102135780638205bf6a1461022857600080fd5b8063245a7bfc1461013c578063313ce5671461016c57806350d25bcd1461018657806354fd4d501461019c57806358303b10146101a4575b600080fd5b6001546201000090046001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6101746102ff565b60405160ff9091168152602001610163565b61018e61038f565b604051908152602001610163565b61018e61041a565b60015460405161ffff9091168152602001610163565b6101cd6101c8366004610f22565b61046d565b604080516001600160501b03968716815260208101959095528401929092526060830152909116608082015260a001610163565b61018e61056b565b61021161061a565b005b61021b61062e565b6040516101639190610fba565b61018e6106bd565b6000546001600160a01b031661014f565b6101cd610710565b6101cd610257366004610f22565b61080a565b61021161026a366004610def565b6108f3565b61018e61027d366004610f09565b610974565b61018e610290366004610f09565b610a65565b61014f6102a3366004610ee5565b6003602052600090815260409020546001600160a01b031681565b60025461014f906001600160a01b031681565b6102116102df366004610def565b610b01565b6102116102f2366004610def565b610b77565b6101cd610ba1565b6000600160000160029054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561035257600080fd5b505afa158015610366573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038a9190610f97565b905090565b6000600160000160029054906101000a90046001600160a01b03166001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103e257600080fd5b505afa1580156103f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038a9190610e1f565b6000600160000160029054906101000a90046001600160a01b03166001600160a01b03166354fd4d506040518163ffffffff1660e01b815260040160206040518083038186803b1580156103e257600080fd5b60025460009081908190819081906001600160a01b03166104d55760405162461bcd60e51b815260206004820152601e60248201527f4e6f2070726f706f7365642061676772656761746f722070726573656e74000060448201526064015b60405180910390fd5b600254604051639a6fc8f560e01b81526001600160501b03881660048201526001600160a01b0390911690639a6fc8f59060240160a06040518083038186803b15801561052157600080fd5b505afa158015610535573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105599190610f3f565b939a9299509097509550909350915050565b60408051808201825260015461ffff8116808352620100009091046001600160a01b031660208084018290528451633345078160e11b8152945160009561060b94939263668a0f0292600480840193829003018186803b1580156105ce57600080fd5b505afa1580156105e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106069190610e1f565b610c74565b6001600160501b031691505090565b610622610c98565b61062c6000610cf2565b565b6060600160000160029054906101000a90046001600160a01b03166001600160a01b0316637284e4166040518163ffffffff1660e01b815260040160006040518083038186803b15801561068157600080fd5b505afa158015610695573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261038a9190810190610e38565b6000600160000160029054906101000a90046001600160a01b03166001600160a01b0316638205bf6a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103e257600080fd5b60025460009081908190819081906001600160a01b03166107735760405162461bcd60e51b815260206004820152601e60248201527f4e6f2070726f706f7365642061676772656761746f722070726573656e74000060448201526064016104cc565b600260009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156107c157600080fd5b505afa1580156107d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f99190610f3f565b945094509450945094509091929394565b600080600080600080600061082a886001600160501b0316604081901c91565b61ffff821660009081526003602052604090819020549051639a6fc8f560e01b815267ffffffffffffffff831660048201529294509092506001600160a01b031690639a6fc8f59060240160a06040518083038186803b15801561088d57600080fd5b505afa1580156108a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c59190610f3f565b939a509198509650945092506108df878787878787610d42565b939c929b5090995097509095509350505050565b6108fb610c98565b6002546001600160a01b038281169116146109585760405162461bcd60e51b815260206004820152601b60248201527f496e76616c69642070726f706f7365642061676772656761746f72000000000060448201526064016104cc565b600280546001600160a01b031916905561097181610d78565b50565b6000600161098460106040611013565b61098f90600261106e565b6109999190611116565b8211156109a857506000919050565b61ffff604083811c91821660009081526003602052205483906001600160a01b0316806109da57506000949350505050565b604051632d6ad63760e21b815267ffffffffffffffff831660048201526001600160a01b0382169063b5ab58dc906024015b60206040518083038186803b158015610a2457600080fd5b505afa158015610a38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5c9190610e1f565b95945050505050565b60006001610a7560106040611013565b610a8090600261106e565b610a8a9190611116565b821115610a9957506000919050565b61ffff604083811c91821660009081526003602052205483906001600160a01b031680610acb57506000949350505050565b604051632d8cd88360e21b815267ffffffffffffffff831660048201526001600160a01b0382169063b633620c90602401610a0c565b610b09610c98565b6001600160a01b038116610b6e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104cc565b61097181610cf2565b610b7f610c98565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60408051808201825260015461ffff811682526201000090046001600160a01b0316602082018190528251633fabe5a360e21b81529251600093849384938493849363feaf968c9160048083019260a0929190829003018186803b158015610c0857600080fd5b505afa158015610c1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c409190610f3f565b8551949a5092985090965094509250610c629087908790879087908790610d42565b95509550955095509550509091929394565b69ffff0000000000000000604083901b1667ffffffffffffffff8216175b92915050565b6000546001600160a01b0316331461062c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104cc565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000806000610d54868c610c74565b8a8a8a610d618a8c610c74565b939f929e50909c509a509098509650505050505050565b60018054600091610d8d9161ffff1690610fed565b60408051808201825261ffff9092168083526001600160a01b039094166020928301819052600180546201000083026001600160b01b031990911687171790556000948552600390925290922080546001600160a01b03191690921790915550565b600060208284031215610e0157600080fd5b81356001600160a01b0381168114610e1857600080fd5b9392505050565b600060208284031215610e3157600080fd5b5051919050565b600060208284031215610e4a57600080fd5b815167ffffffffffffffff80821115610e6257600080fd5b818401915084601f830112610e7657600080fd5b815181811115610e8857610e88611173565b604051601f8201601f19908116603f01168101908382118183101715610eb057610eb0611173565b81604052828152876020848701011115610ec957600080fd5b610eda83602083016020880161112d565b979650505050505050565b600060208284031215610ef757600080fd5b813561ffff81168114610e1857600080fd5b600060208284031215610f1b57600080fd5b5035919050565b600060208284031215610f3457600080fd5b8135610e1881611189565b600080600080600060a08688031215610f5757600080fd5b8551610f6281611189565b809550506020860151935060408601519250606086015191506080860151610f8981611189565b809150509295509295909350565b600060208284031215610fa957600080fd5b815160ff81168114610e1857600080fd5b6020815260008251806020840152610fd981604085016020870161112d565b601f01601f19169190910160400192915050565b600061ffff80831681851680830382111561100a5761100a61115d565b01949350505050565b600082198211156110265761102661115d565b500190565b600181815b8085111561106657816000190482111561104c5761104c61115d565b8085161561105957918102915b93841c9390800290611030565b509250929050565b6000610e18838360008261108457506001610c92565b8161109157506000610c92565b81600181146110a757600281146110b1576110cd565b6001915050610c92565b60ff8411156110c2576110c261115d565b50506001821b610c92565b5060208310610133831016604e8410600b84101617156110f0575081810a610c92565b6110fa838361102b565b806000190482111561110e5761110e61115d565b029392505050565b6000828210156111285761112861115d565b500390565b60005b83811015611148578181015183820152602001611130565b83811115611157576000848401525b50505050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160501b038116811461097157600080fdfea2646970667358221220937348e21657f7ef79e2833e0525c9d7ecc8049e021786c886a8d63c843a501e64736f6c63430008060033000000000000000000000000798df1d82009421e3497d4b1d93912138299997c
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106101375760003560e01c80638da5cb5b116100b8578063b633620c1161007c578063b633620c14610282578063c159730414610295578063e8c4be30146102be578063f2fde38b146102d1578063f8a2abd3146102e4578063feaf968c146102f757600080fd5b80638da5cb5b146102305780638f6b4d91146102415780639a6fc8f514610249578063a928c0961461025c578063b5ab58dc1461026f57600080fd5b80636001ac53116100ff5780636001ac53146101ba578063668a0f0214610201578063715018a6146102095780637284e416146102135780638205bf6a1461022857600080fd5b8063245a7bfc1461013c578063313ce5671461016c57806350d25bcd1461018657806354fd4d501461019c57806358303b10146101a4575b600080fd5b6001546201000090046001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6101746102ff565b60405160ff9091168152602001610163565b61018e61038f565b604051908152602001610163565b61018e61041a565b60015460405161ffff9091168152602001610163565b6101cd6101c8366004610f22565b61046d565b604080516001600160501b03968716815260208101959095528401929092526060830152909116608082015260a001610163565b61018e61056b565b61021161061a565b005b61021b61062e565b6040516101639190610fba565b61018e6106bd565b6000546001600160a01b031661014f565b6101cd610710565b6101cd610257366004610f22565b61080a565b61021161026a366004610def565b6108f3565b61018e61027d366004610f09565b610974565b61018e610290366004610f09565b610a65565b61014f6102a3366004610ee5565b6003602052600090815260409020546001600160a01b031681565b60025461014f906001600160a01b031681565b6102116102df366004610def565b610b01565b6102116102f2366004610def565b610b77565b6101cd610ba1565b6000600160000160029054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561035257600080fd5b505afa158015610366573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038a9190610f97565b905090565b6000600160000160029054906101000a90046001600160a01b03166001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103e257600080fd5b505afa1580156103f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038a9190610e1f565b6000600160000160029054906101000a90046001600160a01b03166001600160a01b03166354fd4d506040518163ffffffff1660e01b815260040160206040518083038186803b1580156103e257600080fd5b60025460009081908190819081906001600160a01b03166104d55760405162461bcd60e51b815260206004820152601e60248201527f4e6f2070726f706f7365642061676772656761746f722070726573656e74000060448201526064015b60405180910390fd5b600254604051639a6fc8f560e01b81526001600160501b03881660048201526001600160a01b0390911690639a6fc8f59060240160a06040518083038186803b15801561052157600080fd5b505afa158015610535573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105599190610f3f565b939a9299509097509550909350915050565b60408051808201825260015461ffff8116808352620100009091046001600160a01b031660208084018290528451633345078160e11b8152945160009561060b94939263668a0f0292600480840193829003018186803b1580156105ce57600080fd5b505afa1580156105e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106069190610e1f565b610c74565b6001600160501b031691505090565b610622610c98565b61062c6000610cf2565b565b6060600160000160029054906101000a90046001600160a01b03166001600160a01b0316637284e4166040518163ffffffff1660e01b815260040160006040518083038186803b15801561068157600080fd5b505afa158015610695573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261038a9190810190610e38565b6000600160000160029054906101000a90046001600160a01b03166001600160a01b0316638205bf6a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103e257600080fd5b60025460009081908190819081906001600160a01b03166107735760405162461bcd60e51b815260206004820152601e60248201527f4e6f2070726f706f7365642061676772656761746f722070726573656e74000060448201526064016104cc565b600260009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156107c157600080fd5b505afa1580156107d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f99190610f3f565b945094509450945094509091929394565b600080600080600080600061082a886001600160501b0316604081901c91565b61ffff821660009081526003602052604090819020549051639a6fc8f560e01b815267ffffffffffffffff831660048201529294509092506001600160a01b031690639a6fc8f59060240160a06040518083038186803b15801561088d57600080fd5b505afa1580156108a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c59190610f3f565b939a509198509650945092506108df878787878787610d42565b939c929b5090995097509095509350505050565b6108fb610c98565b6002546001600160a01b038281169116146109585760405162461bcd60e51b815260206004820152601b60248201527f496e76616c69642070726f706f7365642061676772656761746f72000000000060448201526064016104cc565b600280546001600160a01b031916905561097181610d78565b50565b6000600161098460106040611013565b61098f90600261106e565b6109999190611116565b8211156109a857506000919050565b61ffff604083811c91821660009081526003602052205483906001600160a01b0316806109da57506000949350505050565b604051632d6ad63760e21b815267ffffffffffffffff831660048201526001600160a01b0382169063b5ab58dc906024015b60206040518083038186803b158015610a2457600080fd5b505afa158015610a38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5c9190610e1f565b95945050505050565b60006001610a7560106040611013565b610a8090600261106e565b610a8a9190611116565b821115610a9957506000919050565b61ffff604083811c91821660009081526003602052205483906001600160a01b031680610acb57506000949350505050565b604051632d8cd88360e21b815267ffffffffffffffff831660048201526001600160a01b0382169063b633620c90602401610a0c565b610b09610c98565b6001600160a01b038116610b6e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104cc565b61097181610cf2565b610b7f610c98565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60408051808201825260015461ffff811682526201000090046001600160a01b0316602082018190528251633fabe5a360e21b81529251600093849384938493849363feaf968c9160048083019260a0929190829003018186803b158015610c0857600080fd5b505afa158015610c1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c409190610f3f565b8551949a5092985090965094509250610c629087908790879087908790610d42565b95509550955095509550509091929394565b69ffff0000000000000000604083901b1667ffffffffffffffff8216175b92915050565b6000546001600160a01b0316331461062c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104cc565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000806000610d54868c610c74565b8a8a8a610d618a8c610c74565b939f929e50909c509a509098509650505050505050565b60018054600091610d8d9161ffff1690610fed565b60408051808201825261ffff9092168083526001600160a01b039094166020928301819052600180546201000083026001600160b01b031990911687171790556000948552600390925290922080546001600160a01b03191690921790915550565b600060208284031215610e0157600080fd5b81356001600160a01b0381168114610e1857600080fd5b9392505050565b600060208284031215610e3157600080fd5b5051919050565b600060208284031215610e4a57600080fd5b815167ffffffffffffffff80821115610e6257600080fd5b818401915084601f830112610e7657600080fd5b815181811115610e8857610e88611173565b604051601f8201601f19908116603f01168101908382118183101715610eb057610eb0611173565b81604052828152876020848701011115610ec957600080fd5b610eda83602083016020880161112d565b979650505050505050565b600060208284031215610ef757600080fd5b813561ffff81168114610e1857600080fd5b600060208284031215610f1b57600080fd5b5035919050565b600060208284031215610f3457600080fd5b8135610e1881611189565b600080600080600060a08688031215610f5757600080fd5b8551610f6281611189565b809550506020860151935060408601519250606086015191506080860151610f8981611189565b809150509295509295909350565b600060208284031215610fa957600080fd5b815160ff81168114610e1857600080fd5b6020815260008251806020840152610fd981604085016020870161112d565b601f01601f19169190910160400192915050565b600061ffff80831681851680830382111561100a5761100a61115d565b01949350505050565b600082198211156110265761102661115d565b500190565b600181815b8085111561106657816000190482111561104c5761104c61115d565b8085161561105957918102915b93841c9390800290611030565b509250929050565b6000610e18838360008261108457506001610c92565b8161109157506000610c92565b81600181146110a757600281146110b1576110cd565b6001915050610c92565b60ff8411156110c2576110c261115d565b50506001821b610c92565b5060208310610133831016604e8410600b84101617156110f0575081810a610c92565b6110fa838361102b565b806000190482111561110e5761110e61115d565b029392505050565b6000828210156111285761112861115d565b500390565b60005b83811015611148578181015183820152602001611130565b83811115611157576000848401525b50505050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160501b038116811461097157600080fdfea2646970667358221220937348e21657f7ef79e2833e0525c9d7ecc8049e021786c886a8d63c843a501e64736f6c63430008060033