Source Code
Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 231 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Approve | 44000883 | 158 days ago | IN | 0 S | 0.00281306 | ||||
| Mint | 43939676 | 158 days ago | IN | 0 S | 0.01564203 | ||||
| Approve | 43864010 | 159 days ago | IN | 0 S | 0.00306819 | ||||
| Approve | 43863939 | 159 days ago | IN | 0 S | 0.00337444 | ||||
| Mint | 43863909 | 159 days ago | IN | 0 S | 0.01872084 | ||||
| Mint | 43863855 | 159 days ago | IN | 0 S | 0.01873884 | ||||
| Approve | 43862220 | 159 days ago | IN | 0 S | 0.00306768 | ||||
| Mint | 43862094 | 159 days ago | IN | 0 S | 0.0197973 | ||||
| Increase Lock | 43780755 | 159 days ago | IN | 0 S | 0.01034682 | ||||
| Mint | 43780583 | 159 days ago | IN | 0 S | 0.01815082 | ||||
| Approve | 43645844 | 160 days ago | IN | 0 S | 0.0029216 | ||||
| Mint | 43644460 | 160 days ago | IN | 0 S | 0.01781672 | ||||
| Mint | 43644043 | 160 days ago | IN | 0 S | 0.0182791 | ||||
| Mint | 43643587 | 160 days ago | IN | 0 S | 0.03828531 | ||||
| Mint | 43616226 | 160 days ago | IN | 0 S | 0.01906513 | ||||
| Approve | 43570934 | 161 days ago | IN | 0 S | 0.00260752 | ||||
| Safe Transfer Fr... | 43569078 | 161 days ago | IN | 0 S | 0.00279348 | ||||
| Approve | 43569051 | 161 days ago | IN | 0 S | 0.00337444 | ||||
| Safe Transfer Fr... | 43568167 | 161 days ago | IN | 0 S | 0.00288659 | ||||
| Approve | 43568141 | 161 days ago | IN | 0 S | 0.00316993 | ||||
| Safe Transfer Fr... | 43568101 | 161 days ago | IN | 0 S | 0.00279348 | ||||
| Approve | 43568082 | 161 days ago | IN | 0 S | 0.00281357 | ||||
| Approve | 43568049 | 161 days ago | IN | 0 S | 0.00314897 | ||||
| Approve | 43568001 | 161 days ago | IN | 0 S | 0.0030687 | ||||
| Mint | 43560745 | 161 days ago | IN | 0 S | 0.01748034 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
veGHOG
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
interface IVeGHOGStaking {
function onVeGHOGMinted(uint256 tokenId, uint256 amount) external;
function onVeGHOGIncreased(uint256 tokenId, uint256 addedAmount) external;
}
contract veGHOG is ERC721, Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
using Counters for Counters.Counter;
using Strings for uint256;
// Structs
struct VeNFT {
uint256 amount; // Amount of GHOG locked
uint256 lockTime; // When the GHOG was locked
uint8 fraction; // 0: Choir of Echoes, 1: Ember Covenant, 2: Silent Ledger
uint8 rarity; // 0: Base, 1: Normal, 2: Rare, 3: Super-rare
}
// Constants
uint256 public constant MAX_SUPPLY = 200;
uint256 public constant RARE_CAP = 30;
uint256 public constant SUPER_RARE_CAP = 50;
uint256 public constant EMBER_COVENANT_CAP = 67;
uint256 public constant SILENT_LEDGER_CAP = 66;
// State variables
IERC20 public ghog;
address public stakingContract;
Counters.Counter private _tokenIds;
mapping(uint256 => VeNFT) public veNFTs;
uint256 public rareCount;
uint256 public superRareCount;
uint256[3] public fractionCounts; // Counts for each fraction
// Events
event VeNFTMinted(address indexed owner, uint256 indexed tokenId, uint256 amount, uint8 fraction, uint8 rarity);
event GHOGLocked(address indexed owner, uint256 indexed tokenId, uint256 amount);
event LockIncreased(address indexed owner, uint256 indexed tokenId, uint256 oldAmount, uint256 newAmount, uint8 newRarity);
constructor(address _ghog) ERC721("Vote-escrowed GHOG", "veGHOG") {
ghog = IERC20(_ghog);
}
function setStakingContract(address _stakingContract) external onlyOwner {
require(_stakingContract != address(0), "Zero address");
stakingContract = _stakingContract;
}
// Internal functions
function _determineRarity(uint256 amount) internal pure returns (uint8) {
if (amount >= 100 ether) return 3; // Super-rare: 100+ GHOG
if (amount >= 50 ether) return 2; // Rare: 50-99 GHOG
if (amount >= 25 ether) return 1; // Normal: 25-49 GHOG
return 0; // Base: 2-24 GHOG
}
function _getRandomNumber(uint256 seed) internal view returns (uint256) {
return uint256(keccak256(abi.encodePacked(
block.timestamp,
block.prevrandao,
msg.sender,
seed
)));
}
function _determineFraction() internal returns (uint8) {
uint256 rand = _getRandomNumber(_tokenIds.current()) % 3;
// Check caps for each fraction
if (fractionCounts[1] >= EMBER_COVENANT_CAP) {
if (fractionCounts[2] >= SILENT_LEDGER_CAP) {
return 0; // Only Choir of Echoes available
}
rand = rand % 2 == 0 ? 0 : 2; // Choose between Choir and Silent
} else if (fractionCounts[2] >= SILENT_LEDGER_CAP) {
rand = rand % 2 == 0 ? 0 : 1; // Choose between Choir and Ember
}
fractionCounts[rand]++;
return uint8(rand);
}
// Public functions
function mint(uint256 amount) external nonReentrant {
require(_tokenIds.current() < MAX_SUPPLY, "Max supply reached");
require(amount >= 2 ether, "Must lock at least 2 GHOG");
require(stakingContract != address(0), "Staking contract not set");
uint8 rarity = _determineRarity(amount);
// Downgrade rarity if cap is reached
if (rarity == 3 && superRareCount >= SUPER_RARE_CAP) {
rarity = 2;
}
if (rarity == 2 && rareCount >= RARE_CAP) {
rarity = 1;
}
// You could add more downgrades if you ever want to cap Normal, but not needed here
// Now increment the count for the final rarity
if (rarity == 3) {
superRareCount++;
} else if (rarity == 2) {
rareCount++;
}
// Transfer GHOG directly to staking contract
ghog.safeTransferFrom(msg.sender, stakingContract, amount);
// Mint NFT
_tokenIds.increment();
uint256 newTokenId = _tokenIds.current();
_safeMint(msg.sender, newTokenId);
// Store NFT data
veNFTs[newTokenId] = VeNFT({
amount: amount,
lockTime: block.timestamp,
fraction: _determineFraction(),
rarity: rarity
});
// Notify staking contract
IVeGHOGStaking(stakingContract).onVeGHOGMinted(newTokenId, amount);
emit VeNFTMinted(msg.sender, newTokenId, amount, veNFTs[newTokenId].fraction, rarity);
}
function getVeNFT(uint256 tokenId) external view returns (VeNFT memory) {
require(_exists(tokenId), "Token does not exist");
return veNFTs[tokenId];
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "Token does not exist");
VeNFT memory nft = veNFTs[tokenId];
string memory fractionName;
string memory background;
string memory theme;
string memory baseImage = _generateImageURI(nft.fraction);
if (nft.fraction == 0) {
fractionName = "The Choir of Echoes";
background = "sky";
theme = "blue";
} else if (nft.fraction == 1) {
fractionName = "The Ember Covenant";
background = "flames";
theme = "red";
} else {
fractionName = "The Silent Ledger";
background = "darkness";
theme = "black";
}
string memory rarityName = nft.rarity == 3 ? "Super-Rare" :
nft.rarity == 2 ? "Rare" :
nft.rarity == 1 ? "Normal" : "Base";
string memory textColor = nft.fraction == 0 ? "#000000" : "#ffffff"; // Black for Choir of Echoes, white for others
string memory finalSvg = string(abi.encodePacked(
'<svg width="400" height="600" viewBox="0 0 400 600" xmlns="http://www.w3.org/2000/svg">',
'<defs>',
'<style>',
'@font-face {',
' font-family: "Orbitron";',
' src: url("https://fonts.gstatic.com/s/orbitron/v31/yMJMMIlzdpvBhQQL_SC3X9yhF25-T1nyGy6xpmIyXjU1pg.woff2") format("woff2");',
'}',
'</style>',
'<filter id="glow">',
'<feGaussianBlur stdDeviation="2" result="coloredBlur"/>',
'<feMerge>',
'<feMergeNode in="coloredBlur"/>',
'<feMergeNode in="SourceGraphic"/>',
'</feMerge>',
'</filter>',
'</defs>',
'<image href="', baseImage, '" width="400" height="600"/>',
'<text x="200" y="400" fill="', textColor, '" font-family="Orbitron, sans-serif" font-size="32" text-anchor="middle" filter="url(#glow)">',
fractionName,
'</text>',
'<text x="200" y="440" fill="', textColor, '" font-family="Orbitron, sans-serif" font-size="28" text-anchor="middle" filter="url(#glow)">',
rarityName,
'</text>',
'<text x="200" y="480" fill="', textColor, '" font-family="Orbitron, sans-serif" font-size="28" text-anchor="middle" filter="url(#glow)">',
(nft.amount / 1e18).toString(),
' GHOG Locked</text>',
'</svg>'
));
// Create the JSON metadata
string memory json = Base64.encode(bytes(string(abi.encodePacked(
'{',
'"name": "', fractionName, ' #', tokenId.toString(), '",',
'"description": "Hand of God veNFT - ', fractionName, '",',
'"image": "data:image/svg+xml;base64,', Base64.encode(bytes(finalSvg)), '",',
'"attributes": [',
'{',
'"trait_type": "Fraction",',
'"value": "', fractionName, '"',
'},',
'{',
'"trait_type": "Rarity",',
'"value": "', rarityName, '"',
'},',
'{',
'"trait_type": "GHOG Locked",',
'"value": "', (nft.amount / 1e18).toString(), ' GHOG"',
'},',
'{',
'"trait_type": "Background",',
'"value": "', background, '"',
'},',
'{',
'"trait_type": "Theme",',
'"value": "', theme, '"',
'}',
']',
'}'
))));
return string(abi.encodePacked("data:application/json;base64,", json));
}
function _generateImageURI(uint8 fraction) internal pure returns (string memory) {
string memory gateway = "https://ipfs.io/ipfs/";
// IPFS hashes for each fraction
if (fraction == 0) {
// Choir of Echoes (Blue theme)
return string(abi.encodePacked(gateway, "bafybeifgd47knkdykvfoveunv3fnqlvrsw5bunyhcfyunfxujwzjgy7ake"));
} else if (fraction == 1) {
// Ember Covenant (Red theme)
return string(abi.encodePacked(gateway, "bafkreicbvuucsfrf66qlqroxfxnclqhybn3d2aqyf6zvh6k244oapm2rqq"));
} else {
// Silent Ledger (Black theme)
return string(abi.encodePacked(gateway, "bafkreihkrix52iuuxgd3qest4drx6r3cfj5d226ihth4hkdfzje7v5ac7e"));
}
}
// View functions
function getTotalSupply() external view returns (uint256) {
return _tokenIds.current();
}
function getFractionCounts() external view returns (uint256[3] memory) {
return fractionCounts;
}
function increaseLock(uint256 tokenId, uint256 additionalAmount) external nonReentrant {
require(_exists(tokenId), "Token does not exist");
require(ownerOf(tokenId) == msg.sender || msg.sender == stakingContract, "Not token owner or staking contract");
require(additionalAmount > 0, "Amount must be greater than 0");
require(stakingContract != address(0), "Staking contract not set");
VeNFT storage nft = veNFTs[tokenId];
uint256 newAmount = nft.amount + additionalAmount;
uint8 newRarity = _determineRarity(newAmount);
uint8 currentRarity = nft.rarity;
if (newRarity > currentRarity) {
if (newRarity == 3) { // Upgrading to Super-rare
if (superRareCount < SUPER_RARE_CAP && currentRarity < 3) {
if (currentRarity == 2) rareCount--; // Decrement rareCount when upgrading from Rare
superRareCount++;
nft.rarity = newRarity;
}
} else if (newRarity == 2) { // Upgrading to Rare
if (rareCount < RARE_CAP) {
rareCount++;
nft.rarity = newRarity;
}
} else {
nft.rarity = newRarity;
}
}
if (msg.sender != stakingContract) {
ghog.safeTransferFrom(msg.sender, stakingContract, additionalAmount);
}
// Update NFT data
uint256 oldAmount = nft.amount;
nft.amount = newAmount;
// Notify staking contract
IVeGHOGStaking(stakingContract).onVeGHOGIncreased(tokenId, additionalAmount);
emit LockIncreased(msg.sender, tokenId, oldAmount, newAmount, nft.rarity);
}
function getUpgradeableRarityTiers(uint256 tokenId) external view returns (bool canUpgradeToRare, bool canUpgradeToSuperRare) {
require(_exists(tokenId), "Token does not exist");
VeNFT memory nft = veNFTs[tokenId];
// Check if can upgrade to Rare
canUpgradeToRare = nft.rarity < 2 && rareCount < RARE_CAP;
// Check if can upgrade to Super-rare (updated to match increaseLock logic)
canUpgradeToSuperRare = nft.rarity < 3 && superRareCount < SUPER_RARE_CAP;
}
function burn(uint256 tokenId) external {
require(msg.sender == stakingContract, "Only staking contract can burn");
// Decrement rarity counters before burning
VeNFT memory nft = veNFTs[tokenId];
if (nft.rarity == 3) {
superRareCount--;
} else if (nft.rarity == 2) {
rareCount--;
}
_burn(tokenId);
delete veNFTs[tokenId];
}
}
// Base64 encoding library
library Base64 {
string internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
function encode(bytes memory data) internal pure returns (string memory) {
if (data.length == 0) return "";
// Load the table into memory
string memory table = TABLE;
// Encoding takes 3 bytes chunks of binary data from `bytes` data parameter
// and split into 4 numbers of 6 bits.
// The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up
// - `data.length + 2` -> Round up
// - `/ 3` -> Number of 3-bytes chunks
// - `4 *` -> 4 characters for each chunk
string memory result = new string(4 * ((data.length + 2) / 3));
assembly {
// Prepare the lookup table (skip the first "length" byte)
let tablePtr := add(table, 1)
// Prepare result pointer, jump over length
let resultPtr := add(result, 32)
// Run over the input, 3 bytes at a time
for {
let dataPtr := data
let endPtr := add(data, mload(data))
} lt(dataPtr, endPtr) {
} {
// Advance 3 bytes
dataPtr := add(dataPtr, 3)
let input := mload(dataPtr)
mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
resultPtr := add(resultPtr, 1)
mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
resultPtr := add(resultPtr, 1)
mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))
resultPtr := add(resultPtr, 1)
mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))
resultPtr := add(resultPtr, 1)
}
// Handle padding
switch mod(mload(data), 3)
case 1 {
mstore8(sub(resultPtr, 1), 0x3d)
mstore8(sub(resultPtr, 2), 0x3d)
}
case 2 {
mstore8(sub(resultPtr, 1), 0x3d)
}
}
return result;
}
}// 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.4) (token/ERC20/extensions/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.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
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].
*
* CAUTION: See Security Considerations above.
*/
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.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 (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/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;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
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));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
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");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
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");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// 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 cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: address zero is not a valid owner");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _ownerOf(tokenId);
require(owner != address(0), "ERC721: invalid token ID");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
_requireMinted(tokenId);
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not token owner or approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
_requireMinted(tokenId);
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
_safeTransfer(from, to, tokenId, data);
}
/**
* @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.
*
* `data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
*/
function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
return _owners[tokenId];
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _ownerOf(tokenId) != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId, 1);
// Check that tokenId was not minted by `_beforeTokenTransfer` hook
require(!_exists(tokenId), "ERC721: token already minted");
unchecked {
// Will not overflow unless all 2**256 token ids are minted to the same owner.
// Given that tokens are minted one by one, it is impossible in practice that
// this ever happens. Might change if we allow batch minting.
// The ERC fails to describe this case.
_balances[to] += 1;
}
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId, 1);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
* This is an internal function that does not check if the sender is authorized to operate on the token.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId, 1);
// Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
owner = ERC721.ownerOf(tokenId);
// Clear approvals
delete _tokenApprovals[tokenId];
unchecked {
// Cannot overflow, as that would require more tokens to be burned/transferred
// out than the owner initially received through minting and transferring in.
_balances[owner] -= 1;
}
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId, 1);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(address from, address to, uint256 tokenId) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId, 1);
// Check that tokenId was not transferred by `_beforeTokenTransfer` hook
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
// Clear approvals from the previous owner
delete _tokenApprovals[tokenId];
unchecked {
// `_balances[from]` cannot overflow for the same reason as described in `_burn`:
// `from`'s balance is the number of token held, which is at least one before the current
// transfer.
// `_balances[to]` could overflow in the conditions described in `_mint`. That would require
// all 2**256 token ids to be minted, which in practice is impossible.
_balances[from] -= 1;
_balances[to] += 1;
}
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId, 1);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits an {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Reverts if the `tokenId` has not been minted yet.
*/
function _requireMinted(uint256 tokenId) internal view virtual {
require(_exists(tokenId), "ERC721: invalid token ID");
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
* used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
* - When `from` is zero, the tokens will be minted for `to`.
* - When `to` is zero, ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
* - `batchSize` is non-zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}
/**
* @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
* used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
* - When `from` is zero, the tokens were minted for `to`.
* - When `to` is zero, ``from``'s tokens were burned.
* - `from` and `to` are never both zero.
* - `batchSize` is non-zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}
/**
* @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
*
* WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant
* being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such
* that `ownerOf(tokenId)` is `a`.
*/
// solhint-disable-next-line func-name-mixedcase
function __unsafe_increaseBalance(address account, uint256 amount) internal {
_balances[account] += amount;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [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://consensys.net/diligence/blog/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.8.0/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 (last updated v4.9.4) (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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.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
},
"viaIR": true,
"debug": {
"revertStrings": "debug"
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_ghog","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"GHOGLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newAmount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"newRarity","type":"uint8"}],"name":"LockIncreased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"fraction","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"rarity","type":"uint8"}],"name":"VeNFTMinted","type":"event"},{"inputs":[],"name":"EMBER_COVENANT_CAP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RARE_CAP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SILENT_LEDGER_CAP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SUPER_RARE_CAP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"fractionCounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFractionCounts","outputs":[{"internalType":"uint256[3]","name":"","type":"uint256[3]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getUpgradeableRarityTiers","outputs":[{"internalType":"bool","name":"canUpgradeToRare","type":"bool"},{"internalType":"bool","name":"canUpgradeToSuperRare","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getVeNFT","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lockTime","type":"uint256"},{"internalType":"uint8","name":"fraction","type":"uint8"},{"internalType":"uint8","name":"rarity","type":"uint8"}],"internalType":"struct veGHOG.VeNFT","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ghog","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"additionalAmount","type":"uint256"}],"name":"increaseLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rareCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakingContract","type":"address"}],"name":"setStakingContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"superRareCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"veNFTs","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lockTime","type":"uint256"},{"internalType":"uint8","name":"fraction","type":"uint8"},{"internalType":"uint8","name":"rarity","type":"uint8"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608080604052346103fb57613c7a6020813803918261001d81610448565b9384928339810103126103ab57516001600160a01b038116908190036103a6576100476040610448565b906012825271566f74652d657363726f7765642047484f4760701b60208301526100716040610448565b6006815265766547484f4760d01b602082015282519091906001600160401b0381116102b157600054600181811c9116801561039c575b602082101461029157601f8111610338575b506020601f82116001146102d257819293946000926102c7575b50508160011b916000199060031b1c1916176000555b81516001600160401b0381116102b157600154600181811c911680156102a7575b602082101461029157601f811161022c575b50602092601f82116001146101c757928192936000926101bc575b50508160011b916000199060031b1c1916176001555b60068054336001600160a01b0319821681179092556040519291906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a36001600755600880546001600160a01b03191691909117905561380c908161046e8239f35b015190508380610138565b601f198216936001600052806000209160005b86811061021457508360019596106101fb575b505050811b0160015561014e565b015160001960f88460031b161c191690558380806101ed565b919260206001819286850151815501940192016101da565b60016000527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6601f830160051c81019160208410610287575b601f0160051c01905b81811061027b575061011d565b6000815560010161026e565b9091508190610265565b634e487b7160e01b600052602260045260246000fd5b90607f169061010b565b634e487b7160e01b600052604160045260246000fd5b0151905084806100d4565b601f1982169060008052806000209160005b81811061032057509583600195969710610307575b505050811b016000556100ea565b015160001960f88460031b161c191690558480806102f9565b9192602060018192868b0151815501940192016102e4565b600080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563601f830160051c81019160208410610392575b601f0160051c01905b81811061038657506100ba565b60008155600101610379565b9091508190610370565b90607f16906100a8565b600080fd5b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a207475706c65206461746120746f6f2073686f6044820152611c9d60f21b6064820152608490fd5b62461bcd60e51b815260206004820152602260248201527f45746865722073656e7420746f206e6f6e2d70617961626c652066756e63746960448201526137b760f11b6064820152608490fd5b6040519190601f01601f191682016001600160401b038111838210176102b15760405256fe6080604052600436106120a55760003560e01c806301ffc9a71461023c57806306fdde0314610237578063081812fc146102325780630890c9d51461022d578063095ea7b314610228578063134841061461022357806313b9e6a41461021e57806318f2877c1461021957806323b872dd146102145780632f4231441461020f57806332cb6b0c1461020a57806342842e0e1461020557806342966c681461020057806349049f1e146101fb5780635e70a6dc146101f657806362ab7da3146101f15780636352211e146101ec5780636492372f146101e757806370a08231146101e2578063715018a6146101dd5780638da5cb5b146101d857806395d89b41146101d35780639dd373b9146101ce578063a0712d68146101c9578063a22cb465146101c4578063b88d4fde146101bf578063c4e41b22146101ba578063c87b56dd146101b5578063cca187f9146101b0578063d678672c146101ab578063e04af1e2146101a6578063e733a29c146101a1578063e985e9c51461019c578063ee99205c146101975763f2fde38b036120a557611fd8565b611faf565b611f52565b611f34565b611f16565b611efa565b611ea9565b611538565b61151a565b611393565b611221565b610fd3565b610f52565b610e9a565b610e71565b610e14565b610d73565b610ce6565b610cc8565b610cac565b6109c2565b6108fc565b610839565b61080f565b6107f3565b61071f565b6106f6565b610685565b610641565b610618565b610542565b6104fa565b6104ca565b6103d7565b6102f8565b60405162461bcd60e51b815260206004820152602260248201527f45746865722073656e7420746f206e6f6e2d70617961626c652066756e63746960448201526137b760f11b6064820152608490fd5b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a207475706c65206461746120746f6f2073686f6044820152611c9d60f21b6064820152608490fd5b6001600160e01b03198116036102f357565b600080fd5b3461036b576020366003190112610366576020600435610317816102e1565b63ffffffff60e01b166380ac58cd60e01b8114908115610355575b8115610344575b506040519015158152f35b6301ffc9a760e01b14905038610339565b635b5e139f60e01b81149150610332565b610291565b610241565b600091031261036657565b60005b83811061038e5750506000910152565b818101518382015260200161037e565b906020916103b78151809281855285808601910161037b565b601f01601f1916010190565b9060206103d492818152019061039e565b90565b3461036b57600036600319011261036657604051600080548060011c90600181169081156104c0575b6020831082146104ac5782855260208501919081156104935750600114610442575b61043e8461043281860382611344565b604051918291826103c3565b0390f35b60008080529250907f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b81841061047f5750500161043282610422565b80548484015260209093019260010161046c565b60ff191682525090151560051b01905061043282610422565b634e487b7160e01b84526022600452602484fd5b91607f1691610400565b3461036b5760203660031901126103665760206104e8600435612108565b6040516001600160a01b039091168152f35b3461036b57600036600319011261036657602060405160428152f35b600435906001600160a01b03821682036102f357565b602435906001600160a01b03821682036102f357565b3461036b5760403660031901126103665761055b610516565b602435610567816124e1565b916001600160a01b0380841690821681146105c9576105999361059491331490811561059b575b50612146565b6128d3565b005b6001600160a01b0316600090815260056020908152604080832033845290915290205460ff1690503861058e565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b3461036b576000366003190112610366576008546040516001600160a01b039091168152602090f35b3461036b57600036600319011261036657602060405160438152f35b600381101561066f57600e0190600090565b634e487b7160e01b600052603260045260246000fd5b3461036b5760203660031901126103665760043560038110156102f3576106ad60209161065d565b90549060031b1c604051908152f35b6060906003190112610366576004356001600160a01b03811681036102f357906024356001600160a01b03811681036102f3579060443590565b3461036b57610599610707366106bc565b9161071a610715843361293f565b6121b8565b612a1b565b3461036b576020366003190112610366576004356000606060405161074381611323565b828152826020820152826040820152015261077b61077682600052600260205260018060a01b0360406000205416151590565b61221a565b600052600b60205261043e604060002060ff60026040519261079c84611323565b80548452600181015460208501520154818116604084015260081c16606082015260405191829182919091606060ff8160808401958051855260208101516020860152826040820151166040860152015116910152565b3461036b57600036600319011261036657602060405160c88152f35b3461036b57610599610820366106bc565b9060405192610830602085611344565b600084526125d3565b3461036b576020366003190112610366576105996108cb60043560095461086a906001600160a01b031633146122a8565b60ff610895606061088d61088885600052600b602052604060002090565b61225d565b015160ff1690565b16600381036108dd57506108b26108ad600d5461230a565b600d55565b6108bb81612b7e565b600052600b602052604060002090565b60026000918281558260018201550155565b6002036108b2576108f76108f2600c5461230a565b600c55565b6108b2565b3461036b57602036600319011261036657600435600081815260026020526040902054610933906001600160a01b0316151561221a565b600052600b60205260ff61097e606060406000208360026040519261095784611323565b80548452600181015460208501520154818116604084015260081c16918291015260ff1690565b166002811090816109b5575b60031190816109a7575b6040805191151582529115156020820152f35b90506032600d541090610994565b600c54601e11915061098a565b3461036b576040366003190112610366576004356024356109e1612c17565b600082815260026020526040902054610a04906001600160a01b0316151561221a565b610a0d826124e1565b6001600160a01b031633148015610c89575b610a289061231c565b610a33811515612374565b600954610a4e906001600160a01b039081165b1615156123c0565b610a6282600052600b602052604060002090565b90610a6e81835461241a565b610a7781612c6d565b6002840190610a94610a8e835460ff9060081c1690565b60ff1690565b9060ff8116828111610bc3575b50506009546001600160a01b031690508333829003610ba4575b5050835493829055600954610ae690610ada906001600160a01b031681565b6001600160a01b031690565b803b15610b9f576040516313a0360360e11b81526004810187905260248101949094526000908490604490829084905af1908115610b9a577f08ed8d4346150b36f813b174a1356c12cc5247db5b1679b31726b03a39593a6693610b5492610b7f575b505460081c60ff1690565b60408051948552602085019290925260ff1690830152339180606081015b0390a36105996001600755565b80610b8e6000610b9493611344565b80610370565b38610b49565b612489565b612436565b600854610bbc929033906001600160a01b0316612cb5565b3883610abb565b60038103610c3c57506032600d541080610c32575b610be8575b50505b388080610aa1565b6002610c189214610c1f575b610c026108ad600d54612427565b825461ff00191660089190911b61ff0016178255565b3880610bdd565b610c2d6108f2600c5461230a565b610bf4565b5060038210610bd8565b909150600203610c7057600c5490601e8210610c5a575b5050610be0565b610c026108f2610c6993612427565b3880610c53565b815461ff00191660089190911b61ff0016178155610be0565b50600954610a2890610ca3906001600160a01b0316610ada565b33149050610a1f565b3461036b576000366003190112610366576020604051601e8152f35b3461036b5760203660031901126103665760206104e86004356124e1565b3461036b57600036600319011261036657606080604051610d078282611344565b369037604051600e6000825b60038210610d5d578385610d278183611344565b6040519182918201906000835b60038210610d43575050500390f35b825181528594506020928301926001929092019101610d34565b6001602081928554815201930191019091610d13565b3461036b576020366003190112610366576001600160a01b03610d94610516565b168015610dbd57600052600360205261043e604060002054604051918291829190602083019252565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608490fd5b3461036b57600036600319011261036657610e2d612d89565b600680546001600160a01b031981169091556000906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461036b576000366003190112610366576006546040516001600160a01b039091168152602090f35b3461036b5760003660031901126103665760405160006001548060011c9060018116908115610f48575b6020831082146104ac5782855260208501919081156104935750600114610ef55761043e8461043281860382611344565b600160009081529250907fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b818410610f345750500161043282610422565b805484840152602090930192600101610f21565b91607f1691610ec4565b3461036b57602036600319011261036657610f6b610516565b610f73612d89565b6001600160a01b03168015610f9f576bffffffffffffffffffffffff60a01b6009541617600955600080f35b60405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b6044820152606490fd5b3461036b57602036600319011261036657600435610fef612c17565b610ffd60c8600a5410612504565b611011671bc16d674ec80000821015612545565b600954611028906001600160a01b03908116610a46565b61103181612c6d565b90600360ff8316148061120a575b611201575b600260ff831614806111f4575b6111eb575b60ff8216600381036111d157506110716108ad600d54612427565b6008546110979082906001600160a01b03166009546001600160a01b0316903390612cb5565b6110a56001600a5401600a55565b600a54916110b38333612de1565b6111006110be612f08565b6110de6110c9611366565b85815242602082015260ff9092166040830152565b60ff831660608201526110fb85600052600b602052604060002090565b612591565b60095461111790610ada906001600160a01b031681565b90813b15610b9f576040516325a920db60e21b81526004810185905260248101849052916000908390604490829084905af1918215610b9a577f3215e98abb929316d159fb802bf80de24baf8e9a59e22c4d75b7aef68372fa5c926111bc575b50611199600261119186600052600b602052604060002090565b015460ff1690565b6040805194855260ff918216602086015291169083015233918060608101610b72565b80610b8e60006111cb93611344565b38611177565b600203611071576111e66108f2600c54612427565b611071565b60019150611056565b50601e600c541015611051565b60029150611044565b506032600d54101561103f565b801515036102f357565b3461036b5760403660031901126103665761123a610516565b60243561124681611217565b6001600160a01b038216913383146112c857816112856112969233600052600560205260406000209060018060a01b0316600052602052604060002090565b9060ff801983541691151516179055565b604051901515815233907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190602090a3005b60405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606490fd5b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff82111761133f57604052565b61130d565b90601f8019910116810190811067ffffffffffffffff82111761133f57604052565b60405190611375608083611344565b565b67ffffffffffffffff811161133f57601f01601f191660200190565b3461036b576080366003190112610366576113ac610516565b6113b461052c565b906044356064359267ffffffffffffffff84116114ca5736602385011215611471578360040135926113e584611377565b936113f36040519586611344565b808552366024828801011161141c576020816000926024610599990183890137860101526125d3565b60405162461bcd60e51b815260206004820152602760248201527f414249206465636f64696e673a20696e76616c69642062797465206172726179604482015266040d8cadccee8d60cb1b6064820152608490fd5b60405162461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201526a1c9c985e481bd9999cd95d60aa1b6064820152608490fd5b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a20696e76616c6964207475706c65206f666673604482015261195d60f21b6064820152608490fd5b3461036b576000366003190112610366576020600a54604051908152f35b3461036b5760203660031901126103665760043560008181526002602052604090205461156f906001600160a01b0316151561221a565b61158661088882600052600b602052604060002090565b90604082019061159f61159a835160ff1690565b613084565b9160ff6115ad825160ff1690565b1680611e6a57506115bc6126ec565b6115c461271d565b916115cd61273e565b935b60ff6115df606089015160ff1690565b6000911660038103611e21575050611604610a8e6115fb6127c8565b935b5160ff1690565b611e1357611610612815565b955b8751670de0b6b3a7640000900461162890613218565b604051978892602084016116ac906057907f3c7376672077696474683d2234303022206865696768743d223630302220766981527f6577426f783d2230203020343030203630302220786d6c6e733d22687474703a60208201527f2f2f7777772e77332e6f72672f323030302f737667223e00000000000000000060408201520190565b651e3232b3399f60d11b8152600601661e39ba3cb6329f60c91b81526007016b40666f6e742d66616365207b60a01b8152600c017f2020666f6e742d66616d696c793a20224f72626974726f6e223b0000000000008152601a017f20207372633a2075726c282268747470733a2f2f666f6e74732e67737461746981527f632e636f6d2f732f6f72626974726f6e2f7633312f794d4a4d4d496c7a64707660208201527f426851514c5f534333583979684632352d54316e7947793678706d4979586a5560408201527f3170672e776f666632222920666f726d61742822776f66663222293b000000006060820152607c01607d60f81b8152600101671e17b9ba3cb6329f60c11b8152600801711e3334b63a32b91034b21e9133b637bb911f60711b81526012017f3c6665476175737369616e426c757220737464446576696174696f6e3d22322281527f20726573756c743d22636f6c6f726564426c7572222f3e0000000000000000006020820152603701681e3332a6b2b933b29f60b91b81526009017f3c66654d657267654e6f646520696e3d22636f6c6f726564426c7572222f3e008152601f017f3c66654d657267654e6f646520696e3d22536f7572636547726170686963222f8152601f60f91b6020820152602101691e17b332a6b2b933b29f60b11b8152600a01681e17b334b63a32b91f60b91b8152600901661e17b232b3399f60c91b81526007016c1e34b6b0b3b290343932b31e9160991b8152600d016118dc9161283a565b7f222077696474683d2234303022206865696768743d22363030222f3e000000008152601c017f3c7465787420783d223230302220793d22343030222066696c6c3d22000000008152601c01611932908261283a565b7f2220666f6e742d66616d696c793d224f72626974726f6e2c2073616e732d736581527f7269662220666f6e742d73697a653d2233322220746578742d616e63686f723d60208201527f226d6964646c65222066696c7465723d2275726c2823676c6f7729223e0000006040820152605d016119ae908761283a565b661e17ba32bc3a1f60c91b81526007017f3c7465787420783d223230302220793d22343430222066696c6c3d22000000008152601c016119ee908261283a565b6119f790612851565b611a01908661283a565b661e17ba32bc3a1f60c91b81526007017f3c7465787420783d223230302220793d22343830222066696c6c3d22000000008152601c01611a409161283a565b611a4990612851565b611a529161283a565b721023a427a3902637b1b5b2b21e17ba32bc3a1f60691b8152601301651e17b9bb339f60d11b815260060103601f1981018752611a8f9087611344565b611a9890613218565b94611aa2906133e9565b9551670de0b6b3a76400009004611ab890613218565b9160405196879660208801611acc906128c6565b68113730b6b2911d101160b91b8152600901611ae8908461283a565b61202360f01b8152600201611afc9161283a565b61088b60f21b81526002017f226465736372697074696f6e223a202248616e64206f6620476f642076654e4681526302a1016960e51b6020820152602401611b44908361283a565b61088b60f21b81526002017f22696d616765223a2022646174613a696d6167652f7376672b786d6c3b626173815263194d8d0b60e21b6020820152602401611b8b9161283a565b61088b60f21b81526002016e2261747472696275746573223a205b60881b8152600f01611bb7906128c6565b7f2274726169745f74797065223a20224672616374696f6e222c00000000000000815260190169113b30b63ab2911d101160b11b8152600a01611bf99161283a565b601160f91b8152600101611f4b60f21b8152600201611c17906128c6565b7f2274726169745f74797065223a2022526172697479222c000000000000000000815260170169113b30b63ab2911d101160b11b8152600a01611c599161283a565b601160f91b8152600101611f4b60f21b8152600201611c77906128c6565b7f2274726169745f74797065223a202247484f47204c6f636b6564222c000000008152601c0169113b30b63ab2911d101160b11b8152600a01611cb99161283a565b651023a427a39160d11b8152600601611f4b60f21b8152600201611cdc906128c6565b7f2274726169745f74797065223a20224261636b67726f756e64222c00000000008152601b0169113b30b63ab2911d101160b11b8152600a01611d1e9161283a565b601160f91b8152600101611f4b60f21b8152600201611d3c906128c6565b75089d1c985a5d17dd1e5c19488e8808951a195b59488b60521b815260160169113b30b63ab2911d101160b11b8152600a01611d779161283a565b601160f91b8152600101607d60f81b8152600101605d60f81b8152600101607d60f81b815260010103601f1981018252611db19082611344565b611dba906133e9565b6040517f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000006020820152908190603d8201611df39161283a565b03601f1981018252611e059082611344565b60405161043e8192826103c3565b611e1b6127f0565b95611612565b60028103611e3f575050611604610a8e611e396127a6565b936115fd565b600114159050611e5c57611604610a8e611e57612782565b611e39565b611604610a8e611e57612760565b600103611e9057611e79612677565b611e816126a7565b91611e8a6126cb565b936115cf565b611e986125ff565b611ea061262e565b91611e8a612654565b3461036b57602036600319011261036657600435600052600b6020526080604060002060ff81549160026001820154910154906040519384526020840152818116604084015260081c166060820152f35b3461036b57600036600319011261036657602060405160328152f35b3461036b576000366003190112610366576020600c54604051908152f35b3461036b576000366003190112610366576020600d54604051908152f35b3461036b57604036600319011261036657602060ff611fa3611f72610516565b611f7a61052c565b6001600160a01b0391821660009081526005865260408082209290931681526020919091522090565b54166040519015158152f35b3461036b576000366003190112610366576009546040516001600160a01b039091168152602090f35b3461036b57602036600319011261036657611ff1610516565b611ff9612d89565b6001600160a01b0381161561205157600680546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b60405162461bcd60e51b815260206004820152603560248201527f436f6e747261637420646f6573206e6f7420686176652066616c6c6261636b206044820152746e6f7220726563656976652066756e6374696f6e7360581b6064820152608490fd5b60008181526002602052604090205461212b906001600160a01b03161515612495565b6000908152600460205260409020546001600160a01b031690565b1561214d57565b60405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608490fd5b156121bf57565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608490fd5b1561222157565b60405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b6044820152606490fd5b9060405161226a81611323565b606060ff6002839580548552600181015460208601520154818116604085015260081c16910152565b604051906122a2602083611344565b60008252565b156122af57565b60405162461bcd60e51b815260206004820152601e60248201527f4f6e6c79207374616b696e6720636f6e74726163742063616e206275726e00006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b8015612317576000190190565b6122f4565b1561232357565b60405162461bcd60e51b815260206004820152602360248201527f4e6f7420746f6b656e206f776e6572206f72207374616b696e6720636f6e74726044820152621858dd60ea1b6064820152608490fd5b1561237b57565b60405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606490fd5b156123c757565b60405162461bcd60e51b815260206004820152601860248201527f5374616b696e6720636f6e7472616374206e6f742073657400000000000000006044820152606490fd5b906002820180921161231757565b9190820180921161231757565b60001981146123175760010190565b60405162461bcd60e51b815260206004820152602560248201527f54617267657420636f6e747261637420646f6573206e6f7420636f6e7461696e60448201526420636f646560d81b6064820152608490fd5b6040513d6000823e3d90fd5b1561249c57565b60405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606490fd5b6000908152600260205260409020546001600160a01b03166103d4811515612495565b1561250b57565b60405162461bcd60e51b815260206004820152601260248201527113585e081cdd5c1c1b1e481c995858da195960721b6044820152606490fd5b1561254c57565b60405162461bcd60e51b815260206004820152601960248201527f4d757374206c6f636b206174206c6561737420322047484f47000000000000006044820152606490fd5b9060ff60606002611375948451815560208501516001820155019282604082015116831985541617845501511661ff0082549160081b169061ff001916179055565b9161137593916125fa936125ea610715843361293f565b6125f5838383612a1b565b6136af565b61302d565b6040519061260e604083611344565b60118252702a34329029b4b632b73a102632b233b2b960791b6020830152565b6040519061263d604083611344565b60088252676461726b6e65737360c01b6020830152565b60405190612663604083611344565b6005825264626c61636b60d81b6020830152565b60405190612686604083611344565b6012825271151a1948115b58995c8810dbdd995b985b9d60721b6020830152565b604051906126b6604083611344565b6006825265666c616d657360d01b6020830152565b604051906126da604083611344565b60038252621c995960ea1b6020830152565b604051906126fb604083611344565b60138252725468652043686f6972206f66204563686f657360681b6020830152565b6040519061272c604083611344565b6003825262736b7960e81b6020830152565b6040519061274d604083611344565b6004825263626c756560e01b6020830152565b6040519061276f604083611344565b60048252634261736560e01b6020830152565b60405190612791604083611344565b6006825265139bdc9b585b60d21b6020830152565b604051906127b5604083611344565b60048252635261726560e01b6020830152565b604051906127d7604083611344565b600a82526953757065722d5261726560b01b6020830152565b604051906127ff604083611344565b600782526611b3333333333360c91b6020830152565b60405190612824604083611344565b60078252660233030303030360cc1b6020830152565b9061284d6020928281519485920161037b565b0190565b7f2220666f6e742d66616d696c793d224f72626974726f6e2c2073616e732d736581527f7269662220666f6e742d73697a653d2232382220746578742d616e63686f723d60208201527f226d6964646c65222066696c7465723d2275726c2823676c6f7729223e0000006040820152605d0190565b607b60f81b815260010190565b600082815260046020526040902080546001600160a01b0319166001600160a01b0383161790556001600160a01b0361290b836124e1565b6001600160a01b0390921691167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4565b6001600160a01b03612950836124e1565b6001600160a01b0383169116818114939192908415612991575b5050821561297757505090565b9091506001600160a01b039061298c90612108565b161490565b60009081526005602090815260408083206001600160a01b03949094168352929052205460ff169250388061296a565b156129c857565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b612a24836124e1565b6001600160a01b038083169291612a3d911683146129c1565b6001600160a01b038316928315612b2d57612aac612b0692612a6b85612a65610ada8a6124e1565b146129c1565b612a92612a82886000526004602052604060002090565b80546001600160a01b0319169055565b6001600160a01b0316600090815260036020526040902090565b80546000190190556001600160a01b038116600090815260036020526040902060018154019055612ae7856000526002602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b612b87816124e1565b506000612b93826124e1565b8282526004602052604082206bffffffffffffffffffffffff60a01b815416905560018060a01b031680825260036020526040822082198154019055612be3836000526002602052604060002090565b80546001600160a01b03191690557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a4565b600260075414612c28576002600755565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b68056bc75e2d63100000811015612caf576802b5e3af16b1880000811015612ca95768015af1d78b58c400001115612ca457600090565b600190565b50600290565b50600390565b6040516323b872dd60e01b602082019081526001600160a01b03938416602483015293909216604483015260648083019490945292815261137592612d5b92906000908190612d05608486611344565b60018060a01b03169260405194612d1d604087611344565b602086527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65646020870152519082855af1612d556135b1565b91613745565b8051908115918215612d6f575b50506134d8565b612d8292506020809183010191016134c3565b3880612d68565b6006546001600160a01b03163303612d9d57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60405191906020612df28185611344565b600084526001600160a01b038216908115612ec55750916113759391816125fa94612e41612e3c612e3884600052600260205260018060a01b0360406000205416151590565b1590565b6136f9565b600082815260026020526040902054612e63906001600160a01b0316156136f9565b6001600160a01b038316600090815260036020526040902060018154019055612e9a83612ae7846000526002602052604060002090565b60007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a46135e1565b6064906040519062461bcd60e51b825280600483015260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152fd5b612f1d612f16600a54613537565b6003900690565b600f5460009190604311612f9c576042612f3c836010549060031b1c90565b1015612f9857600116612f8d5760ff80915b165b612f89612f5c8261065d565b612f72612f6d8284549060031b1c90565b612427565b825460001960039390931b92831b1916911b179055565b1690565b5060ff806002612f4e565b5090565b6042612fad836010549060031b1c90565b1015612fbd575b60ff9150612f50565b600116612fcf5760ff80915b16612fb4565b5060ff806001612fc9565b60809060208152603260208201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60608201520190565b1561303457565b60405162461bcd60e51b81528061304d60048201612fda565b0390fd5b60405190613060604083611344565b601582527468747470733a2f2f697066732e696f2f697066732f60581b6020830152565b60ff61308e613051565b91168061310d57506103d46130b0916130ff604051938492602084019061283a565b7f6261667962656966676434376b6e6b64796b76666f7665756e7633666e716c7681527f7273773562756e7968636679756e6678756a777a6a677937616b6500000000006020820152603b0190565b03601f198101835282611344565b60010361317d576103d461312e916130ff604051938492602084019061283a565b7f6261666b726569636276757563736672663636716c71726f7866786e636c716881527f79626e33643261717966367a7668366b3234346f61706d3272717100000000006020820152603b0190565b6103d4613197916130ff604051938492602084019061283a565b7f6261666b726569686b726978353269757578676433716573743464727836723381527f63666a35643232366968746834686b64667a6a653776356163376500000000006020820152603b0190565b906131f082611377565b6131fd6040519182611344565b828152809261320e601f1991611377565b0190602036910137565b8060009172184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b82101561334d575b806d04ee2d6d415b85acef8100000000600a921015613331575b662386f26fc1000081101561331c575b6305f5e10081101561330a575b6127108110156132fa575b60648110156132eb575b10156132e0575b6132cb602161329f600185016131e6565b938401015b60001901916f181899199a1a9b1b9c1cb0b131b232b360811b600a82061a8353600a900490565b80156132db576132cb90916132a4565b505090565b60019091019061328e565b60029060649004930192613287565b600490612710900493019261327d565b6008906305f5e1009004930192613272565b601090662386f26fc100009004930192613265565b6020906d04ee2d6d415b85acef81000000009004930192613255565b506040915072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b810461323b565b6040519061337f606083611344565b604082527f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f6040837f4142434445464748494a4b4c4d4e4f505152535455565758595a61626364656660208201520152565b600281901b91906001600160fe1b0381160361231757565b8051156134ba576133f8613370565b61341c61341761341261340b855161240c565b6003900490565b6133d1565b6131e6565b916020830191819082518301915b82811061346a575050506003905106806001146134575760021461344c575090565b603d90600019015390565b50603d9081600019820153600119015390565b60036004919592939501916001603f845182828260121c16880101518453828282600c1c16880101518385015382828260061c16880101516002850153168501015160038201530193919061342a565b506103d4612293565b9081602091031261036657516103d481611217565b156134df57565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b60405160208101914283524460408301523360601b6060830152607482015260748152613565609482611344565b51902090565b9081602091031261036657516103d4816102e1565b6001600160a01b0391821681529116602082015260408101919091526080606082018190526103d49291019061039e565b3d156135dc573d906135c282611377565b916135d06040519384611344565b82523d6000602084013e565b606090565b803b156136a7576001600160a01b031691823b15610b9f57613620926020926000604051809681958294630a85bd0160e11b8452843360048601613580565b03925af160009181613676575b506136605761363a6135b1565b8051908161365b5760405162461bcd60e51b81528061304d60048201612fda565b602001fd5b6001600160e01b031916630a85bd0160e11b1490565b61369991925060203d6020116136a0575b6136918183611344565b81019061356b565b903861362d565b503d613687565b505050600190565b919290803b156136f0576001600160a01b0316803b15610b9f5761362093600060209460405196879586948593630a85bd0160e11b85523360048601613580565b50505050600190565b1561370057565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b919290156137a75750815115613759575090565b3b156137625790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156137ba5750805190602001fd5b60405162461bcd60e51b815290819061304d90600483016103c356fea26469706673582212204d2d43ddf4fc88b5e22b3e9ff8486521ade4212e7a53dda64e82d51a7012e8e664736f6c634300081a00330000000000000000000000000e899da2ad0817ed850ce68f7f489688e4d42d9d
Deployed Bytecode
0x6080604052600436106120a55760003560e01c806301ffc9a71461023c57806306fdde0314610237578063081812fc146102325780630890c9d51461022d578063095ea7b314610228578063134841061461022357806313b9e6a41461021e57806318f2877c1461021957806323b872dd146102145780632f4231441461020f57806332cb6b0c1461020a57806342842e0e1461020557806342966c681461020057806349049f1e146101fb5780635e70a6dc146101f657806362ab7da3146101f15780636352211e146101ec5780636492372f146101e757806370a08231146101e2578063715018a6146101dd5780638da5cb5b146101d857806395d89b41146101d35780639dd373b9146101ce578063a0712d68146101c9578063a22cb465146101c4578063b88d4fde146101bf578063c4e41b22146101ba578063c87b56dd146101b5578063cca187f9146101b0578063d678672c146101ab578063e04af1e2146101a6578063e733a29c146101a1578063e985e9c51461019c578063ee99205c146101975763f2fde38b036120a557611fd8565b611faf565b611f52565b611f34565b611f16565b611efa565b611ea9565b611538565b61151a565b611393565b611221565b610fd3565b610f52565b610e9a565b610e71565b610e14565b610d73565b610ce6565b610cc8565b610cac565b6109c2565b6108fc565b610839565b61080f565b6107f3565b61071f565b6106f6565b610685565b610641565b610618565b610542565b6104fa565b6104ca565b6103d7565b6102f8565b60405162461bcd60e51b815260206004820152602260248201527f45746865722073656e7420746f206e6f6e2d70617961626c652066756e63746960448201526137b760f11b6064820152608490fd5b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a207475706c65206461746120746f6f2073686f6044820152611c9d60f21b6064820152608490fd5b6001600160e01b03198116036102f357565b600080fd5b3461036b576020366003190112610366576020600435610317816102e1565b63ffffffff60e01b166380ac58cd60e01b8114908115610355575b8115610344575b506040519015158152f35b6301ffc9a760e01b14905038610339565b635b5e139f60e01b81149150610332565b610291565b610241565b600091031261036657565b60005b83811061038e5750506000910152565b818101518382015260200161037e565b906020916103b78151809281855285808601910161037b565b601f01601f1916010190565b9060206103d492818152019061039e565b90565b3461036b57600036600319011261036657604051600080548060011c90600181169081156104c0575b6020831082146104ac5782855260208501919081156104935750600114610442575b61043e8461043281860382611344565b604051918291826103c3565b0390f35b60008080529250907f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b81841061047f5750500161043282610422565b80548484015260209093019260010161046c565b60ff191682525090151560051b01905061043282610422565b634e487b7160e01b84526022600452602484fd5b91607f1691610400565b3461036b5760203660031901126103665760206104e8600435612108565b6040516001600160a01b039091168152f35b3461036b57600036600319011261036657602060405160428152f35b600435906001600160a01b03821682036102f357565b602435906001600160a01b03821682036102f357565b3461036b5760403660031901126103665761055b610516565b602435610567816124e1565b916001600160a01b0380841690821681146105c9576105999361059491331490811561059b575b50612146565b6128d3565b005b6001600160a01b0316600090815260056020908152604080832033845290915290205460ff1690503861058e565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b3461036b576000366003190112610366576008546040516001600160a01b039091168152602090f35b3461036b57600036600319011261036657602060405160438152f35b600381101561066f57600e0190600090565b634e487b7160e01b600052603260045260246000fd5b3461036b5760203660031901126103665760043560038110156102f3576106ad60209161065d565b90549060031b1c604051908152f35b6060906003190112610366576004356001600160a01b03811681036102f357906024356001600160a01b03811681036102f3579060443590565b3461036b57610599610707366106bc565b9161071a610715843361293f565b6121b8565b612a1b565b3461036b576020366003190112610366576004356000606060405161074381611323565b828152826020820152826040820152015261077b61077682600052600260205260018060a01b0360406000205416151590565b61221a565b600052600b60205261043e604060002060ff60026040519261079c84611323565b80548452600181015460208501520154818116604084015260081c16606082015260405191829182919091606060ff8160808401958051855260208101516020860152826040820151166040860152015116910152565b3461036b57600036600319011261036657602060405160c88152f35b3461036b57610599610820366106bc565b9060405192610830602085611344565b600084526125d3565b3461036b576020366003190112610366576105996108cb60043560095461086a906001600160a01b031633146122a8565b60ff610895606061088d61088885600052600b602052604060002090565b61225d565b015160ff1690565b16600381036108dd57506108b26108ad600d5461230a565b600d55565b6108bb81612b7e565b600052600b602052604060002090565b60026000918281558260018201550155565b6002036108b2576108f76108f2600c5461230a565b600c55565b6108b2565b3461036b57602036600319011261036657600435600081815260026020526040902054610933906001600160a01b0316151561221a565b600052600b60205260ff61097e606060406000208360026040519261095784611323565b80548452600181015460208501520154818116604084015260081c16918291015260ff1690565b166002811090816109b5575b60031190816109a7575b6040805191151582529115156020820152f35b90506032600d541090610994565b600c54601e11915061098a565b3461036b576040366003190112610366576004356024356109e1612c17565b600082815260026020526040902054610a04906001600160a01b0316151561221a565b610a0d826124e1565b6001600160a01b031633148015610c89575b610a289061231c565b610a33811515612374565b600954610a4e906001600160a01b039081165b1615156123c0565b610a6282600052600b602052604060002090565b90610a6e81835461241a565b610a7781612c6d565b6002840190610a94610a8e835460ff9060081c1690565b60ff1690565b9060ff8116828111610bc3575b50506009546001600160a01b031690508333829003610ba4575b5050835493829055600954610ae690610ada906001600160a01b031681565b6001600160a01b031690565b803b15610b9f576040516313a0360360e11b81526004810187905260248101949094526000908490604490829084905af1908115610b9a577f08ed8d4346150b36f813b174a1356c12cc5247db5b1679b31726b03a39593a6693610b5492610b7f575b505460081c60ff1690565b60408051948552602085019290925260ff1690830152339180606081015b0390a36105996001600755565b80610b8e6000610b9493611344565b80610370565b38610b49565b612489565b612436565b600854610bbc929033906001600160a01b0316612cb5565b3883610abb565b60038103610c3c57506032600d541080610c32575b610be8575b50505b388080610aa1565b6002610c189214610c1f575b610c026108ad600d54612427565b825461ff00191660089190911b61ff0016178255565b3880610bdd565b610c2d6108f2600c5461230a565b610bf4565b5060038210610bd8565b909150600203610c7057600c5490601e8210610c5a575b5050610be0565b610c026108f2610c6993612427565b3880610c53565b815461ff00191660089190911b61ff0016178155610be0565b50600954610a2890610ca3906001600160a01b0316610ada565b33149050610a1f565b3461036b576000366003190112610366576020604051601e8152f35b3461036b5760203660031901126103665760206104e86004356124e1565b3461036b57600036600319011261036657606080604051610d078282611344565b369037604051600e6000825b60038210610d5d578385610d278183611344565b6040519182918201906000835b60038210610d43575050500390f35b825181528594506020928301926001929092019101610d34565b6001602081928554815201930191019091610d13565b3461036b576020366003190112610366576001600160a01b03610d94610516565b168015610dbd57600052600360205261043e604060002054604051918291829190602083019252565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608490fd5b3461036b57600036600319011261036657610e2d612d89565b600680546001600160a01b031981169091556000906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461036b576000366003190112610366576006546040516001600160a01b039091168152602090f35b3461036b5760003660031901126103665760405160006001548060011c9060018116908115610f48575b6020831082146104ac5782855260208501919081156104935750600114610ef55761043e8461043281860382611344565b600160009081529250907fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b818410610f345750500161043282610422565b805484840152602090930192600101610f21565b91607f1691610ec4565b3461036b57602036600319011261036657610f6b610516565b610f73612d89565b6001600160a01b03168015610f9f576bffffffffffffffffffffffff60a01b6009541617600955600080f35b60405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b6044820152606490fd5b3461036b57602036600319011261036657600435610fef612c17565b610ffd60c8600a5410612504565b611011671bc16d674ec80000821015612545565b600954611028906001600160a01b03908116610a46565b61103181612c6d565b90600360ff8316148061120a575b611201575b600260ff831614806111f4575b6111eb575b60ff8216600381036111d157506110716108ad600d54612427565b6008546110979082906001600160a01b03166009546001600160a01b0316903390612cb5565b6110a56001600a5401600a55565b600a54916110b38333612de1565b6111006110be612f08565b6110de6110c9611366565b85815242602082015260ff9092166040830152565b60ff831660608201526110fb85600052600b602052604060002090565b612591565b60095461111790610ada906001600160a01b031681565b90813b15610b9f576040516325a920db60e21b81526004810185905260248101849052916000908390604490829084905af1918215610b9a577f3215e98abb929316d159fb802bf80de24baf8e9a59e22c4d75b7aef68372fa5c926111bc575b50611199600261119186600052600b602052604060002090565b015460ff1690565b6040805194855260ff918216602086015291169083015233918060608101610b72565b80610b8e60006111cb93611344565b38611177565b600203611071576111e66108f2600c54612427565b611071565b60019150611056565b50601e600c541015611051565b60029150611044565b506032600d54101561103f565b801515036102f357565b3461036b5760403660031901126103665761123a610516565b60243561124681611217565b6001600160a01b038216913383146112c857816112856112969233600052600560205260406000209060018060a01b0316600052602052604060002090565b9060ff801983541691151516179055565b604051901515815233907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190602090a3005b60405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606490fd5b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff82111761133f57604052565b61130d565b90601f8019910116810190811067ffffffffffffffff82111761133f57604052565b60405190611375608083611344565b565b67ffffffffffffffff811161133f57601f01601f191660200190565b3461036b576080366003190112610366576113ac610516565b6113b461052c565b906044356064359267ffffffffffffffff84116114ca5736602385011215611471578360040135926113e584611377565b936113f36040519586611344565b808552366024828801011161141c576020816000926024610599990183890137860101526125d3565b60405162461bcd60e51b815260206004820152602760248201527f414249206465636f64696e673a20696e76616c69642062797465206172726179604482015266040d8cadccee8d60cb1b6064820152608490fd5b60405162461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201526a1c9c985e481bd9999cd95d60aa1b6064820152608490fd5b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a20696e76616c6964207475706c65206f666673604482015261195d60f21b6064820152608490fd5b3461036b576000366003190112610366576020600a54604051908152f35b3461036b5760203660031901126103665760043560008181526002602052604090205461156f906001600160a01b0316151561221a565b61158661088882600052600b602052604060002090565b90604082019061159f61159a835160ff1690565b613084565b9160ff6115ad825160ff1690565b1680611e6a57506115bc6126ec565b6115c461271d565b916115cd61273e565b935b60ff6115df606089015160ff1690565b6000911660038103611e21575050611604610a8e6115fb6127c8565b935b5160ff1690565b611e1357611610612815565b955b8751670de0b6b3a7640000900461162890613218565b604051978892602084016116ac906057907f3c7376672077696474683d2234303022206865696768743d223630302220766981527f6577426f783d2230203020343030203630302220786d6c6e733d22687474703a60208201527f2f2f7777772e77332e6f72672f323030302f737667223e00000000000000000060408201520190565b651e3232b3399f60d11b8152600601661e39ba3cb6329f60c91b81526007016b40666f6e742d66616365207b60a01b8152600c017f2020666f6e742d66616d696c793a20224f72626974726f6e223b0000000000008152601a017f20207372633a2075726c282268747470733a2f2f666f6e74732e67737461746981527f632e636f6d2f732f6f72626974726f6e2f7633312f794d4a4d4d496c7a64707660208201527f426851514c5f534333583979684632352d54316e7947793678706d4979586a5560408201527f3170672e776f666632222920666f726d61742822776f66663222293b000000006060820152607c01607d60f81b8152600101671e17b9ba3cb6329f60c11b8152600801711e3334b63a32b91034b21e9133b637bb911f60711b81526012017f3c6665476175737369616e426c757220737464446576696174696f6e3d22322281527f20726573756c743d22636f6c6f726564426c7572222f3e0000000000000000006020820152603701681e3332a6b2b933b29f60b91b81526009017f3c66654d657267654e6f646520696e3d22636f6c6f726564426c7572222f3e008152601f017f3c66654d657267654e6f646520696e3d22536f7572636547726170686963222f8152601f60f91b6020820152602101691e17b332a6b2b933b29f60b11b8152600a01681e17b334b63a32b91f60b91b8152600901661e17b232b3399f60c91b81526007016c1e34b6b0b3b290343932b31e9160991b8152600d016118dc9161283a565b7f222077696474683d2234303022206865696768743d22363030222f3e000000008152601c017f3c7465787420783d223230302220793d22343030222066696c6c3d22000000008152601c01611932908261283a565b7f2220666f6e742d66616d696c793d224f72626974726f6e2c2073616e732d736581527f7269662220666f6e742d73697a653d2233322220746578742d616e63686f723d60208201527f226d6964646c65222066696c7465723d2275726c2823676c6f7729223e0000006040820152605d016119ae908761283a565b661e17ba32bc3a1f60c91b81526007017f3c7465787420783d223230302220793d22343430222066696c6c3d22000000008152601c016119ee908261283a565b6119f790612851565b611a01908661283a565b661e17ba32bc3a1f60c91b81526007017f3c7465787420783d223230302220793d22343830222066696c6c3d22000000008152601c01611a409161283a565b611a4990612851565b611a529161283a565b721023a427a3902637b1b5b2b21e17ba32bc3a1f60691b8152601301651e17b9bb339f60d11b815260060103601f1981018752611a8f9087611344565b611a9890613218565b94611aa2906133e9565b9551670de0b6b3a76400009004611ab890613218565b9160405196879660208801611acc906128c6565b68113730b6b2911d101160b91b8152600901611ae8908461283a565b61202360f01b8152600201611afc9161283a565b61088b60f21b81526002017f226465736372697074696f6e223a202248616e64206f6620476f642076654e4681526302a1016960e51b6020820152602401611b44908361283a565b61088b60f21b81526002017f22696d616765223a2022646174613a696d6167652f7376672b786d6c3b626173815263194d8d0b60e21b6020820152602401611b8b9161283a565b61088b60f21b81526002016e2261747472696275746573223a205b60881b8152600f01611bb7906128c6565b7f2274726169745f74797065223a20224672616374696f6e222c00000000000000815260190169113b30b63ab2911d101160b11b8152600a01611bf99161283a565b601160f91b8152600101611f4b60f21b8152600201611c17906128c6565b7f2274726169745f74797065223a2022526172697479222c000000000000000000815260170169113b30b63ab2911d101160b11b8152600a01611c599161283a565b601160f91b8152600101611f4b60f21b8152600201611c77906128c6565b7f2274726169745f74797065223a202247484f47204c6f636b6564222c000000008152601c0169113b30b63ab2911d101160b11b8152600a01611cb99161283a565b651023a427a39160d11b8152600601611f4b60f21b8152600201611cdc906128c6565b7f2274726169745f74797065223a20224261636b67726f756e64222c00000000008152601b0169113b30b63ab2911d101160b11b8152600a01611d1e9161283a565b601160f91b8152600101611f4b60f21b8152600201611d3c906128c6565b75089d1c985a5d17dd1e5c19488e8808951a195b59488b60521b815260160169113b30b63ab2911d101160b11b8152600a01611d779161283a565b601160f91b8152600101607d60f81b8152600101605d60f81b8152600101607d60f81b815260010103601f1981018252611db19082611344565b611dba906133e9565b6040517f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000006020820152908190603d8201611df39161283a565b03601f1981018252611e059082611344565b60405161043e8192826103c3565b611e1b6127f0565b95611612565b60028103611e3f575050611604610a8e611e396127a6565b936115fd565b600114159050611e5c57611604610a8e611e57612782565b611e39565b611604610a8e611e57612760565b600103611e9057611e79612677565b611e816126a7565b91611e8a6126cb565b936115cf565b611e986125ff565b611ea061262e565b91611e8a612654565b3461036b57602036600319011261036657600435600052600b6020526080604060002060ff81549160026001820154910154906040519384526020840152818116604084015260081c166060820152f35b3461036b57600036600319011261036657602060405160328152f35b3461036b576000366003190112610366576020600c54604051908152f35b3461036b576000366003190112610366576020600d54604051908152f35b3461036b57604036600319011261036657602060ff611fa3611f72610516565b611f7a61052c565b6001600160a01b0391821660009081526005865260408082209290931681526020919091522090565b54166040519015158152f35b3461036b576000366003190112610366576009546040516001600160a01b039091168152602090f35b3461036b57602036600319011261036657611ff1610516565b611ff9612d89565b6001600160a01b0381161561205157600680546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b60405162461bcd60e51b815260206004820152603560248201527f436f6e747261637420646f6573206e6f7420686176652066616c6c6261636b206044820152746e6f7220726563656976652066756e6374696f6e7360581b6064820152608490fd5b60008181526002602052604090205461212b906001600160a01b03161515612495565b6000908152600460205260409020546001600160a01b031690565b1561214d57565b60405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608490fd5b156121bf57565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608490fd5b1561222157565b60405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b6044820152606490fd5b9060405161226a81611323565b606060ff6002839580548552600181015460208601520154818116604085015260081c16910152565b604051906122a2602083611344565b60008252565b156122af57565b60405162461bcd60e51b815260206004820152601e60248201527f4f6e6c79207374616b696e6720636f6e74726163742063616e206275726e00006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b8015612317576000190190565b6122f4565b1561232357565b60405162461bcd60e51b815260206004820152602360248201527f4e6f7420746f6b656e206f776e6572206f72207374616b696e6720636f6e74726044820152621858dd60ea1b6064820152608490fd5b1561237b57565b60405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606490fd5b156123c757565b60405162461bcd60e51b815260206004820152601860248201527f5374616b696e6720636f6e7472616374206e6f742073657400000000000000006044820152606490fd5b906002820180921161231757565b9190820180921161231757565b60001981146123175760010190565b60405162461bcd60e51b815260206004820152602560248201527f54617267657420636f6e747261637420646f6573206e6f7420636f6e7461696e60448201526420636f646560d81b6064820152608490fd5b6040513d6000823e3d90fd5b1561249c57565b60405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606490fd5b6000908152600260205260409020546001600160a01b03166103d4811515612495565b1561250b57565b60405162461bcd60e51b815260206004820152601260248201527113585e081cdd5c1c1b1e481c995858da195960721b6044820152606490fd5b1561254c57565b60405162461bcd60e51b815260206004820152601960248201527f4d757374206c6f636b206174206c6561737420322047484f47000000000000006044820152606490fd5b9060ff60606002611375948451815560208501516001820155019282604082015116831985541617845501511661ff0082549160081b169061ff001916179055565b9161137593916125fa936125ea610715843361293f565b6125f5838383612a1b565b6136af565b61302d565b6040519061260e604083611344565b60118252702a34329029b4b632b73a102632b233b2b960791b6020830152565b6040519061263d604083611344565b60088252676461726b6e65737360c01b6020830152565b60405190612663604083611344565b6005825264626c61636b60d81b6020830152565b60405190612686604083611344565b6012825271151a1948115b58995c8810dbdd995b985b9d60721b6020830152565b604051906126b6604083611344565b6006825265666c616d657360d01b6020830152565b604051906126da604083611344565b60038252621c995960ea1b6020830152565b604051906126fb604083611344565b60138252725468652043686f6972206f66204563686f657360681b6020830152565b6040519061272c604083611344565b6003825262736b7960e81b6020830152565b6040519061274d604083611344565b6004825263626c756560e01b6020830152565b6040519061276f604083611344565b60048252634261736560e01b6020830152565b60405190612791604083611344565b6006825265139bdc9b585b60d21b6020830152565b604051906127b5604083611344565b60048252635261726560e01b6020830152565b604051906127d7604083611344565b600a82526953757065722d5261726560b01b6020830152565b604051906127ff604083611344565b600782526611b3333333333360c91b6020830152565b60405190612824604083611344565b60078252660233030303030360cc1b6020830152565b9061284d6020928281519485920161037b565b0190565b7f2220666f6e742d66616d696c793d224f72626974726f6e2c2073616e732d736581527f7269662220666f6e742d73697a653d2232382220746578742d616e63686f723d60208201527f226d6964646c65222066696c7465723d2275726c2823676c6f7729223e0000006040820152605d0190565b607b60f81b815260010190565b600082815260046020526040902080546001600160a01b0319166001600160a01b0383161790556001600160a01b0361290b836124e1565b6001600160a01b0390921691167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4565b6001600160a01b03612950836124e1565b6001600160a01b0383169116818114939192908415612991575b5050821561297757505090565b9091506001600160a01b039061298c90612108565b161490565b60009081526005602090815260408083206001600160a01b03949094168352929052205460ff169250388061296a565b156129c857565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b612a24836124e1565b6001600160a01b038083169291612a3d911683146129c1565b6001600160a01b038316928315612b2d57612aac612b0692612a6b85612a65610ada8a6124e1565b146129c1565b612a92612a82886000526004602052604060002090565b80546001600160a01b0319169055565b6001600160a01b0316600090815260036020526040902090565b80546000190190556001600160a01b038116600090815260036020526040902060018154019055612ae7856000526002602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b612b87816124e1565b506000612b93826124e1565b8282526004602052604082206bffffffffffffffffffffffff60a01b815416905560018060a01b031680825260036020526040822082198154019055612be3836000526002602052604060002090565b80546001600160a01b03191690557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a4565b600260075414612c28576002600755565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b68056bc75e2d63100000811015612caf576802b5e3af16b1880000811015612ca95768015af1d78b58c400001115612ca457600090565b600190565b50600290565b50600390565b6040516323b872dd60e01b602082019081526001600160a01b03938416602483015293909216604483015260648083019490945292815261137592612d5b92906000908190612d05608486611344565b60018060a01b03169260405194612d1d604087611344565b602086527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65646020870152519082855af1612d556135b1565b91613745565b8051908115918215612d6f575b50506134d8565b612d8292506020809183010191016134c3565b3880612d68565b6006546001600160a01b03163303612d9d57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60405191906020612df28185611344565b600084526001600160a01b038216908115612ec55750916113759391816125fa94612e41612e3c612e3884600052600260205260018060a01b0360406000205416151590565b1590565b6136f9565b600082815260026020526040902054612e63906001600160a01b0316156136f9565b6001600160a01b038316600090815260036020526040902060018154019055612e9a83612ae7846000526002602052604060002090565b60007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a46135e1565b6064906040519062461bcd60e51b825280600483015260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152fd5b612f1d612f16600a54613537565b6003900690565b600f5460009190604311612f9c576042612f3c836010549060031b1c90565b1015612f9857600116612f8d5760ff80915b165b612f89612f5c8261065d565b612f72612f6d8284549060031b1c90565b612427565b825460001960039390931b92831b1916911b179055565b1690565b5060ff806002612f4e565b5090565b6042612fad836010549060031b1c90565b1015612fbd575b60ff9150612f50565b600116612fcf5760ff80915b16612fb4565b5060ff806001612fc9565b60809060208152603260208201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60608201520190565b1561303457565b60405162461bcd60e51b81528061304d60048201612fda565b0390fd5b60405190613060604083611344565b601582527468747470733a2f2f697066732e696f2f697066732f60581b6020830152565b60ff61308e613051565b91168061310d57506103d46130b0916130ff604051938492602084019061283a565b7f6261667962656966676434376b6e6b64796b76666f7665756e7633666e716c7681527f7273773562756e7968636679756e6678756a777a6a677937616b6500000000006020820152603b0190565b03601f198101835282611344565b60010361317d576103d461312e916130ff604051938492602084019061283a565b7f6261666b726569636276757563736672663636716c71726f7866786e636c716881527f79626e33643261717966367a7668366b3234346f61706d3272717100000000006020820152603b0190565b6103d4613197916130ff604051938492602084019061283a565b7f6261666b726569686b726978353269757578676433716573743464727836723381527f63666a35643232366968746834686b64667a6a653776356163376500000000006020820152603b0190565b906131f082611377565b6131fd6040519182611344565b828152809261320e601f1991611377565b0190602036910137565b8060009172184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b82101561334d575b806d04ee2d6d415b85acef8100000000600a921015613331575b662386f26fc1000081101561331c575b6305f5e10081101561330a575b6127108110156132fa575b60648110156132eb575b10156132e0575b6132cb602161329f600185016131e6565b938401015b60001901916f181899199a1a9b1b9c1cb0b131b232b360811b600a82061a8353600a900490565b80156132db576132cb90916132a4565b505090565b60019091019061328e565b60029060649004930192613287565b600490612710900493019261327d565b6008906305f5e1009004930192613272565b601090662386f26fc100009004930192613265565b6020906d04ee2d6d415b85acef81000000009004930192613255565b506040915072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b810461323b565b6040519061337f606083611344565b604082527f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f6040837f4142434445464748494a4b4c4d4e4f505152535455565758595a61626364656660208201520152565b600281901b91906001600160fe1b0381160361231757565b8051156134ba576133f8613370565b61341c61341761341261340b855161240c565b6003900490565b6133d1565b6131e6565b916020830191819082518301915b82811061346a575050506003905106806001146134575760021461344c575090565b603d90600019015390565b50603d9081600019820153600119015390565b60036004919592939501916001603f845182828260121c16880101518453828282600c1c16880101518385015382828260061c16880101516002850153168501015160038201530193919061342a565b506103d4612293565b9081602091031261036657516103d481611217565b156134df57565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b60405160208101914283524460408301523360601b6060830152607482015260748152613565609482611344565b51902090565b9081602091031261036657516103d4816102e1565b6001600160a01b0391821681529116602082015260408101919091526080606082018190526103d49291019061039e565b3d156135dc573d906135c282611377565b916135d06040519384611344565b82523d6000602084013e565b606090565b803b156136a7576001600160a01b031691823b15610b9f57613620926020926000604051809681958294630a85bd0160e11b8452843360048601613580565b03925af160009181613676575b506136605761363a6135b1565b8051908161365b5760405162461bcd60e51b81528061304d60048201612fda565b602001fd5b6001600160e01b031916630a85bd0160e11b1490565b61369991925060203d6020116136a0575b6136918183611344565b81019061356b565b903861362d565b503d613687565b505050600190565b919290803b156136f0576001600160a01b0316803b15610b9f5761362093600060209460405196879586948593630a85bd0160e11b85523360048601613580565b50505050600190565b1561370057565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b919290156137a75750815115613759575090565b3b156137625790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156137ba5750805190602001fd5b60405162461bcd60e51b815290819061304d90600483016103c356fea26469706673582212204d2d43ddf4fc88b5e22b3e9ff8486521ade4212e7a53dda64e82d51a7012e8e664736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000e899da2ad0817ed850ce68f7f489688e4d42d9d
-----Decoded View---------------
Arg [0] : _ghog (address): 0x0e899dA2aD0817ed850ce68f7f489688E4D42D9D
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000e899da2ad0817ed850ce68f7f489688e4d42d9d
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in S
Multichain Portfolio | 35 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.