Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
APMorganMainnet
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 1 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.15;
import "../APMorganDeployable.sol";
contract APMorganMainnet is APMorganDeployable {
constructor() APMorganDeployable() {}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.15;
import "../APMorgan.sol";
import "../APMorganMinter.sol";
contract APMorganDeployable is APMorgan {
constructor() APMorgan(false) {}
}
contract APMorganTestNet is APMorganDeployable {
using SettableCountersUpgradeable for SettableCountersUpgradeable.Counter;
constructor() APMorganDeployable() {}
/// @notice Helper function for testnet deployment allowing for multiple vrf from a single address tests
// function unsetClaimed(address claimooor) external {
// claimed[claimooor] = false;
// }
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.15;
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165StorageUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./lzApp/NonblockingLzAppUpgradeable.sol";
import "./interfaces/IAPMorgan.types.sol";
import "./interfaces/ILayerZeroEndpoint.sol";
import "./interfaces/ILayerZeroReceiver.sol";
import "./abstract/HasSecondarySaleFees.sol";
import "./libraries/SettableCountersUpgradeable.sol";
import "./APMorganMinter.sol";
contract APMorgan is
ERC721EnumerableUpgradeable,
UUPSUpgradeable,
IAPMorganTypes,
ILayerZeroReceiver,
NonblockingLzAppUpgradeable,
HasSecondarySaleFees
{
using SettableCountersUpgradeable for SettableCountersUpgradeable.Counter;
/// LayerZero gas value for bridging
uint256 lzGas;
/// token id counter
SettableCountersUpgradeable.Counter _tokenIdCounter;
/// Mapping of layer combination to used status
mapping(bytes32 => bool) public layerComboUsed;
//. Mapping of token id to layer and source chain information
mapping(uint256 => LayerData) public tokenLayers;
/// Preminted token data for vrf
mapping(uint256 => PremintedTokenData) public premintedTokens;
/// Mapping of greenlisted user to mint claimed
mapping(address => bool) public claimed;
/// Mapping from owner address to owner's preferred token (pfp)
mapping(address => uint256) public preferredToken;
/// Greenlist merkle root
bytes32 public merkleRoot;
/// chain specific starting index (used for reading offchain)
uint16 public startIndex;
/// chain specific end index
uint16 public endIndex;
/// num of assets per layer
LayerCounts public layerCounts;
APMorganMinter apMorganMinter;
uint256 public vrfPaymentContribution;
///Secondary Sales Fees:
address public saleFeesRecipient;
uint32 public secondarySalePercentage;
uint256 constant basisPointsDenominator = 10_000;
/// Roles
bytes32 public constant UPGRADER_ROLE = keccak256("UPGRADER_ROLE");
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant GREENLIST_ADMIN_ROLE =
keccak256("GREENLIST_ADMIN_ROLE");
/// cross chain event
event ReceiveNFT(uint16 _srcChainId, address _from, uint256 _tokenId);
modifier isTokenOwnerOrApproved(uint256 tokenId) {
require(
msg.sender == ownerOf(tokenId) ||
getApproved(tokenId) == msg.sender,
"Not the owner or approved"
);
_;
}
// auto initialize implementation for production environment - require explicitly stating if contract is for testing.
constructor(bool isTestingContract) {
if (!isTestingContract) {
//// @custom:oz-upgrades-unsafe-allow constructor
_disableInitializers();
}
}
/// @notice initialize A.P Morgan Sailing Club contract
/// @param _endpoint - the source chain endpoint for LayerZero implementation
/// @param admin - admin account address
/// @param _startIndex - index for the first token mintable for a specific chain
/// @param _endIndex - index for the last token mintable for a specific chain
/// @param root - greenlist merkle root
/// @param numl2 - layer 2 identifier
/// @param numl3 - layer 3 identifier
/// @param numl4 - layer 4 identifier
/// @param numl5 - layer 5 identifier
/// @param numl6 - layer 6 identifier
/// @param _vrfPaymentContribution - native token payment amount for randomness subsidy
function initialize(
address _endpoint,
address admin,
uint16 _startIndex,
uint16 _endIndex,
bytes32 root,
uint8 numl2,
uint8 numl3,
uint8 numl4,
uint8 numl5,
uint8 numl6,
uint256 _vrfPaymentContribution,
address _apMorganMinter
) public initializer {
__ERC721_init("A.P. Morgan Sailing Club", "APM");
__ERC721Enumerable_init();
__AccessControl_init();
__UUPSUpgradeable_init();
_grantRole(DEFAULT_ADMIN_ROLE, admin);
_grantRole(UPGRADER_ROLE, admin);
_grantRole(GREENLIST_ADMIN_ROLE, admin);
_grantRole(MINTER_ROLE, _apMorganMinter);
__NonblockingLzAppUpgradeable_init_unchained(_endpoint);
lzGas = 500_000; // sufficiently high
HasSecondarySaleFees._initialize();
// start ids from for sensible preferredToken mapping deletion.
_tokenIdCounter.set(_startIndex);
layerCounts = LayerCounts({
numImagesLayer2: numl2,
numImagesLayer3: numl3,
numImagesLayer4: numl4,
numImagesLayer5: numl5,
numImagesLayer6: numl6
});
merkleRoot = root;
startIndex = _startIndex;
endIndex = _endIndex;
vrfPaymentContribution = _vrfPaymentContribution;
apMorganMinter = APMorganMinter(_apMorganMinter);
}
/// @notice public mint function using a proof
/// @param proof - proof used to give minting permission
/// @param layer2 - unique layer 2
/// @param layer3 - unique layer 3
/// @param layer4 - unique layer 4
/// @param layer5 - unique layer 5
/// @param layer6 - unique layer 6
function mintGreenList(
bytes32[] calldata proof,
uint8 layer2,
uint8 layer3,
uint8 layer4,
uint8 layer5,
uint8 layer6
) external payable {
require(
msg.value == vrfPaymentContribution,
"Incorrect randomness subsidy"
);
require(
MerkleProof.verify(
proof,
merkleRoot,
keccak256(abi.encodePacked(msg.sender))
),
"Not greenlisted!"
);
require(!claimed[msg.sender], "Already claimed!");
claimed[msg.sender] = true;
require(
layer2 < layerCounts.numImagesLayer2 &&
layer3 < layerCounts.numImagesLayer3 &&
layer4 < layerCounts.numImagesLayer4 &&
layer5 < layerCounts.numImagesLayer5 &&
layer6 < layerCounts.numImagesLayer6,
"Layers out of bounds!"
);
validateUniqueness(
block.chainid,
layer2,
layer3,
layer4,
layer5,
layer6
);
uint256 tokenId = _tokenIdCounter.current();
require(tokenId <= endIndex, "Max supply reached for chain!");
_tokenIdCounter.increment();
uint256 s_requestId = apMorganMinter.sendVrfRequest{value: msg.value}();
premintedTokens[s_requestId] = PremintedTokenData({
layer2: layer2,
layer3: layer3,
layer4: layer4,
layer5: layer5,
layer6: layer6,
tokenId: uint96(tokenId),
owner: msg.sender
});
}
/// @notice first time minting of A.P. Morgan (internal)
/// @param requestId - vrf requestId
/// @param randomLayer0 - first random layer
/// @param randomLayer1 - second random layer
function mintAPMorgan(
uint256 requestId,
uint8 randomLayer0,
uint8 randomLayer1
) external onlyRole(MINTER_ROLE) {
PremintedTokenData memory tokenData = premintedTokens[requestId];
// Once data read and fulfilled delete storage to get some gas back 😊
delete premintedTokens[requestId];
if (balanceOf(tokenData.owner) == 0) {
preferredToken[tokenData.owner] = tokenData.tokenId;
}
tokenLayers[tokenData.tokenId] = LayerData(
randomLayer0,
randomLayer1,
tokenData.layer2,
tokenData.layer3,
tokenData.layer4,
tokenData.layer5,
tokenData.layer6,
uint200(block.chainid)
);
emit TokenLayersDetermined(
tokenData.tokenId,
block.chainid,
randomLayer0,
randomLayer1,
tokenData.layer2,
tokenData.layer3,
tokenData.layer4,
tokenData.layer5,
tokenData.layer6
);
//Uses _mint over _safeMint as this function should not revert
_mint(tokenData.owner, tokenData.tokenId);
}
function getTokenUniquenessKey(
uint256 originatingChainId,
uint8 layer2,
uint8 layer3,
uint8 layer4,
uint8 layer5,
uint8 layer6
) public pure returns (bytes32) {
return
bytes32(
abi.encodePacked(
uint16(0), /* a space for the 2 randomly generated layers -- useful for future coversion from the full token data to user selected and packed layers via 'AND'/& and a bitmask*/
layer2,
layer3,
layer4,
layer5,
layer6,
uint200(originatingChainId)
)
);
}
/// @notice ensures each layer combination is unique (accompanied by the chain id minted on)
/// @param originatingChainId - chain id of orginally minted token
/// @param layer2 - unique layer 2
/// @param layer3 - unique layer 3
/// @param layer4 - unique layer 4
/// @param layer5 - unique layer 5
/// @param layer6 - unique layer 6
/// @dev virtual for mock contracts for testing lz ignoring originatingChainId
function validateUniqueness(
uint256 originatingChainId,
uint8 layer2,
uint8 layer3,
uint8 layer4,
uint8 layer5,
uint8 layer6
) internal virtual {
bytes32 combo = getTokenUniquenessKey(
originatingChainId,
layer2,
layer3,
layer4,
layer5,
layer6
);
require(!layerComboUsed[combo], "Non unique mint!");
layerComboUsed[combo] = true;
}
/// @notice function to transfer the token from one chain to another
/// @param _dstChainId - the layer zero unique chain id
/// @param tokenId - id of token to bridge
/// @param receiver - receiving address relevant for smart contract transferring cross chain when it likely doesnt exist on the other chain
function transferCrossChain(
uint16 _dstChainId,
uint256 tokenId,
address receiver
) external payable isTokenOwnerOrApproved(tokenId) {
// burn NFT
_burn(tokenId);
LayerData memory tokenLayersCrossChain = tokenLayers[tokenId];
bytes memory payload = abi.encode(
receiver,
tokenId,
tokenLayersCrossChain.originatingChainId,
tokenLayersCrossChain.randomLayer0,
tokenLayersCrossChain.randomLayer1,
tokenLayersCrossChain.layer2,
tokenLayersCrossChain.layer3,
tokenLayersCrossChain.layer4,
tokenLayersCrossChain.layer5,
tokenLayersCrossChain.layer6
);
bytes memory adapterParams = abi.encodePacked(uint16(1), lzGas); // version, lzgas
(uint256 messageFee, ) = lzEndpoint.estimateFees(
_dstChainId,
address(this),
payload,
false,
adapterParams
);
require(msg.value >= messageFee, "To little to cover msgFee");
_lzSend(
_dstChainId,
payload,
payable(msg.sender),
address(0x0),
adapterParams
);
}
/// @notice LayerZero endpoint will invoke this function to deliver the message on the destination
/// @param _srcChainId - the source endpoint identifier
/// @param - the source sending contract address from the source chain
/// @param - the ordered message nonce
/// @param _payload - the signed payload is the UA bytes encoded to be sent
function _nonblockingLzReceive(
uint16 _srcChainId,
bytes memory,
uint64,
bytes memory _payload
) internal override {
(
address toAddress,
uint256 tokenId,
uint256 originatingChainId,
uint8 randomLayer0,
uint8 randomLayer1,
uint8 layer2,
uint8 layer3,
uint8 layer4,
uint8 layer5,
uint8 layer6
) = abi.decode(
_payload,
(
address,
uint256,
uint256,
uint8,
uint8,
uint8,
uint8,
uint8,
uint8,
uint8
)
);
// mint the tokens
_mintCrossChain(
toAddress,
tokenId,
originatingChainId,
randomLayer0,
randomLayer1,
layer2,
layer3,
layer4,
layer5,
layer6
);
emit ReceiveNFT(_srcChainId, toAddress, tokenId);
}
/// @notice unique mint function when being bridged via layerzero
/// @param receiver - user who will receive token on receiving chain
/// @param tokenId - token id to mint it with, note this can fall outside of the startIndex & endIndex of this chains contract
/// @param originatingChainId - normal blockchain id where the token was originally minted
/// @param randomLayer0 - unique random layer 0
/// @param randomLayer1 - unique random layer 1
/// @param layer2 - unique layer 2
/// @param layer3 - unique layer 3
/// @param layer4 - unique layer 4
/// @param layer5 - unique layer 5
/// @param layer6 - unique layer 6
function _mintCrossChain(
address receiver,
uint256 tokenId,
uint256 originatingChainId,
uint8 randomLayer0,
uint8 randomLayer1,
uint8 layer2,
uint8 layer3,
uint8 layer4,
uint8 layer5,
uint8 layer6
) internal {
if (balanceOf(receiver) == 0) preferredToken[receiver] = tokenId;
tokenLayers[tokenId] = LayerData(
randomLayer0,
randomLayer1,
layer2,
layer3,
layer4,
layer5,
layer6,
uint200(originatingChainId)
);
//Using _mint over _safeMint as this function should not revert
_mint(receiver, tokenId);
}
/// @notice after token transfer hook to remove currently set preferredToken
/// @param from - sender
/// @param to - receiver
/// @param tokenId - token id to remove and set as preferred token
function _afterTokenTransfer(
address from, // is always the owner of the token
address to,
uint256 tokenId
) internal override {
// if transfering token to self do nothing
if (from == to) return;
// if not a new mint && transferred token was owners preferred token
if (from != address(0) && preferredToken[from] == tokenId) {
if (balanceOf(from) > 0)
// set preferred token to another that from owns
preferredToken[from] = tokenOfOwnerByIndex(from, 0);
else delete preferredToken[from];
}
if (to != address(0) && preferredToken[to] == 0) {
preferredToken[to] = tokenId;
}
}
/// @notice used for upgrading
/// @param newImplementation - Address of new implementation contract
function _authorizeUpgrade(address newImplementation)
internal
override
onlyRole(UPGRADER_ROLE)
{}
/// @notice used for upgrading
/// @param interfaceId - interface identifier for contract
function supportsInterface(bytes4 interfaceId)
public
view
override(
ERC721EnumerableUpgradeable,
AccessControlUpgradeable,
ERC165StorageUpgradeable
)
returns (bool)
{
return
ERC721EnumerableUpgradeable.supportsInterface(interfaceId) ||
AccessControlUpgradeable.supportsInterface(interfaceId) ||
ERC165StorageUpgradeable.supportsInterface(interfaceId);
}
/// @notice set the users preferred tokenId
/// @param tokenId - id of token to set as pfp
function setPreferredToken(uint256 tokenId)
public
isTokenOwnerOrApproved(tokenId)
{
preferredToken[ownerOf(tokenId)] = tokenId;
}
/// @notice Admin function to introduce new assets to layers
/// @param numl2 - number of assets for layer 2
/// @param numl3 - number of assets for layer 3
/// @param numl4 - number of assets for layer 4
/// @param numl5 - number of assets for layer 5
/// @param numl6 - number of assets for layer 6
function setNumberOfAssetsInLayer(
uint8 numl2,
uint8 numl3,
uint8 numl4,
uint8 numl5,
uint8 numl6
) external onlyRole(DEFAULT_ADMIN_ROLE) {
require(
numl2 >= layerCounts.numImagesLayer2 &&
numl3 >= layerCounts.numImagesLayer3 &&
numl4 >= layerCounts.numImagesLayer4 &&
numl5 >= layerCounts.numImagesLayer5 &&
numl6 >= layerCounts.numImagesLayer6,
"Can't decrease layers"
);
layerCounts = LayerCounts({
numImagesLayer2: numl2,
numImagesLayer3: numl3,
numImagesLayer4: numl4,
numImagesLayer5: numl5,
numImagesLayer6: numl6
});
}
/// @notice Helper function for getting next tokenId
function getTokenIdCounter() external view returns (uint256) {
return _tokenIdCounter.current();
}
/**
* @dev Returns the base Uniform Resource Identifier (URI) for all tokens
*/
function _baseURI() internal pure override returns (string memory) {
return "https://morganning.float-nfts.com/";
}
//////////////////// ADMIN FUNCTIONS ////////////////////
/// @notice update the mint greenlist by setting a new merkle root
/// @param root - new greenlist merkle root
function setMerkleRoot(bytes32 root)
external
virtual
onlyRole(GREENLIST_ADMIN_ROLE)
{
merkleRoot = root;
}
function setFeeParams(address _saleFeesRecipient, uint32 _feeBasisPoints)
external
onlyRole(DEFAULT_ADMIN_ROLE)
{
require(_feeBasisPoints <= basisPointsDenominator);
secondarySalePercentage = _feeBasisPoints;
saleFeesRecipient = _saleFeesRecipient;
}
function getFeeRecipients(uint256)
public
view
override
returns (address[] memory)
{
address[] memory feeRecipients = new address[](1);
feeRecipients[0] = saleFeesRecipient;
return feeRecipients;
}
function getFeeBps(uint256) public view override returns (uint32[] memory) {
uint32[] memory fees = new uint32[](1);
fees[0] = secondarySalePercentage;
return fees;
}
function setIndexes(uint16 _startIndex, uint16 _endIndex)
external
onlyRole(DEFAULT_ADMIN_ROLE)
{
startIndex = _startIndex;
endIndex = _endIndex;
}
function configurePaymentContributionAndLzGas(
uint256 _vrfPaymentContribution,
uint256 _lzGas
) external onlyRole(DEFAULT_ADMIN_ROLE) {
vrfPaymentContribution = _vrfPaymentContribution;
lzGas = _lzGas;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[43] private __gap;
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.15;
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "./abstract/VRFConsumerBaseV2Upgradeable.sol";
import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import "./APMorgan.sol";
import "./APMorganRoles.sol";
import "./interfaces/IAPMorgan.types.sol";
contract APMorganMinter is
UUPSUpgradeable,
APMorganRoles,
IAPMorganTypes,
VRFConsumerBaseV2Upgradeable
{
/// Link Token for subscription payment to VRF
LinkTokenInterface immutable LINKTOKEN;
/// Gas value KeyHash for VRF requests
bytes32 immutable keyHash;
/// vrf callback gas limit
uint32 public callbackGasLimit;
/// Number of requested confirmations for randomness (minimum 3)
uint16 public constant requestConfirmations = 3;
/// vrf params
uint64 public s_subscriptionId;
APMorgan apMorgan;
// auto initialize implementation for production environment - require explicitly stating if contract is for testing.
constructor(
bool isTestingContract,
address _vrfCoordinator,
address linkTokenContract,
bytes32 _keyHash
) VRFConsumerBaseV2Upgradeable(_vrfCoordinator) {
LINKTOKEN = LinkTokenInterface(linkTokenContract);
keyHash = _keyHash;
if (!isTestingContract) {
//// @custom:oz-upgrades-unsafe-allow constructor
_disableInitializers();
}
}
function initialize(address admin, address _apMorgan) public initializer {
callbackGasLimit = 1_000_000; // sufficiently high
__roles_init(admin, _apMorgan);
apMorgan = APMorgan(_apMorgan);
//Create a new VRF subscription when you initialize the contract.
createNewSubscription();
}
function sendVrfRequest()
external
payable
onlyRole(APMORGAN_ROLE)
returns (uint256 s_requestId)
{
s_requestId = VRFCoordinatorV2Interface(vrfCoordinator)
.requestRandomWords(
keyHash,
s_subscriptionId,
requestConfirmations,
callbackGasLimit,
1 // num of random numbers to request
);
}
/// @notice VRF callback function to provide random numbers and mint the associated token
/// @param requestId - VRF request id
/// @param randomWords - random numbers
function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords)
internal
override
{
(uint8 randomLayer0, uint8 randomLayer1) = getTwoRandomLayers(
randomWords[0]
);
apMorgan.mintAPMorgan(requestId, randomLayer0, randomLayer1);
}
/// @notice get two random layers from a single uint256 returned from vrf
/// @param randomWord - random number
function getTwoRandomLayers(uint256 randomWord)
internal
pure
returns (uint8, uint8)
{
return (
determineRandomLayer(randomWord % 100), // Only looks at the first 7 bits (ie 2^7)
determineRandomLayer((randomWord >> 7) % 100) // Looks at the next 7 bits of the number
);
}
/// @notice Probabilistic Randomness for layer assets
/// 50% probability of asset 0
/// 30% probability of asset 1
/// 15% probability of asset 2
/// 5% probability of asset 3
/// @param randomValue - random value between 0 and 99
/// @return randomAsset - random asset of value [0:3]
function determineRandomLayer(uint256 randomValue)
internal
pure
returns (uint8 randomAsset)
{
if (randomValue < 50) {
randomAsset = 0;
} else if (randomValue < 80) {
randomAsset = 1;
} else if (randomValue < 95) {
randomAsset = 2;
} else {
randomAsset = 3;
}
}
// ////////////// VRF functions //////////////
/// @notice Adds this contract as a consumer of VRF random words (numbers)
function createNewSubscription() internal virtual {
s_subscriptionId = VRFCoordinatorV2Interface(vrfCoordinator)
.createSubscription();
// Add this contract as a consumer of its own subscription.
VRFCoordinatorV2Interface(vrfCoordinator).addConsumer(
s_subscriptionId,
address(this)
);
}
/// @notice Adds this contract as a consumer of VRF random words (numbers)
/// @param amount - id of token to set as pfp
/// @dev assumes this contract holds link (decimals: 18)
function topUpSubscription(uint256 amount)
public
onlyRole(DEFAULT_ADMIN_ROLE)
{
LINKTOKEN.transferAndCall(
address(VRFCoordinatorV2Interface(vrfCoordinator)),
amount,
abi.encode(s_subscriptionId)
);
}
/// @notice Removes the vrf subscription
/// @param receivingWallet - wallet that will receive outstanding link balance in subscription
function cancelSubscription(address receivingWallet)
external
onlyRole(DEFAULT_ADMIN_ROLE)
{
// Cancel the subscription and send the remaining LINK to a wallet address.
VRFCoordinatorV2Interface(vrfCoordinator).cancelSubscription(
s_subscriptionId,
receivingWallet
);
s_subscriptionId = 0;
}
/// @notice Withdraw subscriptions link to wallet
/// @param amount - amount of link to withdraw
/// @param to - receiver
/// @dev check the vrfCoordinator contract to get the balance of link related to this contracts subscriptionId
function withdraw(uint256 amount, address to)
external
onlyRole(DEFAULT_ADMIN_ROLE)
{
LINKTOKEN.transfer(to, amount);
}
/// @notice used for upgrading
/// @param newImplementation - Address of new implementation contract
function _authorizeUpgrade(address newImplementation)
internal
override
onlyRole(UPGRADER_ROLE)
{}
/// @notice used for upgrading
/// @param interfaceId - interface identifier for contract
function supportsInterface(bytes4 interfaceId)
public
view
override(AccessControlUpgradeable)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
/// @notice Univ2 interface for swapping native token for link to mint subsidy
/// @param router - address of router contract
/// @param amountOutMin - min amount required to return for swap
/// @param path - array of addresses for swap
function swapToLinkForRandomness(
address router,
uint256 amountOutMin,
address[] calldata path
) external onlyRole(DEFAULT_ADMIN_ROLE) {
// uint amountOutMin, address[] calldata path, address to, uint deadline)
IUniswapV2Router02(router).swapExactETHForTokens{
value: address(this).balance
}(amountOutMin, path, address(this), block.timestamp);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[43] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
using AddressUpgradeable for address;
using StringsUpgradeable 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.
*/
function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
__ERC721_init_unchained(name_, symbol_);
}
function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
return
interfaceId == type(IERC721Upgradeable).interfaceId ||
interfaceId == type(IERC721MetadataUpgradeable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
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) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
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 = ERC721Upgradeable.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
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: transfer caller is not owner nor 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: transfer caller is not owner nor 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 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 _owners[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) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721Upgradeable.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);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721Upgradeable.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId);
}
/**
* @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(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @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 IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[44] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../ERC721Upgradeable.sol";
import "./IERC721EnumerableUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable {
function __ERC721Enumerable_init() internal onlyInitializing {
}
function __ERC721Enumerable_init_unchained() internal onlyInitializing {
}
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC721Upgradeable) returns (bool) {
return interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Upgradeable.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721EnumerableUpgradeable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721Upgradeable.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721Upgradeable.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[46] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165Storage.sol)
pragma solidity ^0.8.0;
import "./ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Storage based implementation of the {IERC165} interface.
*
* Contracts may inherit from this and call {_registerInterface} to declare
* their support of an interface.
*/
abstract contract ERC165StorageUpgradeable is Initializable, ERC165Upgradeable {
function __ERC165Storage_init() internal onlyInitializing {
}
function __ERC165Storage_init_unchained() internal onlyInitializing {
}
/**
* @dev Mapping of interface ids to whether or not it's supported.
*/
mapping(bytes4 => bool) private _supportedInterfaces;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return super.supportsInterface(interfaceId) || _supportedInterfaces[interfaceId];
}
/**
* @dev Registers the contract as an implementer of the interface defined by
* `interfaceId`. Support of the actual ERC165 interface is automatic and
* registering its interface id is not required.
*
* See {IERC165-supportsInterface}.
*
* Requirements:
*
* - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
*/
function _registerInterface(bytes4 interfaceId) internal virtual {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.0;
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*
* _Available since v4.1._
*/
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address private immutable __self = address(this);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
require(address(this) != __self, "Function must be called through delegatecall");
require(_getImplementation() == __self, "Function must be called through active proxy");
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
_;
}
/**
* @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate that the this implementation remains valid after an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
return _IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*/
function upgradeTo(address newImplementation) external virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*/
function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data, true);
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeTo} and {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal override onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the merkle tree could be reinterpreted as a leaf value.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = _efficientHash(computedHash, proofElement);
} else {
// Hash(current element of the proof + current computed hash)
computedHash = _efficientHash(proofElement, computedHash);
}
}
return computedHash;
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./LzAppUpgradeable.sol";
/*
* the default LayerZero messaging behaviour is blocking, i.e. any failed message will block the channel
* this abstract class try-catch all fail messages and store locally for future retry. hence, non-blocking
* NOTE: if the srcAddress is not configured properly, it will still block the message pathway from (srcChainId, srcAddress)
*/
abstract contract NonblockingLzAppUpgradeable is Initializable, LzAppUpgradeable {
function __NonblockingLzAppUpgradeable_init(address _endpoint) internal onlyInitializing {
__NonblockingLzAppUpgradeable_init_unchained(_endpoint);
}
function __NonblockingLzAppUpgradeable_init_unchained(address _endpoint) internal onlyInitializing {
__LzAppUpgradeable_init_unchained(_endpoint);
}
mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages;
event MessageFailed(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload);
// overriding the virtual function in LzReceiver
function _blockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual override {
// try-catch all errors/exceptions
try this.nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload) {
// do nothing
} catch {
// error / exception
failedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(_payload);
emit MessageFailed(_srcChainId, _srcAddress, _nonce, _payload);
}
}
function nonblockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) public virtual {
// only internal transaction
require(_msgSender() == address(this), "NonblockingLzApp: caller must be LzApp");
_nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
}
//@notice override this function
function _nonblockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual;
function retryMessage(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) public payable virtual {
// assert there is message to retry
bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce];
require(payloadHash != bytes32(0), "NonblockingLzApp: no stored message");
require(keccak256(_payload) == payloadHash, "NonblockingLzApp: invalid payload");
// clear the stored message
failedMessages[_srcChainId][_srcAddress][_nonce] = bytes32(0);
// execute the message. revert if it fails again
_nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.15;
interface IAPMorganTypes {
event TokenLayersDetermined(
uint256 tokenId,
uint256 chainId,
uint8 randomLayer0,
uint8 randomLayer1,
uint8 layer2,
uint8 layer3,
uint8 layer4,
uint8 layer5,
uint8 layer6
);
/// @dev packed into 1 storage slot
struct LayerData {
uint8 randomLayer0;
uint8 randomLayer1;
uint8 layer2;
uint8 layer3;
uint8 layer4;
uint8 layer5;
uint8 layer6;
uint200 originatingChainId;
}
/// @dev - packed into 1 storage slots
struct PremintedTokenData {
uint8 layer2;
uint8 layer3;
uint8 layer4;
uint8 layer5;
uint8 layer6;
uint96 tokenId; // 2^96=7.9228163e+28
address owner; // size of 20bytes or uint160
}
struct LayerCounts {
uint8 numImagesLayer2;
uint8 numImagesLayer3;
uint8 numImagesLayer4;
uint8 numImagesLayer5;
uint8 numImagesLayer6;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
import "./ILayerZeroUserApplicationConfig.sol";
interface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig {
/// @notice send a LayerZero message to the specified address at a LayerZero endpoint.
/// @param _dstChainId - the destination chain identifier
/// @param _destination - the address on destination chain (in bytes). address length/format may vary by chains
/// @param _payload - a custom bytes payload to send to the destination contract
/// @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address
/// @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction
/// @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination
function send(
uint16 _dstChainId,
bytes calldata _destination,
bytes calldata _payload,
address payable _refundAddress,
address _zroPaymentAddress,
bytes calldata _adapterParams
) external payable;
/// @notice used by the messaging library to publish verified payload
/// @param _srcChainId - the source chain identifier
/// @param _srcAddress - the source contract (as bytes) at the source chain
/// @param _dstAddress - the address on destination chain
/// @param _nonce - the unbound message ordering nonce
/// @param _gasLimit - the gas limit for external contract execution
/// @param _payload - verified payload to send to the destination contract
function receivePayload(
uint16 _srcChainId,
bytes calldata _srcAddress,
address _dstAddress,
uint64 _nonce,
uint256 _gasLimit,
bytes calldata _payload
) external;
/// @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain
/// @param _srcChainId - the source chain identifier
/// @param _srcAddress - the source chain contract address
function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress)
external
view
returns (uint64);
/// @notice get the outboundNonce from this source chain which, consequently, is always an EVM
/// @param _srcAddress - the source chain contract address
function getOutboundNonce(uint16 _dstChainId, address _srcAddress)
external
view
returns (uint64);
/// @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery
/// @param _dstChainId - the destination chain identifier
/// @param _userApplication - the user app address on this EVM chain
/// @param _payload - the custom message to send over LayerZero
/// @param _payInZRO - if false, user app pays the protocol fee in native token
/// @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain
function estimateFees(
uint16 _dstChainId,
address _userApplication,
bytes calldata _payload,
bool _payInZRO,
bytes calldata _adapterParam
) external view returns (uint256 nativeFee, uint256 zroFee);
/// @notice get this Endpoint's immutable source identifier
function getChainId() external view returns (uint16);
/// @notice the interface to retry failed message on this Endpoint destination
/// @param _srcChainId - the source chain identifier
/// @param _srcAddress - the source chain contract address
/// @param _payload - the payload to be retried
function retryPayload(
uint16 _srcChainId,
bytes calldata _srcAddress,
bytes calldata _payload
) external;
/// @notice query if any STORED payload (message blocking) at the endpoint.
/// @param _srcChainId - the source chain identifier
/// @param _srcAddress - the source chain contract address
function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress)
external
view
returns (bool);
/// @notice query if the _libraryAddress is valid for sending msgs.
/// @param _userApplication - the user app address on this EVM chain
function getSendLibraryAddress(address _userApplication)
external
view
returns (address);
/// @notice query if the _libraryAddress is valid for receiving msgs.
/// @param _userApplication - the user app address on this EVM chain
function getReceiveLibraryAddress(address _userApplication)
external
view
returns (address);
/// @notice query if the non-reentrancy guard for send() is on
/// @return true if the guard is on. false otherwise
function isSendingPayload() external view returns (bool);
/// @notice query if the non-reentrancy guard for receive() is on
/// @return true if the guard is on. false otherwise
function isReceivingPayload() external view returns (bool);
/// @notice get the configuration of the LayerZero messaging library of the specified version
/// @param _version - messaging library version
/// @param _chainId - the chainId for the pending config change
/// @param _userApplication - the contract address of the user application
/// @param _configType - type of configuration. every messaging library has its own convention.
function getConfig(
uint16 _version,
uint16 _chainId,
address _userApplication,
uint256 _configType
) external view returns (bytes memory);
/// @notice get the send() LayerZero messaging library version
/// @param _userApplication - the contract address of the user application
function getSendVersion(address _userApplication)
external
view
returns (uint16);
/// @notice get the lzReceive() LayerZero messaging library version
/// @param _userApplication - the contract address of the user application
function getReceiveVersion(address _userApplication)
external
view
returns (uint16);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
interface ILayerZeroReceiver {
/// @notice LayerZero endpoint will invoke this function to deliver the message on the destination
/// @param _srcChainId - the source endpoint identifier
/// @param _srcAddress - the source sending contract address from the source chain
/// @param _nonce - the ordered message nonce
/// @param _payload - the signed payload is the UA bytes has encoded to be sent
function lzReceive(
uint16 _srcChainId,
bytes calldata _srcAddress,
uint64 _nonce,
bytes calldata _payload
) external;
}//SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165StorageUpgradeable.sol";
abstract contract HasSecondarySaleFees is ERC165StorageUpgradeable {
event SecondarySaleFees(
uint256 tokenId,
address[] recipients,
uint256[] bps
);
/*
* bytes4(keccak256('getFeeBps(uint256)')) == 0x0ebd4c7f
* bytes4(keccak256('getFeeRecipients(uint256)')) == 0xb9c4d9fb
*
* => 0x0ebd4c7f ^ 0xb9c4d9fb == 0xb7799584
*/
bytes4 private constant _INTERFACE_ID_FEES = 0xb7799584;
function _initialize() public {
_registerInterface(_INTERFACE_ID_FEES);
}
function getFeeRecipients(uint256 id)
public
view
virtual
returns (address[] memory);
function getFeeBps(uint256 id)
public
view
virtual
returns (uint32[] memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) tweaked to accomodate a setter
pragma solidity 0.8.15;
/**
* @title Counters
* @author Matt Condon (@shrugs), tweaked by Denham
* @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 SettableCountersUpgradeable {
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;
}
function set(Counter storage counter, uint256 startIndex) internal {
counter._value = startIndex;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165Upgradeable.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721Upgradeable is IERC165Upgradeable {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (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 IERC721ReceiverUpgradeable {
/**
* @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 v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721Upgradeable.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
/**
* @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.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @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 ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165Upgradeable).interfaceId;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
*/
modifier initializer() {
bool isTopLevelCall = _setInitializedVersion(1);
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
* initialization step. This is essential to configure modules that are added through upgrades and that require
* initialization.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*/
modifier reinitializer(uint8 version) {
bool isTopLevelCall = _setInitializedVersion(version);
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(version);
}
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*/
function _disableInitializers() internal virtual {
_setInitializedVersion(type(uint8).max);
}
function _setInitializedVersion(uint8 version) private returns (bool) {
// If the contract is initializing we ignore whether _initialized is set in order to support multiple
// inheritance patterns, but we only do this in the context of a constructor, and for the lowest level
// of initializers, because in other contexts the contract may have been reentered.
if (_initializing) {
require(
version == 1 && !AddressUpgradeable.isContract(address(this)),
"Initializable: contract is already initialized"
);
return false;
} else {
require(_initialized < version, "Initializable: contract is already initialized");
_initialized = version;
return true;
}
}
}// 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 IERC165Upgradeable {
/**
* @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.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721Upgradeable.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721EnumerableUpgradeable is IERC721Upgradeable {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface IERC1822ProxiableUpgradeable {
/**
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
* address.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy.
*/
function proxiableUUID() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)
pragma solidity ^0.8.2;
import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";
/**
* @dev This abstract contract provides getters and event emitting update functions for
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
*
* _Available since v4.1._
*
* @custom:oz-upgrades-unsafe-allow delegatecall
*/
abstract contract ERC1967UpgradeUpgradeable is Initializable {
function __ERC1967Upgrade_init() internal onlyInitializing {
}
function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
}
// This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Returns the current implementation address.
*/
function _getImplementation() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Perform implementation upgrade
*
* Emits an {Upgraded} event.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Perform implementation upgrade with additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCall(
address newImplementation,
bytes memory data,
bool forceCall
) internal {
_upgradeTo(newImplementation);
if (data.length > 0 || forceCall) {
_functionDelegateCall(newImplementation, data);
}
}
/**
* @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCallUUPS(
address newImplementation,
bytes memory data,
bool forceCall
) internal {
// Upgrades from old implementations will perform a rollback test. This test requires the new
// implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
// this special case will break upgrade paths from old UUPS implementation to new ones.
if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
_setImplementation(newImplementation);
} else {
try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
} catch {
revert("ERC1967Upgrade: new implementation is not UUPS");
}
_upgradeToAndCall(newImplementation, data, forceCall);
}
}
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Returns the current admin.
*/
function _getAdmin() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
require(newAdmin != address(0), "ERC1967: new admin is the zero address");
StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {AdminChanged} event.
*/
function _changeAdmin(address newAdmin) internal {
emit AdminChanged(_getAdmin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
* This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
*/
bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Emitted when the beacon is upgraded.
*/
event BeaconUpgraded(address indexed beacon);
/**
* @dev Returns the current beacon.
*/
function _getBeacon() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the EIP1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
require(
AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
"ERC1967: beacon implementation is not a contract"
);
StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
}
/**
* @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
* not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
*
* Emits a {BeaconUpgraded} event.
*/
function _upgradeBeaconToAndCall(
address newBeacon,
bytes memory data,
bool forceCall
) internal {
_setBeacon(newBeacon);
emit BeaconUpgraded(newBeacon);
if (data.length > 0 || forceCall) {
_functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
}
}
/**
* @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) private returns (bytes memory) {
require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.0;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeaconUpgradeable {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {BeaconProxy} will check that this address is a contract.
*/
function implementation() external view returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)
pragma solidity ^0.8.0;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
*/
library StorageSlotUpgradeable {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
assembly {
r.slot := slot
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "../interfaces/ILayerZeroReceiver.sol";
import "../interfaces/ILayerZeroUserApplicationConfig.sol";
import "../interfaces/ILayerZeroEndpoint.sol";
/*
* a generic LzReceiver implementation
*/
abstract contract LzAppUpgradeable is
Initializable,
AccessControlUpgradeable,
ILayerZeroReceiver,
ILayerZeroUserApplicationConfig
{
ILayerZeroEndpoint public lzEndpoint;
mapping(uint16 => bytes) public trustedRemoteLookup;
mapping(uint16 => mapping(uint256 => uint256)) public minDstGasLookup;
event SetTrustedRemote(uint16 _srcChainId, bytes _srcAddress);
function __LzAppUpgradeable_init(address _endpoint)
internal
onlyInitializing
{
__LzAppUpgradeable_init_unchained(_endpoint);
}
function __LzAppUpgradeable_init_unchained(address _endpoint)
internal
onlyInitializing
{
lzEndpoint = ILayerZeroEndpoint(_endpoint);
}
function lzReceive(
uint16 _srcChainId,
bytes memory _srcAddress,
uint64 _nonce,
bytes memory _payload
) public virtual override {
// lzReceive must be called by the endpoint for security
require(
_msgSender() == address(lzEndpoint),
"LZ: invalid endpoint caller"
);
bytes memory trustedRemote = trustedRemoteLookup[_srcChainId];
// if will still block the message pathway from (srcChainId, srcAddress). should not receive message from untrusted remote.
require(
trustedRemote.length > 0 &&
keccak256(_srcAddress) == keccak256(trustedRemote),
"LzApp: invalid source sending contract"
);
_blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
}
// abstract function - the default behaviour of LayerZero is blocking. See: NonblockingLzApp if you dont need to enforce ordered messaging
function _blockingLzReceive(
uint16 _srcChainId,
bytes memory _srcAddress,
uint64 _nonce,
bytes memory _payload
) internal virtual;
function _lzSend(
uint16 _dstChainId,
bytes memory _payload,
address payable _refundAddress,
address _zroPaymentAddress,
bytes memory _adapterParams
) internal virtual {
bytes memory trustedRemote = trustedRemoteLookup[_dstChainId];
require(trustedRemote.length != 0, "LZ: dest chn isnt trsted src");
lzEndpoint.send{value: msg.value}(
_dstChainId,
trustedRemote,
_payload,
_refundAddress,
_zroPaymentAddress,
_adapterParams
);
}
function _checkGasLimit(
uint16 _dstChainId,
uint256 _type,
bytes memory _adapterParams,
uint256 _extraGas
) internal view {
uint256 providedGasLimit = getGasLimit(_adapterParams);
uint256 minGasLimit = minDstGasLookup[_dstChainId][_type] + _extraGas;
require(minGasLimit > 0, "LzApp: minGasLimit not set");
require(providedGasLimit >= minGasLimit, "LzApp: gas limit is too low");
}
//---------------------------UserApplication config----------------------------------------
function getConfig(
uint16 _version,
uint16 _chainId,
address,
uint256 _configType
) external view returns (bytes memory) {
return
lzEndpoint.getConfig(
_version,
_chainId,
address(this),
_configType
);
}
// generic config for LayerZero user Application
function setConfig(
uint16 _version,
uint16 _chainId,
uint256 _configType,
bytes calldata _config
) external override onlyRole(DEFAULT_ADMIN_ROLE) {
lzEndpoint.setConfig(_version, _chainId, _configType, _config);
}
function setSendVersion(uint16 _version)
external
override
onlyRole(DEFAULT_ADMIN_ROLE)
{
lzEndpoint.setSendVersion(_version);
}
function setReceiveVersion(uint16 _version)
external
override
onlyRole(DEFAULT_ADMIN_ROLE)
{
lzEndpoint.setReceiveVersion(_version);
}
function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress)
external
override
onlyRole(DEFAULT_ADMIN_ROLE)
{
lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress);
}
/// @notice specify trusted crosschain sender contract address
/// @param _srcChainId - layerZero unique chain id
/// @param _srcAddress - contract address of source
/// @dev layer zero chain id's are not the same as vanilla chain ids
function setTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress)
external
onlyRole(DEFAULT_ADMIN_ROLE)
{
trustedRemoteLookup[_srcChainId] = _srcAddress;
emit SetTrustedRemote(_srcChainId, _srcAddress);
}
function setMinDstGasLookup(
uint16 _dstChainId,
uint256 _type,
uint256 _dstGasAmount
) external onlyRole(DEFAULT_ADMIN_ROLE) {
require(_dstGasAmount > 0, "LzApp: invalid _dstGasAmount");
minDstGasLookup[_dstChainId][_type] = _dstGasAmount;
}
function getGasLimit(bytes memory _adapterParams)
internal
pure
returns (uint256 gasLimit)
{
assembly {
gasLimit := mload(add(_adapterParams, 34))
}
}
//--------------------------- VIEW FUNCTION ----------------------------------------
/// @notice for reading which addresses are trusted for each chain
/// @param _srcChainId - layerZero unique chain id
/// @param _srcAddress - contract address of source
/// @dev layer zero chain id's are not the same as vanilla chain ids
function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress)
external
view
returns (bool)
{
bytes memory trustedSource = trustedRemoteLookup[_srcChainId];
return keccak256(trustedSource) == keccak256(_srcAddress);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
function __AccessControl_init() internal onlyInitializing {
}
function __AccessControl_init_unchained() internal onlyInitializing {
}
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
StringsUpgradeable.toHexString(uint160(account), 20),
" is missing role ",
StringsUpgradeable.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
interface ILayerZeroUserApplicationConfig {
/// @notice set the configuration of the LayerZero messaging library of the specified version
/// @param _version - messaging library version
/// @param _chainId - the chainId for the pending config change
/// @param _configType - type of configuration. every messaging library has its own convention.
/// @param _config - configuration in the bytes. can encode arbitrary content.
function setConfig(
uint16 _version,
uint16 _chainId,
uint256 _configType,
bytes calldata _config
) external;
/// @notice set the send() LayerZero messaging library version to _version
/// @param _version - new messaging library version
function setSendVersion(uint16 _version) external;
/// @notice set the lzReceive() LayerZero messaging library version to _version
/// @param _version - new messaging library version
function setReceiveVersion(uint16 _version) external;
/// @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload
/// @param _srcChainId - the chainId of the source chain
/// @param _srcAddress - the contract address of the source contract at the source chain
function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress)
external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControlUpgradeable {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
/** *************************************************************************************************************
* @notice Interface for upgradeable contracts using VRF randomness
* @dev see https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/VRFConsumerBaseV2.sol
* **************************************************************************************************************
*/
abstract contract VRFConsumerBaseV2Upgradeable is Initializable {
error OnlyCoordinatorCanFulfill(address have, address want);
address public immutable vrfCoordinator;
/**
* @param _vrfCoordinator address of VRFCoordinator contract
*/
constructor(address _vrfCoordinator) {
vrfCoordinator = _vrfCoordinator;
}
/**
* @notice fulfillRandomness handles the VRF response. Your contract must
* @notice implement it. See "SECURITY CONSIDERATIONS" above for important
* @notice principles to keep in mind when implementing your fulfillRandomness
* @notice method.
*
* @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this
* @dev signature, and will call it once it has verified the proof
* @dev associated with the randomness. (It is triggered via a call to
* @dev rawFulfillRandomness, below.)
*
* @param requestId The Id initially returned by requestRandomness
* @param randomWords the VRF output expanded to the requested number of words
*/
function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords)
internal
virtual;
// rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
// proof. rawFulfillRandomness then calls fulfillRandomness, after validating
// the origin of the call
function rawFulfillRandomWords(
uint256 requestId,
uint256[] memory randomWords
) external {
if (msg.sender != vrfCoordinator) {
revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator);
}
fulfillRandomWords(requestId, randomWords);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface LinkTokenInterface {
function allowance(address owner, address spender) external view returns (uint256 remaining);
function approve(address spender, uint256 value) external returns (bool success);
function balanceOf(address owner) external view returns (uint256 balance);
function decimals() external view returns (uint8 decimalPlaces);
function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);
function increaseApproval(address spender, uint256 subtractedValue) external;
function name() external view returns (string memory tokenName);
function symbol() external view returns (string memory tokenSymbol);
function totalSupply() external view returns (uint256 totalTokensIssued);
function transfer(address to, uint256 value) external returns (bool success);
function transferAndCall(
address to,
uint256 value,
bytes calldata data
) external returns (bool success);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool success);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface VRFCoordinatorV2Interface {
/**
* @notice Get configuration relevant for making requests
* @return minimumRequestConfirmations global min for request confirmations
* @return maxGasLimit global max for request gas limit
* @return s_provingKeyHashes list of registered key hashes
*/
function getRequestConfig()
external
view
returns (
uint16,
uint32,
bytes32[] memory
);
/**
* @notice Request a set of random words.
* @param keyHash - Corresponds to a particular oracle job which uses
* that key for generating the VRF proof. Different keyHash's have different gas price
* ceilings, so you can select a specific one to bound your maximum per request cost.
* @param subId - The ID of the VRF subscription. Must be funded
* with the minimum subscription balance required for the selected keyHash.
* @param minimumRequestConfirmations - How many blocks you'd like the
* oracle to wait before responding to the request. See SECURITY CONSIDERATIONS
* for why you may want to request more. The acceptable range is
* [minimumRequestBlockConfirmations, 200].
* @param callbackGasLimit - How much gas you'd like to receive in your
* fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords
* may be slightly less than this amount because of gas used calling the function
* (argument decoding etc.), so you may need to request slightly more than you expect
* to have inside fulfillRandomWords. The acceptable range is
* [0, maxGasLimit]
* @param numWords - The number of uint256 random values you'd like to receive
* in your fulfillRandomWords callback. Note these numbers are expanded in a
* secure way by the VRFCoordinator from a single random value supplied by the oracle.
* @return requestId - A unique identifier of the request. Can be used to match
* a request to a response in fulfillRandomWords.
*/
function requestRandomWords(
bytes32 keyHash,
uint64 subId,
uint16 minimumRequestConfirmations,
uint32 callbackGasLimit,
uint32 numWords
) external returns (uint256 requestId);
/**
* @notice Create a VRF subscription.
* @return subId - A unique subscription id.
* @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.
* @dev Note to fund the subscription, use transferAndCall. For example
* @dev LINKTOKEN.transferAndCall(
* @dev address(COORDINATOR),
* @dev amount,
* @dev abi.encode(subId));
*/
function createSubscription() external returns (uint64 subId);
/**
* @notice Get a VRF subscription.
* @param subId - ID of the subscription
* @return balance - LINK balance of the subscription in juels.
* @return reqCount - number of requests for this subscription, determines fee tier.
* @return owner - owner of the subscription.
* @return consumers - list of consumer address which are able to use this subscription.
*/
function getSubscription(uint64 subId)
external
view
returns (
uint96 balance,
uint64 reqCount,
address owner,
address[] memory consumers
);
/**
* @notice Request subscription owner transfer.
* @param subId - ID of the subscription
* @param newOwner - proposed new owner of the subscription
*/
function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;
/**
* @notice Request subscription owner transfer.
* @param subId - ID of the subscription
* @dev will revert if original owner of subId has
* not requested that msg.sender become the new owner.
*/
function acceptSubscriptionOwnerTransfer(uint64 subId) external;
/**
* @notice Add a consumer to a VRF subscription.
* @param subId - ID of the subscription
* @param consumer - New consumer which can use the subscription
*/
function addConsumer(uint64 subId, address consumer) external;
/**
* @notice Remove a consumer from a VRF subscription.
* @param subId - ID of the subscription
* @param consumer - Consumer to remove from the subscription
*/
function removeConsumer(uint64 subId, address consumer) external;
/**
* @notice Cancel a subscription
* @param subId - ID of the subscription
* @param to - Where to send the remaining LINK to
*/
function cancelSubscription(uint64 subId, address to) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/** ****************************************************************************
* @notice Interface for contracts using VRF randomness
* *****************************************************************************
* @dev PURPOSE
*
* @dev Reggie the Random Oracle (not his real job) wants to provide randomness
* @dev to Vera the verifier in such a way that Vera can be sure he's not
* @dev making his output up to suit himself. Reggie provides Vera a public key
* @dev to which he knows the secret key. Each time Vera provides a seed to
* @dev Reggie, he gives back a value which is computed completely
* @dev deterministically from the seed and the secret key.
*
* @dev Reggie provides a proof by which Vera can verify that the output was
* @dev correctly computed once Reggie tells it to her, but without that proof,
* @dev the output is indistinguishable to her from a uniform random sample
* @dev from the output space.
*
* @dev The purpose of this contract is to make it easy for unrelated contracts
* @dev to talk to Vera the verifier about the work Reggie is doing, to provide
* @dev simple access to a verifiable source of randomness. It ensures 2 things:
* @dev 1. The fulfillment came from the VRFCoordinator
* @dev 2. The consumer contract implements fulfillRandomWords.
* *****************************************************************************
* @dev USAGE
*
* @dev Calling contracts must inherit from VRFConsumerBase, and can
* @dev initialize VRFConsumerBase's attributes in their constructor as
* @dev shown:
*
* @dev contract VRFConsumer {
* @dev constructor(<other arguments>, address _vrfCoordinator, address _link)
* @dev VRFConsumerBase(_vrfCoordinator) public {
* @dev <initialization with other arguments goes here>
* @dev }
* @dev }
*
* @dev The oracle will have given you an ID for the VRF keypair they have
* @dev committed to (let's call it keyHash). Create subscription, fund it
* @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface
* @dev subscription management functions).
* @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations,
* @dev callbackGasLimit, numWords),
* @dev see (VRFCoordinatorInterface for a description of the arguments).
*
* @dev Once the VRFCoordinator has received and validated the oracle's response
* @dev to your request, it will call your contract's fulfillRandomWords method.
*
* @dev The randomness argument to fulfillRandomWords is a set of random words
* @dev generated from your requestId and the blockHash of the request.
*
* @dev If your contract could have concurrent requests open, you can use the
* @dev requestId returned from requestRandomWords to track which response is associated
* @dev with which randomness request.
* @dev See "SECURITY CONSIDERATIONS" for principles to keep in mind,
* @dev if your contract could have multiple requests in flight simultaneously.
*
* @dev Colliding `requestId`s are cryptographically impossible as long as seeds
* @dev differ.
*
* *****************************************************************************
* @dev SECURITY CONSIDERATIONS
*
* @dev A method with the ability to call your fulfillRandomness method directly
* @dev could spoof a VRF response with any random value, so it's critical that
* @dev it cannot be directly called by anything other than this base contract
* @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).
*
* @dev For your users to trust that your contract's random behavior is free
* @dev from malicious interference, it's best if you can write it so that all
* @dev behaviors implied by a VRF response are executed *during* your
* @dev fulfillRandomness method. If your contract must store the response (or
* @dev anything derived from it) and use it later, you must ensure that any
* @dev user-significant behavior which depends on that stored value cannot be
* @dev manipulated by a subsequent VRF request.
*
* @dev Similarly, both miners and the VRF oracle itself have some influence
* @dev over the order in which VRF responses appear on the blockchain, so if
* @dev your contract could have multiple VRF requests in flight simultaneously,
* @dev you must ensure that the order in which the VRF responses arrive cannot
* @dev be used to manipulate your contract's user-significant behavior.
*
* @dev Since the block hash of the block which contains the requestRandomness
* @dev call is mixed into the input to the VRF *last*, a sufficiently powerful
* @dev miner could, in principle, fork the blockchain to evict the block
* @dev containing the request, forcing the request to be included in a
* @dev different block with a different hash, and therefore a different input
* @dev to the VRF. However, such an attack would incur a substantial economic
* @dev cost. This cost scales with the number of blocks the VRF oracle waits
* @dev until it calls responds to a request. It is for this reason that
* @dev that you can signal to an oracle you'd like them to wait longer before
* @dev responding to the request (however this is not enforced in the contract
* @dev and so remains effective only in the case of unmodified oracle software).
*/
abstract contract VRFConsumerBaseV2 {
error OnlyCoordinatorCanFulfill(address have, address want);
address private immutable vrfCoordinator;
/**
* @param _vrfCoordinator address of VRFCoordinator contract
*/
constructor(address _vrfCoordinator) {
vrfCoordinator = _vrfCoordinator;
}
/**
* @notice fulfillRandomness handles the VRF response. Your contract must
* @notice implement it. See "SECURITY CONSIDERATIONS" above for important
* @notice principles to keep in mind when implementing your fulfillRandomness
* @notice method.
*
* @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this
* @dev signature, and will call it once it has verified the proof
* @dev associated with the randomness. (It is triggered via a call to
* @dev rawFulfillRandomness, below.)
*
* @param requestId The Id initially returned by requestRandomness
* @param randomWords the VRF output expanded to the requested number of words
*/
function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual;
// rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
// proof. rawFulfillRandomness then calls fulfillRandomness, after validating
// the origin of the call
function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {
if (msg.sender != vrfCoordinator) {
revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator);
}
fulfillRandomWords(requestId, randomWords);
}
}pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.15;
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
abstract contract APMorganRoles is Initializable, AccessControlUpgradeable {
/// Roles
bytes32 public constant UPGRADER_ROLE = keccak256("UPGRADER_ROLE");
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant APMORGAN_ROLE = keccak256("APMORGAN_ROLE");
/// @notice initialize ap morgan access control contract
function __roles_init(address admin, address apMorgan)
internal
onlyInitializing
{
__AccessControl_init();
_grantRole(DEFAULT_ADMIN_ROLE, admin);
_grantRole(UPGRADER_ROLE, admin);
_grantRole(APMORGAN_ROLE, apMorgan);
}
}pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}{
"optimizer": {
"enabled": true,
"runs": 1
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"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":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"MessageFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"ReceiveNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"recipients","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"bps","type":"uint256[]"}],"name":"SecondarySaleFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"SetTrustedRemote","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"chainId","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"randomLayer0","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"randomLayer1","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"layer2","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"layer3","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"layer4","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"layer5","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"layer6","type":"uint8"}],"name":"TokenLayersDetermined","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":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GREENLIST_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_initialize","outputs":[],"stateMutability":"nonpayable","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":"address","name":"","type":"address"}],"name":"claimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_vrfPaymentContribution","type":"uint256"},{"internalType":"uint256","name":"_lzGas","type":"uint256"}],"name":"configurePaymentContributionAndLzGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endIndex","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"uint64","name":"","type":"uint64"}],"name":"failedMessages","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"forceResumeReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"_configType","type":"uint256"}],"name":"getConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getFeeBps","outputs":[{"internalType":"uint32[]","name":"","type":"uint32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getFeeRecipients","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenIdCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"originatingChainId","type":"uint256"},{"internalType":"uint8","name":"layer2","type":"uint8"},{"internalType":"uint8","name":"layer3","type":"uint8"},{"internalType":"uint8","name":"layer4","type":"uint8"},{"internalType":"uint8","name":"layer5","type":"uint8"},{"internalType":"uint8","name":"layer6","type":"uint8"}],"name":"getTokenUniquenessKey","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_endpoint","type":"address"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"uint16","name":"_startIndex","type":"uint16"},{"internalType":"uint16","name":"_endIndex","type":"uint16"},{"internalType":"bytes32","name":"root","type":"bytes32"},{"internalType":"uint8","name":"numl2","type":"uint8"},{"internalType":"uint8","name":"numl3","type":"uint8"},{"internalType":"uint8","name":"numl4","type":"uint8"},{"internalType":"uint8","name":"numl5","type":"uint8"},{"internalType":"uint8","name":"numl6","type":"uint8"},{"internalType":"uint256","name":"_vrfPaymentContribution","type":"uint256"},{"internalType":"address","name":"_apMorganMinter","type":"address"}],"name":"initialize","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":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"isTrustedRemote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"layerComboUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"layerCounts","outputs":[{"internalType":"uint8","name":"numImagesLayer2","type":"uint8"},{"internalType":"uint8","name":"numImagesLayer3","type":"uint8"},{"internalType":"uint8","name":"numImagesLayer4","type":"uint8"},{"internalType":"uint8","name":"numImagesLayer5","type":"uint8"},{"internalType":"uint8","name":"numImagesLayer6","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lzEndpoint","outputs":[{"internalType":"contract ILayerZeroEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"minDstGasLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint8","name":"randomLayer0","type":"uint8"},{"internalType":"uint8","name":"randomLayer1","type":"uint8"}],"name":"mintAPMorgan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"uint8","name":"layer2","type":"uint8"},{"internalType":"uint8","name":"layer3","type":"uint8"},{"internalType":"uint8","name":"layer4","type":"uint8"},{"internalType":"uint8","name":"layer5","type":"uint8"},{"internalType":"uint8","name":"layer6","type":"uint8"}],"name":"mintGreenList","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"nonblockingLzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"preferredToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"premintedTokens","outputs":[{"internalType":"uint8","name":"layer2","type":"uint8"},{"internalType":"uint8","name":"layer3","type":"uint8"},{"internalType":"uint8","name":"layer4","type":"uint8"},{"internalType":"uint8","name":"layer5","type":"uint8"},{"internalType":"uint8","name":"layer6","type":"uint8"},{"internalType":"uint96","name":"tokenId","type":"uint96"},{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"retryMessage","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","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":[],"name":"saleFeesRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"secondarySalePercentage","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_configType","type":"uint256"},{"internalType":"bytes","name":"_config","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_saleFeesRecipient","type":"address"},{"internalType":"uint32","name":"_feeBasisPoints","type":"uint32"}],"name":"setFeeParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_startIndex","type":"uint16"},{"internalType":"uint16","name":"_endIndex","type":"uint16"}],"name":"setIndexes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"root","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint256","name":"_type","type":"uint256"},{"internalType":"uint256","name":"_dstGasAmount","type":"uint256"}],"name":"setMinDstGasLookup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"numl2","type":"uint8"},{"internalType":"uint8","name":"numl3","type":"uint8"},{"internalType":"uint8","name":"numl4","type":"uint8"},{"internalType":"uint8","name":"numl5","type":"uint8"},{"internalType":"uint8","name":"numl6","type":"uint8"}],"name":"setNumberOfAssetsInLayer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"setPreferredToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setReceiveVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setSendVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"setTrustedRemote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startIndex","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"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":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenLayers","outputs":[{"internalType":"uint8","name":"randomLayer0","type":"uint8"},{"internalType":"uint8","name":"randomLayer1","type":"uint8"},{"internalType":"uint8","name":"layer2","type":"uint8"},{"internalType":"uint8","name":"layer3","type":"uint8"},{"internalType":"uint8","name":"layer4","type":"uint8"},{"internalType":"uint8","name":"layer5","type":"uint8"},{"internalType":"uint8","name":"layer6","type":"uint8"},{"internalType":"uint200","name":"originatingChainId","type":"uint200"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"transferCrossChain","outputs":[],"stateMutability":"payable","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":"uint16","name":"","type":"uint16"}],"name":"trustedRemoteLookup","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"vrfPaymentContribution","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60a0604052306080523480156200001557600080fd5b5060006200002262000029565b5062000142565b6200003560ff62000038565b50565b60008054610100900460ff1615620000a1578160ff1660011480156200007157506200006f30620000e560201b620030631760201c565b155b620000995760405162461bcd60e51b81526004016200009090620000f4565b60405180910390fd5b506000919050565b60005460ff808416911610620000cb5760405162461bcd60e51b81526004016200009090620000f4565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b608051615fcc6200017a600039600081816117420152818161178201528181611a0601528181611a460152611b510152615fcc6000f3fe6080604052600436106103145760003560e01c80621d35671461031957806301ffc9a71461033b5780630298442d1461037057806306fdde031461039057806307810867146103b257806307e0db17146103f9578063081812fc14610419578063095ea7b3146104515780630ebd4c7f1461047157806310ddb1371461049e57806311cc69cb146104be57806311de0518146104ec57806318160ddd1461050c5780631bf751dd1461052157806323b872dd14610543578063248a9ca3146105635780632eb4a7ab146105835780632f2ff15d1461059a5780632f745c59146105ba57806336568abe146105da5780633659cfe6146105fa5780633d8b38f61461061a5780633e0e828b1461063a5780634122bec41461066957806342842e0e1461068957806342d65a8d146106a95780634c97f31a146106c95780634de9fb93146106fa5780634eb4a1e51461071b5780634f1ef2861461073b5780634f6ccce71461074e57806352d1902d1461076e57806357ab0af1146107835780635ac293c9146107a35780635b8c41e6146107c55780635e0d09bb146108155780636352211e146108e657806366ad5c8a1461090657806370a08231146109265780637533d7881461094657806376945b5f146109665780637cb647591461097d57806380ae4ebc1461099d5780638202a750146109b257806385bab09c146109ec5780638c132016146109ff57806391d1485414610a1f57806395d89b4114610a3f5780639852634314610a545780639b57db5f14610aca578063a217fddf14610aea578063a22cb46514610aff578063b353aaa714610b1f578063b88d4fde14610b40578063b9c4d9fb14610b60578063bb21a39214610b8d578063bf0cda2914610bad578063c87b56dd14610bcd578063c884ef8314610bed578063cbed8b9c14610c1e578063d1deba1f14610c3e578063d539139314610c51578063d547741f14610c73578063d9ddda9714610c93578063db250fee14610d64578063dbfd4b9814610d77578063e985e9c514610d8c578063eb8d72b714610dac578063f5ecbdbc14610dcc578063f72c0d8b14610dec575b600080fd5b34801561032557600080fd5b50610339610334366004614c0d565b610e0e565b005b34801561034757600080fd5b5061035b610356366004614ca7565b610fa0565b60405190151581526020015b60405180910390f35b34801561037c57600080fd5b5061033961038b366004614cfe565b610fcf565b34801561039c57600080fd5b506103a56111fb565b6040516103679190614e30565b3480156103be57600080fd5b506103eb6103cd366004614e43565b61016160209081526000928352604080842090915290825290205481565b604051908152602001610367565b34801561040557600080fd5b50610339610414366004614e6d565b61128d565b34801561042557600080fd5b50610439610434366004614e88565b6112ff565b6040516001600160a01b039091168152602001610367565b34801561045d57600080fd5b5061033961046c366004614ea1565b611387565b34801561047d57600080fd5b5061049161048c366004614e88565b611497565b6040516103679190614ebf565b3480156104aa57600080fd5b506103396104b9366004614e6d565b6114ff565b3480156104ca57600080fd5b506103eb6104d9366004614f09565b6101ff6020526000908152604090205481565b3480156104f857600080fd5b50610339610507366004614e88565b61153f565b34801561051857600080fd5b506099546103eb565b34801561052d57600080fd5b506103eb600080516020615e8e83398151915281565b34801561054f57600080fd5b5061033961055e366004614f26565b6115c1565b34801561056f57600080fd5b506103eb61057e366004614e88565b6115f2565b34801561058f57600080fd5b506103eb6102005481565b3480156105a657600080fd5b506103396105b5366004614f67565b611608565b3480156105c657600080fd5b506103eb6105d5366004614ea1565b611624565b3480156105e657600080fd5b506103396105f5366004614f67565b6116ba565b34801561060657600080fd5b50610339610615366004614f09565b611738565b34801561062657600080fd5b5061035b610635366004614fdf565b611800565b34801561064657600080fd5b50610201546106569061ffff1681565b60405161ffff9091168152602001610367565b34801561067557600080fd5b506103eb610684366004615031565b6118ce565b34801561069557600080fd5b506103396106a4366004614f26565b611950565b3480156106b557600080fd5b506103396106c4366004614fdf565b61196b565b3480156106d557600080fd5b5061035b6106e4366004614e88565b6101fb6020526000908152604090205460ff1681565b34801561070657600080fd5b5061020554610439906001600160a01b031681565b34801561072757600080fd5b506103396107363660046150aa565b6119e3565b6103396107493660046150cc565b6119fc565b34801561075a57600080fd5b506103eb610769366004614e88565b611ab1565b34801561077a57600080fd5b506103eb611b44565b34801561078f57600080fd5b5061033961079e36600461511b565b611bf2565b3480156107af57600080fd5b50610201546106569062010000900461ffff1681565b3480156107d157600080fd5b506103eb6107e036600461515d565b610194602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b34801561082157600080fd5b50610891610830366004614e88565b6101fc6020526000908152604090205460ff80821691610100810482169162010000820481169163010000008104821691600160201b8204811691600160281b8104821691600160301b82041690600160381b90046001600160c81b031688565b6040805160ff998a16815297891660208901529588169587019590955292861660608601529085166080850152841660a084015290921660c08201526001600160c81b0390911660e082015261010001610367565b3480156108f257600080fd5b50610439610901366004614e88565b611f62565b34801561091257600080fd5b50610339610921366004614c0d565b611fd9565b34801561093257600080fd5b506103eb610941366004614f09565b612049565b34801561095257600080fd5b506103a5610961366004614e6d565b6120d0565b34801561097257600080fd5b506103eb6102045481565b34801561098957600080fd5b50610339610998366004614e88565b61216b565b3480156109a957600080fd5b5061033961218a565b3480156109be57600080fd5b50610205546109d790600160a01b900463ffffffff1681565b60405163ffffffff9091168152602001610367565b6103396109fa3660046151ba565b61219c565b348015610a0b57600080fd5b50610339610a1a3660046151ef565b6124d4565b348015610a2b57600080fd5b5061035b610a3a366004614f67565b612509565b348015610a4b57600080fd5b506103a5612535565b348015610a6057600080fd5b5061020254610a969060ff80821691610100810482169162010000820481169163010000008104821691600160201b9091041685565b6040805160ff968716815294861660208601529285169284019290925283166060830152909116608082015260a001610367565b348015610ad657600080fd5b50610339610ae5366004615222565b612544565b348015610af657600080fd5b506103eb600081565b348015610b0b57600080fd5b50610339610b1a366004615255565b6125c1565b348015610b2b57600080fd5b5061015f54610439906001600160a01b031681565b348015610b4c57600080fd5b50610339610b5b366004615288565b6125cc565b348015610b6c57600080fd5b50610b80610b7b366004614e88565b6125fe565b60405161036791906152e7565b348015610b9957600080fd5b50610339610ba8366004615328565b612663565b348015610bb957600080fd5b50610339610bc836600461535f565b6126c4565b348015610bd957600080fd5b506103a5610be8366004614e88565b61281e565b348015610bf957600080fd5b5061035b610c08366004614f09565b6101fe6020526000908152604090205460ff1681565b348015610c2a57600080fd5b50610339610c393660046153d0565b6128e8565b610339610c4c366004614c0d565b612966565b348015610c5d57600080fd5b506103eb600080516020615f3583398151915281565b348015610c7f57600080fd5b50610339610c8e366004614f67565b612aba565b348015610c9f57600080fd5b50610d0f610cae366004614e88565b6101fd602052600090815260409020805460019091015460ff80831692610100810482169262010000820483169263010000008304811692600160201b810490911691600160281b9091046001600160601b0316906001600160a01b031687565b6040805160ff9889168152968816602088015294871694860194909452918516606085015290931660808301526001600160601b0390921660a08201526001600160a01b0390911660c082015260e001610367565b610339610d7236600461543e565b612ad6565b348015610d8357600080fd5b506103eb612f22565b348015610d9857600080fd5b5061035b610da7366004615504565b612f33565b348015610db857600080fd5b50610339610dc7366004614fdf565b612f61565b348015610dd857600080fd5b506103a5610de7366004615532565b612fcd565b348015610df857600080fd5b506103eb600080516020615ece83398151915281565b61015f546001600160a01b0316336001600160a01b031614610e755760405162461bcd60e51b815260206004820152601b60248201527a262d1d1034b73b30b634b21032b7323837b4b73a1031b0b63632b960291b60448201526064015b60405180910390fd5b61ffff84166000908152610160602052604081208054610e949061557f565b80601f0160208091040260200160405190810160405280929190818152602001828054610ec09061557f565b8015610f0d5780601f10610ee257610100808354040283529160200191610f0d565b820191906000526020600020905b815481529060010190602001808311610ef057829003601f168201915b5050505050905060008151118015610f32575080805190602001208480519060200120145b610f8d5760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b6064820152608401610e6c565b610f9985858585613072565b5050505050565b6000610fab82613164565b80610fba5750610fba82613189565b80610fc95750610fc9826131ae565b92915050565b6000610fdb60016131e0565b90508015610ff3576000805461ff0019166101001790555b61104860405180604001604052806018815260200177209728171026b7b933b0b71029b0b4b634b7339021b63ab160411b8152506040518060400160405280600381526020016241504d60e81b815250613274565b6110506132a5565b6110586132a5565b6110606132a5565b61106b60008d6132cc565b611083600080516020615ece8339815191528d6132cc565b61109b600080516020615e8e8339815191528d6132cc565b6110b3600080516020615f35833981519152836132cc565b6110bc8d613353565b6207a1206101f9556110cc61218a565b61ffff8b166101fa556040805160a08101825260ff8a81168083528a8216602084018190528a8316948401859052898316606085018190529289166080909401849052610202805461ffff19169092176101009091021763ffff000019166201000094850263ff00000019161763010000009092029190911760ff60201b1916600160201b9092029190911790556102008a9055610201805461ffff8e811663ffffffff1990921691909117908d1690920291909117905561020483905561020380546001600160a01b0319166001600160a01b03841617905580156111ec576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050505050505050565b60606065805461120a9061557f565b80601f01602080910402602001604051908101604052809291908181526020018280546112369061557f565b80156112835780601f1061125857610100808354040283529160200191611283565b820191906000526020600020905b81548152906001019060200180831161126657829003601f168201915b5050505050905090565b600061129881613383565b61015f546040516307e0db1760e01b815261ffff841660048201526001600160a01b03909116906307e0db17906024015b600060405180830381600087803b1580156112e357600080fd5b505af11580156112f7573d6000803e3d6000fd5b505050505050565b600061130a8261338d565b61136b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610e6c565b506000908152606960205260409020546001600160a01b031690565b600061139282611f62565b9050806001600160a01b0316836001600160a01b0316036113ff5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610e6c565b336001600160a01b038216148061141b575061141b8133612f33565b6114885760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776044820152771b995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b60421b6064820152608401610e6c565b61149283836133aa565b505050565b604080516001808252818301909252606091600091906020808301908036833701905050905061020560149054906101000a900463ffffffff16816000815181106114e4576114e46155b9565b63ffffffff9092166020928302919091019091015292915050565b600061150a81613383565b61015f546040516310ddb13760e01b815261ffff841660048201526001600160a01b03909116906310ddb137906024016112c9565b8061154981611f62565b6001600160a01b0316336001600160a01b0316148061157857503361156d826112ff565b6001600160a01b0316145b6115945760405162461bcd60e51b8152600401610e6c906155cf565b816101ff60006115a385611f62565b6001600160a01b031681526020810191909152604001600020555050565b6115cb3382613418565b6115e75760405162461bcd60e51b8152600401610e6c90615602565b6114928383836134e1565b600090815261012d602052604090206001015490565b611611826115f2565b61161a81613383565b61149283836132cc565b600061162f83612049565b82106116915760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610e6c565b506001600160a01b03919091166000908152609760209081526040808320938352929052205490565b6001600160a01b038116331461172a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610e6c565b611734828261367c565b5050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036117805760405162461bcd60e51b8152600401610e6c90615653565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166117b26136e4565b6001600160a01b0316146117d85760405162461bcd60e51b8152600401610e6c9061568d565b6117e181613700565b604080516000808252602082019092526117fd91839190613718565b50565b61ffff831660009081526101606020526040812080548291906118229061557f565b80601f016020809104026020016040519081016040528092919081815260200182805461184e9061557f565b801561189b5780601f106118705761010080835404028352916020019161189b565b820191906000526020600020905b81548152906001019060200180831161187e57829003601f168201915b5050505050905083836040516118b29291906156c7565b60405180910390208180519060200120149150505b9392505050565b604080516000602082018190526001600160f81b031960f889811b8216602285015288811b8216602385015287811b8216602485015286811b8216602585015285901b16602683015266ffffffffffffff1960388a901b1660278301529101604051602081830303815290604052611945906156d7565b979650505050505050565b611492838383604051806020016040528060008152506125cc565b600061197681613383565b61015f546040516342d65a8d60e01b81526001600160a01b03909116906342d65a8d906119ab90879087908790600401615724565b600060405180830381600087803b1580156119c557600080fd5b505af11580156119d9573d6000803e3d6000fd5b5050505050505050565b60006119ee81613383565b50610204919091556101f955565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003611a445760405162461bcd60e51b8152600401610e6c90615653565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611a766136e4565b6001600160a01b031614611a9c5760405162461bcd60e51b8152600401610e6c9061568d565b611aa582613700565b61173482826001613718565b6000611abc60995490565b8210611b1f5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610e6c565b60998281548110611b3257611b326155b9565b90600052602060002001549050919050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611bdf5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608401610e6c565b50600080516020615eee83398151915290565b600080516020615f35833981519152611c0a81613383565b60008481526101fd60208181526040808420815160e081018352815460ff808216835261010082048116838701526201000082048116948301949094526301000000810484166060830152600160201b810490931660808201526001600160601b03600160281b84041660a08201526001820180546001600160a01b03811660c08401908152978c9052959094526001600160881b031990921690556001600160a01b031990921690559051611cbf90612049565b600003611cf65760a081015160c08201516001600160a01b031660009081526101ff602052604090206001600160601b0390911690555b6040518061010001604052808560ff1681526020018460ff168152602001826000015160ff168152602001826020015160ff168152602001826040015160ff168152602001826060015160ff168152602001826080015160ff168152602001466001600160c81b03168152506101fc60008360a001516001600160601b0316815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a81548160ff021916908360ff16021790555060c08201518160000160066101000a81548160ff021916908360ff16021790555060e08201518160000160076101000a8154816001600160c81b0302191690836001600160c81b031602179055509050507fa7e737b88a4532608ffb37be016b003bc1a58f199eff30443d16def0db7c43be8160a0015146868685600001518660200151876040015188606001518960800151604051611f3f999897969594939291906001600160601b03999099168952602089019790975260ff958616604089015293851660608801529184166080870152831660a0860152821660c0850152811660e0840152166101008201526101200190565b60405180910390a1610f998160c001518260a001516001600160601b0316613883565b6000818152606760205260408120546001600160a01b031680610fc95760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610e6c565b3330146120375760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062656044820152650204c7a4170760d41b6064820152608401610e6c565b612043848484846139b7565b50505050565b60006001600160a01b0382166120b45760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610e6c565b506001600160a01b031660009081526068602052604090205490565b61016060205260009081526040902080546120ea9061557f565b80601f01602080910402602001604051908101604052809291908181526020018280546121169061557f565b80156121635780601f1061213857610100808354040283529160200191612163565b820191906000526020600020905b81548152906001019060200180831161214657829003601f168201915b505050505081565b600080516020615e8e83398151915261218381613383565b5061020055565b61219a632dde656160e21b613a6b565b565b816121a681611f62565b6001600160a01b0316336001600160a01b031614806121d55750336121ca826112ff565b6001600160a01b0316145b6121f15760405162461bcd60e51b8152600401610e6c906155cf565b6121fa83613aea565b60006101fc6000858152602001908152602001600020604051806101000160405290816000820160009054906101000a900460ff1660ff1660ff1681526020016000820160019054906101000a900460ff1660ff1660ff1681526020016000820160029054906101000a900460ff1660ff1660ff1681526020016000820160039054906101000a900460ff1660ff1660ff1681526020016000820160049054906101000a900460ff1660ff1660ff1681526020016000820160059054906101000a900460ff1660ff1660ff1681526020016000820160069054906101000a900460ff1660ff1660ff1681526020016000820160079054906101000a90046001600160c81b03166001600160c81b03166001600160c81b0316815250509050600083858360e00151846000015185602001518660400151876060015188608001518960a001518a60c001516040516020016123be9a999897969594939291906001600160a01b039a909a168a5260208a01989098526001600160c81b0396909616604089015260ff9485166060890152928416608088015290831660a0870152821660c0860152811660e0850152908116610100840152166101208201526101400190565b60408051601f19818403018152908290526101f954600160f01b60208401526022830152915060009060420160408051601f198184030181529082905261015f5463040a7bb160e41b83529092506000916001600160a01b03909116906340a7bb1090612437908b903090889087908990600401615742565b6040805180830381865afa158015612453573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124779190615796565b509050803410156124c65760405162461bcd60e51b8152602060048201526019602482015278546f206c6974746c6520746f20636f766572206d736746656560381b6044820152606401610e6c565b6119d9888433600086613b87565b60006124df81613383565b50610201805461ffff928316620100000263ffffffff199091169290931691909117919091179055565b600091825261012d602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606066805461120a9061557f565b600061254f81613383565b6000821161259e5760405162461bcd60e51b815260206004820152601c60248201527b131e905c1c0e881a5b9d985b1a590817d91cdd11d85cd05b5bdd5b9d60221b6044820152606401610e6c565b5061ffff9092166000908152610161602090815260408083209383529290522055565b611734338383613cec565b6125d63383613418565b6125f25760405162461bcd60e51b8152600401610e6c90615602565b61204384848484613db6565b604080516001808252818301909252606091600091906020808301908036833750506102055482519293506001600160a01b031691839150600090612645576126456155b9565b6001600160a01b039092166020928302919091019091015292915050565b600061266e81613383565b6127108263ffffffff16111561268357600080fd5b5061020580546001600160a01b039093166001600160a01b031963ffffffff909316600160a01b02929092166001600160c01b031990931692909217179055565b60006126cf81613383565b6102025460ff908116908716108015906126f857506102025460ff610100909104811690861610155b801561271457506102025460ff62010000909104811690851610155b801561273157506102025460ff6301000000909104811690841610155b801561274e57506102025460ff600160201b909104811690831610155b6127925760405162461bcd60e51b815260206004820152601560248201527443616e2774206465637265617365206c617965727360581b6044820152606401610e6c565b506040805160a08101825260ff9687168082529587166020820181905294871691810182905292861660608401819052919095166080909201829052610202805461ffff19169094176101009093029290921763ffff000019166201000090940263ff00000019169390931763010000009091021760ff60201b1916600160201b909202919091179055565b60606128298261338d565b61288d5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610e6c565b6000612897613de9565b905060008151116128b757604051806020016040528060008152506118c7565b806128c184613e09565b6040516020016128d29291906157ba565b6040516020818303038152906040529392505050565b60006128f381613383565b61015f546040516332fb62e760e21b81526001600160a01b039091169063cbed8b9c9061292c90899089908990899089906004016157e9565b600060405180830381600087803b15801561294657600080fd5b505af115801561295a573d6000803e3d6000fd5b50505050505050505050565b61ffff8416600090815261019460205260408082209051612988908690615817565b90815260408051602092819003830190206001600160401b03861660009081529252902054905080612a085760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b6064820152608401610e6c565b815160208301208114612a675760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b6064820152608401610e6c565b61ffff8516600090815261019460205260408082209051612a89908790615817565b90815260408051602092819003830190206001600160401b03871660009081529252902055610f99858585856139b7565b612ac3826115f2565b612acc81613383565b611492838361367c565b610204543414612b275760405162461bcd60e51b815260206004820152601c60248201527b496e636f72726563742072616e646f6d6e657373207375627369647960201b6044820152606401610e6c565b612b9887878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050610200546040516001600160601b03193360601b166020820152909250603401905060405160208183030381529060405280519060200120613f09565b612bd75760405162461bcd60e51b815260206004820152601060248201526f4e6f7420677265656e6c69737465642160801b6044820152606401610e6c565b3360009081526101fe602052604090205460ff1615612c2b5760405162461bcd60e51b815260206004820152601060248201526f416c726561647920636c61696d65642160801b6044820152606401610e6c565b3360009081526101fe60205260409020805460ff191660011790556102025460ff908116908616108015612c6d57506102025460ff6101009091048116908516105b8015612c8857506102025460ff620100009091048116908416105b8015612ca457506102025460ff63010000009091048116908316105b8015612cc057506102025460ff600160201b9091048116908216105b612d045760405162461bcd60e51b81526020600482015260156024820152744c6179657273206f7574206f6620626f756e64732160581b6044820152606401610e6c565b612d12468686868686613f1f565b6000612d1e6101fa5490565b6102015490915062010000900461ffff16811115612d7e5760405162461bcd60e51b815260206004820152601d60248201527f4d617820737570706c79207265616368656420666f7220636861696e210000006044820152606401610e6c565b612d8d6101fa80546001019055565b600061020360009054906101000a90046001600160a01b03166001600160a01b0316635f73e201346040518263ffffffff1660e01b815260040160206040518083038185885af1158015612de5573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612e0a9190615833565b6040805160e08101825260ff998a1681529789166020808a01918252978a16898301908152968a1660608a01908152958a1660808a019081526001600160601b0395861660a08b019081523360c08c0190815260009586526101fd909a52929093209851895491519751965193519251909516600160281b02600160281b600160881b0319928b16600160201b0292909216600160201b600160881b0319938b1663010000000263ff00000019978c1662010000029790971663ffff000019988c166101000261ffff1990931696909b169590951717959095169790971792909217959095169490941717825551600190910180546001600160a01b03929092166001600160a01b0319909216919091179055505050565b6000612f2e6101fa5490565b905090565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b6000612f6c81613383565b61ffff8416600090815261016060205260409020612f8b8385836158a7565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab848484604051612fbf93929190615724565b60405180910390a150505050565b61015f54604051633d7b2f6f60e21b815261ffff808716600483015285166024820152306044820152606481018390526060916001600160a01b03169063f5ecbdbc90608401600060405180830381865afa158015613030573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526130589190810190615960565b90505b949350505050565b6001600160a01b03163b151590565b604051633356ae4560e11b815230906366ad5c8a9061309b9087908790879087906004016159cd565b600060405180830381600087803b1580156130b557600080fd5b505af19250505080156130c6575060015b61204357808051906020012061019460008661ffff1661ffff168152602001908152602001600020846040516130fc9190615817565b9081526040805191829003602090810183206001600160401b0387166000908152915220919091557fe6f254030bcb01ffd20558175c13fcaed6d1520be7becee4c961b65f79243b0d906131579086908690869086906159cd565b60405180910390a1612043565b60006001600160e01b0319821663780e9d6360e01b1480610fc95750610fc982613fa7565b60006001600160e01b03198216637965db0b60e01b1480610fc95750610fc982613164565b60006131b982613189565b80610fc95750506001600160e01b03191660009081526101c7602052604090205460ff1690565b60008054610100900460ff161561322e578160ff16600114801561320a575061320830613063565b155b6132265760405162461bcd60e51b8152600401610e6c90615a0b565b506000919050565b60005460ff8084169116106132555760405162461bcd60e51b8152600401610e6c90615a0b565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff1661329b5760405162461bcd60e51b8152600401610e6c90615a59565b6117348282613ff7565b600054610100900460ff1661219a5760405162461bcd60e51b8152600401610e6c90615a59565b6132d68282612509565b61173457600082815261012d602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561330f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600054610100900460ff1661337a5760405162461bcd60e51b8152600401610e6c90615a59565b6117fd81614037565b6117fd8133614081565b6000908152606760205260409020546001600160a01b0316151590565b600081815260696020526040902080546001600160a01b0319166001600160a01b03841690811790915581906133df82611f62565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006134238261338d565b6134845760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610e6c565b600061348f83611f62565b9050806001600160a01b0316846001600160a01b031614806134b657506134b68185612f33565b8061305b5750836001600160a01b03166134cf846112ff565b6001600160a01b031614949350505050565b826001600160a01b03166134f482611f62565b6001600160a01b0316146135585760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610e6c565b6001600160a01b0382166135ba5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610e6c565b6135c58383836140e5565b6135d06000826133aa565b6001600160a01b03831660009081526068602052604081208054600192906135f9908490615aba565b90915550506001600160a01b0382166000908152606860205260408120805460019290613627908490615ad1565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b038681169182179092559151849391871691600080516020615f5583398151915291a461149283838361419d565b6136868282612509565b1561173457600082815261012d602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080516020615eee833981519152546001600160a01b031690565b600080516020615ece83398151915261173481613383565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561374b5761149283614299565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156137a5575060408051601f3d908101601f191682019092526137a291810190615833565b60015b6138085760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610e6c565b600080516020615eee83398151915281146138775760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610e6c565b50611492838383614333565b6001600160a01b0382166138d95760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610e6c565b6138e28161338d565b1561392e5760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606401610e6c565b61393a600083836140e5565b6001600160a01b0382166000908152606860205260408120805460019290613963908490615ad1565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386169081179091559051839290600080516020615f55833981519152908290a46117346000838361419d565b6000806000806000806000806000808a8060200190518101906139da9190615ae9565b9950995099509950995099509950995099509950613a008a8a8a8a8a8a8a8a8a8a614358565b7f1046a24c098e44fbda12f8600bd37cb06b6f2e48354350ae51621d09b3b5a9058e8b8b604051613a539392919061ffff9390931683526001600160a01b03919091166020830152604082015260600190565b60405180910390a15050505050505050505050505050565b6001600160e01b03198082169003613ac45760405162461bcd60e51b815260206004820152601c60248201527b115490cc4d8d4e881a5b9d985b1a59081a5b9d195c999858d9481a5960221b6044820152606401610e6c565b6001600160e01b03191660009081526101c760205260409020805460ff19166001179055565b6000613af582611f62565b9050613b03816000846140e5565b613b0e6000836133aa565b6001600160a01b0381166000908152606860205260408120805460019290613b37908490615aba565b909155505060008281526067602052604080822080546001600160a01b0319169055518391906001600160a01b03841690600080516020615f55833981519152908390a46117348160008461419d565b61ffff85166000908152610160602052604081208054613ba69061557f565b80601f0160208091040260200160405190810160405280929190818152602001828054613bd29061557f565b8015613c1f5780601f10613bf457610100808354040283529160200191613c1f565b820191906000526020600020905b815481529060010190602001808311613c0257829003601f168201915b505050505090508051600003613c765760405162461bcd60e51b815260206004820152601c60248201527b4c5a3a20646573742063686e2069736e74207472737465642073726360201b6044820152606401610e6c565b61015f5460405162c5803160e81b81526001600160a01b039091169063c5803100903490613cb2908a9086908b908b908b908b90600401615baf565b6000604051808303818588803b158015613ccb57600080fd5b505af1158015613cdf573d6000803e3d6000fd5b5050505050505050505050565b816001600160a01b0316836001600160a01b031603613d495760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610e6c565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613dc18484846134e1565b613dcd84848484614512565b6120435760405162461bcd60e51b8152600401610e6c90615c16565b6060604051806060016040528060228152602001615f7560229139905090565b606081600003613e305750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613e5a5780613e4481615c68565b9150613e539050600a83615c97565b9150613e34565b6000816001600160401b03811115613e7457613e74614b33565b6040519080825280601f01601f191660200182016040528015613e9e576020820181803683370190505b5090505b841561305b57613eb3600183615aba565b9150613ec0600a86615cab565b613ecb906030615ad1565b60f81b818381518110613ee057613ee06155b9565b60200101906001600160f81b031916908160001a905350613f02600a86615c97565b9450613ea2565b600082613f168584614617565b14949350505050565b6000613f2f8787878787876118ce565b60008181526101fb602052604090205490915060ff1615613f855760405162461bcd60e51b815260206004820152601060248201526f4e6f6e20756e69717565206d696e742160801b6044820152606401610e6c565b60009081526101fb60205260409020805460ff19166001179055505050505050565b60006001600160e01b031982166380ac58cd60e01b1480613fd857506001600160e01b03198216635b5e139f60e01b145b80610fc957506301ffc9a760e01b6001600160e01b0319831614610fc9565b600054610100900460ff1661401e5760405162461bcd60e51b8152600401610e6c90615a59565b606561402a8382615cbf565b5060666114928282615cbf565b600054610100900460ff1661405e5760405162461bcd60e51b8152600401610e6c90615a59565b61015f80546001600160a01b0319166001600160a01b0392909216919091179055565b61408b8282612509565b611734576140a3816001600160a01b0316601461468b565b6140ae83602061468b565b6040516020016140bf929190615d78565b60408051601f198184030181529082905262461bcd60e51b8252610e6c91600401614e30565b6001600160a01b0383166141405761413b81609980546000838152609a60205260408120829055600182018355919091527f72a152ddfb8e864297c917af52ea6c1c68aead0fee1a62673fcc7e0c94979d000155565b614163565b816001600160a01b0316836001600160a01b031614614163576141638382614826565b6001600160a01b03821661417a57611492816148c3565b826001600160a01b0316826001600160a01b031614611492576114928282614972565b816001600160a01b0316836001600160a01b0316036141bb57505050565b6001600160a01b038316158015906141eb57506001600160a01b03831660009081526101ff602052604090205481145b156142465760006141fb84612049565b111561422b5761420c836000611624565b6001600160a01b03841660009081526101ff6020526040902055614246565b6001600160a01b03831660009081526101ff60205260408120555b6001600160a01b0382161580159061427557506001600160a01b03821660009081526101ff6020526040902054155b15611492576001600160a01b039190911660009081526101ff602052604090205550565b6142a281613063565b6143045760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610e6c565b600080516020615eee83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b61433c836149b6565b6000825111806143495750805b156114925761204383836149f6565b6143618a612049565b600003614385576001600160a01b038a1660009081526101ff602052604090208990555b6040518061010001604052808860ff1681526020018760ff1681526020018660ff1681526020018560ff1681526020018460ff1681526020018360ff1681526020018260ff168152602001896001600160c81b03168152506101fc60008b815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a81548160ff021916908360ff16021790555060c08201518160000160066101000a81548160ff021916908360ff16021790555060e08201518160000160076101000a8154816001600160c81b0302191690836001600160c81b0316021790555090505061295a8a8a613883565b6000614526846001600160a01b0316613063565b1561460f57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061455d903390899088908890600401615de7565b6020604051808303816000875af1925050508015614598575060408051601f3d908101601f1916820190925261459591810190615e24565b60015b6145f5573d8080156145c6576040519150601f19603f3d011682016040523d82523d6000602084013e6145cb565b606091505b5080516000036145ed5760405162461bcd60e51b8152600401610e6c90615c16565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061305b565b50600161305b565b600081815b8451811015614683576000858281518110614639576146396155b9565b6020026020010151905080831161465f5760008381526020829052604090209250614670565b600081815260208490526040902092505b508061467b81615c68565b91505061461c565b509392505050565b6060600061469a836002615e41565b6146a5906002615ad1565b6001600160401b038111156146bc576146bc614b33565b6040519080825280601f01601f1916602001820160405280156146e6576020820181803683370190505b509050600360fc1b81600081518110614701576147016155b9565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110614730576147306155b9565b60200101906001600160f81b031916908160001a9053506000614754846002615e41565b61475f906001615ad1565b90505b60018111156147d7576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110614793576147936155b9565b1a60f81b8282815181106147a9576147a96155b9565b60200101906001600160f81b031916908160001a90535060049490941c936147d081615e60565b9050614762565b5083156118c75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610e6c565b6000600161483384612049565b61483d9190615aba565b600083815260986020526040902054909150808214614890576001600160a01b03841660009081526097602090815260408083208584528252808320548484528184208190558352609890915290208190555b5060009182526098602090815260408084208490556001600160a01b039094168352609781528383209183525290812055565b6099546000906148d590600190615aba565b6000838152609a6020526040812054609980549394509092849081106148fd576148fd6155b9565b90600052602060002001549050806099838154811061491e5761491e6155b9565b6000918252602080832090910192909255828152609a9091526040808220849055858252812055609980548061495657614956615e77565b6001900381819060005260206000200160009055905550505050565b600061497d83612049565b6001600160a01b039093166000908152609760209081526040808320868452825280832085905593825260989052919091209190915550565b6149bf81614299565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060614a0183613063565b614a5c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610e6c565b600080846001600160a01b031684604051614a779190615817565b600060405180830381855af49150503d8060008114614ab2576040519150601f19603f3d011682016040523d82523d6000602084013e614ab7565b606091505b5091509150614adf8282604051806060016040528060278152602001615f0e60279139614ae8565b95945050505050565b60608315614af75750816118c7565b825115614b075782518084602001fd5b8160405162461bcd60e51b8152600401610e6c9190614e30565b803561ffff8116811461326f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614b7157614b71614b33565b604052919050565b60006001600160401b03821115614b9257614b92614b33565b50601f01601f191660200190565b600082601f830112614bb157600080fd5b8135614bc4614bbf82614b79565b614b49565b818152846020838601011115614bd957600080fd5b816020850160208301376000918101602001919091529392505050565b80356001600160401b038116811461326f57600080fd5b60008060008060808587031215614c2357600080fd5b614c2c85614b21565b935060208501356001600160401b0380821115614c4857600080fd5b614c5488838901614ba0565b9450614c6260408801614bf6565b93506060870135915080821115614c7857600080fd5b50614c8587828801614ba0565b91505092959194509250565b6001600160e01b0319811681146117fd57600080fd5b600060208284031215614cb957600080fd5b81356118c781614c91565b6001600160a01b03811681146117fd57600080fd5b803561326f81614cc4565b60ff811681146117fd57600080fd5b803561326f81614ce4565b6000806000806000806000806000806000806101808d8f031215614d2157600080fd5b8c35614d2c81614cc4565b9b5060208d0135614d3c81614cc4565b9a50614d4a60408e01614b21565b9950614d5860608e01614b21565b985060808d0135975060a08d0135614d6f81614ce4565b965060c08d0135614d7f81614ce4565b955060e08d0135614d8f81614ce4565b94506101008d0135614da081614ce4565b9350614daf6101208e01614cf3565b92506101408d01359150614dc66101608e01614cd9565b90509295989b509295989b509295989b565b60005b83811015614df3578181015183820152602001614ddb565b838111156120435750506000910152565b60008151808452614e1c816020860160208601614dd8565b601f01601f19169290920160200192915050565b6020815260006118c76020830184614e04565b60008060408385031215614e5657600080fd5b614e5f83614b21565b946020939093013593505050565b600060208284031215614e7f57600080fd5b6118c782614b21565b600060208284031215614e9a57600080fd5b5035919050565b60008060408385031215614eb457600080fd5b8235614e5f81614cc4565b6020808252825182820181905260009190848201906040850190845b81811015614efd57835163ffffffff1683529284019291840191600101614edb565b50909695505050505050565b600060208284031215614f1b57600080fd5b81356118c781614cc4565b600080600060608486031215614f3b57600080fd5b8335614f4681614cc4565b92506020840135614f5681614cc4565b929592945050506040919091013590565b60008060408385031215614f7a57600080fd5b823591506020830135614f8c81614cc4565b809150509250929050565b60008083601f840112614fa957600080fd5b5081356001600160401b03811115614fc057600080fd5b602083019150836020828501011115614fd857600080fd5b9250929050565b600080600060408486031215614ff457600080fd5b614ffd84614b21565b925060208401356001600160401b0381111561501857600080fd5b61502486828701614f97565b9497909650939450505050565b60008060008060008060c0878903121561504a57600080fd5b86359550602087013561505c81614ce4565b9450604087013561506c81614ce4565b9350606087013561507c81614ce4565b9250608087013561508c81614ce4565b915060a087013561509c81614ce4565b809150509295509295509295565b600080604083850312156150bd57600080fd5b50508035926020909101359150565b600080604083850312156150df57600080fd5b82356150ea81614cc4565b915060208301356001600160401b0381111561510557600080fd5b61511185828601614ba0565b9150509250929050565b60008060006060848603121561513057600080fd5b83359250602084013561514281614ce4565b9150604084013561515281614ce4565b809150509250925092565b60008060006060848603121561517257600080fd5b61517b84614b21565b925060208401356001600160401b0381111561519657600080fd5b6151a286828701614ba0565b9250506151b160408501614bf6565b90509250925092565b6000806000606084860312156151cf57600080fd5b6151d884614b21565b925060208401359150604084013561515281614cc4565b6000806040838503121561520257600080fd5b61520b83614b21565b915061521960208401614b21565b90509250929050565b60008060006060848603121561523757600080fd5b61524084614b21565b95602085013595506040909401359392505050565b6000806040838503121561526857600080fd5b823561527381614cc4565b915060208301358015158114614f8c57600080fd5b6000806000806080858703121561529e57600080fd5b84356152a981614cc4565b935060208501356152b981614cc4565b92506040850135915060608501356001600160401b038111156152db57600080fd5b614c8587828801614ba0565b6020808252825182820181905260009190848201906040850190845b81811015614efd5783516001600160a01b031683529284019291840191600101615303565b6000806040838503121561533b57600080fd5b823561534681614cc4565b9150602083013563ffffffff81168114614f8c57600080fd5b600080600080600060a0868803121561537757600080fd5b853561538281614ce4565b9450602086013561539281614ce4565b935060408601356153a281614ce4565b925060608601356153b281614ce4565b915060808601356153c281614ce4565b809150509295509295909350565b6000806000806000608086880312156153e857600080fd5b6153f186614b21565b94506153ff60208701614b21565b93506040860135925060608601356001600160401b0381111561542157600080fd5b61542d88828901614f97565b969995985093965092949392505050565b600080600080600080600060c0888a03121561545957600080fd5b87356001600160401b038082111561547057600080fd5b818a0191508a601f83011261548457600080fd5b81358181111561549357600080fd5b8b60208260051b85010111156154a857600080fd5b6020928301995097506154be918a019050614cf3565b94506154cc60408901614cf3565b93506154da60608901614cf3565b92506154e860808901614cf3565b91506154f660a08901614cf3565b905092959891949750929550565b6000806040838503121561551757600080fd5b823561552281614cc4565b91506020830135614f8c81614cc4565b6000806000806080858703121561554857600080fd5b61555185614b21565b935061555f60208601614b21565b9250604085013561556f81614cc4565b9396929550929360600135925050565b600181811c9082168061559357607f821691505b6020821081036155b357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b602080825260199082015278139bdd081d1a19481bdddb995c881bdc88185c1c1c9bdd9959603a1b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602c90820152600080516020615eae83398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c90820152600080516020615eae83398151915260408201526b6163746976652070726f787960a01b606082015260800190565b8183823760009101908152919050565b805160208083015191908110156155b35760001960209190910360031b1b16919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff841681526040602082015260006130586040830184866156fb565b61ffff861681526001600160a01b038516602082015260a06040820181905260009061577090830186614e04565b8415156060840152828103608084015261578a8185614e04565b98975050505050505050565b600080604083850312156157a957600080fd5b505080516020909101519092909150565b600083516157cc818460208801614dd8565b8351908301906157e0818360208801614dd8565b01949350505050565b600061ffff8088168352808716602084015250846040830152608060608301526119456080830184866156fb565b60008251615829818460208701614dd8565b9190910192915050565b60006020828403121561584557600080fd5b5051919050565b601f82111561149257600081815260208120601f850160051c810160208610156158735750805b601f850160051c820191505b818110156112f75782815560010161587f565b600019600383901b1c191660019190911b1790565b6001600160401b038311156158be576158be614b33565b6158d2836158cc835461557f565b8361584c565b6000601f84116001811461590057600085156158ee5750838201355b6158f88682615892565b845550610f99565b600083815260209020601f19861690835b828110156159315786850135825560209485019460019092019101615911565b508682101561594e5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006020828403121561597257600080fd5b81516001600160401b0381111561598857600080fd5b8201601f8101841361599957600080fd5b80516159a7614bbf82614b79565b8181528560208385010111156159bc57600080fd5b614adf826020830160208601614dd8565b61ffff851681526080602082015260006159ea6080830186614e04565b6001600160401b038516604084015282810360608401526119458185614e04565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600082821015615acc57615acc615aa4565b500390565b60008219821115615ae457615ae4615aa4565b500190565b6000806000806000806000806000806101408b8d031215615b0957600080fd5b8a51615b1481614cc4565b809a505060208b0151985060408b0151975060608b0151615b3481614ce4565b60808c0151909750615b4581614ce4565b60a08c0151909650615b5681614ce4565b60c08c0151909550615b6781614ce4565b60e08c0151909450615b7881614ce4565b6101008c0151909350615b8a81614ce4565b6101208c0151909250615b9c81614ce4565b809150509295989b9194979a5092959850565b61ffff8716815260c060208201526000615bcc60c0830188614e04565b8281036040840152615bde8188614e04565b6001600160a01b0387811660608601528616608085015283810360a08501529050615c098185614e04565b9998505050505050505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600060018201615c7a57615c7a615aa4565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082615ca657615ca6615c81565b500490565b600082615cba57615cba615c81565b500690565b81516001600160401b03811115615cd857615cd8614b33565b615cec81615ce6845461557f565b8461584c565b602080601f831160018114615d1b5760008415615d095750858301515b615d138582615892565b8655506112f7565b600085815260208120601f198616915b82811015615d4a57888601518255948401946001909101908401615d2b565b5085821015615d685787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351615daa816017850160208801614dd8565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615ddb816028840160208801614dd8565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615e1a90830184614e04565b9695505050505050565b600060208284031215615e3657600080fd5b81516118c781614c91565b6000816000190483118215151615615e5b57615e5b615aa4565b500290565b600081615e6f57615e6f615aa4565b506000190190565b634e487b7160e01b600052603160045260246000fdfe96a5a7c64c68f2a09ecd97a5d0e4e9b0ca7344f6196481bc066d1f6eb768db4c46756e6374696f6e206d7573742062652063616c6c6564207468726f75676820189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65649f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef68747470733a2f2f6d6f7267616e6e696e672e666c6f61742d6e6674732e636f6d2fa26469706673582212201ac34047bfe4b81ff7f212585fbcb64f0bbbb094ae3b239b2e4d7ec36532aee464736f6c634300080f0033
Deployed Bytecode
0x6080604052600436106103145760003560e01c80621d35671461031957806301ffc9a71461033b5780630298442d1461037057806306fdde031461039057806307810867146103b257806307e0db17146103f9578063081812fc14610419578063095ea7b3146104515780630ebd4c7f1461047157806310ddb1371461049e57806311cc69cb146104be57806311de0518146104ec57806318160ddd1461050c5780631bf751dd1461052157806323b872dd14610543578063248a9ca3146105635780632eb4a7ab146105835780632f2ff15d1461059a5780632f745c59146105ba57806336568abe146105da5780633659cfe6146105fa5780633d8b38f61461061a5780633e0e828b1461063a5780634122bec41461066957806342842e0e1461068957806342d65a8d146106a95780634c97f31a146106c95780634de9fb93146106fa5780634eb4a1e51461071b5780634f1ef2861461073b5780634f6ccce71461074e57806352d1902d1461076e57806357ab0af1146107835780635ac293c9146107a35780635b8c41e6146107c55780635e0d09bb146108155780636352211e146108e657806366ad5c8a1461090657806370a08231146109265780637533d7881461094657806376945b5f146109665780637cb647591461097d57806380ae4ebc1461099d5780638202a750146109b257806385bab09c146109ec5780638c132016146109ff57806391d1485414610a1f57806395d89b4114610a3f5780639852634314610a545780639b57db5f14610aca578063a217fddf14610aea578063a22cb46514610aff578063b353aaa714610b1f578063b88d4fde14610b40578063b9c4d9fb14610b60578063bb21a39214610b8d578063bf0cda2914610bad578063c87b56dd14610bcd578063c884ef8314610bed578063cbed8b9c14610c1e578063d1deba1f14610c3e578063d539139314610c51578063d547741f14610c73578063d9ddda9714610c93578063db250fee14610d64578063dbfd4b9814610d77578063e985e9c514610d8c578063eb8d72b714610dac578063f5ecbdbc14610dcc578063f72c0d8b14610dec575b600080fd5b34801561032557600080fd5b50610339610334366004614c0d565b610e0e565b005b34801561034757600080fd5b5061035b610356366004614ca7565b610fa0565b60405190151581526020015b60405180910390f35b34801561037c57600080fd5b5061033961038b366004614cfe565b610fcf565b34801561039c57600080fd5b506103a56111fb565b6040516103679190614e30565b3480156103be57600080fd5b506103eb6103cd366004614e43565b61016160209081526000928352604080842090915290825290205481565b604051908152602001610367565b34801561040557600080fd5b50610339610414366004614e6d565b61128d565b34801561042557600080fd5b50610439610434366004614e88565b6112ff565b6040516001600160a01b039091168152602001610367565b34801561045d57600080fd5b5061033961046c366004614ea1565b611387565b34801561047d57600080fd5b5061049161048c366004614e88565b611497565b6040516103679190614ebf565b3480156104aa57600080fd5b506103396104b9366004614e6d565b6114ff565b3480156104ca57600080fd5b506103eb6104d9366004614f09565b6101ff6020526000908152604090205481565b3480156104f857600080fd5b50610339610507366004614e88565b61153f565b34801561051857600080fd5b506099546103eb565b34801561052d57600080fd5b506103eb600080516020615e8e83398151915281565b34801561054f57600080fd5b5061033961055e366004614f26565b6115c1565b34801561056f57600080fd5b506103eb61057e366004614e88565b6115f2565b34801561058f57600080fd5b506103eb6102005481565b3480156105a657600080fd5b506103396105b5366004614f67565b611608565b3480156105c657600080fd5b506103eb6105d5366004614ea1565b611624565b3480156105e657600080fd5b506103396105f5366004614f67565b6116ba565b34801561060657600080fd5b50610339610615366004614f09565b611738565b34801561062657600080fd5b5061035b610635366004614fdf565b611800565b34801561064657600080fd5b50610201546106569061ffff1681565b60405161ffff9091168152602001610367565b34801561067557600080fd5b506103eb610684366004615031565b6118ce565b34801561069557600080fd5b506103396106a4366004614f26565b611950565b3480156106b557600080fd5b506103396106c4366004614fdf565b61196b565b3480156106d557600080fd5b5061035b6106e4366004614e88565b6101fb6020526000908152604090205460ff1681565b34801561070657600080fd5b5061020554610439906001600160a01b031681565b34801561072757600080fd5b506103396107363660046150aa565b6119e3565b6103396107493660046150cc565b6119fc565b34801561075a57600080fd5b506103eb610769366004614e88565b611ab1565b34801561077a57600080fd5b506103eb611b44565b34801561078f57600080fd5b5061033961079e36600461511b565b611bf2565b3480156107af57600080fd5b50610201546106569062010000900461ffff1681565b3480156107d157600080fd5b506103eb6107e036600461515d565b610194602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b34801561082157600080fd5b50610891610830366004614e88565b6101fc6020526000908152604090205460ff80821691610100810482169162010000820481169163010000008104821691600160201b8204811691600160281b8104821691600160301b82041690600160381b90046001600160c81b031688565b6040805160ff998a16815297891660208901529588169587019590955292861660608601529085166080850152841660a084015290921660c08201526001600160c81b0390911660e082015261010001610367565b3480156108f257600080fd5b50610439610901366004614e88565b611f62565b34801561091257600080fd5b50610339610921366004614c0d565b611fd9565b34801561093257600080fd5b506103eb610941366004614f09565b612049565b34801561095257600080fd5b506103a5610961366004614e6d565b6120d0565b34801561097257600080fd5b506103eb6102045481565b34801561098957600080fd5b50610339610998366004614e88565b61216b565b3480156109a957600080fd5b5061033961218a565b3480156109be57600080fd5b50610205546109d790600160a01b900463ffffffff1681565b60405163ffffffff9091168152602001610367565b6103396109fa3660046151ba565b61219c565b348015610a0b57600080fd5b50610339610a1a3660046151ef565b6124d4565b348015610a2b57600080fd5b5061035b610a3a366004614f67565b612509565b348015610a4b57600080fd5b506103a5612535565b348015610a6057600080fd5b5061020254610a969060ff80821691610100810482169162010000820481169163010000008104821691600160201b9091041685565b6040805160ff968716815294861660208601529285169284019290925283166060830152909116608082015260a001610367565b348015610ad657600080fd5b50610339610ae5366004615222565b612544565b348015610af657600080fd5b506103eb600081565b348015610b0b57600080fd5b50610339610b1a366004615255565b6125c1565b348015610b2b57600080fd5b5061015f54610439906001600160a01b031681565b348015610b4c57600080fd5b50610339610b5b366004615288565b6125cc565b348015610b6c57600080fd5b50610b80610b7b366004614e88565b6125fe565b60405161036791906152e7565b348015610b9957600080fd5b50610339610ba8366004615328565b612663565b348015610bb957600080fd5b50610339610bc836600461535f565b6126c4565b348015610bd957600080fd5b506103a5610be8366004614e88565b61281e565b348015610bf957600080fd5b5061035b610c08366004614f09565b6101fe6020526000908152604090205460ff1681565b348015610c2a57600080fd5b50610339610c393660046153d0565b6128e8565b610339610c4c366004614c0d565b612966565b348015610c5d57600080fd5b506103eb600080516020615f3583398151915281565b348015610c7f57600080fd5b50610339610c8e366004614f67565b612aba565b348015610c9f57600080fd5b50610d0f610cae366004614e88565b6101fd602052600090815260409020805460019091015460ff80831692610100810482169262010000820483169263010000008304811692600160201b810490911691600160281b9091046001600160601b0316906001600160a01b031687565b6040805160ff9889168152968816602088015294871694860194909452918516606085015290931660808301526001600160601b0390921660a08201526001600160a01b0390911660c082015260e001610367565b610339610d7236600461543e565b612ad6565b348015610d8357600080fd5b506103eb612f22565b348015610d9857600080fd5b5061035b610da7366004615504565b612f33565b348015610db857600080fd5b50610339610dc7366004614fdf565b612f61565b348015610dd857600080fd5b506103a5610de7366004615532565b612fcd565b348015610df857600080fd5b506103eb600080516020615ece83398151915281565b61015f546001600160a01b0316336001600160a01b031614610e755760405162461bcd60e51b815260206004820152601b60248201527a262d1d1034b73b30b634b21032b7323837b4b73a1031b0b63632b960291b60448201526064015b60405180910390fd5b61ffff84166000908152610160602052604081208054610e949061557f565b80601f0160208091040260200160405190810160405280929190818152602001828054610ec09061557f565b8015610f0d5780601f10610ee257610100808354040283529160200191610f0d565b820191906000526020600020905b815481529060010190602001808311610ef057829003601f168201915b5050505050905060008151118015610f32575080805190602001208480519060200120145b610f8d5760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b6064820152608401610e6c565b610f9985858585613072565b5050505050565b6000610fab82613164565b80610fba5750610fba82613189565b80610fc95750610fc9826131ae565b92915050565b6000610fdb60016131e0565b90508015610ff3576000805461ff0019166101001790555b61104860405180604001604052806018815260200177209728171026b7b933b0b71029b0b4b634b7339021b63ab160411b8152506040518060400160405280600381526020016241504d60e81b815250613274565b6110506132a5565b6110586132a5565b6110606132a5565b61106b60008d6132cc565b611083600080516020615ece8339815191528d6132cc565b61109b600080516020615e8e8339815191528d6132cc565b6110b3600080516020615f35833981519152836132cc565b6110bc8d613353565b6207a1206101f9556110cc61218a565b61ffff8b166101fa556040805160a08101825260ff8a81168083528a8216602084018190528a8316948401859052898316606085018190529289166080909401849052610202805461ffff19169092176101009091021763ffff000019166201000094850263ff00000019161763010000009092029190911760ff60201b1916600160201b9092029190911790556102008a9055610201805461ffff8e811663ffffffff1990921691909117908d1690920291909117905561020483905561020380546001600160a01b0319166001600160a01b03841617905580156111ec576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050505050505050565b60606065805461120a9061557f565b80601f01602080910402602001604051908101604052809291908181526020018280546112369061557f565b80156112835780601f1061125857610100808354040283529160200191611283565b820191906000526020600020905b81548152906001019060200180831161126657829003601f168201915b5050505050905090565b600061129881613383565b61015f546040516307e0db1760e01b815261ffff841660048201526001600160a01b03909116906307e0db17906024015b600060405180830381600087803b1580156112e357600080fd5b505af11580156112f7573d6000803e3d6000fd5b505050505050565b600061130a8261338d565b61136b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610e6c565b506000908152606960205260409020546001600160a01b031690565b600061139282611f62565b9050806001600160a01b0316836001600160a01b0316036113ff5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610e6c565b336001600160a01b038216148061141b575061141b8133612f33565b6114885760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776044820152771b995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b60421b6064820152608401610e6c565b61149283836133aa565b505050565b604080516001808252818301909252606091600091906020808301908036833701905050905061020560149054906101000a900463ffffffff16816000815181106114e4576114e46155b9565b63ffffffff9092166020928302919091019091015292915050565b600061150a81613383565b61015f546040516310ddb13760e01b815261ffff841660048201526001600160a01b03909116906310ddb137906024016112c9565b8061154981611f62565b6001600160a01b0316336001600160a01b0316148061157857503361156d826112ff565b6001600160a01b0316145b6115945760405162461bcd60e51b8152600401610e6c906155cf565b816101ff60006115a385611f62565b6001600160a01b031681526020810191909152604001600020555050565b6115cb3382613418565b6115e75760405162461bcd60e51b8152600401610e6c90615602565b6114928383836134e1565b600090815261012d602052604090206001015490565b611611826115f2565b61161a81613383565b61149283836132cc565b600061162f83612049565b82106116915760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610e6c565b506001600160a01b03919091166000908152609760209081526040808320938352929052205490565b6001600160a01b038116331461172a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610e6c565b611734828261367c565b5050565b6001600160a01b037f000000000000000000000000f8e5f92eb85d5cec7eae61b1ffa1d7518808ca671630036117805760405162461bcd60e51b8152600401610e6c90615653565b7f000000000000000000000000f8e5f92eb85d5cec7eae61b1ffa1d7518808ca676001600160a01b03166117b26136e4565b6001600160a01b0316146117d85760405162461bcd60e51b8152600401610e6c9061568d565b6117e181613700565b604080516000808252602082019092526117fd91839190613718565b50565b61ffff831660009081526101606020526040812080548291906118229061557f565b80601f016020809104026020016040519081016040528092919081815260200182805461184e9061557f565b801561189b5780601f106118705761010080835404028352916020019161189b565b820191906000526020600020905b81548152906001019060200180831161187e57829003601f168201915b5050505050905083836040516118b29291906156c7565b60405180910390208180519060200120149150505b9392505050565b604080516000602082018190526001600160f81b031960f889811b8216602285015288811b8216602385015287811b8216602485015286811b8216602585015285901b16602683015266ffffffffffffff1960388a901b1660278301529101604051602081830303815290604052611945906156d7565b979650505050505050565b611492838383604051806020016040528060008152506125cc565b600061197681613383565b61015f546040516342d65a8d60e01b81526001600160a01b03909116906342d65a8d906119ab90879087908790600401615724565b600060405180830381600087803b1580156119c557600080fd5b505af11580156119d9573d6000803e3d6000fd5b5050505050505050565b60006119ee81613383565b50610204919091556101f955565b6001600160a01b037f000000000000000000000000f8e5f92eb85d5cec7eae61b1ffa1d7518808ca67163003611a445760405162461bcd60e51b8152600401610e6c90615653565b7f000000000000000000000000f8e5f92eb85d5cec7eae61b1ffa1d7518808ca676001600160a01b0316611a766136e4565b6001600160a01b031614611a9c5760405162461bcd60e51b8152600401610e6c9061568d565b611aa582613700565b61173482826001613718565b6000611abc60995490565b8210611b1f5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610e6c565b60998281548110611b3257611b326155b9565b90600052602060002001549050919050565b6000306001600160a01b037f000000000000000000000000f8e5f92eb85d5cec7eae61b1ffa1d7518808ca671614611bdf5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608401610e6c565b50600080516020615eee83398151915290565b600080516020615f35833981519152611c0a81613383565b60008481526101fd60208181526040808420815160e081018352815460ff808216835261010082048116838701526201000082048116948301949094526301000000810484166060830152600160201b810490931660808201526001600160601b03600160281b84041660a08201526001820180546001600160a01b03811660c08401908152978c9052959094526001600160881b031990921690556001600160a01b031990921690559051611cbf90612049565b600003611cf65760a081015160c08201516001600160a01b031660009081526101ff602052604090206001600160601b0390911690555b6040518061010001604052808560ff1681526020018460ff168152602001826000015160ff168152602001826020015160ff168152602001826040015160ff168152602001826060015160ff168152602001826080015160ff168152602001466001600160c81b03168152506101fc60008360a001516001600160601b0316815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a81548160ff021916908360ff16021790555060c08201518160000160066101000a81548160ff021916908360ff16021790555060e08201518160000160076101000a8154816001600160c81b0302191690836001600160c81b031602179055509050507fa7e737b88a4532608ffb37be016b003bc1a58f199eff30443d16def0db7c43be8160a0015146868685600001518660200151876040015188606001518960800151604051611f3f999897969594939291906001600160601b03999099168952602089019790975260ff958616604089015293851660608801529184166080870152831660a0860152821660c0850152811660e0840152166101008201526101200190565b60405180910390a1610f998160c001518260a001516001600160601b0316613883565b6000818152606760205260408120546001600160a01b031680610fc95760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610e6c565b3330146120375760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062656044820152650204c7a4170760d41b6064820152608401610e6c565b612043848484846139b7565b50505050565b60006001600160a01b0382166120b45760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610e6c565b506001600160a01b031660009081526068602052604090205490565b61016060205260009081526040902080546120ea9061557f565b80601f01602080910402602001604051908101604052809291908181526020018280546121169061557f565b80156121635780601f1061213857610100808354040283529160200191612163565b820191906000526020600020905b81548152906001019060200180831161214657829003601f168201915b505050505081565b600080516020615e8e83398151915261218381613383565b5061020055565b61219a632dde656160e21b613a6b565b565b816121a681611f62565b6001600160a01b0316336001600160a01b031614806121d55750336121ca826112ff565b6001600160a01b0316145b6121f15760405162461bcd60e51b8152600401610e6c906155cf565b6121fa83613aea565b60006101fc6000858152602001908152602001600020604051806101000160405290816000820160009054906101000a900460ff1660ff1660ff1681526020016000820160019054906101000a900460ff1660ff1660ff1681526020016000820160029054906101000a900460ff1660ff1660ff1681526020016000820160039054906101000a900460ff1660ff1660ff1681526020016000820160049054906101000a900460ff1660ff1660ff1681526020016000820160059054906101000a900460ff1660ff1660ff1681526020016000820160069054906101000a900460ff1660ff1660ff1681526020016000820160079054906101000a90046001600160c81b03166001600160c81b03166001600160c81b0316815250509050600083858360e00151846000015185602001518660400151876060015188608001518960a001518a60c001516040516020016123be9a999897969594939291906001600160a01b039a909a168a5260208a01989098526001600160c81b0396909616604089015260ff9485166060890152928416608088015290831660a0870152821660c0860152811660e0850152908116610100840152166101208201526101400190565b60408051601f19818403018152908290526101f954600160f01b60208401526022830152915060009060420160408051601f198184030181529082905261015f5463040a7bb160e41b83529092506000916001600160a01b03909116906340a7bb1090612437908b903090889087908990600401615742565b6040805180830381865afa158015612453573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124779190615796565b509050803410156124c65760405162461bcd60e51b8152602060048201526019602482015278546f206c6974746c6520746f20636f766572206d736746656560381b6044820152606401610e6c565b6119d9888433600086613b87565b60006124df81613383565b50610201805461ffff928316620100000263ffffffff199091169290931691909117919091179055565b600091825261012d602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606066805461120a9061557f565b600061254f81613383565b6000821161259e5760405162461bcd60e51b815260206004820152601c60248201527b131e905c1c0e881a5b9d985b1a590817d91cdd11d85cd05b5bdd5b9d60221b6044820152606401610e6c565b5061ffff9092166000908152610161602090815260408083209383529290522055565b611734338383613cec565b6125d63383613418565b6125f25760405162461bcd60e51b8152600401610e6c90615602565b61204384848484613db6565b604080516001808252818301909252606091600091906020808301908036833750506102055482519293506001600160a01b031691839150600090612645576126456155b9565b6001600160a01b039092166020928302919091019091015292915050565b600061266e81613383565b6127108263ffffffff16111561268357600080fd5b5061020580546001600160a01b039093166001600160a01b031963ffffffff909316600160a01b02929092166001600160c01b031990931692909217179055565b60006126cf81613383565b6102025460ff908116908716108015906126f857506102025460ff610100909104811690861610155b801561271457506102025460ff62010000909104811690851610155b801561273157506102025460ff6301000000909104811690841610155b801561274e57506102025460ff600160201b909104811690831610155b6127925760405162461bcd60e51b815260206004820152601560248201527443616e2774206465637265617365206c617965727360581b6044820152606401610e6c565b506040805160a08101825260ff9687168082529587166020820181905294871691810182905292861660608401819052919095166080909201829052610202805461ffff19169094176101009093029290921763ffff000019166201000090940263ff00000019169390931763010000009091021760ff60201b1916600160201b909202919091179055565b60606128298261338d565b61288d5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610e6c565b6000612897613de9565b905060008151116128b757604051806020016040528060008152506118c7565b806128c184613e09565b6040516020016128d29291906157ba565b6040516020818303038152906040529392505050565b60006128f381613383565b61015f546040516332fb62e760e21b81526001600160a01b039091169063cbed8b9c9061292c90899089908990899089906004016157e9565b600060405180830381600087803b15801561294657600080fd5b505af115801561295a573d6000803e3d6000fd5b50505050505050505050565b61ffff8416600090815261019460205260408082209051612988908690615817565b90815260408051602092819003830190206001600160401b03861660009081529252902054905080612a085760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b6064820152608401610e6c565b815160208301208114612a675760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b6064820152608401610e6c565b61ffff8516600090815261019460205260408082209051612a89908790615817565b90815260408051602092819003830190206001600160401b03871660009081529252902055610f99858585856139b7565b612ac3826115f2565b612acc81613383565b611492838361367c565b610204543414612b275760405162461bcd60e51b815260206004820152601c60248201527b496e636f72726563742072616e646f6d6e657373207375627369647960201b6044820152606401610e6c565b612b9887878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050610200546040516001600160601b03193360601b166020820152909250603401905060405160208183030381529060405280519060200120613f09565b612bd75760405162461bcd60e51b815260206004820152601060248201526f4e6f7420677265656e6c69737465642160801b6044820152606401610e6c565b3360009081526101fe602052604090205460ff1615612c2b5760405162461bcd60e51b815260206004820152601060248201526f416c726561647920636c61696d65642160801b6044820152606401610e6c565b3360009081526101fe60205260409020805460ff191660011790556102025460ff908116908616108015612c6d57506102025460ff6101009091048116908516105b8015612c8857506102025460ff620100009091048116908416105b8015612ca457506102025460ff63010000009091048116908316105b8015612cc057506102025460ff600160201b9091048116908216105b612d045760405162461bcd60e51b81526020600482015260156024820152744c6179657273206f7574206f6620626f756e64732160581b6044820152606401610e6c565b612d12468686868686613f1f565b6000612d1e6101fa5490565b6102015490915062010000900461ffff16811115612d7e5760405162461bcd60e51b815260206004820152601d60248201527f4d617820737570706c79207265616368656420666f7220636861696e210000006044820152606401610e6c565b612d8d6101fa80546001019055565b600061020360009054906101000a90046001600160a01b03166001600160a01b0316635f73e201346040518263ffffffff1660e01b815260040160206040518083038185885af1158015612de5573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612e0a9190615833565b6040805160e08101825260ff998a1681529789166020808a01918252978a16898301908152968a1660608a01908152958a1660808a019081526001600160601b0395861660a08b019081523360c08c0190815260009586526101fd909a52929093209851895491519751965193519251909516600160281b02600160281b600160881b0319928b16600160201b0292909216600160201b600160881b0319938b1663010000000263ff00000019978c1662010000029790971663ffff000019988c166101000261ffff1990931696909b169590951717959095169790971792909217959095169490941717825551600190910180546001600160a01b03929092166001600160a01b0319909216919091179055505050565b6000612f2e6101fa5490565b905090565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b6000612f6c81613383565b61ffff8416600090815261016060205260409020612f8b8385836158a7565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab848484604051612fbf93929190615724565b60405180910390a150505050565b61015f54604051633d7b2f6f60e21b815261ffff808716600483015285166024820152306044820152606481018390526060916001600160a01b03169063f5ecbdbc90608401600060405180830381865afa158015613030573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526130589190810190615960565b90505b949350505050565b6001600160a01b03163b151590565b604051633356ae4560e11b815230906366ad5c8a9061309b9087908790879087906004016159cd565b600060405180830381600087803b1580156130b557600080fd5b505af19250505080156130c6575060015b61204357808051906020012061019460008661ffff1661ffff168152602001908152602001600020846040516130fc9190615817565b9081526040805191829003602090810183206001600160401b0387166000908152915220919091557fe6f254030bcb01ffd20558175c13fcaed6d1520be7becee4c961b65f79243b0d906131579086908690869086906159cd565b60405180910390a1612043565b60006001600160e01b0319821663780e9d6360e01b1480610fc95750610fc982613fa7565b60006001600160e01b03198216637965db0b60e01b1480610fc95750610fc982613164565b60006131b982613189565b80610fc95750506001600160e01b03191660009081526101c7602052604090205460ff1690565b60008054610100900460ff161561322e578160ff16600114801561320a575061320830613063565b155b6132265760405162461bcd60e51b8152600401610e6c90615a0b565b506000919050565b60005460ff8084169116106132555760405162461bcd60e51b8152600401610e6c90615a0b565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff1661329b5760405162461bcd60e51b8152600401610e6c90615a59565b6117348282613ff7565b600054610100900460ff1661219a5760405162461bcd60e51b8152600401610e6c90615a59565b6132d68282612509565b61173457600082815261012d602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561330f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600054610100900460ff1661337a5760405162461bcd60e51b8152600401610e6c90615a59565b6117fd81614037565b6117fd8133614081565b6000908152606760205260409020546001600160a01b0316151590565b600081815260696020526040902080546001600160a01b0319166001600160a01b03841690811790915581906133df82611f62565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006134238261338d565b6134845760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610e6c565b600061348f83611f62565b9050806001600160a01b0316846001600160a01b031614806134b657506134b68185612f33565b8061305b5750836001600160a01b03166134cf846112ff565b6001600160a01b031614949350505050565b826001600160a01b03166134f482611f62565b6001600160a01b0316146135585760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610e6c565b6001600160a01b0382166135ba5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610e6c565b6135c58383836140e5565b6135d06000826133aa565b6001600160a01b03831660009081526068602052604081208054600192906135f9908490615aba565b90915550506001600160a01b0382166000908152606860205260408120805460019290613627908490615ad1565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b038681169182179092559151849391871691600080516020615f5583398151915291a461149283838361419d565b6136868282612509565b1561173457600082815261012d602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080516020615eee833981519152546001600160a01b031690565b600080516020615ece83398151915261173481613383565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561374b5761149283614299565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156137a5575060408051601f3d908101601f191682019092526137a291810190615833565b60015b6138085760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610e6c565b600080516020615eee83398151915281146138775760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610e6c565b50611492838383614333565b6001600160a01b0382166138d95760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610e6c565b6138e28161338d565b1561392e5760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606401610e6c565b61393a600083836140e5565b6001600160a01b0382166000908152606860205260408120805460019290613963908490615ad1565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386169081179091559051839290600080516020615f55833981519152908290a46117346000838361419d565b6000806000806000806000806000808a8060200190518101906139da9190615ae9565b9950995099509950995099509950995099509950613a008a8a8a8a8a8a8a8a8a8a614358565b7f1046a24c098e44fbda12f8600bd37cb06b6f2e48354350ae51621d09b3b5a9058e8b8b604051613a539392919061ffff9390931683526001600160a01b03919091166020830152604082015260600190565b60405180910390a15050505050505050505050505050565b6001600160e01b03198082169003613ac45760405162461bcd60e51b815260206004820152601c60248201527b115490cc4d8d4e881a5b9d985b1a59081a5b9d195c999858d9481a5960221b6044820152606401610e6c565b6001600160e01b03191660009081526101c760205260409020805460ff19166001179055565b6000613af582611f62565b9050613b03816000846140e5565b613b0e6000836133aa565b6001600160a01b0381166000908152606860205260408120805460019290613b37908490615aba565b909155505060008281526067602052604080822080546001600160a01b0319169055518391906001600160a01b03841690600080516020615f55833981519152908390a46117348160008461419d565b61ffff85166000908152610160602052604081208054613ba69061557f565b80601f0160208091040260200160405190810160405280929190818152602001828054613bd29061557f565b8015613c1f5780601f10613bf457610100808354040283529160200191613c1f565b820191906000526020600020905b815481529060010190602001808311613c0257829003601f168201915b505050505090508051600003613c765760405162461bcd60e51b815260206004820152601c60248201527b4c5a3a20646573742063686e2069736e74207472737465642073726360201b6044820152606401610e6c565b61015f5460405162c5803160e81b81526001600160a01b039091169063c5803100903490613cb2908a9086908b908b908b908b90600401615baf565b6000604051808303818588803b158015613ccb57600080fd5b505af1158015613cdf573d6000803e3d6000fd5b5050505050505050505050565b816001600160a01b0316836001600160a01b031603613d495760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610e6c565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613dc18484846134e1565b613dcd84848484614512565b6120435760405162461bcd60e51b8152600401610e6c90615c16565b6060604051806060016040528060228152602001615f7560229139905090565b606081600003613e305750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613e5a5780613e4481615c68565b9150613e539050600a83615c97565b9150613e34565b6000816001600160401b03811115613e7457613e74614b33565b6040519080825280601f01601f191660200182016040528015613e9e576020820181803683370190505b5090505b841561305b57613eb3600183615aba565b9150613ec0600a86615cab565b613ecb906030615ad1565b60f81b818381518110613ee057613ee06155b9565b60200101906001600160f81b031916908160001a905350613f02600a86615c97565b9450613ea2565b600082613f168584614617565b14949350505050565b6000613f2f8787878787876118ce565b60008181526101fb602052604090205490915060ff1615613f855760405162461bcd60e51b815260206004820152601060248201526f4e6f6e20756e69717565206d696e742160801b6044820152606401610e6c565b60009081526101fb60205260409020805460ff19166001179055505050505050565b60006001600160e01b031982166380ac58cd60e01b1480613fd857506001600160e01b03198216635b5e139f60e01b145b80610fc957506301ffc9a760e01b6001600160e01b0319831614610fc9565b600054610100900460ff1661401e5760405162461bcd60e51b8152600401610e6c90615a59565b606561402a8382615cbf565b5060666114928282615cbf565b600054610100900460ff1661405e5760405162461bcd60e51b8152600401610e6c90615a59565b61015f80546001600160a01b0319166001600160a01b0392909216919091179055565b61408b8282612509565b611734576140a3816001600160a01b0316601461468b565b6140ae83602061468b565b6040516020016140bf929190615d78565b60408051601f198184030181529082905262461bcd60e51b8252610e6c91600401614e30565b6001600160a01b0383166141405761413b81609980546000838152609a60205260408120829055600182018355919091527f72a152ddfb8e864297c917af52ea6c1c68aead0fee1a62673fcc7e0c94979d000155565b614163565b816001600160a01b0316836001600160a01b031614614163576141638382614826565b6001600160a01b03821661417a57611492816148c3565b826001600160a01b0316826001600160a01b031614611492576114928282614972565b816001600160a01b0316836001600160a01b0316036141bb57505050565b6001600160a01b038316158015906141eb57506001600160a01b03831660009081526101ff602052604090205481145b156142465760006141fb84612049565b111561422b5761420c836000611624565b6001600160a01b03841660009081526101ff6020526040902055614246565b6001600160a01b03831660009081526101ff60205260408120555b6001600160a01b0382161580159061427557506001600160a01b03821660009081526101ff6020526040902054155b15611492576001600160a01b039190911660009081526101ff602052604090205550565b6142a281613063565b6143045760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610e6c565b600080516020615eee83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b61433c836149b6565b6000825111806143495750805b156114925761204383836149f6565b6143618a612049565b600003614385576001600160a01b038a1660009081526101ff602052604090208990555b6040518061010001604052808860ff1681526020018760ff1681526020018660ff1681526020018560ff1681526020018460ff1681526020018360ff1681526020018260ff168152602001896001600160c81b03168152506101fc60008b815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a81548160ff021916908360ff16021790555060c08201518160000160066101000a81548160ff021916908360ff16021790555060e08201518160000160076101000a8154816001600160c81b0302191690836001600160c81b0316021790555090505061295a8a8a613883565b6000614526846001600160a01b0316613063565b1561460f57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061455d903390899088908890600401615de7565b6020604051808303816000875af1925050508015614598575060408051601f3d908101601f1916820190925261459591810190615e24565b60015b6145f5573d8080156145c6576040519150601f19603f3d011682016040523d82523d6000602084013e6145cb565b606091505b5080516000036145ed5760405162461bcd60e51b8152600401610e6c90615c16565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061305b565b50600161305b565b600081815b8451811015614683576000858281518110614639576146396155b9565b6020026020010151905080831161465f5760008381526020829052604090209250614670565b600081815260208490526040902092505b508061467b81615c68565b91505061461c565b509392505050565b6060600061469a836002615e41565b6146a5906002615ad1565b6001600160401b038111156146bc576146bc614b33565b6040519080825280601f01601f1916602001820160405280156146e6576020820181803683370190505b509050600360fc1b81600081518110614701576147016155b9565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110614730576147306155b9565b60200101906001600160f81b031916908160001a9053506000614754846002615e41565b61475f906001615ad1565b90505b60018111156147d7576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110614793576147936155b9565b1a60f81b8282815181106147a9576147a96155b9565b60200101906001600160f81b031916908160001a90535060049490941c936147d081615e60565b9050614762565b5083156118c75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610e6c565b6000600161483384612049565b61483d9190615aba565b600083815260986020526040902054909150808214614890576001600160a01b03841660009081526097602090815260408083208584528252808320548484528184208190558352609890915290208190555b5060009182526098602090815260408084208490556001600160a01b039094168352609781528383209183525290812055565b6099546000906148d590600190615aba565b6000838152609a6020526040812054609980549394509092849081106148fd576148fd6155b9565b90600052602060002001549050806099838154811061491e5761491e6155b9565b6000918252602080832090910192909255828152609a9091526040808220849055858252812055609980548061495657614956615e77565b6001900381819060005260206000200160009055905550505050565b600061497d83612049565b6001600160a01b039093166000908152609760209081526040808320868452825280832085905593825260989052919091209190915550565b6149bf81614299565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060614a0183613063565b614a5c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610e6c565b600080846001600160a01b031684604051614a779190615817565b600060405180830381855af49150503d8060008114614ab2576040519150601f19603f3d011682016040523d82523d6000602084013e614ab7565b606091505b5091509150614adf8282604051806060016040528060278152602001615f0e60279139614ae8565b95945050505050565b60608315614af75750816118c7565b825115614b075782518084602001fd5b8160405162461bcd60e51b8152600401610e6c9190614e30565b803561ffff8116811461326f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614b7157614b71614b33565b604052919050565b60006001600160401b03821115614b9257614b92614b33565b50601f01601f191660200190565b600082601f830112614bb157600080fd5b8135614bc4614bbf82614b79565b614b49565b818152846020838601011115614bd957600080fd5b816020850160208301376000918101602001919091529392505050565b80356001600160401b038116811461326f57600080fd5b60008060008060808587031215614c2357600080fd5b614c2c85614b21565b935060208501356001600160401b0380821115614c4857600080fd5b614c5488838901614ba0565b9450614c6260408801614bf6565b93506060870135915080821115614c7857600080fd5b50614c8587828801614ba0565b91505092959194509250565b6001600160e01b0319811681146117fd57600080fd5b600060208284031215614cb957600080fd5b81356118c781614c91565b6001600160a01b03811681146117fd57600080fd5b803561326f81614cc4565b60ff811681146117fd57600080fd5b803561326f81614ce4565b6000806000806000806000806000806000806101808d8f031215614d2157600080fd5b8c35614d2c81614cc4565b9b5060208d0135614d3c81614cc4565b9a50614d4a60408e01614b21565b9950614d5860608e01614b21565b985060808d0135975060a08d0135614d6f81614ce4565b965060c08d0135614d7f81614ce4565b955060e08d0135614d8f81614ce4565b94506101008d0135614da081614ce4565b9350614daf6101208e01614cf3565b92506101408d01359150614dc66101608e01614cd9565b90509295989b509295989b509295989b565b60005b83811015614df3578181015183820152602001614ddb565b838111156120435750506000910152565b60008151808452614e1c816020860160208601614dd8565b601f01601f19169290920160200192915050565b6020815260006118c76020830184614e04565b60008060408385031215614e5657600080fd5b614e5f83614b21565b946020939093013593505050565b600060208284031215614e7f57600080fd5b6118c782614b21565b600060208284031215614e9a57600080fd5b5035919050565b60008060408385031215614eb457600080fd5b8235614e5f81614cc4565b6020808252825182820181905260009190848201906040850190845b81811015614efd57835163ffffffff1683529284019291840191600101614edb565b50909695505050505050565b600060208284031215614f1b57600080fd5b81356118c781614cc4565b600080600060608486031215614f3b57600080fd5b8335614f4681614cc4565b92506020840135614f5681614cc4565b929592945050506040919091013590565b60008060408385031215614f7a57600080fd5b823591506020830135614f8c81614cc4565b809150509250929050565b60008083601f840112614fa957600080fd5b5081356001600160401b03811115614fc057600080fd5b602083019150836020828501011115614fd857600080fd5b9250929050565b600080600060408486031215614ff457600080fd5b614ffd84614b21565b925060208401356001600160401b0381111561501857600080fd5b61502486828701614f97565b9497909650939450505050565b60008060008060008060c0878903121561504a57600080fd5b86359550602087013561505c81614ce4565b9450604087013561506c81614ce4565b9350606087013561507c81614ce4565b9250608087013561508c81614ce4565b915060a087013561509c81614ce4565b809150509295509295509295565b600080604083850312156150bd57600080fd5b50508035926020909101359150565b600080604083850312156150df57600080fd5b82356150ea81614cc4565b915060208301356001600160401b0381111561510557600080fd5b61511185828601614ba0565b9150509250929050565b60008060006060848603121561513057600080fd5b83359250602084013561514281614ce4565b9150604084013561515281614ce4565b809150509250925092565b60008060006060848603121561517257600080fd5b61517b84614b21565b925060208401356001600160401b0381111561519657600080fd5b6151a286828701614ba0565b9250506151b160408501614bf6565b90509250925092565b6000806000606084860312156151cf57600080fd5b6151d884614b21565b925060208401359150604084013561515281614cc4565b6000806040838503121561520257600080fd5b61520b83614b21565b915061521960208401614b21565b90509250929050565b60008060006060848603121561523757600080fd5b61524084614b21565b95602085013595506040909401359392505050565b6000806040838503121561526857600080fd5b823561527381614cc4565b915060208301358015158114614f8c57600080fd5b6000806000806080858703121561529e57600080fd5b84356152a981614cc4565b935060208501356152b981614cc4565b92506040850135915060608501356001600160401b038111156152db57600080fd5b614c8587828801614ba0565b6020808252825182820181905260009190848201906040850190845b81811015614efd5783516001600160a01b031683529284019291840191600101615303565b6000806040838503121561533b57600080fd5b823561534681614cc4565b9150602083013563ffffffff81168114614f8c57600080fd5b600080600080600060a0868803121561537757600080fd5b853561538281614ce4565b9450602086013561539281614ce4565b935060408601356153a281614ce4565b925060608601356153b281614ce4565b915060808601356153c281614ce4565b809150509295509295909350565b6000806000806000608086880312156153e857600080fd5b6153f186614b21565b94506153ff60208701614b21565b93506040860135925060608601356001600160401b0381111561542157600080fd5b61542d88828901614f97565b969995985093965092949392505050565b600080600080600080600060c0888a03121561545957600080fd5b87356001600160401b038082111561547057600080fd5b818a0191508a601f83011261548457600080fd5b81358181111561549357600080fd5b8b60208260051b85010111156154a857600080fd5b6020928301995097506154be918a019050614cf3565b94506154cc60408901614cf3565b93506154da60608901614cf3565b92506154e860808901614cf3565b91506154f660a08901614cf3565b905092959891949750929550565b6000806040838503121561551757600080fd5b823561552281614cc4565b91506020830135614f8c81614cc4565b6000806000806080858703121561554857600080fd5b61555185614b21565b935061555f60208601614b21565b9250604085013561556f81614cc4565b9396929550929360600135925050565b600181811c9082168061559357607f821691505b6020821081036155b357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b602080825260199082015278139bdd081d1a19481bdddb995c881bdc88185c1c1c9bdd9959603a1b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602c90820152600080516020615eae83398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c90820152600080516020615eae83398151915260408201526b6163746976652070726f787960a01b606082015260800190565b8183823760009101908152919050565b805160208083015191908110156155b35760001960209190910360031b1b16919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff841681526040602082015260006130586040830184866156fb565b61ffff861681526001600160a01b038516602082015260a06040820181905260009061577090830186614e04565b8415156060840152828103608084015261578a8185614e04565b98975050505050505050565b600080604083850312156157a957600080fd5b505080516020909101519092909150565b600083516157cc818460208801614dd8565b8351908301906157e0818360208801614dd8565b01949350505050565b600061ffff8088168352808716602084015250846040830152608060608301526119456080830184866156fb565b60008251615829818460208701614dd8565b9190910192915050565b60006020828403121561584557600080fd5b5051919050565b601f82111561149257600081815260208120601f850160051c810160208610156158735750805b601f850160051c820191505b818110156112f75782815560010161587f565b600019600383901b1c191660019190911b1790565b6001600160401b038311156158be576158be614b33565b6158d2836158cc835461557f565b8361584c565b6000601f84116001811461590057600085156158ee5750838201355b6158f88682615892565b845550610f99565b600083815260209020601f19861690835b828110156159315786850135825560209485019460019092019101615911565b508682101561594e5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006020828403121561597257600080fd5b81516001600160401b0381111561598857600080fd5b8201601f8101841361599957600080fd5b80516159a7614bbf82614b79565b8181528560208385010111156159bc57600080fd5b614adf826020830160208601614dd8565b61ffff851681526080602082015260006159ea6080830186614e04565b6001600160401b038516604084015282810360608401526119458185614e04565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600082821015615acc57615acc615aa4565b500390565b60008219821115615ae457615ae4615aa4565b500190565b6000806000806000806000806000806101408b8d031215615b0957600080fd5b8a51615b1481614cc4565b809a505060208b0151985060408b0151975060608b0151615b3481614ce4565b60808c0151909750615b4581614ce4565b60a08c0151909650615b5681614ce4565b60c08c0151909550615b6781614ce4565b60e08c0151909450615b7881614ce4565b6101008c0151909350615b8a81614ce4565b6101208c0151909250615b9c81614ce4565b809150509295989b9194979a5092959850565b61ffff8716815260c060208201526000615bcc60c0830188614e04565b8281036040840152615bde8188614e04565b6001600160a01b0387811660608601528616608085015283810360a08501529050615c098185614e04565b9998505050505050505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600060018201615c7a57615c7a615aa4565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082615ca657615ca6615c81565b500490565b600082615cba57615cba615c81565b500690565b81516001600160401b03811115615cd857615cd8614b33565b615cec81615ce6845461557f565b8461584c565b602080601f831160018114615d1b5760008415615d095750858301515b615d138582615892565b8655506112f7565b600085815260208120601f198616915b82811015615d4a57888601518255948401946001909101908401615d2b565b5085821015615d685787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351615daa816017850160208801614dd8565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615ddb816028840160208801614dd8565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615e1a90830184614e04565b9695505050505050565b600060208284031215615e3657600080fd5b81516118c781614c91565b6000816000190483118215151615615e5b57615e5b615aa4565b500290565b600081615e6f57615e6f615aa4565b506000190190565b634e487b7160e01b600052603160045260246000fdfe96a5a7c64c68f2a09ecd97a5d0e4e9b0ca7344f6196481bc066d1f6eb768db4c46756e6374696f6e206d7573742062652063616c6c6564207468726f75676820189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65649f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef68747470733a2f2f6d6f7267616e6e696e672e666c6f61742d6e6674732e636f6d2fa26469706673582212201ac34047bfe4b81ff7f212585fbcb64f0bbbb094ae3b239b2e4d7ec36532aee464736f6c634300080f0033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.