Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Latest 23 from a total of 23 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Create Pinata | 5903355 | 4 hrs ago | IN | 0.000022 ETH | 0.0000086 | ||||
Create Pinata | 5903127 | 4 hrs ago | IN | 0.000022 ETH | 0.0000086 | ||||
Create Pinata | 5903078 | 4 hrs ago | IN | 0.000022 ETH | 0.0000086 | ||||
Create Pinata | 5902541 | 4 hrs ago | IN | 0.000022 ETH | 0.0000086 | ||||
Create Pinata | 5902468 | 4 hrs ago | IN | 0.000022 ETH | 0.0000086 | ||||
Create Pinata | 5902423 | 4 hrs ago | IN | 0.000022 ETH | 0.0000086 | ||||
Create Pinata | 5902400 | 4 hrs ago | IN | 0.000022 ETH | 0.0000086 | ||||
Create Pinata | 5902228 | 4 hrs ago | IN | 0.000022 ETH | 0.0000086 | ||||
Create Pinata | 5902174 | 4 hrs ago | IN | 0.000022 ETH | 0.00001026 | ||||
Create Pinata | 5902140 | 4 hrs ago | IN | 0.00002 ETH | 0.00000863 | ||||
Create Pinata | 5902096 | 4 hrs ago | IN | 0.00002 ETH | 0.00000863 | ||||
Create Pinata | 5902073 | 4 hrs ago | IN | 0.00002 ETH | 0.00000863 | ||||
Create Pinata | 5901417 | 5 hrs ago | IN | 0.000022 ETH | 0.00000863 | ||||
Create Pinata | 5901308 | 5 hrs ago | IN | 0.000022 ETH | 0.00000863 | ||||
Create Pinata | 5901002 | 5 hrs ago | IN | 0.000022 ETH | 0.00000863 | ||||
Create Pinata | 5900935 | 5 hrs ago | IN | 0.000022 ETH | 0.00000863 | ||||
Create Pinata | 5900916 | 5 hrs ago | IN | 0.000022 ETH | 0.00000863 | ||||
Create Pinata | 5900563 | 5 hrs ago | IN | 0.000022 ETH | 0.00000863 | ||||
Create Pinata | 5900398 | 5 hrs ago | IN | 0.000022 ETH | 0.00001028 | ||||
Create Pinata | 5900296 | 5 hrs ago | IN | 0.000022 ETH | 0.00000865 | ||||
Create Pinata | 5900207 | 5 hrs ago | IN | 0.000022 ETH | 0.00001031 | ||||
Create Pinata | 5889716 | 10 hrs ago | IN | 0.000034 ETH | 0.00010739 | ||||
Create Pinata | 5889259 | 10 hrs ago | IN | 0.000034 ETH | 0.00012175 |
Latest 25 internal transactions (View All)
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
5903355 | 4 hrs ago | 0 ETH | ||||
5903355 | 4 hrs ago | 0.00001 ETH | ||||
5903355 | 4 hrs ago | 0.00001 ETH | ||||
5903355 | 4 hrs ago | 0 ETH | ||||
5903355 | 4 hrs ago | Contract Creation | 0.000012 ETH | |||
5903355 | 4 hrs ago | 0.000012 ETH | ||||
5903355 | 4 hrs ago | 0 ETH | ||||
5903355 | 4 hrs ago | 0 ETH | ||||
5903355 | 4 hrs ago | 0 ETH | ||||
5903355 | 4 hrs ago | 0 ETH | ||||
5903355 | 4 hrs ago | 0.000022 ETH | ||||
5903127 | 4 hrs ago | 0 ETH | ||||
5903127 | 4 hrs ago | 0.00001 ETH | ||||
5903127 | 4 hrs ago | 0.00001 ETH | ||||
5903127 | 4 hrs ago | 0 ETH | ||||
5903127 | 4 hrs ago | Contract Creation | 0.000012 ETH | |||
5903127 | 4 hrs ago | 0.000012 ETH | ||||
5903127 | 4 hrs ago | 0 ETH | ||||
5903127 | 4 hrs ago | 0 ETH | ||||
5903127 | 4 hrs ago | 0 ETH | ||||
5903127 | 4 hrs ago | 0 ETH | ||||
5903127 | 4 hrs ago | 0.000022 ETH | ||||
5903078 | 4 hrs ago | 0 ETH | ||||
5903078 | 4 hrs ago | 0.00001 ETH | ||||
5903078 | 4 hrs ago | 0.00001 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
PinataFactory
Compiler Version
v0.8.28+commit.7893614a
ZkSolc Version
v1.5.11
Optimization Enabled:
Yes with Mode 3
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.28; import "./Pinata.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract PinataFactory is Ownable { uint256 public creationCost; address[] public deployedPinatas; address public immutable platformAddress; address public immutable entropyAddress; address public immutable entropyProvider; event PinataCreated(address indexed pinataAddress, address indexed creator, uint8 difficulty, uint256 prizePool, uint256 hitCost); event CreationCostUpdated(uint256 newCost); constructor( address _initialOwner, uint256 _creationCost, address _entropyAddress, address _entropyProvider ) Ownable(_initialOwner) { require(_initialOwner != address(0), "Invalid owner address"); require(_entropyAddress != address(0), "Invalid entropy address"); require(_entropyProvider != address(0), "Invalid entropy provider"); creationCost = _creationCost; platformAddress = address(this); entropyAddress = _entropyAddress; entropyProvider = _entropyProvider; } function createPinata( uint256 prizePool, uint256 hitCost, uint256 creatorFee, uint256 platformFee, uint8 rangeIndex ) external payable { require(msg.value >= creationCost + prizePool, "Insufficient payment"); // Create new Pinata instance Pinata pinata = new Pinata{ value: prizePool }( msg.sender, prizePool, hitCost, creatorFee, platformFee, platformAddress, entropyAddress, entropyProvider, rangeIndex ); address clone = address(pinata); deployedPinatas.push(clone); // Refund excess payment if any uint256 excess = msg.value - (creationCost + prizePool); if (excess > 0) { (bool success, ) = payable(msg.sender).call{value: excess}(""); require(success, "Refund transfer failed"); } emit PinataCreated(clone, msg.sender, rangeIndex, prizePool, hitCost); } function updateCreationCost(uint256 _newCost) external onlyOwner { creationCost = _newCost; emit CreationCostUpdated(_newCost); } function getDeployedPinatas( uint256 offset, uint256 limit ) external view returns (address[] memory) { uint256 totalPinatas = deployedPinatas.length; require(offset < totalPinatas, "Offset out of bounds"); uint256 size = (offset + limit > totalPinatas) ? totalPinatas - offset : limit; address[] memory result = new address[](size); for (uint256 i = 0; i < size; i++) { result[i] = deployedPinatas[offset + i]; } return result; } function getTotalPinatas() external view returns (uint256) { return deployedPinatas.length; } function withdrawFactoryFees() external onlyOwner { uint256 balance = address(this).balance; require(balance > 0, "No fees to withdraw"); (bool success, ) = payable(owner()).call{value: balance}(""); require(success, "Transfer failed"); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.28; import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {IEntropyConsumer} from "@pythnetwork/entropy-sdk-solidity/IEntropyConsumer.sol"; import {IEntropy} from "@pythnetwork/entropy-sdk-solidity/IEntropy.sol"; /// @title Pinata - A decentralized prize game using Pyth's entropy /// @author Jean Ayala /// @notice This contract implements a game where users can hit a pinata for prizes /// @dev Uses Pyth Network's entropy for random number generation and implements reentrancy protection contract Pinata is ReentrancyGuard, Ownable, IEntropyConsumer { IEntropy private entropy; // EVENTS /// @notice Emitted when a user wins a regular prize /// @param user Address of the winner /// @param amount Prize amount won event UserWonPrize(address user, uint256 amount); /// @notice Emitted when a user breaks the pinata and wins the jackpot /// @param user Address of the winner /// @param amount Jackpot amount won event UserWonJackpot(address user, uint256 amount); /// @notice Emitted when a user attempts to hit the pinata /// @param user Address of the player /// @param pinata Address of this contract /// @param sequenceNumber Unique identifier for this attempt event UserTriesToHit(address user, address pinata, uint256 sequenceNumber); /// @notice Emitted when the prize pool receives additional funds /// @param user Address of the contributor /// @param amount Amount added to the prize pool event PrizePoolRefilled(address user, uint256 amount); /// @notice Emitted when funds are withdrawn from the prize pool /// @param user Address of the withdrawer /// @param amount Amount withdrawn event PrizePoolWithdrawed(address user, uint256 amount); /// @notice Emitted with the result of a hit attempt /// @param user Address of the player /// @param entropyProvider Address of the entropy provider /// @param sequenceNumber Unique identifier for this attempt /// @param firstNumber First number in the sequence /// @param secondNumber Second number in the sequence /// @param thirdNumber Third number in the sequence /// @param timesHit Total number of times the pinata has been hit /// @param totalPayed Total amount paid out in prizes event HitResult( address user, address entropyProvider, uint256 sequenceNumber, uint256 firstNumber, uint256 secondNumber, uint256 thirdNumber, uint256 timesHit, uint256 totalPayed ); /// @notice Emitted when benefits are withdrawn /// @param recipient Address receiving the benefits /// @param amount Amount withdrawn /// @param isCreator Whether the recipient is the creator or platform event BenefitsWithdrawn( address indexed recipient, uint256 amount, bool isCreator ); /// @notice Emitted when fees are accumulated /// @param creatorAmount Amount accumulated for creator /// @param platformAmount Amount accumulated for platform /// @param timestamp Time of accumulation event FeesAccumulated(uint256 creatorAmount, uint256 platformAmount, uint256 timestamp); // STATES /// @notice Address of the entropy provider for random number generation address private entropyProvider; /// @notice Address that receives platform fees address public platformAddress; /// @notice Indicates if the pinata has been broken (jackpot won) bool public pinataIsBroken = false; /// @notice Maximum multiplier for prizes uint256 public maxMultiplier; /// @notice Total number of times the pinata has been hit uint256 public hasBeenHit; /// @notice Total amount paid out in prizes uint256 public hasBeenPaid; /// @notice Cost to hit the pinata once uint256 public hitCost; /// @notice Fee percentage for the creator (in basis points) uint256 public creatorFee; /// @notice Accumulated benefits for the creator uint256 public creatorBenefits; /// @notice Fee percentage for the platform (in basis points) uint256 public platformFee; /// @notice Accumulated benefits for the platform uint256 public platformBenefits; /// @notice Maximum range for the second number in sequences uint256 public secondNumberMaxRange; /// @notice Initial prize pool amount uint256 public originalPrizePool; /// @notice Amount withdrawn by the owner uint256 public ownerWithdrawn; /// @notice Maximum total fees (15%) uint256 public constant MAX_TOTAL_FEES = 15; /// @notice Mapping of range index to allowed range values mapping(uint8 => uint256) private allowedRanges; /// @notice Mapping of player address to their current sequence number mapping(address => uint256) public playerNumbers; /// @notice Mapping of sequence number to player address mapping(uint256 => address) private numberToPlayer; /// @notice Initializes the Pinata contract /// @dev Sets up the initial state, prize pool, and winning sequences /// @param _initialOwner Address of the contract owner /// @param _prizePool Initial amount for the prize pool /// @param _hitCost Cost to hit the pinata /// @param _creatorFee Fee percentage for creator (in basis points) /// @param _platformFee Fee percentage for platform (in basis points) /// @param _platformAddress Address to receive platform fees /// @param _entropyAddress Address of the entropy contract /// @param _entropyProvider Address of the entropy provider /// @param _rangeIndex Index for selecting the number range constructor( address _initialOwner, uint256 _prizePool, uint256 _hitCost, uint256 _creatorFee, uint256 _platformFee, address _platformAddress, address _entropyAddress, address _entropyProvider, uint8 _rangeIndex ) payable Ownable(_initialOwner) { require(_initialOwner != address(0), "Invalid owner address"); require(_platformAddress != address(0), "Invalid platform address"); require(_entropyAddress != address(0), "Invalid entropy address"); require(_entropyProvider != address(0), "Invalid entropy provider"); require(_platformFee >= 300, "Platform fee must be at least 3%"); require(_creatorFee <= 1000, "Fees cannot exceed 10%"); require( (_creatorFee + _platformFee) <= MAX_TOTAL_FEES * 10000, "Fees cant be more than 15%" ); require(msg.value >= _prizePool, "Insufficient initial prize pool"); // Initialize allowed ranges allowedRanges[0] = 6; allowedRanges[1] = 8; allowedRanges[2] = 12; allowedRanges[3] = 18; allowedRanges[4] = 24; require(_rangeIndex <= 4, "Invalid range index"); secondNumberMaxRange = allowedRanges[_rangeIndex]; require( _prizePool >= (_hitCost * (secondNumberMaxRange - 1)), "Prize pool cant cover max prize" ); maxMultiplier = secondNumberMaxRange - 1; hitCost = _hitCost; creatorFee = _creatorFee; platformFee = _platformFee; platformAddress = _platformAddress; originalPrizePool = _prizePool; entropy = IEntropy(_entropyAddress); entropyProvider = _entropyProvider; } // FUNCTIONS // A function to try to hit the pinata function hitPinata(bytes32 userRandomNumber) public payable nonReentrant { require(!pinataIsBroken, "This pinata has been broken and the jackpot claimed"); uint256 _hitCost = hitCost; // Cache storage read uint256 _maxMultiplier = maxMultiplier; // Cache storage read uint256 fee = entropy.getFee(entropyProvider); // Explicit overflow check for totalCost require(_hitCost <= type(uint256).max - fee, "Cost overflow"); uint256 totalCost = _hitCost + fee; // Explicit overflow check for maxPrize require(_hitCost <= type(uint256).max / _maxMultiplier, "Prize calculation overflow"); uint256 maxPrize = _hitCost * _maxMultiplier; require(playerNumbers[msg.sender] == 0, "user is already playing"); // this is 0 again once the user finish playing require(msg.value >= totalCost, "no enought payment to hit the pinata"); require( address(this).balance >= maxPrize + creatorBenefits + platformBenefits, "Insufficient contract balance for potential prizes" ); // here we call entropy of pyth uint64 sequenceNumber = entropy.requestWithCallback{value: fee}( entropyProvider, userRandomNumber ); playerNumbers[msg.sender] = sequenceNumber; numberToPlayer[sequenceNumber] = msg.sender; // this will be deleted once the user finish playing // Calculate fees based on hitCost using basis points with precision loss protection // First multiply all components to maintain precision uint256 creatorAmount = (_hitCost * creatorFee); uint256 platformAmount = (_hitCost * platformFee); // Perform division last to minimize precision loss creatorAmount = creatorAmount / 10000; platformAmount = platformAmount / 10000; // Explicit overflow checks for benefits accumulation require(creatorBenefits <= type(uint256).max - creatorAmount, "Creator benefits overflow"); require(platformBenefits <= type(uint256).max - platformAmount, "Platform benefits overflow"); creatorBenefits += creatorAmount; platformBenefits += platformAmount; emit FeesAccumulated(creatorAmount, platformAmount, block.timestamp); emit UserTriesToHit(msg.sender, address(this), sequenceNumber); // Refund excess payment if user sent more than required uint256 excess = msg.value - totalCost; if (excess > 0) { (bool success, ) = payable(msg.sender).call{value: excess}(""); require(success, "Refund transfer failed"); } } function entropyCallback( uint64 sequenceNumber, address provider, bytes32 randomNumber ) internal override { address user = numberToPlayer[sequenceNumber]; require(user != address(0), "Invalid user address"); hasBeenHit += 1; uint256[3] memory sequence = generateSequence( randomNumber, secondNumberMaxRange ); uint256 prize = getPrizeForSequence(sequence); if (prize > 0) { sendPrize(prize, user); } delete numberToPlayer[sequenceNumber]; playerNumbers[user] = 0; emit HitResult( user, provider, sequenceNumber, sequence[0], sequence[1], sequence[2], hasBeenHit, hasBeenPaid ); } // Maps a random number into a range between minRange and maxRange (inclusive) function mapRandomNumber( bytes32 randomNumber, uint256 minRange, uint256 maxRange ) internal pure returns (uint256) { uint256 range = maxRange - minRange + 1; return minRange + (uint256(randomNumber) % range); } function generateSequence( bytes32 randomNumber, uint256 maxRange ) internal pure returns (uint256[3] memory) { uint256 firstResult = mapRandomNumber( keccak256(abi.encodePacked(randomNumber, "first")), 1, maxRange ); uint256 secondResult = mapRandomNumber( keccak256(abi.encodePacked(randomNumber, "second")), 1, maxRange ); uint256 thirdResult = mapRandomNumber( keccak256(abi.encodePacked(randomNumber, "third")), 1, maxRange ); uint256[3] memory sequence = [firstResult, secondResult, thirdResult]; return sequence; } // Function to withdraw accumulated benefits for either creator or platform function withdrawBenefits(bool isCreator) public nonReentrant { uint256 amount; address recipient; if (isCreator) { require( creatorBenefits > 0, "No creator benefits available to withdraw" ); amount = creatorBenefits; creatorBenefits = 0; recipient = owner(); } else { require( msg.sender == platformAddress, "Only platform can withdraw platform benefits" ); require( platformBenefits > 0, "No platform benefits available to withdraw" ); amount = platformBenefits; platformBenefits = 0; recipient = platformAddress; } emit BenefitsWithdrawn(recipient, amount, isCreator); (bool success, ) = payable(recipient).call{value: amount}(""); require(success, "Transfer failed"); } function getEntropy() internal view override returns (address) { return address(entropy); } // Function to get the prize amount for a given sequence // This function also calculates the jackpot minus creator or platform benefits function getPrizeForSequence(uint256[3] memory _sequence) public view returns (uint256) { // Create sequence array directly without additional conversion uint8[] memory sequence = new uint8[](3); for(uint256 i = 0; i < 3; i++) { require(_sequence[i] <= type(uint8).max, "Sequence number too large"); sequence[i] = uint8(_sequence[i]); } // Check for jackpot (all numbers match maximum) if (sequence[0] == secondNumberMaxRange && sequence[1] == secondNumberMaxRange && sequence[2] == secondNumberMaxRange) { return address(this).balance - creatorBenefits - platformBenefits; } // Calculate prize based on sequence pattern if (sequence[0] == sequence[1] && sequence[1] == sequence[2]) { // All three numbers match return sequence[0] * hitCost; } else if (sequence[0] == sequence[1] || sequence[1] == sequence[2]) { // Two adjacent numbers match uint8 matchingNumber = sequence[0] == sequence[1] ? sequence[0] : sequence[1]; return (hitCost * matchingNumber) / 2; } return 0; } // A function to send a prize, minus the creator and plaform benefits function sendPrize(uint256 _amount, address _winner) internal { require(_winner != address(0), "Invalid winner address"); require(_amount > 0, "Prize amount must be greater than 0"); require( _amount <= address(this).balance - creatorBenefits - platformBenefits, "Insufficient contract balance" ); // Calculate fees using basis points uint256 creatorAmount = (_amount * creatorFee) / 10000; uint256 platformAmount = (_amount * platformFee) / 10000; uint256 finalPrizeAmount = _amount - creatorAmount - platformAmount; // Check if this is a jackpot win bool isJackpot = finalPrizeAmount == address(this).balance - creatorBenefits - platformBenefits; // Update state before transfer creatorBenefits += creatorAmount; platformBenefits += platformAmount; hasBeenPaid += finalPrizeAmount; if (isJackpot) { pinataIsBroken = true; emit UserWonJackpot(_winner, finalPrizeAmount); } else { emit UserWonPrize(_winner, finalPrizeAmount); } // Send prize to user (bool success, ) = payable(_winner).call{value: finalPrizeAmount}(""); require(success, "Prize transfer failed"); } // Function to refill the prize pool function refillPrizePool() public payable nonReentrant { require(msg.value > 0, "Must send some ETH to refill"); require(!pinataIsBroken, "Cannot refill a broken pinata"); originalPrizePool += msg.value; // Update originalPrizePool to include new funds emit PrizePoolRefilled(msg.sender, msg.value); } function withdrawPrizePool() external onlyOwner nonReentrant { require(!pinataIsBroken, "Cannot withdraw from broken pinata"); require( address(this).balance > creatorBenefits + platformBenefits, "No funds available for withdrawal" ); uint256 availableForWithdrawal = originalPrizePool - ownerWithdrawn; require(availableForWithdrawal > 0, "No prize pool left to withdraw"); uint256 actualBalance = address(this).balance - creatorBenefits - platformBenefits; uint256 withdrawAmount = availableForWithdrawal; if (actualBalance < withdrawAmount) { withdrawAmount = actualBalance; } // Calculate required balance for max prize uint256 maxPrize = hitCost * maxMultiplier; require( (actualBalance - withdrawAmount) >= maxPrize, "Withdrawal would leave insufficient funds for max prize" ); ownerWithdrawn += withdrawAmount; emit PrizePoolWithdrawed(owner(), withdrawAmount); (bool success, ) = payable(owner()).call{value: withdrawAmount}(""); require(success, "Transfer failed"); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../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. * * The initial owner is set to the address provided by the deployer. 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; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @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 { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _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: Apache 2 pragma solidity ^0.8.0; import "./EntropyEvents.sol"; interface IEntropy is EntropyEvents { // Register msg.sender as a randomness provider. The arguments are the provider's configuration parameters // and initial commitment. Re-registering the same provider rotates the provider's commitment (and updates // the feeInWei). // // chainLength is the number of values in the hash chain *including* the commitment, that is, chainLength >= 1. function register( uint128 feeInWei, bytes32 commitment, bytes calldata commitmentMetadata, uint64 chainLength, bytes calldata uri ) external; // Withdraw a portion of the accumulated fees for the provider msg.sender. // Calling this function will transfer `amount` wei to the caller (provided that they have accrued a sufficient // balance of fees in the contract). function withdraw(uint128 amount) external; // Withdraw a portion of the accumulated fees for provider. The msg.sender must be the fee manager for this provider. // Calling this function will transfer `amount` wei to the caller (provided that they have accrued a sufficient // balance of fees in the contract). function withdrawAsFeeManager(address provider, uint128 amount) external; // As a user, request a random number from `provider`. Prior to calling this method, the user should // generate a random number x and keep it secret. The user should then compute hash(x) and pass that // as the userCommitment argument. (You may call the constructUserCommitment method to compute the hash.) // // This method returns a sequence number. The user should pass this sequence number to // their chosen provider (the exact method for doing so will depend on the provider) to retrieve the provider's // number. The user should then call fulfillRequest to construct the final random number. // // This method will revert unless the caller provides a sufficient fee (at least getFee(provider)) as msg.value. // Note that excess value is *not* refunded to the caller. function request( address provider, bytes32 userCommitment, bool useBlockHash ) external payable returns (uint64 assignedSequenceNumber); // Request a random number. The method expects the provider address and a secret random number // in the arguments. It returns a sequence number. // // The address calling this function should be a contract that inherits from the IEntropyConsumer interface. // The `entropyCallback` method on that interface will receive a callback with the generated random number. // // This method will revert unless the caller provides a sufficient fee (at least getFee(provider)) as msg.value. // Note that excess value is *not* refunded to the caller. function requestWithCallback( address provider, bytes32 userRandomNumber ) external payable returns (uint64 assignedSequenceNumber); // Fulfill a request for a random number. This method validates the provided userRandomness and provider's proof // against the corresponding commitments in the in-flight request. If both values are validated, this function returns // the corresponding random number. // // Note that this function can only be called once per in-flight request. Calling this function deletes the stored // request information (so that the contract doesn't use a linear amount of storage in the number of requests). // If you need to use the returned random number more than once, you are responsible for storing it. function reveal( address provider, uint64 sequenceNumber, bytes32 userRevelation, bytes32 providerRevelation ) external returns (bytes32 randomNumber); // Fulfill a request for a random number. This method validates the provided userRandomness // and provider's revelation against the corresponding commitment in the in-flight request. If both values are validated // and the requestor address is a contract address, this function calls the requester's entropyCallback method with the // sequence number, provider address and the random number as arguments. Else if the requestor is an EOA, it won't call it. // // Note that this function can only be called once per in-flight request. Calling this function deletes the stored // request information (so that the contract doesn't use a linear amount of storage in the number of requests). // If you need to use the returned random number more than once, you are responsible for storing it. // // Anyone can call this method to fulfill a request, but the callback will only be made to the original requester. function revealWithCallback( address provider, uint64 sequenceNumber, bytes32 userRandomNumber, bytes32 providerRevelation ) external; function getProviderInfo( address provider ) external view returns (EntropyStructs.ProviderInfo memory info); function getDefaultProvider() external view returns (address provider); function getRequest( address provider, uint64 sequenceNumber ) external view returns (EntropyStructs.Request memory req); function getFee(address provider) external view returns (uint128 feeAmount); function getAccruedPythFees() external view returns (uint128 accruedPythFeesInWei); function setProviderFee(uint128 newFeeInWei) external; function setProviderFeeAsFeeManager( address provider, uint128 newFeeInWei ) external; function setProviderUri(bytes calldata newUri) external; // Set manager as the fee manager for the provider msg.sender. // After calling this function, manager will be able to set the provider's fees and withdraw them. // Only one address can be the fee manager for a provider at a time -- calling this function again with a new value // will override the previous value. Call this function with the all-zero address to disable the fee manager role. function setFeeManager(address manager) external; function constructUserCommitment( bytes32 userRandomness ) external pure returns (bytes32 userCommitment); function combineRandomValues( bytes32 userRandomness, bytes32 providerRandomness, bytes32 blockHash ) external pure returns (bytes32 combinedRandomness); }
// SPDX-License-Identifier: Apache 2 pragma solidity ^0.8.0; abstract contract IEntropyConsumer { // This method is called by Entropy to provide the random number to the consumer. // It asserts that the msg.sender is the Entropy contract. It is not meant to be // override by the consumer. function _entropyCallback( uint64 sequence, address provider, bytes32 randomNumber ) external { address entropy = getEntropy(); require(entropy != address(0), "Entropy address not set"); require(msg.sender == entropy, "Only Entropy can call this function"); entropyCallback(sequence, provider, randomNumber); } // getEntropy returns Entropy contract address. The method is being used to check that the // callback is indeed from Entropy contract. The consumer is expected to implement this method. // Entropy address can be found here - https://docs.pyth.network/entropy/contract-addresses function getEntropy() internal view virtual returns (address); // This method is expected to be implemented by the consumer to handle the random number. // It will be called by _entropyCallback after _entropyCallback ensures that the call is // indeed from Entropy contract. function entropyCallback( uint64 sequence, address provider, bytes32 randomNumber ) internal virtual; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at, * consider using {ReentrancyGuardTransient} instead. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "./EntropyStructs.sol"; interface EntropyEvents { event Registered(EntropyStructs.ProviderInfo provider); event Requested(EntropyStructs.Request request); event RequestedWithCallback( address indexed provider, address indexed requestor, uint64 indexed sequenceNumber, bytes32 userRandomNumber, EntropyStructs.Request request ); event Revealed( EntropyStructs.Request request, bytes32 userRevelation, bytes32 providerRevelation, bytes32 blockHash, bytes32 randomNumber ); event RevealedWithCallback( EntropyStructs.Request request, bytes32 userRandomNumber, bytes32 providerRevelation, bytes32 randomNumber ); event ProviderFeeUpdated(address provider, uint128 oldFee, uint128 newFee); event ProviderUriUpdated(address provider, bytes oldUri, bytes newUri); event ProviderFeeManagerUpdated( address provider, address oldFeeManager, address newFeeManager ); event Withdrawal( address provider, address recipient, uint128 withdrawnAmount ); }
// SPDX-License-Identifier: Apache 2 pragma solidity ^0.8.0; contract EntropyStructs { struct ProviderInfo { uint128 feeInWei; uint128 accruedFeesInWei; // The commitment that the provider posted to the blockchain, and the sequence number // where they committed to this. This value is not advanced after the provider commits, // and instead is stored to help providers track where they are in the hash chain. bytes32 originalCommitment; uint64 originalCommitmentSequenceNumber; // Metadata for the current commitment. Providers may optionally use this field to help // manage rotations (i.e., to pick the sequence number from the correct hash chain). bytes commitmentMetadata; // Optional URI where clients can retrieve revelations for the provider. // Client SDKs can use this field to automatically determine how to retrieve random values for each provider. // TODO: specify the API that must be implemented at this URI bytes uri; // The first sequence number that is *not* included in the current commitment (i.e., an exclusive end index). // The contract maintains the invariant that sequenceNumber <= endSequenceNumber. // If sequenceNumber == endSequenceNumber, the provider must rotate their commitment to add additional random values. uint64 endSequenceNumber; // The sequence number that will be assigned to the next inbound user request. uint64 sequenceNumber; // The current commitment represents an index/value in the provider's hash chain. // These values are used to verify requests for future sequence numbers. Note that // currentCommitmentSequenceNumber < sequenceNumber. // // The currentCommitment advances forward through the provider's hash chain as values // are revealed on-chain. bytes32 currentCommitment; uint64 currentCommitmentSequenceNumber; // An address that is authorized to set / withdraw fees on behalf of this provider. address feeManager; } struct Request { // Storage slot 1 // address provider; uint64 sequenceNumber; // The number of hashes required to verify the provider revelation. uint32 numHashes; // Storage slot 2 // // The commitment is keccak256(userCommitment, providerCommitment). Storing the hash instead of both saves 20k gas by // eliminating 1 store. bytes32 commitment; // Storage slot 3 // // The number of the block where this request was created. // Note that we're using a uint64 such that we have an additional space for an address and other fields in // this storage slot. Although block.number returns a uint256, 64 bits should be plenty to index all of the // blocks ever generated. uint64 blockNumber; // The address that requested this random number. address requester; // If true, incorporate the blockhash of blockNumber into the generated random value. bool useBlockhash; // If true, the requester will be called back with the generated random value. bool isRequestWithCallback; // There are 2 remaining bytes of free space in this slot. } }
{ "evmVersion": "paris", "optimizer": { "enabled": true, "mode": "3" }, "outputSelection": { "*": { "*": [ "abi" ] } }, "detectMissingLibraries": false, "forceEVMLA": false, "enableEraVMExtensions": false, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"_initialOwner","type":"address"},{"internalType":"uint256","name":"_creationCost","type":"uint256"},{"internalType":"address","name":"_entropyAddress","type":"address"},{"internalType":"address","name":"_entropyProvider","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newCost","type":"uint256"}],"name":"CreationCostUpdated","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pinataAddress","type":"address"},{"indexed":true,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"uint8","name":"difficulty","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"prizePool","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"hitCost","type":"uint256"}],"name":"PinataCreated","type":"event"},{"inputs":[{"internalType":"uint256","name":"prizePool","type":"uint256"},{"internalType":"uint256","name":"hitCost","type":"uint256"},{"internalType":"uint256","name":"creatorFee","type":"uint256"},{"internalType":"uint256","name":"platformFee","type":"uint256"},{"internalType":"uint8","name":"rangeIndex","type":"uint8"}],"name":"createPinata","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"creationCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"deployedPinatas","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"entropyAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"entropyProvider","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"getDeployedPinatas","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalPinatas","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":"platformAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newCost","type":"uint256"}],"name":"updateCreationCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFactoryFees","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
9c4d535b0000000000000000000000000000000000000000000000000000000000000000010001177489cbd0225ce0c4ae765c4d55212ad087e1a0ad5c05f1f65cf55b85000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000800000000000000000000000007ea1bb15c6d91827a37697c75b2eeee930c0c1880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000858687fd592112f7046e394a3bf10d0c11ff9e630000000000000000000000006cc14824ea2918f5de5c2f75a9da968ad4bd6344
Deployed Bytecode
0x0002000000000002000a00000000000200000060031002700001000000010355000000db0030019d000000db033001970000000100200190000000230000c13d0000008002000039000000400020043f000000040030008c000003010000413d000000000201043b000000e002200270000000e70020009c000000530000a13d000000e80020009c000000770000a13d000000e90020009c000000b60000213d000000ec0020009c000000d90000613d000000ed0020009c000003010000c13d0000000001000416000000000001004b000003010000c13d0000000001000412000600000001001d000500000000003d000080050100003900000044030000390000000004000415000000060440008a000001370000013d0000000002000416000000000002004b000003010000c13d0000001f02300039000000dc02200197000000e002200039000000400020043f0000001f0430018f000000dd05300198000000e002500039000000340000613d000000e006000039000000000701034f000000007807043c0000000006860436000000000026004b000000300000c13d000000000004004b000000410000613d000000000151034f0000000304400210000000000502043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f0000000000120435000000800030008c000003010000413d000000e00600043d000000de0060009c000003010000213d000001200200043d000000de0020009c000003010000213d000001400400043d000000de0040009c000003010000213d000000000006004b000001620000c13d000000fa01000041000000000010043f000000040000043f000000f9010000410000036500010430000000f10020009c000000960000213d000000f50020009c000000f80000613d000000f60020009c000000fd0000613d000000f70020009c000003010000c13d000000a40030008c000003010000413d0000002402100370000000000402043b0000000402100370000000000302043b0000008402100370000000000602043b000000ff0060008c000003010000213d0000000102000039000000000202041a000000000032001a000003240000413d00000000023200190000000005000416000000000025004b000001900000813d000000e401000041000000800010043f0000002001000039000000840010043f0000001401000039000000a40010043f0000011301000041000000c40010043f00000104010000410000036500010430000000ee0020009c000001050000613d000000ef0020009c0000011d0000613d000000f00020009c000003010000c13d000000240030008c000003010000413d0000000002000416000000000002004b000003010000c13d0000000401100370000000000101043b0000000202000039000000000202041a000000000021004b000003010000813d036303310000040f0000000302200210000000000101041a000000000121022f000000de01100197000000ff0020008c0000000001002019000000400200043d0000000000120435000000db0020009c000000db02008041000000400120021000000109011001c7000003640001042e000000f20020009c000001220000613d000000f30020009c0000012d0000613d000000f40020009c000003010000c13d000000240030008c000003010000413d0000000002000416000000000002004b000003010000c13d000000000200041a000000de032001970000000002000411000000000023004b0000015d0000c13d0000000401100370000000000101043b0000000103000039000000000013041b000000800010043f0000000001000414000000db0010009c000000db01008041000000c0011002100000010a011001c70000800d020000390000010b04000041036303590000040f00000001002001900000011b0000c13d000003010000013d000000ea0020009c0000013e0000613d000000eb0020009c000003010000c13d000000240030008c000003010000413d0000000002000416000000000002004b000003010000c13d0000000401100370000000000101043b000000de0010009c000003010000213d000000000200041a000000de052001970000000003000411000000000035004b000001ea0000c13d000000de061001980000004e0000613d000000df01200197000000000161019f000000000010041b0000000001000414000000db0010009c000000db01008041000000c001100210000000e0011001c70000800d020000390000000303000039000000e104000041036303590000040f00000001002001900000011b0000c13d000003010000013d000000440030008c000003010000413d0000000002000416000000000002004b000003010000c13d0000002402100370000000000702043b0000000202000039000000000402041a0000000405100370000000000505043b000000000654004b000001810000a13d000000000057001a000003240000413d0000000008570019000000000048004b000000000607a019000000fe0060009c000000f20000213d00000005086002100000003f078000390000010507700197000001060070009c000001f80000a13d0000010701000041000000000010043f0000004101000039000000040010043f000000f90100004100000365000104300000000001000416000000000001004b000003010000c13d0000000101000039000001010000013d0000000001000416000000000001004b000003010000c13d0000000201000039000000000101041a000000800010043f0000010201000041000003640001042e0000000001000416000000000001004b000003010000c13d000000000100041a000000de051001970000000002000411000000000025004b0000015d0000c13d000000df01100197000000000010041b0000000001000414000000db0010009c000000db01008041000000c001100210000000e0011001c70000800d020000390000000303000039000000e1040000410000000006000019036303590000040f0000000100200190000003010000613d0000000001000019000003640001042e0000000001000416000000000001004b000003010000c13d000000000100041a0000013a0000013d0000000001000416000000000001004b000003010000c13d0000000001000412000a00000001001d000900200000003d0000800501000039000000440300003900000000040004150000000a0440008a000001370000013d0000000001000416000000000001004b000003010000c13d0000000001000412000800000001001d000700400000003d000080050100003900000044030000390000000004000415000000080440008a00000005044002100000010102000041036303400000040f000000de01100197000000800010043f0000010201000041000003640001042e0000000001000416000000000001004b000003010000c13d000000000100041a000000de021001970000000001000411000000000012004b0000018b0000c13d000000fb010000410000000000100443000000000100041000000004001004430000000001000414000000db0010009c000000db01008041000000c001100210000000fc011001c70000800a020000390363035e0000040f0000000100200190000001e90000613d000000000301043b000000000003004b000002320000c13d000000400100043d000000440210003900000100030000410000000000320435000000240210003900000013030000390000026c0000013d000000f801000041000000000010043f000000040020043f000000f9010000410000036500010430000001000100043d000200000001001d000000000100041a000400000002001d000000df02100197000000000262019f000000000020041b0000000002000414000000de05100197000000db0020009c000000db02008041000000c001200210000000e0011001c70000800d020000390000000303000039000300000004001d000000e104000041036303590000040f000000030300002900000001002001900000000402000029000003010000613d000000000002004b000001ef0000c13d000000400100043d0000004402100039000000e6030000410000000000320435000000240210003900000017030000390000026c0000013d000000e401000041000000800010043f0000002001000039000000840010043f0000001401000039000000a40010043f0000010301000041000000c40010043f00000104010000410000036500010430000000f802000041000000000020043f000000040010043f000000f9010000410000036500010430000300000006001d000000da02000041000000a40020043f0000000002000411000001040020043f000400000003001d000001240030043f000200000004001d000001440040043f0000004402100370000000000202043b000001640020043f0000006401100370000000000101043b000001840010043f000001010100004100000000001004430000000001000412000000040010044300000024000004430000000001000414000000db0010009c000000db01008041000000c0011002100000010c011001c700008005020000390363035e0000040f0000000100200190000001e90000613d000000000101043b000000de01100197000001a40010043f0000010101000041000000000010044300000000010004120000000400100443000000200100003900000024001004430000000001000414000000db0010009c000000db01008041000000c0011002100000010c011001c700008005020000390363035e0000040f0000000100200190000001e90000613d000000000101043b000000de01100197000001c40010043f0000010101000041000000000010044300000000010004120000000400100443000000400100003900000024001004430000000001000414000000db0010009c000000db01008041000000c0011002100000010c011001c700008005020000390363035e0000040f0000000100200190000001e90000613d0000000302000029000000ff0220018f000000000101043b000000de01100197000001e40010043f000300000002001d000002040020043f00000000010004140000010d02000041000000800020043f000000840000043f0000006002000039000000c40020043f0000012002000039000000e40020043f000000db0010009c000000db01008041000000c0011002100000010e011001c70000000403000029000000000003004b000002910000c13d0000800602000039000002940000013d000000000001042f000000f801000041000000000010043f000000040030043f000000f9010000410000036500010430000000000003004b000002770000c13d000000400100043d0000004402100039000000e3030000410000000000320435000000240210003900000018030000390000026c0000013d0000008007700039000000400070043f000000800060043f0000001f0780018f000000000008004b000002050000613d000000000131034f000000a003800039000000a008000039000000001901043c0000000008980436000000000038004b000002010000c13d000000000007004b000000000006004b000002190000613d00000000010000190000000003510019000000000034004b0000028b0000a13d000000000020043f000000800700043d000000000071004b0000028b0000813d0000000507100210000000a007700039000001080330009a000000000303041a000000de0330019700000000003704350000000101100039000000000061004b000002090000413d000000400100043d00000020020000390000000002210436000000800300043d00000000003204350000004002100039000000000003004b000002290000613d000000a00400003900000000050000190000000046040434000000de0660019700000000026204360000000105500039000000000035004b000002230000413d0000000002120049000000db0020009c000000db020080410000006002200210000000db0010009c000000db010080410000004001100210000000000112019f000003640001042e000000000100041a0000000002000414000000de04100197000000db0020009c000000db02008041000000c001200210000000e0011001c700008009020000390000000005000019036303590000040f0000006003100270000000db03300198000002640000613d0000001f04300039000000dc044001970000003f04400039000000fd04400197000000400500043d0000000004450019000000000054004b00000000060000390000000106004039000000fe0040009c000000f20000213d0000000100600190000000f20000c13d000000400040043f0000001f0430018f0000000006350436000000dd053001980000000003560019000002570000613d000000000701034f000000007807043c0000000006860436000000000036004b000002530000c13d000000000004004b000002640000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f000000000013043500000001002001900000011b0000c13d000000400100043d0000004402100039000000ff03000041000000000032043500000024021000390000000f030000390000000000320435000000e4020000410000000000210435000000040210003900000020030000390000000000320435000000db0010009c000000db010080410000004001100210000000e5011001c7000003650001043000000001010000390000000204000029000000000041041b0000000001000410000000800010043f000000a00020043f000000c00030043f0000014000000443000001600010044300000020010000390000018000100443000001a0002004430000004002000039000001c000200443000001e000300443000001000010044300000003010000390000012000100443000000e201000041000003640001042e0000010701000041000000000010043f0000003201000039000000040010043f000000f9010000410000036500010430000080090200003900008006040000390000000105000039036303590000040f0000000100200190000003030000613d00000000020000310000000103200367000000000101043b000000000001004b0000000002000019000003060000613d0000000203000039000000000203041a0000010f0020009c000000f20000813d000100de0010019b0000000101200039000000000013041b000000000030043f000001080120009a000000000201041a000000df0220019700000001022001af000000000021041b0000000101000039000000000101041a0000000402000029000000000021001a000003240000413d00000000012100190000000002000416000000000312004b000003240000413d000002e70000613d0000000001000414000000db0010009c000000db01008041000000c001100210000000e0011001c7000080090200003900000000040004110000000005000019036303590000040f0000006003100270000000db03300198000002e50000613d0000001f04300039000000dc044001970000003f04400039000000fd04400197000000400500043d0000000004450019000000000054004b00000000060000390000000106004039000000fe0040009c000000f20000213d0000000100600190000000f20000c13d000000400040043f0000001f0430018f0000000006350436000000dd053001980000000003560019000002d80000613d000000000701034f000000007807043c0000000006860436000000000036004b000002d40000c13d000000000004004b000002e50000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f000000000013043500000001002001900000032a0000613d000000400100043d00000040021000390000000203000029000000000032043500000020021000390000000403000029000000000032043500000003020000290000000000210435000000db0010009c000000db0100804100000040011002100000000002000414000000db0020009c000000db02008041000000c002200210000000000112019f00000111011001c70000800d020000390000000303000039000001120400004100000001050000290000000006000411036303590000040f00000001002001900000011b0000c13d000000000100001900000365000104300000006002100270000000db02200197000000000301034f0000001f0520018f000000dd06200198000000400100043d0000000004610019000003110000613d000000000703034f0000000008010019000000007907043c0000000008980436000000000048004b0000030d0000c13d000000000005004b0000031e0000613d000000000363034f0000000305500210000000000604043300000000065601cf000000000656022f000000000303043b0000010005500089000000000353022f00000000035301cf000000000363019f00000000003404350000006002200210000000db0010009c000000db010080410000004001100210000000000121019f00000365000104300000010701000041000000000010043f0000001101000039000000040010043f000000f9010000410000036500010430000000400100043d000000440210003900000110030000410000000000320435000000240210003900000016030000390000026c0000013d0000000202000039000000000302041a000000000013004b000003390000a13d000000000020043f000001080110009a0000000002000019000000000001042d0000010701000041000000000010043f0000003201000039000000040010043f000000f9010000410000036500010430000000000001042f00000000050100190000000000200443000000040100003900000005024002700000000002020031000000000121043a0000002004400039000000000031004b000003430000413d000000db0030009c000000db0300804100000060013002100000000002000414000000db0020009c000000db02008041000000c002200210000000000112019f00000114011001c700000000020500190363035e0000040f0000000100200190000003580000613d000000000101043b000000000001042d000000000001042f0000035c002104210000000102000039000000000001042d0000000002000019000000000001042d00000361002104230000000102000039000000000001042d0000000002000019000000000001042d0000036300000432000003640001042e000003650001043000000000000000000000000000000000010002bff80de3371cd6bdb385fb3729ab87faeccfed25e394bf2f62e60dac3600000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000000ffffffe0000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000008be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e00000000200000000000000000000000000000100000001000000000000000000496e76616c696420656e74726f70792070726f7669646572000000000000000008c379a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064000000000000000000000000496e76616c696420656e74726f7079206164647265737300000000000000000000000000000000000000000000000000000000000000000000000000715018a500000000000000000000000000000000000000000000000000000000b905035a00000000000000000000000000000000000000000000000000000000ea07b62200000000000000000000000000000000000000000000000000000000ea07b62300000000000000000000000000000000000000000000000000000000f2fde38b00000000000000000000000000000000000000000000000000000000b905035b00000000000000000000000000000000000000000000000000000000dbe55e5600000000000000000000000000000000000000000000000000000000715018a6000000000000000000000000000000000000000000000000000000008da5cb5b000000000000000000000000000000000000000000000000000000009adda497000000000000000000000000000000000000000000000000000000004bb7b598000000000000000000000000000000000000000000000000000000004bb7b599000000000000000000000000000000000000000000000000000000005bf414ac0000000000000000000000000000000000000000000000000000000068b64ec90000000000000000000000000000000000000000000000000000000014e60813000000000000000000000000000000000000000000000000000000002a2bba0300000000000000000000000000000000000000000000000000000000391b58ab118cdaa70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000001e4fbdf7000000000000000000000000000000000000000000000000000000009cc7f708afc65944829bd487b90b72536b1951864fbfc14e125fc972a6507f39020000020000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000000000003ffffffe0000000000000000000000000000000000000000000000000ffffffffffffffff5472616e73666572206661696c656400000000000000000000000000000000004e6f206665657320746f20776974686472617700000000000000000000000000310ab089e4439a4c15d089f94afb7896ff553aecb10793d0ab882de59d99a32e00000000000000000000000000000000000000200000008000000000000000004f6666736574206f7574206f6620626f756e647300000000000000000000000000000000000000000000000000000000000000640000008000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0000000000000000000000000000000000000000000000000ffffffffffffff7f4e487b7100000000000000000000000000000000000000000000000000000000bfa87805ed57dc1f0d489ce33be4c4577d74ccde357eeeee058a32c55c44a532000000000000000000000000000000000000002000000000000000000000000002000000000000000000000000000000000000200000008000000000000000008c76f98cb6c586b4d243aea813535b5f077900fc55b5db21acb57022bed3efef02000002000000000000000000000000000000440000000000000000000000009c4d535bdea7cd8a978f128b93471df48c7dbab89d703809115bdc118c235bfd02000000000000000000000000000000000001a40000008000000000000000000000000000000000000000000000000000000000000000010000000000000000526566756e64207472616e73666572206661696c656400000000000000000000020000000000000000000000000000000000006000000000000000000000000085bdf847d9847df4a6b4e82641996374aed01e0c32c27a943798a6bb4a624730496e73756666696369656e74207061796d656e74000000000000000000000000020000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009e81abc99e4840286b10f1c99ad453912e5d2b0c18c1f03cd0f7113a02f86646
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000007ea1bb15c6d91827a37697c75b2eeee930c0c1880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000858687fd592112f7046e394a3bf10d0c11ff9e630000000000000000000000006cc14824ea2918f5de5c2f75a9da968ad4bd6344
-----Decoded View---------------
Arg [0] : _initialOwner (address): 0x7ea1Bb15c6D91827a37697c75b2Eeee930c0C188
Arg [1] : _creationCost (uint256): 0
Arg [2] : _entropyAddress (address): 0x858687fD592112f7046E394A3Bf10D0C11fF9e63
Arg [3] : _entropyProvider (address): 0x6CC14824Ea2918f5De5C2f75A9Da968ad4BD6344
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000007ea1bb15c6d91827a37697c75b2eeee930c0c188
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 000000000000000000000000858687fd592112f7046e394a3bf10d0c11ff9e63
Arg [3] : 0000000000000000000000006cc14824ea2918f5de5c2f75a9da968ad4bd6344
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.