Source Code
Latest 25 from a total of 89 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Renounce Ownersh... | 18105626 | 901 days ago | IN | 0 ETH | 0.00022861 | ||||
| Collect | 17818606 | 942 days ago | IN | 0 ETH | 0.00278538 | ||||
| Collect | 17710124 | 957 days ago | IN | 0 ETH | 0.00208809 | ||||
| Play | 17603061 | 972 days ago | IN | 0 ETH | 0.00469856 | ||||
| Collect | 17603052 | 972 days ago | IN | 0 ETH | 0.0022759 | ||||
| Play | 17603043 | 972 days ago | IN | 0 ETH | 0.00510394 | ||||
| Play | 17570169 | 977 days ago | IN | 0 ETH | 0.00473612 | ||||
| Collect | 17533075 | 982 days ago | IN | 0 ETH | 0.00239509 | ||||
| Play | 17505844 | 986 days ago | IN | 0 ETH | 0.00508874 | ||||
| Play | 17505835 | 986 days ago | IN | 0 ETH | 0.006118 | ||||
| Collect | 17494462 | 987 days ago | IN | 0 ETH | 0.00262197 | ||||
| Collect | 17481354 | 989 days ago | IN | 0 ETH | 0.00266076 | ||||
| Collect | 17477429 | 990 days ago | IN | 0 ETH | 0.00216143 | ||||
| Collect | 17475400 | 990 days ago | IN | 0 ETH | 0.00276144 | ||||
| Play | 17470035 | 991 days ago | IN | 0 ETH | 0.0048449 | ||||
| Play | 17468158 | 991 days ago | IN | 0 ETH | 0.00477619 | ||||
| Play | 17460344 | 992 days ago | IN | 0 ETH | 0.00444649 | ||||
| Collect | 17460328 | 992 days ago | IN | 0 ETH | 0.00300429 | ||||
| Collect | 17453243 | 993 days ago | IN | 0 ETH | 0.00243376 | ||||
| Collect | 17440270 | 995 days ago | IN | 0 ETH | 0.00493004 | ||||
| Collect | 17433652 | 996 days ago | IN | 0 ETH | 0.00379287 | ||||
| Play | 17427080 | 997 days ago | IN | 0 ETH | 0.00779597 | ||||
| Play | 17426175 | 997 days ago | IN | 0 ETH | 0.00672765 | ||||
| Play | 17426004 | 997 days ago | IN | 0 ETH | 0.00868269 | ||||
| Collect | 17425992 | 997 days ago | IN | 0 ETH | 0.00315272 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
FlipItGameV1
Compiler Version
v0.8.13+commit.abaa5c0e
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import { IERC721A } from "erc721a/contracts/IERC721A.sol";
import { Random } from "./libraries/Random.sol";
import { IFlipItMinter } from "./IFlipItMinter.sol";
/**
* @title FlipIt game
*
* @notice An implementation of the game (v1.0) in the FlipIt ecosystem.
*/
contract FlipItGameV1 is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.UintSet;
/// @notice A struct containing the game data.
/// @param player Address of the player.
/// @param amount Amount of the transferred tokens.
/// @param rewardIds List of reward token ids.
/// @param win Flag indicating the result of the game.
struct Game {
address player;
uint256 amount;
uint256[] rewardIds;
bool win;
}
/// @notice A struct containing the threshold configuration.
/// @param level Number of nft required to play.
/// @param min Minimum amount of tokens required to play.
/// @param max Maximum amount of tokens required to play.
struct Threshold {
uint256 level;
uint256 min;
uint256 max;
}
//-------------------------------------------------------------------------
// Constants & Immutables
/// @notice Address to the external smart contract that is ERC20 implementation.
IERC20 internal immutable token;
/// @notice Address to the external smart contract that is ERC721A implementation.
IERC721A internal immutable burger;
/// @notice Address to the external smart contract that mints nfts.
IFlipItMinter internal minter;
uint256 internal constant WINNING_CHANCE = 35;
//-------------------------------------------------------------------------
// Storage
/// @notice Incremental value for indexing games and tracking the number of games.
uint256 public gameSerialId;
/// @notice Incremental value for indexing thresholds and tracking the number of thresholds.
uint256 public thresholdSerialId;
/// @notice Mapping to store all games.
mapping(uint256 => Game) public games;
/// @notice Mapping to store all thresholds.
mapping(uint256 => Threshold) public thresholds;
/// @notice Mapping to store all game ids of the player.
mapping(address => EnumerableSet.UintSet) internal _gameIdsByPlayer;
//-------------------------------------------------------------------------
// Events
/// @notice Event emitted when game has been played.
/// @param gameSerialId Id of the game.
event Played(uint256 gameSerialId);
//-------------------------------------------------------------------------
// Errors
/// @notice Threshold conditions have not been met.
/// @param thresholdId Id of the threshold.
error InvalidThreshold(uint256 thresholdId);
/// @notice Contract reference is `address(0)`.
error UnacceptableReference();
/// @notice Event emitted when the minter reference has been updated.
/// @param minter Address of the minter smart contract.
event MinterUpdated(address minter);
//-------------------------------------------------------------------------
// Construction & Initialization
/// @notice Contract state initialization.
/// @param token_ Address of the token smart contract.
/// @param burger_ Address of the burger smart contract.
/// @param minter_ Address of the minter smart contract.
constructor(IERC20 token_, IERC721A burger_, IFlipItMinter minter_) {
if (address(token_) == address(0) || address(burger_) == address(0) || address(minter_) == address(0)) {
revert UnacceptableReference();
}
token = token_;
burger = burger_;
minter = minter_;
}
/// @notice Updates the minter.
/// @param minter_ Address of the minter smart contract.
function updateMinter(IFlipItMinter minter_) external onlyOwner {
if (address(minter_) == address(0)) revert UnacceptableReference();
minter = minter_;
emit MinterUpdated(address(minter_));
}
/// @notice Plays the game.
/// @param thresholdId Id of the selected threshold.
/// @param amount Amount of tokens.
function play(uint256 thresholdId, uint256 amount) external nonReentrant {
address player = _msgSender();
Threshold memory threshold = thresholds[thresholdId];
/**
* Checks if the conditions of the given threshold have been met:
* - the threshold must exist
* - the player must have the required amount of tokens
* - the player must have the required amount of nfts
*/
if (threshold.min == 0 && threshold.max == 0) revert InvalidThreshold(thresholdId);
if (amount < threshold.min || amount > threshold.max) revert InvalidThreshold(thresholdId);
if (token.balanceOf(player) < amount || token.allowance(player, address(this)) < amount) revert InvalidThreshold(thresholdId);
if (threshold.level != 0 && burger.balanceOf(player) < threshold.level) revert InvalidThreshold(thresholdId);
/// Generates random number between 1 and 100.
uint256 chance = Random.number(token.balanceOf(address(this)) + token.balanceOf(player) + gameSerialId, 1, 100, player);
bool win = chance <= WINNING_CHANCE;
/// Mints a reward (nft)
uint256[] memory rewards = minter.mintIngredient(player, 1);
/// Saves the result of the game
games[++gameSerialId] = Game({ player: player, amount: amount, win: win, rewardIds: rewards });
_gameIdsByPlayer[player].add(gameSerialId);
emit Played(gameSerialId);
/// Transfers tokens depending on the game result
if (win) token.safeTransfer(player, amount);
if (!win) token.safeTransferFrom(player, address(this), amount);
}
/// @notice Collect the rewards.
/// @param amount Number of the rewards to claim.
function collect(uint256 amount) external nonReentrant {
minter.mintBurger(_msgSender(), amount);
}
/// @notice Adds new threshold.
/// @param level Number of nft required to play.
/// @param min Minimum amount of tokens required to play.
/// @param max Maximum amount of tokens required to play.
function addThreshold(uint256 level, uint256 min, uint256 max) external onlyOwner {
if (min > max) revert UnacceptableReference();
thresholds[++thresholdSerialId] = Threshold({ level: level, min: min, max: max });
}
/// @notice Updates the threshold.
/// @param id Id of the threshold.
/// @param level Number of nft required to play.
/// @param min Minimum amount of tokens required to play.
/// @param max Maximum amount of tokens required to play.
function updateThreshold(uint256 id, uint256 level, uint256 min, uint256 max) external onlyOwner {
Threshold memory threshold = thresholds[id];
if (threshold.min == 0 && threshold.max == 0) revert InvalidThreshold(id);
if (min > max) revert UnacceptableReference();
thresholds[id] = Threshold({ level: level, min: min, max: max });
}
/// @param player Address of the player.
/// @return Returns the game ids by the given address.
function gameIdsByPlayer(address player) external view returns (uint256[] memory) {
return _gameIdsByPlayer[player].values();
}
/// @param gameId Id of the game.
/// @return Returns the rewards ids of the game.
function rewardIdsByGame(uint256 gameId) external view returns (uint256[] memory) {
return games[gameId].rewardIds;
}
/// @notice Withdraw any token from the smart contract to the given recipient.
/// @param to Address of the recipient.
/// @param token_ Address of the token smart contract.
function withdrawToken(address to, IERC20 token_) external onlyOwner {
token_.safeTransfer(to, token_.balanceOf(address(this)));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or 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 {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// 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 (last updated v4.8.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*
* [WARNING]
* ====
* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
* unusable.
* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
*
* In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
* array of EnumerableSet.
* ====
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastValue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastValue;
// Update the index for the moved value
set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
bytes32[] memory store = _values(set._inner);
bytes32[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
interface IFlipItMinter {
/// @notice Mints a given number of tokens and transfers them to the recipient.
/// @param recipient Address of the recipient.
/// @param amount Amount of the token to mint.
/// @return List of minted token ids.
function mintBurger(address recipient, uint256 amount) external returns (uint256[] memory);
/// @notice Mints a given number of tokens and transfers them to the recipient.
/// @param recipient Address of the recipient.
/// @param amount Amount of the token to mint.
/// @return List of minted token ids.
function mintIngredient(address recipient, uint256 amount) external returns (uint256[] memory);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
library Random {
/// @notice Generates a random number from the specified range.
/// @param nonce Value used to increase randomness.
/// @param min Minimum value of the range.
/// @param max Maximum value of the range.
/// @param sender Address used to increase randomness.
/// @return Returns the random number.
function number(uint256 nonce, uint256 min, uint256 max, address sender) internal view returns (uint256) {
uint256 value = uint256(keccak256(abi.encodePacked(block.difficulty, block.gaslimit, sender, block.number, nonce)));
return (value % max) + min;
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of ERC721A.
*/
interface IERC721A {
/**
* The caller must own the token or be an approved operator.
*/
error ApprovalCallerNotOwnerNorApproved();
/**
* The token does not exist.
*/
error ApprovalQueryForNonexistentToken();
/**
* Cannot query the balance for the zero address.
*/
error BalanceQueryForZeroAddress();
/**
* Cannot mint to the zero address.
*/
error MintToZeroAddress();
/**
* The quantity of tokens minted must be more than zero.
*/
error MintZeroQuantity();
/**
* The token does not exist.
*/
error OwnerQueryForNonexistentToken();
/**
* The caller must own the token or be an approved operator.
*/
error TransferCallerNotOwnerNorApproved();
/**
* The token must be owned by `from`.
*/
error TransferFromIncorrectOwner();
/**
* Cannot safely transfer to a contract that does not implement the
* ERC721Receiver interface.
*/
error TransferToNonERC721ReceiverImplementer();
/**
* Cannot transfer to the zero address.
*/
error TransferToZeroAddress();
/**
* The token does not exist.
*/
error URIQueryForNonexistentToken();
/**
* The `quantity` minted with ERC2309 exceeds the safety limit.
*/
error MintERC2309QuantityExceedsLimit();
/**
* The `extraData` cannot be set on an unintialized ownership slot.
*/
error OwnershipNotInitializedForExtraData();
// =============================================================
// STRUCTS
// =============================================================
struct TokenOwnership {
// The address of the owner.
address addr;
// Stores the start time of ownership with minimal overhead for tokenomics.
uint64 startTimestamp;
// Whether the token has been burned.
bool burned;
// Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
uint24 extraData;
}
// =============================================================
// TOKEN COUNTERS
// =============================================================
/**
* @dev Returns the total number of tokens in existence.
* Burned tokens will reduce the count.
* To get the total number of tokens minted, please see {_totalMinted}.
*/
function totalSupply() external view returns (uint256);
// =============================================================
// IERC165
// =============================================================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
// =============================================================
// IERC721
// =============================================================
/**
* @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`,
* 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,
bytes calldata data
) external payable;
/**
* @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
/**
* @dev Transfers `tokenId` 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 payable;
/**
* @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 payable;
/**
* @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);
// =============================================================
// IERC721Metadata
// =============================================================
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
// =============================================================
// IERC2309
// =============================================================
/**
* @dev Emitted when tokens in `fromTokenId` to `toTokenId`
* (inclusive) is transferred from `from` to `to`, as defined in the
* [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
*
* See {_mintERC2309} for more details.
*/
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}{
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": [],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IERC20","name":"token_","type":"address"},{"internalType":"contract IERC721A","name":"burger_","type":"address"},{"internalType":"contract IFlipItMinter","name":"minter_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"thresholdId","type":"uint256"}],"name":"InvalidThreshold","type":"error"},{"inputs":[],"name":"UnacceptableReference","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"minter","type":"address"}],"name":"MinterUpdated","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":false,"internalType":"uint256","name":"gameSerialId","type":"uint256"}],"name":"Played","type":"event"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"addThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"collect","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"player","type":"address"}],"name":"gameIdsByPlayer","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameSerialId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"games","outputs":[{"internalType":"address","name":"player","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"win","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"thresholdId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"play","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"gameId","type":"uint256"}],"name":"rewardIdsByGame","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"thresholdSerialId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"thresholds","outputs":[{"internalType":"uint256","name":"level","type":"uint256"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IFlipItMinter","name":"minter_","type":"address"}],"name":"updateMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"level","type":"uint256"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"updateThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"contract IERC20","name":"token_","type":"address"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60c06040523480156200001157600080fd5b5060405162002a7a38038062002a7a8339818101604052810190620000379190620003bc565b620000576200004b620001e860201b60201c565b620001f060201b60201c565b60018081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480620000c65750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b80620000fe5750600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b1562000136576040517fe21d05d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff168152505080600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505062000418565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620002e682620002b9565b9050919050565b6000620002fa82620002d9565b9050919050565b6200030c81620002ed565b81146200031857600080fd5b50565b6000815190506200032c8162000301565b92915050565b60006200033f82620002d9565b9050919050565b620003518162000332565b81146200035d57600080fd5b50565b600081519050620003718162000346565b92915050565b60006200038482620002d9565b9050919050565b620003968162000377565b8114620003a257600080fd5b50565b600081519050620003b6816200038b565b92915050565b600080600060608486031215620003d857620003d7620002b4565b5b6000620003e8868287016200031b565b9350506020620003fb8682870162000360565b92505060406200040e86828701620003a5565b9150509250925092565b60805160a05161261962000461600039600061092f0152600081816107980152818161083a01528181610a1501528181610aaf01528181610da50152610df701526126196000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80637bc49a9511610097578063b6c2261111610066578063b6c226111461025e578063ce3f865f14610290578063e4a144d1146102ac578063f2fde38b146102ca576100f5565b80637bc49a95146101d85780638da5cb5b146101f4578063900b0d3914610212578063a0beaeef14610242576100f5565b80634eb03f6e116100d35780634eb03f6e146101665780635a244c0714610182578063715018a6146101b257806376d2c118146101bc576100f5565b8063063011bb146100fa578063117a5b90146101185780633aeac4e11461014a575b600080fd5b6101026102e6565b60405161010f919061182f565b60405180910390f35b610132600480360381019061012d919061188a565b6102ec565b60405161014193929190611913565b60405180910390f35b610164600480360381019061015f91906119b4565b610343565b005b610180600480360381019061017b9190611a32565b6103f3565b005b61019c6004803603810190610197919061188a565b6104dc565b6040516101a99190611b1d565b60405180910390f35b6101ba61054a565b005b6101d660048036038101906101d19190611b3f565b61055e565b005b6101f260048036038101906101ed9190611ba6565b610690565b005b6101fc610e4e565b6040516102099190611be6565b60405180910390f35b61022c60048036038101906102279190611c01565b610e77565b6040516102399190611b1d565b60405180910390f35b61025c60048036038101906102579190611c2e565b610ec7565b005b6102786004803603810190610273919061188a565b610f71565b60405161028793929190611c81565b60405180910390f35b6102aa60048036038101906102a5919061188a565b610f9b565b005b6102b461105b565b6040516102c1919061182f565b60405180910390f35b6102e460048036038101906102df9190611c01565b611061565b005b60035481565b60056020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060030160009054906101000a900460ff16905083565b61034b6110e4565b6103ef828273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016103889190611be6565b602060405180830381865afa1580156103a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c99190611ccd565b8373ffffffffffffffffffffffffffffffffffffffff166111629092919063ffffffff16565b5050565b6103fb6110e4565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610461576040517fe21d05d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fad0f299ec81a386c98df0ac27dae11dd020ed1b56963c53a7292e7a3a314539a816040516104d19190611be6565b60405180910390a150565b60606005600083815260200190815260200160002060020180548060200260200160405190810160405280929190818152602001828054801561053e57602002820191906000526020600020905b81548152602001906001019080831161052a575b50505050509050919050565b6105526110e4565b61055c60006111e8565b565b6105666110e4565b60006006600086815260200190815260200160002060405180606001604052908160008201548152602001600182015481526020016002820154815250509050600081602001511480156105be575060008160400151145b1561060057846040517f651a749b0000000000000000000000000000000000000000000000000000000081526004016105f7919061182f565b60405180910390fd5b8183111561063a576040517fe21d05d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051806060016040528085815260200184815260200183815250600660008781526020019081526020016000206000820151816000015560208201518160010155604082015181600201559050505050505050565b6106986112ac565b60006106a26112fb565b905060006006600085815260200190815260200160002060405180606001604052908160008201548152602001600182015481526020016002820154815250509050600081602001511480156106fc575060008160400151145b1561073e57836040517f651a749b000000000000000000000000000000000000000000000000000000008152600401610735919061182f565b60405180910390fd5b80602001518310806107535750806040015183115b1561079557836040517f651a749b00000000000000000000000000000000000000000000000000000000815260040161078c919061182f565b60405180910390fd5b827f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b81526004016107ef9190611be6565b602060405180830381865afa15801561080c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108309190611ccd565b10806108d65750827f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84306040518363ffffffff1660e01b8152600401610893929190611cfa565b602060405180830381865afa1580156108b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d49190611ccd565b105b1561091857836040517f651a749b00000000000000000000000000000000000000000000000000000000815260040161090f919061182f565b60405180910390fd5b60008160000151141580156109c9575080600001517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b81526004016109869190611be6565b602060405180830381865afa1580156109a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c79190611ccd565b105b15610a0b57836040517f651a749b000000000000000000000000000000000000000000000000000000008152600401610a02919061182f565b60405180910390fd5b6000610b656003547f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401610a6c9190611be6565b602060405180830381865afa158015610a89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aad9190611ccd565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610b069190611be6565b602060405180830381865afa158015610b23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b479190611ccd565b610b519190611d52565b610b5b9190611d52565b6001606486611303565b90506000602382111590506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166399d869938660016040518363ffffffff1660e01b8152600401610bd0929190611ded565b6000604051808303816000875af1158015610bef573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610c189190611f6f565b905060405180608001604052808673ffffffffffffffffffffffffffffffffffffffff16815260200187815260200182815260200183151581525060056000600360008154610c6690611fb8565b919050819055815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190610ce79291906117ac565b5060608201518160030160006101000a81548160ff021916908315150217905550905050610d5e600354600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061135c90919063ffffffff16565b507f058365367dbf27b3eb0105dc3673f1ebf4fd677c3d63be59eed845df3c83db7f600354604051610d90919061182f565b60405180910390a18115610dea57610de985877f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166111629092919063ffffffff16565b5b81610e3d57610e3c8530887f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611376909392919063ffffffff16565b5b5050505050610e4a6113ff565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060610ec0600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611408565b9050919050565b610ecf6110e4565b80821115610f09576040517fe21d05d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180606001604052808481526020018381526020018281525060066000600460008154610f3790611fb8565b9190508190558152602001908152602001600020600082015181600001556020820151816001015560408201518160020155905050505050565b60066020528060005260406000206000915090508060000154908060010154908060020154905083565b610fa36112ac565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166389aaafe1610fe96112fb565b836040518363ffffffff1660e01b8152600401611007929190612000565b6000604051808303816000875af1158015611026573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061104f9190611f6f565b506110586113ff565b50565b60045481565b6110696110e4565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036110d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110cf906120ac565b60405180910390fd5b6110e1816111e8565b50565b6110ec6112fb565b73ffffffffffffffffffffffffffffffffffffffff1661110a610e4e565b73ffffffffffffffffffffffffffffffffffffffff1614611160576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115790612118565b60405180910390fd5b565b6111e38363a9059cbb60e01b8484604051602401611181929190612000565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611429565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6002600154036112f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e890612184565b60405180910390fd5b6002600181905550565b600033905090565b600080444584438960405160200161131f95949392919061220d565b6040516020818303038152906040528051906020012060001c9050848482611347919061229b565b6113519190611d52565b915050949350505050565b600061136e836000018360001b6114f0565b905092915050565b6113f9846323b872dd60e01b858585604051602401611397939291906122cc565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611429565b50505050565b60018081905550565b6060600061141883600001611560565b905060608190508092505050919050565b600061148b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166115bc9092919063ffffffff16565b90506000815111156114eb57808060200190518101906114ab919061232f565b6114ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e1906123ce565b60405180910390fd5b5b505050565b60006114fc83836115d4565b61155557826000018290806001815401808255809150506001900390600052602060002001600090919091909150558260000180549050836001016000848152602001908152602001600020819055506001905061155a565b600090505b92915050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156115b057602002820191906000526020600020905b81548152602001906001019080831161159c575b50505050509050919050565b60606115cb84846000856115f7565b90509392505050565b600080836001016000848152602001908152602001600020541415905092915050565b60608247101561163c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163390612460565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161166591906124fa565b60006040518083038185875af1925050503d80600081146116a2576040519150601f19603f3d011682016040523d82523d6000602084013e6116a7565b606091505b50915091506116b8878383876116c4565b92505050949350505050565b6060831561172657600083510361171e576116de85611739565b61171d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117149061255d565b60405180910390fd5b5b829050611731565b611730838361175c565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60008251111561176f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a391906125c1565b60405180910390fd5b8280548282559060005260206000209081019282156117e8579160200282015b828111156117e75782518255916020019190600101906117cc565b5b5090506117f591906117f9565b5090565b5b808211156118125760008160009055506001016117fa565b5090565b6000819050919050565b61182981611816565b82525050565b60006020820190506118446000830184611820565b92915050565b6000604051905090565b600080fd5b600080fd5b61186781611816565b811461187257600080fd5b50565b6000813590506118848161185e565b92915050565b6000602082840312156118a05761189f611854565b5b60006118ae84828501611875565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006118e2826118b7565b9050919050565b6118f2816118d7565b82525050565b60008115159050919050565b61190d816118f8565b82525050565b600060608201905061192860008301866118e9565b6119356020830185611820565b6119426040830184611904565b949350505050565b611953816118d7565b811461195e57600080fd5b50565b6000813590506119708161194a565b92915050565b6000611981826118d7565b9050919050565b61199181611976565b811461199c57600080fd5b50565b6000813590506119ae81611988565b92915050565b600080604083850312156119cb576119ca611854565b5b60006119d985828601611961565b92505060206119ea8582860161199f565b9150509250929050565b60006119ff826118d7565b9050919050565b611a0f816119f4565b8114611a1a57600080fd5b50565b600081359050611a2c81611a06565b92915050565b600060208284031215611a4857611a47611854565b5b6000611a5684828501611a1d565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611a9481611816565b82525050565b6000611aa68383611a8b565b60208301905092915050565b6000602082019050919050565b6000611aca82611a5f565b611ad48185611a6a565b9350611adf83611a7b565b8060005b83811015611b10578151611af78882611a9a565b9750611b0283611ab2565b925050600181019050611ae3565b5085935050505092915050565b60006020820190508181036000830152611b378184611abf565b905092915050565b60008060008060808587031215611b5957611b58611854565b5b6000611b6787828801611875565b9450506020611b7887828801611875565b9350506040611b8987828801611875565b9250506060611b9a87828801611875565b91505092959194509250565b60008060408385031215611bbd57611bbc611854565b5b6000611bcb85828601611875565b9250506020611bdc85828601611875565b9150509250929050565b6000602082019050611bfb60008301846118e9565b92915050565b600060208284031215611c1757611c16611854565b5b6000611c2584828501611961565b91505092915050565b600080600060608486031215611c4757611c46611854565b5b6000611c5586828701611875565b9350506020611c6686828701611875565b9250506040611c7786828701611875565b9150509250925092565b6000606082019050611c966000830186611820565b611ca36020830185611820565b611cb06040830184611820565b949350505050565b600081519050611cc78161185e565b92915050565b600060208284031215611ce357611ce2611854565b5b6000611cf184828501611cb8565b91505092915050565b6000604082019050611d0f60008301856118e9565b611d1c60208301846118e9565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611d5d82611816565b9150611d6883611816565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611d9d57611d9c611d23565b5b828201905092915050565b6000819050919050565b6000819050919050565b6000611dd7611dd2611dcd84611da8565b611db2565b611816565b9050919050565b611de781611dbc565b82525050565b6000604082019050611e0260008301856118e9565b611e0f6020830184611dde565b9392505050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611e6482611e1b565b810181811067ffffffffffffffff82111715611e8357611e82611e2c565b5b80604052505050565b6000611e9661184a565b9050611ea28282611e5b565b919050565b600067ffffffffffffffff821115611ec257611ec1611e2c565b5b602082029050602081019050919050565b600080fd5b6000611eeb611ee684611ea7565b611e8c565b90508083825260208201905060208402830185811115611f0e57611f0d611ed3565b5b835b81811015611f375780611f238882611cb8565b845260208401935050602081019050611f10565b5050509392505050565b600082601f830112611f5657611f55611e16565b5b8151611f66848260208601611ed8565b91505092915050565b600060208284031215611f8557611f84611854565b5b600082015167ffffffffffffffff811115611fa357611fa2611859565b5b611faf84828501611f41565b91505092915050565b6000611fc382611816565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611ff557611ff4611d23565b5b600182019050919050565b600060408201905061201560008301856118e9565b6120226020830184611820565b9392505050565b600082825260208201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000612096602683612029565b91506120a18261203a565b604082019050919050565b600060208201905081810360008301526120c581612089565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612102602083612029565b915061210d826120cc565b602082019050919050565b60006020820190508181036000830152612131816120f5565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061216e601f83612029565b915061217982612138565b602082019050919050565b6000602082019050818103600083015261219d81612161565b9050919050565b6000819050919050565b6121bf6121ba82611816565b6121a4565b82525050565b60008160601b9050919050565b60006121dd826121c5565b9050919050565b60006121ef826121d2565b9050919050565b612207612202826118d7565b6121e4565b82525050565b600061221982886121ae565b60208201915061222982876121ae565b60208201915061223982866121f6565b60148201915061224982856121ae565b60208201915061225982846121ae565b6020820191508190509695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006122a682611816565b91506122b183611816565b9250826122c1576122c061226c565b5b828206905092915050565b60006060820190506122e160008301866118e9565b6122ee60208301856118e9565b6122fb6040830184611820565b949350505050565b61230c816118f8565b811461231757600080fd5b50565b60008151905061232981612303565b92915050565b60006020828403121561234557612344611854565b5b60006123538482850161231a565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b60006123b8602a83612029565b91506123c38261235c565b604082019050919050565b600060208201905081810360008301526123e7816123ab565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b600061244a602683612029565b9150612455826123ee565b604082019050919050565b600060208201905081810360008301526124798161243d565b9050919050565b600081519050919050565b600081905092915050565b60005b838110156124b4578082015181840152602081019050612499565b838111156124c3576000848401525b50505050565b60006124d482612480565b6124de818561248b565b93506124ee818560208601612496565b80840191505092915050565b600061250682846124c9565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000612547601d83612029565b915061255282612511565b602082019050919050565b600060208201905081810360008301526125768161253a565b9050919050565b600081519050919050565b60006125938261257d565b61259d8185612029565b93506125ad818560208601612496565b6125b681611e1b565b840191505092915050565b600060208201905081810360008301526125db8184612588565b90509291505056fea26469706673582212206f618d2c2c1a3b88ad82df0b869d75b9c96fe92f40b773f060e70715c03c90b464736f6c634300080d00330000000000000000000000001d745b9c04aa2946a4e16862cfe4dd2469a28fa1000000000000000000000000fa9a50d76dd0ee66cb144fc4148faef62e43ceb4000000000000000000000000ff64e67e08c2fee12aef48f97dc685e38e21f40f
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80637bc49a9511610097578063b6c2261111610066578063b6c226111461025e578063ce3f865f14610290578063e4a144d1146102ac578063f2fde38b146102ca576100f5565b80637bc49a95146101d85780638da5cb5b146101f4578063900b0d3914610212578063a0beaeef14610242576100f5565b80634eb03f6e116100d35780634eb03f6e146101665780635a244c0714610182578063715018a6146101b257806376d2c118146101bc576100f5565b8063063011bb146100fa578063117a5b90146101185780633aeac4e11461014a575b600080fd5b6101026102e6565b60405161010f919061182f565b60405180910390f35b610132600480360381019061012d919061188a565b6102ec565b60405161014193929190611913565b60405180910390f35b610164600480360381019061015f91906119b4565b610343565b005b610180600480360381019061017b9190611a32565b6103f3565b005b61019c6004803603810190610197919061188a565b6104dc565b6040516101a99190611b1d565b60405180910390f35b6101ba61054a565b005b6101d660048036038101906101d19190611b3f565b61055e565b005b6101f260048036038101906101ed9190611ba6565b610690565b005b6101fc610e4e565b6040516102099190611be6565b60405180910390f35b61022c60048036038101906102279190611c01565b610e77565b6040516102399190611b1d565b60405180910390f35b61025c60048036038101906102579190611c2e565b610ec7565b005b6102786004803603810190610273919061188a565b610f71565b60405161028793929190611c81565b60405180910390f35b6102aa60048036038101906102a5919061188a565b610f9b565b005b6102b461105b565b6040516102c1919061182f565b60405180910390f35b6102e460048036038101906102df9190611c01565b611061565b005b60035481565b60056020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060030160009054906101000a900460ff16905083565b61034b6110e4565b6103ef828273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016103889190611be6565b602060405180830381865afa1580156103a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c99190611ccd565b8373ffffffffffffffffffffffffffffffffffffffff166111629092919063ffffffff16565b5050565b6103fb6110e4565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610461576040517fe21d05d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fad0f299ec81a386c98df0ac27dae11dd020ed1b56963c53a7292e7a3a314539a816040516104d19190611be6565b60405180910390a150565b60606005600083815260200190815260200160002060020180548060200260200160405190810160405280929190818152602001828054801561053e57602002820191906000526020600020905b81548152602001906001019080831161052a575b50505050509050919050565b6105526110e4565b61055c60006111e8565b565b6105666110e4565b60006006600086815260200190815260200160002060405180606001604052908160008201548152602001600182015481526020016002820154815250509050600081602001511480156105be575060008160400151145b1561060057846040517f651a749b0000000000000000000000000000000000000000000000000000000081526004016105f7919061182f565b60405180910390fd5b8183111561063a576040517fe21d05d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051806060016040528085815260200184815260200183815250600660008781526020019081526020016000206000820151816000015560208201518160010155604082015181600201559050505050505050565b6106986112ac565b60006106a26112fb565b905060006006600085815260200190815260200160002060405180606001604052908160008201548152602001600182015481526020016002820154815250509050600081602001511480156106fc575060008160400151145b1561073e57836040517f651a749b000000000000000000000000000000000000000000000000000000008152600401610735919061182f565b60405180910390fd5b80602001518310806107535750806040015183115b1561079557836040517f651a749b00000000000000000000000000000000000000000000000000000000815260040161078c919061182f565b60405180910390fd5b827f0000000000000000000000001d745b9c04aa2946a4e16862cfe4dd2469a28fa173ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b81526004016107ef9190611be6565b602060405180830381865afa15801561080c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108309190611ccd565b10806108d65750827f0000000000000000000000001d745b9c04aa2946a4e16862cfe4dd2469a28fa173ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84306040518363ffffffff1660e01b8152600401610893929190611cfa565b602060405180830381865afa1580156108b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d49190611ccd565b105b1561091857836040517f651a749b00000000000000000000000000000000000000000000000000000000815260040161090f919061182f565b60405180910390fd5b60008160000151141580156109c9575080600001517f000000000000000000000000fa9a50d76dd0ee66cb144fc4148faef62e43ceb473ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b81526004016109869190611be6565b602060405180830381865afa1580156109a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c79190611ccd565b105b15610a0b57836040517f651a749b000000000000000000000000000000000000000000000000000000008152600401610a02919061182f565b60405180910390fd5b6000610b656003547f0000000000000000000000001d745b9c04aa2946a4e16862cfe4dd2469a28fa173ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401610a6c9190611be6565b602060405180830381865afa158015610a89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aad9190611ccd565b7f0000000000000000000000001d745b9c04aa2946a4e16862cfe4dd2469a28fa173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610b069190611be6565b602060405180830381865afa158015610b23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b479190611ccd565b610b519190611d52565b610b5b9190611d52565b6001606486611303565b90506000602382111590506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166399d869938660016040518363ffffffff1660e01b8152600401610bd0929190611ded565b6000604051808303816000875af1158015610bef573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610c189190611f6f565b905060405180608001604052808673ffffffffffffffffffffffffffffffffffffffff16815260200187815260200182815260200183151581525060056000600360008154610c6690611fb8565b919050819055815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190610ce79291906117ac565b5060608201518160030160006101000a81548160ff021916908315150217905550905050610d5e600354600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061135c90919063ffffffff16565b507f058365367dbf27b3eb0105dc3673f1ebf4fd677c3d63be59eed845df3c83db7f600354604051610d90919061182f565b60405180910390a18115610dea57610de985877f0000000000000000000000001d745b9c04aa2946a4e16862cfe4dd2469a28fa173ffffffffffffffffffffffffffffffffffffffff166111629092919063ffffffff16565b5b81610e3d57610e3c8530887f0000000000000000000000001d745b9c04aa2946a4e16862cfe4dd2469a28fa173ffffffffffffffffffffffffffffffffffffffff16611376909392919063ffffffff16565b5b5050505050610e4a6113ff565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060610ec0600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611408565b9050919050565b610ecf6110e4565b80821115610f09576040517fe21d05d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180606001604052808481526020018381526020018281525060066000600460008154610f3790611fb8565b9190508190558152602001908152602001600020600082015181600001556020820151816001015560408201518160020155905050505050565b60066020528060005260406000206000915090508060000154908060010154908060020154905083565b610fa36112ac565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166389aaafe1610fe96112fb565b836040518363ffffffff1660e01b8152600401611007929190612000565b6000604051808303816000875af1158015611026573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061104f9190611f6f565b506110586113ff565b50565b60045481565b6110696110e4565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036110d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110cf906120ac565b60405180910390fd5b6110e1816111e8565b50565b6110ec6112fb565b73ffffffffffffffffffffffffffffffffffffffff1661110a610e4e565b73ffffffffffffffffffffffffffffffffffffffff1614611160576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115790612118565b60405180910390fd5b565b6111e38363a9059cbb60e01b8484604051602401611181929190612000565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611429565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6002600154036112f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e890612184565b60405180910390fd5b6002600181905550565b600033905090565b600080444584438960405160200161131f95949392919061220d565b6040516020818303038152906040528051906020012060001c9050848482611347919061229b565b6113519190611d52565b915050949350505050565b600061136e836000018360001b6114f0565b905092915050565b6113f9846323b872dd60e01b858585604051602401611397939291906122cc565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611429565b50505050565b60018081905550565b6060600061141883600001611560565b905060608190508092505050919050565b600061148b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166115bc9092919063ffffffff16565b90506000815111156114eb57808060200190518101906114ab919061232f565b6114ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e1906123ce565b60405180910390fd5b5b505050565b60006114fc83836115d4565b61155557826000018290806001815401808255809150506001900390600052602060002001600090919091909150558260000180549050836001016000848152602001908152602001600020819055506001905061155a565b600090505b92915050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156115b057602002820191906000526020600020905b81548152602001906001019080831161159c575b50505050509050919050565b60606115cb84846000856115f7565b90509392505050565b600080836001016000848152602001908152602001600020541415905092915050565b60608247101561163c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163390612460565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161166591906124fa565b60006040518083038185875af1925050503d80600081146116a2576040519150601f19603f3d011682016040523d82523d6000602084013e6116a7565b606091505b50915091506116b8878383876116c4565b92505050949350505050565b6060831561172657600083510361171e576116de85611739565b61171d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117149061255d565b60405180910390fd5b5b829050611731565b611730838361175c565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60008251111561176f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a391906125c1565b60405180910390fd5b8280548282559060005260206000209081019282156117e8579160200282015b828111156117e75782518255916020019190600101906117cc565b5b5090506117f591906117f9565b5090565b5b808211156118125760008160009055506001016117fa565b5090565b6000819050919050565b61182981611816565b82525050565b60006020820190506118446000830184611820565b92915050565b6000604051905090565b600080fd5b600080fd5b61186781611816565b811461187257600080fd5b50565b6000813590506118848161185e565b92915050565b6000602082840312156118a05761189f611854565b5b60006118ae84828501611875565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006118e2826118b7565b9050919050565b6118f2816118d7565b82525050565b60008115159050919050565b61190d816118f8565b82525050565b600060608201905061192860008301866118e9565b6119356020830185611820565b6119426040830184611904565b949350505050565b611953816118d7565b811461195e57600080fd5b50565b6000813590506119708161194a565b92915050565b6000611981826118d7565b9050919050565b61199181611976565b811461199c57600080fd5b50565b6000813590506119ae81611988565b92915050565b600080604083850312156119cb576119ca611854565b5b60006119d985828601611961565b92505060206119ea8582860161199f565b9150509250929050565b60006119ff826118d7565b9050919050565b611a0f816119f4565b8114611a1a57600080fd5b50565b600081359050611a2c81611a06565b92915050565b600060208284031215611a4857611a47611854565b5b6000611a5684828501611a1d565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611a9481611816565b82525050565b6000611aa68383611a8b565b60208301905092915050565b6000602082019050919050565b6000611aca82611a5f565b611ad48185611a6a565b9350611adf83611a7b565b8060005b83811015611b10578151611af78882611a9a565b9750611b0283611ab2565b925050600181019050611ae3565b5085935050505092915050565b60006020820190508181036000830152611b378184611abf565b905092915050565b60008060008060808587031215611b5957611b58611854565b5b6000611b6787828801611875565b9450506020611b7887828801611875565b9350506040611b8987828801611875565b9250506060611b9a87828801611875565b91505092959194509250565b60008060408385031215611bbd57611bbc611854565b5b6000611bcb85828601611875565b9250506020611bdc85828601611875565b9150509250929050565b6000602082019050611bfb60008301846118e9565b92915050565b600060208284031215611c1757611c16611854565b5b6000611c2584828501611961565b91505092915050565b600080600060608486031215611c4757611c46611854565b5b6000611c5586828701611875565b9350506020611c6686828701611875565b9250506040611c7786828701611875565b9150509250925092565b6000606082019050611c966000830186611820565b611ca36020830185611820565b611cb06040830184611820565b949350505050565b600081519050611cc78161185e565b92915050565b600060208284031215611ce357611ce2611854565b5b6000611cf184828501611cb8565b91505092915050565b6000604082019050611d0f60008301856118e9565b611d1c60208301846118e9565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611d5d82611816565b9150611d6883611816565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611d9d57611d9c611d23565b5b828201905092915050565b6000819050919050565b6000819050919050565b6000611dd7611dd2611dcd84611da8565b611db2565b611816565b9050919050565b611de781611dbc565b82525050565b6000604082019050611e0260008301856118e9565b611e0f6020830184611dde565b9392505050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611e6482611e1b565b810181811067ffffffffffffffff82111715611e8357611e82611e2c565b5b80604052505050565b6000611e9661184a565b9050611ea28282611e5b565b919050565b600067ffffffffffffffff821115611ec257611ec1611e2c565b5b602082029050602081019050919050565b600080fd5b6000611eeb611ee684611ea7565b611e8c565b90508083825260208201905060208402830185811115611f0e57611f0d611ed3565b5b835b81811015611f375780611f238882611cb8565b845260208401935050602081019050611f10565b5050509392505050565b600082601f830112611f5657611f55611e16565b5b8151611f66848260208601611ed8565b91505092915050565b600060208284031215611f8557611f84611854565b5b600082015167ffffffffffffffff811115611fa357611fa2611859565b5b611faf84828501611f41565b91505092915050565b6000611fc382611816565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611ff557611ff4611d23565b5b600182019050919050565b600060408201905061201560008301856118e9565b6120226020830184611820565b9392505050565b600082825260208201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000612096602683612029565b91506120a18261203a565b604082019050919050565b600060208201905081810360008301526120c581612089565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612102602083612029565b915061210d826120cc565b602082019050919050565b60006020820190508181036000830152612131816120f5565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061216e601f83612029565b915061217982612138565b602082019050919050565b6000602082019050818103600083015261219d81612161565b9050919050565b6000819050919050565b6121bf6121ba82611816565b6121a4565b82525050565b60008160601b9050919050565b60006121dd826121c5565b9050919050565b60006121ef826121d2565b9050919050565b612207612202826118d7565b6121e4565b82525050565b600061221982886121ae565b60208201915061222982876121ae565b60208201915061223982866121f6565b60148201915061224982856121ae565b60208201915061225982846121ae565b6020820191508190509695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006122a682611816565b91506122b183611816565b9250826122c1576122c061226c565b5b828206905092915050565b60006060820190506122e160008301866118e9565b6122ee60208301856118e9565b6122fb6040830184611820565b949350505050565b61230c816118f8565b811461231757600080fd5b50565b60008151905061232981612303565b92915050565b60006020828403121561234557612344611854565b5b60006123538482850161231a565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b60006123b8602a83612029565b91506123c38261235c565b604082019050919050565b600060208201905081810360008301526123e7816123ab565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b600061244a602683612029565b9150612455826123ee565b604082019050919050565b600060208201905081810360008301526124798161243d565b9050919050565b600081519050919050565b600081905092915050565b60005b838110156124b4578082015181840152602081019050612499565b838111156124c3576000848401525b50505050565b60006124d482612480565b6124de818561248b565b93506124ee818560208601612496565b80840191505092915050565b600061250682846124c9565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000612547601d83612029565b915061255282612511565b602082019050919050565b600060208201905081810360008301526125768161253a565b9050919050565b600081519050919050565b60006125938261257d565b61259d8185612029565b93506125ad818560208601612496565b6125b681611e1b565b840191505092915050565b600060208201905081810360008301526125db8184612588565b90509291505056fea26469706673582212206f618d2c2c1a3b88ad82df0b869d75b9c96fe92f40b773f060e70715c03c90b464736f6c634300080d0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000001d745b9c04aa2946a4e16862cfe4dd2469a28fa1000000000000000000000000fa9a50d76dd0ee66cb144fc4148faef62e43ceb4000000000000000000000000ff64e67e08c2fee12aef48f97dc685e38e21f40f
-----Decoded View---------------
Arg [0] : token_ (address): 0x1D745b9C04Aa2946A4e16862CFe4dd2469A28fA1
Arg [1] : burger_ (address): 0xfa9A50d76dd0EE66Cb144fC4148FAEF62e43CEb4
Arg [2] : minter_ (address): 0xfF64e67e08C2FEE12aEf48F97DC685e38E21f40F
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000001d745b9c04aa2946a4e16862cfe4dd2469a28fa1
Arg [1] : 000000000000000000000000fa9a50d76dd0ee66cb144fc4148faef62e43ceb4
Arg [2] : 000000000000000000000000ff64e67e08c2fee12aef48f97dc685e38e21f40f
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.