Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 58 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Open | 15098823 | 1334 days ago | IN | 0 ETH | 0.00240764 | ||||
| Open | 15098823 | 1334 days ago | IN | 0 ETH | 0.00051997 | ||||
| Open | 15098821 | 1334 days ago | IN | 0 ETH | 0.00215042 | ||||
| Open | 15098820 | 1334 days ago | IN | 0 ETH | 0.0021584 | ||||
| Open | 15098818 | 1334 days ago | IN | 0 ETH | 0.00166225 | ||||
| Open | 15098816 | 1334 days ago | IN | 0 ETH | 0.00169497 | ||||
| Open | 15098813 | 1334 days ago | IN | 0 ETH | 0.00198533 | ||||
| Open | 15098812 | 1334 days ago | IN | 0 ETH | 0.00220008 | ||||
| Open | 15098808 | 1334 days ago | IN | 0 ETH | 0.00243208 | ||||
| Open | 15098805 | 1334 days ago | IN | 0 ETH | 0.00245011 | ||||
| Open | 15098801 | 1334 days ago | IN | 0 ETH | 0.00222738 | ||||
| Open | 15098792 | 1334 days ago | IN | 0 ETH | 0.00322062 | ||||
| Open | 15098789 | 1334 days ago | IN | 0 ETH | 0.00312817 | ||||
| Open | 15098785 | 1334 days ago | IN | 0 ETH | 0.0023407 | ||||
| Open | 15098774 | 1334 days ago | IN | 0 ETH | 0.00253976 | ||||
| Open | 15098769 | 1334 days ago | IN | 0 ETH | 0.00318208 | ||||
| Open | 15098759 | 1334 days ago | IN | 0 ETH | 0.00337116 | ||||
| Open | 15098754 | 1334 days ago | IN | 0 ETH | 0.00262218 | ||||
| Open | 15098745 | 1334 days ago | IN | 0 ETH | 0.00159353 | ||||
| Open | 15098744 | 1334 days ago | IN | 0 ETH | 0.00166361 | ||||
| Open | 15098739 | 1334 days ago | IN | 0 ETH | 0.00195653 | ||||
| Open | 15098735 | 1334 days ago | IN | 0 ETH | 0.00195713 | ||||
| Open | 15098730 | 1334 days ago | IN | 0 ETH | 0.00161622 | ||||
| Open | 15098725 | 1334 days ago | IN | 0 ETH | 0.00185766 | ||||
| Open | 15098716 | 1334 days ago | IN | 0 ETH | 0.00205792 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
UnifriendsVaultGameV2
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./interfaces/IExternalItemSupport.sol";
contract UnifriendsVaultGameV2 is AccessControl, VRFConsumerBaseV2 {
bytes32 private constant OWNER_ROLE = keccak256("OWNER_ROLE");
bytes32 private constant MODERATOR_ROLE = keccak256("MODERATOR_ROLE");
// Chainklink VRF V2
VRFCoordinatorV2Interface immutable COORDINATOR;
bytes32 public immutable keyHash;
uint64 public immutable subscriptionId;
bool public isPaused = true;
bool public useVRF = false;
uint256 public prizesId = 1;
uint256 public grandPrizesToSend = 1;
uint256 public superRaresToSend = 2;
uint16 constant numWords = 1;
uint256 constant maxLockersToOpen = 50;
uint256 constant maxSuperRares = 2;
uint256 constant maxGrandPrizes = 1;
/// @dev requestId => sender address
mapping(uint256 => address) private requestIdToSender;
uint256 private vaultItemId = 4;
uint256 private GRAND_PRIZE = 1;
uint256 private SUPER_RARE = 2;
uint256 private RARE = 3;
uint256 private COMMON = 4;
uint256 private UNCOMMON = 5;
uint256 private BASE = 6;
uint256 private requestNonce = 1;
/// @notice Unifriends item contract
IExternalItemSupport public shopContractAddress;
/// @notice Lockers opened total
uint256 public lockersOpened = 0;
/// @notice locker index => is opened
mapping(uint256 => bool) public lockerMapping;
event RandomnessRequest(uint256 requestId);
event ItemsWon(
uint256 prizesId,
address to,
uint256 itemId,
uint256 quantity
);
event VaultReset(uint256 resetTimestamp);
constructor(
address _shopContractAddress,
address _vrfV2Coordinator,
bytes32 keyHash_,
uint64 subscriptionId_
) VRFConsumerBaseV2(_vrfV2Coordinator) {
COORDINATOR = VRFCoordinatorV2Interface(_vrfV2Coordinator);
keyHash = keyHash_;
subscriptionId = subscriptionId_;
shopContractAddress = IExternalItemSupport(_shopContractAddress);
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
_setupRole(OWNER_ROLE, _msgSender());
_setupRole(MODERATOR_ROLE, _msgSender());
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords)
internal
override
{
_processRandomnessFulfillment(
requestId,
randomWords[0],
requestIdToSender[requestId]
);
}
/// @notice Opens a locker by id and burns a keycard token
function open(uint256 lockerId) public {
require(!isPaused, "Vault openings are paused");
require(lockerId > 0 && lockerId < 51, "Invalid locker Id");
require(!lockerMapping[lockerId], "Vault already opened");
// Burn token to exchange
shopContractAddress.burnItemForOwnerAddress(
vaultItemId,
1,
_msgSender()
);
uint256 requestId;
if (useVRF == true) {
requestId = COORDINATOR.requestRandomWords(
_keyHash(),
_subscriptionId(),
3,
300000,
numWords
);
requestIdToSender[requestId] = _msgSender();
_processRandomnessRequest(requestId, lockerId);
emit RandomnessRequest(requestId);
} else {
requestId = requestNonce++;
requestIdToSender[requestId] = _msgSender();
_handleLockerUpdate(requestId, lockerId);
_handleItemMinting(
requestId,
pseudorandom(_msgSender(), lockerId),
_msgSender()
);
}
}
function readLockerState()
public
view
returns (bool[maxLockersToOpen] memory)
{
bool[maxLockersToOpen] memory lockerState;
for (uint256 i = 0; i < maxLockersToOpen; i++) {
lockerState[i] = lockerMapping[i + 1];
}
return lockerState;
}
/// @dev Handle updating internal locker state
function _handleLockerUpdate(uint256 requestId, uint256 lockerId) internal {
lockerMapping[lockerId] = true;
unchecked {
lockersOpened++;
}
}
/// @dev Handle minting items related to a randomness request
function _handleItemMinting(
uint256 requestId,
uint256 randomness,
address to
) internal {
// Transform the result to a number between 1 and 100 inclusively
uint256 chance = (randomness % 100) + 1;
// Grand Prize 1%, Superare 2%, rare 5%, common 22%, uncommon 30%, base 40%
// Ensures at least 1 1 grand prize and 1 super rare will come out
if (
grandPrizesToSend > 0 &&
(chance == 1 ||
grandPrizesToSend >= (maxLockersToOpen - lockersOpened))
) {
// GRAND_PRIZE 1
emit ItemsWon(prizesId, to, GRAND_PRIZE, 1);
unchecked {
grandPrizesToSend--;
}
} else if (
superRaresToSend > 0 &&
(chance == 2 ||
chance == 3 ||
superRaresToSend >= (maxLockersToOpen - lockersOpened))
) {
// SUPER_RARE 2-3
emit ItemsWon(prizesId, to, SUPER_RARE, 1);
unchecked {
superRaresToSend--;
}
} else if ((chance >= 4 && chance < 9)) {
// RARE 4-8
emit ItemsWon(prizesId, to, RARE, 1);
} else if ((chance >= 9 && chance < 31) || chance < 31) {
// COMMON 9-30 - The base case if grand-rare are max allocated
emit ItemsWon(prizesId, to, COMMON, 1);
} else if (chance >= 31 && chance < 61) {
// UNCOMMON 31-60
emit ItemsWon(prizesId, to, UNCOMMON, 1);
} else if (chance >= 60 && chance < 101) {
// BASE 60-100
emit ItemsWon(prizesId, to, BASE, 1);
}
}
/// @dev Bastardized "randomness", if we want it
function pseudorandom(address to, uint256 lockerId)
private
view
returns (uint256)
{
return
uint256(
keccak256(
abi.encodePacked(
block.difficulty,
block.timestamp,
to,
Strings.toString(requestNonce),
Strings.toString(lockerId)
)
)
);
}
/**
* Chainlink integration
*/
/// @dev Handle randomness request and process locker update
function _processRandomnessRequest(uint256 requestId, uint256 lockerId)
internal
{
_handleLockerUpdate(requestId, lockerId);
}
/// @dev Handles randomness fulfillment and processes mint logic
function _processRandomnessFulfillment(
uint256 requestId,
uint256 randomness,
address to
) internal {
_handleItemMinting(requestId, randomness, to);
}
function _keyHash() internal view returns (bytes32) {
return keyHash;
}
function _subscriptionId() internal view returns (uint64) {
return subscriptionId;
}
/**
* Moderator functions
*/
/// @dev Handles resetting the vault
function resetVault() public onlyRole(MODERATOR_ROLE) {
for (uint256 i = 0; i < maxLockersToOpen; i++) {
lockerMapping[i + 1] = false;
}
lockersOpened = 0;
superRaresToSend = maxSuperRares;
grandPrizesToSend = maxGrandPrizes;
emit VaultReset(block.timestamp);
}
/// @dev Handles changing up the prize set
function setPrizesId(uint256 _prizesId) external onlyRole(MODERATOR_ROLE) {
prizesId = _prizesId;
}
/// @dev Handles changing up the max grand prizes to send
function setMaxGrandPrizes(uint256 _grandPrizesToSend)
external
onlyRole(MODERATOR_ROLE)
{
grandPrizesToSend = _grandPrizesToSend;
}
/// @dev Handles changing up the max super rare prizes to send
function setMaxSuperRares(uint256 _superRaresToSend)
external
onlyRole(MODERATOR_ROLE)
{
superRaresToSend = _superRaresToSend;
}
/// @dev Sets the vault burn item id
function setVaultItemId(uint256 _vaultItemId)
external
onlyRole(MODERATOR_ROLE)
{
vaultItemId = _vaultItemId;
}
/// @dev Determines whether to allow openings at all
function setPaused(bool _isPaused) external onlyRole(MODERATOR_ROLE) {
isPaused = _isPaused;
}
/**
* Owner functions
*/
/// @dev Sets the contract address for the item to burn
function setShopContractAddress(address _shopContractAddress)
external
onlyRole(OWNER_ROLE)
{
shopContractAddress = IExternalItemSupport(_shopContractAddress);
}
/// @dev Determines whether to use VRF or not
function setUseVRF(bool _useVRF) external onlyRole(OWNER_ROLE) {
useVRF = _useVRF;
}
}// 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;
}// 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
// OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol)
pragma solidity ^0.8.0;
import "../ERC1155.sol";
/**
* @dev Extension of {ERC1155} that allows token holders to destroy both their
* own tokens and those that they have been approved to use.
*
* _Available since v3.1._
*/
abstract contract ERC1155Burnable is ERC1155 {
function burn(
address account,
uint256 id,
uint256 value
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_burn(account, id, value);
}
function burnBatch(
address account,
uint256[] memory ids,
uint256[] memory values
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_burnBatch(account, ids, values);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @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);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
interface IExternalItemSupport is IERC1155 {
function burnItemForOwnerAddress(
uint256 _typeId,
uint256 _quantity,
address _materialOwnerAddress
) external;
function mintItemToAddress(
uint256 _typeId,
uint256 _quantity,
address _toAddress
) external;
function bulkSafeTransfer(
uint256 _typeId,
uint256 _quantityPerRecipient,
address[] calldata recipients
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) 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
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/**
* @dev See {_setURI}.
*/
constructor(string memory uri_) {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: balance query for the zero address");
return _balances[id][account];
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: transfer caller is not owner nor approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
emit TransferSingle(operator, from, to, id, amount);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
}
emit TransferBatch(operator, from, to, ids, amounts);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurrence of the `\{id\}` substring in either the
* URI or any of the amounts in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
/**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; i++) {
_balances[ids[i]][to] += amounts[i];
}
emit TransferBatch(operator, address(0), to, ids, amounts);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens of token type `id`.
*/
function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
/**
* @dev Hook that is called after any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
) {
if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
uint256[] memory array = new uint256[](1);
array[0] = element;
return array;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
import "../IERC1155.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
interface IERC1155MetadataURI is IERC1155 {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}{
"optimizer": {
"enabled": true,
"runs": 1000,
"details": {
"yul": false
}
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_shopContractAddress","type":"address"},{"internalType":"address","name":"_vrfV2Coordinator","type":"address"},{"internalType":"bytes32","name":"keyHash_","type":"bytes32"},{"internalType":"uint64","name":"subscriptionId_","type":"uint64"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"prizesId","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"itemId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"ItemsWon","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"requestId","type":"uint256"}],"name":"RandomnessRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"resetTimestamp","type":"uint256"}],"name":"VaultReset","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"grandPrizesToSend","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"keyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lockerMapping","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockersOpened","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockerId","type":"uint256"}],"name":"open","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"prizesId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"readLockerState","outputs":[{"internalType":"bool[50]","name":"","type":"bool[50]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resetVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_grandPrizesToSend","type":"uint256"}],"name":"setMaxGrandPrizes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_superRaresToSend","type":"uint256"}],"name":"setMaxSuperRares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isPaused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizesId","type":"uint256"}],"name":"setPrizesId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_shopContractAddress","type":"address"}],"name":"setShopContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_useVRF","type":"bool"}],"name":"setUseVRF","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_vaultItemId","type":"uint256"}],"name":"setVaultItemId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shopContractAddress","outputs":[{"internalType":"contract IExternalItemSupport","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"subscriptionId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"superRaresToSend","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"useVRF","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
6101006040526001805461ffff19168117815560028181556003828155600482815560068181556007859055600893909355600991909155600a556005600b55600c55600d556000600f553480156200005757600080fd5b5060405162001f8a38038062001f8a8339810160408190526200007a9162000259565b6001600160a01b03838116608081905260a05260c08390526001600160401b03821660e052600e80546001600160a01b031916918616919091179055620000ca6000620000c43390565b6200012c565b620000f67fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e336200012c565b620001227f71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834f336200012c565b50505050620002c7565b6200013882826200013c565b5050565b620001488282620001c4565b62000138576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001803390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff165b92915050565b60006001600160a01b038216620001e9565b6200020c81620001ef565b81146200021857600080fd5b50565b8051620001e98162000201565b806200020c565b8051620001e98162000228565b6001600160401b0381166200020c565b8051620001e9816200023c565b60008060008060808587031215620002745762000274600080fd5b60006200028287876200021b565b945050602062000295878288016200021b565b9350506040620002a8878288016200022f565b9250506060620002bb878288016200024c565b91505092959194509250565b60805160a05160c05160e051611c74620003166000396000818161020901526108fd01526000818161031201526108db015260006108a6015260008181610527015261054f0152611c746000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c806368707edc116100f9578063d547741f11610097578063f1da0a6e11610071578063f1da0a6e14610403578063f6ea6c1a14610416578063f877a8af14610429578063f98ed38e1461043c57600080fd5b8063d547741f146103c4578063dafe68e8146103d7578063e5051f0b146103e057600080fd5b8063a217fddf116100d3578063a217fddf14610391578063b187bd2614610399578063bff54587146103a6578063ce24c3f8146103bb57600080fd5b806368707edc14610334578063690e7c091461034757806391d148541461035a57600080fd5b80632b9e2273116101665780633f06a551116101405780633f06a551146102d25780634a3fa16d146102f257806351734744146102fa57806361728f391461030d57600080fd5b80632b9e2273146102995780632f2ff15d146102ac57806336568abe146102bf57600080fd5b806316c38b3c116101a257806316c38b3c146102385780631e556f8d1461024d5780631fe543e314610263578063248a9ca31461027657600080fd5b806301ffc9a7146101c957806306038341146101f257806309c1ba2e14610204575b600080fd5b6101dc6101d73660046113c5565b610445565b6040516101e991906113f0565b60405180910390f35b6001546101dc90610100900460ff1681565b61022b7f000000000000000000000000000000000000000000000000000000000000000081565b6040516101e9919061140e565b61024b61024636600461142f565b6104de565b005b610256600f5481565b6040516101e99190611456565b61024b61027136600461157c565b61051c565b6102566102843660046115d4565b60009081526020819052604090206001015490565b61024b6102a73660046115d4565b6105b9565b61024b6102ba36600461161a565b6105e9565b61024b6102cd36600461161a565b610613565b600e546102e5906001600160a01b031681565b6040516101e9919061168f565b61024b610645565b61024b6103083660046115d4565b610707565b6102567f000000000000000000000000000000000000000000000000000000000000000081565b61024b6103423660046115d4565b610737565b61024b6103553660046115d4565b610767565b6101dc61036836600461161a565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610256600081565b6001546101dc9060ff1681565b6103ae610a95565b6040516101e991906116e5565b61025660045481565b61024b6103d236600461161a565b610b08565b61025660035481565b6101dc6103ee3660046115d4565b60106020526000908152604090205460ff1681565b61024b6104113660046115d4565b610b2d565b61024b6104243660046116f4565b610b5d565b61024b61043736600461142f565b610bb7565b61025660025481565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806104d857507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7f71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834f61050881610bfc565b506001805460ff1916911515919091179055565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105ab57337f00000000000000000000000000000000000000000000000000000000000000006040517f1cf993f40000000000000000000000000000000000000000000000000000000081526004016105a292919061171e565b60405180910390fd5b6105b58282610c09565b5050565b7f71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834f6105e381610bfc565b50600655565b60008281526020819052604090206001015461060481610bfc565b61060e8383610c4a565b505050565b6001600160a01b038116331461063b5760405162461bcd60e51b81526004016105a290611739565b6105b58282610ce8565b7f71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834f61066f81610bfc565b60005b60328110156106bc57600060108161068b8460016117b0565b81526020810191909152604001600020805460ff1916911515919091179055806106b4816117c8565b915050610672565b506000600f55600260045560016003556040517f487a05943749c8ce60b2ce8e8dbf332679e5aa5edf6520167bd49498f3ce386a906106fc904290611456565b60405180910390a150565b7f71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834f61073181610bfc565b50600255565b7f71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834f61076181610bfc565b50600455565b60015460ff161561078a5760405162461bcd60e51b81526004016105a29061181a565b60008111801561079a5750603381105b6107b65760405162461bcd60e51b81526004016105a29061185e565b60008181526010602052604090205460ff16156107e55760405162461bcd60e51b81526004016105a2906118a2565b600e546006546040517f9eef4aa60000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691639eef4aa6916108349160019033906004016118c7565b600060405180830381600087803b15801561084e57600080fd5b505af1158015610862573d6000803e3d6000fd5b50506001805460009350610100900460ff16151514159050610a0e576040517f5d3b1d300000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635d3b1d3090610930907f0000000000000000000000000000000000000000000000000000000000000000907f000000000000000000000000000000000000000000000000000000000000000090600390620493e090600190600401611935565b602060405180830381600087803b15801561094a57600080fd5b505af115801561095e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610982919061198c565b6000818152600560209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19163317905585835260109091529020805460ff19166001908117909155600f8054909101905590507f76421cb080d40e8a03ba462b500012451ba59bdebc46694dc458807c1d754b6281604051610a029190611456565b60405180910390a15050565b600d8054906000610a1e836117c8565b909155509050336000828152600560209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0395909516949094179093558482526010905220805460ff19166001908117909155600f805490910190556105b581610a8f3385610d67565b33610db3565b610a9d61136c565b610aa561136c565b60005b6032811015610b025760106000610ac08360016117b0565b815260208101919091526040016000205460ff16828260328110610ae657610ae66119ad565b9115156020909202015280610afa816117c8565b915050610aa8565b50919050565b600082815260208190526040902060010154610b2381610bfc565b61060e8383610ce8565b7f71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834f610b5781610bfc565b50600355565b7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e610b8781610bfc565b50600e805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e610be181610bfc565b50600180549115156101000261ff0019909216919091179055565b610c068133611041565b50565b6105b58282600081518110610c2057610c206119ad565b602090810291909101810151600086815260059092526040909120546001600160a01b03166110bf565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166105b5576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610ca43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16156105b5576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000444284610d77600d546110ca565b610d80866110ca565b604051602001610d94959493929190611a39565b60408051601f1981840301815291905280516020909101209392505050565b6000610dc0606484611aa2565b610dcb9060016117b0565b90506000600354118015610df857508060011480610df85750600f54610df2906032611ab6565b60035410155b15610e4e577ffa060830e863c26140d1c71974fe9ff1b33d6b833875e8f70e74967ecc359299600254836007546001604051610e379493929190611acd565b60405180910390a16003805460001901905561103b565b6000600454118015610e8457508060021480610e6a5750806003145b80610e845750600f54610e7e906032611ab6565b60045410155b15610eda577ffa060830e863c26140d1c71974fe9ff1b33d6b833875e8f70e74967ecc359299600254836008546001604051610ec39493929190611acd565b60405180910390a16004805460001901905561103b565b60048110158015610eeb5750600981105b15610f37577ffa060830e863c26140d1c71974fe9ff1b33d6b833875e8f70e74967ecc359299600254836009546001604051610f2a9493929190611acd565b60405180910390a161103b565b60098110158015610f485750601f81105b80610f535750601f81105b15610f92577ffa060830e863c26140d1c71974fe9ff1b33d6b833875e8f70e74967ecc35929960025483600a546001604051610f2a9493929190611acd565b601f8110158015610fa35750603d81105b15610fe2577ffa060830e863c26140d1c71974fe9ff1b33d6b833875e8f70e74967ecc35929960025483600b546001604051610f2a9493929190611acd565b603c8110158015610ff35750606581105b1561103b577ffa060830e863c26140d1c71974fe9ff1b33d6b833875e8f70e74967ecc35929960025483600c5460016040516110329493929190611acd565b60405180910390a15b50505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166105b55761107d816001600160a01b031660146111d0565b6110888360206111d0565b604051602001611099929190611b0b565b60408051601f198184030181529082905262461bcd60e51b82526105a291600401611ba1565b61060e838383610db3565b6060816110ee5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156111185780611102816117c8565b91506111119050600a83611bb2565b91506110f2565b60008167ffffffffffffffff81111561113357611133611475565b6040519080825280601f01601f19166020018201604052801561115d576020820181803683370190505b5090505b84156111c857611172600183611ab6565b915061117f600a86611aa2565b61118a9060306117b0565b60f81b81838151811061119f5761119f6119ad565b60200101906001600160f81b031916908160001a9053506111c1600a86611bb2565b9450611161565b949350505050565b606060006111df836002611bc6565b6111ea9060026117b0565b67ffffffffffffffff81111561120257611202611475565b6040519080825280601f01601f19166020018201604052801561122c576020820181803683370190505b509050600360fc1b81600081518110611247576112476119ad565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611292576112926119ad565b60200101906001600160f81b031916908160001a90535060006112b6846002611bc6565b6112c19060016117b0565b90505b6001811115611346577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110611302576113026119ad565b1a60f81b828281518110611318576113186119ad565b60200101906001600160f81b031916908160001a90535060049490941c9361133f81611be5565b90506112c4565b5083156113655760405162461bcd60e51b81526004016105a290611c2e565b9392505050565b6040518061064001604052806032906020820280368337509192915050565b7fffffffff0000000000000000000000000000000000000000000000000000000081165b8114610c0657600080fd5b80356104d88161138b565b6000602082840312156113da576113da600080fd5b60006111c884846113ba565b8015155b82525050565b602081016104d882846113e6565b67ffffffffffffffff81166113ea565b602081016104d882846113fe565b8015156113af565b80356104d88161141c565b60006020828403121561144457611444600080fd5b60006111c88484611424565b806113ea565b602081016104d88284611450565b806113af565b80356104d881611464565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff821117156114b1576114b1611475565b6040525050565b60006114c360405190565b90506114cf828261148b565b919050565b600067ffffffffffffffff8211156114ee576114ee611475565b5060209081020190565b600061150b611506846114d4565b6114b8565b8381529050602080820190840283018581111561152a5761152a600080fd5b835b8181101561154e578061153f888261146a565b8452506020928301920161152c565b5050509392505050565b600082601f83011261156c5761156c600080fd5b81356111c88482602086016114f8565b6000806040838503121561159257611592600080fd5b600061159e858561146a565b925050602083013567ffffffffffffffff8111156115be576115be600080fd5b6115ca85828601611558565b9150509250929050565b6000602082840312156115e9576115e9600080fd5b60006111c8848461146a565b60006001600160a01b0382166104d8565b6113af816115f5565b80356104d881611606565b6000806040838503121561163057611630600080fd5b600061163c858561146a565b92505060206115ca8582860161160f565b60006104d86001600160a01b038316611664565b90565b6001600160a01b031690565b60006104d88261164d565b60006104d882611670565b6113ea8161167b565b602081016104d88284611686565b60006116a983836113e6565b505060200190565b6032818060005b838110156116dd5781516116cc878261169d565b9650602083019250506001016116b8565b505050505050565b61064081016104d882846116b1565b60006020828403121561170957611709600080fd5b60006111c8848461160f565b6113ea816115f5565b6040810161172c8285611715565b6113656020830184611715565b602080825281016104d881602f81527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560208201527f20726f6c657320666f722073656c660000000000000000000000000000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082198211156117c3576117c361179a565b500190565b60006000198214156117dc576117dc61179a565b5060010190565b601981526000602082017f5661756c74206f70656e696e6773206172652070617573656400000000000000815291505b5060200190565b602080825281016104d8816117e3565b601181526000602082017f496e76616c6964206c6f636b657220496400000000000000000000000000000081529150611813565b602080825281016104d88161182a565b601481526000602082017f5661756c7420616c7265616479206f70656e656400000000000000000000000081529150611813565b602080825281016104d88161186e565b60006104d86116618381565b6113ea816118b2565b606081016118d58286611450565b6118e260208301856118be565b6111c86040830184611715565b600061ffff82166104d8565b6113ea816118ef565b60006104d8825b63ffffffff1690565b6113ea81611904565b60006104d861ffff831661190b565b6113ea8161191d565b60a081016119438288611450565b61195060208301876113fe565b61195d60408301866118fb565b61196a6060830185611914565b611977608083018461192c565b9695505050505050565b80516104d881611464565b6000602082840312156119a1576119a1600080fd5b60006111c88484611981565b634e487b7160e01b600052603260045260246000fd5b60006104d88260601b90565b60006104d8826119c3565b6113ea6119e6826115f5565b6119cf565b60005b83811015611a065781810151838201526020016119ee565b8381111561103b5750506000910152565b6000611a21825190565b611a2f8185602086016119eb565b9290920192915050565b6000611a458288611450565b602082019150611a558287611450565b602082019150611a6582866119da565b601482019150611a758285611a17565b9150611a818284611a17565b979650505050505050565b634e487b7160e01b600052601260045260246000fd5b600082611ab157611ab1611a8c565b500690565b600082821015611ac857611ac861179a565b500390565b60808101611adb8287611450565b611ae86020830186611715565b611af56040830185611450565b611b0260608301846118be565b95945050505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526017016000611b3d8285611a17565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000815260110191506111c88284611a17565b6000611b79825190565b808452602084019350611b908185602086016119eb565b601f01601f19169290920192915050565b602080825281016113658184611b6f565b600082611bc157611bc1611a8c565b500490565b6000816000190483118215151615611be057611be061179a565b500290565b600081611bf457611bf461179a565b506000190190565b60208082527f537472696e67733a20686578206c656e67746820696e73756666696369656e7491019081526000611813565b602080825281016104d881611bfc56fea26469706673582212207423182a495d9ae4502735c2cb647ab3e3108a0def7691b4a8de6f489848b21964736f6c6343000809003300000000000000000000000011dd2bfb64d5e5ecf5a7b0a5c5e187e56220f903000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699098af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef00000000000000000000000000000000000000000000000000000000000000af
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c806368707edc116100f9578063d547741f11610097578063f1da0a6e11610071578063f1da0a6e14610403578063f6ea6c1a14610416578063f877a8af14610429578063f98ed38e1461043c57600080fd5b8063d547741f146103c4578063dafe68e8146103d7578063e5051f0b146103e057600080fd5b8063a217fddf116100d3578063a217fddf14610391578063b187bd2614610399578063bff54587146103a6578063ce24c3f8146103bb57600080fd5b806368707edc14610334578063690e7c091461034757806391d148541461035a57600080fd5b80632b9e2273116101665780633f06a551116101405780633f06a551146102d25780634a3fa16d146102f257806351734744146102fa57806361728f391461030d57600080fd5b80632b9e2273146102995780632f2ff15d146102ac57806336568abe146102bf57600080fd5b806316c38b3c116101a257806316c38b3c146102385780631e556f8d1461024d5780631fe543e314610263578063248a9ca31461027657600080fd5b806301ffc9a7146101c957806306038341146101f257806309c1ba2e14610204575b600080fd5b6101dc6101d73660046113c5565b610445565b6040516101e991906113f0565b60405180910390f35b6001546101dc90610100900460ff1681565b61022b7f00000000000000000000000000000000000000000000000000000000000000af81565b6040516101e9919061140e565b61024b61024636600461142f565b6104de565b005b610256600f5481565b6040516101e99190611456565b61024b61027136600461157c565b61051c565b6102566102843660046115d4565b60009081526020819052604090206001015490565b61024b6102a73660046115d4565b6105b9565b61024b6102ba36600461161a565b6105e9565b61024b6102cd36600461161a565b610613565b600e546102e5906001600160a01b031681565b6040516101e9919061168f565b61024b610645565b61024b6103083660046115d4565b610707565b6102567f8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef81565b61024b6103423660046115d4565b610737565b61024b6103553660046115d4565b610767565b6101dc61036836600461161a565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610256600081565b6001546101dc9060ff1681565b6103ae610a95565b6040516101e991906116e5565b61025660045481565b61024b6103d236600461161a565b610b08565b61025660035481565b6101dc6103ee3660046115d4565b60106020526000908152604090205460ff1681565b61024b6104113660046115d4565b610b2d565b61024b6104243660046116f4565b610b5d565b61024b61043736600461142f565b610bb7565b61025660025481565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806104d857507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7f71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834f61050881610bfc565b506001805460ff1916911515919091179055565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990916146105ab57337f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699096040517f1cf993f40000000000000000000000000000000000000000000000000000000081526004016105a292919061171e565b60405180910390fd5b6105b58282610c09565b5050565b7f71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834f6105e381610bfc565b50600655565b60008281526020819052604090206001015461060481610bfc565b61060e8383610c4a565b505050565b6001600160a01b038116331461063b5760405162461bcd60e51b81526004016105a290611739565b6105b58282610ce8565b7f71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834f61066f81610bfc565b60005b60328110156106bc57600060108161068b8460016117b0565b81526020810191909152604001600020805460ff1916911515919091179055806106b4816117c8565b915050610672565b506000600f55600260045560016003556040517f487a05943749c8ce60b2ce8e8dbf332679e5aa5edf6520167bd49498f3ce386a906106fc904290611456565b60405180910390a150565b7f71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834f61073181610bfc565b50600255565b7f71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834f61076181610bfc565b50600455565b60015460ff161561078a5760405162461bcd60e51b81526004016105a29061181a565b60008111801561079a5750603381105b6107b65760405162461bcd60e51b81526004016105a29061185e565b60008181526010602052604090205460ff16156107e55760405162461bcd60e51b81526004016105a2906118a2565b600e546006546040517f9eef4aa60000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691639eef4aa6916108349160019033906004016118c7565b600060405180830381600087803b15801561084e57600080fd5b505af1158015610862573d6000803e3d6000fd5b50506001805460009350610100900460ff16151514159050610a0e576040517f5d3b1d300000000000000000000000000000000000000000000000000000000081527f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699096001600160a01b031690635d3b1d3090610930907f8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef907f00000000000000000000000000000000000000000000000000000000000000af90600390620493e090600190600401611935565b602060405180830381600087803b15801561094a57600080fd5b505af115801561095e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610982919061198c565b6000818152600560209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19163317905585835260109091529020805460ff19166001908117909155600f8054909101905590507f76421cb080d40e8a03ba462b500012451ba59bdebc46694dc458807c1d754b6281604051610a029190611456565b60405180910390a15050565b600d8054906000610a1e836117c8565b909155509050336000828152600560209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0395909516949094179093558482526010905220805460ff19166001908117909155600f805490910190556105b581610a8f3385610d67565b33610db3565b610a9d61136c565b610aa561136c565b60005b6032811015610b025760106000610ac08360016117b0565b815260208101919091526040016000205460ff16828260328110610ae657610ae66119ad565b9115156020909202015280610afa816117c8565b915050610aa8565b50919050565b600082815260208190526040902060010154610b2381610bfc565b61060e8383610ce8565b7f71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834f610b5781610bfc565b50600355565b7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e610b8781610bfc565b50600e805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e610be181610bfc565b50600180549115156101000261ff0019909216919091179055565b610c068133611041565b50565b6105b58282600081518110610c2057610c206119ad565b602090810291909101810151600086815260059092526040909120546001600160a01b03166110bf565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166105b5576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610ca43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16156105b5576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000444284610d77600d546110ca565b610d80866110ca565b604051602001610d94959493929190611a39565b60408051601f1981840301815291905280516020909101209392505050565b6000610dc0606484611aa2565b610dcb9060016117b0565b90506000600354118015610df857508060011480610df85750600f54610df2906032611ab6565b60035410155b15610e4e577ffa060830e863c26140d1c71974fe9ff1b33d6b833875e8f70e74967ecc359299600254836007546001604051610e379493929190611acd565b60405180910390a16003805460001901905561103b565b6000600454118015610e8457508060021480610e6a5750806003145b80610e845750600f54610e7e906032611ab6565b60045410155b15610eda577ffa060830e863c26140d1c71974fe9ff1b33d6b833875e8f70e74967ecc359299600254836008546001604051610ec39493929190611acd565b60405180910390a16004805460001901905561103b565b60048110158015610eeb5750600981105b15610f37577ffa060830e863c26140d1c71974fe9ff1b33d6b833875e8f70e74967ecc359299600254836009546001604051610f2a9493929190611acd565b60405180910390a161103b565b60098110158015610f485750601f81105b80610f535750601f81105b15610f92577ffa060830e863c26140d1c71974fe9ff1b33d6b833875e8f70e74967ecc35929960025483600a546001604051610f2a9493929190611acd565b601f8110158015610fa35750603d81105b15610fe2577ffa060830e863c26140d1c71974fe9ff1b33d6b833875e8f70e74967ecc35929960025483600b546001604051610f2a9493929190611acd565b603c8110158015610ff35750606581105b1561103b577ffa060830e863c26140d1c71974fe9ff1b33d6b833875e8f70e74967ecc35929960025483600c5460016040516110329493929190611acd565b60405180910390a15b50505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166105b55761107d816001600160a01b031660146111d0565b6110888360206111d0565b604051602001611099929190611b0b565b60408051601f198184030181529082905262461bcd60e51b82526105a291600401611ba1565b61060e838383610db3565b6060816110ee5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156111185780611102816117c8565b91506111119050600a83611bb2565b91506110f2565b60008167ffffffffffffffff81111561113357611133611475565b6040519080825280601f01601f19166020018201604052801561115d576020820181803683370190505b5090505b84156111c857611172600183611ab6565b915061117f600a86611aa2565b61118a9060306117b0565b60f81b81838151811061119f5761119f6119ad565b60200101906001600160f81b031916908160001a9053506111c1600a86611bb2565b9450611161565b949350505050565b606060006111df836002611bc6565b6111ea9060026117b0565b67ffffffffffffffff81111561120257611202611475565b6040519080825280601f01601f19166020018201604052801561122c576020820181803683370190505b509050600360fc1b81600081518110611247576112476119ad565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611292576112926119ad565b60200101906001600160f81b031916908160001a90535060006112b6846002611bc6565b6112c19060016117b0565b90505b6001811115611346577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110611302576113026119ad565b1a60f81b828281518110611318576113186119ad565b60200101906001600160f81b031916908160001a90535060049490941c9361133f81611be5565b90506112c4565b5083156113655760405162461bcd60e51b81526004016105a290611c2e565b9392505050565b6040518061064001604052806032906020820280368337509192915050565b7fffffffff0000000000000000000000000000000000000000000000000000000081165b8114610c0657600080fd5b80356104d88161138b565b6000602082840312156113da576113da600080fd5b60006111c884846113ba565b8015155b82525050565b602081016104d882846113e6565b67ffffffffffffffff81166113ea565b602081016104d882846113fe565b8015156113af565b80356104d88161141c565b60006020828403121561144457611444600080fd5b60006111c88484611424565b806113ea565b602081016104d88284611450565b806113af565b80356104d881611464565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff821117156114b1576114b1611475565b6040525050565b60006114c360405190565b90506114cf828261148b565b919050565b600067ffffffffffffffff8211156114ee576114ee611475565b5060209081020190565b600061150b611506846114d4565b6114b8565b8381529050602080820190840283018581111561152a5761152a600080fd5b835b8181101561154e578061153f888261146a565b8452506020928301920161152c565b5050509392505050565b600082601f83011261156c5761156c600080fd5b81356111c88482602086016114f8565b6000806040838503121561159257611592600080fd5b600061159e858561146a565b925050602083013567ffffffffffffffff8111156115be576115be600080fd5b6115ca85828601611558565b9150509250929050565b6000602082840312156115e9576115e9600080fd5b60006111c8848461146a565b60006001600160a01b0382166104d8565b6113af816115f5565b80356104d881611606565b6000806040838503121561163057611630600080fd5b600061163c858561146a565b92505060206115ca8582860161160f565b60006104d86001600160a01b038316611664565b90565b6001600160a01b031690565b60006104d88261164d565b60006104d882611670565b6113ea8161167b565b602081016104d88284611686565b60006116a983836113e6565b505060200190565b6032818060005b838110156116dd5781516116cc878261169d565b9650602083019250506001016116b8565b505050505050565b61064081016104d882846116b1565b60006020828403121561170957611709600080fd5b60006111c8848461160f565b6113ea816115f5565b6040810161172c8285611715565b6113656020830184611715565b602080825281016104d881602f81527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560208201527f20726f6c657320666f722073656c660000000000000000000000000000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082198211156117c3576117c361179a565b500190565b60006000198214156117dc576117dc61179a565b5060010190565b601981526000602082017f5661756c74206f70656e696e6773206172652070617573656400000000000000815291505b5060200190565b602080825281016104d8816117e3565b601181526000602082017f496e76616c6964206c6f636b657220496400000000000000000000000000000081529150611813565b602080825281016104d88161182a565b601481526000602082017f5661756c7420616c7265616479206f70656e656400000000000000000000000081529150611813565b602080825281016104d88161186e565b60006104d86116618381565b6113ea816118b2565b606081016118d58286611450565b6118e260208301856118be565b6111c86040830184611715565b600061ffff82166104d8565b6113ea816118ef565b60006104d8825b63ffffffff1690565b6113ea81611904565b60006104d861ffff831661190b565b6113ea8161191d565b60a081016119438288611450565b61195060208301876113fe565b61195d60408301866118fb565b61196a6060830185611914565b611977608083018461192c565b9695505050505050565b80516104d881611464565b6000602082840312156119a1576119a1600080fd5b60006111c88484611981565b634e487b7160e01b600052603260045260246000fd5b60006104d88260601b90565b60006104d8826119c3565b6113ea6119e6826115f5565b6119cf565b60005b83811015611a065781810151838201526020016119ee565b8381111561103b5750506000910152565b6000611a21825190565b611a2f8185602086016119eb565b9290920192915050565b6000611a458288611450565b602082019150611a558287611450565b602082019150611a6582866119da565b601482019150611a758285611a17565b9150611a818284611a17565b979650505050505050565b634e487b7160e01b600052601260045260246000fd5b600082611ab157611ab1611a8c565b500690565b600082821015611ac857611ac861179a565b500390565b60808101611adb8287611450565b611ae86020830186611715565b611af56040830185611450565b611b0260608301846118be565b95945050505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526017016000611b3d8285611a17565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000815260110191506111c88284611a17565b6000611b79825190565b808452602084019350611b908185602086016119eb565b601f01601f19169290920192915050565b602080825281016113658184611b6f565b600082611bc157611bc1611a8c565b500490565b6000816000190483118215151615611be057611be061179a565b500290565b600081611bf457611bf461179a565b506000190190565b60208082527f537472696e67733a20686578206c656e67746820696e73756666696369656e7491019081526000611813565b602080825281016104d881611bfc56fea26469706673582212207423182a495d9ae4502735c2cb647ab3e3108a0def7691b4a8de6f489848b21964736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000011dd2bfb64d5e5ecf5a7b0a5c5e187e56220f903000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699098af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef00000000000000000000000000000000000000000000000000000000000000af
-----Decoded View---------------
Arg [0] : _shopContractAddress (address): 0x11dd2bFB64d5e5ECf5a7b0A5c5e187e56220F903
Arg [1] : _vrfV2Coordinator (address): 0x271682DEB8C4E0901D1a1550aD2e64D568E69909
Arg [2] : keyHash_ (bytes32): 0x8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef
Arg [3] : subscriptionId_ (uint64): 175
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000011dd2bfb64d5e5ecf5a7b0a5c5e187e56220f903
Arg [1] : 000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909
Arg [2] : 8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000af
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.