Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been partially verified via Sourcify.
- Contract name:
- OrandProviderV2
- Optimization enabled
- true
- Compiler version
- v0.8.19+commit.7dd6d404
- Optimization runs
- 1000
- EVM Version
- default
- Verified at
- 2024-04-17T09:34:57.407078Z
Constructor Arguments
0xe14ad856ebf7bbaa7a06e3630293f308e4a4f42864943970dbfea1d1958a7569c1bab7e1b9b627b4cc916810ddf5068627dcb80648a428b8dd24f2e5b06c1e200000000000000000000000000263a91767a3dcdfeb896ef26db671104e0f370800000000000000000000000005b8280f78ba3c85f9d22b8e14e92f175f31f912000000000000000000000000fe514492cbfb5b1713c7f7e8fd1c474d2739195f00000000000000000000000000000000000000000000000000000000000000c8
Contract source code
// Sources flattened with hardhat v2.19.4 https://hardhat.org // SPDX-License-Identifier: Apache-2.0 AND MIT // File @openzeppelin/contracts/utils/Context.sol@v4.9.5 // Original license: 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; } } // File @openzeppelin/contracts/access/Ownable.sol@v4.9.5 // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; /** * @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); } } // File @openzeppelin/contracts/utils/math/Math.sol@v4.9.5 // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } } // File @openzeppelin/contracts/utils/math/SignedMath.sol@v4.9.5 // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } } // File @openzeppelin/contracts/utils/Strings.sol@v4.9.5 // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } } // File @openzeppelin/contracts/utils/cryptography/ECDSA.sol@v4.9.5 // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } } // File contracts/orand-v2/interfaces/IOrandECDSAV2.sol // Original license: SPDX_License_Identifier: Apache-2.0 pragma solidity ^0.8.0; // Error error InvalidECDSAProofLength(uint256 proofLength); error InvalidProofSigner(address proofSigner); interface IOrandECDSAV2 { // Struct Orand ECDSA proof struct OrandECDSAProof { address signer; address receiverAddress; uint96 receiverEpoch; uint256 ecvrfProofDigest; } // Get signer address from a valid proof function decomposeProof(bytes memory proof) external pure returns (OrandECDSAProof memory ecdsaProof); // Get operator function getOperator() external view returns (address operatorAddress); } // File contracts/orand-v2/interfaces/IOrandProviderV2.sol // Original license: SPDX_License_Identifier: Apache-2.0 pragma solidity ^0.8.0; error UnableToForwardRandomness(address receiver, uint256 y); error InvalidAlphaValue(uint256 expectedAlpha, uint256 givenAlpha); error InvalidGenesisEpoch(uint256 currentEpoch); error InvalidECVRFProofDigest(); interface IOrandProviderV2 is IOrandECDSAV2 { // ECVRF struct struct ECVRFProof { uint256[2] gamma; uint256 c; uint256 s; uint256 alpha; address uWitness; uint256[2] cGammaWitness; uint256[2] sHashWitness; uint256 zInv; } // Start new genesis for receiver function genesis(bytes memory fraudProof, ECVRFProof calldata ecvrfProof) external returns (bool); // Publish new epoch with Fraud Proof function publishFraudProof(bytes memory fraudProof, ECVRFProof calldata ecvrfProof) external returns (bool); // Publish new epoch with ECDSA Proof and Fraud Proof function publish(address receiver, ECVRFProof calldata ecvrfProof) external returns (bool); // Verify a ECVRF proof epoch is valid or not function verifyEpoch( bytes memory fraudProof, ECVRFProof calldata ecvrfProof ) external view returns ( OrandECDSAProof memory ecdsaProof, uint96 currentEpochNumber, bool isEpochLinked, bool isValidDualProof, uint256 currentEpochResult, uint256 verifiedEpochResult ); // Get address of ECVRF verifier function getECVRFVerifier() external view returns (address ecvrfVerifier); } // File contracts/orand-v2/interfaces/IOrandECVRFV2.sol // Original license: SPDX_License_Identifier: Apache-2.0 pragma solidity ^0.8.0; interface IOrandECVRFV2 { // Verify raw proof of ECVRF function verifyECVRFProof( uint256[2] memory pk, uint256[2] memory gamma, uint256 c, uint256 s, uint256 alpha, address uWitness, uint256[2] memory cGammaWitness, uint256[2] memory sHashWitness, uint256 zInv ) external view returns (uint256 y); // Verify structed proof of ECVRF function verifyStructECVRFProof( uint256[2] memory pk, IOrandProviderV2.ECVRFProof memory ecvrfProof ) external view returns (uint256 y); } // File contracts/libraries/Bytes.sol // Original license: SPDX_License_Identifier: Apache-2.0 pragma solidity 0.8.19; // Index is out of range error OutOfRange(uint256 requiredLen, uint256 maxLen); library Bytes { // Read address from input bytes buffer function readAddress(bytes memory input, uint256 offset) internal pure returns (address result) { if (offset + 20 > input.length) { revert OutOfRange(offset + 20, input.length); } assembly { result := shr(96, mload(add(add(input, 0x20), offset))) } } // Read unsafe from input bytes buffer function readUintUnsafe(bytes memory input, uint256 offset, uint256 bitLen) internal pure returns (uint256 result) { assembly { result := shr(sub(256, bitLen), mload(add(add(input, 0x20), offset))) } } // Read uint256 from input bytes buffer function readUint256(bytes memory input, uint256 offset) internal pure returns (uint256 result) { if (offset + 32 > input.length) { revert OutOfRange(offset + 32, input.length); } assembly { result := mload(add(add(input, 0x20), offset)) } } // Read a sub bytes array from input bytes buffer function readBytes(bytes memory input, uint256 offset, uint256 length) internal pure returns (bytes memory) { if (offset + length > input.length) { revert OutOfRange(offset + length, input.length); } bytes memory result = new bytes(length); assembly { // Seek offset to the beginning let seek := add(add(input, 0x20), offset) // Next is size of data let resultOffset := add(result, 0x20) for { let i := 0 } lt(i, length) { i := add(i, 0x20) } { mstore(add(resultOffset, i), mload(add(seek, i))) } } return result; } } // File contracts/orand-v2/OrandECDSAV2.sol // Original license: SPDX_License_Identifier: Apache-2.0 pragma solidity 0.8.19; contract OrandECDSAV2 is IOrandECDSAV2 { // Event: Set New Operator event SetNewOperator(address indexed oldOperator, address indexed newOperator); // Orand operator address address private operator; // Byte manipulation using Bytes for bytes; // Verifiy digital signature using ECDSA for bytes; using ECDSA for bytes32; // Set operator at constructing time constructor(address operatorAddress) { _setOperator(operatorAddress); } //=======================[ Internal ]==================== // Set proof operator function _setOperator(address operatorAddress) internal { emit SetNewOperator(operator, operatorAddress); operator = operatorAddress; } //=======================[ Internal View ]==================== // Get operator address function _getOperator() internal view returns (address operatorAddress) { return operator; } // Verify proof of operator // 0 - 65: secp256k1 Signature // 65 - 77: Epoch // 77 - 97: Receiver address // 97 - 129: Y result of VRF function _decodeFraudProof(bytes memory fraudProof) internal pure returns (OrandECDSAProof memory ecdsaProof) { if (fraudProof.length != 129) { revert InvalidECDSAProofLength(fraudProof.length); } bytes memory signature = fraudProof.readBytes(0, 65); bytes memory message = fraudProof.readBytes(65, fraudProof.length - 65); uint256 proofUint = message.readUint256(0); ecdsaProof.receiverEpoch = uint96(proofUint >> 160); ecdsaProof.receiverAddress = address(uint160(proofUint)); ecdsaProof.ecvrfProofDigest = message.readUint256(32); ecdsaProof.signer = message.toEthSignedMessageHash().recover(signature); return ecdsaProof; } //=======================[ External View ]==================== // Decompose a valid proof function decomposeProof(bytes memory proof) external pure returns (OrandECDSAProof memory ecdsaProof) { return _decodeFraudProof(proof); } // Get operator function getOperator() external view returns (address operatorAddress) { return _getOperator(); } } // File contracts/orand-v2/interfaces/IOrandManagementV2.sol // Original license: SPDX_License_Identifier: Apache-2.0 pragma solidity ^0.8.0; interface IOrandManagementV2 { // Get public key function getPublicKey() external view returns (uint256[2] memory pubKey); // Get digest of corresponding public key function getPublicKeyDigest() external view returns (bytes32 operator); } // File contracts/orand-v2/OrandManagementV2.sol // Original license: SPDX_License_Identifier: Apache-2.0 pragma solidity 0.8.19; contract OrandManagementV2 is IOrandManagementV2 { // Public key that will be use to uint256[2] private publicKey; // Event Set New Public Key event SetNewPublicKey(address indexed actor, uint256 indexed pkx, uint256 indexed pky); // Set public key of Orand at the constructing time constructor(uint256[2] memory publickey) { _setPublicKey(publickey); } //=======================[ Internal ]==================== // Set new public key by XY to verify ECVRF proof function _setPublicKey(uint256[2] memory publickey) internal { publicKey = publickey; emit SetNewPublicKey(msg.sender, publickey[0], publickey[1]); } //=======================[ Internal view ]==================== // Get public key function _getPublicKey() internal view returns (uint256[2] memory pubKey) { return publicKey; } // Get public key digest function _getPublicKeyDigest() internal view returns (bytes32 pubKeyDigest) { return keccak256(abi.encodePacked(publicKey)); } //=======================[ External view ]==================== // Get public key function getPublicKey() external view returns (uint256[2] memory pubKey) { return _getPublicKey(); } // Get digest of corresponding public key function getPublicKeyDigest() external view returns (bytes32 operator) { return _getPublicKeyDigest(); } } // File contracts/orand-v2/interfaces/IOrandConsumerV2.sol // Original license: SPDX_License_Identifier: Apache-2.0 pragma solidity ^0.8.0; error InvalidProvider(); interface IOrandConsumerV2 { // Consume the verifiable randomness from Orand provider // Return false if you want to stop batching function consumeRandomness(uint256 randomness) external returns (bool); } // File contracts/orand-v2/interfaces/IOrandStorageV2.sol // Original license: SPDX_License_Identifier: Apache-2.0 pragma solidity ^0.8.0; interface IOrandStorageV2 { // Get a given epoch result for a given receiver function getEpochResult(address receiver, uint96 epoch) external view returns (uint256 result); // Get total number of epochs for a given receiver function getTotalEpoch(address receiver) external view returns (uint96 epoch); // Get current epoch of a given receiver function getCurrentEpoch(address receiver) external view returns (uint96 epoch); // Get current epoch of a given receiver function getCurrentEpochResult(address receiver) external view returns (uint256 result); } // File contracts/orand-v2/OrandStorageV2.sol // Original license: SPDX_License_Identifier: Apache-2.0 pragma solidity 0.8.19; contract OrandStorageV2 is IOrandStorageV2 { using Bytes for bytes; // Event: New Epoch event NewEpoch(address indexed receiverAddress, uint96 indexed receiverEpoch, uint256 indexed randomness); // Storage of recent epoch's result // Map epoch ++ receiver -> alpha mapping(uint256 => uint256) private epochResult; // Map receiver -> total epoch mapping(address => uint256) private epochMax; //=======================[ Internal ]==================== // Add validity epoch function _addEpoch(address receiver, uint256 result) internal { uint96 epoch = uint96(epochMax[receiver]); // Add epoch to storage // epoch != 0 => able to sue == true epochResult[_packing(epoch, receiver)] = result; // If add new epoch we increase the epoch max 1 epochMax[receiver] = epoch + 1; // Emit event to outside of EVM emit NewEpoch(receiver, epoch, result); } //=======================[ Internal pure ]==================== // Packing adderss and uint96 to a single bytes32 // 96 bits a ++ 160 bits b function _packing(uint96 a, address b) internal pure returns (uint256 packed) { assembly { packed := or(shl(160, a), b) } } //=======================[ Internal View ]==================== // Get result of current epoch function _getCurrentEpoch(address receiver) internal view returns (uint96 epoch) { epoch = uint96(epochMax[receiver]); return (epoch > 0) ? epoch - 1 : epoch; } // Get total number of epoch for a given receiver function _getTotalEpoch(address receiver) internal view returns (uint96 epoch) { return uint96(epochMax[receiver]); } // Get result of current epoch function _getCurrentEpochResult(address receiver) internal view returns (uint256 result) { return epochResult[_packing(_getCurrentEpoch(receiver), receiver)]; } //=======================[ External View ]==================== // Get a given epoch result for a given receiver function getEpochResult(address receiver, uint96 epoch) external view returns (uint256 result) { return epochResult[_packing(epoch, receiver)]; } // Get current epoch of a given receiver function getCurrentEpochResult(address receiver) external view returns (uint256 result) { return _getCurrentEpochResult(receiver); } // Get total number of epochs for a given receiver function getTotalEpoch(address receiver) external view returns (uint96 epoch) { return _getTotalEpoch(receiver); } // Get current epoch of a given receiver function getCurrentEpoch(address receiver) external view returns (uint96 epoch) { return _getCurrentEpoch(receiver); } } // File contracts/orocle-v1/interfaces/IOrocleAggregatorV1.sol // Original license: SPDX_License_Identifier: Apache-2.0 pragma solidity ^0.8.0; error ExistedApplication(uint32 appId); error InvalidApplication(uint32 appId); error InvalidApplicationName(bytes24 appName); error InvalidRoundNumber(uint64 round, uint64 requiredRound); error UndefinedRound(uint64 round); error InvalidDataLength(uint256 length); error UnableToPublishData(bytes data); error DeactivatedUser(address user); interface IOrocleAggregatorV1 { /** * Emit event when a new request is created * @param identifier Data identifier * @param data Data */ function request(uint256 identifier, bytes calldata data) external returns (bool); /** * Fulfill request * @param identifier Data identifier * @param data Data */ function fulfill(uint256 identifier, bytes calldata data) external returns (bool); /** * Check if user is deactivated * @param user User address * @return status */ function isDeactivated(address user) external view returns (bool); /** * Get round of a given application * @param appId Application ID * @return round */ function getMetadata(uint32 appId, bytes20 identifier) external view returns (uint64 round, uint64 lastUpdate); /** * Get data of an application * @param appId Application ID * @param round Round number * @param identifier Data identifier * @return data Data */ function getData(uint32 appId, uint64 round, bytes20 identifier) external view returns (bytes32 data); /** * Get latest data of an application * @param appId Application ID * @param identifier Data identifier * @return data */ function getLatestData(uint32 appId, bytes20 identifier) external view returns (bytes32 data); /** * Get latest data of an application * @param appId Application ID * @param identifier Data identifier * @return round lastUpdate data */ function getLatestRound( uint32 appId, bytes20 identifier ) external view returns (uint64 round, uint64 lastUpdate, bytes32 data); } // File contracts/orand-v2/OrandProviderV2.sol // Original license: SPDX_License_Identifier: Apache-2.0 pragma solidity 0.8.19; contract OrandProviderV2 is IOrandProviderV2, Ownable, OrandStorageV2, OrandManagementV2, OrandECDSAV2 { // ECVRF verifier smart contract IOrandECVRFV2 private ecvrf; // Orocle V1 IOrocleAggregatorV1 private oracle; // We allow max batching is 1000 uint256 private maxBatching; // Event: Set New ECVRF Verifier event SetNewECVRFVerifier(address indexed actor, address indexed ecvrfAddress); // Event: Set the limit for batching randomness event SetBatchingLimit(address indexed actor, uint256 indexed maxBatching); // Event: set new oracle event SetNewOracle(address indexed actor, address indexed newOracle); // Provider V2 construct method constructor( uint256[2] memory publicKey, address operator, address ecvrfAddress, address oracleAddress, uint256 maxBatchingLimit ) OrandManagementV2(publicKey) OrandECDSAV2(operator) { _setNewECVRFVerifier(ecvrfAddress); _setNewOracle(oracleAddress); _setMaxBatching(maxBatchingLimit); } //=======================[ Owner ]==================== // Update new ECVRF verifier function setMaxBatching(uint256 maxBatchingLimit) external onlyOwner returns (bool) { _setMaxBatching(maxBatchingLimit); return true; } // Update new ECVRF verifier function setNewOracle(address oracleAddress) external onlyOwner returns (bool) { _setNewOracle(oracleAddress); return true; } // Update new ECVRF verifier function setNewECVRFVerifier(address ecvrfAddress) external onlyOwner returns (bool) { _setNewECVRFVerifier(ecvrfAddress); return true; } // Set new public key to verify proof function setPublicKey(uint256[2] memory pk) external onlyOwner returns (bool) { _setPublicKey(pk); return true; } //=======================[ Internal ]==================== // Update new ECVRF verifier function _setMaxBatching(uint256 maxBatchingLimit) internal { maxBatching = maxBatchingLimit; emit SetBatchingLimit(msg.sender, maxBatchingLimit); } // Update new ECVRF verifier function _setNewOracle(address oracleAddress) internal { oracle = IOrocleAggregatorV1(oracleAddress); emit SetNewOracle(msg.sender, oracleAddress); } // Update new ECVRF verifier function _setNewECVRFVerifier(address ecvrfAddress) internal { ecvrf = IOrandECVRFV2(ecvrfAddress); emit SetNewECVRFVerifier(msg.sender, ecvrfAddress); } //=======================[ External ]==================== // Start new genesis for receiver function genesis(bytes memory fraudProof, ECVRFProof calldata ecvrfProof) external returns (bool) { OrandECDSAProof memory ecdsaProof = _decodeFraudProof(fraudProof); uint256 currentEpochResult = _getCurrentEpochResult(ecdsaProof.receiverAddress); // Invalid genesis epoch if (currentEpochResult != 0 || ecdsaProof.receiverEpoch != 0) { revert InvalidGenesisEpoch(currentEpochResult); } // ECVRF proof digest must match if ( ecdsaProof.ecvrfProofDigest != uint256( keccak256( abi.encodePacked( _getPublicKey(), ecvrfProof.gamma, ecvrfProof.c, ecvrfProof.s, ecvrfProof.alpha, ecvrfProof.uWitness, ecvrfProof.cGammaWitness, ecvrfProof.sHashWitness, ecvrfProof.zInv ) ) ) ) { revert InvalidECVRFProofDigest(); } // y = keccak256(gamma.x, gamma.y) // uint256 y = uint256(keccak256(abi.encodePacked(ecvrfProof.gamma))); uint256 result = ecvrf.verifyStructECVRFProof(_getPublicKey(), ecvrfProof); // Add epoch to the epoch chain of Orand ECVRF _addEpoch(ecdsaProof.receiverAddress, result); return true; } // Publish new epoch with Fraud Proof function publishFraudProof(bytes memory fraudProof, ECVRFProof calldata ecvrfProof) external returns (bool) { OrandECDSAProof memory ecdsaProof = _decodeFraudProof(fraudProof); uint256 currentEpochResult = _getCurrentEpochResult(ecdsaProof.receiverAddress); // Current alpha must be the result of previous epoch if (ecdsaProof.signer != _getOperator()) { revert InvalidProofSigner(ecdsaProof.signer); } // Current alpha must be the result of previous epoch if (ecvrfProof.alpha != currentEpochResult) { revert InvalidAlphaValue(currentEpochResult, ecvrfProof.alpha); } // ECVRF proof digest must match if ( ecdsaProof.ecvrfProofDigest != uint256( keccak256( abi.encodePacked( _getPublicKey(), ecvrfProof.gamma, ecvrfProof.c, ecvrfProof.s, ecvrfProof.alpha, ecvrfProof.uWitness, ecvrfProof.cGammaWitness, ecvrfProof.sHashWitness, ecvrfProof.zInv ) ) ) ) { revert InvalidECVRFProofDigest(); } // y = keccak256(gamma.x, gamma.y) uint256 result = uint256(keccak256(abi.encodePacked(ecvrfProof.gamma))); // Add epoch to the epoch chain of Orand ECVRF _addEpoch(ecdsaProof.receiverAddress, result); // Check for the existing smart contract and forward randomness to receiver if (ecdsaProof.receiverAddress.code.length > 0) { for (uint256 i = 0; i < maxBatching; i += 1) { if (!IOrandConsumerV2(ecdsaProof.receiverAddress).consumeRandomness(result)) { oracle.fulfill(0, abi.encodePacked(ecdsaProof.receiverAddress)); break; } result = uint256(keccak256(abi.encodePacked(result))); } } return true; } // Publish new epoch with ECDSA Proof and Fraud Proof function publish(address receiver, ECVRFProof calldata ecvrfProof) external returns (bool) { uint256 currentEpochResult = _getCurrentEpochResult(receiver); // Current alpha must be the result of previous epoch if (ecvrfProof.alpha != currentEpochResult) { revert InvalidAlphaValue(currentEpochResult, ecvrfProof.alpha); } // y = keccak256(gamma.x, gamma.y) // uint256 y = uint256(keccak256(abi.encodePacked(ecvrfProof.gamma))); uint256 result = ecvrf.verifyStructECVRFProof(_getPublicKey(), ecvrfProof); // Add epoch to the epoch chain of Orand ECVRF _addEpoch(receiver, result); // Check for the existing smart contract and forward randomness to receiver if (receiver.code.length > 0) { for (uint256 i = 0; i < maxBatching; i += 1) { if (!IOrandConsumerV2(receiver).consumeRandomness(result)) { oracle.fulfill(0, abi.encodePacked(receiver)); break; } result = uint256(keccak256(abi.encodePacked(result))); } } return true; } //=======================[ External View ]==================== // Verify a ECVRF proof epoch is valid or not function verifyEpoch( bytes memory fraudProof, ECVRFProof calldata ecvrfProof ) external view returns ( OrandECDSAProof memory ecdsaProof, uint96 currentEpochNumber, bool isEpochLinked, bool isValidDualProof, uint256 currentEpochResult, uint256 verifiedEpochResult ) { ecdsaProof = _decodeFraudProof(fraudProof); isValidDualProof = ecdsaProof.ecvrfProofDigest == uint256( keccak256( abi.encodePacked( _getPublicKey(), ecvrfProof.gamma, ecvrfProof.c, ecvrfProof.s, ecvrfProof.alpha, ecvrfProof.uWitness, ecvrfProof.cGammaWitness, ecvrfProof.sHashWitness, ecvrfProof.zInv ) ) ); currentEpochNumber = _getCurrentEpoch(ecdsaProof.receiverAddress); currentEpochResult = _getCurrentEpochResult(ecdsaProof.receiverAddress); isEpochLinked = currentEpochResult == ecvrfProof.alpha; // y = keccak256(gamma.x, gamma.y) // uint256 y = uint256(keccak256(abi.encodePacked(ecvrfProof.gamma))); verifiedEpochResult = ecvrf.verifyStructECVRFProof(_getPublicKey(), ecvrfProof); } // Get address of ECVRF verifier function getECVRFVerifier() external view returns (address ecvrfVerifier) { return address(ecvrf); } // Get address of Oracle function getOracle() external view returns (address oracleAddress) { return address(oracle); } // Get maximum batching limit function getMaximumBatching() external view returns (uint256 maxBatchingLimit) { return maxBatching; } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"uint256[2]","name":"publicKey","internalType":"uint256[2]"},{"type":"address","name":"operator","internalType":"address"},{"type":"address","name":"ecvrfAddress","internalType":"address"},{"type":"address","name":"oracleAddress","internalType":"address"},{"type":"uint256","name":"maxBatchingLimit","internalType":"uint256"}]},{"type":"error","name":"InvalidAlphaValue","inputs":[{"type":"uint256","name":"expectedAlpha","internalType":"uint256"},{"type":"uint256","name":"givenAlpha","internalType":"uint256"}]},{"type":"error","name":"InvalidECDSAProofLength","inputs":[{"type":"uint256","name":"proofLength","internalType":"uint256"}]},{"type":"error","name":"InvalidECVRFProofDigest","inputs":[]},{"type":"error","name":"InvalidGenesisEpoch","inputs":[{"type":"uint256","name":"currentEpoch","internalType":"uint256"}]},{"type":"error","name":"InvalidProofSigner","inputs":[{"type":"address","name":"proofSigner","internalType":"address"}]},{"type":"error","name":"OutOfRange","inputs":[{"type":"uint256","name":"requiredLen","internalType":"uint256"},{"type":"uint256","name":"maxLen","internalType":"uint256"}]},{"type":"event","name":"NewEpoch","inputs":[{"type":"address","name":"receiverAddress","internalType":"address","indexed":true},{"type":"uint96","name":"receiverEpoch","internalType":"uint96","indexed":true},{"type":"uint256","name":"randomness","internalType":"uint256","indexed":true}],"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":"event","name":"SetBatchingLimit","inputs":[{"type":"address","name":"actor","internalType":"address","indexed":true},{"type":"uint256","name":"maxBatching","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"SetNewECVRFVerifier","inputs":[{"type":"address","name":"actor","internalType":"address","indexed":true},{"type":"address","name":"ecvrfAddress","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SetNewOperator","inputs":[{"type":"address","name":"oldOperator","internalType":"address","indexed":true},{"type":"address","name":"newOperator","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SetNewOracle","inputs":[{"type":"address","name":"actor","internalType":"address","indexed":true},{"type":"address","name":"newOracle","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SetNewPublicKey","inputs":[{"type":"address","name":"actor","internalType":"address","indexed":true},{"type":"uint256","name":"pkx","internalType":"uint256","indexed":true},{"type":"uint256","name":"pky","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"pure","outputs":[{"type":"tuple","name":"ecdsaProof","internalType":"struct IOrandECDSAV2.OrandECDSAProof","components":[{"type":"address","name":"signer","internalType":"address"},{"type":"address","name":"receiverAddress","internalType":"address"},{"type":"uint96","name":"receiverEpoch","internalType":"uint96"},{"type":"uint256","name":"ecvrfProofDigest","internalType":"uint256"}]}],"name":"decomposeProof","inputs":[{"type":"bytes","name":"proof","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"genesis","inputs":[{"type":"bytes","name":"fraudProof","internalType":"bytes"},{"type":"tuple","name":"ecvrfProof","internalType":"struct IOrandProviderV2.ECVRFProof","components":[{"type":"uint256[2]","name":"gamma","internalType":"uint256[2]"},{"type":"uint256","name":"c","internalType":"uint256"},{"type":"uint256","name":"s","internalType":"uint256"},{"type":"uint256","name":"alpha","internalType":"uint256"},{"type":"address","name":"uWitness","internalType":"address"},{"type":"uint256[2]","name":"cGammaWitness","internalType":"uint256[2]"},{"type":"uint256[2]","name":"sHashWitness","internalType":"uint256[2]"},{"type":"uint256","name":"zInv","internalType":"uint256"}]}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint96","name":"epoch","internalType":"uint96"}],"name":"getCurrentEpoch","inputs":[{"type":"address","name":"receiver","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"result","internalType":"uint256"}],"name":"getCurrentEpochResult","inputs":[{"type":"address","name":"receiver","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"ecvrfVerifier","internalType":"address"}],"name":"getECVRFVerifier","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"result","internalType":"uint256"}],"name":"getEpochResult","inputs":[{"type":"address","name":"receiver","internalType":"address"},{"type":"uint96","name":"epoch","internalType":"uint96"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"maxBatchingLimit","internalType":"uint256"}],"name":"getMaximumBatching","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"operatorAddress","internalType":"address"}],"name":"getOperator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"oracleAddress","internalType":"address"}],"name":"getOracle","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[2]","name":"pubKey","internalType":"uint256[2]"}],"name":"getPublicKey","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"operator","internalType":"bytes32"}],"name":"getPublicKeyDigest","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint96","name":"epoch","internalType":"uint96"}],"name":"getTotalEpoch","inputs":[{"type":"address","name":"receiver","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"publish","inputs":[{"type":"address","name":"receiver","internalType":"address"},{"type":"tuple","name":"ecvrfProof","internalType":"struct IOrandProviderV2.ECVRFProof","components":[{"type":"uint256[2]","name":"gamma","internalType":"uint256[2]"},{"type":"uint256","name":"c","internalType":"uint256"},{"type":"uint256","name":"s","internalType":"uint256"},{"type":"uint256","name":"alpha","internalType":"uint256"},{"type":"address","name":"uWitness","internalType":"address"},{"type":"uint256[2]","name":"cGammaWitness","internalType":"uint256[2]"},{"type":"uint256[2]","name":"sHashWitness","internalType":"uint256[2]"},{"type":"uint256","name":"zInv","internalType":"uint256"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"publishFraudProof","inputs":[{"type":"bytes","name":"fraudProof","internalType":"bytes"},{"type":"tuple","name":"ecvrfProof","internalType":"struct IOrandProviderV2.ECVRFProof","components":[{"type":"uint256[2]","name":"gamma","internalType":"uint256[2]"},{"type":"uint256","name":"c","internalType":"uint256"},{"type":"uint256","name":"s","internalType":"uint256"},{"type":"uint256","name":"alpha","internalType":"uint256"},{"type":"address","name":"uWitness","internalType":"address"},{"type":"uint256[2]","name":"cGammaWitness","internalType":"uint256[2]"},{"type":"uint256[2]","name":"sHashWitness","internalType":"uint256[2]"},{"type":"uint256","name":"zInv","internalType":"uint256"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setMaxBatching","inputs":[{"type":"uint256","name":"maxBatchingLimit","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setNewECVRFVerifier","inputs":[{"type":"address","name":"ecvrfAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setNewOracle","inputs":[{"type":"address","name":"oracleAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setPublicKey","inputs":[{"type":"uint256[2]","name":"pk","internalType":"uint256[2]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"ecdsaProof","internalType":"struct IOrandECDSAV2.OrandECDSAProof","components":[{"type":"address","name":"signer","internalType":"address"},{"type":"address","name":"receiverAddress","internalType":"address"},{"type":"uint96","name":"receiverEpoch","internalType":"uint96"},{"type":"uint256","name":"ecvrfProofDigest","internalType":"uint256"}]},{"type":"uint96","name":"currentEpochNumber","internalType":"uint96"},{"type":"bool","name":"isEpochLinked","internalType":"bool"},{"type":"bool","name":"isValidDualProof","internalType":"bool"},{"type":"uint256","name":"currentEpochResult","internalType":"uint256"},{"type":"uint256","name":"verifiedEpochResult","internalType":"uint256"}],"name":"verifyEpoch","inputs":[{"type":"bytes","name":"fraudProof","internalType":"bytes"},{"type":"tuple","name":"ecvrfProof","internalType":"struct IOrandProviderV2.ECVRFProof","components":[{"type":"uint256[2]","name":"gamma","internalType":"uint256[2]"},{"type":"uint256","name":"c","internalType":"uint256"},{"type":"uint256","name":"s","internalType":"uint256"},{"type":"uint256","name":"alpha","internalType":"uint256"},{"type":"address","name":"uWitness","internalType":"address"},{"type":"uint256[2]","name":"cGammaWitness","internalType":"uint256[2]"},{"type":"uint256[2]","name":"sHashWitness","internalType":"uint256[2]"},{"type":"uint256","name":"zInv","internalType":"uint256"}]}]}]
Contract Creation Code
0x60806040523480156200001157600080fd5b50604051620021d0380380620021d08339810160408190526200003491620002d0565b8385620000413362000085565b6200004c81620000d5565b5062000058816200011a565b50620000648362000176565b6200006f82620001c2565b6200007a816200020e565b505050505062000397565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620000e4600382600262000243565b506020810151815160405133907fbfa225acb3bdc1bbe3faa03e81a000c6399a94d8db72b0c434dd5828b7083f5690600090a450565b6005546040516001600160a01b038084169216907f82d04c58d23161f2b0d3c01082dae861326f4703555a22090a04f971dc00d4e790600090a3600580546001600160a01b0319166001600160a01b0392909216919091179055565b600680546001600160a01b0319166001600160a01b03831690811790915560405133907f5f710a9b3681930bf1343b51da6fa8f2476a09903e0831f661f36bd63892931a90600090a350565b600780546001600160a01b0319166001600160a01b03831690811790915560405133907fd85f66a2d033a785734c4777d12d2526304b1727ddd6774582a4ddb3474dac9790600090a350565b6008819055604051819033907fe71d538682fa7ee72ed8c324fac011fe5a8d0f5ceb54d49f35c82099889a957c90600090a350565b826002810192821562000274579160200282015b828111156200027457825182559160200191906001019062000257565b506200028292915062000286565b5090565b5b8082111562000282576000815560010162000287565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b0381168114620002cb57600080fd5b919050565b600080600080600060c08688031215620002e957600080fd5b86601f870112620002f957600080fd5b604080519081016001600160401b03811182821017156200031e576200031e6200029d565b80604052508060408801898111156200033657600080fd5b885b818110156200035257805183526020928301920162000338565b508297506200036181620002b3565b96505050506200037460608701620002b3565b92506200038460808701620002b3565b915060a086015190509295509295909350565b611e2980620003a76000396000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c80638da5cb5b116100d8578063cfa51d9a1161008c578063e7f43c6811610066578063e7f43c681461034d578063f2fde38b14610355578063f4de72311461036857600080fd5b8063cfa51d9a14610300578063e02bc3c814610325578063e5114f6c1461032d57600080fd5b8063b0ab7dac116100bd578063b0ab7dac146102b8578063bf776ba4146102dc578063c0f948d2146102ef57600080fd5b80638da5cb5b146102945780639a336be1146102a557600080fd5b806372ceb2de1161013a578063803ab8db11610114578063803ab8db1461024a578063804d45961461025d578063833b1fce1461026f57600080fd5b806372ceb2de146102115780637dbfe9f5146102245780637fcde1c21461023757600080fd5b80633d6a36641161016b5780633d6a3664146101d15780634d3223a5146101f4578063715018a61461020757600080fd5b8063243904d4146101875780632e334452146101bc575b600080fd5b61019a61019536600461178d565b61037b565b6040516bffffffffffffffffffffffff90911681526020015b60405180910390f35b6101c461039b565b6040516101b391906117d8565b6101e46101df36600461178d565b6103b0565b60405190151581526020016101b3565b61019a61020236600461178d565b6103cc565b61020f6103d7565b005b6101e461021f36600461178d565b6103eb565b6101e46102323660046117e6565b6103fe565b6101e4610245366004611818565b610411565b6101e4610258366004611863565b61066e565b6008545b6040519081526020016101b3565b6007546001600160a01b03165b6040516001600160a01b0390911681526020016101b3565b6000546001600160a01b031661027c565b6101e46102b3366004611970565b610681565b6102616102c63660046119b7565b60a01b1760009081526001602052604090205490565b6101e46102ea366004611970565b61081b565b6006546001600160a01b031661027c565b61031361030e366004611970565b610b36565b6040516101b3969594939291906119ff565b610261610c85565b61034061033b366004611a81565b610c8f565b6040516101b39190611abe565b61027c610cbc565b61020f61036336600461178d565b610cd0565b61026161037636600461178d565b610d60565b6001600160a01b0381166000908152600260205260408120545b92915050565b6103a3611705565b6103ab610d6b565b905090565b60006103ba610da5565b6103c382610dff565b5060015b919050565b600061039582610e58565b6103df610da5565b6103e96000610e95565b565b60006103f5610da5565b6103c382610ef2565b6000610408610da5565b6103c382610f4b565b60008061041d84610f80565b905080836080013514610455576040516338e5849560e11b815260048101829052608084013560248201526044015b60405180910390fd5b6006546000906001600160a01b03166331ff34cf610471610d6b565b866040518363ffffffff1660e01b815260040161048f929190611b11565b602060405180830381865afa1580156104ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d09190611b8c565b90506104dc8582610fb0565b6001600160a01b0385163b156106635760005b60085481101561066157604051632f4a1ff560e01b8152600481018390526001600160a01b03871690632f4a1ff5906024016020604051808303816000875af1158015610540573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105649190611ba5565b6106295760075460408051606089901b6bffffffffffffffffffffffff191660208201528151601481830301815260348201928390527f0d9577c6000000000000000000000000000000000000000000000000000000009092526001600160a01b0390921691630d9577c6916105e09160009190603801611beb565b6020604051808303816000875af11580156105ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106239190611ba5565b50610661565b60408051602081018490520160408051601f198184030181529190528051602090910120915061065a600182611c3b565b90506104ef565b505b506001949350505050565b6000610678610da5565b6103c382611045565b60008061068d84611088565b9050600061069e8260200151610f80565b9050801515806106bf575060408201516bffffffffffffffffffffffff1615155b156106f9576040517f2c364f1c0000000000000000000000000000000000000000000000000000000081526004810182905260240161044c565b610701610d6b565b8460408101356060820135608083013561072160c0850160a0860161178d565b8960c0018a610100018b610140013560405160200161074899989796959493929190611c4e565b6040516020818303038152906040528051906020012060001c826060015114610784576040516305b604d760e01b815260040160405180910390fd5b6006546000906001600160a01b03166331ff34cf6107a0610d6b565b876040518363ffffffff1660e01b81526004016107be929190611b11565b602060405180830381865afa1580156107db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ff9190611b8c565b905061080f836020015182610fb0565b50600195945050505050565b60008061082784611088565b905060006108388260200151610f80565b905061084c6005546001600160a01b031690565b6001600160a01b031682600001516001600160a01b0316146108a85781516040517fd90fe8e10000000000000000000000000000000000000000000000000000000081526001600160a01b03909116600482015260240161044c565b808460800135146108d9576040516338e5849560e11b8152600481018290526080850135602482015260440161044c565b6108e1610d6b565b8460408101356060820135608083013561090160c0850160a0860161178d565b8960c0018a610100018b610140013560405160200161092899989796959493929190611c4e565b6040516020818303038152906040528051906020012060001c826060015114610964576040516305b604d760e01b815260040160405180910390fd5b604051600090610978908690602001611cdd565b6040516020818303038152906040528051906020012060001c90506109a1836020015182610fb0565b60208301516001600160a01b03163b1561080f5760005b600854811015610b29576020840151604051632f4a1ff560e01b8152600481018490526001600160a01b0390911690632f4a1ff5906024016020604051808303816000875af1158015610a0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a339190611ba5565b610af1576007546020808601516040516001600160a01b0390931692630d9577c692600092610a7c9290910160609190911b6bffffffffffffffffffffffff1916815260140190565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610aa8929190611beb565b6020604051808303816000875af1158015610ac7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aeb9190611ba5565b50610b29565b60408051602081018490520160408051601f1981840301815291905280516020909101209150610b22600182611c3b565b90506109b8565b5060019695505050505050565b60408051608081018252600080825260208201819052918101829052606081018290529080808080610b6788611088565b9550610b71610d6b565b87604081013560608201356080830135610b9160c0850160a0860161178d565b8c60c0018d610100018e6101400135604051602001610bb899989796959493929190611c4e565b6040516020818303038152906040528051906020012060001c8660600151149250610be68660200151610e58565b9450610bf58660200151610f80565b6006546080890135821495509092506001600160a01b03166331ff34cf610c1a610d6b565b896040518363ffffffff1660e01b8152600401610c38929190611b11565b602060405180830381865afa158015610c55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c799190611b8c565b90509295509295509295565b60006103ab61117d565b60408051608081018252600080825260208201819052918101829052606081019190915261039582611088565b60006103ab6005546001600160a01b031690565b610cd8610da5565b6001600160a01b038116610d545760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161044c565b610d5d81610e95565b50565b600061039582610f80565b610d73611705565b60408051808201918290529060039060029082845b815481526020019060010190808311610d88575050505050905090565b6000546001600160a01b031633146103e95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161044c565b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831690811790915560405133907fd85f66a2d033a785734c4777d12d2526304b1727ddd6774582a4ddb3474dac9790600090a350565b6001600160a01b0381166000908152600260205260409020546bffffffffffffffffffffffff8116610e8a5780610395565b610395600182611cea565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831690811790915560405133907f5f710a9b3681930bf1343b51da6fa8f2476a09903e0831f661f36bd63892931a90600090a350565b6008819055604051819033907fe71d538682fa7ee72ed8c324fac011fe5a8d0f5ceb54d49f35c82099889a957c90600090a350565b600060016000610f9a610f9285610e58565b60a01b851790565b8152602001908152602001600020549050919050565b6001600160a01b03821660009081526002602090815260408083205460a081901b861784526001928390529220839055610feb908290611d16565b6001600160a01b0384166000818152600260205260408082206bffffffffffffffffffffffff9485169055518593851692917f50524705e17603fd96db3d4cbd148655f75d19bf9ab86067ef587134b7919e8091a4505050565b6110526003826002611723565b506020810151815160405133907fbfa225acb3bdc1bbe3faa03e81a000c6399a94d8db72b0c434dd5828b7083f5690600090a450565b60408051608081018252600080825260208201819052918101829052606081019190915281516081146110ec5781516040517f0786993c00000000000000000000000000000000000000000000000000000000815260040161044c91815260200190565b60006110fa838260416111ac565b9050600061111860418086516111109190611d3b565b8691906111ac565b905060006111268282611268565b60a081901c60408601526001600160a01b038116602080870191909152909150611151908390611268565b606085015261116983611163846112b6565b906112f1565b6001600160a01b0316845250919392505050565b600060036040516020016111919190611d4e565b60405160208183030381529060405280519060200120905090565b82516060906111bb8385611c3b565b11156111ef576111cb8284611c3b565b845160405163abe5c32f60e01b81526004810192909252602482015260440161044c565b60008267ffffffffffffffff81111561120a5761120a61184d565b6040519080825280601f01601f191660200182016040528015611234576020820181803683370190505b5090508360208601016020820160005b8581101561125c578281015182820152602001611244565b50919695505050505050565b8151600090611278836020611c3b565b11156112ad57611289826020611c3b565b835160405163abe5c32f60e01b81526004810192909252602482015260440161044c565b50016020015190565b60006112c28251611315565b826040516020016112d4929190611d82565b604051602081830303815290604052805190602001209050919050565b600080600061130085856113b5565b9150915061130d816113fa565b509392505050565b606060006113228361155f565b600101905060008167ffffffffffffffff8111156113425761134261184d565b6040519080825280601f01601f19166020018201604052801561136c576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461137657509392505050565b60008082516041036113eb5760208301516040840151606085015160001a6113df87828585611641565b945094505050506113f3565b506000905060025b9250929050565b600081600481111561140e5761140e611ddd565b036114165750565b600181600481111561142a5761142a611ddd565b036114775760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161044c565b600281600481111561148b5761148b611ddd565b036114d85760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161044c565b60038160048111156114ec576114ec611ddd565b03610d5d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161044c565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106115a8577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106115d4576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106115f257662386f26fc10000830492506010015b6305f5e100831061160a576305f5e100830492506008015b612710831061161e57612710830492506004015b60648310611630576064830492506002015b600a83106103955760010192915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561167857506000905060036116fc565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156116cc573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166116f5576000600192509250506116fc565b9150600090505b94509492505050565b60405180604001604052806002906020820280368337509192915050565b8260028101928215611751579160200282015b82811115611751578251825591602001919060010190611736565b5061175d929150611761565b5090565b5b8082111561175d5760008155600101611762565b80356001600160a01b03811681146103c757600080fd5b60006020828403121561179f57600080fd5b6117a882611776565b9392505050565b8060005b60028110156117d25781518452602093840193909101906001016117b3565b50505050565b6040810161039582846117af565b6000602082840312156117f857600080fd5b5035919050565b6000610160828403121561181257600080fd5b50919050565b600080610180838503121561182c57600080fd5b61183583611776565b915061184484602085016117ff565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60006040828403121561187557600080fd5b82601f83011261188457600080fd5b6040516040810181811067ffffffffffffffff821117156118a7576118a761184d565b80604052508060408401858111156118be57600080fd5b845b818110156118d85780358352602092830192016118c0565b509195945050505050565b600082601f8301126118f457600080fd5b813567ffffffffffffffff8082111561190f5761190f61184d565b604051601f8301601f19908116603f011681019082821181831017156119375761193761184d565b8160405283815286602085880101111561195057600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080610180838503121561198457600080fd5b823567ffffffffffffffff81111561199b57600080fd5b6119a7858286016118e3565b92505061184484602085016117ff565b600080604083850312156119ca57600080fd5b6119d383611776565b915060208301356bffffffffffffffffffffffff811681146119f457600080fd5b809150509250929050565b6101208101611a4a82896001600160a01b03808251168352806020830151166020840152506bffffffffffffffffffffffff6040820151166040830152606081015160608301525050565b6bffffffffffffffffffffffff96909616608082015293151560a085015291151560c084015260e083015261010090910152919050565b600060208284031215611a9357600080fd5b813567ffffffffffffffff811115611aaa57600080fd5b611ab6848285016118e3565b949350505050565b6080810161039582846001600160a01b03808251168352806020830151166020840152506bffffffffffffffffffffffff6040820151166040830152606081015160608301525050565b60408183375050565b6101a08101611b2082856117af565b604083604084013760408301356080830152606083013560a0830152608083013560c08301526001600160a01b03611b5a60a08501611776565b1660e0830152610100604060c08501828501376101406040828601828601378085013561018085015250509392505050565b600060208284031215611b9e57600080fd5b5051919050565b600060208284031215611bb757600080fd5b815180151581146117a857600080fd5b60005b83811015611be2578181015183820152602001611bca565b50506000910152565b8281526040602082015260008251806040840152611c10816060850160208701611bc7565b601f01601f1916919091016060019392505050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561039557610395611c25565b6000818b825b6002811015611c73578151835260209283019290910190600101611c54565b50505060408a60408401378860808301528760a08301528660c08301526bffffffffffffffffffffffff198660601b1660e0830152611cb560f4830186611b08565b611cc3610134830185611b08565b506101748101919091526101940198975050505050505050565b6040828237604001919050565b6bffffffffffffffffffffffff828116828216039080821115611d0f57611d0f611c25565b5092915050565b6bffffffffffffffffffffffff818116838216019080821115611d0f57611d0f611c25565b8181038181111561039557610395611c25565b60008183825b6002811015611d73578154835260209092019160019182019101611d54565b50505060408201905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a000000000000815260008351611dba81601a850160208801611bc7565b835190830190611dd181601a840160208801611bc7565b01601a01949350505050565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220d6abff6d9c9ccc2d6cc2512aa350b18b156eb4d3753ee1bab157926d6e95865464736f6c63430008130033e14ad856ebf7bbaa7a06e3630293f308e4a4f42864943970dbfea1d1958a7569c1bab7e1b9b627b4cc916810ddf5068627dcb80648a428b8dd24f2e5b06c1e200000000000000000000000000263a91767a3dcdfeb896ef26db671104e0f370800000000000000000000000005b8280f78ba3c85f9d22b8e14e92f175f31f912000000000000000000000000fe514492cbfb5b1713c7f7e8fd1c474d2739195f00000000000000000000000000000000000000000000000000000000000000c8
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106101825760003560e01c80638da5cb5b116100d8578063cfa51d9a1161008c578063e7f43c6811610066578063e7f43c681461034d578063f2fde38b14610355578063f4de72311461036857600080fd5b8063cfa51d9a14610300578063e02bc3c814610325578063e5114f6c1461032d57600080fd5b8063b0ab7dac116100bd578063b0ab7dac146102b8578063bf776ba4146102dc578063c0f948d2146102ef57600080fd5b80638da5cb5b146102945780639a336be1146102a557600080fd5b806372ceb2de1161013a578063803ab8db11610114578063803ab8db1461024a578063804d45961461025d578063833b1fce1461026f57600080fd5b806372ceb2de146102115780637dbfe9f5146102245780637fcde1c21461023757600080fd5b80633d6a36641161016b5780633d6a3664146101d15780634d3223a5146101f4578063715018a61461020757600080fd5b8063243904d4146101875780632e334452146101bc575b600080fd5b61019a61019536600461178d565b61037b565b6040516bffffffffffffffffffffffff90911681526020015b60405180910390f35b6101c461039b565b6040516101b391906117d8565b6101e46101df36600461178d565b6103b0565b60405190151581526020016101b3565b61019a61020236600461178d565b6103cc565b61020f6103d7565b005b6101e461021f36600461178d565b6103eb565b6101e46102323660046117e6565b6103fe565b6101e4610245366004611818565b610411565b6101e4610258366004611863565b61066e565b6008545b6040519081526020016101b3565b6007546001600160a01b03165b6040516001600160a01b0390911681526020016101b3565b6000546001600160a01b031661027c565b6101e46102b3366004611970565b610681565b6102616102c63660046119b7565b60a01b1760009081526001602052604090205490565b6101e46102ea366004611970565b61081b565b6006546001600160a01b031661027c565b61031361030e366004611970565b610b36565b6040516101b3969594939291906119ff565b610261610c85565b61034061033b366004611a81565b610c8f565b6040516101b39190611abe565b61027c610cbc565b61020f61036336600461178d565b610cd0565b61026161037636600461178d565b610d60565b6001600160a01b0381166000908152600260205260408120545b92915050565b6103a3611705565b6103ab610d6b565b905090565b60006103ba610da5565b6103c382610dff565b5060015b919050565b600061039582610e58565b6103df610da5565b6103e96000610e95565b565b60006103f5610da5565b6103c382610ef2565b6000610408610da5565b6103c382610f4b565b60008061041d84610f80565b905080836080013514610455576040516338e5849560e11b815260048101829052608084013560248201526044015b60405180910390fd5b6006546000906001600160a01b03166331ff34cf610471610d6b565b866040518363ffffffff1660e01b815260040161048f929190611b11565b602060405180830381865afa1580156104ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d09190611b8c565b90506104dc8582610fb0565b6001600160a01b0385163b156106635760005b60085481101561066157604051632f4a1ff560e01b8152600481018390526001600160a01b03871690632f4a1ff5906024016020604051808303816000875af1158015610540573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105649190611ba5565b6106295760075460408051606089901b6bffffffffffffffffffffffff191660208201528151601481830301815260348201928390527f0d9577c6000000000000000000000000000000000000000000000000000000009092526001600160a01b0390921691630d9577c6916105e09160009190603801611beb565b6020604051808303816000875af11580156105ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106239190611ba5565b50610661565b60408051602081018490520160408051601f198184030181529190528051602090910120915061065a600182611c3b565b90506104ef565b505b506001949350505050565b6000610678610da5565b6103c382611045565b60008061068d84611088565b9050600061069e8260200151610f80565b9050801515806106bf575060408201516bffffffffffffffffffffffff1615155b156106f9576040517f2c364f1c0000000000000000000000000000000000000000000000000000000081526004810182905260240161044c565b610701610d6b565b8460408101356060820135608083013561072160c0850160a0860161178d565b8960c0018a610100018b610140013560405160200161074899989796959493929190611c4e565b6040516020818303038152906040528051906020012060001c826060015114610784576040516305b604d760e01b815260040160405180910390fd5b6006546000906001600160a01b03166331ff34cf6107a0610d6b565b876040518363ffffffff1660e01b81526004016107be929190611b11565b602060405180830381865afa1580156107db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ff9190611b8c565b905061080f836020015182610fb0565b50600195945050505050565b60008061082784611088565b905060006108388260200151610f80565b905061084c6005546001600160a01b031690565b6001600160a01b031682600001516001600160a01b0316146108a85781516040517fd90fe8e10000000000000000000000000000000000000000000000000000000081526001600160a01b03909116600482015260240161044c565b808460800135146108d9576040516338e5849560e11b8152600481018290526080850135602482015260440161044c565b6108e1610d6b565b8460408101356060820135608083013561090160c0850160a0860161178d565b8960c0018a610100018b610140013560405160200161092899989796959493929190611c4e565b6040516020818303038152906040528051906020012060001c826060015114610964576040516305b604d760e01b815260040160405180910390fd5b604051600090610978908690602001611cdd565b6040516020818303038152906040528051906020012060001c90506109a1836020015182610fb0565b60208301516001600160a01b03163b1561080f5760005b600854811015610b29576020840151604051632f4a1ff560e01b8152600481018490526001600160a01b0390911690632f4a1ff5906024016020604051808303816000875af1158015610a0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a339190611ba5565b610af1576007546020808601516040516001600160a01b0390931692630d9577c692600092610a7c9290910160609190911b6bffffffffffffffffffffffff1916815260140190565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610aa8929190611beb565b6020604051808303816000875af1158015610ac7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aeb9190611ba5565b50610b29565b60408051602081018490520160408051601f1981840301815291905280516020909101209150610b22600182611c3b565b90506109b8565b5060019695505050505050565b60408051608081018252600080825260208201819052918101829052606081018290529080808080610b6788611088565b9550610b71610d6b565b87604081013560608201356080830135610b9160c0850160a0860161178d565b8c60c0018d610100018e6101400135604051602001610bb899989796959493929190611c4e565b6040516020818303038152906040528051906020012060001c8660600151149250610be68660200151610e58565b9450610bf58660200151610f80565b6006546080890135821495509092506001600160a01b03166331ff34cf610c1a610d6b565b896040518363ffffffff1660e01b8152600401610c38929190611b11565b602060405180830381865afa158015610c55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c799190611b8c565b90509295509295509295565b60006103ab61117d565b60408051608081018252600080825260208201819052918101829052606081019190915261039582611088565b60006103ab6005546001600160a01b031690565b610cd8610da5565b6001600160a01b038116610d545760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161044c565b610d5d81610e95565b50565b600061039582610f80565b610d73611705565b60408051808201918290529060039060029082845b815481526020019060010190808311610d88575050505050905090565b6000546001600160a01b031633146103e95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161044c565b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831690811790915560405133907fd85f66a2d033a785734c4777d12d2526304b1727ddd6774582a4ddb3474dac9790600090a350565b6001600160a01b0381166000908152600260205260409020546bffffffffffffffffffffffff8116610e8a5780610395565b610395600182611cea565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831690811790915560405133907f5f710a9b3681930bf1343b51da6fa8f2476a09903e0831f661f36bd63892931a90600090a350565b6008819055604051819033907fe71d538682fa7ee72ed8c324fac011fe5a8d0f5ceb54d49f35c82099889a957c90600090a350565b600060016000610f9a610f9285610e58565b60a01b851790565b8152602001908152602001600020549050919050565b6001600160a01b03821660009081526002602090815260408083205460a081901b861784526001928390529220839055610feb908290611d16565b6001600160a01b0384166000818152600260205260408082206bffffffffffffffffffffffff9485169055518593851692917f50524705e17603fd96db3d4cbd148655f75d19bf9ab86067ef587134b7919e8091a4505050565b6110526003826002611723565b506020810151815160405133907fbfa225acb3bdc1bbe3faa03e81a000c6399a94d8db72b0c434dd5828b7083f5690600090a450565b60408051608081018252600080825260208201819052918101829052606081019190915281516081146110ec5781516040517f0786993c00000000000000000000000000000000000000000000000000000000815260040161044c91815260200190565b60006110fa838260416111ac565b9050600061111860418086516111109190611d3b565b8691906111ac565b905060006111268282611268565b60a081901c60408601526001600160a01b038116602080870191909152909150611151908390611268565b606085015261116983611163846112b6565b906112f1565b6001600160a01b0316845250919392505050565b600060036040516020016111919190611d4e565b60405160208183030381529060405280519060200120905090565b82516060906111bb8385611c3b565b11156111ef576111cb8284611c3b565b845160405163abe5c32f60e01b81526004810192909252602482015260440161044c565b60008267ffffffffffffffff81111561120a5761120a61184d565b6040519080825280601f01601f191660200182016040528015611234576020820181803683370190505b5090508360208601016020820160005b8581101561125c578281015182820152602001611244565b50919695505050505050565b8151600090611278836020611c3b565b11156112ad57611289826020611c3b565b835160405163abe5c32f60e01b81526004810192909252602482015260440161044c565b50016020015190565b60006112c28251611315565b826040516020016112d4929190611d82565b604051602081830303815290604052805190602001209050919050565b600080600061130085856113b5565b9150915061130d816113fa565b509392505050565b606060006113228361155f565b600101905060008167ffffffffffffffff8111156113425761134261184d565b6040519080825280601f01601f19166020018201604052801561136c576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461137657509392505050565b60008082516041036113eb5760208301516040840151606085015160001a6113df87828585611641565b945094505050506113f3565b506000905060025b9250929050565b600081600481111561140e5761140e611ddd565b036114165750565b600181600481111561142a5761142a611ddd565b036114775760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161044c565b600281600481111561148b5761148b611ddd565b036114d85760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161044c565b60038160048111156114ec576114ec611ddd565b03610d5d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161044c565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106115a8577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106115d4576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106115f257662386f26fc10000830492506010015b6305f5e100831061160a576305f5e100830492506008015b612710831061161e57612710830492506004015b60648310611630576064830492506002015b600a83106103955760010192915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561167857506000905060036116fc565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156116cc573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166116f5576000600192509250506116fc565b9150600090505b94509492505050565b60405180604001604052806002906020820280368337509192915050565b8260028101928215611751579160200282015b82811115611751578251825591602001919060010190611736565b5061175d929150611761565b5090565b5b8082111561175d5760008155600101611762565b80356001600160a01b03811681146103c757600080fd5b60006020828403121561179f57600080fd5b6117a882611776565b9392505050565b8060005b60028110156117d25781518452602093840193909101906001016117b3565b50505050565b6040810161039582846117af565b6000602082840312156117f857600080fd5b5035919050565b6000610160828403121561181257600080fd5b50919050565b600080610180838503121561182c57600080fd5b61183583611776565b915061184484602085016117ff565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60006040828403121561187557600080fd5b82601f83011261188457600080fd5b6040516040810181811067ffffffffffffffff821117156118a7576118a761184d565b80604052508060408401858111156118be57600080fd5b845b818110156118d85780358352602092830192016118c0565b509195945050505050565b600082601f8301126118f457600080fd5b813567ffffffffffffffff8082111561190f5761190f61184d565b604051601f8301601f19908116603f011681019082821181831017156119375761193761184d565b8160405283815286602085880101111561195057600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080610180838503121561198457600080fd5b823567ffffffffffffffff81111561199b57600080fd5b6119a7858286016118e3565b92505061184484602085016117ff565b600080604083850312156119ca57600080fd5b6119d383611776565b915060208301356bffffffffffffffffffffffff811681146119f457600080fd5b809150509250929050565b6101208101611a4a82896001600160a01b03808251168352806020830151166020840152506bffffffffffffffffffffffff6040820151166040830152606081015160608301525050565b6bffffffffffffffffffffffff96909616608082015293151560a085015291151560c084015260e083015261010090910152919050565b600060208284031215611a9357600080fd5b813567ffffffffffffffff811115611aaa57600080fd5b611ab6848285016118e3565b949350505050565b6080810161039582846001600160a01b03808251168352806020830151166020840152506bffffffffffffffffffffffff6040820151166040830152606081015160608301525050565b60408183375050565b6101a08101611b2082856117af565b604083604084013760408301356080830152606083013560a0830152608083013560c08301526001600160a01b03611b5a60a08501611776565b1660e0830152610100604060c08501828501376101406040828601828601378085013561018085015250509392505050565b600060208284031215611b9e57600080fd5b5051919050565b600060208284031215611bb757600080fd5b815180151581146117a857600080fd5b60005b83811015611be2578181015183820152602001611bca565b50506000910152565b8281526040602082015260008251806040840152611c10816060850160208701611bc7565b601f01601f1916919091016060019392505050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561039557610395611c25565b6000818b825b6002811015611c73578151835260209283019290910190600101611c54565b50505060408a60408401378860808301528760a08301528660c08301526bffffffffffffffffffffffff198660601b1660e0830152611cb560f4830186611b08565b611cc3610134830185611b08565b506101748101919091526101940198975050505050505050565b6040828237604001919050565b6bffffffffffffffffffffffff828116828216039080821115611d0f57611d0f611c25565b5092915050565b6bffffffffffffffffffffffff818116838216019080821115611d0f57611d0f611c25565b8181038181111561039557610395611c25565b60008183825b6002811015611d73578154835260209092019160019182019101611d54565b50505060408201905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a000000000000815260008351611dba81601a850160208801611bc7565b835190830190611dd181601a840160208801611bc7565b01601a01949350505050565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220d6abff6d9c9ccc2d6cc2512aa350b18b156eb4d3753ee1bab157926d6e95865464736f6c63430008130033