Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x4E50807f...06F279935 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
RandomProviderV2
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.20;
import {VRFConsumerBaseV2Plus} from "@chainlink/contracts/src/v0.8/vrf/dev/VRFConsumerBaseV2Plus.sol";
import {VRFV2PlusClient} from "@chainlink/contracts/src/v0.8/vrf/dev/libraries/VRFV2PlusClient.sol";
import {RandomDeriveLib} from "./libraries/RandomDeriveLib.sol";
import {IRandomConsumer} from "./interfaces/IRandomConsumer.sol";
import {UnauthorizedCaller, InvalidMaxNumber, InvalidRequestId, SubscriptionNotSet, ExceedsMaxRanges, RequestNotPending, RequestTimedOut, InvalidRandomWords} from "./Shared/Errors.sol";
/**
* @title RandomProviderV2
* @notice Optimized VRF provider with reduced gas costs
* @dev Key optimizations vs V1:
* 1. Removed allRequestIds array (saves ~20k gas per request)
* 2. Removed consumerRequests mapping (saves ~20k gas per request)
* 3. Uses mapping for pending status (O(1) vs O(n) removal)
* 4. Doesn't store derivedValues (saves ~140k gas for 7 ranges)
* 5. Reduced default callbackGasLimitBase
* 6. Cleaner storage layout
*/
contract RandomProviderV2 is VRFConsumerBaseV2Plus {
// ═══════════════════════════════════════════════════════════════════════
// CONSTANTS
// ═══════════════════════════════════════════════════════════════════════
bytes32 public constant FAILURE_TIMEOUT = keccak256("TIMEOUT");
bytes32 public constant FAILURE_CONSUMER_REVERT = keccak256("CONSUMER_REVERT");
bytes32 public constant FAILURE_CONSUMER_ERROR = keccak256("CONSUMER_ERROR");
uint256 public constant DEFAULT_MAX_RANGES = 1;
uint256 public constant ABSOLUTE_MAX_RANGES = 64;
uint256 public constant REQUEST_TIMEOUT = 24 hours;
uint256 public constant MIN_GAS_LIMIT = 100000;
uint16 public constant MAX_REQUEST_CONFIRMATIONS = 200;
// ═══════════════════════════════════════════════════════════════════════
// ENUMS & STRUCTS
// ═══════════════════════════════════════════════════════════════════════
enum RequestStatus {
NonExistent,
Pending,
Fulfilled,
Failed
}
/// @dev Packed request data - optimized for gas
struct RequestData {
address consumer; // 20 bytes
RequestStatus status; // 1 byte
uint40 timestamp; // 5 bytes (good until year 36812)
uint8 rangeCount; // 1 byte (max 64)
// 32 bytes total - fits in one slot with tight packing
uint256 rawWord; // slot 2
}
// ═══════════════════════════════════════════════════════════════════════
// STATE VARIABLES
// ═══════════════════════════════════════════════════════════════════════
// VRF configuration
bytes32 public keyHash;
uint256 public subId;
uint16 public requestConfirmations;
uint32 public callbackGasLimitBase;
uint32 public extraGasPerWord;
// Consumer management
mapping(address => bool) public allowedConsumers;
mapping(address => uint256) public maxRangesAllowed;
// Request tracking - OPTIMIZED
mapping(uint256 => RequestData) public requestData;
mapping(uint256 => RandomDeriveLib.Range[]) private requestRanges;
// Simple counters (no unbounded arrays!)
uint256 public totalRequests;
uint256 public pendingRequestCount;
// ═══════════════════════════════════════════════════════════════════════
// EVENTS
// ═══════════════════════════════════════════════════════════════════════
event ConsumerStatusUpdated(address indexed consumer, bool status, uint256 maxRanges);
event RandomWordsRequested(
uint256 indexed requestId,
address indexed consumer,
uint256 rangeCount,
uint256 gasLimit,
RandomDeriveLib.Range[] ranges // Kept for Graph compatibility
);
event RandomWordsFulfilled(
uint256 indexed requestId,
uint256 randomWord,
uint256[] derivedValues
);
event RequestFailed(uint256 indexed requestId, string reason);
event SubscriptionIdSet(uint256 indexed subId);
event ConfigUpdated(
uint16 requestConfirmations,
uint32 callbackGasLimitBase,
uint32 extraGasPerWord
);
event FailureNotificationFailed(
uint256 indexed requestId,
address indexed consumer,
bytes32 failureTag,
bytes reason
);
// ═══════════════════════════════════════════════════════════════════════
// MODIFIERS
// ═══════════════════════════════════════════════════════════════════════
modifier onlyAllowedConsumer() {
if (!allowedConsumers[msg.sender]) revert UnauthorizedCaller();
_;
}
modifier validRequest(uint256 requestId) {
if (requestData[requestId].consumer == address(0)) revert InvalidRequestId();
_;
}
// ═══════════════════════════════════════════════════════════════════════
// CONSTRUCTOR
// ═══════════════════════════════════════════════════════════════════════
constructor(address _vrfCoordinator) VRFConsumerBaseV2Plus(_vrfCoordinator) {
// Optimized defaults
keyHash = 0x1770bdc7eec7771f7ba4ffd640f34260d7f095b79c92d34a5b2551d6f6cfd2be; // 50 gwei
requestConfirmations = 3;
callbackGasLimitBase = 800000; // Reduced from 2.5M - actual needs ~500-700k
extraGasPerWord = 5000;
}
// ═══════════════════════════════════════════════════════════════════════
// OWNER FUNCTIONS
// ═══════════════════════════════════════════════════════════════════════
function setKeyHash(bytes32 _keyHash) external onlyOwner {
require(_keyHash != 0, "Invalid key hash");
keyHash = _keyHash;
}
function setSubscriptionId(uint256 _subId) external onlyOwner {
require(_subId != 0, "Invalid subscription ID");
subId = _subId;
emit SubscriptionIdSet(_subId);
}
function setConsumerStatus(
address consumer,
bool status,
uint256 maxRanges
) external onlyOwner {
require(consumer != address(0), "Invalid consumer address");
uint256 rangesAllowed = maxRanges == 0 ? DEFAULT_MAX_RANGES : maxRanges;
if (maxRanges > 0) {
require(maxRanges <= ABSOLUTE_MAX_RANGES, "Invalid max ranges");
}
allowedConsumers[consumer] = status;
maxRangesAllowed[consumer] = rangesAllowed;
emit ConsumerStatusUpdated(consumer, status, rangesAllowed);
}
function setConfig(
uint16 _requestConfirmations,
uint32 _callbackGasLimitBase,
uint32 _extraGasPerWord
) external onlyOwner {
require(
_requestConfirmations >= 3 && _requestConfirmations <= MAX_REQUEST_CONFIRMATIONS,
"Invalid confirmations"
);
require(_callbackGasLimitBase >= MIN_GAS_LIMIT, "Gas limit too low");
requestConfirmations = _requestConfirmations;
callbackGasLimitBase = _callbackGasLimitBase;
extraGasPerWord = _extraGasPerWord;
emit ConfigUpdated(_requestConfirmations, _callbackGasLimitBase, _extraGasPerWord);
}
// ═══════════════════════════════════════════════════════════════════════
// REQUEST FUNCTIONS
// ═══════════════════════════════════════════════════════════════════════
/**
* @notice Request a single random number
* @param maxNumber Upper bound (exclusive) for the random number
*/
function requestRandomNumber(uint256 maxNumber) external onlyAllowedConsumer returns (uint256) {
if (maxNumber == 0) revert InvalidMaxNumber();
RandomDeriveLib.Range[] memory ranges = new RandomDeriveLib.Range[](1);
ranges[0] = RandomDeriveLib.Range({min: 0, max: uint128(maxNumber)});
return _requestRandomWords(ranges);
}
/**
* @notice Request multiple random numbers with specific ranges
* @param ranges Array of range descriptors
*/
function requestRandomNumbers(
RandomDeriveLib.Range[] calldata ranges
) external onlyAllowedConsumer returns (uint256) {
RandomDeriveLib.Range[] memory rangesCopy = new RandomDeriveLib.Range[](ranges.length);
for (uint256 i = 0; i < ranges.length; i++) {
rangesCopy[i] = ranges[i];
}
return _requestRandomWords(rangesCopy);
}
// ═══════════════════════════════════════════════════════════════════════
// INTERNAL REQUEST LOGIC
// ═══════════════════════════════════════════════════════════════════════
function _requestRandomWords(
RandomDeriveLib.Range[] memory ranges
) internal returns (uint256) {
if (ranges.length == 0) revert InvalidMaxNumber();
if (subId == 0) revert SubscriptionNotSet();
uint256 authorizedRanges = maxRangesAllowed[msg.sender];
if (ranges.length > authorizedRanges) revert ExceedsMaxRanges();
// Validate ranges
for (uint256 i = 0; i < ranges.length; i++) {
if (ranges[i].max <= ranges[i].min) revert InvalidMaxNumber();
}
// Calculate callback gas limit
uint256 baseGas = callbackGasLimitBase - (callbackGasLimitBase / 10);
uint256 totalGas = baseGas + (ranges.length * extraGasPerWord);
uint32 safeGasLimit = totalGas > callbackGasLimitBase
? callbackGasLimitBase
: uint32(totalGas);
// Request from VRF
uint256 requestId = s_vrfCoordinator.requestRandomWords(
VRFV2PlusClient.RandomWordsRequest({
keyHash: keyHash,
subId: subId,
requestConfirmations: requestConfirmations,
callbackGasLimit: safeGasLimit,
numWords: 1,
extraArgs: VRFV2PlusClient._argsToBytes(
VRFV2PlusClient.ExtraArgsV1({nativePayment: false})
)
})
);
// Store request data - OPTIMIZED: single slot write
requestData[requestId] = RequestData({
consumer: msg.sender,
status: RequestStatus.Pending,
timestamp: uint40(block.timestamp),
rangeCount: uint8(ranges.length),
rawWord: 0
});
// Store ranges temporarily
RandomDeriveLib.Range[] storage storedRanges = requestRanges[requestId];
for (uint256 i = 0; i < ranges.length; i++) {
storedRanges.push(ranges[i]);
}
// Update counters - NO ARRAY PUSH!
totalRequests++;
pendingRequestCount++;
emit RandomWordsRequested(requestId, msg.sender, ranges.length, safeGasLimit, ranges);
return requestId;
}
// ═══════════════════════════════════════════════════════════════════════
// FULFILLMENT
// ═══════════════════════════════════════════════════════════════════════
function fulfillRandomWords(
uint256 requestId,
uint256[] calldata randomWords
) internal override validRequest(requestId) {
RequestData storage data = requestData[requestId];
if (randomWords.length != 1) revert InvalidRandomWords();
// Check timeout
if (block.timestamp > data.timestamp + REQUEST_TIMEOUT) {
data.status = RequestStatus.Failed;
_notifyFailure(
IRandomConsumer(data.consumer),
requestId,
FAILURE_TIMEOUT,
bytes("")
);
_cleanup(requestId);
emit RequestFailed(requestId, "Timeout");
return;
}
uint256 vrfWord = randomWords[0];
data.rawWord = vrfWord;
// Load and derive values
RandomDeriveLib.Range[] storage storedRanges = requestRanges[requestId];
RandomDeriveLib.Range[] memory rangesCopy = new RandomDeriveLib.Range[](storedRanges.length);
for (uint256 i = 0; i < storedRanges.length; i++) {
rangesCopy[i] = storedRanges[i];
}
(uint256[] memory derivedValues, ) = RandomDeriveLib.deriveBounded(vrfWord, rangesCopy);
// NOTE: We do NOT store derivedValues! This saves ~140k gas for 7 ranges
// Consumers can re-derive if needed using rawWord
// Call consumer
IRandomConsumer consumer = IRandomConsumer(data.consumer);
bool success = true;
string memory failureReason = "";
try consumer.fulfillRandomness(requestId, vrfWord, derivedValues) {
data.status = RequestStatus.Fulfilled;
} catch Error(string memory reason) {
success = false;
failureReason = reason;
data.status = RequestStatus.Failed;
_notifyFailure(consumer, requestId, FAILURE_CONSUMER_REVERT, bytes(reason));
} catch (bytes memory lowLevelData) {
success = false;
failureReason = "Low-level error";
data.status = RequestStatus.Failed;
_notifyFailure(consumer, requestId, FAILURE_CONSUMER_ERROR, lowLevelData);
}
// Cleanup
_cleanup(requestId);
if (success) {
emit RandomWordsFulfilled(requestId, vrfWord, derivedValues);
} else {
emit RequestFailed(requestId, failureReason);
}
}
function _notifyFailure(
IRandomConsumer consumer,
uint256 requestId,
bytes32 tag,
bytes memory details
) internal {
try consumer.handleRandomFailure(requestId, tag, details) {
} catch (bytes memory reason) {
emit FailureNotificationFailed(
requestId,
address(consumer),
tag,
reason.length == 0 ? bytes("") : reason
);
}
}
function _cleanup(uint256 requestId) internal {
delete requestRanges[requestId];
// O(1) decrement instead of O(n) array removal
if (pendingRequestCount > 0) {
pendingRequestCount--;
}
}
// ═══════════════════════════════════════════════════════════════════════
// VIEW FUNCTIONS
// ═══════════════════════════════════════════════════════════════════════
function getRequestStatus(uint256 requestId) external view returns (RequestStatus) {
return requestData[requestId].status;
}
function getRequestData(uint256 requestId) external view returns (
address consumer,
RequestStatus status,
uint256 timestamp,
uint256 rangeCount,
uint256 rawWord
) {
RequestData memory data = requestData[requestId];
return (
data.consumer,
data.status,
uint256(data.timestamp),
uint256(data.rangeCount),
data.rawWord
);
}
function getRawWord(uint256 requestId) external view returns (uint256) {
return requestData[requestId].rawWord;
}
function getPendingRequestCount() external view returns (uint256) {
return pendingRequestCount;
}
// Compatibility with V1 interface
function failureReasonTimeout() public pure returns (bytes32) {
return FAILURE_TIMEOUT;
}
function failureReasonConsumerRevert() public pure returns (bytes32) {
return FAILURE_CONSUMER_REVERT;
}
function failureReasonConsumerError() public pure returns (bytes32) {
return FAILURE_CONSUMER_ERROR;
}
/**
* @notice Re-derive values from stored rawWord (for debugging/verification)
* @dev Consumers should cache derivedValues if they need them later
*/
function rederiveValues(
uint256 requestId,
RandomDeriveLib.Range[] calldata ranges
) external view returns (uint256[] memory) {
uint256 rawWord = requestData[requestId].rawWord;
require(rawWord != 0, "No raw word");
(uint256[] memory values, ) = RandomDeriveLib.deriveBounded(rawWord, ranges);
return values;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ConfirmedOwnerWithProposal} from "./ConfirmedOwnerWithProposal.sol";
/// @title The ConfirmedOwner contract
/// @notice A contract with helpers for basic contract ownership.
contract ConfirmedOwner is ConfirmedOwnerWithProposal {
constructor(
address newOwner
) ConfirmedOwnerWithProposal(newOwner, address(0)) {}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {IOwnable} from "../interfaces/IOwnable.sol";
/// @title The ConfirmedOwner contract
/// @notice A contract with helpers for basic contract ownership.
contract ConfirmedOwnerWithProposal is IOwnable {
address private s_owner;
address private s_pendingOwner;
event OwnershipTransferRequested(address indexed from, address indexed to);
event OwnershipTransferred(address indexed from, address indexed to);
constructor(address newOwner, address pendingOwner) {
// solhint-disable-next-line gas-custom-errors
require(newOwner != address(0), "Cannot set owner to zero");
s_owner = newOwner;
if (pendingOwner != address(0)) {
_transferOwnership(pendingOwner);
}
}
/// @notice Allows an owner to begin transferring ownership to a new address.
function transferOwnership(
address to
) public override onlyOwner {
_transferOwnership(to);
}
/// @notice Allows an ownership transfer to be completed by the recipient.
function acceptOwnership() external override {
// solhint-disable-next-line gas-custom-errors
require(msg.sender == s_pendingOwner, "Must be proposed owner");
address oldOwner = s_owner;
s_owner = msg.sender;
s_pendingOwner = address(0);
emit OwnershipTransferred(oldOwner, msg.sender);
}
/// @notice Get the current owner
function owner() public view override returns (address) {
return s_owner;
}
/// @notice validate, transfer ownership, and emit relevant events
function _transferOwnership(
address to
) private {
// solhint-disable-next-line gas-custom-errors
require(to != msg.sender, "Cannot transfer to self");
s_pendingOwner = to;
emit OwnershipTransferRequested(s_owner, to);
}
/// @notice validate access
function _validateOwnership() internal view {
// solhint-disable-next-line gas-custom-errors
require(msg.sender == s_owner, "Only callable by owner");
}
/// @notice Reverts if called by anyone other than the contract owner.
modifier onlyOwner() {
_validateOwnership();
_;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IOwnable {
function owner() external returns (address);
function transferOwnership(
address recipient
) external;
function acceptOwnership() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol";
import {IVRFCoordinatorV2Plus} from "./interfaces/IVRFCoordinatorV2Plus.sol";
import {IVRFMigratableConsumerV2Plus} from "./interfaces/IVRFMigratableConsumerV2Plus.sol";
/**
*
* @notice Interface for contracts using VRF randomness
* *****************************************************************************
* @dev PURPOSE
*
* @dev Reggie the Random Oracle (not his real job) wants to provide randomness
* @dev to Vera the verifier in such a way that Vera can be sure he's not
* @dev making his output up to suit himself. Reggie provides Vera a public key
* @dev to which he knows the secret key. Each time Vera provides a seed to
* @dev Reggie, he gives back a value which is computed completely
* @dev deterministically from the seed and the secret key.
*
* @dev Reggie provides a proof by which Vera can verify that the output was
* @dev correctly computed once Reggie tells it to her, but without that proof,
* @dev the output is indistinguishable to her from a uniform random sample
* @dev from the output space.
*
* @dev The purpose of this contract is to make it easy for unrelated contracts
* @dev to talk to Vera the verifier about the work Reggie is doing, to provide
* @dev simple access to a verifiable source of randomness. It ensures 2 things:
* @dev 1. The fulfillment came from the VRFCoordinatorV2Plus.
* @dev 2. The consumer contract implements fulfillRandomWords.
* *****************************************************************************
* @dev USAGE
*
* @dev Calling contracts must inherit from VRFConsumerBaseV2Plus, and can
* @dev initialize VRFConsumerBaseV2Plus's attributes in their constructor as
* @dev shown:
*
* @dev contract VRFConsumerV2Plus is VRFConsumerBaseV2Plus {
* @dev constructor(<other arguments>, address _vrfCoordinator, address _subOwner)
* @dev VRFConsumerBaseV2Plus(_vrfCoordinator, _subOwner) public {
* @dev <initialization with other arguments goes here>
* @dev }
* @dev }
*
* @dev The oracle will have given you an ID for the VRF keypair they have
* @dev committed to (let's call it keyHash). Create a subscription, fund it
* @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface
* @dev subscription management functions).
* @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations,
* @dev callbackGasLimit, numWords, extraArgs),
* @dev see (IVRFCoordinatorV2Plus for a description of the arguments).
*
* @dev Once the VRFCoordinatorV2Plus has received and validated the oracle's response
* @dev to your request, it will call your contract's fulfillRandomWords method.
*
* @dev The randomness argument to fulfillRandomWords is a set of random words
* @dev generated from your requestId and the blockHash of the request.
*
* @dev If your contract could have concurrent requests open, you can use the
* @dev requestId returned from requestRandomWords to track which response is associated
* @dev with which randomness request.
* @dev See "SECURITY CONSIDERATIONS" for principles to keep in mind,
* @dev if your contract could have multiple requests in flight simultaneously.
*
* @dev Colliding `requestId`s are cryptographically impossible as long as seeds
* @dev differ.
*
* *****************************************************************************
* @dev SECURITY CONSIDERATIONS
*
* @dev A method with the ability to call your fulfillRandomness method directly
* @dev could spoof a VRF response with any random value, so it's critical that
* @dev it cannot be directly called by anything other than this base contract
* @dev (specifically, by the VRFConsumerBaseV2Plus.rawFulfillRandomness method).
*
* @dev For your users to trust that your contract's random behavior is free
* @dev from malicious interference, it's best if you can write it so that all
* @dev behaviors implied by a VRF response are executed *during* your
* @dev fulfillRandomness method. If your contract must store the response (or
* @dev anything derived from it) and use it later, you must ensure that any
* @dev user-significant behavior which depends on that stored value cannot be
* @dev manipulated by a subsequent VRF request.
*
* @dev Similarly, both miners and the VRF oracle itself have some influence
* @dev over the order in which VRF responses appear on the blockchain, so if
* @dev your contract could have multiple VRF requests in flight simultaneously,
* @dev you must ensure that the order in which the VRF responses arrive cannot
* @dev be used to manipulate your contract's user-significant behavior.
*
* @dev Since the block hash of the block which contains the requestRandomness
* @dev call is mixed into the input to the VRF *last*, a sufficiently powerful
* @dev miner could, in principle, fork the blockchain to evict the block
* @dev containing the request, forcing the request to be included in a
* @dev different block with a different hash, and therefore a different input
* @dev to the VRF. However, such an attack would incur a substantial economic
* @dev cost. This cost scales with the number of blocks the VRF oracle waits
* @dev until it calls responds to a request. It is for this reason that
* @dev that you can signal to an oracle you'd like them to wait longer before
* @dev responding to the request (however this is not enforced in the contract
* @dev and so remains effective only in the case of unmodified oracle software).
*/
abstract contract VRFConsumerBaseV2Plus is IVRFMigratableConsumerV2Plus, ConfirmedOwner {
error OnlyCoordinatorCanFulfill(address have, address want);
error OnlyOwnerOrCoordinator(address have, address owner, address coordinator);
error ZeroAddress();
// s_vrfCoordinator should be used by consumers to make requests to vrfCoordinator
// so that coordinator reference is updated after migration
IVRFCoordinatorV2Plus public s_vrfCoordinator;
/**
* @param _vrfCoordinator address of VRFCoordinator contract
*/
constructor(
address _vrfCoordinator
) ConfirmedOwner(msg.sender) {
if (_vrfCoordinator == address(0)) {
revert ZeroAddress();
}
s_vrfCoordinator = IVRFCoordinatorV2Plus(_vrfCoordinator);
}
/**
* @notice fulfillRandomness handles the VRF response. Your contract must
* @notice implement it. See "SECURITY CONSIDERATIONS" above for important
* @notice principles to keep in mind when implementing your fulfillRandomness
* @notice method.
*
* @dev VRFConsumerBaseV2Plus expects its subcontracts to have a method with this
* @dev signature, and will call it once it has verified the proof
* @dev associated with the randomness. (It is triggered via a call to
* @dev rawFulfillRandomness, below.)
*
* @param requestId The Id initially returned by requestRandomness
* @param randomWords the VRF output expanded to the requested number of words
*/
// solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore
function fulfillRandomWords(uint256 requestId, uint256[] calldata randomWords) internal virtual;
// rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
// proof. rawFulfillRandomness then calls fulfillRandomness, after validating
// the origin of the call
function rawFulfillRandomWords(uint256 requestId, uint256[] calldata randomWords) external {
if (msg.sender != address(s_vrfCoordinator)) {
revert OnlyCoordinatorCanFulfill(msg.sender, address(s_vrfCoordinator));
}
fulfillRandomWords(requestId, randomWords);
}
/**
* @inheritdoc IVRFMigratableConsumerV2Plus
*/
function setCoordinator(
address _vrfCoordinator
) external override onlyOwnerOrCoordinator {
if (_vrfCoordinator == address(0)) {
revert ZeroAddress();
}
s_vrfCoordinator = IVRFCoordinatorV2Plus(_vrfCoordinator);
emit CoordinatorSet(_vrfCoordinator);
}
modifier onlyOwnerOrCoordinator() {
if (msg.sender != owner() && msg.sender != address(s_vrfCoordinator)) {
revert OnlyOwnerOrCoordinator(msg.sender, owner(), address(s_vrfCoordinator));
}
_;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol";
import {IVRFSubscriptionV2Plus} from "./IVRFSubscriptionV2Plus.sol";
// Interface that enables consumers of VRFCoordinatorV2Plus to be future-proof for upgrades
// This interface is supported by subsequent versions of VRFCoordinatorV2Plus
interface IVRFCoordinatorV2Plus is IVRFSubscriptionV2Plus {
/**
* @notice Request a set of random words.
* @param req - a struct containing following fields for randomness request:
* keyHash - Corresponds to a particular oracle job which uses
* that key for generating the VRF proof. Different keyHash's have different gas price
* ceilings, so you can select a specific one to bound your maximum per request cost.
* subId - The ID of the VRF subscription. Must be funded
* with the minimum subscription balance required for the selected keyHash.
* requestConfirmations - How many blocks you'd like the
* oracle to wait before responding to the request. See SECURITY CONSIDERATIONS
* for why you may want to request more. The acceptable range is
* [minimumRequestBlockConfirmations, 200].
* callbackGasLimit - How much gas you'd like to receive in your
* fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords
* may be slightly less than this amount because of gas used calling the function
* (argument decoding etc.), so you may need to request slightly more than you expect
* to have inside fulfillRandomWords. The acceptable range is
* [0, maxGasLimit]
* numWords - The number of uint256 random values you'd like to receive
* in your fulfillRandomWords callback. Note these numbers are expanded in a
* secure way by the VRFCoordinator from a single random value supplied by the oracle.
* extraArgs - abi-encoded extra args
* @return requestId - A unique identifier of the request. Can be used to match
* a request to a response in fulfillRandomWords.
*/
function requestRandomWords(
VRFV2PlusClient.RandomWordsRequest calldata req
) external returns (uint256 requestId);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @notice The IVRFMigratableConsumerV2Plus interface defines the
/// @notice method required to be implemented by all V2Plus consumers.
/// @dev This interface is designed to be used in VRFConsumerBaseV2Plus.
interface IVRFMigratableConsumerV2Plus {
event CoordinatorSet(address vrfCoordinator);
/// @notice Sets the VRF Coordinator address
/// @notice This method should only be callable by the coordinator or contract owner
function setCoordinator(
address vrfCoordinator
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @notice The IVRFSubscriptionV2Plus interface defines the subscription
/// @notice related methods implemented by the V2Plus coordinator.
interface IVRFSubscriptionV2Plus {
/**
* @notice Add a consumer to a VRF subscription.
* @param subId - ID of the subscription
* @param consumer - New consumer which can use the subscription
*/
function addConsumer(uint256 subId, address consumer) external;
/**
* @notice Remove a consumer from a VRF subscription.
* @param subId - ID of the subscription
* @param consumer - Consumer to remove from the subscription
*/
function removeConsumer(uint256 subId, address consumer) external;
/**
* @notice Cancel a subscription
* @param subId - ID of the subscription
* @param to - Where to send the remaining LINK to
*/
function cancelSubscription(uint256 subId, address to) external;
/**
* @notice Accept subscription owner transfer.
* @param subId - ID of the subscription
* @dev will revert if original owner of subId has
* not requested that msg.sender become the new owner.
*/
function acceptSubscriptionOwnerTransfer(
uint256 subId
) external;
/**
* @notice Request subscription owner transfer.
* @param subId - ID of the subscription
* @param newOwner - proposed new owner of the subscription
*/
function requestSubscriptionOwnerTransfer(uint256 subId, address newOwner) external;
/**
* @notice Create a VRF subscription.
* @return subId - A unique subscription id.
* @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.
* @dev Note to fund the subscription with LINK, use transferAndCall. For example
* @dev LINKTOKEN.transferAndCall(
* @dev address(COORDINATOR),
* @dev amount,
* @dev abi.encode(subId));
* @dev Note to fund the subscription with Native, use fundSubscriptionWithNative. Be sure
* @dev to send Native with the call, for example:
* @dev COORDINATOR.fundSubscriptionWithNative{value: amount}(subId);
*/
function createSubscription() external returns (uint256 subId);
/**
* @notice Get a VRF subscription.
* @param subId - ID of the subscription
* @return balance - LINK balance of the subscription in juels.
* @return nativeBalance - native balance of the subscription in wei.
* @return reqCount - Requests count of subscription.
* @return owner - owner of the subscription.
* @return consumers - list of consumer address which are able to use this subscription.
*/
function getSubscription(
uint256 subId
)
external
view
returns (uint96 balance, uint96 nativeBalance, uint64 reqCount, address owner, address[] memory consumers);
/*
* @notice Check to see if there exists a request commitment consumers
* for all consumers and keyhashes for a given sub.
* @param subId - ID of the subscription
* @return true if there exists at least one unfulfilled request for the subscription, false
* otherwise.
*/
function pendingRequestExists(
uint256 subId
) external view returns (bool);
/**
* @notice Paginate through all active VRF subscriptions.
* @param startIndex index of the subscription to start from
* @param maxCount maximum number of subscriptions to return, 0 to return all
* @dev the order of IDs in the list is **not guaranteed**, therefore, if making successive calls, one
* @dev should consider keeping the blockheight constant to ensure a holistic picture of the contract state
*/
function getActiveSubscriptionIds(uint256 startIndex, uint256 maxCount) external view returns (uint256[] memory);
/**
* @notice Fund a subscription with native.
* @param subId - ID of the subscription
* @notice This method expects msg.value to be greater than or equal to 0.
*/
function fundSubscriptionWithNative(
uint256 subId
) external payable;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
// End consumer library.
library VRFV2PlusClient {
// extraArgs will evolve to support new features
bytes4 public constant EXTRA_ARGS_V1_TAG = bytes4(keccak256("VRF ExtraArgsV1"));
struct ExtraArgsV1 {
bool nativePayment;
}
struct RandomWordsRequest {
bytes32 keyHash;
uint256 subId;
uint16 requestConfirmations;
uint32 callbackGasLimit;
uint32 numWords;
bytes extraArgs;
}
function _argsToBytes(
ExtraArgsV1 memory extraArgs
) internal pure returns (bytes memory bts) {
return abi.encodeWithSelector(EXTRA_ARGS_V1_TAG, extraArgs);
}
}// SPDX-License-Identifier: MIT pragma solidity 0.8.20; // Common errors error NoBalanceToWithdraw(); error UnauthorizedCaller(); error InsufficientFunds(); error SubscriptionNotSet(); error RequestNotPending(); error RequestTimedOut(); error InvalidRandomWords(); // BurningRoulette errors error InvalidBetAmount(); error InsufficientEVABalance(); error NoWBTCReceived(); error UnauthorizedProvider(); error RequestAlreadyProcessed(); error EmptyMultipliersArray(); error InvalidBetLimits(); error InvalidSpinCount(); // RandomProvider errors error InvalidMaxNumber(); error GameNotEnabled(); error ProbabilityTooHigh(); error InvalidRequestId(); error OnlyGameCanClaim(); error AlreadyClaimed(); error ReservationExpired(); error InsufficientBalance(); error NotExpiredYet(); error ExceedsMaxRanges();
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
interface IRandomConsumer {
/**
* @notice Called by RandomProvider when randomness is ready.
* @param requestId The id of the randomness request.
* @param randomWord The raw VRF word received from the coordinator.
* @param derivedValues The bounded numbers produced using the requested ranges.
*/
function fulfillRandomness(
uint256 requestId,
uint256 randomWord,
uint256[] memory derivedValues
) external;
/**
* @notice Called by RandomProvider when a request cannot be fulfilled.
* @param requestId The id of the randomness request.
* @param reason Identifier describing the failure (e.g. keccak256("TIMEOUT")).
* @param details Additional context encoded as bytes (may be empty).
*/
function handleRandomFailure(
uint256 requestId,
bytes32 reason,
bytes calldata details
) external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
/// @title RandomDeriveLib
/// @notice Utility helpers to deterministically derive bounded random values from a
/// single 256-bit VRF word.
library RandomDeriveLib {
/// @notice Configuration for a bounded random number.
struct Range {
uint128 min; // inclusive lower bound
uint128 max; // exclusive upper bound
}
/// @notice Thrown when a requested range is invalid.
error InvalidRange(uint256 index);
/// @notice Derives bounded random numbers from a single 256-bit seed.
/// @param seed The initial random seed (typically a VRF word).
/// @param ranges The list of ranges to derive numbers for.
/// @return values The derived numbers, each constrained to its range.
/// @return lastSeed The final seed after processing all ranges (can be reused).
function deriveBounded(
uint256 seed,
Range[] memory ranges
) internal pure returns (uint256[] memory values, uint256 lastSeed) {
uint256 length = ranges.length;
values = new uint256[](length);
for (uint256 i = 0; i < length; i++) {
Range memory range = ranges[i];
uint256 minValue = uint256(range.min);
uint256 maxValue = uint256(range.max);
if (maxValue <= minValue) {
revert InvalidRange(i);
}
uint256 span = maxValue - minValue; // guaranteed > 0
uint256 boundedValue = (seed % span) + minValue;
values[i] = boundedValue;
// Derive the next seed for the following iteration.
seed = uint256(keccak256(abi.encode(seed, i)));
}
lastSeed = seed;
}
/// @notice Derives a single bounded number and the next seed.
/// @param seed The current random seed.
/// @param minValue Inclusive lower bound for the derived value.
/// @param maxValue Exclusive upper bound for the derived value.
/// @param index Position of this derivation in the sequence (used for hashing and error reporting).
/// @return value The derived random number within [minValue, maxValue).
/// @return nextSeed The next seed to use for subsequent derivations.
function deriveOnce(
uint256 seed,
uint128 minValue,
uint128 maxValue,
uint256 index
) internal pure returns (uint256 value, uint256 nextSeed) {
uint256 min = uint256(minValue);
uint256 max = uint256(maxValue);
if (max <= min) {
revert InvalidRange(index);
}
uint256 span = max - min;
value = (seed % span) + min;
nextSeed = uint256(keccak256(abi.encode(seed, index)));
}
/// @notice Derives a deterministic sequence of 256-bit words from an initial seed.
/// @dev Useful when the consumer wants raw words instead of bounded numbers.
/// @param seed The initial random seed.
/// @param count How many additional words to derive.
/// @return words The sequence of derived words (length == count).
/// @return lastSeed The final seed after derivation.
function deriveWordSequence(
uint256 seed,
uint256 count
) internal pure returns (uint256[] memory words, uint256 lastSeed) {
words = new uint256[](count);
for (uint256 i = 0; i < count; i++) {
seed = uint256(keccak256(abi.encode(seed, i)));
words[i] = seed;
}
lastSeed = seed;
}
}{
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "shanghai",
"remappings": [
"project/:@chainlink/contracts/=npm/@chainlink/[email protected]/",
"project/:@chainlink/contracts/=npm/@chainlink/[email protected]/"
],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_vrfCoordinator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ExceedsMaxRanges","type":"error"},{"inputs":[],"name":"InvalidMaxNumber","type":"error"},{"inputs":[],"name":"InvalidRandomWords","type":"error"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"InvalidRange","type":"error"},{"inputs":[],"name":"InvalidRequestId","type":"error"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"coordinator","type":"address"}],"name":"OnlyOwnerOrCoordinator","type":"error"},{"inputs":[],"name":"SubscriptionNotSet","type":"error"},{"inputs":[],"name":"UnauthorizedCaller","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"requestConfirmations","type":"uint16"},{"indexed":false,"internalType":"uint32","name":"callbackGasLimitBase","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"extraGasPerWord","type":"uint32"}],"name":"ConfigUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"consumer","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"},{"indexed":false,"internalType":"uint256","name":"maxRanges","type":"uint256"}],"name":"ConsumerStatusUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"vrfCoordinator","type":"address"}],"name":"CoordinatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":true,"internalType":"address","name":"consumer","type":"address"},{"indexed":false,"internalType":"bytes32","name":"failureTag","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"reason","type":"bytes"}],"name":"FailureNotificationFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"OwnershipTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"randomWord","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"derivedValues","type":"uint256[]"}],"name":"RandomWordsFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":true,"internalType":"address","name":"consumer","type":"address"},{"indexed":false,"internalType":"uint256","name":"rangeCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"gasLimit","type":"uint256"},{"components":[{"internalType":"uint128","name":"min","type":"uint128"},{"internalType":"uint128","name":"max","type":"uint128"}],"indexed":false,"internalType":"struct RandomDeriveLib.Range[]","name":"ranges","type":"tuple[]"}],"name":"RandomWordsRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"RequestFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"subId","type":"uint256"}],"name":"SubscriptionIdSet","type":"event"},{"inputs":[],"name":"ABSOLUTE_MAX_RANGES","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_MAX_RANGES","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FAILURE_CONSUMER_ERROR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FAILURE_CONSUMER_REVERT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FAILURE_TIMEOUT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_REQUEST_CONFIRMATIONS","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_GAS_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REQUEST_TIMEOUT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowedConsumers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"callbackGasLimitBase","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"extraGasPerWord","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"failureReasonConsumerError","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"failureReasonConsumerRevert","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"failureReasonTimeout","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getPendingRequestCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"}],"name":"getRawWord","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"}],"name":"getRequestData","outputs":[{"internalType":"address","name":"consumer","type":"address"},{"internalType":"enum RandomProviderV2.RequestStatus","name":"status","type":"uint8"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"rangeCount","type":"uint256"},{"internalType":"uint256","name":"rawWord","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"}],"name":"getRequestStatus","outputs":[{"internalType":"enum RandomProviderV2.RequestStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"keyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxRangesAllowed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingRequestCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"components":[{"internalType":"uint128","name":"min","type":"uint128"},{"internalType":"uint128","name":"max","type":"uint128"}],"internalType":"struct RandomDeriveLib.Range[]","name":"ranges","type":"tuple[]"}],"name":"rederiveValues","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"requestConfirmations","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"requestData","outputs":[{"internalType":"address","name":"consumer","type":"address"},{"internalType":"enum RandomProviderV2.RequestStatus","name":"status","type":"uint8"},{"internalType":"uint40","name":"timestamp","type":"uint40"},{"internalType":"uint8","name":"rangeCount","type":"uint8"},{"internalType":"uint256","name":"rawWord","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxNumber","type":"uint256"}],"name":"requestRandomNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint128","name":"min","type":"uint128"},{"internalType":"uint128","name":"max","type":"uint128"}],"internalType":"struct RandomDeriveLib.Range[]","name":"ranges","type":"tuple[]"}],"name":"requestRandomNumbers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"s_vrfCoordinator","outputs":[{"internalType":"contract IVRFCoordinatorV2Plus","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_requestConfirmations","type":"uint16"},{"internalType":"uint32","name":"_callbackGasLimitBase","type":"uint32"},{"internalType":"uint32","name":"_extraGasPerWord","type":"uint32"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"consumer","type":"address"},{"internalType":"bool","name":"status","type":"bool"},{"internalType":"uint256","name":"maxRanges","type":"uint256"}],"name":"setConsumerStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vrfCoordinator","type":"address"}],"name":"setCoordinator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"name":"setKeyHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_subId","type":"uint256"}],"name":"setSubscriptionId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"subId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRequests","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
0x608060405234801562000010575f80fd5b506040516200255f3803806200255f8339810160408190526200003391620001f6565b8033805f816200008a5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b5f80546001600160a01b0319166001600160a01b0384811691909117909155811615620000bc57620000bc816200014c565b5050506001600160a01b038116620000e75760405163d92e233d60e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055507f1770bdc7eec7771f7ba4ffd640f34260d7f095b79c92d34a5b2551d6f6cfd2be600355600580546001600160501b031916671388000c3500000317905562000225565b336001600160a01b03821603620001a65760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000081565b600180546001600160a01b0319166001600160a01b038381169182179092555f8054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b5f6020828403121562000207575f80fd5b81516001600160a01b03811681146200021e575f80fd5b9392505050565b61232c80620002335f395ff3fe608060405234801561000f575f80fd5b5060043610610229575f3560e01c80639130d1b21161012a578063c1e0d236116100b4578063e6a210af11610079578063e6a210af14610597578063eb1d28bb146105b9578063ec336e11146105c2578063f2fde38b146105e8578063f735968c146105fb575f80fd5b8063c1e0d23614610500578063d8a4676f14610513578063da046ce814610549578063dd5a894f1461057b578063e0abba571461058e575f80fd5b8063b0fb162f116100fa578063b0fb162f146104c5578063b1eb96c9146104d3578063b376edbd146104e6578063bc0ed30d146104ee578063bc2c81e9146104f6575f80fd5b80639130d1b21461045a57806398544710146104795780639e33908b1461048c5780639eccacf6146104b2575f80fd5b806361728f39116101b657806385b88d5a1161017b57806385b88d5a146103ff5780638aea61dc146104125780638da5cb5b1461041b5780638ea981171461043f5780638f33d7c914610452575f80fd5b806361728f391461039d578063727e6608146103a65780637297fc61146103c657806379ba5097146103ed5780637ce1ffeb146103f5575f80fd5b806335999a7d116101fc57806335999a7d146102fa57806342d10e551461032157806346549f411461034d578063484956c51461036057806358ff423d14610387575f80fd5b8063055342961461022d57806315c48b84146102625780631fe543e31461027d5780632adb9e3c14610292575b5f80fd5b7f557bc7dd98b058bb9f53e4df97129792526574a4717818cdf9803f6b16290a315b6040519081526020015b60405180910390f35b61026a60c881565b60405161ffff9091168152602001610259565b61029061028b366004611b9f565b61061f565b005b6102e96102a0366004611c17565b60086020525f9081526040902080546001909101546001600160a01b0382169160ff600160a01b820481169264ffffffffff600160a81b84041692600160d01b90049091169085565b604051610259959493929190611c62565b61024f7f7de8c190dae06a0d538e8de8db3f15877766074bb5a2835b1061d57383d670c381565b60055461033890600160301b900463ffffffff1681565b60405163ffffffff9091168152602001610259565b61029061035b366004611cbb565b610674565b61024f7f2961ae3abb4319e6f3219d7e6705c5b73cd9d34c241ee979884ad93815f0b97181565b6005546103389062010000900463ffffffff1681565b61024f60035481565b6103b96103b4366004611d43565b6107a0565b6040516102599190611dc4565b61024f7f557bc7dd98b058bb9f53e4df97129792526574a4717818cdf9803f6b16290a3181565b610290610858565b61024f620186a081565b61024f61040d366004611ddd565b610901565b61024f600a5481565b5f546001600160a01b03165b6040516001600160a01b039091168152602001610259565b61029061044d366004611e1c565b610a07565b61024f600181565b61024f610468366004611e1c565b60076020525f908152604090205481565b610290610487366004611c17565b610af7565b7f7de8c190dae06a0d538e8de8db3f15877766074bb5a2835b1061d57383d670c361024f565b600254610427906001600160a01b031681565b60055461026a9061ffff1681565b61024f6104e1366004611c17565b610b47565b61024f604081565b600b5461024f565b61024f6201518081565b61029061050e366004611c17565b610c2a565b61053c610521366004611c17565b5f90815260086020526040902054600160a01b900460ff1690565b6040516102599190611e35565b61056b610557366004611e1c565b60066020525f908152604090205460ff1681565b6040519015158152602001610259565b610290610589366004611e56565b610cb3565b61024f600b5481565b61024f6105a5366004611c17565b5f9081526008602052604090206001015490565b61024f60045481565b7f2961ae3abb4319e6f3219d7e6705c5b73cd9d34c241ee979884ad93815f0b97161024f565b6102906105f6366004611e1c565b610df3565b61060e610609366004611c17565b610e07565b604051610259959493929190611e9e565b6002546001600160a01b031633146106645760025460405163073e64fd60e21b81523360048201526001600160a01b0390911660248201526044015b60405180910390fd5b61066f838383610ed0565b505050565b61067c61135e565b6001600160a01b0383166106d25760405162461bcd60e51b815260206004820152601860248201527f496e76616c696420636f6e73756d657220616464726573730000000000000000604482015260640161065b565b5f81156106df57816106e2565b60015b905081156107305760408211156107305760405162461bcd60e51b8152602060048201526012602482015271496e76616c6964206d61782072616e67657360701b604482015260640161065b565b6001600160a01b0384165f818152600660209081526040808320805460ff1916881515908117909155600783529281902085905580519283529082018490527f862018a08880c668a51f563f0bbb0b5c9a5c0d50a8477f56aa531a6fc8b0f2c5910160405180910390a250505050565b5f838152600860205260408120600101546060918190036107f15760405162461bcd60e51b815260206004820152600b60248201526a139bc81c985dc81ddbdc9960aa1b604482015260640161065b565b5f61084d828686808060200260200160405190810160405280939291908181526020015f905b828210156108435761083460408302860136819003810190611f3a565b81526020019060010190610817565b50505050506113b2565b509695505050505050565b6001546001600160a01b031633146108ab5760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b604482015260640161065b565b5f8054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b335f9081526006602052604081205460ff1661093057604051635c427cd960e01b815260040160405180910390fd5b5f8267ffffffffffffffff81111561094a5761094a611ed7565b60405190808252806020026020018201604052801561098e57816020015b604080518082019091525f80825260208201528152602001906001900390816109685790505b5090505f5b838110156109f3578484828181106109ad576109ad611f9f565b9050604002018036038101906109c39190611f3a565b8282815181106109d5576109d5611f9f565b602002602001018190525080806109eb90611fc7565b915050610993565b506109fd81611504565b9150505b92915050565b5f546001600160a01b03163314801590610a2c57506002546001600160a01b03163314155b15610a7c5733610a435f546001600160a01b031690565b60025460405163061db9c160e01b81526001600160a01b039384166004820152918316602483015291909116604482015260640161065b565b6001600160a01b038116610aa35760405163d92e233d60e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527fd1a6a14209a385a964d036e404cb5cfb71f4000cdb03c9366292430787261be69060200160405180910390a150565b610aff61135e565b5f819003610b425760405162461bcd60e51b815260206004820152601060248201526f092dcecc2d8d2c840d6caf240d0c2e6d60831b604482015260640161065b565b600355565b335f9081526006602052604081205460ff16610b7657604051635c427cd960e01b815260040160405180910390fd5b815f03610b9657604051630177be4b60e01b815260040160405180910390fd5b6040805160018082528183019092525f91816020015b604080518082019091525f8082526020820152815260200190600190039081610bac57905050905060405180604001604052805f6001600160801b03168152602001846001600160801b0316815250815f81518110610c0d57610c0d611f9f565b6020026020010181905250610c2181611504565b9150505b919050565b610c3261135e565b805f03610c815760405162461bcd60e51b815260206004820152601760248201527f496e76616c696420737562736372697074696f6e204944000000000000000000604482015260640161065b565b600481905560405181907f8a2377055cb80a6969c9e8a0cc11ee02c18ba436643aa673bf887b12f3544231905f90a250565b610cbb61135e565b60038361ffff1610158015610cd5575060c861ffff841611155b610d195760405162461bcd60e51b8152602060048201526015602482015274496e76616c696420636f6e6669726d6174696f6e7360581b604482015260640161065b565b620186a08263ffffffff161015610d665760405162461bcd60e51b8152602060048201526011602482015270476173206c696d697420746f6f206c6f7760781b604482015260640161065b565b6005805461ffff851665ffffffffffff1990911681176201000063ffffffff8681169182029290921769ffffffff0000000000001916600160301b92861692830217909355604080519283526020830193909352918101919091527f753ca0c3657bcf9ef603c50e345a2c6185164ba62d2ca6e18483ec975aa695d29060600160405180910390a1505050565b610dfb61135e565b610e0481611931565b50565b5f818152600860209081526040808320815160a0810190925280546001600160a01b038116835284938493849384938493830190600160a01b900460ff166003811115610e5657610e56611c2e565b6003811115610e6757610e67611c2e565b81528154600160a81b810464ffffffffff908116602080850191909152600160d01b90920460ff9081166040808601919091526001909501546060948501528551928601519486015193860151608090960151929d949c50921699509216965090945092505050565b5f8381526008602052604090205483906001600160a01b0316610f06576040516302e8145360e61b815260040160405180910390fd5b5f84815260086020526040902060018314610f3457604051631f9efadb60e11b815260040160405180910390fd5b8054610f52906201518090600160a81b900464ffffffffff16611fdf565b421115611011578054600360a01b60ff60a01b19821617825560408051602081019091525f8152610fb0916001600160a01b03169087907f557bc7dd98b058bb9f53e4df97129792526574a4717818cdf9803f6b16290a31906119d9565b610fb985611acb565b847f55e7e920e02068b5d6b5d6f2647a1b22512687889accfa54a061df01051a10bf60405161100390602080825260079082015266151a5b595bdd5d60ca1b604082015260600190565b60405180910390a250611358565b5f84845f81811061102457611024611f9f565b60209081029290920135600185018190555f898152600990935260408320805491945092915067ffffffffffffffff81111561106257611062611ed7565b6040519080825280602002602001820160405280156110a657816020015b604080518082019091525f80825260208201528152602001906001900390816110805790505b5090505f5b825481101561112c578281815481106110c6576110c6611f9f565b5f918252602091829020604080518082019091529101546001600160801b038082168352600160801b9091041691810191909152825183908390811061110e5761110e611f9f565b6020026020010181905250808061112490611fc7565b9150506110ab565b505f61113884836113b2565b508554604080516020810182525f8152905163b1d94c9560e01b81529293506001600160a01b039091169160019190839063b1d94c9590611181908f908b908990600401611ff2565b5f604051808303815f87803b158015611198575f80fd5b505af19250505080156111a9575060015b6112b6576111b5612019565b806308c379a00361121d57506111c9612032565b806111d4575061121f565b885460ff60a01b1916600360a01b1789555f9250905080611217848e7f7de8c190dae06a0d538e8de8db3f15877766074bb5a2835b1061d57383d670c3846119d9565b506112c8565b505b3d808015611248576040519150601f19603f3d011682016040523d82523d5f602084013e61124d565b606091505b5060408051808201909152600f81526e2637bb96b632bb32b61032b93937b960891b6020820152895460ff60a01b1916600360a01b178a555f93509150611217848e7f2961ae3abb4319e6f3219d7e6705c5b73cd9d34c241ee979884ad93815f0b971846119d9565b875460ff60a01b1916600160a11b1788555b6112d18c611acb565b8115611316578b7f93e1173be54cedd9126549fd129b715cab6d00b7492080fca0b389a2af25373f88866040516113099291906120bb565b60405180910390a261134f565b8b7f55e7e920e02068b5d6b5d6f2647a1b22512687889accfa54a061df01051a10bf82604051611346919061211e565b60405180910390a25b50505050505050505b50505050565b5f546001600160a01b031633146113b05760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b604482015260640161065b565b565b80516060905f908067ffffffffffffffff8111156113d2576113d2611ed7565b6040519080825280602002602001820160405280156113fb578160200160208202803683370190505b5092505f5b818110156114fb575f85828151811061141b5761141b611f9f565b602002602001015190505f815f01516001600160801b031690505f82602001516001600160801b03169050818111611469576040516334851d2d60e11b81526004810185905260240161065b565b5f6114748383612130565b90505f83611482838d612157565b61148c9190611fdf565b9050808987815181106114a1576114a1611f9f565b6020026020010181815250508a866040516020016114c9929190918252602082015260400190565b604051602081830303815290604052805190602001205f1c9a50505050505080806114f390611fc7565b915050611400565b50919492505050565b5f81515f0361152657604051630177be4b60e01b815260040160405180910390fd5b6004545f03611548576040516342c4719160e11b815260040160405180910390fd5b335f908152600760205260409020548251811015611579576040516327bf27fd60e11b815260040160405180910390fd5b5f5b83518110156116015783818151811061159657611596611f9f565b60200260200101515f01516001600160801b03168482815181106115bc576115bc611f9f565b6020026020010151602001516001600160801b0316116115ef57604051630177be4b60e01b815260040160405180910390fd5b806115f981611fc7565b91505061157b565b506005545f9061161f90600a9062010000900463ffffffff1661216a565b600554611638919062010000900463ffffffff1661218c565b600554855163ffffffff92831693505f9261165b92600160301b900416906121b0565b6116659083611fdf565b6005549091505f9062010000900463ffffffff1682116116855781611695565b60055462010000900463ffffffff165b6002546040805160c081018252600354815260045460208083019190915260055461ffff168284015263ffffffff851660608301526001608083015282519081019092525f8083529394506001600160a01b0390921691639b1c385e9160a082019061170090611b00565b8152506040518263ffffffff1660e01b815260040161171f91906121c7565b6020604051808303815f875af115801561173b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061175f9190612223565b6040805160a081018252338152600160208083019182524264ffffffffff16838501528b5160ff1660608401525f60808401819052858152600890915292909220815181546001600160a01b031981166001600160a01b039092169182178355935194955091939092909183916001600160a81b03191617600160a01b8360038111156117ee576117ee611c2e565b02179055506040828101518254606085015160ff16600160d01b0260ff60d01b1964ffffffffff909316600160a81b029290921665ffffffffffff60a81b19909116171782556080909201516001909101555f8281526009602052908120905b88518110156118b6578189828151811061186a5761186a611f9f565b60209081029190910181015182546001810184555f93845292829020815191909201516001600160801b03908116600160801b02911617910155806118ae81611fc7565b91505061184e565b50600a8054905f6118c683611fc7565b9091555050600b8054905f6118da83611fc7565b9190505550336001600160a01b0316827f66d9d157fbc43ff4032bf71fc33442f06a93c86368efade9193bf47d2b17da288a51868c60405161191e9392919061223a565b60405180910390a3509695505050505050565b336001600160a01b038216036119895760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161065b565b600180546001600160a01b0319166001600160a01b038381169182179092555f8054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6040516310be330160e01b81526001600160a01b038516906310be330190611a09908690869086906004016122ab565b5f604051808303815f87803b158015611a20575f80fd5b505af1925050508015611a31575060015b611358573d808015611a5e576040519150601f19603f3d011682016040523d82523d5f602084013e611a63565b606091505b50846001600160a01b0316847fad1c6a9df5df482ebaada30f64eaf6ffca5b722033273bde4f5faaff1251b5b78584515f14611a9f5784611aaf565b60405180602001604052805f8152505b604051611abd9291906122c9565b60405180910390a350611358565b5f818152600960205260408120611ae191611b71565b600b5415610e0457600b8054905f611af8836122e1565b919050555050565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401611b3991511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b5080545f8255905f5260205f2090810190610e0491905b80821115611b9b575f8155600101611b88565b5090565b5f805f60408486031215611bb1575f80fd5b83359250602084013567ffffffffffffffff80821115611bcf575f80fd5b818601915086601f830112611be2575f80fd5b813581811115611bf0575f80fd5b8760208260051b8501011115611c04575f80fd5b6020830194508093505050509250925092565b5f60208284031215611c27575f80fd5b5035919050565b634e487b7160e01b5f52602160045260245ffd5b60048110611c5e57634e487b7160e01b5f52602160045260245ffd5b9052565b6001600160a01b038616815260a08101611c7f6020830187611c42565b64ffffffffff8516604083015260ff841660608301528260808301529695505050505050565b80356001600160a01b0381168114610c25575f80fd5b5f805f60608486031215611ccd575f80fd5b611cd684611ca5565b925060208401358015158114611cea575f80fd5b929592945050506040919091013590565b5f8083601f840112611d0b575f80fd5b50813567ffffffffffffffff811115611d22575f80fd5b6020830191508360208260061b8501011115611d3c575f80fd5b9250929050565b5f805f60408486031215611d55575f80fd5b83359250602084013567ffffffffffffffff811115611d72575f80fd5b611d7e86828701611cfb565b9497909650939450505050565b5f8151808452602080850194508084015f5b83811015611db957815187529582019590820190600101611d9d565b509495945050505050565b602081525f611dd66020830184611d8b565b9392505050565b5f8060208385031215611dee575f80fd5b823567ffffffffffffffff811115611e04575f80fd5b611e1085828601611cfb565b90969095509350505050565b5f60208284031215611e2c575f80fd5b611dd682611ca5565b60208101610a018284611c42565b803563ffffffff81168114610c25575f80fd5b5f805f60608486031215611e68575f80fd5b833561ffff81168114611e79575f80fd5b9250611e8760208501611e43565b9150611e9560408501611e43565b90509250925092565b6001600160a01b038616815260a08101611ebb6020830187611c42565b8460408301528360608301528260808301529695505050505050565b634e487b7160e01b5f52604160045260245ffd5b601f8201601f1916810167ffffffffffffffff81118282101715611f1d57634e487b7160e01b5f52604160045260245ffd5b6040525050565b80356001600160801b0381168114610c25575f80fd5b5f60408284031215611f4a575f80fd5b6040516040810181811067ffffffffffffffff82111715611f7957634e487b7160e01b5f52604160045260245ffd5b604052611f8583611f24565b8152611f9360208401611f24565b60208201529392505050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f60018201611fd857611fd8611fb3565b5060010190565b80820180821115610a0157610a01611fb3565b838152826020820152606060408201525f6120106060830184611d8b565b95945050505050565b5f60033d111561202f5760045f803e505f5160e01c5b90565b5f60443d101561203f5790565b6040516003193d81016004833e81513d67ffffffffffffffff816024840111818411171561206f57505050505090565b82850191508151818111156120875750505050505090565b843d87010160208285010111156120a15750505050505090565b6120b060208286010187611eeb565b509095945050505050565b828152604060208201525f6120d36040830184611d8b565b949350505050565b5f81518084525f5b818110156120ff576020818501810151868301820152016120e3565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f611dd660208301846120db565b81810381811115610a0157610a01611fb3565b634e487b7160e01b5f52601260045260245ffd5b5f8261216557612165612143565b500690565b5f63ffffffff8084168061218057612180612143565b92169190910492915050565b63ffffffff8281168282160390808211156121a9576121a9611fb3565b5092915050565b8082028115828204841417610a0157610a01611fb3565b60208152815160208201526020820151604082015261ffff60408301511660608201525f606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c0808401526109fd60e08401826120db565b5f60208284031215612233575f80fd5b5051919050565b5f60608201858352602063ffffffff861681850152604060608186015282865180855260808701915083880194505f5b8181101561229c57855180516001600160801b039081168552908601511685840152948401949183019160010161226a565b50909998505050505050505050565b838152826020820152606060408201525f61201060608301846120db565b828152604060208201525f6120d360408301846120db565b5f816122ef576122ef611fb3565b505f19019056fea26469706673582212206205c0e89e16858c010d2d9c69cf153403c3c24f60b46759613cf76eb163488364736f6c634300081400330000000000000000000000003c0ca683b403e37668ae3dc4fb62f4b29b6f7a3e
Deployed Bytecode
0x608060405234801561000f575f80fd5b5060043610610229575f3560e01c80639130d1b21161012a578063c1e0d236116100b4578063e6a210af11610079578063e6a210af14610597578063eb1d28bb146105b9578063ec336e11146105c2578063f2fde38b146105e8578063f735968c146105fb575f80fd5b8063c1e0d23614610500578063d8a4676f14610513578063da046ce814610549578063dd5a894f1461057b578063e0abba571461058e575f80fd5b8063b0fb162f116100fa578063b0fb162f146104c5578063b1eb96c9146104d3578063b376edbd146104e6578063bc0ed30d146104ee578063bc2c81e9146104f6575f80fd5b80639130d1b21461045a57806398544710146104795780639e33908b1461048c5780639eccacf6146104b2575f80fd5b806361728f39116101b657806385b88d5a1161017b57806385b88d5a146103ff5780638aea61dc146104125780638da5cb5b1461041b5780638ea981171461043f5780638f33d7c914610452575f80fd5b806361728f391461039d578063727e6608146103a65780637297fc61146103c657806379ba5097146103ed5780637ce1ffeb146103f5575f80fd5b806335999a7d116101fc57806335999a7d146102fa57806342d10e551461032157806346549f411461034d578063484956c51461036057806358ff423d14610387575f80fd5b8063055342961461022d57806315c48b84146102625780631fe543e31461027d5780632adb9e3c14610292575b5f80fd5b7f557bc7dd98b058bb9f53e4df97129792526574a4717818cdf9803f6b16290a315b6040519081526020015b60405180910390f35b61026a60c881565b60405161ffff9091168152602001610259565b61029061028b366004611b9f565b61061f565b005b6102e96102a0366004611c17565b60086020525f9081526040902080546001909101546001600160a01b0382169160ff600160a01b820481169264ffffffffff600160a81b84041692600160d01b90049091169085565b604051610259959493929190611c62565b61024f7f7de8c190dae06a0d538e8de8db3f15877766074bb5a2835b1061d57383d670c381565b60055461033890600160301b900463ffffffff1681565b60405163ffffffff9091168152602001610259565b61029061035b366004611cbb565b610674565b61024f7f2961ae3abb4319e6f3219d7e6705c5b73cd9d34c241ee979884ad93815f0b97181565b6005546103389062010000900463ffffffff1681565b61024f60035481565b6103b96103b4366004611d43565b6107a0565b6040516102599190611dc4565b61024f7f557bc7dd98b058bb9f53e4df97129792526574a4717818cdf9803f6b16290a3181565b610290610858565b61024f620186a081565b61024f61040d366004611ddd565b610901565b61024f600a5481565b5f546001600160a01b03165b6040516001600160a01b039091168152602001610259565b61029061044d366004611e1c565b610a07565b61024f600181565b61024f610468366004611e1c565b60076020525f908152604090205481565b610290610487366004611c17565b610af7565b7f7de8c190dae06a0d538e8de8db3f15877766074bb5a2835b1061d57383d670c361024f565b600254610427906001600160a01b031681565b60055461026a9061ffff1681565b61024f6104e1366004611c17565b610b47565b61024f604081565b600b5461024f565b61024f6201518081565b61029061050e366004611c17565b610c2a565b61053c610521366004611c17565b5f90815260086020526040902054600160a01b900460ff1690565b6040516102599190611e35565b61056b610557366004611e1c565b60066020525f908152604090205460ff1681565b6040519015158152602001610259565b610290610589366004611e56565b610cb3565b61024f600b5481565b61024f6105a5366004611c17565b5f9081526008602052604090206001015490565b61024f60045481565b7f2961ae3abb4319e6f3219d7e6705c5b73cd9d34c241ee979884ad93815f0b97161024f565b6102906105f6366004611e1c565b610df3565b61060e610609366004611c17565b610e07565b604051610259959493929190611e9e565b6002546001600160a01b031633146106645760025460405163073e64fd60e21b81523360048201526001600160a01b0390911660248201526044015b60405180910390fd5b61066f838383610ed0565b505050565b61067c61135e565b6001600160a01b0383166106d25760405162461bcd60e51b815260206004820152601860248201527f496e76616c696420636f6e73756d657220616464726573730000000000000000604482015260640161065b565b5f81156106df57816106e2565b60015b905081156107305760408211156107305760405162461bcd60e51b8152602060048201526012602482015271496e76616c6964206d61782072616e67657360701b604482015260640161065b565b6001600160a01b0384165f818152600660209081526040808320805460ff1916881515908117909155600783529281902085905580519283529082018490527f862018a08880c668a51f563f0bbb0b5c9a5c0d50a8477f56aa531a6fc8b0f2c5910160405180910390a250505050565b5f838152600860205260408120600101546060918190036107f15760405162461bcd60e51b815260206004820152600b60248201526a139bc81c985dc81ddbdc9960aa1b604482015260640161065b565b5f61084d828686808060200260200160405190810160405280939291908181526020015f905b828210156108435761083460408302860136819003810190611f3a565b81526020019060010190610817565b50505050506113b2565b509695505050505050565b6001546001600160a01b031633146108ab5760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b604482015260640161065b565b5f8054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b335f9081526006602052604081205460ff1661093057604051635c427cd960e01b815260040160405180910390fd5b5f8267ffffffffffffffff81111561094a5761094a611ed7565b60405190808252806020026020018201604052801561098e57816020015b604080518082019091525f80825260208201528152602001906001900390816109685790505b5090505f5b838110156109f3578484828181106109ad576109ad611f9f565b9050604002018036038101906109c39190611f3a565b8282815181106109d5576109d5611f9f565b602002602001018190525080806109eb90611fc7565b915050610993565b506109fd81611504565b9150505b92915050565b5f546001600160a01b03163314801590610a2c57506002546001600160a01b03163314155b15610a7c5733610a435f546001600160a01b031690565b60025460405163061db9c160e01b81526001600160a01b039384166004820152918316602483015291909116604482015260640161065b565b6001600160a01b038116610aa35760405163d92e233d60e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527fd1a6a14209a385a964d036e404cb5cfb71f4000cdb03c9366292430787261be69060200160405180910390a150565b610aff61135e565b5f819003610b425760405162461bcd60e51b815260206004820152601060248201526f092dcecc2d8d2c840d6caf240d0c2e6d60831b604482015260640161065b565b600355565b335f9081526006602052604081205460ff16610b7657604051635c427cd960e01b815260040160405180910390fd5b815f03610b9657604051630177be4b60e01b815260040160405180910390fd5b6040805160018082528183019092525f91816020015b604080518082019091525f8082526020820152815260200190600190039081610bac57905050905060405180604001604052805f6001600160801b03168152602001846001600160801b0316815250815f81518110610c0d57610c0d611f9f565b6020026020010181905250610c2181611504565b9150505b919050565b610c3261135e565b805f03610c815760405162461bcd60e51b815260206004820152601760248201527f496e76616c696420737562736372697074696f6e204944000000000000000000604482015260640161065b565b600481905560405181907f8a2377055cb80a6969c9e8a0cc11ee02c18ba436643aa673bf887b12f3544231905f90a250565b610cbb61135e565b60038361ffff1610158015610cd5575060c861ffff841611155b610d195760405162461bcd60e51b8152602060048201526015602482015274496e76616c696420636f6e6669726d6174696f6e7360581b604482015260640161065b565b620186a08263ffffffff161015610d665760405162461bcd60e51b8152602060048201526011602482015270476173206c696d697420746f6f206c6f7760781b604482015260640161065b565b6005805461ffff851665ffffffffffff1990911681176201000063ffffffff8681169182029290921769ffffffff0000000000001916600160301b92861692830217909355604080519283526020830193909352918101919091527f753ca0c3657bcf9ef603c50e345a2c6185164ba62d2ca6e18483ec975aa695d29060600160405180910390a1505050565b610dfb61135e565b610e0481611931565b50565b5f818152600860209081526040808320815160a0810190925280546001600160a01b038116835284938493849384938493830190600160a01b900460ff166003811115610e5657610e56611c2e565b6003811115610e6757610e67611c2e565b81528154600160a81b810464ffffffffff908116602080850191909152600160d01b90920460ff9081166040808601919091526001909501546060948501528551928601519486015193860151608090960151929d949c50921699509216965090945092505050565b5f8381526008602052604090205483906001600160a01b0316610f06576040516302e8145360e61b815260040160405180910390fd5b5f84815260086020526040902060018314610f3457604051631f9efadb60e11b815260040160405180910390fd5b8054610f52906201518090600160a81b900464ffffffffff16611fdf565b421115611011578054600360a01b60ff60a01b19821617825560408051602081019091525f8152610fb0916001600160a01b03169087907f557bc7dd98b058bb9f53e4df97129792526574a4717818cdf9803f6b16290a31906119d9565b610fb985611acb565b847f55e7e920e02068b5d6b5d6f2647a1b22512687889accfa54a061df01051a10bf60405161100390602080825260079082015266151a5b595bdd5d60ca1b604082015260600190565b60405180910390a250611358565b5f84845f81811061102457611024611f9f565b60209081029290920135600185018190555f898152600990935260408320805491945092915067ffffffffffffffff81111561106257611062611ed7565b6040519080825280602002602001820160405280156110a657816020015b604080518082019091525f80825260208201528152602001906001900390816110805790505b5090505f5b825481101561112c578281815481106110c6576110c6611f9f565b5f918252602091829020604080518082019091529101546001600160801b038082168352600160801b9091041691810191909152825183908390811061110e5761110e611f9f565b6020026020010181905250808061112490611fc7565b9150506110ab565b505f61113884836113b2565b508554604080516020810182525f8152905163b1d94c9560e01b81529293506001600160a01b039091169160019190839063b1d94c9590611181908f908b908990600401611ff2565b5f604051808303815f87803b158015611198575f80fd5b505af19250505080156111a9575060015b6112b6576111b5612019565b806308c379a00361121d57506111c9612032565b806111d4575061121f565b885460ff60a01b1916600360a01b1789555f9250905080611217848e7f7de8c190dae06a0d538e8de8db3f15877766074bb5a2835b1061d57383d670c3846119d9565b506112c8565b505b3d808015611248576040519150601f19603f3d011682016040523d82523d5f602084013e61124d565b606091505b5060408051808201909152600f81526e2637bb96b632bb32b61032b93937b960891b6020820152895460ff60a01b1916600360a01b178a555f93509150611217848e7f2961ae3abb4319e6f3219d7e6705c5b73cd9d34c241ee979884ad93815f0b971846119d9565b875460ff60a01b1916600160a11b1788555b6112d18c611acb565b8115611316578b7f93e1173be54cedd9126549fd129b715cab6d00b7492080fca0b389a2af25373f88866040516113099291906120bb565b60405180910390a261134f565b8b7f55e7e920e02068b5d6b5d6f2647a1b22512687889accfa54a061df01051a10bf82604051611346919061211e565b60405180910390a25b50505050505050505b50505050565b5f546001600160a01b031633146113b05760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b604482015260640161065b565b565b80516060905f908067ffffffffffffffff8111156113d2576113d2611ed7565b6040519080825280602002602001820160405280156113fb578160200160208202803683370190505b5092505f5b818110156114fb575f85828151811061141b5761141b611f9f565b602002602001015190505f815f01516001600160801b031690505f82602001516001600160801b03169050818111611469576040516334851d2d60e11b81526004810185905260240161065b565b5f6114748383612130565b90505f83611482838d612157565b61148c9190611fdf565b9050808987815181106114a1576114a1611f9f565b6020026020010181815250508a866040516020016114c9929190918252602082015260400190565b604051602081830303815290604052805190602001205f1c9a50505050505080806114f390611fc7565b915050611400565b50919492505050565b5f81515f0361152657604051630177be4b60e01b815260040160405180910390fd5b6004545f03611548576040516342c4719160e11b815260040160405180910390fd5b335f908152600760205260409020548251811015611579576040516327bf27fd60e11b815260040160405180910390fd5b5f5b83518110156116015783818151811061159657611596611f9f565b60200260200101515f01516001600160801b03168482815181106115bc576115bc611f9f565b6020026020010151602001516001600160801b0316116115ef57604051630177be4b60e01b815260040160405180910390fd5b806115f981611fc7565b91505061157b565b506005545f9061161f90600a9062010000900463ffffffff1661216a565b600554611638919062010000900463ffffffff1661218c565b600554855163ffffffff92831693505f9261165b92600160301b900416906121b0565b6116659083611fdf565b6005549091505f9062010000900463ffffffff1682116116855781611695565b60055462010000900463ffffffff165b6002546040805160c081018252600354815260045460208083019190915260055461ffff168284015263ffffffff851660608301526001608083015282519081019092525f8083529394506001600160a01b0390921691639b1c385e9160a082019061170090611b00565b8152506040518263ffffffff1660e01b815260040161171f91906121c7565b6020604051808303815f875af115801561173b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061175f9190612223565b6040805160a081018252338152600160208083019182524264ffffffffff16838501528b5160ff1660608401525f60808401819052858152600890915292909220815181546001600160a01b031981166001600160a01b039092169182178355935194955091939092909183916001600160a81b03191617600160a01b8360038111156117ee576117ee611c2e565b02179055506040828101518254606085015160ff16600160d01b0260ff60d01b1964ffffffffff909316600160a81b029290921665ffffffffffff60a81b19909116171782556080909201516001909101555f8281526009602052908120905b88518110156118b6578189828151811061186a5761186a611f9f565b60209081029190910181015182546001810184555f93845292829020815191909201516001600160801b03908116600160801b02911617910155806118ae81611fc7565b91505061184e565b50600a8054905f6118c683611fc7565b9091555050600b8054905f6118da83611fc7565b9190505550336001600160a01b0316827f66d9d157fbc43ff4032bf71fc33442f06a93c86368efade9193bf47d2b17da288a51868c60405161191e9392919061223a565b60405180910390a3509695505050505050565b336001600160a01b038216036119895760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161065b565b600180546001600160a01b0319166001600160a01b038381169182179092555f8054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6040516310be330160e01b81526001600160a01b038516906310be330190611a09908690869086906004016122ab565b5f604051808303815f87803b158015611a20575f80fd5b505af1925050508015611a31575060015b611358573d808015611a5e576040519150601f19603f3d011682016040523d82523d5f602084013e611a63565b606091505b50846001600160a01b0316847fad1c6a9df5df482ebaada30f64eaf6ffca5b722033273bde4f5faaff1251b5b78584515f14611a9f5784611aaf565b60405180602001604052805f8152505b604051611abd9291906122c9565b60405180910390a350611358565b5f818152600960205260408120611ae191611b71565b600b5415610e0457600b8054905f611af8836122e1565b919050555050565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa82604051602401611b3991511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b5080545f8255905f5260205f2090810190610e0491905b80821115611b9b575f8155600101611b88565b5090565b5f805f60408486031215611bb1575f80fd5b83359250602084013567ffffffffffffffff80821115611bcf575f80fd5b818601915086601f830112611be2575f80fd5b813581811115611bf0575f80fd5b8760208260051b8501011115611c04575f80fd5b6020830194508093505050509250925092565b5f60208284031215611c27575f80fd5b5035919050565b634e487b7160e01b5f52602160045260245ffd5b60048110611c5e57634e487b7160e01b5f52602160045260245ffd5b9052565b6001600160a01b038616815260a08101611c7f6020830187611c42565b64ffffffffff8516604083015260ff841660608301528260808301529695505050505050565b80356001600160a01b0381168114610c25575f80fd5b5f805f60608486031215611ccd575f80fd5b611cd684611ca5565b925060208401358015158114611cea575f80fd5b929592945050506040919091013590565b5f8083601f840112611d0b575f80fd5b50813567ffffffffffffffff811115611d22575f80fd5b6020830191508360208260061b8501011115611d3c575f80fd5b9250929050565b5f805f60408486031215611d55575f80fd5b83359250602084013567ffffffffffffffff811115611d72575f80fd5b611d7e86828701611cfb565b9497909650939450505050565b5f8151808452602080850194508084015f5b83811015611db957815187529582019590820190600101611d9d565b509495945050505050565b602081525f611dd66020830184611d8b565b9392505050565b5f8060208385031215611dee575f80fd5b823567ffffffffffffffff811115611e04575f80fd5b611e1085828601611cfb565b90969095509350505050565b5f60208284031215611e2c575f80fd5b611dd682611ca5565b60208101610a018284611c42565b803563ffffffff81168114610c25575f80fd5b5f805f60608486031215611e68575f80fd5b833561ffff81168114611e79575f80fd5b9250611e8760208501611e43565b9150611e9560408501611e43565b90509250925092565b6001600160a01b038616815260a08101611ebb6020830187611c42565b8460408301528360608301528260808301529695505050505050565b634e487b7160e01b5f52604160045260245ffd5b601f8201601f1916810167ffffffffffffffff81118282101715611f1d57634e487b7160e01b5f52604160045260245ffd5b6040525050565b80356001600160801b0381168114610c25575f80fd5b5f60408284031215611f4a575f80fd5b6040516040810181811067ffffffffffffffff82111715611f7957634e487b7160e01b5f52604160045260245ffd5b604052611f8583611f24565b8152611f9360208401611f24565b60208201529392505050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f60018201611fd857611fd8611fb3565b5060010190565b80820180821115610a0157610a01611fb3565b838152826020820152606060408201525f6120106060830184611d8b565b95945050505050565b5f60033d111561202f5760045f803e505f5160e01c5b90565b5f60443d101561203f5790565b6040516003193d81016004833e81513d67ffffffffffffffff816024840111818411171561206f57505050505090565b82850191508151818111156120875750505050505090565b843d87010160208285010111156120a15750505050505090565b6120b060208286010187611eeb565b509095945050505050565b828152604060208201525f6120d36040830184611d8b565b949350505050565b5f81518084525f5b818110156120ff576020818501810151868301820152016120e3565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f611dd660208301846120db565b81810381811115610a0157610a01611fb3565b634e487b7160e01b5f52601260045260245ffd5b5f8261216557612165612143565b500690565b5f63ffffffff8084168061218057612180612143565b92169190910492915050565b63ffffffff8281168282160390808211156121a9576121a9611fb3565b5092915050565b8082028115828204841417610a0157610a01611fb3565b60208152815160208201526020820151604082015261ffff60408301511660608201525f606083015163ffffffff80821660808501528060808601511660a0850152505060a083015160c0808401526109fd60e08401826120db565b5f60208284031215612233575f80fd5b5051919050565b5f60608201858352602063ffffffff861681850152604060608186015282865180855260808701915083880194505f5b8181101561229c57855180516001600160801b039081168552908601511685840152948401949183019160010161226a565b50909998505050505050505050565b838152826020820152606060408201525f61201060608301846120db565b828152604060208201525f6120d360408301846120db565b5f816122ef576122ef611fb3565b505f19019056fea26469706673582212206205c0e89e16858c010d2d9c69cf153403c3c24f60b46759613cf76eb163488364736f6c63430008140033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.