编译器
0.8.17+commit.8df45f5f
文件 1 的 9:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 2 的 9:IERC1155.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC1155 is IERC165 {
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
event URI(string value, uint256 indexed id);
function balanceOf(address account, uint256 id) external view returns (uint256);
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
function setApprovalForAll(address operator, bool approved) external;
function isApprovedForAll(address account, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
文件 3 的 9:IERC1155Receiver.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC1155Receiver is IERC165 {
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}
文件 4 的 9:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 5 的 9:IERC721.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
文件 6 的 9:IERC721Receiver.sol
pragma solidity ^0.8.0;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 7 的 9:JingleBeanz.sol
pragma solidity ^0.8.13;
import "openzeppelin-contracts/access/Ownable.sol";
import "openzeppelin-contracts/utils/cryptography/MerkleProof.sol";
import { IERC721 } from "openzeppelin-contracts/token/ERC721/IERC721.sol";
import { IERC1155 } from "openzeppelin-contracts/token/ERC1155/IERC1155.sol";
import { IERC721Receiver } from "openzeppelin-contracts/token/ERC721/IERC721Receiver.sol";
import { IERC1155Receiver } from "openzeppelin-contracts/token/ERC1155/IERC1155Receiver.sol";
enum State{ UNOPENED, SUBMISSION, GIFTING, CLOSED }
struct Gift {
uint256 nextTouch;
uint256 poolIndex;
uint256 stolenCount;
uint256 tokenId;
address tokenContract;
}
contract JingleBeanz is Ownable {
error WrongState(State _currentState, State _requiredState);
error AlreadySubmitted();
error InvalidGift();
error Unauthorized();
error AlreadyHaveGift();
error AlreadyOwnedGift();
error GiftCooldownNotComplete();
error GiftDoesNotExist();
error MaxGiftSteals();
error NoGiftOwner();
error ZeroAddress();
error OwnerWithdrawLocked();
event Submitted(
address indexed _from,
uint256 indexed giftId,
address tokenContract,
uint256 tokenId
);
event Gifted(address indexed _to, uint256 indexed giftId);
event Stolen(address indexed _from, address indexed _to, uint256 indexed giftId);
event Withdraw(address indexed _to, uint256 indexed giftId);
event StateChange(State indexed _state);
modifier onlySubmitted() {
if (_giftGiver[msg.sender] == 0) revert Unauthorized();
_;
}
modifier onlyWhenState(State _state) {
if (_state != state) revert WrongState(state, _state);
_;
}
State public state;
uint256 public giftId;
uint256 public poolSize;
bytes32 public userMerkleRoot;
bytes32 public giftMerkleRoot;
uint256 private seed;
uint256 private withdrawReleaseDate;
uint256 constant public STEAL_COOLDOWN = 6 hours;
uint256 constant public OWNER_WITHDRAW_LOCKOUT = 19 days;
mapping(uint256 => uint256) internal _giftPool;
mapping(uint256 => Gift) internal _gift;
function gift(uint256 _giftId) public view returns (Gift memory returnGift) {
returnGift = _gift[_giftId];
if (returnGift.tokenContract == address(0)) revert GiftDoesNotExist();
}
mapping(address => uint256) internal _giftGiver;
function giftGiver(address _giver) public view returns (uint256) {
if (_giver == address(0)) {
revert ZeroAddress();
}
return _giftGiver[_giver];
}
mapping(uint256 => address) internal _ownerOf;
function ownerOf(uint256 _giftId) public view returns (address giftOwner) {
if ((giftOwner = _ownerOf[_giftId]) == address(0)) revert NoGiftOwner();
}
mapping(address => uint256) internal _ownsGift;
function ownsGift(address _owner) public view returns (uint256) {
if (_owner == address(0)) {
revert ZeroAddress();
}
return _ownsGift[_owner];
}
mapping(address => mapping(uint256 => bool)) internal _touchedGift;
function touchedGift(address _user, uint256 _giftId) public view returns (bool) {
if (_user == address(0)) {
revert ZeroAddress();
}
return _touchedGift[_user][_giftId];
}
constructor(bytes32 _userMerkleRoot, bytes32 _giftMerkleRoot) {
state = State.UNOPENED;
userMerkleRoot = _userMerkleRoot;
giftMerkleRoot = _giftMerkleRoot;
withdrawReleaseDate = block.timestamp + OWNER_WITHDRAW_LOCKOUT;
}
function submitGift(
uint256 _tokenId,
address _tokenContract,
bytes32[] calldata _userMerkleProof,
bytes32[] calldata _giftMerkleProof
) public onlyWhenState(State.SUBMISSION) {
if (!isUserWhiteListed(msg.sender, _userMerkleProof)) revert Unauthorized();
if (!isTokenApproved(_tokenContract, _giftMerkleProof)) revert InvalidGift();
if (_giftGiver[msg.sender] != 0) revert AlreadySubmitted();
unchecked {
giftId++;
poolSize++;
}
Gift memory newGift = Gift({
nextTouch: 0,
poolIndex: poolSize,
stolenCount: 0,
tokenId: _tokenId,
tokenContract: _tokenContract
});
_giftGiver[msg.sender] = giftId;
_gift[giftId] = newGift;
_giftPool[poolSize] = giftId;
if (isERC721(_tokenContract)) {
IERC721(_tokenContract).safeTransferFrom(msg.sender, address(this), _tokenId);
} else {
IERC1155(_tokenContract).safeTransferFrom(msg.sender, address(this), _tokenId, 1, "");
}
emit Submitted(msg.sender, giftId, _tokenContract, _tokenId);
}
function getRandomGift() public onlySubmitted onlyWhenState(State.GIFTING) returns (uint256) {
return internalGetRandomGift();
}
function internalGetRandomGift() internal returns (uint256) {
if (_ownsGift[msg.sender] != 0) revert AlreadyHaveGift();
uint256 randomPoolIndex = getRandomPoolIndex();
uint256 id = _giftPool[randomPoolIndex];
if (randomPoolIndex < poolSize) {
_giftPool[randomPoolIndex] = _giftPool[poolSize--];
} else {
unchecked {
poolSize--;
}
}
_gift[id].nextTouch = block.timestamp + STEAL_COOLDOWN;
_ownerOf[id] = msg.sender;
_ownsGift[msg.sender] = id;
_touchedGift[msg.sender][id] = true;
emit Gifted(msg.sender, id);
return id;
}
function stealGift(uint256 _giftId) public onlySubmitted onlyWhenState(State.GIFTING) {
if (_ownsGift[msg.sender] != 0) revert AlreadyHaveGift();
if (_touchedGift[msg.sender][_giftId]) revert AlreadyOwnedGift();
address prevOwner = _ownerOf[_giftId];
if (prevOwner == address(0)) revert NoGiftOwner();
Gift storage stolenGift = _gift[_giftId];
if (block.timestamp < stolenGift.nextTouch) revert GiftCooldownNotComplete();
if (stolenGift.stolenCount == 2) revert MaxGiftSteals();
stolenGift.nextTouch = block.timestamp + STEAL_COOLDOWN;
unchecked {
stolenGift.stolenCount++;
}
_ownerOf[_giftId] = msg.sender;
_ownsGift[msg.sender] = _giftId;
_ownsGift[prevOwner] = 0;
_touchedGift[msg.sender][_giftId] = true;
emit Stolen(prevOwner, msg.sender, _giftId);
}
function withdrawGift() public onlySubmitted onlyWhenState(State.CLOSED) returns (uint256) {
uint256 id = _ownsGift[msg.sender];
if (id == 0) {
id = internalGetRandomGift();
}
delete _giftGiver[msg.sender];
Gift memory withdrawnGift = _gift[id];
uint256 withdrawnGiftId = withdrawnGift.tokenId;
address contractAddress = withdrawnGift.tokenContract;
giftTransfer(contractAddress, withdrawnGiftId);
emit Withdraw(msg.sender, id);
return id;
}
function withdrawFromGame() public onlySubmitted onlyWhenState(State.SUBMISSION) {
uint256 id = _giftGiver[msg.sender];
Gift memory withdrawnGift = _gift[id];
uint256 withdrawnGiftPoolIndex = withdrawnGift.poolIndex;
if (withdrawnGiftPoolIndex < poolSize) {
uint256 endOfPoolGiftId = _giftPool[poolSize--];
Gift storage endOfPoolGift = _gift[endOfPoolGiftId];
endOfPoolGift.poolIndex = withdrawnGiftPoolIndex;
_giftPool[withdrawnGiftPoolIndex] = endOfPoolGiftId;
} else {
unchecked {
poolSize--;
}
}
delete _giftGiver[msg.sender];
delete _gift[id];
address withdrawnGiftContract = withdrawnGift.tokenContract;
uint256 withdrawnGiftTokenId = withdrawnGift.tokenId;
giftTransfer(withdrawnGiftContract, withdrawnGiftTokenId);
emit Withdraw(msg.sender, id);
}
function changeGameState(uint8 _state) public onlyOwner {
state = State(_state);
emit StateChange(state);
}
function updateUserMerkleRoot(bytes32 _userMerkleRoot) public onlyOwner {
userMerkleRoot = _userMerkleRoot;
}
function updateGiftMerkleRoot(bytes32 _giftMerkleRoot) public onlyOwner {
giftMerkleRoot = _giftMerkleRoot;
}
function withdrawGift(uint256 _giftId) public onlyOwner {
if (block.timestamp < withdrawReleaseDate) revert OwnerWithdrawLocked();
Gift memory withdrawnGift = _gift[_giftId];
if (withdrawnGift.tokenContract == address(0)) revert GiftDoesNotExist();
address withdrawnGiftContract = withdrawnGift.tokenContract;
uint256 withdrawnGiftTokenId = withdrawnGift.tokenId;
giftTransfer(withdrawnGiftContract, withdrawnGiftTokenId);
emit Withdraw(msg.sender, _giftId);
}
function giftTransfer(address withdrawnGiftContract, uint256 withdrawnGiftTokenId) private {
if (isERC721(withdrawnGiftContract)) {
IERC721(withdrawnGiftContract).safeTransferFrom(address(this), msg.sender, withdrawnGiftTokenId);
} else {
IERC1155(withdrawnGiftContract).safeTransferFrom(address(this), msg.sender, withdrawnGiftTokenId, 1, "");
}
}
function isUserWhiteListed(
address _user,
bytes32[] calldata _merkleProof
) internal view returns (bool) {
bytes32 leaf = keccak256(abi.encodePacked(_user));
return MerkleProof.verify(_merkleProof, userMerkleRoot, leaf);
}
function isTokenApproved(
address _tokenAddress,
bytes32[] calldata _merkleProof
) internal view returns (bool) {
bytes32 leaf = keccak256(abi.encodePacked(_tokenAddress));
return MerkleProof.verify(_merkleProof, giftMerkleRoot, leaf);
}
function getRandomPoolIndex() internal returns (uint256) {
return (uint256(keccak256(
abi.encodePacked(
block.timestamp,
block.difficulty,
++seed
)
)) % poolSize) + 1;
}
function isERC721(address _contract) internal view returns (bool) {
return IERC721(_contract).supportsInterface(type(IERC721).interfaceId);
}
function onERC721Received(
address,
address,
uint256,
bytes calldata
) public pure returns (bytes4) {
return IERC721Receiver.onERC721Received.selector;
}
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes calldata
) public pure returns(bytes4) {
return IERC1155Receiver.onERC1155Received.selector;
}
}
文件 8 的 9:MerkleProof.sol
pragma solidity ^0.8.0;
library MerkleProof {
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
文件 9 的 9:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
{
"compilationTarget": {
"src/JingleBeanz.sol": "JingleBeanz"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [
":ds-test/=lib/forge-std/lib/ds-test/src/",
":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
":forge-std/=lib/forge-std/src/",
":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
":solmate/=lib/solmate/src/"
]
}
[{"inputs":[{"internalType":"bytes32","name":"_userMerkleRoot","type":"bytes32"},{"internalType":"bytes32","name":"_giftMerkleRoot","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyHaveGift","type":"error"},{"inputs":[],"name":"AlreadyOwnedGift","type":"error"},{"inputs":[],"name":"AlreadySubmitted","type":"error"},{"inputs":[],"name":"GiftCooldownNotComplete","type":"error"},{"inputs":[],"name":"GiftDoesNotExist","type":"error"},{"inputs":[],"name":"InvalidGift","type":"error"},{"inputs":[],"name":"MaxGiftSteals","type":"error"},{"inputs":[],"name":"NoGiftOwner","type":"error"},{"inputs":[],"name":"OwnerWithdrawLocked","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[{"internalType":"enum State","name":"_currentState","type":"uint8"},{"internalType":"enum State","name":"_requiredState","type":"uint8"}],"name":"WrongState","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"giftId","type":"uint256"}],"name":"Gifted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"enum State","name":"_state","type":"uint8"}],"name":"StateChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"giftId","type":"uint256"}],"name":"Stolen","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"uint256","name":"giftId","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Submitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"giftId","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"OWNER_WITHDRAW_LOCKOUT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STEAL_COOLDOWN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_state","type":"uint8"}],"name":"changeGameState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getRandomGift","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_giftId","type":"uint256"}],"name":"gift","outputs":[{"components":[{"internalType":"uint256","name":"nextTouch","type":"uint256"},{"internalType":"uint256","name":"poolIndex","type":"uint256"},{"internalType":"uint256","name":"stolenCount","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"tokenContract","type":"address"}],"internalType":"struct Gift","name":"returnGift","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_giver","type":"address"}],"name":"giftGiver","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"giftId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"giftMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_giftId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"giftOwner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"ownsGift","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"state","outputs":[{"internalType":"enum State","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_giftId","type":"uint256"}],"name":"stealGift","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_tokenContract","type":"address"},{"internalType":"bytes32[]","name":"_userMerkleProof","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_giftMerkleProof","type":"bytes32[]"}],"name":"submitGift","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_giftId","type":"uint256"}],"name":"touchedGift","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_giftMerkleRoot","type":"bytes32"}],"name":"updateGiftMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_userMerkleRoot","type":"bytes32"}],"name":"updateUserMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"userMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawFromGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_giftId","type":"uint256"}],"name":"withdrawGift","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawGift","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]