Source Code
Overview
CELO Balance
CELO Value
$0.00Multichain Info
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
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:
SuperChainBadges
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
No with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {ERC1155Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
struct BadgeUpdate {
uint256 badgeId;
uint256 tier;
}
struct BadgeMetadata {
uint256 badgeId;
string generalURI;
}
struct BadgeTierMetadata {
uint256 badgeId;
uint256 tier;
string newURI;
uint256 points;
}
contract SuperChainBadges is
Initializable,
ERC1155Upgradeable,
OwnableUpgradeable,
UUPSUpgradeable
{
uint256 constant LEVEL_MASK = uint256(type(uint128).max);
uint256 constant LEVEL_SHIFT = 128;
/// @custom:storage-location erc7201:openzeppelin.storage.superchain_badges
struct BadgesStorage {
address resolver;
mapping(uint256 => Badge) _badges;
mapping(address => mapping(uint256 => uint256)) _userBadgeTiers;
}
struct BadgeTier {
string uri;
uint256 points;
}
struct Badge {
string generalURI;
mapping(uint256 => BadgeTier) tiers;
uint256 highestTier;
}
event BadgeTierSet(
uint256 indexed badgeId,
uint256 tier,
string uri,
uint256 points
);
event BadgeMinted(
address indexed user,
uint256 indexed badgeId,
uint256 initialTier,
uint256 points,
string uri
);
event BadgeMetadataSettled(uint256 indexed badgeId, string generalURI);
event BadgeMetadataUpdated(uint256 indexed badgeId, string generalURI);
event BadgeTierMetadataUpdated(
uint256 indexed badgeId,
uint256 tier,
string newURI
);
event BadgeTierUpdated(
address indexed user,
uint256 indexed badgeId,
uint256 tier,
uint256 points,
string uri
);
event BadgeTierRemoved(uint256 indexed badgeId, uint256 tier);
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.superchain_badges")) - 1)) & ~bytes32(uint256(0xff));
bytes32 private constant SUPERCHAIN_BADGES_STORAGE_LOCATION =
0xb2b7b32472936fec942d11d364b3fb7baeea6584fbe4aa7e3432289df3426200;
function badgesStorage() private pure returns (BadgesStorage storage $) {
assembly {
$.slot := SUPERCHAIN_BADGES_STORAGE_LOCATION
}
}
function initialize(address owner) public initializer {
__ERC1155_init("");
__Ownable_init(owner);
__UUPSUpgradeable_init();
}
function setBadgesAndTiers(
BadgeMetadata[] memory badges,
BadgeTierMetadata[] memory badgeTiers
) public onlyOwner {
for (uint256 i = 0; i < badges.length; i++) {
setBadgeMetadata(badges[i].badgeId, badges[i].generalURI);
}
for (uint256 i = 0; i < badgeTiers.length; i++) {
setBadgeTier(
badgeTiers[i].badgeId,
badgeTiers[i].tier,
badgeTiers[i].newURI,
badgeTiers[i].points
);
}
}
function setBadgeMetadata(
uint256 badgeId,
string memory generalURI
) public onlyOwner {
BadgesStorage storage s = badgesStorage();
s._badges[badgeId].generalURI = generalURI;
emit BadgeMetadataSettled(badgeId, generalURI);
}
function updateBadgeMetadata(
uint256 badgeId,
string memory generalURI
) public onlyOwner {
BadgesStorage storage s = badgesStorage();
require(
bytes(s._badges[badgeId].generalURI).length != 0,
"Badge does not exist"
);
s._badges[badgeId].generalURI = generalURI;
emit BadgeMetadataUpdated(badgeId, generalURI);
}
function updateBadgeTierMetadata(
uint256 badgeId,
uint256 tier,
string memory newURI
) public onlyOwner {
BadgesStorage storage s = badgesStorage();
require(
bytes(s._badges[badgeId].generalURI).length != 0,
"Badge does not exist"
);
require(
bytes(s._badges[badgeId].tiers[tier].uri).length != 0,
"URI for initial tier not set"
);
s._badges[badgeId].tiers[tier].uri = newURI;
emit BadgeTierMetadataUpdated(badgeId, tier, newURI);
}
function setBadgeTier(
uint256 badgeId,
uint256 tier,
string memory newURI,
uint256 points
) public onlyOwner {
BadgesStorage storage s = badgesStorage();
require(
bytes(s._badges[badgeId].generalURI).length != 0,
"Badge does not exist"
);
require(tier > 0, "Tier must be greater than 0");
require(
tier == s._badges[badgeId].highestTier + 1,
"Tiers must be added sequentially"
);
if (tier > 1) {
require(
points > s._badges[badgeId].tiers[tier - 1].points,
"Points must be greater than the previous tier"
);
}
s._badges[badgeId].tiers[tier] = BadgeTier(newURI, points);
s._badges[badgeId].highestTier = tier;
emit BadgeTierSet(badgeId, tier, newURI, points);
}
function mintBadge(
address to,
uint256 badgeId,
uint256 initialTier
) internal returns (uint256 totalPoints) {
BadgesStorage storage s = badgesStorage();
require(
bytes(s._badges[badgeId].tiers[initialTier].uri).length != 0,
"URI for initial tier not set"
);
uint256 tokenId = _encodeTokenId(badgeId, initialTier);
require(balanceOf(to, tokenId) == 0, "Badge already minted");
_mint(to, tokenId, 1, "");
s._userBadgeTiers[to][badgeId] = initialTier;
for (uint256 tier = 1; tier <= initialTier; tier++) {
totalPoints += s._badges[badgeId].tiers[tier].points;
}
emit BadgeMinted(
to,
badgeId,
initialTier,
totalPoints,
s._badges[badgeId].tiers[initialTier].uri
);
}
function updateBadgeTier(
address user,
uint256 badgeId,
uint256 newTier
) internal returns (uint256 totalPoints) {
BadgesStorage storage s = badgesStorage();
require(
bytes(s._badges[badgeId].tiers[newTier].uri).length != 0,
"URI for new tier not set"
);
uint256 oldTier = s._userBadgeTiers[user][badgeId];
uint256 oldTokenId = _encodeTokenId(badgeId, oldTier);
uint256 newTokenId = _encodeTokenId(badgeId, newTier);
require(balanceOf(user, newTokenId) == 0, "Badge already minted");
_burn(user, oldTokenId, 1);
_mint(user, newTokenId, 1, "");
s._userBadgeTiers[user][badgeId] = newTier;
for (uint256 tier = oldTier + 1; tier <= newTier; tier++) {
totalPoints += s._badges[badgeId].tiers[tier].points;
}
emit BadgeTierUpdated(
user,
badgeId,
newTier,
totalPoints,
s._badges[badgeId].tiers[newTier].uri
);
}
function getBadgeURIForUser(
address user,
uint256 badgeId
) public view returns (string memory generalURI, string memory tierUri) {
BadgesStorage storage s = badgesStorage();
uint256 userTier = s._userBadgeTiers[user][badgeId];
generalURI = s._badges[badgeId].generalURI;
tierUri = s._badges[badgeId].tiers[userTier].uri;
}
function getGeneralBadgeURI(
uint256 badgeId
) public view returns (string memory) {
BadgesStorage storage s = badgesStorage();
return s._badges[badgeId].generalURI;
}
function getUserBadgeTier(
address user,
uint256 badgeId
) public view returns (uint256) {
BadgesStorage storage s = badgesStorage();
return s._userBadgeTiers[user][badgeId];
}
function updateOrMintBadges(
address user,
BadgeUpdate[] memory updates
) public returns (uint256 points) {
BadgesStorage storage s = badgesStorage();
require(
msg.sender == s.resolver,
"Only resolver can call this function"
);
for (uint256 i = 0; i < updates.length; i++) {
uint256 badgeId = updates[i].badgeId;
uint256 tier = updates[i].tier;
if (s._userBadgeTiers[user][badgeId] > 0) {
points += updateBadgeTier(user, badgeId, tier);
} else {
points += mintBadge(user, badgeId, tier);
}
}
}
function setResolver(address _resolver) public onlyOwner {
BadgesStorage storage s = badgesStorage();
s.resolver = _resolver;
}
function getHighestBadgeTier(
uint256 badgeId
) public view returns (uint256) {
BadgesStorage storage s = badgesStorage();
return s._badges[badgeId].highestTier;
}
function uri(uint256 tokenId) public view override returns (string memory) {
BadgesStorage storage s = badgesStorage();
(uint256 badgeId, uint256 tier) = _decodeTokenId(tokenId);
string memory baseURI = s._badges[badgeId].generalURI;
string memory tierURI = s._badges[badgeId].tiers[tier].uri;
return
string(
abi.encodePacked(
"{",
'"generalURI": "',
baseURI,
'",',
'"tierURI": "',
tierURI,
'"',
"}"
)
);
}
function safeTransferFrom(
address,
address,
uint256,
uint256,
bytes memory
) public virtual override {
revert("BadgeNFT: Transfers are disabled");
}
function safeBatchTransferFrom(
address,
address,
uint256[] memory,
uint256[] memory,
bytes memory
) public virtual override {
revert("BadgeNFT: Transfers are disabled");
}
function _encodeTokenId(
uint256 badgeId,
uint256 tier
) internal pure returns (uint256) {
return (badgeId << LEVEL_SHIFT) | (tier & LEVEL_MASK);
}
function _decodeTokenId(
uint256 tokenId
) internal pure returns (uint256 badgeId, uint256 tier) {
badgeId = tokenId >> LEVEL_SHIFT;
tier = tokenId & LEVEL_MASK;
}
function resolver() public view returns (address) {
BadgesStorage storage s = badgesStorage();
return s.resolver;
}
function removeBadgeTier(uint256 badgeId, uint256 tier) public onlyOwner {
BadgesStorage storage s = badgesStorage();
require(bytes(s._badges[badgeId].generalURI).length != 0, "Badge does not exist");
require(bytes(s._badges[badgeId].tiers[tier].uri).length != 0, "Tier does not exist");
require(tier == s._badges[badgeId].highestTier, "Can only remove highest tier");
delete s._badges[badgeId].tiers[tier];
s._badges[badgeId].highestTier = tier - 1;
emit BadgeTierRemoved(badgeId, tier);
}
function _authorizeUpgrade(address) internal override onlyOwner {}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.20;
import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol";
import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol";
import {Initializable} from "./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.
*/
abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
address private immutable __self = address(this);
/**
* @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`
* and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,
* while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.
* If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must
* be the empty byte string if no function should be called, making it impossible to invoke the `receive` function
* during an upgrade.
*/
string public constant UPGRADE_INTERFACE_VERSION = "5.0.0";
/**
* @dev The call is from an unauthorized context.
*/
error UUPSUnauthorizedCallContext();
/**
* @dev The storage `slot` is unsupported as a UUID.
*/
error UUPSUnsupportedProxiableUUID(bytes32 slot);
/**
* @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() {
_checkProxy();
_;
}
/**
* @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() {
_checkNotDelegated();
_;
}
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/**
* @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate the implementation's compatibility when performing 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 notDelegated returns (bytes32) {
return ERC1967Utils.IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data);
}
/**
* @dev Reverts if the execution is not performed via delegatecall or the execution
* context is not of a proxy with an ERC1967-compliant implementation pointing to self.
* See {_onlyProxy}.
*/
function _checkProxy() internal view virtual {
if (
address(this) == __self || // Must be called through delegatecall
ERC1967Utils.getImplementation() != __self // Must be called through an active proxy
) {
revert UUPSUnauthorizedCallContext();
}
}
/**
* @dev Reverts if the execution is performed via delegatecall.
* See {notDelegated}.
*/
function _checkNotDelegated() internal view virtual {
if (address(this) != __self) {
// Must not be called through delegatecall
revert UUPSUnauthorizedCallContext();
}
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
/**
* @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.
*
* As a security check, {proxiableUUID} is invoked in the new implementation, and the return value
* is expected to be the implementation slot in ERC1967.
*
* Emits an {IERC1967-Upgraded} event.
*/
function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {
try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {
revert UUPSUnsupportedProxiableUUID(slot);
}
ERC1967Utils.upgradeToAndCall(newImplementation, data);
} catch {
// The implementation is not UUPS
revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.20;
import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol";
import {IERC1155MetadataURI} from "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol";
import {ContextUpgradeable} from "../../utils/ContextUpgradeable.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {ERC165Upgradeable} from "../../utils/introspection/ERC165Upgradeable.sol";
import {Arrays} from "@openzeppelin/contracts/utils/Arrays.sol";
import {IERC1155Errors} from "@openzeppelin/contracts/interfaces/draft-IERC6093.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*/
abstract contract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155, IERC1155MetadataURI, IERC1155Errors {
using Arrays for uint256[];
using Arrays for address[];
/// @custom:storage-location erc7201:openzeppelin.storage.ERC1155
struct ERC1155Storage {
mapping(uint256 id => mapping(address account => uint256)) _balances;
mapping(address account => mapping(address operator => bool)) _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string _uri;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC1155")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant ERC1155StorageLocation = 0x88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c4500;
function _getERC1155Storage() private pure returns (ERC1155Storage storage $) {
assembly {
$.slot := ERC1155StorageLocation
}
}
/**
* @dev See {_setURI}.
*/
function __ERC1155_init(string memory uri_) internal onlyInitializing {
__ERC1155_init_unchained(uri_);
}
function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256 /* id */) public view virtual returns (string memory) {
ERC1155Storage storage $ = _getERC1155Storage();
return $._uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*/
function balanceOf(address account, uint256 id) public view virtual returns (uint256) {
ERC1155Storage storage $ = _getERC1155Storage();
return $._balances[id][account];
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(
address[] memory accounts,
uint256[] memory ids
) public view virtual returns (uint256[] memory) {
if (accounts.length != ids.length) {
revert ERC1155InvalidArrayLength(ids.length, accounts.length);
}
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts.unsafeMemoryAccess(i), ids.unsafeMemoryAccess(i));
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual returns (bool) {
ERC1155Storage storage $ = _getERC1155Storage();
return $._operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) public virtual {
address sender = _msgSender();
if (from != sender && !isApprovedForAll(from, sender)) {
revert ERC1155MissingApprovalForAll(sender, from);
}
_safeTransferFrom(from, to, id, value, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) public virtual {
address sender = _msgSender();
if (from != sender && !isApprovedForAll(from, sender)) {
revert ERC1155MissingApprovalForAll(sender, from);
}
_safeBatchTransferFrom(from, to, ids, values, data);
}
/**
* @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. Will mint (or burn) if `from`
* (or `to`) is the zero address.
*
* Emits a {TransferSingle} event if the arrays contain one element, and {TransferBatch} otherwise.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement either {IERC1155Receiver-onERC1155Received}
* or {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value.
* - `ids` and `values` must have the same length.
*
* NOTE: The ERC-1155 acceptance check is not performed in this function. See {_updateWithAcceptanceCheck} instead.
*/
function _update(address from, address to, uint256[] memory ids, uint256[] memory values) internal virtual {
ERC1155Storage storage $ = _getERC1155Storage();
if (ids.length != values.length) {
revert ERC1155InvalidArrayLength(ids.length, values.length);
}
address operator = _msgSender();
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids.unsafeMemoryAccess(i);
uint256 value = values.unsafeMemoryAccess(i);
if (from != address(0)) {
uint256 fromBalance = $._balances[id][from];
if (fromBalance < value) {
revert ERC1155InsufficientBalance(from, fromBalance, value, id);
}
unchecked {
// Overflow not possible: value <= fromBalance
$._balances[id][from] = fromBalance - value;
}
}
if (to != address(0)) {
$._balances[id][to] += value;
}
}
if (ids.length == 1) {
uint256 id = ids.unsafeMemoryAccess(0);
uint256 value = values.unsafeMemoryAccess(0);
emit TransferSingle(operator, from, to, id, value);
} else {
emit TransferBatch(operator, from, to, ids, values);
}
}
/**
* @dev Version of {_update} that performs the token acceptance check by calling
* {IERC1155Receiver-onERC1155Received} or {IERC1155Receiver-onERC1155BatchReceived} on the receiver address if it
* contains code (eg. is a smart contract at the moment of execution).
*
* IMPORTANT: Overriding this function is discouraged because it poses a reentrancy risk from the receiver. So any
* update to the contract state after this function would break the check-effect-interaction pattern. Consider
* overriding {_update} instead.
*/
function _updateWithAcceptanceCheck(
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) internal virtual {
_update(from, to, ids, values);
if (to != address(0)) {
address operator = _msgSender();
if (ids.length == 1) {
uint256 id = ids.unsafeMemoryAccess(0);
uint256 value = values.unsafeMemoryAccess(0);
_doSafeTransferAcceptanceCheck(operator, from, to, id, value, data);
} else {
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, values, data);
}
}
}
/**
* @dev Transfers a `value` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `from` must have a balance of tokens of type `id` of at least `value` amount.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
(uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
_updateWithAcceptanceCheck(from, to, ids, values, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
* - `ids` and `values` must have the same length.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
_updateWithAcceptanceCheck(from, to, ids, values, data);
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurrence of the `\{id\}` substring in either the
* URI or any of the values in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
ERC1155Storage storage $ = _getERC1155Storage();
$._uri = newuri;
}
/**
* @dev Creates a `value` amount of tokens of type `id`, and assigns them to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(address to, uint256 id, uint256 value, bytes memory data) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
(uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
_updateWithAcceptanceCheck(address(0), to, ids, values, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `values` must have the same length.
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _mintBatch(address to, uint256[] memory ids, uint256[] memory values, bytes memory data) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
_updateWithAcceptanceCheck(address(0), to, ids, values, data);
}
/**
* @dev Destroys a `value` amount of tokens of type `id` from `from`
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `value` amount of tokens of type `id`.
*/
function _burn(address from, uint256 id, uint256 value) internal {
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
(uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
_updateWithAcceptanceCheck(from, address(0), ids, values, "");
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `value` amount of tokens of type `id`.
* - `ids` and `values` must have the same length.
*/
function _burnBatch(address from, uint256[] memory ids, uint256[] memory values) internal {
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
_updateWithAcceptanceCheck(from, address(0), ids, values, "");
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the zero address.
*/
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
ERC1155Storage storage $ = _getERC1155Storage();
if (operator == address(0)) {
revert ERC1155InvalidOperator(address(0));
}
$._operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Performs an acceptance check by calling {IERC1155-onERC1155Received} on the `to` address
* if it contains code at the moment of execution.
*/
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 value,
bytes memory data
) private {
if (to.code.length > 0) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, value, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
// Tokens rejected
revert ERC1155InvalidReceiver(to);
}
} catch (bytes memory reason) {
if (reason.length == 0) {
// non-ERC1155Receiver implementer
revert ERC1155InvalidReceiver(to);
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
}
/**
* @dev Performs a batch acceptance check by calling {IERC1155-onERC1155BatchReceived} on the `to` address
* if it contains code at the moment of execution.
*/
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) private {
if (to.code.length > 0) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, values, data) returns (
bytes4 response
) {
if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
// Tokens rejected
revert ERC1155InvalidReceiver(to);
}
} catch (bytes memory reason) {
if (reason.length == 0) {
// non-ERC1155Receiver implementer
revert ERC1155InvalidReceiver(to);
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
}
/**
* @dev Creates an array in memory with only one value for each of the elements provided.
*/
function _asSingletonArrays(
uint256 element1,
uint256 element2
) private pure returns (uint256[] memory array1, uint256[] memory array2) {
/// @solidity memory-safe-assembly
assembly {
// Load the free memory pointer
array1 := mload(0x40)
// Set array length to 1
mstore(array1, 1)
// Store the single element at the next word after the length (where content starts)
mstore(add(array1, 0x20), element1)
// Repeat for next array locating it right after the first array
array2 := add(array1, 0x40)
mstore(array2, 1)
mstore(add(array2, 0x20), element2)
// Update the free memory pointer by pointing after the second array
mstore(0x40, add(array2, 0x40))
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
/// @custom:storage-location erc7201:openzeppelin.storage.Ownable
struct OwnableStorage {
address _owner;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;
function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
assembly {
$.slot := OwnableStorageLocation
}
}
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
function __Ownable_init(address initialOwner) internal onlyInitializing {
__Ownable_init_unchained(initialOwner);
}
function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
OwnableStorage storage $ = _getOwnableStorage();
return $._owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
OwnableStorage storage $ = _getOwnableStorage();
address oldOwner = $._owner;
$._owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.20;
/**
* @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]
* ```solidity
* 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 Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct InitializableStorage {
/**
* @dev Indicates that the contract has been initialized.
*/
uint64 _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/**
* @dev The contract is already initialized.
*/
error InvalidInitialization();
/**
* @dev The contract is not initializing.
*/
error NotInitializing();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint64 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.
*
* Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
// Cache values to avoid duplicated sloads
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reininitialization) and the
// current contract is just being deployed
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._initialized = 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.
*
* 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.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* 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.
*
* WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint64 version) {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._initialized = version;
$._initializing = true;
_;
$._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() {
_checkInitializing();
_;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
/**
* @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.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
assembly {
$.slot := INITIALIZABLE_STORAGE
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.20;
/**
* @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 IERC1822Proxiable {
/**
* @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 v5.0.0) (proxy/ERC1967/ERC1967Utils.sol)
pragma solidity ^0.8.20;
import {IBeacon} from "../beacon/IBeacon.sol";
import {Address} from "../../utils/Address.sol";
import {StorageSlot} from "../../utils/StorageSlot.sol";
/**
* @dev This abstract contract provides getters and event emitting update functions for
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
*/
library ERC1967Utils {
// We re-declare ERC-1967 events here because they can't be used directly from IERC1967.
// This will be fixed in Solidity 0.8.21. At that point we should remove these events.
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Emitted when the beacon is changed.
*/
event BeaconUpgraded(address indexed beacon);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev The `implementation` of the proxy is invalid.
*/
error ERC1967InvalidImplementation(address implementation);
/**
* @dev The `admin` of the proxy is invalid.
*/
error ERC1967InvalidAdmin(address admin);
/**
* @dev The `beacon` of the proxy is invalid.
*/
error ERC1967InvalidBeacon(address beacon);
/**
* @dev An upgrade function sees `msg.value > 0` that may be lost.
*/
error ERC1967NonPayable();
/**
* @dev Returns the current implementation address.
*/
function getImplementation() internal view returns (address) {
return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
if (newImplementation.code.length == 0) {
revert ERC1967InvalidImplementation(newImplementation);
}
StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Performs implementation upgrade with additional setup call if data is nonempty.
* This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
* to avoid stuck value in the contract.
*
* Emits an {IERC1967-Upgraded} event.
*/
function upgradeToAndCall(address newImplementation, bytes memory data) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
if (data.length > 0) {
Address.functionDelegateCall(newImplementation, data);
} else {
_checkNonPayable();
}
}
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Returns the current admin.
*
* TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using
* the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
* `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
*/
function getAdmin() internal view returns (address) {
return StorageSlot.getAddressSlot(ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
if (newAdmin == address(0)) {
revert ERC1967InvalidAdmin(address(0));
}
StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {IERC1967-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 the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Returns the current beacon.
*/
function getBeacon() internal view returns (address) {
return StorageSlot.getAddressSlot(BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the EIP1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
if (newBeacon.code.length == 0) {
revert ERC1967InvalidBeacon(newBeacon);
}
StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;
address beaconImplementation = IBeacon(newBeacon).implementation();
if (beaconImplementation.code.length == 0) {
revert ERC1967InvalidImplementation(beaconImplementation);
}
}
/**
* @dev Change the beacon and trigger a setup call if data is nonempty.
* This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
* to avoid stuck value in the contract.
*
* Emits an {IERC1967-BeaconUpgraded} event.
*
* CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since
* it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for
* efficiency.
*/
function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {
_setBeacon(newBeacon);
emit BeaconUpgraded(newBeacon);
if (data.length > 0) {
Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
} else {
_checkNonPayable();
}
}
/**
* @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract
* if an upgrade doesn't perform an initialization call.
*/
function _checkNonPayable() private {
if (msg.value > 0) {
revert ERC1967NonPayable();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the value of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(
address[] calldata accounts,
uint256[] calldata ids
) external view returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155Received} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `value` amount.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
*
* Requirements:
*
* - `ids` and `values` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Interface that must be implemented by smart contracts in order to receive
* ERC-1155 token transfers.
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.20;
import {IERC1155} from "../IERC1155.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*/
interface IERC1155MetadataURI is IERC1155 {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
import {Initializable} from "../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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {Initializable} from "../../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);
* }
* ```
*/
abstract contract ERC165Upgradeable is Initializable, IERC165 {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Arrays.sol)
pragma solidity ^0.8.20;
import {StorageSlot} from "./StorageSlot.sol";
import {Math} from "./math/Math.sol";
/**
* @dev Collection of functions related to array types.
*/
library Arrays {
using StorageSlot for bytes32;
/**
* @dev Searches a sorted `array` and returns the first index that contains
* a value greater or equal to `element`. If no such index exists (i.e. all
* values in the array are strictly less than `element`), the array length is
* returned. Time complexity O(log n).
*
* `array` is expected to be sorted in ascending order, and to contain no
* repeated elements.
*/
function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {
uint256 low = 0;
uint256 high = array.length;
if (high == 0) {
return 0;
}
while (low < high) {
uint256 mid = Math.average(low, high);
// Note that mid will always be strictly less than high (i.e. it will be a valid array index)
// because Math.average rounds towards zero (it does integer division with truncation).
if (unsafeAccess(array, mid).value > element) {
high = mid;
} else {
low = mid + 1;
}
}
// At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.
if (low > 0 && unsafeAccess(array, low - 1).value == element) {
return low - 1;
} else {
return low;
}
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) {
bytes32 slot;
// We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
// following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.
/// @solidity memory-safe-assembly
assembly {
mstore(0, arr.slot)
slot := add(keccak256(0, 0x20), pos)
}
return slot.getAddressSlot();
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) {
bytes32 slot;
// We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
// following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.
/// @solidity memory-safe-assembly
assembly {
mstore(0, arr.slot)
slot := add(keccak256(0, 0x20), pos)
}
return slot.getBytes32Slot();
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) {
bytes32 slot;
// We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
// following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.
/// @solidity memory-safe-assembly
assembly {
mstore(0, arr.slot)
slot := add(keccak256(0, 0x20), pos)
}
return slot.getUint256Slot();
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) {
assembly {
res := mload(add(add(arr, 0x20), mul(pos, 0x20)))
}
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) {
assembly {
res := mload(add(add(arr, 0x20), mul(pos, 0x20)))
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.20;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeacon {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {UpgradeableBeacon} will check that this address is a contract.
*/
function implementation() external view returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @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 or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* 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.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @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`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @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:
* ```solidity
* 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(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}{
"remappings": [
"eas-contracts/=lib/eas-contracts/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
"openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
"solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/"
],
"optimizer": {
"enabled": false,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC1155InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC1155InvalidApprover","type":"error"},{"inputs":[{"internalType":"uint256","name":"idsLength","type":"uint256"},{"internalType":"uint256","name":"valuesLength","type":"uint256"}],"name":"ERC1155InvalidArrayLength","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC1155InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC1155InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC1155InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC1155MissingApprovalForAll","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","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":"uint256","name":"badgeId","type":"uint256"},{"indexed":false,"internalType":"string","name":"generalURI","type":"string"}],"name":"BadgeMetadataSettled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"badgeId","type":"uint256"},{"indexed":false,"internalType":"string","name":"generalURI","type":"string"}],"name":"BadgeMetadataUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"badgeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"initialTier","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"points","type":"uint256"},{"indexed":false,"internalType":"string","name":"uri","type":"string"}],"name":"BadgeMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"badgeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tier","type":"uint256"},{"indexed":false,"internalType":"string","name":"newURI","type":"string"}],"name":"BadgeTierMetadataUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"badgeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tier","type":"uint256"}],"name":"BadgeTierRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"badgeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tier","type":"uint256"},{"indexed":false,"internalType":"string","name":"uri","type":"string"},{"indexed":false,"internalType":"uint256","name":"points","type":"uint256"}],"name":"BadgeTierSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"badgeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tier","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"points","type":"uint256"},{"indexed":false,"internalType":"string","name":"uri","type":"string"}],"name":"BadgeTierUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"badgeId","type":"uint256"}],"name":"getBadgeURIForUser","outputs":[{"internalType":"string","name":"generalURI","type":"string"},{"internalType":"string","name":"tierUri","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"badgeId","type":"uint256"}],"name":"getGeneralBadgeURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"badgeId","type":"uint256"}],"name":"getHighestBadgeTier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"badgeId","type":"uint256"}],"name":"getUserBadgeTier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"badgeId","type":"uint256"},{"internalType":"uint256","name":"tier","type":"uint256"}],"name":"removeBadgeTier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resolver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"badgeId","type":"uint256"},{"internalType":"string","name":"generalURI","type":"string"}],"name":"setBadgeMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"badgeId","type":"uint256"},{"internalType":"uint256","name":"tier","type":"uint256"},{"internalType":"string","name":"newURI","type":"string"},{"internalType":"uint256","name":"points","type":"uint256"}],"name":"setBadgeTier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"badgeId","type":"uint256"},{"internalType":"string","name":"generalURI","type":"string"}],"internalType":"struct BadgeMetadata[]","name":"badges","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"badgeId","type":"uint256"},{"internalType":"uint256","name":"tier","type":"uint256"},{"internalType":"string","name":"newURI","type":"string"},{"internalType":"uint256","name":"points","type":"uint256"}],"internalType":"struct BadgeTierMetadata[]","name":"badgeTiers","type":"tuple[]"}],"name":"setBadgesAndTiers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_resolver","type":"address"}],"name":"setResolver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"badgeId","type":"uint256"},{"internalType":"string","name":"generalURI","type":"string"}],"name":"updateBadgeMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"badgeId","type":"uint256"},{"internalType":"uint256","name":"tier","type":"uint256"},{"internalType":"string","name":"newURI","type":"string"}],"name":"updateBadgeTierMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"components":[{"internalType":"uint256","name":"badgeId","type":"uint256"},{"internalType":"uint256","name":"tier","type":"uint256"}],"internalType":"struct BadgeUpdate[]","name":"updates","type":"tuple[]"}],"name":"updateOrMintBadges","outputs":[{"internalType":"uint256","name":"points","type":"uint256"}],"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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60a06040523073ffffffffffffffffffffffffffffffffffffffff1660809073ffffffffffffffffffffffffffffffffffffffff1681525034801561004357600080fd5b5060805161573c6200006e60003960008181611e2701528181611e7c0152612037015261573c6000f3fe6080604052600436106101b65760003560e01c8063715018a6116100ec578063c4d66de81161008a578063db41f82a11610064578063db41f82a1461061c578063e985e9c51461065a578063f242432a14610697578063f2fde38b146106c0576101b6565b8063c4d66de8146105a1578063ce64b45f146105ca578063cf132d1c146105f3576101b6565b806397240eaa116100c657806397240eaa146104e7578063a22cb46514610524578063ad3cb1cc1461054d578063c43e4f4c14610578576101b6565b8063715018a6146104685780638da5cb5b1461047f57806396534480146104aa576101b6565b806347461b40116101595780634e543b26116101335780634e543b26146103cf5780634f1ef286146103f857806352d1902d14610414578063546186641461043f576101b6565b806347461b40146103405780634889b1cc146103695780634e1273f414610392576101b6565b80630e89341c116101955780630e89341c146102605780630fd645f11461029d5780631f47a210146102da5780632eb2c2d614610317576101b6565b8062fdd58e146101bb57806301ffc9a7146101f857806304f3bcec14610235575b600080fd5b3480156101c757600080fd5b506101e260048036038101906101dd919061374e565b6106e9565b6040516101ef919061379d565b60405180910390f35b34801561020457600080fd5b5061021f600480360381019061021a9190613810565b610752565b60405161022c9190613858565b60405180910390f35b34801561024157600080fd5b5061024a610834565b6040516102579190613882565b60405180910390f35b34801561026c57600080fd5b506102876004803603810190610282919061389d565b61086c565b604051610294919061395a565b60405180910390f35b3480156102a957600080fd5b506102c460048036038101906102bf919061374e565b610a16565b6040516102d1919061379d565b60405180910390f35b3480156102e657600080fd5b5061030160048036038101906102fc919061389d565b610a7f565b60405161030e919061379d565b60405180910390f35b34801561032357600080fd5b5061033e60048036038101906103399190613b79565b610aad565b005b34801561034c57600080fd5b5061036760048036038101906103629190613ce9565b610ae8565b005b34801561037557600080fd5b50610390600480360381019061038b9190613d45565b610bc6565b005b34801561039e57600080fd5b506103b960048036038101906103b49190613e48565b610dc0565b6040516103c69190613f7e565b60405180910390f35b3480156103db57600080fd5b506103f660048036038101906103f19190613fa0565b610ec9565b005b610412600480360381019061040d9190613fcd565b610f24565b005b34801561042057600080fd5b50610429610f43565b6040516104369190614042565b60405180910390f35b34801561044b57600080fd5b5061046660048036038101906104619190614329565b610f76565b005b34801561047457600080fd5b5061047d611080565b005b34801561048b57600080fd5b50610494611094565b6040516104a19190613882565b60405180910390f35b3480156104b657600080fd5b506104d160048036038101906104cc919061389d565b6110cc565b6040516104de919061395a565b60405180910390f35b3480156104f357600080fd5b5061050e600480360381019061050991906144b4565b611183565b60405161051b919061379d565b60405180910390f35b34801561053057600080fd5b5061054b6004803603810190610546919061453c565b61131c565b005b34801561055957600080fd5b50610562611332565b60405161056f919061395a565b60405180910390f35b34801561058457600080fd5b5061059f600480360381019061059a919061457c565b61136b565b005b3480156105ad57600080fd5b506105c860048036038101906105c39190613fa0565b6114db565b005b3480156105d657600080fd5b506105f160048036038101906105ec9190613ce9565b61168a565b005b3480156105ff57600080fd5b5061061a600480360381019061061591906145eb565b611701565b005b34801561062857600080fd5b50610643600480360381019061063e919061374e565b61196a565b60405161065192919061466e565b60405180910390f35b34801561066657600080fd5b50610681600480360381019061067c91906146a5565b611b33565b60405161068e9190613858565b60405180910390f35b3480156106a357600080fd5b506106be60048036038101906106b991906146e5565b611bd5565b005b3480156106cc57600080fd5b506106e760048036038101906106e29190613fa0565b611c10565b005b6000806106f4611c96565b905080600001600084815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491505092915050565b60007fd9b67a26000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061081d57507f0e89341c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061082d575061082c82611cbe565b5b9050919050565b60008061083f611d28565b90508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505090565b60606000610878611d28565b905060008061088685611d50565b91509150600083600101600084815260200190815260200160002060000180546108af906147ab565b80601f01602080910402602001604051908101604052809291908181526020018280546108db906147ab565b80156109285780601f106108fd57610100808354040283529160200191610928565b820191906000526020600020905b81548152906001019060200180831161090b57829003601f168201915b50505050509050600084600101600085815260200190815260200160002060010160008481526020019081526020016000206000018054610968906147ab565b80601f0160208091040260200160405190810160405280929190818152602001828054610994906147ab565b80156109e15780601f106109b6576101008083540402835291602001916109e1565b820191906000526020600020905b8154815290600101906020018083116109c457829003601f168201915b5050505050905081816040516020016109fb9291906149e0565b60405160208183030381529060405295505050505050919050565b600080610a21611d28565b90508060020160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000205491505092915050565b600080610a8a611d28565b905080600101600084815260200190815260200160002060020154915050919050565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610adf90614a92565b60405180910390fd5b610af0611d76565b6000610afa611d28565b905060008160010160008581526020019081526020016000206000018054610b21906147ab565b905003610b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5a90614afe565b60405180910390fd5b818160010160008581526020019081526020016000206000019081610b889190614cca565b50827fb810609e93b7325976c078b96d9c92d3160d0d165073b8c9a8a6a4d257fd047783604051610bb9919061395a565b60405180910390a2505050565b610bce611d76565b6000610bd8611d28565b905060008160010160008581526020019081526020016000206000018054610bff906147ab565b905003610c41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3890614afe565b60405180910390fd5b600081600101600085815260200190815260200160002060010160008481526020019081526020016000206000018054610c7a906147ab565b905003610cbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb390614de8565b60405180910390fd5b806001016000848152602001908152602001600020600201548214610d16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0d90614e54565b60405180910390fd5b806001016000848152602001908152602001600020600101600083815260200190815260200160002060008082016000610d509190613649565b60018201600090555050600182610d679190614ea3565b81600101600085815260200190815260200160002060020181905550827f65eaec986a04066dc84e3c37cb749de21d4c1d9f205397f5153707414d6a791983604051610db3919061379d565b60405180910390a2505050565b60608151835114610e0c57815183516040517f5b059991000000000000000000000000000000000000000000000000000000008152600401610e03929190614ed7565b60405180910390fd5b6000835167ffffffffffffffff811115610e2957610e28613981565b5b604051908082528060200260200182016040528015610e575781602001602082028036833780820191505090505b50905060005b8451811015610ebe57610e94610e7c8287611dfd90919063ffffffff16565b610e8f8387611e1190919063ffffffff16565b6106e9565b828281518110610ea757610ea6614f00565b5b602002602001018181525050806001019050610e5d565b508091505092915050565b610ed1611d76565b6000610edb611d28565b9050818160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b610f2c611e25565b610f3582611f0b565b610f3f8282611f16565b5050565b6000610f4d612035565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b905090565b610f7e611d76565b60005b8251811015610fdd57610fd0838281518110610fa057610f9f614f00565b5b602002602001015160000151848381518110610fbf57610fbe614f00565b5b60200260200101516020015161168a565b8080600101915050610f81565b5060005b815181101561107b5761106e82828151811061100057610fff614f00565b5b60200260200101516000015183838151811061101f5761101e614f00565b5b60200260200101516020015184848151811061103e5761103d614f00565b5b60200260200101516040015185858151811061105d5761105c614f00565b5b602002602001015160600151611701565b8080600101915050610fe1565b505050565b611088611d76565b61109260006120bc565b565b60008061109f612193565b90508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505090565b606060006110d8611d28565b905080600101600084815260200190815260200160002060000180546110fd906147ab565b80601f0160208091040260200160405190810160405280929190818152602001828054611129906147ab565b80156111765780601f1061114b57610100808354040283529160200191611176565b820191906000526020600020905b81548152906001019060200180831161115957829003601f168201915b5050505050915050919050565b60008061118e611d28565b90508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611222576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121990614fa1565b60405180910390fd5b60005b835181101561131457600084828151811061124357611242614f00565b5b6020026020010151600001519050600085838151811061126657611265614f00565b5b602002602001015160200151905060008460020160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000205411156112ec576112da8783836121bb565b856112e59190614fc1565b9450611305565b6112f7878383612471565b856113029190614fc1565b94505b50508080600101915050611225565b505092915050565b61132e6113276126a9565b83836126b1565b5050565b6040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b611373611d76565b600061137d611d28565b9050600081600101600086815260200190815260200160002060000180546113a4906147ab565b9050036113e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113dd90614afe565b60405180910390fd5b60008160010160008681526020019081526020016000206001016000858152602001908152602001600020600001805461141f906147ab565b905003611461576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145890615041565b60405180910390fd5b818160010160008681526020019081526020016000206001016000858152602001908152602001600020600001908161149a9190614cca565b50837f3e442b5d5a6ecd8c0a86017cabd5ee0efbf32debbee58f9cea68f1b8489e419384846040516114cd929190615061565b60405180910390a250505050565b60006114e5612830565b905060008160000160089054906101000a900460ff1615905060008260000160009054906101000a900467ffffffffffffffff1690506000808267ffffffffffffffff161480156115335750825b9050600060018367ffffffffffffffff16148015611568575060003073ffffffffffffffffffffffffffffffffffffffff163b145b905081158015611576575080155b156115ad576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018560000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555083156115fd5760018560000160086101000a81548160ff0219169083151502179055505b61161560405180602001604052806000815250612858565b61161e8661286c565b611626612880565b83156116825760008560000160086101000a81548160ff0219169083151502179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2600160405161167991906150e0565b60405180910390a15b505050505050565b611692611d76565b600061169c611d28565b90508181600101600085815260200190815260200160002060000190816116c39190614cca565b50827f2e5977e12fac9a91696e22ba811f2893e11ad62f8aa53e99a628b031d18a379f836040516116f4919061395a565b60405180910390a2505050565b611709611d76565b6000611713611d28565b90506000816001016000878152602001908152602001600020600001805461173a906147ab565b90500361177c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177390614afe565b60405180910390fd5b600084116117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b690615147565b60405180910390fd5b6001816001016000878152602001908152602001600020600201546117e49190614fc1565b8414611825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181c906151b3565b60405180910390fd5b60018411156118a95780600101600086815260200190815260200160002060010160006001866118559190614ea3565b81526020019081526020016000206001015482116118a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189f90615245565b60405180910390fd5b5b604051806040016040528084815260200183815250816001016000878152602001908152602001600020600101600086815260200190815260200160002060008201518160000190816118fc9190614cca565b50602082015181600101559050508381600101600087815260200190815260200160002060020181905550847f5625f15df4cbadf2e6e3f80e2406aec5d99a432335ef0e9a1fba9e48b055830385858560405161195b93929190615265565b60405180910390a25050505050565b6060806000611977611d28565b905060008160020160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002054905081600101600086815260200190815260200160002060000180546119f3906147ab565b80601f0160208091040260200160405190810160405280929190818152602001828054611a1f906147ab565b8015611a6c5780601f10611a4157610100808354040283529160200191611a6c565b820191906000526020600020905b815481529060010190602001808311611a4f57829003601f168201915b5050505050935081600101600086815260200190815260200160002060010160008281526020019081526020016000206000018054611aaa906147ab565b80601f0160208091040260200160405190810160405280929190818152602001828054611ad6906147ab565b8015611b235780601f10611af857610100808354040283529160200191611b23565b820191906000526020600020905b815481529060010190602001808311611b0657829003601f168201915b5050505050925050509250929050565b600080611b3e611c96565b90508060010160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1691505092915050565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0790614a92565b60405180910390fd5b611c18611d76565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611c8a5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401611c819190613882565b60405180910390fd5b611c93816120bc565b50565b60007f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c4500905090565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60007fb2b7b32472936fec942d11d364b3fb7baeea6584fbe4aa7e3432289df3426200905090565b600080608083901c91506fffffffffffffffffffffffffffffffff801683169050915091565b611d7e6126a9565b73ffffffffffffffffffffffffffffffffffffffff16611d9c611094565b73ffffffffffffffffffffffffffffffffffffffff1614611dfb57611dbf6126a9565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401611df29190613882565b60405180910390fd5b565b600060208202602084010151905092915050565b600060208202602084010151905092915050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161480611ed257507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611eb961288a565b73ffffffffffffffffffffffffffffffffffffffff1614155b15611f09576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b611f13611d76565b50565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611f7e57506040513d601f19601f82011682018060405250810190611f7b91906152cf565b60015b611fbf57816040517f4c9c8ce3000000000000000000000000000000000000000000000000000000008152600401611fb69190613882565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b811461202657806040517faa1d49a400000000000000000000000000000000000000000000000000000000815260040161201d9190614042565b60405180910390fd5b61203083836128e1565b505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff16146120ba576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b60006120c6612193565b905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050828260000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3505050565b60007f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300905090565b6000806121c6611d28565b9050600081600101600086815260200190815260200160002060010160008581526020019081526020016000206000018054612201906147ab565b905003612243576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223a90615348565b60405180910390fd5b60008160020160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002054905060006122a68683612954565b905060006122b48787612954565b905060006122c289836106e9565b14612302576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122f9906153b4565b60405180910390fd5b61230e88836001612979565b61232a8882600160405180602001604052806000815250612a20565b858460020160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008981526020019081526020016000208190555060006001846123909190614fc1565b90505b8681116123e757846001016000898152602001908152602001600020600101600082815260200190815260200160002060010154866123d29190614fc1565b955080806123df906153d4565b915050612393565b50868873ffffffffffffffffffffffffffffffffffffffff167fc7dbf0b78addad69fc9c14ead96d18ce8f998f40c8d2bc27369024f60b04774888888860010160008d815260200190815260200160002060010160008c815260200190815260200160002060000160405161245e939291906154a0565b60405180910390a3505050509392505050565b60008061247c611d28565b90506000816001016000868152602001908152602001600020600101600085815260200190815260200160002060000180546124b7906147ab565b9050036124f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f090615041565b60405180910390fd5b60006125058585612954565b9050600061251387836106e9565b14612553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254a906153b4565b60405180910390fd5b61256f8682600160405180602001604052806000815250612a20565b838260020160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000878152602001908152602001600020819055506000600190505b848111612621578260010160008781526020019081526020016000206001016000828152602001908152602001600020600101548461260c9190614fc1565b93508080612619906153d4565b9150506125cd565b50848673ffffffffffffffffffffffffffffffffffffffff167f8e8cf982bc9a9ef5a00739d574ba95b0a83f6d81d4a92de85a4130243847864a86868660010160008b815260200190815260200160002060010160008a8152602001908152602001600020600001604051612698939291906154a0565b60405180910390a350509392505050565b600033905090565b60006126bb611c96565b9050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361272f5760006040517fced3e1000000000000000000000000000000000000000000000000000000000081526004016127269190613882565b60405180910390fd5b818160010160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31846040516128229190613858565b60405180910390a350505050565b60007ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00905090565b612860612ab9565b61286981612af9565b50565b612874612ab9565b61287d81612b0d565b50565b612888612ab9565b565b60006128b87f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b612b93565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6128ea82612b9d565b8173ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a2600081511115612947576129418282612c6a565b50612950565b61294f612cee565b5b5050565b60006fffffffffffffffffffffffffffffffff80168216608084901b17905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036129eb5760006040517f01a835140000000000000000000000000000000000000000000000000000000081526004016129e29190613882565b60405180910390fd5b6000806129f88484612d2b565b91509150612a19856000848460405180602001604052806000815250612d5b565b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603612a925760006040517f57f447ce000000000000000000000000000000000000000000000000000000008152600401612a899190613882565b60405180910390fd5b600080612a9f8585612d2b565b91509150612ab1600087848487612d5b565b505050505050565b612ac1612e0d565b612af7576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b612b01612ab9565b612b0a81612e2d565b50565b612b15612ab9565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612b875760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401612b7e9190613882565b60405180910390fd5b612b90816120bc565b50565b6000819050919050565b60008173ffffffffffffffffffffffffffffffffffffffff163b03612bf957806040517f4c9c8ce3000000000000000000000000000000000000000000000000000000008152600401612bf09190613882565b60405180910390fd5b80612c267f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b612b93565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60606000808473ffffffffffffffffffffffffffffffffffffffff1684604051612c949190615525565b600060405180830381855af49150503d8060008114612ccf576040519150601f19603f3d011682016040523d82523d6000602084013e612cd4565b606091505b5091509150612ce4858383612e4f565b9250505092915050565b6000341115612d29576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b60608060405191506001825283602083015260408201905060018152826020820152604081016040529250929050565b612d6785858585612ede565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614612e06576000612da56126a9565b90506001845103612df5576000612dc6600086611e1190919063ffffffff16565b90506000612dde600086611e1190919063ffffffff16565b9050612dee83898985858961329c565b5050612e04565b612e03818787878787613450565b5b505b5050505050565b6000612e17612830565b60000160089054906101000a900460ff16905090565b6000612e37611c96565b905081816002019081612e4a9190614cca565b505050565b606082612e6457612e5f82613604565b612ed6565b60008251148015612e8c575060008473ffffffffffffffffffffffffffffffffffffffff163b145b15612ece57836040517f9996b315000000000000000000000000000000000000000000000000000000008152600401612ec59190613882565b60405180910390fd5b819050612ed7565b5b9392505050565b6000612ee8611c96565b90508151835114612f3457825182516040517f5b059991000000000000000000000000000000000000000000000000000000008152600401612f2b929190614ed7565b60405180910390fd5b6000612f3e6126a9565b905060005b8451811015613156576000612f618287611e1190919063ffffffff16565b90506000612f788387611e1190919063ffffffff16565b9050600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff16146130ab57600085600001600084815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561305057898183856040517f03dee4c5000000000000000000000000000000000000000000000000000000008152600401613047949392919061553c565b60405180910390fd5b81810386600001600085815260200190815260200160002060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614613149578085600001600084815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546131419190614fc1565b925050819055505b5050806001019050612f43565b506001845103613215576000613176600086611e1190919063ffffffff16565b9050600061318e600086611e1190919063ffffffff16565b90508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628585604051613206929190614ed7565b60405180910390a45050613294565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161328b929190615581565b60405180910390a45b505050505050565b60008473ffffffffffffffffffffffffffffffffffffffff163b1115613448578373ffffffffffffffffffffffffffffffffffffffff1663f23a6e6187878686866040518663ffffffff1660e01b81526004016132fd959493929190615602565b6020604051808303816000875af192505050801561333957506040513d601f19601f820116820180604052508101906133369190615671565b60015b6133bd573d8060008114613369576040519150601f19603f3d011682016040523d82523d6000602084013e61336e565b606091505b5060008151036133b557846040517f57f447ce0000000000000000000000000000000000000000000000000000000081526004016133ac9190613882565b60405180910390fd5b805181602001fd5b63f23a6e6160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461344657846040517f57f447ce00000000000000000000000000000000000000000000000000000000815260040161343d9190613882565b60405180910390fd5b505b505050505050565b60008473ffffffffffffffffffffffffffffffffffffffff163b11156135fc578373ffffffffffffffffffffffffffffffffffffffff1663bc197c8187878686866040518663ffffffff1660e01b81526004016134b195949392919061569e565b6020604051808303816000875af19250505080156134ed57506040513d601f19601f820116820180604052508101906134ea9190615671565b60015b613571573d806000811461351d576040519150601f19603f3d011682016040523d82523d6000602084013e613522565b606091505b50600081510361356957846040517f57f447ce0000000000000000000000000000000000000000000000000000000081526004016135609190613882565b60405180910390fd5b805181602001fd5b63bc197c8160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146135fa57846040517f57f447ce0000000000000000000000000000000000000000000000000000000081526004016135f19190613882565b60405180910390fd5b505b505050505050565b6000815111156136175780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b508054613655906147ab565b6000825580601f106136675750613686565b601f0160209004906000526020600020908101906136859190613689565b5b50565b5b808211156136a257600081600090555060010161368a565b5090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006136e5826136ba565b9050919050565b6136f5816136da565b811461370057600080fd5b50565b600081359050613712816136ec565b92915050565b6000819050919050565b61372b81613718565b811461373657600080fd5b50565b60008135905061374881613722565b92915050565b60008060408385031215613765576137646136b0565b5b600061377385828601613703565b925050602061378485828601613739565b9150509250929050565b61379781613718565b82525050565b60006020820190506137b2600083018461378e565b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6137ed816137b8565b81146137f857600080fd5b50565b60008135905061380a816137e4565b92915050565b600060208284031215613826576138256136b0565b5b6000613834848285016137fb565b91505092915050565b60008115159050919050565b6138528161383d565b82525050565b600060208201905061386d6000830184613849565b92915050565b61387c816136da565b82525050565b60006020820190506138976000830184613873565b92915050565b6000602082840312156138b3576138b26136b0565b5b60006138c184828501613739565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156139045780820151818401526020810190506138e9565b60008484015250505050565b6000601f19601f8301169050919050565b600061392c826138ca565b61393681856138d5565b93506139468185602086016138e6565b61394f81613910565b840191505092915050565b600060208201905081810360008301526139748184613921565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6139b982613910565b810181811067ffffffffffffffff821117156139d8576139d7613981565b5b80604052505050565b60006139eb6136a6565b90506139f782826139b0565b919050565b600067ffffffffffffffff821115613a1757613a16613981565b5b602082029050602081019050919050565b600080fd5b6000613a40613a3b846139fc565b6139e1565b90508083825260208201905060208402830185811115613a6357613a62613a28565b5b835b81811015613a8c5780613a788882613739565b845260208401935050602081019050613a65565b5050509392505050565b600082601f830112613aab57613aaa61397c565b5b8135613abb848260208601613a2d565b91505092915050565b600080fd5b600067ffffffffffffffff821115613ae457613ae3613981565b5b613aed82613910565b9050602081019050919050565b82818337600083830152505050565b6000613b1c613b1784613ac9565b6139e1565b905082815260208101848484011115613b3857613b37613ac4565b5b613b43848285613afa565b509392505050565b600082601f830112613b6057613b5f61397c565b5b8135613b70848260208601613b09565b91505092915050565b600080600080600060a08688031215613b9557613b946136b0565b5b6000613ba388828901613703565b9550506020613bb488828901613703565b945050604086013567ffffffffffffffff811115613bd557613bd46136b5565b5b613be188828901613a96565b935050606086013567ffffffffffffffff811115613c0257613c016136b5565b5b613c0e88828901613a96565b925050608086013567ffffffffffffffff811115613c2f57613c2e6136b5565b5b613c3b88828901613b4b565b9150509295509295909350565b600067ffffffffffffffff821115613c6357613c62613981565b5b613c6c82613910565b9050602081019050919050565b6000613c8c613c8784613c48565b6139e1565b905082815260208101848484011115613ca857613ca7613ac4565b5b613cb3848285613afa565b509392505050565b600082601f830112613cd057613ccf61397c565b5b8135613ce0848260208601613c79565b91505092915050565b60008060408385031215613d0057613cff6136b0565b5b6000613d0e85828601613739565b925050602083013567ffffffffffffffff811115613d2f57613d2e6136b5565b5b613d3b85828601613cbb565b9150509250929050565b60008060408385031215613d5c57613d5b6136b0565b5b6000613d6a85828601613739565b9250506020613d7b85828601613739565b9150509250929050565b600067ffffffffffffffff821115613da057613d9f613981565b5b602082029050602081019050919050565b6000613dc4613dbf84613d85565b6139e1565b90508083825260208201905060208402830185811115613de757613de6613a28565b5b835b81811015613e105780613dfc8882613703565b845260208401935050602081019050613de9565b5050509392505050565b600082601f830112613e2f57613e2e61397c565b5b8135613e3f848260208601613db1565b91505092915050565b60008060408385031215613e5f57613e5e6136b0565b5b600083013567ffffffffffffffff811115613e7d57613e7c6136b5565b5b613e8985828601613e1a565b925050602083013567ffffffffffffffff811115613eaa57613ea96136b5565b5b613eb685828601613a96565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613ef581613718565b82525050565b6000613f078383613eec565b60208301905092915050565b6000602082019050919050565b6000613f2b82613ec0565b613f358185613ecb565b9350613f4083613edc565b8060005b83811015613f71578151613f588882613efb565b9750613f6383613f13565b925050600181019050613f44565b5085935050505092915050565b60006020820190508181036000830152613f988184613f20565b905092915050565b600060208284031215613fb657613fb56136b0565b5b6000613fc484828501613703565b91505092915050565b60008060408385031215613fe457613fe36136b0565b5b6000613ff285828601613703565b925050602083013567ffffffffffffffff811115614013576140126136b5565b5b61401f85828601613b4b565b9150509250929050565b6000819050919050565b61403c81614029565b82525050565b60006020820190506140576000830184614033565b92915050565b600067ffffffffffffffff82111561407857614077613981565b5b602082029050602081019050919050565b600080fd5b600080fd5b6000604082840312156140a9576140a8614089565b5b6140b360406139e1565b905060006140c384828501613739565b600083015250602082013567ffffffffffffffff8111156140e7576140e661408e565b5b6140f384828501613cbb565b60208301525092915050565b600061411261410d8461405d565b6139e1565b9050808382526020820190506020840283018581111561413557614134613a28565b5b835b8181101561417c57803567ffffffffffffffff81111561415a5761415961397c565b5b8086016141678982614093565b85526020850194505050602081019050614137565b5050509392505050565b600082601f83011261419b5761419a61397c565b5b81356141ab8482602086016140ff565b91505092915050565b600067ffffffffffffffff8211156141cf576141ce613981565b5b602082029050602081019050919050565b6000608082840312156141f6576141f5614089565b5b61420060806139e1565b9050600061421084828501613739565b600083015250602061422484828501613739565b602083015250604082013567ffffffffffffffff8111156142485761424761408e565b5b61425484828501613cbb565b604083015250606061426884828501613739565b60608301525092915050565b6000614287614282846141b4565b6139e1565b905080838252602082019050602084028301858111156142aa576142a9613a28565b5b835b818110156142f157803567ffffffffffffffff8111156142cf576142ce61397c565b5b8086016142dc89826141e0565b855260208501945050506020810190506142ac565b5050509392505050565b600082601f8301126143105761430f61397c565b5b8135614320848260208601614274565b91505092915050565b600080604083850312156143405761433f6136b0565b5b600083013567ffffffffffffffff81111561435e5761435d6136b5565b5b61436a85828601614186565b925050602083013567ffffffffffffffff81111561438b5761438a6136b5565b5b614397858286016142fb565b9150509250929050565b600067ffffffffffffffff8211156143bc576143bb613981565b5b602082029050602081019050919050565b6000604082840312156143e3576143e2614089565b5b6143ed60406139e1565b905060006143fd84828501613739565b600083015250602061441184828501613739565b60208301525092915050565b600061443061442b846143a1565b6139e1565b9050808382526020820190506040840283018581111561445357614452613a28565b5b835b8181101561447c578061446888826143cd565b845260208401935050604081019050614455565b5050509392505050565b600082601f83011261449b5761449a61397c565b5b81356144ab84826020860161441d565b91505092915050565b600080604083850312156144cb576144ca6136b0565b5b60006144d985828601613703565b925050602083013567ffffffffffffffff8111156144fa576144f96136b5565b5b61450685828601614486565b9150509250929050565b6145198161383d565b811461452457600080fd5b50565b60008135905061453681614510565b92915050565b60008060408385031215614553576145526136b0565b5b600061456185828601613703565b925050602061457285828601614527565b9150509250929050565b600080600060608486031215614595576145946136b0565b5b60006145a386828701613739565b93505060206145b486828701613739565b925050604084013567ffffffffffffffff8111156145d5576145d46136b5565b5b6145e186828701613cbb565b9150509250925092565b60008060008060808587031215614605576146046136b0565b5b600061461387828801613739565b945050602061462487828801613739565b935050604085013567ffffffffffffffff811115614645576146446136b5565b5b61465187828801613cbb565b925050606061466287828801613739565b91505092959194509250565b600060408201905081810360008301526146888185613921565b9050818103602083015261469c8184613921565b90509392505050565b600080604083850312156146bc576146bb6136b0565b5b60006146ca85828601613703565b92505060206146db85828601613703565b9150509250929050565b600080600080600060a08688031215614701576147006136b0565b5b600061470f88828901613703565b955050602061472088828901613703565b945050604061473188828901613739565b935050606061474288828901613739565b925050608086013567ffffffffffffffff811115614763576147626136b5565b5b61476f88828901613b4b565b9150509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806147c357607f821691505b6020821081036147d6576147d561477c565b5b50919050565b600081905092915050565b7f7b00000000000000000000000000000000000000000000000000000000000000600082015250565b600061481d6001836147dc565b9150614828826147e7565b600182019050919050565b7f2267656e6572616c555249223a20220000000000000000000000000000000000600082015250565b6000614869600f836147dc565b915061487482614833565b600f82019050919050565b600061488a826138ca565b61489481856147dc565b93506148a48185602086016138e6565b80840191505092915050565b7f222c000000000000000000000000000000000000000000000000000000000000600082015250565b60006148e66002836147dc565b91506148f1826148b0565b600282019050919050565b7f2274696572555249223a20220000000000000000000000000000000000000000600082015250565b6000614932600c836147dc565b915061493d826148fc565b600c82019050919050565b7f2200000000000000000000000000000000000000000000000000000000000000600082015250565b600061497e6001836147dc565b915061498982614948565b600182019050919050565b7f7d00000000000000000000000000000000000000000000000000000000000000600082015250565b60006149ca6001836147dc565b91506149d582614994565b600182019050919050565b60006149eb82614810565b91506149f68261485c565b9150614a02828561487f565b9150614a0d826148d9565b9150614a1882614925565b9150614a24828461487f565b9150614a2f82614971565b9150614a3a826149bd565b91508190509392505050565b7f42616467654e46543a205472616e7366657273206172652064697361626c6564600082015250565b6000614a7c6020836138d5565b9150614a8782614a46565b602082019050919050565b60006020820190508181036000830152614aab81614a6f565b9050919050565b7f426164676520646f6573206e6f74206578697374000000000000000000000000600082015250565b6000614ae86014836138d5565b9150614af382614ab2565b602082019050919050565b60006020820190508181036000830152614b1781614adb565b9050919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302614b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82614b43565b614b8a8683614b43565b95508019841693508086168417925050509392505050565b6000819050919050565b6000614bc7614bc2614bbd84613718565b614ba2565b613718565b9050919050565b6000819050919050565b614be183614bac565b614bf5614bed82614bce565b848454614b50565b825550505050565b600090565b614c0a614bfd565b614c15818484614bd8565b505050565b5b81811015614c3957614c2e600082614c02565b600181019050614c1b565b5050565b601f821115614c7e57614c4f81614b1e565b614c5884614b33565b81016020851015614c67578190505b614c7b614c7385614b33565b830182614c1a565b50505b505050565b600082821c905092915050565b6000614ca160001984600802614c83565b1980831691505092915050565b6000614cba8383614c90565b9150826002028217905092915050565b614cd3826138ca565b67ffffffffffffffff811115614cec57614ceb613981565b5b614cf682546147ab565b614d01828285614c3d565b600060209050601f831160018114614d345760008415614d22578287015190505b614d2c8582614cae565b865550614d94565b601f198416614d4286614b1e565b60005b82811015614d6a57848901518255600182019150602085019450602081019050614d45565b86831015614d875784890151614d83601f891682614c90565b8355505b6001600288020188555050505b505050505050565b7f5469657220646f6573206e6f7420657869737400000000000000000000000000600082015250565b6000614dd26013836138d5565b9150614ddd82614d9c565b602082019050919050565b60006020820190508181036000830152614e0181614dc5565b9050919050565b7f43616e206f6e6c792072656d6f76652068696768657374207469657200000000600082015250565b6000614e3e601c836138d5565b9150614e4982614e08565b602082019050919050565b60006020820190508181036000830152614e6d81614e31565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614eae82613718565b9150614eb983613718565b9250828203905081811115614ed157614ed0614e74565b5b92915050565b6000604082019050614eec600083018561378e565b614ef9602083018461378e565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4f6e6c79207265736f6c7665722063616e2063616c6c20746869732066756e6360008201527f74696f6e00000000000000000000000000000000000000000000000000000000602082015250565b6000614f8b6024836138d5565b9150614f9682614f2f565b604082019050919050565b60006020820190508181036000830152614fba81614f7e565b9050919050565b6000614fcc82613718565b9150614fd783613718565b9250828201905080821115614fef57614fee614e74565b5b92915050565b7f55524920666f7220696e697469616c2074696572206e6f742073657400000000600082015250565b600061502b601c836138d5565b915061503682614ff5565b602082019050919050565b6000602082019050818103600083015261505a8161501e565b9050919050565b6000604082019050615076600083018561378e565b81810360208301526150888184613921565b90509392505050565b6000819050919050565b600067ffffffffffffffff82169050919050565b60006150ca6150c56150c084615091565b614ba2565b61509b565b9050919050565b6150da816150af565b82525050565b60006020820190506150f560008301846150d1565b92915050565b7f54696572206d7573742062652067726561746572207468616e20300000000000600082015250565b6000615131601b836138d5565b915061513c826150fb565b602082019050919050565b6000602082019050818103600083015261516081615124565b9050919050565b7f5469657273206d7573742062652061646465642073657175656e7469616c6c79600082015250565b600061519d6020836138d5565b91506151a882615167565b602082019050919050565b600060208201905081810360008301526151cc81615190565b9050919050565b7f506f696e7473206d7573742062652067726561746572207468616e207468652060008201527f70726576696f7573207469657200000000000000000000000000000000000000602082015250565b600061522f602d836138d5565b915061523a826151d3565b604082019050919050565b6000602082019050818103600083015261525e81615222565b9050919050565b600060608201905061527a600083018661378e565b818103602083015261528c8185613921565b905061529b604083018461378e565b949350505050565b6152ac81614029565b81146152b757600080fd5b50565b6000815190506152c9816152a3565b92915050565b6000602082840312156152e5576152e46136b0565b5b60006152f3848285016152ba565b91505092915050565b7f55524920666f72206e65772074696572206e6f74207365740000000000000000600082015250565b60006153326018836138d5565b915061533d826152fc565b602082019050919050565b6000602082019050818103600083015261536181615325565b9050919050565b7f426164676520616c7265616479206d696e746564000000000000000000000000600082015250565b600061539e6014836138d5565b91506153a982615368565b602082019050919050565b600060208201905081810360008301526153cd81615391565b9050919050565b60006153df82613718565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361541157615410614e74565b5b600182019050919050565b60008154615429816147ab565b61543381866138d5565b9450600182166000811461544e576001811461546457615497565b60ff198316865281151560200286019350615497565b61546d85614b1e565b60005b8381101561548f57815481890152600182019150602081019050615470565b808801955050505b50505092915050565b60006060820190506154b5600083018661378e565b6154c2602083018561378e565b81810360408301526154d4818461541c565b9050949350505050565b600081519050919050565b600081905092915050565b60006154ff826154de565b61550981856154e9565b93506155198185602086016138e6565b80840191505092915050565b600061553182846154f4565b915081905092915050565b60006080820190506155516000830187613873565b61555e602083018661378e565b61556b604083018561378e565b615578606083018461378e565b95945050505050565b6000604082019050818103600083015261559b8185613f20565b905081810360208301526155af8184613f20565b90509392505050565b600082825260208201905092915050565b60006155d4826154de565b6155de81856155b8565b93506155ee8185602086016138e6565b6155f781613910565b840191505092915050565b600060a0820190506156176000830188613873565b6156246020830187613873565b615631604083018661378e565b61563e606083018561378e565b818103608083015261565081846155c9565b90509695505050505050565b60008151905061566b816137e4565b92915050565b600060208284031215615687576156866136b0565b5b60006156958482850161565c565b91505092915050565b600060a0820190506156b36000830188613873565b6156c06020830187613873565b81810360408301526156d28186613f20565b905081810360608301526156e68185613f20565b905081810360808301526156fa81846155c9565b9050969550505050505056fea2646970667358221220f2405189bf8b01cc7e912b091853f6dc43b0b7ae6b7d0ce3b13b974634d67f6b64736f6c63430008170033
Deployed Bytecode
0x6080604052600436106101b65760003560e01c8063715018a6116100ec578063c4d66de81161008a578063db41f82a11610064578063db41f82a1461061c578063e985e9c51461065a578063f242432a14610697578063f2fde38b146106c0576101b6565b8063c4d66de8146105a1578063ce64b45f146105ca578063cf132d1c146105f3576101b6565b806397240eaa116100c657806397240eaa146104e7578063a22cb46514610524578063ad3cb1cc1461054d578063c43e4f4c14610578576101b6565b8063715018a6146104685780638da5cb5b1461047f57806396534480146104aa576101b6565b806347461b40116101595780634e543b26116101335780634e543b26146103cf5780634f1ef286146103f857806352d1902d14610414578063546186641461043f576101b6565b806347461b40146103405780634889b1cc146103695780634e1273f414610392576101b6565b80630e89341c116101955780630e89341c146102605780630fd645f11461029d5780631f47a210146102da5780632eb2c2d614610317576101b6565b8062fdd58e146101bb57806301ffc9a7146101f857806304f3bcec14610235575b600080fd5b3480156101c757600080fd5b506101e260048036038101906101dd919061374e565b6106e9565b6040516101ef919061379d565b60405180910390f35b34801561020457600080fd5b5061021f600480360381019061021a9190613810565b610752565b60405161022c9190613858565b60405180910390f35b34801561024157600080fd5b5061024a610834565b6040516102579190613882565b60405180910390f35b34801561026c57600080fd5b506102876004803603810190610282919061389d565b61086c565b604051610294919061395a565b60405180910390f35b3480156102a957600080fd5b506102c460048036038101906102bf919061374e565b610a16565b6040516102d1919061379d565b60405180910390f35b3480156102e657600080fd5b5061030160048036038101906102fc919061389d565b610a7f565b60405161030e919061379d565b60405180910390f35b34801561032357600080fd5b5061033e60048036038101906103399190613b79565b610aad565b005b34801561034c57600080fd5b5061036760048036038101906103629190613ce9565b610ae8565b005b34801561037557600080fd5b50610390600480360381019061038b9190613d45565b610bc6565b005b34801561039e57600080fd5b506103b960048036038101906103b49190613e48565b610dc0565b6040516103c69190613f7e565b60405180910390f35b3480156103db57600080fd5b506103f660048036038101906103f19190613fa0565b610ec9565b005b610412600480360381019061040d9190613fcd565b610f24565b005b34801561042057600080fd5b50610429610f43565b6040516104369190614042565b60405180910390f35b34801561044b57600080fd5b5061046660048036038101906104619190614329565b610f76565b005b34801561047457600080fd5b5061047d611080565b005b34801561048b57600080fd5b50610494611094565b6040516104a19190613882565b60405180910390f35b3480156104b657600080fd5b506104d160048036038101906104cc919061389d565b6110cc565b6040516104de919061395a565b60405180910390f35b3480156104f357600080fd5b5061050e600480360381019061050991906144b4565b611183565b60405161051b919061379d565b60405180910390f35b34801561053057600080fd5b5061054b6004803603810190610546919061453c565b61131c565b005b34801561055957600080fd5b50610562611332565b60405161056f919061395a565b60405180910390f35b34801561058457600080fd5b5061059f600480360381019061059a919061457c565b61136b565b005b3480156105ad57600080fd5b506105c860048036038101906105c39190613fa0565b6114db565b005b3480156105d657600080fd5b506105f160048036038101906105ec9190613ce9565b61168a565b005b3480156105ff57600080fd5b5061061a600480360381019061061591906145eb565b611701565b005b34801561062857600080fd5b50610643600480360381019061063e919061374e565b61196a565b60405161065192919061466e565b60405180910390f35b34801561066657600080fd5b50610681600480360381019061067c91906146a5565b611b33565b60405161068e9190613858565b60405180910390f35b3480156106a357600080fd5b506106be60048036038101906106b991906146e5565b611bd5565b005b3480156106cc57600080fd5b506106e760048036038101906106e29190613fa0565b611c10565b005b6000806106f4611c96565b905080600001600084815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491505092915050565b60007fd9b67a26000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061081d57507f0e89341c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061082d575061082c82611cbe565b5b9050919050565b60008061083f611d28565b90508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505090565b60606000610878611d28565b905060008061088685611d50565b91509150600083600101600084815260200190815260200160002060000180546108af906147ab565b80601f01602080910402602001604051908101604052809291908181526020018280546108db906147ab565b80156109285780601f106108fd57610100808354040283529160200191610928565b820191906000526020600020905b81548152906001019060200180831161090b57829003601f168201915b50505050509050600084600101600085815260200190815260200160002060010160008481526020019081526020016000206000018054610968906147ab565b80601f0160208091040260200160405190810160405280929190818152602001828054610994906147ab565b80156109e15780601f106109b6576101008083540402835291602001916109e1565b820191906000526020600020905b8154815290600101906020018083116109c457829003601f168201915b5050505050905081816040516020016109fb9291906149e0565b60405160208183030381529060405295505050505050919050565b600080610a21611d28565b90508060020160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000205491505092915050565b600080610a8a611d28565b905080600101600084815260200190815260200160002060020154915050919050565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610adf90614a92565b60405180910390fd5b610af0611d76565b6000610afa611d28565b905060008160010160008581526020019081526020016000206000018054610b21906147ab565b905003610b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5a90614afe565b60405180910390fd5b818160010160008581526020019081526020016000206000019081610b889190614cca565b50827fb810609e93b7325976c078b96d9c92d3160d0d165073b8c9a8a6a4d257fd047783604051610bb9919061395a565b60405180910390a2505050565b610bce611d76565b6000610bd8611d28565b905060008160010160008581526020019081526020016000206000018054610bff906147ab565b905003610c41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3890614afe565b60405180910390fd5b600081600101600085815260200190815260200160002060010160008481526020019081526020016000206000018054610c7a906147ab565b905003610cbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb390614de8565b60405180910390fd5b806001016000848152602001908152602001600020600201548214610d16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0d90614e54565b60405180910390fd5b806001016000848152602001908152602001600020600101600083815260200190815260200160002060008082016000610d509190613649565b60018201600090555050600182610d679190614ea3565b81600101600085815260200190815260200160002060020181905550827f65eaec986a04066dc84e3c37cb749de21d4c1d9f205397f5153707414d6a791983604051610db3919061379d565b60405180910390a2505050565b60608151835114610e0c57815183516040517f5b059991000000000000000000000000000000000000000000000000000000008152600401610e03929190614ed7565b60405180910390fd5b6000835167ffffffffffffffff811115610e2957610e28613981565b5b604051908082528060200260200182016040528015610e575781602001602082028036833780820191505090505b50905060005b8451811015610ebe57610e94610e7c8287611dfd90919063ffffffff16565b610e8f8387611e1190919063ffffffff16565b6106e9565b828281518110610ea757610ea6614f00565b5b602002602001018181525050806001019050610e5d565b508091505092915050565b610ed1611d76565b6000610edb611d28565b9050818160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b610f2c611e25565b610f3582611f0b565b610f3f8282611f16565b5050565b6000610f4d612035565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b905090565b610f7e611d76565b60005b8251811015610fdd57610fd0838281518110610fa057610f9f614f00565b5b602002602001015160000151848381518110610fbf57610fbe614f00565b5b60200260200101516020015161168a565b8080600101915050610f81565b5060005b815181101561107b5761106e82828151811061100057610fff614f00565b5b60200260200101516000015183838151811061101f5761101e614f00565b5b60200260200101516020015184848151811061103e5761103d614f00565b5b60200260200101516040015185858151811061105d5761105c614f00565b5b602002602001015160600151611701565b8080600101915050610fe1565b505050565b611088611d76565b61109260006120bc565b565b60008061109f612193565b90508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505090565b606060006110d8611d28565b905080600101600084815260200190815260200160002060000180546110fd906147ab565b80601f0160208091040260200160405190810160405280929190818152602001828054611129906147ab565b80156111765780601f1061114b57610100808354040283529160200191611176565b820191906000526020600020905b81548152906001019060200180831161115957829003601f168201915b5050505050915050919050565b60008061118e611d28565b90508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611222576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121990614fa1565b60405180910390fd5b60005b835181101561131457600084828151811061124357611242614f00565b5b6020026020010151600001519050600085838151811061126657611265614f00565b5b602002602001015160200151905060008460020160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000205411156112ec576112da8783836121bb565b856112e59190614fc1565b9450611305565b6112f7878383612471565b856113029190614fc1565b94505b50508080600101915050611225565b505092915050565b61132e6113276126a9565b83836126b1565b5050565b6040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b611373611d76565b600061137d611d28565b9050600081600101600086815260200190815260200160002060000180546113a4906147ab565b9050036113e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113dd90614afe565b60405180910390fd5b60008160010160008681526020019081526020016000206001016000858152602001908152602001600020600001805461141f906147ab565b905003611461576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145890615041565b60405180910390fd5b818160010160008681526020019081526020016000206001016000858152602001908152602001600020600001908161149a9190614cca565b50837f3e442b5d5a6ecd8c0a86017cabd5ee0efbf32debbee58f9cea68f1b8489e419384846040516114cd929190615061565b60405180910390a250505050565b60006114e5612830565b905060008160000160089054906101000a900460ff1615905060008260000160009054906101000a900467ffffffffffffffff1690506000808267ffffffffffffffff161480156115335750825b9050600060018367ffffffffffffffff16148015611568575060003073ffffffffffffffffffffffffffffffffffffffff163b145b905081158015611576575080155b156115ad576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018560000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555083156115fd5760018560000160086101000a81548160ff0219169083151502179055505b61161560405180602001604052806000815250612858565b61161e8661286c565b611626612880565b83156116825760008560000160086101000a81548160ff0219169083151502179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2600160405161167991906150e0565b60405180910390a15b505050505050565b611692611d76565b600061169c611d28565b90508181600101600085815260200190815260200160002060000190816116c39190614cca565b50827f2e5977e12fac9a91696e22ba811f2893e11ad62f8aa53e99a628b031d18a379f836040516116f4919061395a565b60405180910390a2505050565b611709611d76565b6000611713611d28565b90506000816001016000878152602001908152602001600020600001805461173a906147ab565b90500361177c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177390614afe565b60405180910390fd5b600084116117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b690615147565b60405180910390fd5b6001816001016000878152602001908152602001600020600201546117e49190614fc1565b8414611825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181c906151b3565b60405180910390fd5b60018411156118a95780600101600086815260200190815260200160002060010160006001866118559190614ea3565b81526020019081526020016000206001015482116118a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189f90615245565b60405180910390fd5b5b604051806040016040528084815260200183815250816001016000878152602001908152602001600020600101600086815260200190815260200160002060008201518160000190816118fc9190614cca565b50602082015181600101559050508381600101600087815260200190815260200160002060020181905550847f5625f15df4cbadf2e6e3f80e2406aec5d99a432335ef0e9a1fba9e48b055830385858560405161195b93929190615265565b60405180910390a25050505050565b6060806000611977611d28565b905060008160020160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002054905081600101600086815260200190815260200160002060000180546119f3906147ab565b80601f0160208091040260200160405190810160405280929190818152602001828054611a1f906147ab565b8015611a6c5780601f10611a4157610100808354040283529160200191611a6c565b820191906000526020600020905b815481529060010190602001808311611a4f57829003601f168201915b5050505050935081600101600086815260200190815260200160002060010160008281526020019081526020016000206000018054611aaa906147ab565b80601f0160208091040260200160405190810160405280929190818152602001828054611ad6906147ab565b8015611b235780601f10611af857610100808354040283529160200191611b23565b820191906000526020600020905b815481529060010190602001808311611b0657829003601f168201915b5050505050925050509250929050565b600080611b3e611c96565b90508060010160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1691505092915050565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0790614a92565b60405180910390fd5b611c18611d76565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611c8a5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401611c819190613882565b60405180910390fd5b611c93816120bc565b50565b60007f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c4500905090565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60007fb2b7b32472936fec942d11d364b3fb7baeea6584fbe4aa7e3432289df3426200905090565b600080608083901c91506fffffffffffffffffffffffffffffffff801683169050915091565b611d7e6126a9565b73ffffffffffffffffffffffffffffffffffffffff16611d9c611094565b73ffffffffffffffffffffffffffffffffffffffff1614611dfb57611dbf6126a9565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401611df29190613882565b60405180910390fd5b565b600060208202602084010151905092915050565b600060208202602084010151905092915050565b7f0000000000000000000000003d63da1e9b936304a3c442275e9c688b40c1549c73ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161480611ed257507f0000000000000000000000003d63da1e9b936304a3c442275e9c688b40c1549c73ffffffffffffffffffffffffffffffffffffffff16611eb961288a565b73ffffffffffffffffffffffffffffffffffffffff1614155b15611f09576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b611f13611d76565b50565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611f7e57506040513d601f19601f82011682018060405250810190611f7b91906152cf565b60015b611fbf57816040517f4c9c8ce3000000000000000000000000000000000000000000000000000000008152600401611fb69190613882565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b811461202657806040517faa1d49a400000000000000000000000000000000000000000000000000000000815260040161201d9190614042565b60405180910390fd5b61203083836128e1565b505050565b7f0000000000000000000000003d63da1e9b936304a3c442275e9c688b40c1549c73ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff16146120ba576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b60006120c6612193565b905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050828260000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3505050565b60007f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300905090565b6000806121c6611d28565b9050600081600101600086815260200190815260200160002060010160008581526020019081526020016000206000018054612201906147ab565b905003612243576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223a90615348565b60405180910390fd5b60008160020160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002054905060006122a68683612954565b905060006122b48787612954565b905060006122c289836106e9565b14612302576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122f9906153b4565b60405180910390fd5b61230e88836001612979565b61232a8882600160405180602001604052806000815250612a20565b858460020160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008981526020019081526020016000208190555060006001846123909190614fc1565b90505b8681116123e757846001016000898152602001908152602001600020600101600082815260200190815260200160002060010154866123d29190614fc1565b955080806123df906153d4565b915050612393565b50868873ffffffffffffffffffffffffffffffffffffffff167fc7dbf0b78addad69fc9c14ead96d18ce8f998f40c8d2bc27369024f60b04774888888860010160008d815260200190815260200160002060010160008c815260200190815260200160002060000160405161245e939291906154a0565b60405180910390a3505050509392505050565b60008061247c611d28565b90506000816001016000868152602001908152602001600020600101600085815260200190815260200160002060000180546124b7906147ab565b9050036124f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f090615041565b60405180910390fd5b60006125058585612954565b9050600061251387836106e9565b14612553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254a906153b4565b60405180910390fd5b61256f8682600160405180602001604052806000815250612a20565b838260020160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000878152602001908152602001600020819055506000600190505b848111612621578260010160008781526020019081526020016000206001016000828152602001908152602001600020600101548461260c9190614fc1565b93508080612619906153d4565b9150506125cd565b50848673ffffffffffffffffffffffffffffffffffffffff167f8e8cf982bc9a9ef5a00739d574ba95b0a83f6d81d4a92de85a4130243847864a86868660010160008b815260200190815260200160002060010160008a8152602001908152602001600020600001604051612698939291906154a0565b60405180910390a350509392505050565b600033905090565b60006126bb611c96565b9050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361272f5760006040517fced3e1000000000000000000000000000000000000000000000000000000000081526004016127269190613882565b60405180910390fd5b818160010160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31846040516128229190613858565b60405180910390a350505050565b60007ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00905090565b612860612ab9565b61286981612af9565b50565b612874612ab9565b61287d81612b0d565b50565b612888612ab9565b565b60006128b87f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b612b93565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6128ea82612b9d565b8173ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a2600081511115612947576129418282612c6a565b50612950565b61294f612cee565b5b5050565b60006fffffffffffffffffffffffffffffffff80168216608084901b17905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036129eb5760006040517f01a835140000000000000000000000000000000000000000000000000000000081526004016129e29190613882565b60405180910390fd5b6000806129f88484612d2b565b91509150612a19856000848460405180602001604052806000815250612d5b565b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603612a925760006040517f57f447ce000000000000000000000000000000000000000000000000000000008152600401612a899190613882565b60405180910390fd5b600080612a9f8585612d2b565b91509150612ab1600087848487612d5b565b505050505050565b612ac1612e0d565b612af7576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b612b01612ab9565b612b0a81612e2d565b50565b612b15612ab9565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612b875760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401612b7e9190613882565b60405180910390fd5b612b90816120bc565b50565b6000819050919050565b60008173ffffffffffffffffffffffffffffffffffffffff163b03612bf957806040517f4c9c8ce3000000000000000000000000000000000000000000000000000000008152600401612bf09190613882565b60405180910390fd5b80612c267f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b612b93565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60606000808473ffffffffffffffffffffffffffffffffffffffff1684604051612c949190615525565b600060405180830381855af49150503d8060008114612ccf576040519150601f19603f3d011682016040523d82523d6000602084013e612cd4565b606091505b5091509150612ce4858383612e4f565b9250505092915050565b6000341115612d29576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b60608060405191506001825283602083015260408201905060018152826020820152604081016040529250929050565b612d6785858585612ede565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614612e06576000612da56126a9565b90506001845103612df5576000612dc6600086611e1190919063ffffffff16565b90506000612dde600086611e1190919063ffffffff16565b9050612dee83898985858961329c565b5050612e04565b612e03818787878787613450565b5b505b5050505050565b6000612e17612830565b60000160089054906101000a900460ff16905090565b6000612e37611c96565b905081816002019081612e4a9190614cca565b505050565b606082612e6457612e5f82613604565b612ed6565b60008251148015612e8c575060008473ffffffffffffffffffffffffffffffffffffffff163b145b15612ece57836040517f9996b315000000000000000000000000000000000000000000000000000000008152600401612ec59190613882565b60405180910390fd5b819050612ed7565b5b9392505050565b6000612ee8611c96565b90508151835114612f3457825182516040517f5b059991000000000000000000000000000000000000000000000000000000008152600401612f2b929190614ed7565b60405180910390fd5b6000612f3e6126a9565b905060005b8451811015613156576000612f618287611e1190919063ffffffff16565b90506000612f788387611e1190919063ffffffff16565b9050600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff16146130ab57600085600001600084815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561305057898183856040517f03dee4c5000000000000000000000000000000000000000000000000000000008152600401613047949392919061553c565b60405180910390fd5b81810386600001600085815260200190815260200160002060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614613149578085600001600084815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546131419190614fc1565b925050819055505b5050806001019050612f43565b506001845103613215576000613176600086611e1190919063ffffffff16565b9050600061318e600086611e1190919063ffffffff16565b90508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628585604051613206929190614ed7565b60405180910390a45050613294565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161328b929190615581565b60405180910390a45b505050505050565b60008473ffffffffffffffffffffffffffffffffffffffff163b1115613448578373ffffffffffffffffffffffffffffffffffffffff1663f23a6e6187878686866040518663ffffffff1660e01b81526004016132fd959493929190615602565b6020604051808303816000875af192505050801561333957506040513d601f19601f820116820180604052508101906133369190615671565b60015b6133bd573d8060008114613369576040519150601f19603f3d011682016040523d82523d6000602084013e61336e565b606091505b5060008151036133b557846040517f57f447ce0000000000000000000000000000000000000000000000000000000081526004016133ac9190613882565b60405180910390fd5b805181602001fd5b63f23a6e6160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461344657846040517f57f447ce00000000000000000000000000000000000000000000000000000000815260040161343d9190613882565b60405180910390fd5b505b505050505050565b60008473ffffffffffffffffffffffffffffffffffffffff163b11156135fc578373ffffffffffffffffffffffffffffffffffffffff1663bc197c8187878686866040518663ffffffff1660e01b81526004016134b195949392919061569e565b6020604051808303816000875af19250505080156134ed57506040513d601f19601f820116820180604052508101906134ea9190615671565b60015b613571573d806000811461351d576040519150601f19603f3d011682016040523d82523d6000602084013e613522565b606091505b50600081510361356957846040517f57f447ce0000000000000000000000000000000000000000000000000000000081526004016135609190613882565b60405180910390fd5b805181602001fd5b63bc197c8160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146135fa57846040517f57f447ce0000000000000000000000000000000000000000000000000000000081526004016135f19190613882565b60405180910390fd5b505b505050505050565b6000815111156136175780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b508054613655906147ab565b6000825580601f106136675750613686565b601f0160209004906000526020600020908101906136859190613689565b5b50565b5b808211156136a257600081600090555060010161368a565b5090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006136e5826136ba565b9050919050565b6136f5816136da565b811461370057600080fd5b50565b600081359050613712816136ec565b92915050565b6000819050919050565b61372b81613718565b811461373657600080fd5b50565b60008135905061374881613722565b92915050565b60008060408385031215613765576137646136b0565b5b600061377385828601613703565b925050602061378485828601613739565b9150509250929050565b61379781613718565b82525050565b60006020820190506137b2600083018461378e565b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6137ed816137b8565b81146137f857600080fd5b50565b60008135905061380a816137e4565b92915050565b600060208284031215613826576138256136b0565b5b6000613834848285016137fb565b91505092915050565b60008115159050919050565b6138528161383d565b82525050565b600060208201905061386d6000830184613849565b92915050565b61387c816136da565b82525050565b60006020820190506138976000830184613873565b92915050565b6000602082840312156138b3576138b26136b0565b5b60006138c184828501613739565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156139045780820151818401526020810190506138e9565b60008484015250505050565b6000601f19601f8301169050919050565b600061392c826138ca565b61393681856138d5565b93506139468185602086016138e6565b61394f81613910565b840191505092915050565b600060208201905081810360008301526139748184613921565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6139b982613910565b810181811067ffffffffffffffff821117156139d8576139d7613981565b5b80604052505050565b60006139eb6136a6565b90506139f782826139b0565b919050565b600067ffffffffffffffff821115613a1757613a16613981565b5b602082029050602081019050919050565b600080fd5b6000613a40613a3b846139fc565b6139e1565b90508083825260208201905060208402830185811115613a6357613a62613a28565b5b835b81811015613a8c5780613a788882613739565b845260208401935050602081019050613a65565b5050509392505050565b600082601f830112613aab57613aaa61397c565b5b8135613abb848260208601613a2d565b91505092915050565b600080fd5b600067ffffffffffffffff821115613ae457613ae3613981565b5b613aed82613910565b9050602081019050919050565b82818337600083830152505050565b6000613b1c613b1784613ac9565b6139e1565b905082815260208101848484011115613b3857613b37613ac4565b5b613b43848285613afa565b509392505050565b600082601f830112613b6057613b5f61397c565b5b8135613b70848260208601613b09565b91505092915050565b600080600080600060a08688031215613b9557613b946136b0565b5b6000613ba388828901613703565b9550506020613bb488828901613703565b945050604086013567ffffffffffffffff811115613bd557613bd46136b5565b5b613be188828901613a96565b935050606086013567ffffffffffffffff811115613c0257613c016136b5565b5b613c0e88828901613a96565b925050608086013567ffffffffffffffff811115613c2f57613c2e6136b5565b5b613c3b88828901613b4b565b9150509295509295909350565b600067ffffffffffffffff821115613c6357613c62613981565b5b613c6c82613910565b9050602081019050919050565b6000613c8c613c8784613c48565b6139e1565b905082815260208101848484011115613ca857613ca7613ac4565b5b613cb3848285613afa565b509392505050565b600082601f830112613cd057613ccf61397c565b5b8135613ce0848260208601613c79565b91505092915050565b60008060408385031215613d0057613cff6136b0565b5b6000613d0e85828601613739565b925050602083013567ffffffffffffffff811115613d2f57613d2e6136b5565b5b613d3b85828601613cbb565b9150509250929050565b60008060408385031215613d5c57613d5b6136b0565b5b6000613d6a85828601613739565b9250506020613d7b85828601613739565b9150509250929050565b600067ffffffffffffffff821115613da057613d9f613981565b5b602082029050602081019050919050565b6000613dc4613dbf84613d85565b6139e1565b90508083825260208201905060208402830185811115613de757613de6613a28565b5b835b81811015613e105780613dfc8882613703565b845260208401935050602081019050613de9565b5050509392505050565b600082601f830112613e2f57613e2e61397c565b5b8135613e3f848260208601613db1565b91505092915050565b60008060408385031215613e5f57613e5e6136b0565b5b600083013567ffffffffffffffff811115613e7d57613e7c6136b5565b5b613e8985828601613e1a565b925050602083013567ffffffffffffffff811115613eaa57613ea96136b5565b5b613eb685828601613a96565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613ef581613718565b82525050565b6000613f078383613eec565b60208301905092915050565b6000602082019050919050565b6000613f2b82613ec0565b613f358185613ecb565b9350613f4083613edc565b8060005b83811015613f71578151613f588882613efb565b9750613f6383613f13565b925050600181019050613f44565b5085935050505092915050565b60006020820190508181036000830152613f988184613f20565b905092915050565b600060208284031215613fb657613fb56136b0565b5b6000613fc484828501613703565b91505092915050565b60008060408385031215613fe457613fe36136b0565b5b6000613ff285828601613703565b925050602083013567ffffffffffffffff811115614013576140126136b5565b5b61401f85828601613b4b565b9150509250929050565b6000819050919050565b61403c81614029565b82525050565b60006020820190506140576000830184614033565b92915050565b600067ffffffffffffffff82111561407857614077613981565b5b602082029050602081019050919050565b600080fd5b600080fd5b6000604082840312156140a9576140a8614089565b5b6140b360406139e1565b905060006140c384828501613739565b600083015250602082013567ffffffffffffffff8111156140e7576140e661408e565b5b6140f384828501613cbb565b60208301525092915050565b600061411261410d8461405d565b6139e1565b9050808382526020820190506020840283018581111561413557614134613a28565b5b835b8181101561417c57803567ffffffffffffffff81111561415a5761415961397c565b5b8086016141678982614093565b85526020850194505050602081019050614137565b5050509392505050565b600082601f83011261419b5761419a61397c565b5b81356141ab8482602086016140ff565b91505092915050565b600067ffffffffffffffff8211156141cf576141ce613981565b5b602082029050602081019050919050565b6000608082840312156141f6576141f5614089565b5b61420060806139e1565b9050600061421084828501613739565b600083015250602061422484828501613739565b602083015250604082013567ffffffffffffffff8111156142485761424761408e565b5b61425484828501613cbb565b604083015250606061426884828501613739565b60608301525092915050565b6000614287614282846141b4565b6139e1565b905080838252602082019050602084028301858111156142aa576142a9613a28565b5b835b818110156142f157803567ffffffffffffffff8111156142cf576142ce61397c565b5b8086016142dc89826141e0565b855260208501945050506020810190506142ac565b5050509392505050565b600082601f8301126143105761430f61397c565b5b8135614320848260208601614274565b91505092915050565b600080604083850312156143405761433f6136b0565b5b600083013567ffffffffffffffff81111561435e5761435d6136b5565b5b61436a85828601614186565b925050602083013567ffffffffffffffff81111561438b5761438a6136b5565b5b614397858286016142fb565b9150509250929050565b600067ffffffffffffffff8211156143bc576143bb613981565b5b602082029050602081019050919050565b6000604082840312156143e3576143e2614089565b5b6143ed60406139e1565b905060006143fd84828501613739565b600083015250602061441184828501613739565b60208301525092915050565b600061443061442b846143a1565b6139e1565b9050808382526020820190506040840283018581111561445357614452613a28565b5b835b8181101561447c578061446888826143cd565b845260208401935050604081019050614455565b5050509392505050565b600082601f83011261449b5761449a61397c565b5b81356144ab84826020860161441d565b91505092915050565b600080604083850312156144cb576144ca6136b0565b5b60006144d985828601613703565b925050602083013567ffffffffffffffff8111156144fa576144f96136b5565b5b61450685828601614486565b9150509250929050565b6145198161383d565b811461452457600080fd5b50565b60008135905061453681614510565b92915050565b60008060408385031215614553576145526136b0565b5b600061456185828601613703565b925050602061457285828601614527565b9150509250929050565b600080600060608486031215614595576145946136b0565b5b60006145a386828701613739565b93505060206145b486828701613739565b925050604084013567ffffffffffffffff8111156145d5576145d46136b5565b5b6145e186828701613cbb565b9150509250925092565b60008060008060808587031215614605576146046136b0565b5b600061461387828801613739565b945050602061462487828801613739565b935050604085013567ffffffffffffffff811115614645576146446136b5565b5b61465187828801613cbb565b925050606061466287828801613739565b91505092959194509250565b600060408201905081810360008301526146888185613921565b9050818103602083015261469c8184613921565b90509392505050565b600080604083850312156146bc576146bb6136b0565b5b60006146ca85828601613703565b92505060206146db85828601613703565b9150509250929050565b600080600080600060a08688031215614701576147006136b0565b5b600061470f88828901613703565b955050602061472088828901613703565b945050604061473188828901613739565b935050606061474288828901613739565b925050608086013567ffffffffffffffff811115614763576147626136b5565b5b61476f88828901613b4b565b9150509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806147c357607f821691505b6020821081036147d6576147d561477c565b5b50919050565b600081905092915050565b7f7b00000000000000000000000000000000000000000000000000000000000000600082015250565b600061481d6001836147dc565b9150614828826147e7565b600182019050919050565b7f2267656e6572616c555249223a20220000000000000000000000000000000000600082015250565b6000614869600f836147dc565b915061487482614833565b600f82019050919050565b600061488a826138ca565b61489481856147dc565b93506148a48185602086016138e6565b80840191505092915050565b7f222c000000000000000000000000000000000000000000000000000000000000600082015250565b60006148e66002836147dc565b91506148f1826148b0565b600282019050919050565b7f2274696572555249223a20220000000000000000000000000000000000000000600082015250565b6000614932600c836147dc565b915061493d826148fc565b600c82019050919050565b7f2200000000000000000000000000000000000000000000000000000000000000600082015250565b600061497e6001836147dc565b915061498982614948565b600182019050919050565b7f7d00000000000000000000000000000000000000000000000000000000000000600082015250565b60006149ca6001836147dc565b91506149d582614994565b600182019050919050565b60006149eb82614810565b91506149f68261485c565b9150614a02828561487f565b9150614a0d826148d9565b9150614a1882614925565b9150614a24828461487f565b9150614a2f82614971565b9150614a3a826149bd565b91508190509392505050565b7f42616467654e46543a205472616e7366657273206172652064697361626c6564600082015250565b6000614a7c6020836138d5565b9150614a8782614a46565b602082019050919050565b60006020820190508181036000830152614aab81614a6f565b9050919050565b7f426164676520646f6573206e6f74206578697374000000000000000000000000600082015250565b6000614ae86014836138d5565b9150614af382614ab2565b602082019050919050565b60006020820190508181036000830152614b1781614adb565b9050919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302614b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82614b43565b614b8a8683614b43565b95508019841693508086168417925050509392505050565b6000819050919050565b6000614bc7614bc2614bbd84613718565b614ba2565b613718565b9050919050565b6000819050919050565b614be183614bac565b614bf5614bed82614bce565b848454614b50565b825550505050565b600090565b614c0a614bfd565b614c15818484614bd8565b505050565b5b81811015614c3957614c2e600082614c02565b600181019050614c1b565b5050565b601f821115614c7e57614c4f81614b1e565b614c5884614b33565b81016020851015614c67578190505b614c7b614c7385614b33565b830182614c1a565b50505b505050565b600082821c905092915050565b6000614ca160001984600802614c83565b1980831691505092915050565b6000614cba8383614c90565b9150826002028217905092915050565b614cd3826138ca565b67ffffffffffffffff811115614cec57614ceb613981565b5b614cf682546147ab565b614d01828285614c3d565b600060209050601f831160018114614d345760008415614d22578287015190505b614d2c8582614cae565b865550614d94565b601f198416614d4286614b1e565b60005b82811015614d6a57848901518255600182019150602085019450602081019050614d45565b86831015614d875784890151614d83601f891682614c90565b8355505b6001600288020188555050505b505050505050565b7f5469657220646f6573206e6f7420657869737400000000000000000000000000600082015250565b6000614dd26013836138d5565b9150614ddd82614d9c565b602082019050919050565b60006020820190508181036000830152614e0181614dc5565b9050919050565b7f43616e206f6e6c792072656d6f76652068696768657374207469657200000000600082015250565b6000614e3e601c836138d5565b9150614e4982614e08565b602082019050919050565b60006020820190508181036000830152614e6d81614e31565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614eae82613718565b9150614eb983613718565b9250828203905081811115614ed157614ed0614e74565b5b92915050565b6000604082019050614eec600083018561378e565b614ef9602083018461378e565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4f6e6c79207265736f6c7665722063616e2063616c6c20746869732066756e6360008201527f74696f6e00000000000000000000000000000000000000000000000000000000602082015250565b6000614f8b6024836138d5565b9150614f9682614f2f565b604082019050919050565b60006020820190508181036000830152614fba81614f7e565b9050919050565b6000614fcc82613718565b9150614fd783613718565b9250828201905080821115614fef57614fee614e74565b5b92915050565b7f55524920666f7220696e697469616c2074696572206e6f742073657400000000600082015250565b600061502b601c836138d5565b915061503682614ff5565b602082019050919050565b6000602082019050818103600083015261505a8161501e565b9050919050565b6000604082019050615076600083018561378e565b81810360208301526150888184613921565b90509392505050565b6000819050919050565b600067ffffffffffffffff82169050919050565b60006150ca6150c56150c084615091565b614ba2565b61509b565b9050919050565b6150da816150af565b82525050565b60006020820190506150f560008301846150d1565b92915050565b7f54696572206d7573742062652067726561746572207468616e20300000000000600082015250565b6000615131601b836138d5565b915061513c826150fb565b602082019050919050565b6000602082019050818103600083015261516081615124565b9050919050565b7f5469657273206d7573742062652061646465642073657175656e7469616c6c79600082015250565b600061519d6020836138d5565b91506151a882615167565b602082019050919050565b600060208201905081810360008301526151cc81615190565b9050919050565b7f506f696e7473206d7573742062652067726561746572207468616e207468652060008201527f70726576696f7573207469657200000000000000000000000000000000000000602082015250565b600061522f602d836138d5565b915061523a826151d3565b604082019050919050565b6000602082019050818103600083015261525e81615222565b9050919050565b600060608201905061527a600083018661378e565b818103602083015261528c8185613921565b905061529b604083018461378e565b949350505050565b6152ac81614029565b81146152b757600080fd5b50565b6000815190506152c9816152a3565b92915050565b6000602082840312156152e5576152e46136b0565b5b60006152f3848285016152ba565b91505092915050565b7f55524920666f72206e65772074696572206e6f74207365740000000000000000600082015250565b60006153326018836138d5565b915061533d826152fc565b602082019050919050565b6000602082019050818103600083015261536181615325565b9050919050565b7f426164676520616c7265616479206d696e746564000000000000000000000000600082015250565b600061539e6014836138d5565b91506153a982615368565b602082019050919050565b600060208201905081810360008301526153cd81615391565b9050919050565b60006153df82613718565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361541157615410614e74565b5b600182019050919050565b60008154615429816147ab565b61543381866138d5565b9450600182166000811461544e576001811461546457615497565b60ff198316865281151560200286019350615497565b61546d85614b1e565b60005b8381101561548f57815481890152600182019150602081019050615470565b808801955050505b50505092915050565b60006060820190506154b5600083018661378e565b6154c2602083018561378e565b81810360408301526154d4818461541c565b9050949350505050565b600081519050919050565b600081905092915050565b60006154ff826154de565b61550981856154e9565b93506155198185602086016138e6565b80840191505092915050565b600061553182846154f4565b915081905092915050565b60006080820190506155516000830187613873565b61555e602083018661378e565b61556b604083018561378e565b615578606083018461378e565b95945050505050565b6000604082019050818103600083015261559b8185613f20565b905081810360208301526155af8184613f20565b90509392505050565b600082825260208201905092915050565b60006155d4826154de565b6155de81856155b8565b93506155ee8185602086016138e6565b6155f781613910565b840191505092915050565b600060a0820190506156176000830188613873565b6156246020830187613873565b615631604083018661378e565b61563e606083018561378e565b818103608083015261565081846155c9565b90509695505050505050565b60008151905061566b816137e4565b92915050565b600060208284031215615687576156866136b0565b5b60006156958482850161565c565b91505092915050565b600060a0820190506156b36000830188613873565b6156c06020830187613873565b81810360408301526156d28186613f20565b905081810360608301526156e68185613f20565b905081810360808301526156fa81846155c9565b9050969550505050505056fea2646970667358221220f2405189bf8b01cc7e912b091853f6dc43b0b7ae6b7d0ce3b13b974634d67f6b64736f6c63430008170033
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.