Overview
ETH Balance
ETH Value
$0.00Latest 25 from a total of 2,943 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Renounce Ownersh... | 190914400 | 680 days ago | IN | 0 ETH | 0.00000569 | ||||
| Buy | 151988671 | 798 days ago | IN | 0.06 ETH | 0.00003688 | ||||
| Buy | 151987235 | 798 days ago | IN | 0.06 ETH | 0.00003649 | ||||
| Buy | 151987222 | 798 days ago | IN | 0.06 ETH | 0.00003703 | ||||
| Buy | 151987199 | 798 days ago | IN | 0.06 ETH | 0.00003703 | ||||
| Buy | 151987072 | 798 days ago | IN | 0.06 ETH | 0.00003793 | ||||
| Buy | 151987058 | 798 days ago | IN | 0.06 ETH | 0.00003793 | ||||
| Buy | 151987042 | 798 days ago | IN | 0.06 ETH | 0.00003793 | ||||
| Buy | 151987029 | 798 days ago | IN | 0.06 ETH | 0.00003793 | ||||
| Buy | 151987024 | 798 days ago | IN | 0.06 ETH | 0.00003703 | ||||
| Buy | 151987011 | 798 days ago | IN | 0.06 ETH | 0.00003793 | ||||
| Buy | 151987009 | 798 days ago | IN | 0.06 ETH | 0.00003703 | ||||
| Buy | 151986996 | 798 days ago | IN | 0.06 ETH | 0.00003793 | ||||
| Buy | 151986992 | 798 days ago | IN | 0.06 ETH | 0.00003703 | ||||
| Buy | 151986979 | 798 days ago | IN | 0.06 ETH | 0.00003793 | ||||
| Buy | 151986973 | 798 days ago | IN | 0.06 ETH | 0.00003703 | ||||
| Buy | 151986971 | 798 days ago | IN | 0.06 ETH | 0.00003703 | ||||
| Buy | 151986957 | 798 days ago | IN | 0.06 ETH | 0.00003793 | ||||
| Buy | 151986947 | 798 days ago | IN | 0.06 ETH | 0.00003703 | ||||
| Buy | 151986946 | 798 days ago | IN | 0.06 ETH | 0.00003793 | ||||
| Buy | 151986938 | 798 days ago | IN | 0.06 ETH | 0.00003703 | ||||
| Buy | 151986937 | 798 days ago | IN | 0.06 ETH | 0.00003703 | ||||
| Buy | 151986931 | 798 days ago | IN | 0.06 ETH | 0.00003793 | ||||
| Buy | 151986924 | 798 days ago | IN | 0.06 ETH | 0.00003703 | ||||
| Buy | 151986921 | 798 days ago | IN | 0.06 ETH | 0.00003703 |
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986329 | 798 days ago | 0.06 ETH | ||||
| 151986328 | 798 days ago | 0.06 ETH | ||||
| 151986328 | 798 days ago | 0.06 ETH | ||||
| 151986328 | 798 days ago | 0.06 ETH | ||||
| 151986328 | 798 days ago | 0.06 ETH | ||||
| 151986328 | 798 days ago | 0.06 ETH | ||||
| 151986328 | 798 days ago | 0.06 ETH | ||||
| 151986328 | 798 days ago | 0.06 ETH | ||||
| 151986328 | 798 days ago | 0.06 ETH | ||||
| 151986328 | 798 days ago | 0.06 ETH |
Cross-Chain Transactions
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
interface NFTContract {
function buyMint(address to,uint256 tokenId,string calldata content) external;
}
contract SeraphBlindBox is Context, Ownable, ReentrancyGuard{
event Buy(
address sender,
uint256 boxIndex,
uint256 buyCount,
uint256 feeAmount,
address feeAddress
);
event Withdraw(
address sender,
address reciver,
uint256 amount
);
event WithdrawERC20(
address sender,
address reciver,
uint256 amount,
IERC20 token
);
struct BlindBox {
string[] contents;
uint256 total;
uint256 price;
uint256 purchaseLimit2;
}
struct BoxInfo {
uint256 remain;
uint256 total;
uint256 price;
uint256 purchaseLimit1;
uint256 purchaseCount1;
uint256 purchaseLimit2;
uint256 purchaseCount2;
}
uint256 private tokenId = 1000;
NFTContract public nft;
address payable public feeAddress;
uint256 private endSaleTime;
uint256 private commonSaleTime;
uint256 private whitelistSaleTime;
uint256 public blindBoxTypeCount;
mapping(uint256 => BlindBox) private blindBoxMap;
mapping(address => mapping(uint256 => uint256)) private purchaseLimit1;
mapping(address => mapping(uint256 => uint256)) private purchaseCount1;
mapping(address => bool) private allowPurchaseLimit2;
mapping(address => mapping(uint256 => uint256)) private purchaseCount2;
// baseinfo
function setStartTokenId(uint256 _tokenId) external onlyOwner {
tokenId = _tokenId;
}
function setNft(address _nft) external onlyOwner {
nft = NFTContract(_nft);
}
function setFeeAddress(address payable _feeAddress) external onlyOwner {
feeAddress = _feeAddress;
}
function setEndSaleTime(uint256 _endSaleTime) external onlyOwner {
endSaleTime = _endSaleTime;
}
function setCommonSaleTime(uint256 _commonSaleTime) external onlyOwner {
commonSaleTime = _commonSaleTime;
}
function setWhitelistSaleTime(uint256 _whitelistSaleTime) external onlyOwner {
whitelistSaleTime = _whitelistSaleTime;
}
function getSaleTime() external view returns (uint256, uint256, uint256) {
return (whitelistSaleTime, commonSaleTime, endSaleTime);
}
// blindbox
function setBlindBoxTypeCount(uint256 _count) external onlyOwner {
blindBoxTypeCount = _count;
}
function addContentsToBlindBox(uint256 _boxIndex, string[] memory _newContents) external onlyOwner {
BlindBox storage box = blindBoxMap[_boxIndex];
for (uint256 i = 0; i < _newContents.length; i++) {
box.contents.push(_newContents[i]);
}
box.total += _newContents.length;
}
function clearContents(uint256 _boxIndex) external onlyOwner {
delete blindBoxMap[_boxIndex].contents;
blindBoxMap[_boxIndex].total = 0;
}
function setBoxInfo(uint256 _boxIndex, uint256 _price, uint56 _purchaseLimit2) external onlyOwner {
BlindBox storage box = blindBoxMap[_boxIndex];
box.price = _price;
box.purchaseLimit2 = _purchaseLimit2;
}
function getInfo(address _user)external view returns (BoxInfo[] memory infoList) {
infoList = new BoxInfo[](blindBoxTypeCount);
for (uint256 i = 0; i < blindBoxTypeCount; i++) {
BlindBox storage box = blindBoxMap[i];
uint256 _purchaseLimit1 = purchaseLimit1[_user][i];
uint256 _purchaseCount1 = purchaseCount1[_user][i];
uint256 _purchaseLimit2 = box.purchaseLimit2;
if (allowPurchaseLimit2[_user] == false) {
_purchaseLimit2 = 0;
}
uint256 _purchaseCount2 = purchaseCount2[_user][i];
BoxInfo memory info = BoxInfo({
remain: box.contents.length,
total: box.total,
price: box.price,
purchaseLimit1: _purchaseLimit1,
purchaseCount1: _purchaseCount1,
purchaseLimit2: _purchaseLimit2,
purchaseCount2: _purchaseCount2
});
infoList[i] = info;
}
return infoList;
}
// whitelist
function updateWhitelist1(address[] calldata _users, uint[] calldata _nums, uint _boxIndex) external onlyOwner {
require(_users.length == _nums.length, "The array length is different");
for (uint256 i = 0; i < _users.length; i++) {
purchaseLimit1[_users[i]][_boxIndex] = _nums[i];
}
}
function updateWhitelist2(address[] calldata _users, bool status) external onlyOwner {
for (uint256 i = 0; i < _users.length; i++) {
allowPurchaseLimit2[_users[i]] = status;
}
}
// buy
function buy(uint256 _boxIndex, uint256 _num) external payable notFromContract nonReentrant{
// Check end sale time
require(block.timestamp <= endSaleTime, "Sale has ended");
// Check whitelist sale time
require(block.timestamp >= whitelistSaleTime, "Whitelist sale has not started");
// Check sale count
require(_num > 0, "Number must be > 0");
BlindBox storage box = blindBoxMap[_boxIndex];
require(box.contents.length >= _num, "Not enough boxes left");
// Check purchase limit
if (block.timestamp < commonSaleTime) {
uint256 _purchaseCount1 = purchaseCount1[msg.sender][_boxIndex] + _num;
require(_purchaseCount1 <= purchaseLimit1[msg.sender][_boxIndex], "Purchase limit exceeded");
purchaseCount1[msg.sender][_boxIndex] = _purchaseCount1;
} else {
require(allowPurchaseLimit2[msg.sender], "Only whitelists are allowed");
uint256 _purchaseCount2 = purchaseCount2[msg.sender][_boxIndex] + _num;
require(_purchaseCount2 <= box.purchaseLimit2, "Purchase limit exceeded");
purchaseCount2[msg.sender][_boxIndex] = _purchaseCount2;
}
// Check price
require(msg.value >= box.price * _num, "Insufficient funds");
// mint NFTs
for (uint256 i = 0; i < _num; i++) {
// Randomly choose content
uint index = uint(keccak256(abi.encodePacked(block.timestamp, msg.sender))) % box.contents.length;
string memory content = box.contents[index];
if (index != box.contents.length - 1) {
box.contents[index] = box.contents[box.contents.length - 1];
}
box.contents.pop();
nft.buyMint(msg.sender, tokenId, content);
tokenId++;
}
// Send fee to feeAddress
if (feeAddress != address(0)) {
feeAddress.transfer(msg.value);
emit Buy(msg.sender, _boxIndex, _num, msg.value, feeAddress);
} else {
emit Buy(msg.sender, _boxIndex, _num, msg.value, address(this));
}
}
receive() external payable {
}
function withdrawERC20(address payable _receiver, uint256 _amount, IERC20 _token) external onlyOwner {
_token.transfer(_receiver, _amount);
emit WithdrawERC20(msg.sender, _receiver, _amount, _token);
}
function withdraw(address payable _receiver) external onlyOwner {
uint amount = address(this).balance;
payable(_receiver).transfer(amount);
emit Withdraw(msg.sender, _receiver, amount);
}
function isContract(address _addr) internal view returns (bool) {
uint32 size;
assembly {
size := extcodesize(_addr)
}
return (size > 0);
}
modifier notFromContract() {
require(!isContract(msg.sender), "Contracts are not allowed to call this function");
_;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
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.9.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;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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 (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.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
import "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"boxIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"buyCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"feeAddress","type":"address"}],"name":"Buy","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":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"reciver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"reciver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"WithdrawERC20","type":"event"},{"inputs":[{"internalType":"uint256","name":"_boxIndex","type":"uint256"},{"internalType":"string[]","name":"_newContents","type":"string[]"}],"name":"addContentsToBlindBox","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"blindBoxTypeCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_boxIndex","type":"uint256"},{"internalType":"uint256","name":"_num","type":"uint256"}],"name":"buy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_boxIndex","type":"uint256"}],"name":"clearContents","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getInfo","outputs":[{"components":[{"internalType":"uint256","name":"remain","type":"uint256"},{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"purchaseLimit1","type":"uint256"},{"internalType":"uint256","name":"purchaseCount1","type":"uint256"},{"internalType":"uint256","name":"purchaseLimit2","type":"uint256"},{"internalType":"uint256","name":"purchaseCount2","type":"uint256"}],"internalType":"struct SeraphBlindBox.BoxInfo[]","name":"infoList","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSaleTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nft","outputs":[{"internalType":"contract NFTContract","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"setBlindBoxTypeCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_boxIndex","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"uint56","name":"_purchaseLimit2","type":"uint56"}],"name":"setBoxInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_commonSaleTime","type":"uint256"}],"name":"setCommonSaleTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_endSaleTime","type":"uint256"}],"name":"setEndSaleTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_feeAddress","type":"address"}],"name":"setFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nft","type":"address"}],"name":"setNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"setStartTokenId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_whitelistSaleTime","type":"uint256"}],"name":"setWhitelistSaleTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_users","type":"address[]"},{"internalType":"uint256[]","name":"_nums","type":"uint256[]"},{"internalType":"uint256","name":"_boxIndex","type":"uint256"}],"name":"updateWhitelist1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_users","type":"address[]"},{"internalType":"bool","name":"status","type":"bool"}],"name":"updateWhitelist2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_receiver","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"contract IERC20","name":"_token","type":"address"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60806040526103e860025534801561001657600080fd5b5061002033610029565b60018055610079565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611ada806100886000396000f3fe6080604052600436106101445760003560e01c80636f68fffd116100b6578063b9a28c2c1161006f578063b9a28c2c14610382578063cbf21fe4146103a6578063d6febde8146103d7578063f2fde38b146103ea578063f3c133871461040a578063ffdd5cf11461042a57600080fd5b80636f68fffd146102cf578063715018a6146102ef5780638705fcd4146103045780638da5cb5b14610324578063a2262e2814610342578063afdea6c21461036257600080fd5b806347ccca021161010857806347ccca021461020f57806351cff8d91461022f57806356c00e1f1461024f5780635d507d1e1461026f5780635fc3ea0b1461028f57806369ea8db3146102af57600080fd5b80632b1c3c95146101505780632c50d2f3146101725780632dfd8fae146101925780633025dcff146101b257806341275358146101d257600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b5061017061016b366004611398565b610457565b005b34801561017e57600080fd5b5061017061018d366004611516565b6104ea565b34801561019e57600080fd5b506101706101ad36600461156d565b610569565b3480156101be57600080fd5b506101706101cd366004611586565b610576565b3480156101de57600080fd5b506004546101f2906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561021b57600080fd5b506003546101f2906001600160a01b031681565b34801561023b57600080fd5b5061017061024a3660046115d5565b6105a8565b34801561025b57600080fd5b5061017061026a3660046115f9565b610636565b34801561027b57600080fd5b5061017061028a36600461156d565b610722565b34801561029b57600080fd5b506101706102aa36600461166d565b61072f565b3480156102bb57600080fd5b506101706102ca36600461156d565b610800565b3480156102db57600080fd5b506101706102ea36600461156d565b61080d565b3480156102fb57600080fd5b5061017061081a565b34801561031057600080fd5b5061017061031f3660046115d5565b61082e565b34801561033057600080fd5b506000546001600160a01b03166101f2565b34801561034e57600080fd5b5061017061035d36600461156d565b610858565b34801561036e57600080fd5b5061017061037d36600461156d565b61088b565b34801561038e57600080fd5b5061039860085481565b604051908152602001610206565b3480156103b257600080fd5b5060075460065460055460408051938452602084019290925290820152606001610206565b6101706103e53660046116a4565b610898565b3480156103f657600080fd5b506101706104053660046115d5565b610f72565b34801561041657600080fd5b506101706104253660046115d5565b610feb565b34801561043657600080fd5b5061044a6104453660046115d5565b611015565b60405161020691906116c6565b61045f6111c0565b6000828152600960205260408120905b82518110156104ca578160000183828151811061048e5761048e611748565b602090810291909101810151825460018101845560009384529190922001906104b790826117dd565b50806104c2816118b3565b91505061046f565b5081518160010160008282546104e091906118cc565b9091555050505050565b6104f26111c0565b60005b828110156105635781600c600086868581811061051457610514611748565b905060200201602081019061052991906115d5565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061055b816118b3565b9150506104f5565b50505050565b6105716111c0565b600255565b61057e6111c0565b600092835260096020526040909220600281019190915566ffffffffffffff909116600390910155565b6105b06111c0565b60405147906001600160a01b0383169082156108fc029083906000818181858888f193505050501580156105e8573d6000803e3d6000fd5b50604080513381526001600160a01b03841660208201529081018290527f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9060600160405180910390a15050565b61063e6111c0565b8382146106925760405162461bcd60e51b815260206004820152601d60248201527f546865206172726179206c656e67746820697320646966666572656e7400000060448201526064015b60405180910390fd5b60005b8481101561071a578383828181106106af576106af611748565b90506020020135600a60008888858181106106cc576106cc611748565b90506020020160208101906106e191906115d5565b6001600160a01b031681526020808201929092526040908101600090812086825290925290205580610712816118b3565b915050610695565b505050505050565b61072a6111c0565b600655565b6107376111c0565b60405163a9059cbb60e01b81526001600160a01b0384811660048301526024820184905282169063a9059cbb906044016020604051808303816000875af1158015610786573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107aa91906118e5565b50604080513381526001600160a01b0385811660208301528183018590528316606082015290517f2bd644a15fee99cb48ef2254228e6f6d0f52e9920d48a196472816ea0304dd279181900360800190a1505050565b6108086111c0565b600855565b6108156111c0565b600555565b6108226111c0565b61082c600061121a565b565b6108366111c0565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6108606111c0565b6000818152600960205260408120610877916112c3565b600090815260096020526040812060010155565b6108936111c0565b600755565b333b63ffffffff16156109055760405162461bcd60e51b815260206004820152602f60248201527f436f6e74726163747320617265206e6f7420616c6c6f77656420746f2063616c60448201526e36103a3434b990333ab731ba34b7b760891b6064820152608401610689565b61090d61126a565b6005544211156109505760405162461bcd60e51b815260206004820152600e60248201526d14d85b19481a185cc8195b99195960921b6044820152606401610689565b6007544210156109a25760405162461bcd60e51b815260206004820152601e60248201527f57686974656c6973742073616c6520686173206e6f74207374617274656400006044820152606401610689565b600081116109e75760405162461bcd60e51b815260206004820152601260248201527104e756d626572206d757374206265203e20360741b6044820152606401610689565b60008281526009602052604090208054821115610a3e5760405162461bcd60e51b8152602060048201526015602482015274139bdd08195b9bdd59da08189bde195cc81b19599d605a1b6044820152606401610689565b600654421015610af557336000908152600b60209081526040808320868452909152812054610a6e9084906118cc565b336000908152600a60209081526040808320888452909152902054909150811115610ad55760405162461bcd60e51b8152602060048201526017602482015276141d5c98da185cd9481b1a5b5a5d08195e18d959591959604a1b6044820152606401610689565b336000908152600b60209081526040808320878452909152902055610be6565b336000908152600c602052604090205460ff16610b545760405162461bcd60e51b815260206004820152601b60248201527f4f6e6c792077686974656c697374732061726520616c6c6f77656400000000006044820152606401610689565b336000908152600d60209081526040808320868452909152812054610b7a9084906118cc565b90508160030154811115610bca5760405162461bcd60e51b8152602060048201526017602482015276141d5c98da185cd9481b1a5b5a5d08195e18d959591959604a1b6044820152606401610689565b336000908152600d602090815260408083208784529091529020555b818160020154610bf69190611902565b341015610c3a5760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b6044820152606401610689565b60005b82811015610e6d57815460408051426020808301919091523360601b6bffffffffffffffffffffffff1916828401528251603481840301815260549092019092528051910120600091610c8f91611919565b90506000836000018281548110610ca857610ca8611748565b906000526020600020018054610cbd9061175e565b80601f0160208091040260200160405190810160405280929190818152602001828054610ce99061175e565b8015610d365780601f10610d0b57610100808354040283529160200191610d36565b820191906000526020600020905b815481529060010190602001808311610d1957829003601f168201915b50508754939450610d4e9360019350915061193b9050565b8214610dab5783548490610d649060019061193b565b81548110610d7457610d74611748565b90600052602060002001846000018381548110610d9357610d93611748565b906000526020600020019081610da9919061194e565b505b8354849080610dbc57610dbc611a29565b600190038181906000526020600020016000610dd891906112e1565b905560035460025460405163e3ac610960e01b81526001600160a01b039092169163e3ac610991610e10913391908690600401611a3f565b600060405180830381600087803b158015610e2a57600080fd5b505af1158015610e3e573d6000803e3d6000fd5b505060028054925090506000610e53836118b3565b919050555050508080610e65906118b3565b915050610c3d565b506004546001600160a01b031615610f16576004546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015610eb8573d6000803e3d6000fd5b5060045460408051338152602081018690528082018590523460608201526001600160a01b039092166080830152517f678bff21967f2f3a09540ac4650c6827fff735b884ee0cede358697f4fbfaf849181900360a00190a1610f64565b60408051338152602081018590529081018390523460608201523060808201527f678bff21967f2f3a09540ac4650c6827fff735b884ee0cede358697f4fbfaf849060a00160405180910390a15b50610f6e60018055565b5050565b610f7a6111c0565b6001600160a01b038116610fdf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610689565b610fe88161121a565b50565b610ff36111c0565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b606060085467ffffffffffffffff81111561103257611032611351565b6040519080825280602002602001820160405280156110a357816020015b6110906040518060e00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001906001900390816110505790505b50905060005b6008548110156111ba5760008181526009602090815260408083206001600160a01b038716808552600a8452828520868652845282852054818652600b85528386208787528552838620546003840154928752600c909552928520549194929392909160ff161515900361111b575060005b6001600160a01b0387166000908152600d6020908152604080832088845282529182902054825160e08101845287548152600188015492810192909252600287015492820192909252606081018590526080810184905260a0810183905260c081018290528751819089908990811061119657611196611748565b602002602001018190525050505050505080806111b2906118b3565b9150506110a9565b50919050565b6000546001600160a01b0316331461082c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610689565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6002600154036112bc5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610689565b6002600155565b5080546000825590600052602060002090810190610fe8919061131b565b5080546112ed9061175e565b6000825580601f106112fd575050565b601f016020900490600052602060002090810190610fe8919061133c565b8082111561133857600061132f82826112e1565b5060010161131b565b5090565b5b80821115611338576000815560010161133d565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561139057611390611351565b604052919050565b60008060408084860312156113ac57600080fd5b8335925060208085013567ffffffffffffffff808211156113cc57600080fd5b8187019150601f88818401126113e157600080fd5b8235828111156113f3576113f3611351565b8060051b611402868201611367565b918252848101860191868101908c84111561141c57600080fd5b87870192505b838310156114a95782358681111561143a5760008081fd5b8701603f81018e1361144c5760008081fd5b888101358781111561146057611460611351565b611471818801601f19168b01611367565b8181528f8c8385010111156114865760008081fd5b818c84018c83013760009181018b01919091528352509187019190870190611422565b8099505050505050505050509250929050565b60008083601f8401126114ce57600080fd5b50813567ffffffffffffffff8111156114e657600080fd5b6020830191508360208260051b850101111561150157600080fd5b9250929050565b8015158114610fe857600080fd5b60008060006040848603121561152b57600080fd5b833567ffffffffffffffff81111561154257600080fd5b61154e868287016114bc565b909450925050602084013561156281611508565b809150509250925092565b60006020828403121561157f57600080fd5b5035919050565b60008060006060848603121561159b57600080fd5b8335925060208401359150604084013566ffffffffffffff8116811461156257600080fd5b6001600160a01b0381168114610fe857600080fd5b6000602082840312156115e757600080fd5b81356115f2816115c0565b9392505050565b60008060008060006060868803121561161157600080fd5b853567ffffffffffffffff8082111561162957600080fd5b61163589838a016114bc565b9097509550602088013591508082111561164e57600080fd5b5061165b888289016114bc565b96999598509660400135949350505050565b60008060006060848603121561168257600080fd5b833561168d816115c0565b9250602084013591506040840135611562816115c0565b600080604083850312156116b757600080fd5b50508035926020909101359150565b602080825282518282018190526000919060409081850190868401855b8281101561173b5781518051855286810151878601528581015186860152606080820151908601526080808201519086015260a0808201519086015260c0908101519085015260e090930192908501906001016116e3565b5091979650505050505050565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061177257607f821691505b6020821081036111ba57634e487b7160e01b600052602260045260246000fd5b601f8211156117d857600081815260208120601f850160051c810160208610156117b95750805b601f850160051c820191505b8181101561071a578281556001016117c5565b505050565b815167ffffffffffffffff8111156117f7576117f7611351565b61180b81611805845461175e565b84611792565b602080601f83116001811461184057600084156118285750858301515b600019600386901b1c1916600185901b17855561071a565b600085815260208120601f198616915b8281101561186f57888601518255948401946001909101908401611850565b508582101561188d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b6000600182016118c5576118c561189d565b5060010190565b808201808211156118df576118df61189d565b92915050565b6000602082840312156118f757600080fd5b81516115f281611508565b80820281158282048414176118df576118df61189d565b60008261193657634e487b7160e01b600052601260045260246000fd5b500690565b818103818111156118df576118df61189d565b818103611959575050565b611963825461175e565b67ffffffffffffffff81111561197b5761197b611351565b61198981611805845461175e565b6000601f8211600181146119bd57600083156119a55750848201545b600019600385901b1c1916600184901b178455611a22565b600085815260209020601f19841690600086815260209020845b838110156119f757828601548255600195860195909101906020016119d7565b5085831015611a155781850154600019600388901b60f8161c191681555b50505060018360011b0184555b5050505050565b634e487b7160e01b600052603160045260246000fd5b60018060a01b038416815260006020848184015260606040840152835180606085015260005b81811015611a8157858101830151858201608001528201611a65565b506000608082860101526080601f19601f8301168501019250505094935050505056fea26469706673582212207cc7ad41dd81e2338d282dcfe60d8f0581dd71111eb7beaa9413a8d1852a6c9a64736f6c63430008110033
Deployed Bytecode
0x6080604052600436106101445760003560e01c80636f68fffd116100b6578063b9a28c2c1161006f578063b9a28c2c14610382578063cbf21fe4146103a6578063d6febde8146103d7578063f2fde38b146103ea578063f3c133871461040a578063ffdd5cf11461042a57600080fd5b80636f68fffd146102cf578063715018a6146102ef5780638705fcd4146103045780638da5cb5b14610324578063a2262e2814610342578063afdea6c21461036257600080fd5b806347ccca021161010857806347ccca021461020f57806351cff8d91461022f57806356c00e1f1461024f5780635d507d1e1461026f5780635fc3ea0b1461028f57806369ea8db3146102af57600080fd5b80632b1c3c95146101505780632c50d2f3146101725780632dfd8fae146101925780633025dcff146101b257806341275358146101d257600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b5061017061016b366004611398565b610457565b005b34801561017e57600080fd5b5061017061018d366004611516565b6104ea565b34801561019e57600080fd5b506101706101ad36600461156d565b610569565b3480156101be57600080fd5b506101706101cd366004611586565b610576565b3480156101de57600080fd5b506004546101f2906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561021b57600080fd5b506003546101f2906001600160a01b031681565b34801561023b57600080fd5b5061017061024a3660046115d5565b6105a8565b34801561025b57600080fd5b5061017061026a3660046115f9565b610636565b34801561027b57600080fd5b5061017061028a36600461156d565b610722565b34801561029b57600080fd5b506101706102aa36600461166d565b61072f565b3480156102bb57600080fd5b506101706102ca36600461156d565b610800565b3480156102db57600080fd5b506101706102ea36600461156d565b61080d565b3480156102fb57600080fd5b5061017061081a565b34801561031057600080fd5b5061017061031f3660046115d5565b61082e565b34801561033057600080fd5b506000546001600160a01b03166101f2565b34801561034e57600080fd5b5061017061035d36600461156d565b610858565b34801561036e57600080fd5b5061017061037d36600461156d565b61088b565b34801561038e57600080fd5b5061039860085481565b604051908152602001610206565b3480156103b257600080fd5b5060075460065460055460408051938452602084019290925290820152606001610206565b6101706103e53660046116a4565b610898565b3480156103f657600080fd5b506101706104053660046115d5565b610f72565b34801561041657600080fd5b506101706104253660046115d5565b610feb565b34801561043657600080fd5b5061044a6104453660046115d5565b611015565b60405161020691906116c6565b61045f6111c0565b6000828152600960205260408120905b82518110156104ca578160000183828151811061048e5761048e611748565b602090810291909101810151825460018101845560009384529190922001906104b790826117dd565b50806104c2816118b3565b91505061046f565b5081518160010160008282546104e091906118cc565b9091555050505050565b6104f26111c0565b60005b828110156105635781600c600086868581811061051457610514611748565b905060200201602081019061052991906115d5565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061055b816118b3565b9150506104f5565b50505050565b6105716111c0565b600255565b61057e6111c0565b600092835260096020526040909220600281019190915566ffffffffffffff909116600390910155565b6105b06111c0565b60405147906001600160a01b0383169082156108fc029083906000818181858888f193505050501580156105e8573d6000803e3d6000fd5b50604080513381526001600160a01b03841660208201529081018290527f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9060600160405180910390a15050565b61063e6111c0565b8382146106925760405162461bcd60e51b815260206004820152601d60248201527f546865206172726179206c656e67746820697320646966666572656e7400000060448201526064015b60405180910390fd5b60005b8481101561071a578383828181106106af576106af611748565b90506020020135600a60008888858181106106cc576106cc611748565b90506020020160208101906106e191906115d5565b6001600160a01b031681526020808201929092526040908101600090812086825290925290205580610712816118b3565b915050610695565b505050505050565b61072a6111c0565b600655565b6107376111c0565b60405163a9059cbb60e01b81526001600160a01b0384811660048301526024820184905282169063a9059cbb906044016020604051808303816000875af1158015610786573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107aa91906118e5565b50604080513381526001600160a01b0385811660208301528183018590528316606082015290517f2bd644a15fee99cb48ef2254228e6f6d0f52e9920d48a196472816ea0304dd279181900360800190a1505050565b6108086111c0565b600855565b6108156111c0565b600555565b6108226111c0565b61082c600061121a565b565b6108366111c0565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6108606111c0565b6000818152600960205260408120610877916112c3565b600090815260096020526040812060010155565b6108936111c0565b600755565b333b63ffffffff16156109055760405162461bcd60e51b815260206004820152602f60248201527f436f6e74726163747320617265206e6f7420616c6c6f77656420746f2063616c60448201526e36103a3434b990333ab731ba34b7b760891b6064820152608401610689565b61090d61126a565b6005544211156109505760405162461bcd60e51b815260206004820152600e60248201526d14d85b19481a185cc8195b99195960921b6044820152606401610689565b6007544210156109a25760405162461bcd60e51b815260206004820152601e60248201527f57686974656c6973742073616c6520686173206e6f74207374617274656400006044820152606401610689565b600081116109e75760405162461bcd60e51b815260206004820152601260248201527104e756d626572206d757374206265203e20360741b6044820152606401610689565b60008281526009602052604090208054821115610a3e5760405162461bcd60e51b8152602060048201526015602482015274139bdd08195b9bdd59da08189bde195cc81b19599d605a1b6044820152606401610689565b600654421015610af557336000908152600b60209081526040808320868452909152812054610a6e9084906118cc565b336000908152600a60209081526040808320888452909152902054909150811115610ad55760405162461bcd60e51b8152602060048201526017602482015276141d5c98da185cd9481b1a5b5a5d08195e18d959591959604a1b6044820152606401610689565b336000908152600b60209081526040808320878452909152902055610be6565b336000908152600c602052604090205460ff16610b545760405162461bcd60e51b815260206004820152601b60248201527f4f6e6c792077686974656c697374732061726520616c6c6f77656400000000006044820152606401610689565b336000908152600d60209081526040808320868452909152812054610b7a9084906118cc565b90508160030154811115610bca5760405162461bcd60e51b8152602060048201526017602482015276141d5c98da185cd9481b1a5b5a5d08195e18d959591959604a1b6044820152606401610689565b336000908152600d602090815260408083208784529091529020555b818160020154610bf69190611902565b341015610c3a5760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b6044820152606401610689565b60005b82811015610e6d57815460408051426020808301919091523360601b6bffffffffffffffffffffffff1916828401528251603481840301815260549092019092528051910120600091610c8f91611919565b90506000836000018281548110610ca857610ca8611748565b906000526020600020018054610cbd9061175e565b80601f0160208091040260200160405190810160405280929190818152602001828054610ce99061175e565b8015610d365780601f10610d0b57610100808354040283529160200191610d36565b820191906000526020600020905b815481529060010190602001808311610d1957829003601f168201915b50508754939450610d4e9360019350915061193b9050565b8214610dab5783548490610d649060019061193b565b81548110610d7457610d74611748565b90600052602060002001846000018381548110610d9357610d93611748565b906000526020600020019081610da9919061194e565b505b8354849080610dbc57610dbc611a29565b600190038181906000526020600020016000610dd891906112e1565b905560035460025460405163e3ac610960e01b81526001600160a01b039092169163e3ac610991610e10913391908690600401611a3f565b600060405180830381600087803b158015610e2a57600080fd5b505af1158015610e3e573d6000803e3d6000fd5b505060028054925090506000610e53836118b3565b919050555050508080610e65906118b3565b915050610c3d565b506004546001600160a01b031615610f16576004546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015610eb8573d6000803e3d6000fd5b5060045460408051338152602081018690528082018590523460608201526001600160a01b039092166080830152517f678bff21967f2f3a09540ac4650c6827fff735b884ee0cede358697f4fbfaf849181900360a00190a1610f64565b60408051338152602081018590529081018390523460608201523060808201527f678bff21967f2f3a09540ac4650c6827fff735b884ee0cede358697f4fbfaf849060a00160405180910390a15b50610f6e60018055565b5050565b610f7a6111c0565b6001600160a01b038116610fdf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610689565b610fe88161121a565b50565b610ff36111c0565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b606060085467ffffffffffffffff81111561103257611032611351565b6040519080825280602002602001820160405280156110a357816020015b6110906040518060e00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001906001900390816110505790505b50905060005b6008548110156111ba5760008181526009602090815260408083206001600160a01b038716808552600a8452828520868652845282852054818652600b85528386208787528552838620546003840154928752600c909552928520549194929392909160ff161515900361111b575060005b6001600160a01b0387166000908152600d6020908152604080832088845282529182902054825160e08101845287548152600188015492810192909252600287015492820192909252606081018590526080810184905260a0810183905260c081018290528751819089908990811061119657611196611748565b602002602001018190525050505050505080806111b2906118b3565b9150506110a9565b50919050565b6000546001600160a01b0316331461082c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610689565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6002600154036112bc5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610689565b6002600155565b5080546000825590600052602060002090810190610fe8919061131b565b5080546112ed9061175e565b6000825580601f106112fd575050565b601f016020900490600052602060002090810190610fe8919061133c565b8082111561133857600061132f82826112e1565b5060010161131b565b5090565b5b80821115611338576000815560010161133d565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561139057611390611351565b604052919050565b60008060408084860312156113ac57600080fd5b8335925060208085013567ffffffffffffffff808211156113cc57600080fd5b8187019150601f88818401126113e157600080fd5b8235828111156113f3576113f3611351565b8060051b611402868201611367565b918252848101860191868101908c84111561141c57600080fd5b87870192505b838310156114a95782358681111561143a5760008081fd5b8701603f81018e1361144c5760008081fd5b888101358781111561146057611460611351565b611471818801601f19168b01611367565b8181528f8c8385010111156114865760008081fd5b818c84018c83013760009181018b01919091528352509187019190870190611422565b8099505050505050505050509250929050565b60008083601f8401126114ce57600080fd5b50813567ffffffffffffffff8111156114e657600080fd5b6020830191508360208260051b850101111561150157600080fd5b9250929050565b8015158114610fe857600080fd5b60008060006040848603121561152b57600080fd5b833567ffffffffffffffff81111561154257600080fd5b61154e868287016114bc565b909450925050602084013561156281611508565b809150509250925092565b60006020828403121561157f57600080fd5b5035919050565b60008060006060848603121561159b57600080fd5b8335925060208401359150604084013566ffffffffffffff8116811461156257600080fd5b6001600160a01b0381168114610fe857600080fd5b6000602082840312156115e757600080fd5b81356115f2816115c0565b9392505050565b60008060008060006060868803121561161157600080fd5b853567ffffffffffffffff8082111561162957600080fd5b61163589838a016114bc565b9097509550602088013591508082111561164e57600080fd5b5061165b888289016114bc565b96999598509660400135949350505050565b60008060006060848603121561168257600080fd5b833561168d816115c0565b9250602084013591506040840135611562816115c0565b600080604083850312156116b757600080fd5b50508035926020909101359150565b602080825282518282018190526000919060409081850190868401855b8281101561173b5781518051855286810151878601528581015186860152606080820151908601526080808201519086015260a0808201519086015260c0908101519085015260e090930192908501906001016116e3565b5091979650505050505050565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061177257607f821691505b6020821081036111ba57634e487b7160e01b600052602260045260246000fd5b601f8211156117d857600081815260208120601f850160051c810160208610156117b95750805b601f850160051c820191505b8181101561071a578281556001016117c5565b505050565b815167ffffffffffffffff8111156117f7576117f7611351565b61180b81611805845461175e565b84611792565b602080601f83116001811461184057600084156118285750858301515b600019600386901b1c1916600185901b17855561071a565b600085815260208120601f198616915b8281101561186f57888601518255948401946001909101908401611850565b508582101561188d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b6000600182016118c5576118c561189d565b5060010190565b808201808211156118df576118df61189d565b92915050565b6000602082840312156118f757600080fd5b81516115f281611508565b80820281158282048414176118df576118df61189d565b60008261193657634e487b7160e01b600052601260045260246000fd5b500690565b818103818111156118df576118df61189d565b818103611959575050565b611963825461175e565b67ffffffffffffffff81111561197b5761197b611351565b61198981611805845461175e565b6000601f8211600181146119bd57600083156119a55750848201545b600019600385901b1c1916600184901b178455611a22565b600085815260209020601f19841690600086815260209020845b838110156119f757828601548255600195860195909101906020016119d7565b5085831015611a155781850154600019600388901b60f8161c191681555b50505060018360011b0184555b5050505050565b634e487b7160e01b600052603160045260246000fd5b60018060a01b038416815260006020848184015260606040840152835180606085015260005b81811015611a8157858101830151858201608001528201611a65565b506000608082860101526080601f19601f8301168501019250505094935050505056fea26469706673582212207cc7ad41dd81e2338d282dcfe60d8f0581dd71111eb7beaa9413a8d1852a6c9a64736f6c63430008110033
Net Worth in USD
Net Worth in ETH
Token Allocations
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 100.00% | $2,860.58 | 0.6 | $1,716.35 |
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.