Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
BBOTSRenderer
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 1337 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity ^0.8.13; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {VRFConsumerBaseV2} from "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; import {VRFCoordinatorV2Interface} from "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; import {IBBOTSRenderer} from "src/interface/BBOTSRenderer.interface.sol"; //_/\\\\\\\\\\\\\__________________/\\\\\\\\\\\\\_________/\\\\\_______/\\\\\\\\\\\\\\\_____/\\\\\\\\\\\___ //_\/\\\/////////\\\_______________\/\\\/////////\\\_____/\\\///\\\____\///////\\\/////____/\\\/////////\\\_ // _\/\\\_______\/\\\_______________\/\\\_______\/\\\___/\\\/__\///\\\________\/\\\________\//\\\______\///__ // _\/\\\\\\\\\\\\\\___/\\\\\\\\\\\_\/\\\\\\\\\\\\\\___/\\\______\//\\\_______\/\\\_________\////\\\_________ // _\/\\\/////////\\\_\///////////__\/\\\/////////\\\_\/\\\_______\/\\\_______\/\\\____________\////\\\______ // _\/\\\_______\/\\\_______________\/\\\_______\/\\\_\//\\\______/\\\________\/\\\_______________\////\\\___ // _\/\\\_______\/\\\_______________\/\\\_______\/\\\__\///\\\__/\\\__________\/\\\________/\\\______\//\\\__ // _\/\\\\\\\\\\\\\/________________\/\\\\\\\\\\\\\/_____\///\\\\\/___________\/\\\_______\///\\\\\\\\\\\/___ // _\/////////////__________________\/////////////_________\/////_____________\///__________\///////////_____ /// @title B-BOTS Renderer using Fisher-Yates shuffle to randomize metadata /// @author ghard.eth contract BBOTSRenderer is IBBOTSRenderer, Ownable, VRFConsumerBaseV2 { using Strings for uint256; /*/////////////////////////////////////////////////////////////// RANDOMNESS STORAGE //////////////////////////////////////////////////////////////*/ uint16 constant REQUEST_CONFIRMATIONS = 3; uint32 constant NUM_WORDS = 1; uint32 requestedEntropy; uint256[] public entropies; VRFCoordinatorV2Interface vrfCoordinator; uint64 subscriptionId; /*/////////////////////////////////////////////////////////////// METADATA //////////////////////////////////////////////////////////////*/ uint16[] public tranches; string public metadataPrefix; constructor( uint64 _subscriptionId, address _vrfCoordinator, uint16[] memory _tranches, string memory _metadataPrefix ) VRFConsumerBaseV2(_vrfCoordinator) { subscriptionId = _subscriptionId; vrfCoordinator = VRFCoordinatorV2Interface(_vrfCoordinator); tranches = _tranches; metadataPrefix = _metadataPrefix; } /*/////////////////////////////////////////////////////////////// RENDERING //////////////////////////////////////////////////////////////*/ /** * @notice Get the metadata address for token `_id`. Will be updated after the reveal of each tranche * @dev the length of `entropies` determines how many tranches have been revealed. */ function tokenURI(uint256 id) public view override returns (string memory metadataUri) { // TODO: Translate tokenId to metadata id uint256 metadataId = _renderId(id); return string.concat(metadataPrefix, metadataId.toString()); } function _renderId(uint256 tokenId) internal view returns (uint256 metadataId) { uint256 metadataIdx = tranches[0]; uint256 MAX_SUPPLY = tranches[tranches.length - 1]; uint256 entropy; uint256 randomIndex; uint256[] memory metadata = new uint256[](MAX_SUPPLY + 1); // f(metadataIdx) = tokenId for (uint256 j; j < entropies.length; j++) { entropy = entropies[j]; for (metadataIdx; metadataIdx <= tranches[j + 1]; metadataIdx++) { // Get a random index higher than the current index randomIndex = metadataIdx + (entropy % (MAX_SUPPLY + 1 - metadataIdx)); // if still virtualized, set value of random index if (metadata[randomIndex] == 0) metadata[randomIndex] = randomIndex; // if still virtualized, set value of current index if (metadata[metadataIdx] == 0) metadata[metadataIdx] = metadataIdx; // swap current and random index (metadata[metadataIdx], metadata[randomIndex]) = ( metadata[randomIndex], metadata[metadataIdx] ); // if the assigned metadata is our token, return if (metadata[metadataIdx] == tokenId + 1) { return metadataIdx; } } } // if we havent returned yet, metadata hasnt been assigned return 0; } /*/////////////////////////////////////////////////////////////// RANDOMNESS //////////////////////////////////////////////////////////////*/ /** * @notice Request random number from Chainlink VRF. Only callable by owner. * @dev check keyHash and callbackGasLimit requirements: https://docs.chain.link/docs/vrf-contracts/ */ function requestEntropy(bytes32 _keyHash, uint32 _callbackGasLimit) external onlyOwner { if (requestedEntropy + NUM_WORDS > tranches.length - 1) revert TooMuchEntropy(); vrfCoordinator.requestRandomWords( _keyHash, subscriptionId, REQUEST_CONFIRMATIONS, _callbackGasLimit, NUM_WORDS ); requestedEntropy += NUM_WORDS; emit EntropyRequested(); } /// @dev callback from chainlink vrf. This triggers the tranche reveal of metadata function fulfillRandomWords(uint256, uint256[] memory randomWords) internal override { for (uint256 i; i < randomWords.length; i++) { entropies.push(randomWords[i]); emit EntropyReceived(randomWords[i]); } } function updateSubscription(uint64 _subscriptionId) external onlyOwner { subscriptionId = _subscriptionId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing 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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_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) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @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] = _HEX_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); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /** **************************************************************************** * @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 VRFCoordinator * @dev 2. The consumer contract implements fulfillRandomWords. * ***************************************************************************** * @dev USAGE * * @dev Calling contracts must inherit from VRFConsumerBase, and can * @dev initialize VRFConsumerBase's attributes in their constructor as * @dev shown: * * @dev contract VRFConsumer { * @dev constructor(<other arguments>, address _vrfCoordinator, address _link) * @dev VRFConsumerBase(_vrfCoordinator) 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 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), * @dev see (VRFCoordinatorInterface for a description of the arguments). * * @dev Once the VRFCoordinator 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 VRFConsumerBase.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 VRFConsumerBaseV2 { error OnlyCoordinatorCanFulfill(address have, address want); address private immutable vrfCoordinator; /** * @param _vrfCoordinator address of VRFCoordinator contract */ constructor(address _vrfCoordinator) { vrfCoordinator = _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 VRFConsumerBaseV2 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 */ function fulfillRandomWords(uint256 requestId, uint256[] memory 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[] memory randomWords) external { if (msg.sender != vrfCoordinator) { revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator); } fulfillRandomWords(requestId, randomWords); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface VRFCoordinatorV2Interface { /** * @notice Get configuration relevant for making requests * @return minimumRequestConfirmations global min for request confirmations * @return maxGasLimit global max for request gas limit * @return s_provingKeyHashes list of registered key hashes */ function getRequestConfig() external view returns ( uint16, uint32, bytes32[] memory ); /** * @notice Request a set of random words. * @param 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. * @param subId - The ID of the VRF subscription. Must be funded * with the minimum subscription balance required for the selected keyHash. * @param minimumRequestConfirmations - 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]. * @param 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] * @param 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. * @return requestId - A unique identifier of the request. Can be used to match * a request to a response in fulfillRandomWords. */ function requestRandomWords( bytes32 keyHash, uint64 subId, uint16 minimumRequestConfirmations, uint32 callbackGasLimit, uint32 numWords ) external returns (uint256 requestId); /** * @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, use transferAndCall. For example * @dev LINKTOKEN.transferAndCall( * @dev address(COORDINATOR), * @dev amount, * @dev abi.encode(subId)); */ function createSubscription() external returns (uint64 subId); /** * @notice Get a VRF subscription. * @param subId - ID of the subscription * @return balance - LINK balance of the subscription in juels. * @return reqCount - number of requests for this subscription, determines fee tier. * @return owner - owner of the subscription. * @return consumers - list of consumer address which are able to use this subscription. */ function getSubscription(uint64 subId) external view returns ( uint96 balance, uint64 reqCount, address owner, address[] memory consumers ); /** * @notice Request subscription owner transfer. * @param subId - ID of the subscription * @param newOwner - proposed new owner of the subscription */ function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external; /** * @notice Request 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(uint64 subId) external; /** * @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(uint64 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(uint64 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(uint64 subId, address to) external; /* * @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(uint64 subId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {BBOTSRendererEvents} from "./BBOTSRenderer.events.sol"; import {IMetadataRenderer} from "./MetadataRenderer.interface.sol"; interface IBBOTSRenderer is BBOTSRendererEvents, IMetadataRenderer { error TooMuchEntropy(); /*/////////////////////////////////////////////////////////////// RANDOMNESS //////////////////////////////////////////////////////////////*/ function requestEntropy(bytes32 _keyHash, uint32 _callbackGasLimit) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface BBOTSRendererEvents { event EntropyRequested(); event EntropyReceived(uint256 entropy); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IMetadataRenderer { /*/////////////////////////////////////////////////////////////// RENDERING //////////////////////////////////////////////////////////////*/ function tokenURI(uint256 id) external view returns (string memory); }
{ "remappings": [ "@a16z/=lib/a16z-contracts/", "@chainlink/=lib/chainlink/", "@openzeppelin/=lib/openzeppelin-contracts/", "@rari-capital/solmate/=lib/solmate/", "a16z-contracts/=lib/a16z-contracts/", "chainlink/=lib/chainlink/contracts/src/v0.8/dev/vendor/@arbitrum/nitro-contracts/src/", "ds-test/=lib/solmate/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "solmate/=lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 1337 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint64","name":"_subscriptionId","type":"uint64"},{"internalType":"address","name":"_vrfCoordinator","type":"address"},{"internalType":"uint16[]","name":"_tranches","type":"uint16[]"},{"internalType":"string","name":"_metadataPrefix","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"inputs":[],"name":"TooMuchEntropy","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"entropy","type":"uint256"}],"name":"EntropyReceived","type":"event"},{"anonymous":false,"inputs":[],"name":"EntropyRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"entropies","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metadataPrefix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_keyHash","type":"bytes32"},{"internalType":"uint32","name":"_callbackGasLimit","type":"uint32"}],"name":"requestEntropy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"metadataUri","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tranches","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_subscriptionId","type":"uint64"}],"name":"updateSubscription","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040523480156200001157600080fd5b50604051620014b9380380620014b983398101604081905262000034916200029c565b826200004033620000af565b6001600160a01b03908116608052600280546001600160e01b031916600160a01b6001600160401b038816026001600160a01b03191617918516919091179055815162000095906003906020850190620000ff565b506004620000a4828262000451565b50505050506200051d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b82805482825590600052602060002090600f016010900481019282156200019d5791602002820160005b838211156200016b57835183826101000a81548161ffff021916908361ffff160217905550926020019260020160208160010104928301926001030262000129565b80156200019b5782816101000a81549061ffff02191690556002016020816001010492830192600103026200016b565b505b50620001ab929150620001af565b5090565b5b80821115620001ab5760008155600101620001b0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620002075762000207620001c6565b604052919050565b600082601f8301126200022157600080fd5b81516001600160401b038111156200023d576200023d620001c6565b602062000253601f8301601f19168201620001dc565b82815285828487010111156200026857600080fd5b60005b83811015620002885785810183015182820184015282016200026b565b506000928101909101919091529392505050565b60008060008060808587031215620002b357600080fd5b84516001600160401b038082168214620002cc57600080fd5b602087810151929650916001600160a01b0381168114620002ec57600080fd5b6040880151909550818111156200030257600080fd5b8701601f810189136200031457600080fd5b805182811115620003295762000329620001c6565b8060051b6200033a858201620001dc565b918252828101850191858101908c8411156200035557600080fd5b938601935b838510156200038a578451925061ffff83168314620003795760008081fd5b82825293860193908601906200035a565b80985050505050506060870151915080821115620003a757600080fd5b50620003b6878288016200020f565b91505092959194509250565b600181811c90821680620003d757607f821691505b602082108103620003f857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200044c57600081815260208120601f850160051c81016020861015620004275750805b601f850160051c820191505b81811015620004485782815560010162000433565b5050505b505050565b81516001600160401b038111156200046d576200046d620001c6565b62000485816200047e8454620003c2565b84620003fe565b602080601f831160018114620004bd5760008415620004a45750858301515b600019600386901b1c1916600185901b17855562000448565b600085815260208120601f198616915b82811015620004ee57888601518255948401946001909101908401620004cd565b50858210156200050d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610f79620005406000396000818161039b01526103f60152610f796000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c8063715018a611610076578063c87b56dd1161005b578063c87b56dd14610165578063e2ac9d5b14610178578063f2fde38b1461019957600080fd5b8063715018a6146101425780638da5cb5b1461014a57600080fd5b80631fe543e3116100a75780631fe543e3146100eb578063220d72fa146100fe57806326c259621461011c57600080fd5b806306c3e132146100c35780631d680c74146100d8575b600080fd5b6100d66100d1366004610b74565b6101ac565b005b6100d66100e6366004610ba5565b6101f6565b6100d66100f9366004610bf4565b610390565b610106610436565b6040516101139190610ce2565b60405180910390f35b61012f61012a366004610d15565b6104c4565b60405161ffff9091168152602001610113565b6100d66104fc565b6000546040516001600160a01b039091168152602001610113565b610106610173366004610d15565b610510565b61018b610186366004610d15565b610552565b604051908152602001610113565b6100d66101a7366004610d2e565b610573565b6101b4610603565b6002805467ffffffffffffffff909216600160a01b027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b6101fe610603565b60035461020d90600190610d6d565b60005461022990600190600160a01b900463ffffffff16610d86565b63ffffffff161115610267576040517f9c0d5a2100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002546040517f5d3b1d3000000000000000000000000000000000000000000000000000000000815260048101849052600160a01b820467ffffffffffffffff1660248201526003604482015263ffffffff83166064820152600160848201526001600160a01b0390911690635d3b1d309060a4016020604051808303816000875af11580156102fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031f9190610daa565b506001600060148282829054906101000a900463ffffffff166103429190610d86565b92506101000a81548163ffffffff021916908363ffffffff1602179055507f79ca1c7a36a8d0bb5f4bd968a08237a3642cea45c8ad150ca84297fc8da7487560405160405180910390a15050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610428576040517f1cf993f40000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b610432828261065d565b5050565b6004805461044390610dc3565b80601f016020809104026020016040519081016040528092919081815260200182805461046f90610dc3565b80156104bc5780601f10610491576101008083540402835291602001916104bc565b820191906000526020600020905b81548152906001019060200180831161049f57829003601f168201915b505050505081565b600381815481106104d457600080fd5b9060005260206000209060109182820401919006600202915054906101000a900461ffff1681565b610504610603565b61050e6000610708565b565b6060600061051d83610770565b9050600461052a82610a37565b60405160200161053b929190610e19565b604051602081830303815290604052915050919050565b6001818154811061056257600080fd5b600091825260209091200154905081565b61057b610603565b6001600160a01b0381166105f75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161041f565b61060081610708565b50565b6000546001600160a01b0316331461050e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161041f565b60005b815181101561070357600182828151811061067d5761067d610ec3565b6020908102919091018101518254600181018455600093845291909220015581517faf684b9864405ab68b7e5e2f0f1b6e5a0e9c1f1951174dce7feaf9f2d0b116e3908390839081106106d2576106d2610ec3565b60200260200101516040516106e991815260200190565b60405180910390a1806106fb81610ed9565b915050610660565b505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600360008154811061078757610787610ec3565b60009182526020822060108204015460038054600f9093166002026101000a90910461ffff169350906107bc90600190610d6d565b815481106107cc576107cc610ec3565b600091825260208220601082040154600f9091166002026101000a900461ffff16915080806107fc846001610ef2565b67ffffffffffffffff81111561081457610814610bde565b60405190808252806020026020018201604052801561083d578160200160208202803683370190505b50905060005b600154811015610a29576001818154811061086057610860610ec3565b906000526020600020015493505b600361087b826001610ef2565b8154811061088b5761088b610ec3565b60009182526020909120601082040154600f9091166002026101000a900461ffff168611610a1757856108bf866001610ef2565b6108c99190610d6d565b6108d39085610f1b565b6108dd9087610ef2565b92508183815181106108f1576108f1610ec3565b6020026020010151600003610920578282848151811061091357610913610ec3565b6020026020010181815250505b81868151811061093257610932610ec3565b6020026020010151600003610961578582878151811061095457610954610ec3565b6020026020010181815250505b81838151811061097357610973610ec3565b602002602001015182878151811061098d5761098d610ec3565b60200260200101518388815181106109a7576109a7610ec3565b602002602001018486815181106109c0576109c0610ec3565b6020908102919091010191909152526109da886001610ef2565b8287815181106109ec576109ec610ec3565b602002602001015103610a055750939695505050505050565b85610a0f81610ed9565b96505061086e565b80610a2181610ed9565b915050610843565b506000979650505050505050565b606081600003610a7a57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610aa45780610a8e81610ed9565b9150610a9d9050600a83610f2f565b9150610a7e565b60008167ffffffffffffffff811115610abf57610abf610bde565b6040519080825280601f01601f191660200182016040528015610ae9576020820181803683370190505b5090505b8415610b6c57610afe600183610d6d565b9150610b0b600a86610f1b565b610b16906030610ef2565b60f81b818381518110610b2b57610b2b610ec3565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610b65600a86610f2f565b9450610aed565b949350505050565b600060208284031215610b8657600080fd5b813567ffffffffffffffff81168114610b9e57600080fd5b9392505050565b60008060408385031215610bb857600080fd5b82359150602083013563ffffffff81168114610bd357600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610c0757600080fd5b8235915060208084013567ffffffffffffffff80821115610c2757600080fd5b818601915086601f830112610c3b57600080fd5b813581811115610c4d57610c4d610bde565b8060051b604051601f19603f83011681018181108582111715610c7257610c72610bde565b604052918252848201925083810185019189831115610c9057600080fd5b938501935b82851015610cae57843584529385019392850192610c95565b8096505050505050509250929050565b60005b83811015610cd9578181015183820152602001610cc1565b50506000910152565b6020815260008251806020840152610d01816040850160208701610cbe565b601f01601f19169190910160400192915050565b600060208284031215610d2757600080fd5b5035919050565b600060208284031215610d4057600080fd5b81356001600160a01b0381168114610b9e57600080fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610d8057610d80610d57565b92915050565b63ffffffff818116838216019080821115610da357610da3610d57565b5092915050565b600060208284031215610dbc57600080fd5b5051919050565b600181811c90821680610dd757607f821691505b602082108103610df757634e487b7160e01b600052602260045260246000fd5b50919050565b60008151610e0f818560208601610cbe565b9290920192915050565b600080845481600182811c915080831680610e3557607f831692505b60208084108203610e5457634e487b7160e01b86526022600452602486fd5b818015610e685760018114610e7d57610eaa565b60ff1986168952841515850289019650610eaa565b60008b81526020902060005b86811015610ea25781548b820152908501908301610e89565b505084890196505b505050505050610eba8185610dfd565b95945050505050565b634e487b7160e01b600052603260045260246000fd5b600060018201610eeb57610eeb610d57565b5060010190565b80820180821115610d8057610d80610d57565b634e487b7160e01b600052601260045260246000fd5b600082610f2a57610f2a610f05565b500690565b600082610f3e57610f3e610f05565b50049056fea264697066735822122046fc5215c35b6dc5d640106af2286943877513090e8f07151eb1b0120c27e95b64736f6c63430008110033000000000000000000000000000000000000000000000000000000000000019a000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990900000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f90000000000000000000000000000000000000000000000000000000000000257b0000000000000000000000000000000000000000000000000000000000002775000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f617277656176652e6e65742f30384d6e496357574c33636a44412d69323467335135364278727256336b71664f576e6e7350662d5175412f
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100be5760003560e01c8063715018a611610076578063c87b56dd1161005b578063c87b56dd14610165578063e2ac9d5b14610178578063f2fde38b1461019957600080fd5b8063715018a6146101425780638da5cb5b1461014a57600080fd5b80631fe543e3116100a75780631fe543e3146100eb578063220d72fa146100fe57806326c259621461011c57600080fd5b806306c3e132146100c35780631d680c74146100d8575b600080fd5b6100d66100d1366004610b74565b6101ac565b005b6100d66100e6366004610ba5565b6101f6565b6100d66100f9366004610bf4565b610390565b610106610436565b6040516101139190610ce2565b60405180910390f35b61012f61012a366004610d15565b6104c4565b60405161ffff9091168152602001610113565b6100d66104fc565b6000546040516001600160a01b039091168152602001610113565b610106610173366004610d15565b610510565b61018b610186366004610d15565b610552565b604051908152602001610113565b6100d66101a7366004610d2e565b610573565b6101b4610603565b6002805467ffffffffffffffff909216600160a01b027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b6101fe610603565b60035461020d90600190610d6d565b60005461022990600190600160a01b900463ffffffff16610d86565b63ffffffff161115610267576040517f9c0d5a2100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002546040517f5d3b1d3000000000000000000000000000000000000000000000000000000000815260048101849052600160a01b820467ffffffffffffffff1660248201526003604482015263ffffffff83166064820152600160848201526001600160a01b0390911690635d3b1d309060a4016020604051808303816000875af11580156102fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031f9190610daa565b506001600060148282829054906101000a900463ffffffff166103429190610d86565b92506101000a81548163ffffffff021916908363ffffffff1602179055507f79ca1c7a36a8d0bb5f4bd968a08237a3642cea45c8ad150ca84297fc8da7487560405160405180910390a15050565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699091614610428576040517f1cf993f40000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699091660248201526044015b60405180910390fd5b610432828261065d565b5050565b6004805461044390610dc3565b80601f016020809104026020016040519081016040528092919081815260200182805461046f90610dc3565b80156104bc5780601f10610491576101008083540402835291602001916104bc565b820191906000526020600020905b81548152906001019060200180831161049f57829003601f168201915b505050505081565b600381815481106104d457600080fd5b9060005260206000209060109182820401919006600202915054906101000a900461ffff1681565b610504610603565b61050e6000610708565b565b6060600061051d83610770565b9050600461052a82610a37565b60405160200161053b929190610e19565b604051602081830303815290604052915050919050565b6001818154811061056257600080fd5b600091825260209091200154905081565b61057b610603565b6001600160a01b0381166105f75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161041f565b61060081610708565b50565b6000546001600160a01b0316331461050e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161041f565b60005b815181101561070357600182828151811061067d5761067d610ec3565b6020908102919091018101518254600181018455600093845291909220015581517faf684b9864405ab68b7e5e2f0f1b6e5a0e9c1f1951174dce7feaf9f2d0b116e3908390839081106106d2576106d2610ec3565b60200260200101516040516106e991815260200190565b60405180910390a1806106fb81610ed9565b915050610660565b505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600360008154811061078757610787610ec3565b60009182526020822060108204015460038054600f9093166002026101000a90910461ffff169350906107bc90600190610d6d565b815481106107cc576107cc610ec3565b600091825260208220601082040154600f9091166002026101000a900461ffff16915080806107fc846001610ef2565b67ffffffffffffffff81111561081457610814610bde565b60405190808252806020026020018201604052801561083d578160200160208202803683370190505b50905060005b600154811015610a29576001818154811061086057610860610ec3565b906000526020600020015493505b600361087b826001610ef2565b8154811061088b5761088b610ec3565b60009182526020909120601082040154600f9091166002026101000a900461ffff168611610a1757856108bf866001610ef2565b6108c99190610d6d565b6108d39085610f1b565b6108dd9087610ef2565b92508183815181106108f1576108f1610ec3565b6020026020010151600003610920578282848151811061091357610913610ec3565b6020026020010181815250505b81868151811061093257610932610ec3565b6020026020010151600003610961578582878151811061095457610954610ec3565b6020026020010181815250505b81838151811061097357610973610ec3565b602002602001015182878151811061098d5761098d610ec3565b60200260200101518388815181106109a7576109a7610ec3565b602002602001018486815181106109c0576109c0610ec3565b6020908102919091010191909152526109da886001610ef2565b8287815181106109ec576109ec610ec3565b602002602001015103610a055750939695505050505050565b85610a0f81610ed9565b96505061086e565b80610a2181610ed9565b915050610843565b506000979650505050505050565b606081600003610a7a57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610aa45780610a8e81610ed9565b9150610a9d9050600a83610f2f565b9150610a7e565b60008167ffffffffffffffff811115610abf57610abf610bde565b6040519080825280601f01601f191660200182016040528015610ae9576020820181803683370190505b5090505b8415610b6c57610afe600183610d6d565b9150610b0b600a86610f1b565b610b16906030610ef2565b60f81b818381518110610b2b57610b2b610ec3565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610b65600a86610f2f565b9450610aed565b949350505050565b600060208284031215610b8657600080fd5b813567ffffffffffffffff81168114610b9e57600080fd5b9392505050565b60008060408385031215610bb857600080fd5b82359150602083013563ffffffff81168114610bd357600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610c0757600080fd5b8235915060208084013567ffffffffffffffff80821115610c2757600080fd5b818601915086601f830112610c3b57600080fd5b813581811115610c4d57610c4d610bde565b8060051b604051601f19603f83011681018181108582111715610c7257610c72610bde565b604052918252848201925083810185019189831115610c9057600080fd5b938501935b82851015610cae57843584529385019392850192610c95565b8096505050505050509250929050565b60005b83811015610cd9578181015183820152602001610cc1565b50506000910152565b6020815260008251806020840152610d01816040850160208701610cbe565b601f01601f19169190910160400192915050565b600060208284031215610d2757600080fd5b5035919050565b600060208284031215610d4057600080fd5b81356001600160a01b0381168114610b9e57600080fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610d8057610d80610d57565b92915050565b63ffffffff818116838216019080821115610da357610da3610d57565b5092915050565b600060208284031215610dbc57600080fd5b5051919050565b600181811c90821680610dd757607f821691505b602082108103610df757634e487b7160e01b600052602260045260246000fd5b50919050565b60008151610e0f818560208601610cbe565b9290920192915050565b600080845481600182811c915080831680610e3557607f831692505b60208084108203610e5457634e487b7160e01b86526022600452602486fd5b818015610e685760018114610e7d57610eaa565b60ff1986168952841515850289019650610eaa565b60008b81526020902060005b86811015610ea25781548b820152908501908301610e89565b505084890196505b505050505050610eba8185610dfd565b95945050505050565b634e487b7160e01b600052603260045260246000fd5b600060018201610eeb57610eeb610d57565b5060010190565b80820180821115610d8057610d80610d57565b634e487b7160e01b600052601260045260246000fd5b600082610f2a57610f2a610f05565b500690565b600082610f3e57610f3e610f05565b50049056fea264697066735822122046fc5215c35b6dc5d640106af2286943877513090e8f07151eb1b0120c27e95b64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000019a000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990900000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f90000000000000000000000000000000000000000000000000000000000000257b0000000000000000000000000000000000000000000000000000000000002775000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f617277656176652e6e65742f30384d6e496357574c33636a44412d69323467335135364278727256336b71664f576e6e7350662d5175412f
-----Decoded View---------------
Arg [0] : _subscriptionId (uint64): 410
Arg [1] : _vrfCoordinator (address): 0x271682DEB8C4E0901D1a1550aD2e64D568E69909
Arg [2] : _tranches (uint16[]): 0,8080,9595,10101
Arg [3] : _metadataPrefix (string): https://arweave.net/08MnIcWWL3cjDA-i24g3Q56BxrrV3kqfOWnnsPf-QuA/
-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000000000019a
Arg [1] : 000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000001f90
Arg [7] : 000000000000000000000000000000000000000000000000000000000000257b
Arg [8] : 0000000000000000000000000000000000000000000000000000000000002775
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [10] : 68747470733a2f2f617277656176652e6e65742f30384d6e496357574c33636a
Arg [11] : 44412d69323467335135364278727256336b71664f576e6e7350662d5175412f
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.