Source Code
More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 182 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Set Approval For... | 38635570 | 10 days ago | IN | 0 ETH | 0.00000007 | ||||
| Set Approval For... | 36338177 | 64 days ago | IN | 0 ETH | 0.00000005 | ||||
| Set Approval For... | 36177249 | 67 days ago | IN | 0 ETH | 0.00000018 | ||||
| Set Approval For... | 36149297 | 68 days ago | IN | 0 ETH | 0.00000015 | ||||
| Set Approval For... | 36146810 | 68 days ago | IN | 0 ETH | 0.0000003 | ||||
| Set Approval For... | 35913662 | 73 days ago | IN | 0 ETH | 0.00000011 | ||||
| Set Approval For... | 35609119 | 80 days ago | IN | 0 ETH | 0.00000007 | ||||
| Set Approval For... | 35202957 | 90 days ago | IN | 0 ETH | 0 | ||||
| Set Approval For... | 34877844 | 97 days ago | IN | 0 ETH | 0.00000005 | ||||
| Set Approval For... | 34709493 | 101 days ago | IN | 0 ETH | 0.00000034 | ||||
| Set Approval For... | 34709466 | 101 days ago | IN | 0 ETH | 0.00000055 | ||||
| Set Approval For... | 34673607 | 102 days ago | IN | 0 ETH | 0.00000067 | ||||
| Set Custom Names... | 34429558 | 108 days ago | IN | 0 ETH | 0.00000045 | ||||
| Set Lucha Names | 34429017 | 108 days ago | IN | 0 ETH | 0.00000041 | ||||
| Set Approval For... | 34361156 | 109 days ago | IN | 0 ETH | 0.0000001 | ||||
| Set Approval For... | 33984826 | 118 days ago | IN | 0 ETH | 0.00000024 | ||||
| Set Approval For... | 33946116 | 119 days ago | IN | 0 ETH | 0.00000034 | ||||
| Mint | 33941356 | 119 days ago | IN | 0 ETH | 0.00005006 | ||||
| Mint | 33941226 | 119 days ago | IN | 0 ETH | 0.00000317 | ||||
| Mint | 33941219 | 119 days ago | IN | 0 ETH | 0.00000409 | ||||
| Mint | 33941211 | 119 days ago | IN | 0 ETH | 0.00000341 | ||||
| Mint | 33941204 | 119 days ago | IN | 0 ETH | 0.0000034 | ||||
| Mint | 33941196 | 119 days ago | IN | 0 ETH | 0.00000355 | ||||
| Mint | 33941188 | 119 days ago | IN | 0 ETH | 0.00000365 | ||||
| Mint | 33941181 | 119 days ago | IN | 0 ETH | 0.00000357 |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Luchamon
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "./lib/Base64.sol";
interface ILuchaNames {
function getName(address originContract, uint256 id) external view returns (string memory);
}
contract Luchamon is ERC721Enumerable, AccessControl {
using Strings for uint256;
ILuchaNames public luchaNames;
struct Item {
bytes12 name;
string svg;
}
struct Art {
string[] baseColor;
string[] altColor;
string[] eyeColor;
string[] skinColor;
mapping(uint256 => Item) spirit;
mapping(uint256 => Item) cape;
mapping(uint256 => Item) torso;
mapping(uint256 => Item) arms;
mapping(uint256 => Item) mask;
mapping(uint256 => Item) mouth;
mapping(uint256 => Item) bottoms;
mapping(uint256 => Item) boots;
}
Art art;
mapping(uint256 => uint256) luchamonDNAs;
bool customNamesEnabled;
bool dnaLocked;
bytes32 public constant RESCUER_ROLE = keccak256("RESCUER_ROLE");
bytes32 public constant NAME_MANAGER_ROLE = keccak256("NAME_MANAGER_ROLE");
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
constructor() ERC721("Luchamon", "LUCHAMON") {
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
_setupRole(NAME_MANAGER_ROLE, msg.sender);
_setupRole(RESCUER_ROLE, msg.sender);
art.baseColor = ["ebebf7", "1c1d2f", "cc0d3d", "d22f94", "890ec1", "1c49d8", "19b554", "13cac6", "f7c23c", "f18e2f"];
art.altColor = ["dadae6", "13141f", "ea184d", "e0369f", "9511d2", "2854e6", "1da951", "11b9b5", "e8b63a", "e28327"];
art.eyeColor = ["3b6ba5", "3b8fa5", "3ba599", "3ba577", "339842", "7fa53b", "a5823b", "a5693b", "844f1d", "4e2906"];
art.skinColor = ["f9d1b7", "f7b897", "f39c77", "ffcb84", "bd7e47", "b97e4b", "b97a50", "5a3214", "50270e", "3a1b09"];
art.spirit[0] = Item("Bull", "<path fill='#A9A18A' d='M21 2V1h-1V0h-1v2h1v1h-3v2h2v1h2V5h1V2zM5 3H4V2h1V0H4v1H3v1H2v3h1v1h2V5h2V3H6z'/><g fill='#000' opacity='.15'><path d='M21 4h1v1h-1zM19 5h-1v1h3V5h-1z'/><path d='M2 4h1v1H2zM4 5H3v1h3V5H5z'/></g>");
art.spirit[1] = Item("Jaguar", "<path class='lucha-base' d='M6 2V1H5v5h1V5h1V3h1V2H7zM18 1v1h-2v1h1v2h1v1h1V1z'/><g fill='#000'><path d='M5 1h1v1H5zM6 2v1h2V2H7zM18 1h1v1h-1zM16 2v1h2V2h-1z' opacity='.3'/><path d='M6 3V2H5v4h1V5h1V3zM18 2v1h-1v2h1v1h1V2z' opacity='.2'/></g>");
art.cape[0] = Item("Classic", "<path class='lucha-alt' d='M20 11H3v12h1v-1h2v-1h12v1h2v1h1V11z'/><g fill='#000'><path opacity='.2' d='M20 11v12h1V11zM3 12v11h1V11H3z'/><path opacity='.5' d='M19 11H4v11h2v-1h12v1h2V11z'/></g>");
art.cape[1] = Item("Hooded", "<path class='lucha-alt' d='M20 11H3v12h1v-1h2v-1h12v1h2v1h1V11z'/><g fill='#000'><path opacity='.2' d='M20 11v12h1V11zM3 12v11h1V11H3z'/><path opacity='.5' d='M19 11H4v11h2v-1h12v1h2V11z'/></g>");
art.torso[0] = Item("Shirt", "<path class='lucha-base' d='M22 12v-1h-1v-1h-1V9H4v1H3v1H2v1H1v5h4v-3h1v1h1v1h1v2h8v-2h1v-1h1v-1h1v3h4v-5z'/><path d='M22 12v-1h-1v-1h-1V9H4v1H3v1H2v1H1v5h4v-3h1v1h1v1h1v2h8v-2h1v-1h1v-1h1v3h4v-5z' fill='#000' opacity='.15'/>");
art.torso[1] = Item("Open Shirt", "<path class='lucha-base' d='M10 9H4v1H3v1H2v1H1v3h4v-1h1v1h1v1h1v2h3V9zM22 12v-1h-1v-1h-1V9h-7v9h3v-2h1v-1h1v-1h1v1h4v-3z'/><path d='M10 9H4v1H3v1H2v1H1v3h4v-1h1v1h1v1h1v2h3V9zM22 12v-1h-1v-1h-1V9h-7v9h3v-2h1v-1h1v-1h1v1h4v-3z' fill='#000' opacity='.15'/>");
art.torso[2] = Item("Singlet", "<path class='lucha-base' d='M16 9H7v3h1-1v4h1v1h8v-1h1v-4h-1 1V9z'/><path fill='#000' opacity='.15' d='M16 9H7v7h1v1h8v-1h1V9z'/>");
art.torso[3] = Item("Suspenders", "<path class='lucha-base' d='M15 9v9h1V9zM8 10v8h1V9H8z'/><path d='M8 10v8h1V9H8zM15 9v9h1V9z' fill='#000' opacity='.15'/>");
art.arms[0] = Item("Gloves", "<path class='lucha-base' d='M5 16H1v3h4v-1h1v-1H5zM22 16h-3v1h-1v1h1v1h4v-3z'/><path class='lucha-alt' d='M3 16H1v1h4v-1H4zM22 16h-3v1h4v-1z'/>");
art.arms[1] = Item("Wrist Bands", "<path class='lucha-base' d='M3 15H1v2h4v-2H4zM22 15h-3v2h4v-2z'/>");
art.arms[2] = Item("Right Band", "<path class='lucha-alt' d='M4 14H1v1h4v-1z'/>");
art.arms[3] = Item("Left Band", "<path class='lucha-base' d='M22 14h-3v1h4v-1z'/>");
art.arms[4] = Item("Arm Bands", "<path class='lucha-base' d='M4 14H1v1h4v-1zM22 14h-3v1h4v-1z'/>");
art.arms[5] = Item("Sleeves", "<path class='lucha-base' d='M22 14h-3v3h4v-3zM3 14H1v3h4v-3H4z'/><path class='lucha-alt' d='M22 14h-3v1h4v-1zM3 14H1v1h4v-1H4z'/>");
art.mask[0] = Item("Split", "<path d='M11 0H9v1H8v1H7v1H6v2H5v5h1v2h1v1h1v1h1v1h3V0z'/>");
art.mask[1] = Item("Cross", "<path d='M14 2h-1V0h-2v2H9v2h2v4h2V4h2V2zM12 13h-1v2h2v-2z'/>");
art.mask[2] = Item("Fierce", "<path d='M17 3v1h-2v1h-1v1h-1v3h5V3zM11 8V6h-1V5H9V4H7V3H6v6h5zM11 13v2h2v-2h-1z'/>");
art.mask[3] = Item("Striped", "<path d='M11 2h2V1h1V0h-4v1h1zM6 10v2h1v-1h1v-1H7zM17 10h-1v1h1v1h1v-2z'/><path d='M16 3h1V2h-1V1h-1v1h-1v1h-1v1h-2V3h-1V2H9V1H8v1H7v1h1v1h1v1h1v1h1v9h2V6h1V5h1V4h1z'/>");
art.mask[4] = Item("Bolt", "<path d='M13 3h-3V2h1V1h1V0H9v1H8v1H7v1H6v2h3v1H8v2H7v2h1V9h1V8h1V7h1V6h1V5h1V4h1V3z'/>");
art.mask[5] = Item("Winged", "<path d='M18 5V3h-1V2h-1v1h-1v1h-1v1h-1v1h-2V5h-1V4H9V3H8V2H7v1H6v2H5v5h1v2h1v-1h1v-1h3V9h2v1h3v1h1v1h1v-2h1V5z'/>");
art.mask[6] = Item("Classic", "<path d='M18 5V3h-1V2h-1v2h-1v1h-1v1h-1v3h-2V6h-1V5H9V4H8V2H7v1H6v2H5v4h1v1h2v3h1v1h6v-1h1v-3h2V9h1V5z'/>");
art.mask[7] = Item("Arrow", "<path d='M18 5V3h-1V2h-1V1h-1V0H9v1H8v1H7v1H6v2H5v5h1v2h1v1h1v1h1v1h1v-4h1V5H9V3h1V2h1V1h2v1h1v1h1v2h-2v6h1v4h1v-1h1v-1h1v-1h1v-2h1V5z'/>");
art.mask[8] = Item("Dash", "<path d='M13 3V2h-2v2h2zM13 1V0h-2v1h1zM10 4H9V1H8v1H7v1H6v2H5v5h1v2h1v1h1v1h1v1h1v-2H9v-3h2V5h-1zM18 5V3h-1V2h-1V1h-1v3h-1v1h-1v5h2v3h-1v2h1v-1h1v-1h1v-1h1v-2h1V5z'/>");
art.mouth[0] = Item("Moustache", "<path fill='#421c03' opacity='.9' d='M14 10H9v3h1v-2h4v2h1v-3z'/>");
art.bottoms[0] = Item("Tights", "<path class='lucha-alt' d='M15 17H8v6h3v-3h2v3h3v-6z'/>");
art.bottoms[1] = Item("Trunk Tights", "<path class='lucha-base' d='M15 17H8v3h8v-3z'/><path class='lucha-alt' d='M15 18v1h-2v4h3v-5zM9 19v-1H8v5h3v-4h-1z'/>");
art.boots[0] = Item("Two Tone", "<path class='lucha-alt' d='M9 22H8v1H7v1h4v-2h-1zM16 23v-1h-3v2h4v-1z'/>");
art.boots[1] = Item("High", "<path class='lucha-alt' d='M9 20H8v1h3v-1h-1zM15 20h-2v1h3v-1z'/>");
}
function mint(address to, uint256[] calldata tokenIds) external onlyRole(MINTER_ROLE) {
for (uint256 i; i < tokenIds.length; i++) {
_mint(to, tokenIds[i]);
}
}
function imageData(uint256 _tokenId) public view returns (string memory) {
require(_tokenId > 0 && _tokenId <= 10000, "imageData: Nonexistent token");
uint8[12] memory dna = splitNumber(luchamonDNAs[_tokenId]);
string memory capeShoulders = (dna[1] == 0 || dna[1] == 1)? "<path class='lucha-alt' d='M20 10V9h-2v1h-1v1h4v-1zM5 9H4v1H3v1h4v-1H6V9z'/><path fill='#000' opacity='.2' d='M6 9H4v1H3v1h4v-1H6zM20 10V9h-2v1h-1v1h4v-1z'/>" : "";
string memory capeHood = dna[1] == 1 ? "<path class='lucha-alt' d='M18 4V3h-1V2h-1V1h-1V0H9v1H8v1H7v1H6v2H5v5h1V6h1V5h2V4h1V3h4v1h1v1h2v1h1v4h1V5h-1z'/><g fill='#000'><path d='M18 4V3h-1V2h-1V1h-1V0H9v1H8v1H7v1H6v2H5v5h1V5h1V4h1V3h1V2h6v1h1v1h1v1h1v5h1V5h-1z' opacity='.2'/><path d='M16 4V3h-1V2H9v1H8v1H7v1h2V4h1V3h4v1h1v1h2V4zM6 5h1v1H6zM17 5h1v1h-1z' opacity='.5'/></g>" : "";
return string(abi.encodePacked(
"<svg id='luchamon", _tokenId.toString(), "' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'>",
styles(_tokenId, dna),
"<g class='lucha-breathe'>",
art.spirit[dna[0]].svg,
art.cape[dna[1]].svg,
"<path class='lucha-skin' d='M22 12v-1h-1v-1h-1V9h-1V5h-1V3h-1V2h-1V1h-1V0H9v1H8v1H7v1H6v2H5v4H4v1H3v1H2v1H1v8h4v-1h1v-2H5v-3h1v1h1v1h1v2h8v-2h1v-1h1v-1h1v3h-1v2h1v1h4v-8z'/>",
art.torso[dna[2]].svg,
art.arms[dna[3]].svg,
capeShoulders,
"<path class='lucha-base' d='M18 5V3h-1V2h-1V1h-1V0H9v1H8v1H7v1H6v2H5v5h1v2h1v1h1v1h1v1h6v-1h1v-1h1v-1h1v-2h1V5z'/>",
"<g class='lucha-alt'>", art.mask[dna[4]].svg, "</g>",
capeHood,
"<path fill='#FFF' d='M9 6H6v3h4V6zM17 6h-3v3h4V6z'/><path class='lucha-eyes' d='M16 6h-2v3h3V6zM8 6H7v3h3V6H9z'/><path fill='#FFF' d='M7 6h1v1H7zM16 6h1v1h-1z' opacity='.4'/><path fill='#000' d='M15 7h1v1h-1zM8 7h1v1H8z'/>",
"<path class='lucha-skin' d='M14 10H9v3h6v-3z'/>",
"<path fill='#000' opacity='.9' d='M13 11h-3v1h4v-1z'/>",
art.mouth[dna[5]].svg,
"</g>",
"<path class='lucha-skin' d='M16 23v-6H8v6H7v1h4v-4h2v4h4v-1z'/>",
"<path class='lucha-base' d='M15 17H8v1h1v1h2v1h2v-1h2v-1h1v-1z'/>",
art.bottoms[dna[6]].svg,
"<path class='lucha-base' d='M9 21H8v2H7v1h4v-3h-1zM16 23v-2h-3v3h4v-1z'/>",
art.boots[dna[7]].svg,
"</svg>"
));
}
function styles(uint256 _tokenId, uint8[12] memory _dna) internal view returns (string memory) {
return string(abi.encodePacked(
"<style>#luchamon", _tokenId.toString(), " .lucha-base { fill: #", art.baseColor[_dna[8]],
"; } #luchamon", _tokenId.toString(), " .lucha-alt { fill: #", art.altColor[_dna[9]],
"; } #luchamon", _tokenId.toString(), " .lucha-eyes { fill: #", art.eyeColor[_dna[10]],
"; } #luchamon", _tokenId.toString(), " .lucha-skin { fill: #", art.skinColor[_dna[11]],
"; } #luchamon", _tokenId.toString(), " .lucha-breathe { animation: 0.5s lucha-breathe infinite alternate ease-in-out; } @keyframes lucha-breathe { from { transform: translateY(0px); } to { transform: translateY(1%); } }</style>"
));
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
require(_tokenId > 0 && _tokenId <= 10000, "tokenURI: Nonexistent token");
uint8[12] memory dna = splitNumber(luchamonDNAs[_tokenId]);
Item[8] memory artItems = [
art.spirit[dna[0]],
art.cape[dna[1]],
art.torso[dna[2]],
art.arms[dna[3]],
art.mask[dna[4]],
art.mouth[dna[5]],
art.bottoms[dna[6]],
art.boots[dna[7]]
];
string memory attributes;
string[8] memory traitType = ["Spirit", "Cape", "Torso", "Arms", "Mask", "Mouth", "Bottoms", "Boots"];
for (uint256 i = 0; i < artItems.length; i++) {
if (artItems[i].name == "") continue;
attributes = string(abi.encodePacked(attributes,
bytes(attributes).length == 0 ? '{' : ', {',
'"trait_type": "', traitType[i],'",',
'"value": "', bytes12ToString(artItems[i].name), '"',
'}'
));
}
string memory customName = customNamesEnabled ? luchaNames.getName(address(this), _tokenId) : '';
string memory name = bytes(customName).length > 0 ? customName : string(abi.encodePacked('Luchamon #', _tokenId.toString()));
return string(abi.encodePacked(
"data:application/json;base64,",
Base64.encode(
bytes(
string(abi.encodePacked(
'{',
'"name": "', name, '",',
'"description": "Luchamon were randomly generated using Chainlink VRF and have 100% on-chain art and metadata!",',
'"image_data": "', imageData(_tokenId), '",',
'"external_url": "https://luchamon.com",',
'"attributes": [', attributes, ']',
'}'
))
)
)
));
}
function splitNumber(uint256 _number) internal pure returns (uint8[12] memory) {
uint8[12] memory numbers;
for (uint256 i = 0; i < numbers.length; i++) {
numbers[i] = uint8(_number % 10);
_number /= 10;
}
return numbers;
}
function bytes12ToString(bytes12 _bytes12) internal pure returns (string memory) {
uint8 i = 0;
while(i < 12 && _bytes12[i] != 0) {
i++;
}
bytes memory bytesArray = new bytes(i);
for (i = 0; i < 12 && _bytes12[i] != 0; i++) {
bytesArray[i] = _bytes12[i];
}
return string(bytesArray);
}
function setDNA(uint256[] calldata ids, uint256[] calldata dnas) external onlyRole(DEFAULT_ADMIN_ROLE) {
require(!dnaLocked, "setDNA: locked");
require(ids.length == dnas.length, "Array lengths do not match");
for (uint256 i = 0; i < ids.length; i++) {
luchamonDNAs[ids[i]] = dnas[i];
}
}
function lockDNA() external onlyRole(DEFAULT_ADMIN_ROLE) {
dnaLocked = true;
}
function setLuchaNames(address _luchaNames) external onlyRole(DEFAULT_ADMIN_ROLE) {
luchaNames = ILuchaNames(_luchaNames);
}
function setCustomNamesEnabled(bool val) external onlyRole(NAME_MANAGER_ROLE) {
customNamesEnabled = val;
}
// in case a luchamon is accidentally sent to this contract
function rescueLuchamon(address to, uint256[] calldata tokenIds) external onlyRole(RESCUER_ROLE) {
for (uint256 i; i < tokenIds.length; i++) {
_safeTransfer(address(this), to, tokenIds[i], "");
}
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721Enumerable, AccessControl) returns (bool) {
return super.supportsInterface(interfaceId);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(account),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* May emit a {RoleGranted} event.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: address zero is not a valid owner");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _ownerOf(tokenId);
require(owner != address(0), "ERC721: invalid token ID");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
_requireMinted(tokenId);
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not token owner or approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
_requireMinted(tokenId);
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
_safeTransfer(from, to, tokenId, data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
*/
function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
return _owners[tokenId];
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _ownerOf(tokenId) != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId, 1);
// Check that tokenId was not minted by `_beforeTokenTransfer` hook
require(!_exists(tokenId), "ERC721: token already minted");
unchecked {
// Will not overflow unless all 2**256 token ids are minted to the same owner.
// Given that tokens are minted one by one, it is impossible in practice that
// this ever happens. Might change if we allow batch minting.
// The ERC fails to describe this case.
_balances[to] += 1;
}
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId, 1);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
* This is an internal function that does not check if the sender is authorized to operate on the token.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId, 1);
// Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
owner = ERC721.ownerOf(tokenId);
// Clear approvals
delete _tokenApprovals[tokenId];
unchecked {
// Cannot overflow, as that would require more tokens to be burned/transferred
// out than the owner initially received through minting and transferring in.
_balances[owner] -= 1;
}
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId, 1);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(address from, address to, uint256 tokenId) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId, 1);
// Check that tokenId was not transferred by `_beforeTokenTransfer` hook
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
// Clear approvals from the previous owner
delete _tokenApprovals[tokenId];
unchecked {
// `_balances[from]` cannot overflow for the same reason as described in `_burn`:
// `from`'s balance is the number of token held, which is at least one before the current
// transfer.
// `_balances[to]` could overflow in the conditions described in `_mint`. That would require
// all 2**256 token ids to be minted, which in practice is impossible.
_balances[from] -= 1;
_balances[to] += 1;
}
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId, 1);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits an {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Reverts if the `tokenId` has not been minted yet.
*/
function _requireMinted(uint256 tokenId) internal view virtual {
require(_exists(tokenId), "ERC721: invalid token ID");
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
* used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
* - When `from` is zero, the tokens will be minted for `to`.
* - When `to` is zero, ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
* - `batchSize` is non-zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}
/**
* @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
* used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
* - When `from` is zero, the tokens were minted for `to`.
* - When `to` is zero, ``from``'s tokens were burned.
* - `from` and `to` are never both zero.
* - `batchSize` is non-zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}
/**
* @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
*
* WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant
* being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such
* that `ownerOf(tokenId)` is `a`.
*/
// solhint-disable-next-line func-name-mixedcase
function __unsafe_increaseBalance(address account, uint256 amount) internal {
_balances[account] += amount;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "./IERC721Enumerable.sol";
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev See {ERC721-_beforeTokenTransfer}.
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 firstTokenId,
uint256 batchSize
) internal virtual override {
super._beforeTokenTransfer(from, to, firstTokenId, batchSize);
if (batchSize > 1) {
// Will only trigger during construction. Batch transferring (minting) is not available afterwards.
revert("ERC721Enumerable: consecutive transfers not supported");
}
uint256 tokenId = firstTokenId;
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
import "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// [MIT License] /// @title Base64 /// @notice Provides a function for encoding some bytes in base64 /// @author Brecht Devos <[email protected]> library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return ""; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((len + 2) / 3); // Add some extra buffer at the end bytes memory result = new bytes(encodedLen + 32); bytes memory table = TABLE; assembly { let tablePtr := add(table, 1) let resultPtr := add(result, 32) for { let i := 0 } lt(i, len) { } { i := add(i, 3) let input := and(mload(add(data, i)), 0xffffff) let out := mload(add(tablePtr, and(shr(18, input), 0x3F))) out := shl(8, out) out := add( out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF) ) out := shl(8, out) out := add( out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF) ) out := shl(8, out) out := add( out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF) ) out := shl(224, out) mstore(resultPtr, out) resultPtr := add(resultPtr, 4) } switch mod(len, 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } mstore(result, encodedLen) } return string(result); } }
{
"optimizer": {
"enabled": true,
"runs": 200,
"details": {
"yul": false
}
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NAME_MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RESCUER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"imageData","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockDNA","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"luchaNames","outputs":[{"internalType":"contract ILuchaNames","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"rescueLuchamon","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"val","type":"bool"}],"name":"setCustomNamesEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"dnas","type":"uint256[]"}],"name":"setDNA","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_luchaNames","type":"address"}],"name":"setLuchaNames","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":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b5060405180604001604052806008815260200167263ab1b430b6b7b760c11b81525060405180604001604052806008815260200167262aa1a420a6a7a760c11b815250816000908162000065919062001d68565b50600162000074828262001d68565b50620000869150600090503362001acd565b620000b27f6ae19fd703cb304b53d5f09f6a0ce96b7c6a7edd912859ca6c4ed719bcab610d3362001acd565b620000de7fcf6f9f892731e14b8859835f2ff35575f447fb501f46243c4eb8bac19e31a0503362001acd565b6040805161018081018252600661014082018181526565626562663760d01b6101608401528252825180840184528181526518b198b2193360d11b60208281019190915280840191909152835180850185528281526518d8cc190cd960d21b81830152838501528351808501855282815265190c8c998e4d60d21b818301526060840152835180850185528281526538393065633160d01b8183015260808401528351808501855282815265062c66872c8760d31b8183015260a084015283518085018552828152650c4e588d4d4d60d21b8183015260c084015283518085018552828152651899b1b0b19b60d11b8183015260e0840152835180850185528281526566376332336360d01b8183015261010084015283518085019094529083526533189c32993360d11b908301526101208101919091526200022690600c90600a62001b81565b50604080516101808101825260066101408201818152653230b230b29b60d11b610160840152825282518084018452818152651899989a18b360d11b60208281019190915280840191909152835180850185528281526519584c4e0d1960d21b818301528385015283518085018552828152653298199b1cb360d11b81830152606084015283518085018552828152651c9a9898b21960d11b8183015260808401528351808501855282815265191c1a9a329b60d11b8183015260a0840152835180850185528281526531646139353160d01b8183015260c0840152835180850185528281526531316239623560d01b8183015260e0840152835180850185528281526565386236336160d01b8183015261010084015283518085019094529083526565323833323760d01b908301526101208101919091526200036f90600d90600a62001b81565b506040805161018081018252600661014082018181526533623662613560d01b6101608401528252825180840184528181526533623866613560d01b60208281019190915280840191909152835180850185528281526533626135393960d01b8183015283850152835180850185528281526533626135373760d01b818301526060840152835180850185528281526519999c9c1a1960d11b81830152608084015283518085018552828152651bb3309a99b160d11b8183015260a08401528351808501855282815265309a9c1919b160d11b8183015260c08401528351808501855282815265309a9b1c99b160d11b8183015260e084015283518085018552828152650e0d0d198c5960d21b818301526101008401528351808501909452908352651a32991c981b60d11b90830152610120810191909152620004b890600e90600a62001b81565b506040805161018081018252600661014082018181526566396431623760d01b6101608401528252825180840184528181526566376238393760d01b60208281019190915280840191909152835180850185528281526566333963373760d01b81830152838501528351808501855282815265199998d88e0d60d21b818301526060840152835180850185528281526562643765343760d01b8183015260808401528351808501855282815265311c9bb29a3160d11b8183015260a0840152835180850185528281526506239376135360d41b8183015260c084015283518085018552828152650d584ccc8c4d60d21b8183015260e0840152835180850185528281526535303237306560d01b8183015261010084015283518085019094529083526533613162303960d01b908301526101208101919091526200060190600f90600a62001b81565b50604051806040016040528063109d5b1b60e21b6001600160a01b031916815260200160405180610100016040528060db81526020016200670260db91399052600080526010602090815281517f6e0956cda88cad152e89927e53611735b61a5c762d1428573c6931b0a5efcb0180546001600160601b03191660a09290921c919091178155908201517f6e0956cda88cad152e89927e53611735b61a5c762d1428573c6931b0a5efcb0290620006b9908262001d68565b509050506040518060400160405280652530b3bab0b960d11b6001600160a01b031916815260200160405180610120016040528060f281526020016200661060f29139905260016000526010602090815281517f8c6065603763fec3f5742441d3833f3f43b982453612d76adb39a885e3006b5f80546001600160601b03191660a09290921c919091178155908201517f8c6065603763fec3f5742441d3833f3f43b982453612d76adb39a885e3006b609062000777908262001d68565b50905050604051806040016040528066436c617373696360c81b6001600160a01b031916815260200160405180610100016040528060c18152602001620069e160c191399052600080526011602090815281517f4ad3b33220dddc71b994a52d72c06b10862965f7d926534c05c00fb7e819e7b780546001600160601b03191660a09290921c919091178155908201517f4ad3b33220dddc71b994a52d72c06b10862965f7d926534c05c00fb7e819e7b89062000835908262001d68565b50905050604051806040016040528065121bdbd9195960d21b6001600160a01b031916815260200160405180610100016040528060c18152602001620069e160c19139905260016000526011602090815281517f17bc176d2408558f6e4111feebc3cab4e16b63e967be91cde721f4c8a488b55280546001600160601b03191660a09290921c919091178155908201517f17bc176d2408558f6e4111feebc3cab4e16b63e967be91cde721f4c8a488b55390620008f3908262001d68565b5090505060405180604001604052806414da1a5c9d60da1b6001600160a01b031916815260200160405180610120016040528060e18152602001620063a560e191399052600080526012602090815281517f7e7fa33969761a458e04f477e039a608702b4f924981d6653935a8319a08ad7b80546001600160601b03191660a09290921c919091178155908201517f7e7fa33969761a458e04f477e039a608702b4f924981d6653935a8319a08ad7c90620009af908262001d68565b5090505060405180604001604052806913dc195b8814da1a5c9d60b21b6001600160a01b031916815260200160405180610120016040528060ff8152602001620068e260ff9139905260016000526012602090815281517f71a67924699a20698523213e55fe499d539379d7769cd5567e2c45d583f815a380546001600160601b03191660a09290921c919091178155908201517f71a67924699a20698523213e55fe499d539379d7769cd5567e2c45d583f815a49062000a71908262001d68565b5090505060405180604001604052806614da5b99db195d60ca1b6001600160a01b03191681526020016040518060c001604052806081815260200162006bbb60819139905260026000526012602090815281517f8e1fee8c88a9e04123b21e90cae2727a7715bf522a1e46eb5934ccd05203a6b280546001600160601b03191660a09290921c919091178155908201517f8e1fee8c88a9e04123b21e90cae2727a7715bf522a1e46eb5934ccd05203a6b39062000b2f908262001d68565b5090505060405180604001604052806953757370656e6465727360b01b6001600160a01b03191681526020016040518060a001604052806079815260200162006d1860799139905260036000526012602090815281517f0f36ad39aee03e7108cc48f54934702a5f0d4066f10344cebf8198978d86976a80546001600160601b03191660a09290921c919091178155908201517f0f36ad39aee03e7108cc48f54934702a5f0d4066f10344cebf8198978d86976b9062000bf0908262001d68565b50905050604051806040016040528065476c6f76657360d01b6001600160a01b03191681526020016040518060c00160405280608f8152602001620061eb608f91399052600080526013602090815281517f8fa6efc3be94b5b348b21fea823fe8d100408cee9b7f90524494500445d8ff6c80546001600160601b03191660a09290921c919091178155908201517f8fa6efc3be94b5b348b21fea823fe8d100408cee9b7f90524494500445d8ff6d9062000cac908262001d68565b5090505060405180604001604052806a57726973742042616e647360a81b6001600160a01b0319168152602001604051806080016040528060418152602001620065a260419139905260016000526013602090815281517f4155c2f711f2cdd34f8262ab8fb9b7020a700fe7b6948222152f7670d1fdf34d80546001600160601b03191660a09290921c919091178155908201517f4155c2f711f2cdd34f8262ab8fb9b7020a700fe7b6948222152f7670d1fdf34e9062000d6e908262001d68565b50905050604051806040016040528069149a59da1d0810985b9960b21b6001600160a01b03191681526020016040518060600160405280602d8152602001620065e3602d9139905260026000526013602090815281517f0b9d2c0c271bb30544eb78c59bdaebdae2728e5f65814c07768a0abe90ed192380546001600160601b03191660a09290921c919091178155908201517f0b9d2c0c271bb30544eb78c59bdaebdae2728e5f65814c07768a0abe90ed19249062000e2f908262001d68565b509050506040518060400160405280681319599d0810985b9960ba1b6001600160a01b0319168152602001604051806060016040528060308152602001620061bb60309139905260036000526013602090815281517f0d2a6872ef858a7f8ead18dc4f3f2e8d35c853d47e2816cbb9cdd49202554e0c80546001600160601b03191660a09290921c919091178155908201517f0d2a6872ef858a7f8ead18dc4f3f2e8d35c853d47e2816cbb9cdd49202554e0d9062000eef908262001d68565b5090505060405180604001604052806841726d2042616e647360b81b6001600160a01b03191681526020016040518060600160405280603f8152602001620068a3603f9139905260046000526013602090815281517f01413ff7a3b1d5b6c016c061d48e2c7014700c777a29fcd068fff04265813d5d80546001600160601b03191660a09290921c919091178155908201517f01413ff7a3b1d5b6c016c061d48e2c7014700c777a29fcd068fff04265813d5e9062000faf908262001d68565b50905050604051806040016040528066536c656576657360c81b6001600160a01b03191681526020016040518060c0016040528060818152602001620062bb60819139905260056000526013602090815281517ff4b2859895858d6aa26d656e4999d552f6a869b74c43bba7d2a941c4d22c355980546001600160601b03191660a09290921c919091178155908201517ff4b2859895858d6aa26d656e4999d552f6a869b74c43bba7d2a941c4d22c355a906200106d908262001d68565b5090505060405180604001604052806414dc1b1a5d60da1b6001600160a01b03191681526020016040518060600160405280603a815260200162006aa2603a91399052600080526014602090815281517f4f26c3876aa9f4b92579780beea1161a61f87ebf1ec6ee865b299e447ecba99c80546001600160601b03191660a09290921c919091178155908201517f4f26c3876aa9f4b92579780beea1161a61f87ebf1ec6ee865b299e447ecba99d9062001128908262001d68565b5090505060405180604001604052806443726f737360d81b6001600160a01b03191681526020016040518060600160405280603d815260200162006866603d9139905260016000526014602090815281517fb6c61a840592cc84133e4b25bd509abf4659307c57b160799b38490a5aa48f2c80546001600160601b03191660a09290921c919091178155908201517fb6c61a840592cc84133e4b25bd509abf4659307c57b160799b38490a5aa48f2d90620011e4908262001d68565b5090505060405180604001604052806546696572636560d01b6001600160a01b031916815260200160405180608001604052806053815260200162006c3c60539139905260026000526014602090815281517fa1930aa930426c54c34daad2b9ada7c5d0ef0c96078a3c5bb79f6fa6602c4a7a80546001600160601b03191660a09290921c919091178155908201517fa1930aa930426c54c34daad2b9ada7c5d0ef0c96078a3c5bb79f6fa6602c4a7b90620012a1908262001d68565b5090505060405180604001604052806614dd1c9a5c195960ca1b6001600160a01b03191681526020016040518060e0016040528060a8815260200162006b1360a89139905260036000526014602090815281517f63d87a887046e0430be80fdeb014107d7198c879cbf2cddf39a6df195c86cb3880546001600160601b03191660a09290921c919091178155908201517f63d87a887046e0430be80fdeb014107d7198c879cbf2cddf39a6df195c86cb39906200135f908262001d68565b50905050604051806040016040528063109bdb1d60e21b6001600160a01b031916815260200160405180608001604052806057815260200162006e0360579139905260046000526014602090815281517f52102136546d97ed3f65ec1070a32935d3048ea12f310d29c378dc9d6555c0d680546001600160601b03191660a09290921c919091178155908201517f52102136546d97ed3f65ec1070a32935d3048ea12f310d29c378dc9d6555c0d7906200141a908262001d68565b5090505060405180604001604052806515da5b99d95960d21b6001600160a01b03191681526020016040518060a001604052806072815260200162006d9160729139905260056000526014602090815281517f116126bec5aaa49b347e966c49378cf0c441de9121e306ea3d824584a9615aa280546001600160601b03191660a09290921c919091178155908201517f116126bec5aaa49b347e966c49378cf0c441de9121e306ea3d824584a9615aa390620014d7908262001d68565b50905050604051806040016040528066436c617373696360c81b6001600160a01b03191681526020016040518060a00160405280606981526020016200633c60699139905260066000526014602090815281517fe1f6b6a5fb7e47dad87547d4b0671e7e995a1dae22fbe5b3b5d10e2a77ed7aff80546001600160601b03191660a09290921c919091178155908201517fe1f6b6a5fb7e47dad87547d4b0671e7e995a1dae22fbe5b3b5d10e2a77ed7b009062001595908262001d68565b509050506040518060400160405280644172726f7760d81b6001600160a01b03191681526020016040518060c0016040528060898152602001620067dd60899139905260076000526014602090815281517f904977a779b22381a36c6463d4166ef55ee8cb3392c83093cb1750f1a00c9d9480546001600160601b03191660a09290921c919091178155908201517f904977a779b22381a36c6463d4166ef55ee8cb3392c83093cb1750f1a00c9d959062001651908262001d68565b50905050604051806040016040528063088c2e6d60e31b6001600160a01b03191681526020016040518060e0016040528060a781526020016200648660a79139905260086000526014602090815281517f125fdacc24f94fb724c0c32a4eab75d67204551eb2448dadf875d535a744972680546001600160601b03191660a09290921c919091178155908201517f125fdacc24f94fb724c0c32a4eab75d67204551eb2448dadf875d535a7449727906200170c908262001d68565b509050506040518060400160405280684d6f7573746163686560b81b6001600160a01b031916815260200160405180608001604052806041815260200162006cd7604191399052600080526015602090815281517fa31547ce6245cdb9ecea19cf8c7eb9f5974025bb4075011409251ae855b30aed80546001600160601b03191660a09290921c919091178155908201517fa31547ce6245cdb9ecea19cf8c7eb9f5974025bb4075011409251ae855b30aee90620017cb908262001d68565b5090505060405180604001604052806554696768747360d01b6001600160a01b031916815260200160405180606001604052806037815260200162006adc603791399052600080526016602090815281517f0263c2b778d062355049effc2dece97bc6547ff8a88a3258daa512061c2153dd80546001600160601b03191660a09290921c919091178155908201517f0263c2b778d062355049effc2dece97bc6547ff8a88a3258daa512061c2153de9062001887908262001d68565b5090505060405180604001604052806b5472756e6b2054696768747360a01b6001600160a01b03191681526020016040518060a00160405280607581526020016200652d60759139905260016000526016602090815281517f4c4dc693d7db52f85fe052106f4b4b920e78e8ef37dee82878a60ab8585faf4980546001600160601b03191660a09290921c919091178155908201517f4c4dc693d7db52f85fe052106f4b4b920e78e8ef37dee82878a60ab8585faf4a906200194a908262001d68565b5090505060405180604001604052806754776f20546f6e6560c01b6001600160a01b031916815260200160405180608001604052806048815260200162006c8f604891399052600080526017602090815281517fd840e16649f6b9a295d95876f4633d3a6b10b55e8162971cf78afd886d5ec89b80546001600160601b03191660a09290921c919091178155908201517fd840e16649f6b9a295d95876f4633d3a6b10b55e8162971cf78afd886d5ec89c9062001a08908262001d68565b50905050604051806040016040528063090d2ced60e31b6001600160a01b03191681526020016040518060800160405280604181526020016200627a60419139905260016000526017602090815281517ff36d6bc9642eb6fb6ee9998b09ce990566df752ab06e11f8de7ab633bbd57b8f80546001600160601b03191660a09290921c919091178155908201517ff36d6bc9642eb6fb6ee9998b09ce990566df752ab06e11f8de7ab633bbd57b909062001ac3908262001d68565b5090505062001e38565b62001ad9828262001add565b5050565b6000828152600a602090815260408083206001600160a01b038516845290915290205460ff1662001ad9576000828152600a602090815260408083206001600160a01b03851684529091529020805460ff1916600117905562001b3d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b82805482825590600052602060002090810192821562001bcc579160200282015b8281111562001bcc578251829062001bbb908262001d68565b509160200191906001019062001ba2565b5062001bda92915062001bde565b5090565b8082111562001bda57600062001bf5828262001bff565b5060010162001bde565b50805462001c0d9062001c84565b6000825580601f1062001c1e575050565b601f01602090049060005260206000209081019062001c3e919062001c41565b50565b5b8082111562001bda576000815560010162001c42565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052602260045260246000fd5b60028104600182168062001c9957607f821691505b60208210810362001cae5762001cae62001c6e565b50919050565b600062001cc562001cc28381565b90565b92915050565b62001cd68362001cb4565b815460001960089490940293841b1916921b91909117905550565b600062001d0081848462001ccb565b505050565b8181101562001ad95762001d1b60008262001cf1565b60010162001d05565b601f82111562001d00576000818152602090206020601f8501048101602085101562001d4d5750805b62001d616020601f86010483018262001d05565b5050505050565b81516001600160401b0381111562001d845762001d8462001c58565b62001d90825462001c84565b62001d9d82828562001d24565b6020601f83116001811462001dd4576000841562001dbb5750858201515b600019600886021c198116600286021786555062001e30565b600085815260208120601f198616915b8281101562001e06578885015182556020948501946001909201910162001de4565b8683101562001e235784890151600019601f89166008021c191682555b6001600288020188555050505b505050505050565b6143738062001e486000396000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c806366ae767b1161011a578063a217fddf116100ad578063d53913931161007c578063d53913931461045d578063d547741f14610484578063d8e5754214610497578063de836ebd146104aa578063e985e9c5146104bd57600080fd5b8063a217fddf1461041c578063a22cb46514610424578063b88d4fde14610437578063c87b56dd1461044a57600080fd5b80637d1cad0a116100e95780637d1cad0a146103e657806391d14854146103ee57806395d89b41146104015780639ab5a9461461040957600080fd5b806366ae767b14610379578063692ad6e71461038c57806370a08231146103ac57806371372544146103bf57600080fd5b8063248a9ca311610192578063373807ae11610161578063373807ae1461032d57806342842e0e146103405780634f6ccce7146103535780636352211e1461036657600080fd5b8063248a9ca3146102d15780632f2ff15d146102f45780632f745c591461030757806336568abe1461031a57600080fd5b8063095ea7b3116101ce578063095ea7b31461027157806318160ddd146102865780631be0e1951461029757806323b872dd146102be57600080fd5b806301ffc9a714610200578063061ba2f11461022957806306fdde0314610249578063081812fc14610251575b600080fd5b61021361020e36600461277d565b6104f9565b60405161022091906127a8565b60405180910390f35b61023c6102373660046127c7565b61050a565b604051610220919061283e565b61023c6106fa565b61026461025f3660046127c7565b61078c565b6040516102209190612869565b61028461027f36600461288b565b6107b3565b005b6008545b60405161022091906128ce565b61028a7f6ae19fd703cb304b53d5f09f6a0ce96b7c6a7edd912859ca6c4ed719bcab610d81565b6102846102cc3660046128dc565b610838565b61028a6102df3660046127c7565b6000908152600a602052604090206001015490565b61028461030236600461292c565b610869565b61028a61031536600461288b565b61088e565b61028461032836600461292c565b6108e0565b61028461033b3660046129b1565b610916565b61028461034e3660046128dc565b6109cc565b61028a6103613660046127c7565b6109e7565b6102646103743660046127c7565b610a35565b610284610387366004612a2a565b610a6a565b600b5461039f906001600160a01b031681565b6040516102209190612a6a565b61028a6103ba366004612a2a565b610a98565b61028a7fcf6f9f892731e14b8859835f2ff35575f447fb501f46243c4eb8bac19e31a05081565b610284610adc565b6102136103fc36600461292c565b610af9565b61023c610b24565b610284610417366004612a8b565b610b33565b61028a600081565b610284610432366004612aac565b610b71565b610284610445366004612bd2565b610b7c565b61023c6104583660046127c7565b610bb4565b61028a7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b61028461049236600461292c565b6115c9565b6102846104a5366004612c51565b6115ee565b6102846104b8366004612c51565b611665565b6102136104cb366004612cad565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6000610504826116c4565b92915050565b606060008211801561051e57506127108211155b6105435760405162461bcd60e51b815260040161053a90612d06565b60405180910390fd5b60008281526018602052604081205461055b906116e9565b90506000816001602002015160ff16158061057d5750602082015160ff166001145b61059657604051806020016040528060008152506105b0565b6040518060c00160405280609d81526020016142a1609d91395b90506000826001602002015160ff166001146105db57604051806020016040528060008152506105f8565b60405180610180016040528061014c815260200161415561014c91395b90506106038561174b565b61060d86856117df565b845160ff9081166000908152601060209081526040808320828a01518516845260118352818420828b0151861685526012845282852060608c0151871686526013855283862060808d0151881687526014865284872060a08e0151891688526015875285882060c08f0151909916885260169096529386206001938401979284019691840195948401948c94908101938c9390820192909101906017908f6007602002015160ff1681526020019081526020016000206001016040516020016106e19c9b9a99989796959493929190612e48565b6040516020818303038152906040529350505050919050565b60606000805461070990612d85565b80601f016020809104026020016040519081016040528092919081815260200182805461073590612d85565b80156107825780601f1061075757610100808354040283529160200191610782565b820191906000526020600020905b81548152906001019060200180831161076557829003601f168201915b5050505050905090565b6000610797826118d9565b506000908152600460205260409020546001600160a01b031690565b60006107be82610a35565b9050806001600160a01b0316836001600160a01b0316036107f15760405162461bcd60e51b815260040161053a906133cd565b336001600160a01b038216148061080d575061080d81336104cb565b6108295760405162461bcd60e51b815260040161053a90613437565b6108338383611910565b505050565b610842338261197e565b61085e5760405162461bcd60e51b815260040161053a90613491565b6108338383836119fd565b6000828152600a602052604090206001015461088481611b32565b6108338383611b3c565b600061089983610a98565b82106108b75760405162461bcd60e51b815260040161053a906134e9565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6001600160a01b03811633146109085760405162461bcd60e51b815260040161053a90613545565b6109128282611bc2565b5050565b600061092181611b32565b601954610100900460ff16156109495760405162461bcd60e51b815260040161053a9061357a565b8382146109685760405162461bcd60e51b815260040161053a906135be565b60005b848110156109c45783838281811061098557610985612d16565b90506020020135601860008888858181106109a2576109a2612d16565b602090810292909201358352508101919091526040016000205560010161096b565b505050505050565b61083383838360405180602001604052806000815250610b7c565b60006109f260085490565b8210610a105760405162461bcd60e51b815260040161053a90613617565b60088281548110610a2357610a23612d16565b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b0316806105045760405162461bcd60e51b815260040161053a9061365b565b6000610a7581611b32565b50600b80546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b038216610ac05760405162461bcd60e51b815260040161053a906136b1565b506001600160a01b031660009081526003602052604090205490565b6000610ae781611b32565b506019805461ff001916610100179055565b6000918252600a602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606001805461070990612d85565b7f6ae19fd703cb304b53d5f09f6a0ce96b7c6a7edd912859ca6c4ed719bcab610d610b5d81611b32565b506019805460ff1916911515919091179055565b610912338383611c29565b610b86338361197e565b610ba25760405162461bcd60e51b815260040161053a90613491565b610bae84848484611ccb565b50505050565b6060600082118015610bc857506127108211155b610be45760405162461bcd60e51b815260040161053a906136f5565b600082815260186020526040812054610bfc906116e9565b604080516101008101808352835160ff16600090815260106020528381206101408401909452835460a01b6001600160a01b03191682526001840180549596509094929384939091610120850191610c5390612d85565b80601f0160208091040260200160405190810160405280929190818152602001828054610c7f90612d85565b8015610ccc5780601f10610ca157610100808354040283529160200191610ccc565b820191906000526020600020905b815481529060010190602001808311610caf57829003601f168201915b50505091909252505050815260208481015160ff166000908152601182526040908190208151808301909252805460a01b6001600160a01b0319168252600181018054948401949293919291840191610d2490612d85565b80601f0160208091040260200160405190810160405280929190818152602001828054610d5090612d85565b8015610d9d5780601f10610d7257610100808354040283529160200191610d9d565b820191906000526020600020905b815481529060010190602001808311610d8057829003601f168201915b50505091909252505050815260408481015160ff16600090815260126020908152908290208251808401909352805460a01b6001600160a01b0319168352600181018054948301949192840191610df390612d85565b80601f0160208091040260200160405190810160405280929190818152602001828054610e1f90612d85565b8015610e6c5780601f10610e4157610100808354040283529160200191610e6c565b820191906000526020600020905b815481529060010190602001808311610e4f57829003601f168201915b505050919092525050508152606084015160ff166000908152601360209081526040918290208251808401909352805460a01b6001600160a01b0319168352600181018054948301949192840191610ec390612d85565b80601f0160208091040260200160405190810160405280929190818152602001828054610eef90612d85565b8015610f3c5780601f10610f1157610100808354040283529160200191610f3c565b820191906000526020600020905b815481529060010190602001808311610f1f57829003601f168201915b505050919092525050508152608084015160ff166000908152601460209081526040918290208251808401909352805460a01b6001600160a01b0319168352600181018054948301949192840191610f9390612d85565b80601f0160208091040260200160405190810160405280929190818152602001828054610fbf90612d85565b801561100c5780601f10610fe15761010080835404028352916020019161100c565b820191906000526020600020905b815481529060010190602001808311610fef57829003601f168201915b50505091909252505050815260a08481015160ff166000908152601560209081526040918290208251808401909352805490931b6001600160a01b0319168252600183018054948201949293929184019161106690612d85565b80601f016020809104026020016040519081016040528092919081815260200182805461109290612d85565b80156110df5780601f106110b4576101008083540402835291602001916110df565b820191906000526020600020905b8154815290600101906020018083116110c257829003601f168201915b50505091909252505050815260c084015160ff166000908152601660209081526040918290208251808401909352805460a01b6001600160a01b031916835260018101805494830194919284019161113690612d85565b80601f016020809104026020016040519081016040528092919081815260200182805461116290612d85565b80156111af5780601f10611184576101008083540402835291602001916111af565b820191906000526020600020905b81548152906001019060200180831161119257829003601f168201915b50505091909252505050815260e084015160ff166000908152601760209081526040918290208251808401909352805460a01b6001600160a01b031916835260018101805494830194919284019161120690612d85565b80601f016020809104026020016040519081016040528092919081815260200182805461123290612d85565b801561127f5780601f106112545761010080835404028352916020019161127f565b820191906000526020600020905b81548152906001019060200180831161126257829003601f168201915b5050505050815250508152509050606060006040518061010001604052806040518060400160405280600681526020016514dc1a5c9a5d60d21b8152508152602001604051806040016040528060048152602001634361706560e01b815250815260200160405180604001604052806005815260200164546f72736f60d81b81525081526020016040518060400160405280600481526020016341726d7360e01b8152508152602001604051806040016040528060048152602001634d61736b60e01b81525081526020016040518060400160405280600581526020016409adeeae8d60db1b815250815260200160405180604001604052806007815260200166426f74746f6d7360c81b815250815260200160405180604001604052806005815260200164426f6f747360d81b815250815250905060005b6008811015611492578381600881106113d3576113d3612d16565b6020020151516001600160a01b0319161561148a5782835160001461141357604051806040016040528060038152602001622c207b60e81b81525061142e565b604051806040016040528060018152602001607b60f81b8152505b83836008811061144057611440612d16565b602002015161146587856008811061145a5761145a612d16565b602002015151611cfe565b604051602001611478949392919061375d565b60405160208183030381529060405292505b6001016113b8565b5060195460009060ff166114b5576040518060200160405280600081525061152c565b600b5460405163e1090cff60e01b81526001600160a01b039091169063e1090cff906114e79030908b906004016137ce565b600060405180830381865afa158015611504573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261152c9190810190613841565b9050600080825111611565576115418861174b565b6040516020016115519190613893565b604051602081830303815290604052611567565b815b905061159d816115768a61050a565b86604051602001611589939291906138fe565b604051602081830303815290604052611e35565b6040516020016115ad9190613a4a565b6040516020818303038152906040529650505050505050919050565b6000828152600a60205260409020600101546115e481611b32565b6108338383611bc2565b7fcf6f9f892731e14b8859835f2ff35575f447fb501f46243c4eb8bac19e31a05061161881611b32565b60005b8281101561165e57611656308686868581811061163a5761163a612d16565b9050602002013560405180602001604052806000815250611ccb565b60010161161b565b5050505050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a661168f81611b32565b60005b8281101561165e576116bc858585848181106116b0576116b0612d16565b90506020020135611f9f565b600101611692565b60006001600160e01b03198216637965db0b60e01b14806105045750610504826120a8565b6116f161273c565b6116f961273c565b60005b600c81101561174457611710600a85613a8e565b8282600c811061172257611722612d16565b60ff909216602092909202015261173a600a85613ab8565b93506001016116fc565b5092915050565b60606000611758836120cd565b600101905060008167ffffffffffffffff81111561177857611778612adf565b6040519080825280601f01601f1916602001820160405280156117a2576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846117ac575b509392505050565b60606117ea8361174b565b600c836008602002015160ff168154811061180757611807612d16565b9060005260206000200161181a8561174b565b600d856009602002015160ff168154811061183757611837612d16565b9060005260206000200161184a8761174b565b600e87600a602002015160ff168154811061186757611867612d16565b9060005260206000200161187a8961174b565b600f89600b602002015160ff168154811061189757611897612d16565b906000526020600020016118aa8b61174b565b6040516020016118c299989796959493929190613b5a565b604051602081830303815290604052905092915050565b6000818152600260205260409020546001600160a01b031661190d5760405162461bcd60e51b815260040161053a9061365b565b50565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061194582610a35565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061198a83610a35565b9050806001600160a01b0316846001600160a01b031614806119d157506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806119f55750836001600160a01b03166119ea8461078c565b6001600160a01b0316145b949350505050565b826001600160a01b0316611a1082610a35565b6001600160a01b031614611a365760405162461bcd60e51b815260040161053a90613d98565b6001600160a01b038216611a5c5760405162461bcd60e51b815260040161053a90613de9565b611a6983838360016121a5565b826001600160a01b0316611a7c82610a35565b6001600160a01b031614611aa25760405162461bcd60e51b815260040161053a90613d98565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b61190d8133612284565b611b468282610af9565b610912576000828152600a602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611b7e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611bcc8282610af9565b15610912576000828152600a602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b816001600160a01b0316836001600160a01b031603611c5a5760405162461bcd60e51b815260040161053a90613e2d565b6001600160a01b0383811660008181526005602090815260408083209487168084529490915290819020805460ff1916851515179055517f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190611cbe9085906127a8565b60405180910390a3505050565b611cd68484846119fd565b611ce2848484846122dd565b610bae5760405162461bcd60e51b815260040161053a90613e8c565b606060005b600c8160ff16108015611d375750828160ff16600c8110611d2657611d26612d16565b1a60f81b6001600160f81b03191615155b15611d4e5780611d4681613e9c565b915050611d03565b60008160ff1667ffffffffffffffff811115611d6c57611d6c612adf565b6040519080825280601f01601f191660200182016040528015611d96576020820181803683370190505b509050600091505b600c8260ff16108015611dd25750838260ff16600c8110611dc157611dc1612d16565b1a60f81b6001600160f81b03191615155b15611e2e57838260ff16600c8110611dec57611dec612d16565b1a60f81b818360ff1681518110611e0557611e05612d16565b60200101906001600160f81b031916908160001a90535081611e2681613e9c565b925050611d9e565b9392505050565b80516060906000819003611e59575050604080516020810190915260008152919050565b60006003611e68836002613eb2565b611e729190613ab8565b611e7d906004613ec5565b90506000611e8c826020613eb2565b67ffffffffffffffff811115611ea457611ea4612adf565b6040519080825280601f01601f191660200182016040528015611ece576020820181803683370190505b5090506000604051806060016040528060408152602001614115604091399050600181016020830160005b86811015611f5a576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b835260049092019101611ef9565b506003860660018114611f745760028114611f8557611f91565b613d3d60f01b600119830152611f91565b603d60f81b6000198301525b505050918152949350505050565b6001600160a01b038216611fc55760405162461bcd60e51b815260040161053a90613f0f565b6000818152600260205260409020546001600160a01b031615611ffa5760405162461bcd60e51b815260040161053a90613f53565b6120086000838360016121a5565b6000818152600260205260409020546001600160a01b03161561203d5760405162461bcd60e51b815260040161053a90613f53565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160e01b0319821663780e9d6360e01b14806105045750610504826123de565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b831061210c5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612138576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061215657662386f26fc10000830492506010015b6305f5e100831061216e576305f5e100830492506008015b612710831061218257612710830492506004015b60648310612194576064830492506002015b600a83106105045760010192915050565b60018111156121c65760405162461bcd60e51b815260040161053a90613fb5565b816001600160a01b0385166122225761221d81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612245565b836001600160a01b0316856001600160a01b03161461224557612245858261242e565b6001600160a01b0384166122615761225c816124cb565b61165e565b846001600160a01b0316846001600160a01b03161461165e5761165e848261257a565b61228e8282610af9565b6109125761229b816125be565b6122a68360206125d0565b6040516020016122b7929190613fe3565b60408051601f198184030181529082905262461bcd60e51b825261053a9160040161283e565b60006001600160a01b0384163b156123d357604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061232190339089908890889060040161402c565b6020604051808303816000875af192505050801561235c575060408051601f3d908101601f1916820190925261235991810190614071565b60015b6123b9573d80801561238a576040519150601f19603f3d011682016040523d82523d6000602084013e61238f565b606091505b5080516000036123b15760405162461bcd60e51b815260040161053a90613e8c565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506119f5565b506001949350505050565b60006001600160e01b031982166380ac58cd60e01b148061240f57506001600160e01b03198216635b5e139f60e01b145b8061050457506301ffc9a760e01b6001600160e01b0319831614610504565b6000600161243b84610a98565b6124459190614092565b600083815260076020526040902054909150808214612498576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008546000906124dd90600190614092565b6000838152600960205260408120546008805493945090928490811061250557612505612d16565b90600052602060002001549050806008838154811061252657612526612d16565b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061255e5761255e6140a5565b6001900381819060005260206000200160009055905550505050565b600061258583610a98565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60606105046001600160a01b03831660145b606060006125df836002613ec5565b6125ea906002613eb2565b67ffffffffffffffff81111561260257612602612adf565b6040519080825280601f01601f19166020018201604052801561262c576020820181803683370190505b509050600360fc1b8160008151811061264757612647612d16565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061267657612676612d16565b60200101906001600160f81b031916908160001a905350600061269a846002613ec5565b6126a5906001613eb2565b90505b600181111561271d576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106126d9576126d9612d16565b1a60f81b8282815181106126ef576126ef612d16565b60200101906001600160f81b031916908160001a90535060049490941c93612716816140bb565b90506126a8565b508315611e2e5760405162461bcd60e51b815260040161053a90614104565b604051806101800160405280600c906020820280368337509192915050565b6001600160e01b031981165b811461190d57600080fd5b80356105048161275b565b60006020828403121561279257612792600080fd5b60006119f58484612772565b8015155b82525050565b60208101610504828461279e565b80612767565b8035610504816127b6565b6000602082840312156127dc576127dc600080fd5b60006119f584846127bc565b60005b838110156128035781810151838201526020016127eb565b50506000910152565b6000612816825190565b80845260208401935061282d8185602086016127e8565b601f01601f19169290920192915050565b60208082528101611e2e818461280c565b60006001600160a01b038216610504565b6127a28161284f565b602081016105048284612860565b6127678161284f565b803561050481612877565b600080604083850312156128a1576128a1600080fd5b60006128ad8585612880565b92505060206128be858286016127bc565b9150509250929050565b806127a2565b6020810161050482846128c8565b6000806000606084860312156128f4576128f4600080fd5b60006129008686612880565b935050602061291186828701612880565b9250506040612922868287016127bc565b9150509250925092565b6000806040838503121561294257612942600080fd5b600061294e85856127bc565b92505060206128be85828601612880565b60008083601f84011261297457612974600080fd5b50813567ffffffffffffffff81111561298f5761298f600080fd5b6020830191508360208202830111156129aa576129aa600080fd5b9250929050565b600080600080604085870312156129ca576129ca600080fd5b843567ffffffffffffffff8111156129e4576129e4600080fd5b6129f08782880161295f565b9450945050602085013567ffffffffffffffff811115612a1257612a12600080fd5b612a1e8782880161295f565b95989497509550505050565b600060208284031215612a3f57612a3f600080fd5b60006119f58484612880565b60006105048261284f565b600061050482612a4b565b6127a281612a56565b602081016105048284612a61565b801515612767565b803561050481612a78565b600060208284031215612aa057612aa0600080fd5b60006119f58484612a80565b60008060408385031215612ac257612ac2600080fd5b6000612ace8585612880565b92505060206128be85828601612a80565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715612b1b57612b1b612adf565b6040525050565b6000612b2d60405190565b9050612b398282612af5565b919050565b600067ffffffffffffffff821115612b5857612b58612adf565b601f19601f83011660200192915050565b82818337506000910152565b6000612b88612b8384612b3e565b612b22565b905082815260208101848484011115612ba357612ba3600080fd5b6117d7848285612b69565b600082601f830112612bc257612bc2600080fd5b81356119f5848260208601612b75565b60008060008060808587031215612beb57612beb600080fd5b6000612bf78787612880565b9450506020612c0887828801612880565b9350506040612c19878288016127bc565b925050606085013567ffffffffffffffff811115612c3957612c39600080fd5b612c4587828801612bae565b91505092959194509250565b600080600060408486031215612c6957612c69600080fd5b6000612c758686612880565b935050602084013567ffffffffffffffff811115612c9557612c95600080fd5b612ca18682870161295f565b92509250509250925092565b60008060408385031215612cc357612cc3600080fd5b600061294e8585612880565b601c81526000602082017f696d616765446174613a204e6f6e6578697374656e7420746f6b656e00000000815291505b5060200190565b6020808252810161050481612ccf565b634e487b7160e01b600052603260045260246000fd5b701e39bb339034b21e93b63ab1b430b6b7b760791b815260005b5060110190565b6000612d57825190565b612d658185602086016127e8565b9290920192915050565b634e487b7160e01b600052602260045260246000fd5b600281046001821680612d9957607f821691505b602082108103612dab57612dab612d6f565b50919050565b60008154612dbe81612d85565b600182168015612dd55760018114612dea57612e1a565b60ff1983168652811515820286019350612e1a565b60008581526020902060005b83811015612e1257815488820152600190910190602001612df6565b838801955050505b50505092915050565b741e339031b630b9b99e93b63ab1b43096b0b63a139f60591b815260005b5060150190565b6000612e5382612d2c565b9150612e5f828f612d4d565b7f2720786d6c6e733d27687474703a2f2f7777772e77332e6f72672f323030302f81527f737667272076696577426f783d27302030203234203234273e0000000000000060208201526039019150612eb7828e612d4d565b7f3c6720636c6173733d276c756368612d62726561746865273e0000000000000081526019019150612ee9828d612db1565b9150612ef5828c612db1565b7f3c7061746820636c6173733d276c756368612d736b696e2720643d274d32322081527f3132762d31682d31762d31682d315639682d315635682d315633682d3156326860208201527f2d315631682d315630483976314838763148377631483676324835763448347660408201527f314833763148327631483176386834762d316831762d324835762d336831763160608201527f68317631683176326838762d326831762d316831762d3168317633682d31763260808201526c3418bb18b41a3b169c3d13979f60991b60a082015260ad019150612fd5828b612db1565b9150612fe1828a612db1565b9150612fed8289612d4d565b7f3c7061746820636c6173733d276c756368612d626173652720643d274d31382081527f355633682d315632682d315631682d315630483976314838763148377631483660208201527f763248357635683176326831763168317631683176316836762d316831762d316040820152713418bb1698b418bb16993418ab1abd13979f60711b6060820152607201915061308582612e23565b91506130918288612db1565b631e17b39f60e11b815260040191506130aa8287612d4d565b7f3c706174682066696c6c3d27234646462720643d274d3920364836763368345681527f367a4d31372036682d337633683456367a272f3e3c7061746820636c6173733d60208201527f276c756368612d657965732720643d274d31362036682d327633683356367a4d60408201527f382036483776336833563648397a272f3e3c706174682066696c6c3d2723464660608201527f462720643d274d3720366831763148377a4d3136203668317631682d317a272060808201527f6f7061636974793d272e34272f3e3c706174682066696c6c3d2723303030272060a08201527f643d274d3135203768317631682d317a4d3820376831763148387a272f3e000060c08201527f3c7061746820636c6173733d276c756368612d736b696e2720643d274d31342060de8201526e1898241cbb19b41b3b1699bd13979f60891b60fe8201527f3c706174682066696c6c3d272330303027206f7061636974793d272e3927206461010d820152751e93a69899901898b41699bb18b41a3b1698bd13979f60511b61012d8201526101430191506132468286612db1565b631e17b39f60e11b81527f3c7061746820636c6173733d276c756368612d736b696e2720643d274d31362060048201527f3233762d3648387636483776316834762d34683276346834762d317a272f3e0060248201527f3c7061746820636c6173733d276c756368612d626173652720643d274d31352060438201527f31374838763168317631683276316832762d316832762d316831762d317a272f6063820152601f60f91b608382015260840191506133018285612db1565b7f3c7061746820636c6173733d276c756368612d626173652720643d274d39203281527f3148387632483776316834762d33682d317a4d3136203233762d32682d337633602082015268341a3b1698bd13979f60b91b6040820152604901915061336b8284612db1565b651e17b9bb339f60d11b81526006019e9d5050505050505050505050505050565b602181526000602082017f4552433732313a20617070726f76616c20746f2063757272656e74206f776e658152603960f91b602082015291505b5060400190565b602080825281016105048161338c565b603d81526000602082017f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f81527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000602082015291506133c6565b60208082528101610504816133dd565b602d81526000602082017f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6581526c1c881bdc88185c1c1c9bdd9959609a1b602082015291506133c6565b6020808252810161050481613447565b602b81526000602082017f455243373231456e756d657261626c653a206f776e657220696e646578206f7581526a74206f6620626f756e647360a81b602082015291506133c6565b60208082528101610504816134a1565b602f81526000602082017f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636581526e103937b632b9903337b91039b2b63360891b602082015291506133c6565b60208082528101610504816134f9565b600e81526000602082016d1cd95d1113904e881b1bd8dad95960921b81529150612cff565b6020808252810161050481613555565b601a81526000602082017f4172726179206c656e6774687320646f206e6f74206d6174636800000000000081529150612cff565b602080825281016105048161358a565b602c81526000602082017f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f81526b7574206f6620626f756e647360a01b602082015291506133c6565b60208082528101610504816135ce565b601881526000602082017f4552433732313a20696e76616c696420746f6b656e204944000000000000000081529150612cff565b6020808252810161050481613627565b602981526000602082017f4552433732313a2061646472657373207a65726f206973206e6f7420612076618152683634b21037bbb732b960b91b602082015291506133c6565b602080825281016105048161366b565b601b81526000602082017f746f6b656e5552493a204e6f6e6578697374656e7420746f6b656e000000000081529150612cff565b60208082528101610504816136c1565b6e113a3930b4ba2fba3cb832911d101160891b815260005b50600f0190565b69113b30b63ab2911d101160b11b815260005b50600a0190565b601160f91b815260005b5060010190565b607d60f81b81526000613748565b60006137698287612d4d565b91506137758286612d4d565b915061378082613705565b915061378c8285612d4d565b61088b60f21b815260020191506137a282613724565b91506137ae8284612d4d565b91506137b98261373e565b91506137c48261374f565b9695505050505050565b604081016137dc8285612860565b611e2e60208301846128c8565b60006137f7612b8384612b3e565b90508281526020810184848401111561381257613812600080fd5b6117d78482856127e8565b600082601f83011261383157613831600080fd5b81516119f58482602086016137e9565b60006020828403121561385657613856600080fd5b815167ffffffffffffffff81111561387057613870600080fd5b6119f58482850161381d565b694c756368616d6f6e202360b01b81526000613737565b600061389e8261387c565b9150611e2e8284612d4d565b607b60f81b81526000613748565b6e1134b6b0b3b2afb230ba30911d101160891b8152600061371d565b6e2261747472696275746573223a205b60881b8152600061371d565b605d60f81b81526000613748565b6000613909826138aa565b68113730b6b2911d101160b91b815260090191506139278286612d4d565b61088b60f21b81527f226465736372697074696f6e223a20224c756368616d6f6e207765726520726160028201527f6e646f6d6c792067656e657261746564207573696e6720436861696e6c696e6b60228201527f2056524620616e6420686176652031303025206f6e2d636861696e206172742060428201526e185b99081b595d1859185d1848488b608a1b606282015260710191506139c7826138b8565b91506139d38285612d4d565b61088b60f21b81527f2265787465726e616c5f75726c223a202268747470733a2f2f6c756368616d6f6002820152661b8b98dbdb488b60ca1b60228201526029019150613a1f826138d4565b9150613a2b8284612d4d565b9150613a36826138f0565b9150613a418261374f565b95945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000601d820161389e565b634e487b7160e01b600052601260045260246000fd5b600082613a9d57613a9d613a78565b500690565b634e487b7160e01b600052601160045260246000fd5b600082613ac757613ac7613a78565b500490565b75202e6c756368612d62617365207b2066696c6c3a202360501b815260005b5060160190565b74202e6c756368612d616c74207b2066696c6c3a202360581b81526000612e41565b75202e6c756368612d65796573207b2066696c6c3a202360501b81526000613aeb565b75202e6c756368612d736b696e207b2066696c6c3a202360501b81526000613aeb565b6f1e39ba3cb6329f11b63ab1b430b6b7b760811b81526010016000613b7f828c612d4d565b9150613b8a82613acc565b9150613b96828b612db1565b6c1d903e9011b63ab1b430b6b7b760991b8152600d019150613bb8828a612d4d565b9150613bc382613af2565b9150613bcf8289612db1565b6c1d903e9011b63ab1b430b6b7b760991b8152600d019150613bf18288612d4d565b9150613bfc82613b14565b9150613c088287612db1565b6c1d903e9011b63ab1b430b6b7b760991b8152600d019150613c2a8286612d4d565b9150613c3582613b37565b9150613c418285612db1565b6c1d903e9011b63ab1b430b6b7b760991b8152600d019150613c638284612d4d565b7f202e6c756368612d62726561746865207b20616e696d6174696f6e3a20302e3581527f73206c756368612d6272656174686520696e66696e69746520616c7465726e6160208201527f746520656173652d696e2d6f75743b207d20406b65796672616d6573206c756360408201527f68612d62726561746865207b2066726f6d207b207472616e73666f726d3a207460608201527f72616e736c6174655928307078293b207d20746f207b207472616e73666f726d60808201527f3a207472616e736c61746559283125293b207d207d3c2f7374796c653e00000060a082015260bd019b9a5050505050505050505050565b602581526000602082017f4552433732313a207472616e736665722066726f6d20696e636f72726563742081526437bbb732b960d91b602082015291506133c6565b6020808252810161050481613d56565b602481526000602082017f4552433732313a207472616e7366657220746f20746865207a65726f206164648152637265737360e01b602082015291506133c6565b6020808252810161050481613da8565b601981526000602082017f4552433732313a20617070726f766520746f2063616c6c65720000000000000081529150612cff565b6020808252810161050481613df9565b603281526000602082017f4552433732313a207472616e7366657220746f206e6f6e20455243373231526581527131b2b4bb32b91034b6b83632b6b2b73a32b960711b602082015291506133c6565b6020808252810161050481613e3d565b60ff16600060fe19820161374857613748613aa2565b8082018082111561050457610504613aa2565b81810280821583820485141761174457611744613aa2565b60208082527f4552433732313a206d696e7420746f20746865207a65726f206164647265737391019081526000612cff565b6020808252810161050481613edd565b601c81526000602082017f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000081529150612cff565b6020808252810161050481613f1f565b603581526000602082017f455243373231456e756d657261626c653a20636f6e7365637574697665207472815274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b602082015291506133c6565b6020808252810161050481613f63565b7001034b99036b4b9b9b4b733903937b6329607d1b81526000612d46565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260170160006140158285612d4d565b915061402082613fc5565b91506119f58284612d4d565b6080810161403a8287612860565b6140476020830186612860565b61405460408301856128c8565b81810360608301526137c4818461280c565b80516105048161275b565b60006020828403121561408657614086600080fd5b60006119f58484614066565b8181038181111561050457610504613aa2565b634e487b7160e01b600052603160045260246000fd5b6000816140ca576140ca613aa2565b506000190190565b60208082527f537472696e67733a20686578206c656e67746820696e73756666696369656e7491019081526000612cff565b60208082528101610504816140d256fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f3c7061746820636c6173733d276c756368612d616c742720643d274d313820345633682d315632682d315631682d3156304839763148387631483776314836763248357635683156366831563568325634683156336834763168317631683276316831763468315635682d317a272f3e3c672066696c6c3d2723303030273e3c7061746820643d274d313820345633682d315632682d315631682d3156304839763148387631483776314836763248357635683156356831563468315633683156326836763168317631683176316831763568315635682d317a27206f7061636974793d272e32272f3e3c7061746820643d274d313620345633682d31563248397631483876314837763168325634683156336834763168317631683256347a4d3620356831763148367a4d3137203568317631682d317a27206f7061636974793d272e35272f3e3c2f673e3c7061746820636c6173733d276c756368612d616c742720643d274d32302031305639682d327631682d3176316834762d317a4d35203948347631483376316834762d31483656397a272f3e3c706174682066696c6c3d272330303027206f7061636974793d272e322720643d274d36203948347631483376316834762d3148367a4d32302031305639682d327631682d3176316834762d317a272f3ea2646970667358221220e5a4b072207e1d0956d2c91e23c9ef447c215db3459204363b868673fa64cc1064736f6c634300081600333c7061746820636c6173733d276c756368612d626173652720643d274d3232203134682d3376316834762d317a272f3e3c7061746820636c6173733d276c756368612d626173652720643d274d35203136483176336834762d316831762d3148357a4d3232203136682d337631682d317631683176316834762d337a272f3e3c7061746820636c6173733d276c756368612d616c742720643d274d33203136483176316834762d3148347a4d3232203136682d3376316834762d317a272f3e3c7061746820636c6173733d276c756368612d616c742720643d274d39203230483876316833762d31682d317a4d3135203230682d3276316833762d317a272f3e3c7061746820636c6173733d276c756368612d626173652720643d274d3232203134682d3376336834762d337a4d33203134483176336834762d3348347a272f3e3c7061746820636c6173733d276c756368612d616c742720643d274d3232203134682d3376316834762d317a4d33203134483176316834762d3148347a272f3e3c7061746820643d274d313820355633682d315632682d317632682d317631682d317631682d317633682d325636682d31563548395634483856324837763148367632483576346831763168327633683176316836762d316831762d3368325639683156357a272f3e3c7061746820636c6173733d276c756368612d626173652720643d274d3232203132762d31682d31762d31682d315639483476314833763148327631483176356834762d336831763168317631683176326838762d326831762d316831762d31683176336834762d357a272f3e3c7061746820643d274d3232203132762d31682d31762d31682d315639483476314833763148327631483176356834762d336831763168317631683176326838762d326831762d316831762d31683176336834762d357a272066696c6c3d272330303027206f7061636974793d272e3135272f3e3c7061746820643d274d313320335632682d32763268327a4d313320315630682d32763168317a4d313020344839563148387631483776314836763248357635683176326831763168317631683176316831762d324839762d3368325635682d317a4d313820355633682d315632682d315631682d317633682d317631682d31763568327633682d3176326831762d316831762d316831762d316831762d32683156357a272f3e3c7061746820636c6173733d276c756368612d626173652720643d274d3135203137483876336838762d337a272f3e3c7061746820636c6173733d276c756368612d616c742720643d274d31352031387631682d3276346833762d357a4d39203139762d31483876356833762d34682d317a272f3e3c7061746820636c6173733d276c756368612d626173652720643d274d33203135483176326834762d3248347a4d3232203135682d3376326834762d327a272f3e3c7061746820636c6173733d276c756368612d616c742720643d274d34203134483176316834762d317a272f3e3c7061746820636c6173733d276c756368612d626173652720643d274d36203256314835763568315635683156336831563248377a4d313820317631682d3276316831763268317631683156317a272f3e3c672066696c6c3d2723303030273e3c7061746820643d274d3520316831763148357a4d36203276316832563248377a4d3138203168317631682d317a4d31362032763168325632682d317a27206f7061636974793d272e33272f3e3c7061746820643d274d36203356324835763468315635683156337a4d313820327631682d31763268317631683156327a27206f7061636974793d272e32272f3e3c2f673e3c706174682066696c6c3d27234139413138412720643d274d323120325631682d315630682d31763268317631682d3376326832763168325635683156327a4d352033483456326831563048347631483376314832763368317631683256356832563348367a272f3e3c672066696c6c3d272330303027206f7061636974793d272e3135273e3c7061746820643d274d3231203468317631682d317a4d31392035682d31763168335635682d317a272f3e3c7061746820643d274d3220346831763148327a4d342035483376316833563548357a272f3e3c2f673e3c7061746820643d274d313820355633682d315632682d315631682d3156304839763148387631483776314836763248357635683176326831763168317631683176316831762d3468315635483956336831563268315631683276316831763168317632682d327636683176346831762d316831762d316831762d316831762d32683156357a272f3e3c7061746820643d274d31342032682d315630682d327632483976326832763468325634683256327a4d3132203133682d3176326832762d327a272f3e3c7061746820636c6173733d276c756368612d626173652720643d274d34203134483176316834762d317a4d3232203134682d3376316834762d317a272f3e3c7061746820636c6173733d276c756368612d626173652720643d274d31302039483476314833763148327631483176336834762d31683176316831763168317632683356397a4d3232203132762d31682d31762d31682d315639682d3776396833762d326831762d316831762d31683176316834762d337a272f3e3c7061746820643d274d31302039483476314833763148327631483176336834762d31683176316831763168317632683356397a4d3232203132762d31682d31762d31682d315639682d3776396833762d326831762d316831762d31683176316834762d337a272066696c6c3d272330303027206f7061636974793d272e3135272f3e3c7061746820636c6173733d276c756368612d616c742720643d274d323020313148337631326831762d316832762d3168313276316832763168315631317a272f3e3c672066696c6c3d2723303030273e3c70617468206f7061636974793d272e322720643d274d323020313176313268315631317a4d33203132763131683156313148337a272f3e3c70617468206f7061636974793d272e352720643d274d313920313148347631316832762d31683132763168325631317a272f3e3c2f673e3c7061746820643d274d31312030483976314838763148377631483676324835763568317632683176316831763168317631683356307a272f3e3c7061746820636c6173733d276c756368612d616c742720643d274d3135203137483876366833762d33683276336833762d367a272f3e3c7061746820643d274d313120326832563168315630682d34763168317a4d3620313076326831762d316831762d3148377a4d3137203130682d317631683176316831762d327a272f3e3c7061746820643d274d3136203368315632682d315631682d317631682d317631682d317631682d325633682d3156324839563148387631483776316831763168317631683176316831763968325636683156356831563468317a272f3e3c7061746820636c6173733d276c756368612d626173652720643d274d313620394837763368312d317634683176316838762d316831762d34682d31203156397a272f3e3c706174682066696c6c3d272330303027206f7061636974793d272e31352720643d274d3136203948377637683176316838762d31683156397a272f3e3c7061746820643d274d313720337631682d327631682d317631682d317633683556337a4d313120385636682d31563548395634483756334836763668357a4d313120313376326832762d32682d317a272f3e3c7061746820636c6173733d276c756368612d616c742720643d274d3920323248387631483776316834762d32682d317a4d3136203233762d31682d3376326834762d317a272f3e3c706174682066696c6c3d272334323163303327206f7061636974793d272e392720643d274d3134203130483976336831762d32683476326831762d337a272f3e3c7061746820636c6173733d276c756368612d626173652720643d274d313520397639683156397a4d3820313076386831563948387a272f3e3c7061746820643d274d3820313076386831563948387a4d313520397639683156397a272066696c6c3d272330303027206f7061636974793d272e3135272f3e3c7061746820643d274d313820355633682d315632682d317631682d317631682d317631682d317631682d325635682d3156344839563348385632483776314836763248357635683176326831762d316831762d31683356396832763168337631683176316831762d32683156357a272f3e3c7061746820643d274d31332033682d335632683156316831563048397631483876314837763148367632683376314838763248377632683156396831563868315637683156366831563568315634683156337a272f3e
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c806366ae767b1161011a578063a217fddf116100ad578063d53913931161007c578063d53913931461045d578063d547741f14610484578063d8e5754214610497578063de836ebd146104aa578063e985e9c5146104bd57600080fd5b8063a217fddf1461041c578063a22cb46514610424578063b88d4fde14610437578063c87b56dd1461044a57600080fd5b80637d1cad0a116100e95780637d1cad0a146103e657806391d14854146103ee57806395d89b41146104015780639ab5a9461461040957600080fd5b806366ae767b14610379578063692ad6e71461038c57806370a08231146103ac57806371372544146103bf57600080fd5b8063248a9ca311610192578063373807ae11610161578063373807ae1461032d57806342842e0e146103405780634f6ccce7146103535780636352211e1461036657600080fd5b8063248a9ca3146102d15780632f2ff15d146102f45780632f745c591461030757806336568abe1461031a57600080fd5b8063095ea7b3116101ce578063095ea7b31461027157806318160ddd146102865780631be0e1951461029757806323b872dd146102be57600080fd5b806301ffc9a714610200578063061ba2f11461022957806306fdde0314610249578063081812fc14610251575b600080fd5b61021361020e36600461277d565b6104f9565b60405161022091906127a8565b60405180910390f35b61023c6102373660046127c7565b61050a565b604051610220919061283e565b61023c6106fa565b61026461025f3660046127c7565b61078c565b6040516102209190612869565b61028461027f36600461288b565b6107b3565b005b6008545b60405161022091906128ce565b61028a7f6ae19fd703cb304b53d5f09f6a0ce96b7c6a7edd912859ca6c4ed719bcab610d81565b6102846102cc3660046128dc565b610838565b61028a6102df3660046127c7565b6000908152600a602052604090206001015490565b61028461030236600461292c565b610869565b61028a61031536600461288b565b61088e565b61028461032836600461292c565b6108e0565b61028461033b3660046129b1565b610916565b61028461034e3660046128dc565b6109cc565b61028a6103613660046127c7565b6109e7565b6102646103743660046127c7565b610a35565b610284610387366004612a2a565b610a6a565b600b5461039f906001600160a01b031681565b6040516102209190612a6a565b61028a6103ba366004612a2a565b610a98565b61028a7fcf6f9f892731e14b8859835f2ff35575f447fb501f46243c4eb8bac19e31a05081565b610284610adc565b6102136103fc36600461292c565b610af9565b61023c610b24565b610284610417366004612a8b565b610b33565b61028a600081565b610284610432366004612aac565b610b71565b610284610445366004612bd2565b610b7c565b61023c6104583660046127c7565b610bb4565b61028a7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b61028461049236600461292c565b6115c9565b6102846104a5366004612c51565b6115ee565b6102846104b8366004612c51565b611665565b6102136104cb366004612cad565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6000610504826116c4565b92915050565b606060008211801561051e57506127108211155b6105435760405162461bcd60e51b815260040161053a90612d06565b60405180910390fd5b60008281526018602052604081205461055b906116e9565b90506000816001602002015160ff16158061057d5750602082015160ff166001145b61059657604051806020016040528060008152506105b0565b6040518060c00160405280609d81526020016142a1609d91395b90506000826001602002015160ff166001146105db57604051806020016040528060008152506105f8565b60405180610180016040528061014c815260200161415561014c91395b90506106038561174b565b61060d86856117df565b845160ff9081166000908152601060209081526040808320828a01518516845260118352818420828b0151861685526012845282852060608c0151871686526013855283862060808d0151881687526014865284872060a08e0151891688526015875285882060c08f0151909916885260169096529386206001938401979284019691840195948401948c94908101938c9390820192909101906017908f6007602002015160ff1681526020019081526020016000206001016040516020016106e19c9b9a99989796959493929190612e48565b6040516020818303038152906040529350505050919050565b60606000805461070990612d85565b80601f016020809104026020016040519081016040528092919081815260200182805461073590612d85565b80156107825780601f1061075757610100808354040283529160200191610782565b820191906000526020600020905b81548152906001019060200180831161076557829003601f168201915b5050505050905090565b6000610797826118d9565b506000908152600460205260409020546001600160a01b031690565b60006107be82610a35565b9050806001600160a01b0316836001600160a01b0316036107f15760405162461bcd60e51b815260040161053a906133cd565b336001600160a01b038216148061080d575061080d81336104cb565b6108295760405162461bcd60e51b815260040161053a90613437565b6108338383611910565b505050565b610842338261197e565b61085e5760405162461bcd60e51b815260040161053a90613491565b6108338383836119fd565b6000828152600a602052604090206001015461088481611b32565b6108338383611b3c565b600061089983610a98565b82106108b75760405162461bcd60e51b815260040161053a906134e9565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6001600160a01b03811633146109085760405162461bcd60e51b815260040161053a90613545565b6109128282611bc2565b5050565b600061092181611b32565b601954610100900460ff16156109495760405162461bcd60e51b815260040161053a9061357a565b8382146109685760405162461bcd60e51b815260040161053a906135be565b60005b848110156109c45783838281811061098557610985612d16565b90506020020135601860008888858181106109a2576109a2612d16565b602090810292909201358352508101919091526040016000205560010161096b565b505050505050565b61083383838360405180602001604052806000815250610b7c565b60006109f260085490565b8210610a105760405162461bcd60e51b815260040161053a90613617565b60088281548110610a2357610a23612d16565b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b0316806105045760405162461bcd60e51b815260040161053a9061365b565b6000610a7581611b32565b50600b80546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b038216610ac05760405162461bcd60e51b815260040161053a906136b1565b506001600160a01b031660009081526003602052604090205490565b6000610ae781611b32565b506019805461ff001916610100179055565b6000918252600a602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606001805461070990612d85565b7f6ae19fd703cb304b53d5f09f6a0ce96b7c6a7edd912859ca6c4ed719bcab610d610b5d81611b32565b506019805460ff1916911515919091179055565b610912338383611c29565b610b86338361197e565b610ba25760405162461bcd60e51b815260040161053a90613491565b610bae84848484611ccb565b50505050565b6060600082118015610bc857506127108211155b610be45760405162461bcd60e51b815260040161053a906136f5565b600082815260186020526040812054610bfc906116e9565b604080516101008101808352835160ff16600090815260106020528381206101408401909452835460a01b6001600160a01b03191682526001840180549596509094929384939091610120850191610c5390612d85565b80601f0160208091040260200160405190810160405280929190818152602001828054610c7f90612d85565b8015610ccc5780601f10610ca157610100808354040283529160200191610ccc565b820191906000526020600020905b815481529060010190602001808311610caf57829003601f168201915b50505091909252505050815260208481015160ff166000908152601182526040908190208151808301909252805460a01b6001600160a01b0319168252600181018054948401949293919291840191610d2490612d85565b80601f0160208091040260200160405190810160405280929190818152602001828054610d5090612d85565b8015610d9d5780601f10610d7257610100808354040283529160200191610d9d565b820191906000526020600020905b815481529060010190602001808311610d8057829003601f168201915b50505091909252505050815260408481015160ff16600090815260126020908152908290208251808401909352805460a01b6001600160a01b0319168352600181018054948301949192840191610df390612d85565b80601f0160208091040260200160405190810160405280929190818152602001828054610e1f90612d85565b8015610e6c5780601f10610e4157610100808354040283529160200191610e6c565b820191906000526020600020905b815481529060010190602001808311610e4f57829003601f168201915b505050919092525050508152606084015160ff166000908152601360209081526040918290208251808401909352805460a01b6001600160a01b0319168352600181018054948301949192840191610ec390612d85565b80601f0160208091040260200160405190810160405280929190818152602001828054610eef90612d85565b8015610f3c5780601f10610f1157610100808354040283529160200191610f3c565b820191906000526020600020905b815481529060010190602001808311610f1f57829003601f168201915b505050919092525050508152608084015160ff166000908152601460209081526040918290208251808401909352805460a01b6001600160a01b0319168352600181018054948301949192840191610f9390612d85565b80601f0160208091040260200160405190810160405280929190818152602001828054610fbf90612d85565b801561100c5780601f10610fe15761010080835404028352916020019161100c565b820191906000526020600020905b815481529060010190602001808311610fef57829003601f168201915b50505091909252505050815260a08481015160ff166000908152601560209081526040918290208251808401909352805490931b6001600160a01b0319168252600183018054948201949293929184019161106690612d85565b80601f016020809104026020016040519081016040528092919081815260200182805461109290612d85565b80156110df5780601f106110b4576101008083540402835291602001916110df565b820191906000526020600020905b8154815290600101906020018083116110c257829003601f168201915b50505091909252505050815260c084015160ff166000908152601660209081526040918290208251808401909352805460a01b6001600160a01b031916835260018101805494830194919284019161113690612d85565b80601f016020809104026020016040519081016040528092919081815260200182805461116290612d85565b80156111af5780601f10611184576101008083540402835291602001916111af565b820191906000526020600020905b81548152906001019060200180831161119257829003601f168201915b50505091909252505050815260e084015160ff166000908152601760209081526040918290208251808401909352805460a01b6001600160a01b031916835260018101805494830194919284019161120690612d85565b80601f016020809104026020016040519081016040528092919081815260200182805461123290612d85565b801561127f5780601f106112545761010080835404028352916020019161127f565b820191906000526020600020905b81548152906001019060200180831161126257829003601f168201915b5050505050815250508152509050606060006040518061010001604052806040518060400160405280600681526020016514dc1a5c9a5d60d21b8152508152602001604051806040016040528060048152602001634361706560e01b815250815260200160405180604001604052806005815260200164546f72736f60d81b81525081526020016040518060400160405280600481526020016341726d7360e01b8152508152602001604051806040016040528060048152602001634d61736b60e01b81525081526020016040518060400160405280600581526020016409adeeae8d60db1b815250815260200160405180604001604052806007815260200166426f74746f6d7360c81b815250815260200160405180604001604052806005815260200164426f6f747360d81b815250815250905060005b6008811015611492578381600881106113d3576113d3612d16565b6020020151516001600160a01b0319161561148a5782835160001461141357604051806040016040528060038152602001622c207b60e81b81525061142e565b604051806040016040528060018152602001607b60f81b8152505b83836008811061144057611440612d16565b602002015161146587856008811061145a5761145a612d16565b602002015151611cfe565b604051602001611478949392919061375d565b60405160208183030381529060405292505b6001016113b8565b5060195460009060ff166114b5576040518060200160405280600081525061152c565b600b5460405163e1090cff60e01b81526001600160a01b039091169063e1090cff906114e79030908b906004016137ce565b600060405180830381865afa158015611504573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261152c9190810190613841565b9050600080825111611565576115418861174b565b6040516020016115519190613893565b604051602081830303815290604052611567565b815b905061159d816115768a61050a565b86604051602001611589939291906138fe565b604051602081830303815290604052611e35565b6040516020016115ad9190613a4a565b6040516020818303038152906040529650505050505050919050565b6000828152600a60205260409020600101546115e481611b32565b6108338383611bc2565b7fcf6f9f892731e14b8859835f2ff35575f447fb501f46243c4eb8bac19e31a05061161881611b32565b60005b8281101561165e57611656308686868581811061163a5761163a612d16565b9050602002013560405180602001604052806000815250611ccb565b60010161161b565b5050505050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a661168f81611b32565b60005b8281101561165e576116bc858585848181106116b0576116b0612d16565b90506020020135611f9f565b600101611692565b60006001600160e01b03198216637965db0b60e01b14806105045750610504826120a8565b6116f161273c565b6116f961273c565b60005b600c81101561174457611710600a85613a8e565b8282600c811061172257611722612d16565b60ff909216602092909202015261173a600a85613ab8565b93506001016116fc565b5092915050565b60606000611758836120cd565b600101905060008167ffffffffffffffff81111561177857611778612adf565b6040519080825280601f01601f1916602001820160405280156117a2576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846117ac575b509392505050565b60606117ea8361174b565b600c836008602002015160ff168154811061180757611807612d16565b9060005260206000200161181a8561174b565b600d856009602002015160ff168154811061183757611837612d16565b9060005260206000200161184a8761174b565b600e87600a602002015160ff168154811061186757611867612d16565b9060005260206000200161187a8961174b565b600f89600b602002015160ff168154811061189757611897612d16565b906000526020600020016118aa8b61174b565b6040516020016118c299989796959493929190613b5a565b604051602081830303815290604052905092915050565b6000818152600260205260409020546001600160a01b031661190d5760405162461bcd60e51b815260040161053a9061365b565b50565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061194582610a35565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061198a83610a35565b9050806001600160a01b0316846001600160a01b031614806119d157506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806119f55750836001600160a01b03166119ea8461078c565b6001600160a01b0316145b949350505050565b826001600160a01b0316611a1082610a35565b6001600160a01b031614611a365760405162461bcd60e51b815260040161053a90613d98565b6001600160a01b038216611a5c5760405162461bcd60e51b815260040161053a90613de9565b611a6983838360016121a5565b826001600160a01b0316611a7c82610a35565b6001600160a01b031614611aa25760405162461bcd60e51b815260040161053a90613d98565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b61190d8133612284565b611b468282610af9565b610912576000828152600a602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611b7e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611bcc8282610af9565b15610912576000828152600a602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b816001600160a01b0316836001600160a01b031603611c5a5760405162461bcd60e51b815260040161053a90613e2d565b6001600160a01b0383811660008181526005602090815260408083209487168084529490915290819020805460ff1916851515179055517f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190611cbe9085906127a8565b60405180910390a3505050565b611cd68484846119fd565b611ce2848484846122dd565b610bae5760405162461bcd60e51b815260040161053a90613e8c565b606060005b600c8160ff16108015611d375750828160ff16600c8110611d2657611d26612d16565b1a60f81b6001600160f81b03191615155b15611d4e5780611d4681613e9c565b915050611d03565b60008160ff1667ffffffffffffffff811115611d6c57611d6c612adf565b6040519080825280601f01601f191660200182016040528015611d96576020820181803683370190505b509050600091505b600c8260ff16108015611dd25750838260ff16600c8110611dc157611dc1612d16565b1a60f81b6001600160f81b03191615155b15611e2e57838260ff16600c8110611dec57611dec612d16565b1a60f81b818360ff1681518110611e0557611e05612d16565b60200101906001600160f81b031916908160001a90535081611e2681613e9c565b925050611d9e565b9392505050565b80516060906000819003611e59575050604080516020810190915260008152919050565b60006003611e68836002613eb2565b611e729190613ab8565b611e7d906004613ec5565b90506000611e8c826020613eb2565b67ffffffffffffffff811115611ea457611ea4612adf565b6040519080825280601f01601f191660200182016040528015611ece576020820181803683370190505b5090506000604051806060016040528060408152602001614115604091399050600181016020830160005b86811015611f5a576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b835260049092019101611ef9565b506003860660018114611f745760028114611f8557611f91565b613d3d60f01b600119830152611f91565b603d60f81b6000198301525b505050918152949350505050565b6001600160a01b038216611fc55760405162461bcd60e51b815260040161053a90613f0f565b6000818152600260205260409020546001600160a01b031615611ffa5760405162461bcd60e51b815260040161053a90613f53565b6120086000838360016121a5565b6000818152600260205260409020546001600160a01b03161561203d5760405162461bcd60e51b815260040161053a90613f53565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160e01b0319821663780e9d6360e01b14806105045750610504826123de565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b831061210c5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612138576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061215657662386f26fc10000830492506010015b6305f5e100831061216e576305f5e100830492506008015b612710831061218257612710830492506004015b60648310612194576064830492506002015b600a83106105045760010192915050565b60018111156121c65760405162461bcd60e51b815260040161053a90613fb5565b816001600160a01b0385166122225761221d81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612245565b836001600160a01b0316856001600160a01b03161461224557612245858261242e565b6001600160a01b0384166122615761225c816124cb565b61165e565b846001600160a01b0316846001600160a01b03161461165e5761165e848261257a565b61228e8282610af9565b6109125761229b816125be565b6122a68360206125d0565b6040516020016122b7929190613fe3565b60408051601f198184030181529082905262461bcd60e51b825261053a9160040161283e565b60006001600160a01b0384163b156123d357604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061232190339089908890889060040161402c565b6020604051808303816000875af192505050801561235c575060408051601f3d908101601f1916820190925261235991810190614071565b60015b6123b9573d80801561238a576040519150601f19603f3d011682016040523d82523d6000602084013e61238f565b606091505b5080516000036123b15760405162461bcd60e51b815260040161053a90613e8c565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506119f5565b506001949350505050565b60006001600160e01b031982166380ac58cd60e01b148061240f57506001600160e01b03198216635b5e139f60e01b145b8061050457506301ffc9a760e01b6001600160e01b0319831614610504565b6000600161243b84610a98565b6124459190614092565b600083815260076020526040902054909150808214612498576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008546000906124dd90600190614092565b6000838152600960205260408120546008805493945090928490811061250557612505612d16565b90600052602060002001549050806008838154811061252657612526612d16565b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061255e5761255e6140a5565b6001900381819060005260206000200160009055905550505050565b600061258583610a98565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60606105046001600160a01b03831660145b606060006125df836002613ec5565b6125ea906002613eb2565b67ffffffffffffffff81111561260257612602612adf565b6040519080825280601f01601f19166020018201604052801561262c576020820181803683370190505b509050600360fc1b8160008151811061264757612647612d16565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061267657612676612d16565b60200101906001600160f81b031916908160001a905350600061269a846002613ec5565b6126a5906001613eb2565b90505b600181111561271d576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106126d9576126d9612d16565b1a60f81b8282815181106126ef576126ef612d16565b60200101906001600160f81b031916908160001a90535060049490941c93612716816140bb565b90506126a8565b508315611e2e5760405162461bcd60e51b815260040161053a90614104565b604051806101800160405280600c906020820280368337509192915050565b6001600160e01b031981165b811461190d57600080fd5b80356105048161275b565b60006020828403121561279257612792600080fd5b60006119f58484612772565b8015155b82525050565b60208101610504828461279e565b80612767565b8035610504816127b6565b6000602082840312156127dc576127dc600080fd5b60006119f584846127bc565b60005b838110156128035781810151838201526020016127eb565b50506000910152565b6000612816825190565b80845260208401935061282d8185602086016127e8565b601f01601f19169290920192915050565b60208082528101611e2e818461280c565b60006001600160a01b038216610504565b6127a28161284f565b602081016105048284612860565b6127678161284f565b803561050481612877565b600080604083850312156128a1576128a1600080fd5b60006128ad8585612880565b92505060206128be858286016127bc565b9150509250929050565b806127a2565b6020810161050482846128c8565b6000806000606084860312156128f4576128f4600080fd5b60006129008686612880565b935050602061291186828701612880565b9250506040612922868287016127bc565b9150509250925092565b6000806040838503121561294257612942600080fd5b600061294e85856127bc565b92505060206128be85828601612880565b60008083601f84011261297457612974600080fd5b50813567ffffffffffffffff81111561298f5761298f600080fd5b6020830191508360208202830111156129aa576129aa600080fd5b9250929050565b600080600080604085870312156129ca576129ca600080fd5b843567ffffffffffffffff8111156129e4576129e4600080fd5b6129f08782880161295f565b9450945050602085013567ffffffffffffffff811115612a1257612a12600080fd5b612a1e8782880161295f565b95989497509550505050565b600060208284031215612a3f57612a3f600080fd5b60006119f58484612880565b60006105048261284f565b600061050482612a4b565b6127a281612a56565b602081016105048284612a61565b801515612767565b803561050481612a78565b600060208284031215612aa057612aa0600080fd5b60006119f58484612a80565b60008060408385031215612ac257612ac2600080fd5b6000612ace8585612880565b92505060206128be85828601612a80565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715612b1b57612b1b612adf565b6040525050565b6000612b2d60405190565b9050612b398282612af5565b919050565b600067ffffffffffffffff821115612b5857612b58612adf565b601f19601f83011660200192915050565b82818337506000910152565b6000612b88612b8384612b3e565b612b22565b905082815260208101848484011115612ba357612ba3600080fd5b6117d7848285612b69565b600082601f830112612bc257612bc2600080fd5b81356119f5848260208601612b75565b60008060008060808587031215612beb57612beb600080fd5b6000612bf78787612880565b9450506020612c0887828801612880565b9350506040612c19878288016127bc565b925050606085013567ffffffffffffffff811115612c3957612c39600080fd5b612c4587828801612bae565b91505092959194509250565b600080600060408486031215612c6957612c69600080fd5b6000612c758686612880565b935050602084013567ffffffffffffffff811115612c9557612c95600080fd5b612ca18682870161295f565b92509250509250925092565b60008060408385031215612cc357612cc3600080fd5b600061294e8585612880565b601c81526000602082017f696d616765446174613a204e6f6e6578697374656e7420746f6b656e00000000815291505b5060200190565b6020808252810161050481612ccf565b634e487b7160e01b600052603260045260246000fd5b701e39bb339034b21e93b63ab1b430b6b7b760791b815260005b5060110190565b6000612d57825190565b612d658185602086016127e8565b9290920192915050565b634e487b7160e01b600052602260045260246000fd5b600281046001821680612d9957607f821691505b602082108103612dab57612dab612d6f565b50919050565b60008154612dbe81612d85565b600182168015612dd55760018114612dea57612e1a565b60ff1983168652811515820286019350612e1a565b60008581526020902060005b83811015612e1257815488820152600190910190602001612df6565b838801955050505b50505092915050565b741e339031b630b9b99e93b63ab1b43096b0b63a139f60591b815260005b5060150190565b6000612e5382612d2c565b9150612e5f828f612d4d565b7f2720786d6c6e733d27687474703a2f2f7777772e77332e6f72672f323030302f81527f737667272076696577426f783d27302030203234203234273e0000000000000060208201526039019150612eb7828e612d4d565b7f3c6720636c6173733d276c756368612d62726561746865273e0000000000000081526019019150612ee9828d612db1565b9150612ef5828c612db1565b7f3c7061746820636c6173733d276c756368612d736b696e2720643d274d32322081527f3132762d31682d31762d31682d315639682d315635682d315633682d3156326860208201527f2d315631682d315630483976314838763148377631483676324835763448347660408201527f314833763148327631483176386834762d316831762d324835762d336831763160608201527f68317631683176326838762d326831762d316831762d3168317633682d31763260808201526c3418bb18b41a3b169c3d13979f60991b60a082015260ad019150612fd5828b612db1565b9150612fe1828a612db1565b9150612fed8289612d4d565b7f3c7061746820636c6173733d276c756368612d626173652720643d274d31382081527f355633682d315632682d315631682d315630483976314838763148377631483660208201527f763248357635683176326831763168317631683176316836762d316831762d316040820152713418bb1698b418bb16993418ab1abd13979f60711b6060820152607201915061308582612e23565b91506130918288612db1565b631e17b39f60e11b815260040191506130aa8287612d4d565b7f3c706174682066696c6c3d27234646462720643d274d3920364836763368345681527f367a4d31372036682d337633683456367a272f3e3c7061746820636c6173733d60208201527f276c756368612d657965732720643d274d31362036682d327633683356367a4d60408201527f382036483776336833563648397a272f3e3c706174682066696c6c3d2723464660608201527f462720643d274d3720366831763148377a4d3136203668317631682d317a272060808201527f6f7061636974793d272e34272f3e3c706174682066696c6c3d2723303030272060a08201527f643d274d3135203768317631682d317a4d3820376831763148387a272f3e000060c08201527f3c7061746820636c6173733d276c756368612d736b696e2720643d274d31342060de8201526e1898241cbb19b41b3b1699bd13979f60891b60fe8201527f3c706174682066696c6c3d272330303027206f7061636974793d272e3927206461010d820152751e93a69899901898b41699bb18b41a3b1698bd13979f60511b61012d8201526101430191506132468286612db1565b631e17b39f60e11b81527f3c7061746820636c6173733d276c756368612d736b696e2720643d274d31362060048201527f3233762d3648387636483776316834762d34683276346834762d317a272f3e0060248201527f3c7061746820636c6173733d276c756368612d626173652720643d274d31352060438201527f31374838763168317631683276316832762d316832762d316831762d317a272f6063820152601f60f91b608382015260840191506133018285612db1565b7f3c7061746820636c6173733d276c756368612d626173652720643d274d39203281527f3148387632483776316834762d33682d317a4d3136203233762d32682d337633602082015268341a3b1698bd13979f60b91b6040820152604901915061336b8284612db1565b651e17b9bb339f60d11b81526006019e9d5050505050505050505050505050565b602181526000602082017f4552433732313a20617070726f76616c20746f2063757272656e74206f776e658152603960f91b602082015291505b5060400190565b602080825281016105048161338c565b603d81526000602082017f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f81527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000602082015291506133c6565b60208082528101610504816133dd565b602d81526000602082017f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6581526c1c881bdc88185c1c1c9bdd9959609a1b602082015291506133c6565b6020808252810161050481613447565b602b81526000602082017f455243373231456e756d657261626c653a206f776e657220696e646578206f7581526a74206f6620626f756e647360a81b602082015291506133c6565b60208082528101610504816134a1565b602f81526000602082017f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636581526e103937b632b9903337b91039b2b63360891b602082015291506133c6565b60208082528101610504816134f9565b600e81526000602082016d1cd95d1113904e881b1bd8dad95960921b81529150612cff565b6020808252810161050481613555565b601a81526000602082017f4172726179206c656e6774687320646f206e6f74206d6174636800000000000081529150612cff565b602080825281016105048161358a565b602c81526000602082017f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f81526b7574206f6620626f756e647360a01b602082015291506133c6565b60208082528101610504816135ce565b601881526000602082017f4552433732313a20696e76616c696420746f6b656e204944000000000000000081529150612cff565b6020808252810161050481613627565b602981526000602082017f4552433732313a2061646472657373207a65726f206973206e6f7420612076618152683634b21037bbb732b960b91b602082015291506133c6565b602080825281016105048161366b565b601b81526000602082017f746f6b656e5552493a204e6f6e6578697374656e7420746f6b656e000000000081529150612cff565b60208082528101610504816136c1565b6e113a3930b4ba2fba3cb832911d101160891b815260005b50600f0190565b69113b30b63ab2911d101160b11b815260005b50600a0190565b601160f91b815260005b5060010190565b607d60f81b81526000613748565b60006137698287612d4d565b91506137758286612d4d565b915061378082613705565b915061378c8285612d4d565b61088b60f21b815260020191506137a282613724565b91506137ae8284612d4d565b91506137b98261373e565b91506137c48261374f565b9695505050505050565b604081016137dc8285612860565b611e2e60208301846128c8565b60006137f7612b8384612b3e565b90508281526020810184848401111561381257613812600080fd5b6117d78482856127e8565b600082601f83011261383157613831600080fd5b81516119f58482602086016137e9565b60006020828403121561385657613856600080fd5b815167ffffffffffffffff81111561387057613870600080fd5b6119f58482850161381d565b694c756368616d6f6e202360b01b81526000613737565b600061389e8261387c565b9150611e2e8284612d4d565b607b60f81b81526000613748565b6e1134b6b0b3b2afb230ba30911d101160891b8152600061371d565b6e2261747472696275746573223a205b60881b8152600061371d565b605d60f81b81526000613748565b6000613909826138aa565b68113730b6b2911d101160b91b815260090191506139278286612d4d565b61088b60f21b81527f226465736372697074696f6e223a20224c756368616d6f6e207765726520726160028201527f6e646f6d6c792067656e657261746564207573696e6720436861696e6c696e6b60228201527f2056524620616e6420686176652031303025206f6e2d636861696e206172742060428201526e185b99081b595d1859185d1848488b608a1b606282015260710191506139c7826138b8565b91506139d38285612d4d565b61088b60f21b81527f2265787465726e616c5f75726c223a202268747470733a2f2f6c756368616d6f6002820152661b8b98dbdb488b60ca1b60228201526029019150613a1f826138d4565b9150613a2b8284612d4d565b9150613a36826138f0565b9150613a418261374f565b95945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000601d820161389e565b634e487b7160e01b600052601260045260246000fd5b600082613a9d57613a9d613a78565b500690565b634e487b7160e01b600052601160045260246000fd5b600082613ac757613ac7613a78565b500490565b75202e6c756368612d62617365207b2066696c6c3a202360501b815260005b5060160190565b74202e6c756368612d616c74207b2066696c6c3a202360581b81526000612e41565b75202e6c756368612d65796573207b2066696c6c3a202360501b81526000613aeb565b75202e6c756368612d736b696e207b2066696c6c3a202360501b81526000613aeb565b6f1e39ba3cb6329f11b63ab1b430b6b7b760811b81526010016000613b7f828c612d4d565b9150613b8a82613acc565b9150613b96828b612db1565b6c1d903e9011b63ab1b430b6b7b760991b8152600d019150613bb8828a612d4d565b9150613bc382613af2565b9150613bcf8289612db1565b6c1d903e9011b63ab1b430b6b7b760991b8152600d019150613bf18288612d4d565b9150613bfc82613b14565b9150613c088287612db1565b6c1d903e9011b63ab1b430b6b7b760991b8152600d019150613c2a8286612d4d565b9150613c3582613b37565b9150613c418285612db1565b6c1d903e9011b63ab1b430b6b7b760991b8152600d019150613c638284612d4d565b7f202e6c756368612d62726561746865207b20616e696d6174696f6e3a20302e3581527f73206c756368612d6272656174686520696e66696e69746520616c7465726e6160208201527f746520656173652d696e2d6f75743b207d20406b65796672616d6573206c756360408201527f68612d62726561746865207b2066726f6d207b207472616e73666f726d3a207460608201527f72616e736c6174655928307078293b207d20746f207b207472616e73666f726d60808201527f3a207472616e736c61746559283125293b207d207d3c2f7374796c653e00000060a082015260bd019b9a5050505050505050505050565b602581526000602082017f4552433732313a207472616e736665722066726f6d20696e636f72726563742081526437bbb732b960d91b602082015291506133c6565b6020808252810161050481613d56565b602481526000602082017f4552433732313a207472616e7366657220746f20746865207a65726f206164648152637265737360e01b602082015291506133c6565b6020808252810161050481613da8565b601981526000602082017f4552433732313a20617070726f766520746f2063616c6c65720000000000000081529150612cff565b6020808252810161050481613df9565b603281526000602082017f4552433732313a207472616e7366657220746f206e6f6e20455243373231526581527131b2b4bb32b91034b6b83632b6b2b73a32b960711b602082015291506133c6565b6020808252810161050481613e3d565b60ff16600060fe19820161374857613748613aa2565b8082018082111561050457610504613aa2565b81810280821583820485141761174457611744613aa2565b60208082527f4552433732313a206d696e7420746f20746865207a65726f206164647265737391019081526000612cff565b6020808252810161050481613edd565b601c81526000602082017f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000081529150612cff565b6020808252810161050481613f1f565b603581526000602082017f455243373231456e756d657261626c653a20636f6e7365637574697665207472815274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b602082015291506133c6565b6020808252810161050481613f63565b7001034b99036b4b9b9b4b733903937b6329607d1b81526000612d46565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260170160006140158285612d4d565b915061402082613fc5565b91506119f58284612d4d565b6080810161403a8287612860565b6140476020830186612860565b61405460408301856128c8565b81810360608301526137c4818461280c565b80516105048161275b565b60006020828403121561408657614086600080fd5b60006119f58484614066565b8181038181111561050457610504613aa2565b634e487b7160e01b600052603160045260246000fd5b6000816140ca576140ca613aa2565b506000190190565b60208082527f537472696e67733a20686578206c656e67746820696e73756666696369656e7491019081526000612cff565b60208082528101610504816140d256fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f3c7061746820636c6173733d276c756368612d616c742720643d274d313820345633682d315632682d315631682d3156304839763148387631483776314836763248357635683156366831563568325634683156336834763168317631683276316831763468315635682d317a272f3e3c672066696c6c3d2723303030273e3c7061746820643d274d313820345633682d315632682d315631682d3156304839763148387631483776314836763248357635683156356831563468315633683156326836763168317631683176316831763568315635682d317a27206f7061636974793d272e32272f3e3c7061746820643d274d313620345633682d31563248397631483876314837763168325634683156336834763168317631683256347a4d3620356831763148367a4d3137203568317631682d317a27206f7061636974793d272e35272f3e3c2f673e3c7061746820636c6173733d276c756368612d616c742720643d274d32302031305639682d327631682d3176316834762d317a4d35203948347631483376316834762d31483656397a272f3e3c706174682066696c6c3d272330303027206f7061636974793d272e322720643d274d36203948347631483376316834762d3148367a4d32302031305639682d327631682d3176316834762d317a272f3ea2646970667358221220e5a4b072207e1d0956d2c91e23c9ef447c215db3459204363b868673fa64cc1064736f6c63430008160033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.