Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 141 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Add Lord | 22902553 | 195 days ago | IN | 0 ETH | 0.00147509 | ||||
| Add Lord | 22902552 | 195 days ago | IN | 0 ETH | 0.00149656 | ||||
| Add Lord | 22902551 | 195 days ago | IN | 0 ETH | 0.00151551 | ||||
| Add Lord | 22902550 | 195 days ago | IN | 0 ETH | 0.00318869 | ||||
| Add Lord | 22902549 | 195 days ago | IN | 0 ETH | 0.00142953 | ||||
| Add Lord | 22902548 | 195 days ago | IN | 0 ETH | 0.00135604 | ||||
| Add Lord | 22902547 | 195 days ago | IN | 0 ETH | 0.00137449 | ||||
| Add Lord | 22902546 | 195 days ago | IN | 0 ETH | 0.00133998 | ||||
| Add Lord | 22902545 | 195 days ago | IN | 0 ETH | 0.00129331 | ||||
| Add Lord | 22902544 | 195 days ago | IN | 0 ETH | 0.00275202 | ||||
| Add Eyes | 22902533 | 195 days ago | IN | 0 ETH | 0.00237373 | ||||
| Add Eyes | 22902532 | 195 days ago | IN | 0 ETH | 0.00441892 | ||||
| Add Eyes | 22902530 | 195 days ago | IN | 0 ETH | 0.0043988 | ||||
| Add Eyes | 22902529 | 195 days ago | IN | 0 ETH | 0.00407066 | ||||
| Add Eyes | 22902528 | 195 days ago | IN | 0 ETH | 0.0037246 | ||||
| Add Hair | 22902495 | 195 days ago | IN | 0 ETH | 0.00098386 | ||||
| Add Hair | 22902493 | 195 days ago | IN | 0 ETH | 0.00967023 | ||||
| Add Hair | 22902492 | 195 days ago | IN | 0 ETH | 0.00987545 | ||||
| Add Hair | 22902491 | 195 days ago | IN | 0 ETH | 0.00961844 | ||||
| Add Hair | 22902490 | 195 days ago | IN | 0 ETH | 0.00745747 | ||||
| Add Hair | 22902489 | 195 days ago | IN | 0 ETH | 0.00510565 | ||||
| Add Hair | 22902488 | 195 days ago | IN | 0 ETH | 0.00929339 | ||||
| Add Beards | 22902464 | 195 days ago | IN | 0 ETH | 0.00210555 | ||||
| Add Attrs | 22831125 | 205 days ago | IN | 0 ETH | 0.0163438 | ||||
| Add Attrs | 22831124 | 205 days ago | IN | 0 ETH | 0.01547626 |
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
CryptoSkullsData
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
No with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
/**
* ____ _ ____ _ _ _ ____ _
* / ___|_ __ _ _ _ __ | |_ ___/ ___|| | ___ _| | |___ | _ \ __ _| |_ __ _
* | | | '__| | | | '_ \| __/ _ \___ \| |/ / | | | | / __| | | | |/ _` | __/ _` |
* | |___| | | |_| | |_) | || (_) |__) | <| |_| | | \__ \ | |_| | (_| | || (_| |
* \____|_| \__, | .__/ \__\___/____/|_|\_\\__,_|_|_|___/ |____/ \__,_|\__\__,_|
* |___/|_|
*
* On-chain CryptoSkulls images, attributes, and names.
*
* This contract stores the full image and attribute data for all CryptoSkulls directly on-chain.
* Images are available as raw RGB pixel arrays or as rendered SVG format.
* Attributes are stored as an array of numbers, representing:
* - Uniqueness Index
* - Background ID
* - Genes (Skull, Hair, Eyes, Nose, Teeth, Bones, Beard)
* - Game Token flag
*
* Built using components from OpenZeppelin Contracts.
*
* Source: https://github.com/OpenZeppelin/openzeppelin-contracts
* License: MIT
* Copyright (c) OpenZeppelin
*/
contract CryptoSkullsData is Ownable {
uint24 private constant LINE_COLOR = 2503224;
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant HEX_LENGTH = 6;
uint16 private constant IMG_PIXEL_COUNT = 576;
string internal constant SVG_HEADER = '<svg xmlns="http://www.w3.org/2000/svg" version="1.2" viewBox="0 0 24 24">';
string internal constant SVG_FOOTER = '</svg>';
uint16[] private bonesLineCoords;
uint16[] private bonesFillCoords;
uint16[] private skullLineCoords;
uint16[] private skullFillCoords;
uint24[] private bgColors;
uint24[] private bonesColors;
uint24[] private skullColors;
mapping(uint8 => uint16[]) private noseCoords;
mapping(uint8 => uint16[]) private teethCoords;
mapping(uint8 => int32[]) private eyes;
mapping(uint8 => int32[]) private hair;
mapping(uint8 => int32[]) private beards;
mapping(uint16 => uint24[]) private lords;
mapping(uint16 => uint8[]) private attrs;
mapping(uint16 => string) private names;
constructor() Ownable(_msgSender()) {
initializeData();
}
function addAttrs(uint16 startIndex, uint8[][] memory _attrs) external onlyOwner {
for (uint16 i = 0; i < _attrs.length; ++i) {
attrs[startIndex + i] = _attrs[i];
}
}
/**
* Returns the attribute array of a CryptoSkull in the following order:
* Uniqueness Index, Background ID, Skull Gene, Hair Gene, Eyes Gene, Nose Gene,
* Teeth Gene, Bones Gene, Beard Gene, Game Token.
* @param index The CryptoSkull index (0 <= index < 10000).
*/
function getAttrs(uint16 index) external view returns (uint8[] memory) {
return attrs[index];
}
function addNames(uint16 startIndex, string[] memory _names) external onlyOwner {
for (uint16 i = 0; i < _names.length; ++i) {
names[startIndex + i] = _names[i];
}
}
/**
* Returns the name of a CryptoSkull.
* @param index The CryptoSkull index (0 <= index < 10000).
*/
function getName(uint16 index) external view returns (string memory) {
return names[index];
}
function addEyes(uint8 startIndex, int32[][] memory _eyes) external onlyOwner {
for (uint8 i = 0; i < _eyes.length; ++i) {
eyes[startIndex + i] = _eyes[i];
}
}
function addHair(uint8 startIndex, int32[][] memory _hair) external onlyOwner {
for (uint8 i = 0; i < _hair.length; ++i) {
hair[startIndex + i] = _hair[i];
}
}
function addBeards(uint8 startIndex, int32[][] memory _beards) external onlyOwner {
for (uint8 i = 0; i < _beards.length; ++i) {
beards[startIndex + i] = _beards[i];
}
}
function addLord(uint16 index, uint24[] memory data) external onlyOwner {
lords[index] = data;
}
function drawOutline(uint16[] memory coords, uint24[] memory pixels) private pure {
for (uint8 i = 0; i < coords.length; ++i) {
pixels[coords[i]] = LINE_COLOR;
}
}
function drawFill(uint16[] memory coords, uint24 color, uint24[] memory pixels) private pure {
for (uint8 i = 0; i < coords.length; ++i) {
pixels[coords[i]] = color;
}
}
function drawLayer(int32[] memory data, uint24[] memory pixels) private pure {
uint24 start = uint24(uint32(data[0]));
for (uint8 i = 1; i < data.length; ++i) {
if (data[i] != 0) {
pixels[start + i - 1] = uint24(uint32(data[i] & 0x00ffffff));
}
}
}
function toHexColor(uint256 value) private pure returns (string memory) {
unchecked {
uint256 localValue = value;
bytes memory buffer = new bytes(HEX_LENGTH);
for (uint8 i = HEX_LENGTH; i > 0; --i) {
buffer[i - 1] = HEX_DIGITS[localValue & 0xf];
localValue >>= 4;
}
return string(buffer);
}
}
/**
* Returns the image pixels for a given CryptoSkull index (576 total).
* Each pixel is an RGB value encoded as a uint24.
* @param index The CryptoSkull index (0 <= index < 10000).
*/
function getPixels(uint16 index) public view returns (uint24[] memory) {
uint8[] memory _attrs = attrs[index];
if (_attrs[0] == 1) {
return lords[index];
}
uint24[] memory pixels = new uint24[](IMG_PIXEL_COUNT);
uint24 bgColor = bgColors[_attrs[1]];
for (uint16 i = 0; i < IMG_PIXEL_COUNT; ++i) {
pixels[i] = bgColor;
}
if (_attrs[7] <= 14) {
drawOutline(bonesLineCoords, pixels);
drawFill(bonesFillCoords, bonesColors[_attrs[7]], pixels);
}
drawOutline(skullLineCoords, pixels);
drawFill(skullFillCoords, skullColors[_attrs[2]], pixels);
drawLayer(eyes[_attrs[4]], pixels);
drawOutline(noseCoords[_attrs[5]], pixels);
drawOutline(teethCoords[_attrs[6]], pixels);
if (_attrs[3] <= 121) {
drawLayer(hair[_attrs[3]], pixels);
}
if (_attrs[8] <= 7) {
drawLayer(beards[_attrs[8]], pixels);
}
return pixels;
}
/**
* Generates the CryptoSkull SVG for the given index.
* Each pixel is rendered as a 1x1 rectangle.
* @param index The CryptoSkull index (0 <= index < 10000).
*/
function getSvg(uint16 index) public view returns (string memory svg) {
uint24[] memory pixels = getPixels(index);
for (uint256 y = 0; y < 24; ++y) {
for (uint256 x = 0; x < 24; ++x) {
svg = string.concat(
svg,
'<rect x="', Strings.toString(x),
'" y="', Strings.toString(y),
'" width="1" height="1" shape-rendering="crispEdges" fill="#',
toHexColor(pixels[24 * y + x]), '"/>'
);
}
}
svg = string.concat(SVG_HEADER, svg, SVG_FOOTER);
}
function initializeData() internal {
bonesLineCoords = [3,4,5,18,19,20,27,29,42,44,49,50,53,66,69,70,73,78,89,94,97,98,99,100,115,116,117,118,125,138,365,378,388,391,392,399,400,403,409,410,411,428,429,430,433,438,449,454,457,458,461,474,477,478,483,485,498,500,507,508,509,522,523,524];
bonesFillCoords = [28,43,51,52,67,68,74,75,76,77,90,91,92,93,101,102,113,114,366,367,376,377,389,390,401,402,412,413,414,425,426,427,434,435,436,437,450,451,452,453,459,460,475,476,484,499];
skullLineCoords = [80,81,82,83,84,85,86,87,103,112,126,137,150,161,173,186,197,210,221,234,245,258,269,282,293,294,305,306,318,329,342,343,344,351,352,353,368,375,415,424,439,440,447,448,464,465,470,471,490,491,492,493];
skullFillCoords = [104,105,106,107,108,109,110,111,127,128,129,130,131,132,133,134,135,136,151,152,153,154,155,156,157,158,159,160,174,175,176,177,178,179,180,181,182,183,184,185,198,199,200,201,202,203,204,205,206,207,208,209,222,223,224,225,226,227,228,229,230,231,232,233,246,247,248,249,250,251,252,253,254,255,256,257,270,271,272,273,274,275,276,277,278,279,280,281,295,296,297,298,299,300,301,302,303,304,319,320,321,322,323,324,325,326,327,328,345,346,347,348,349,350,369,370,371,372,373,374,393,394,395,396,397,398,416,417,418,419,420,421,422,423,441,442,443,444,445,446,466,467,468,469];
bgColors = [16777215,0,16316922,15856629,15330543,14607078,13554906,11384253,8818326,4804695,3422784,2172201,16774645,16770019,16763337,16754856,16746375,16739179,16405074,15744574,14692657,13183530,16773366,16768747,16564951,16425665,16221100,15754645,15092096,14037868,12723548,10886733,16314620,15981050,15646458,15047159,14317554,13393384,12471259,11419337,10237621,8793756,15986943,15064063,13680639,11638780,9926138,8675063,7950578,7358696,6767065,6241732,15594239,14411007,12241151,9545727,7639036,6061306,5009141,4350955,3890139,3559367,15201791,13691903,10868991,7651580,5090295,3382000,2264038,1867478,1667522,1598635,14940924,12973818,10086898,6740456,3918299,2275535,1419967,1087661,820633,750213,15138037,12843752,9892567,6547134,3725737,2148759,1226886,829048,627304,556891,15465454,13892056,11727547,9234842,6937468,5361510,4243543,3650125,3120708,2853438,16055523,15334088,14218658,12643189,11133771,9754669,8571166,7649302,6727695,6067213,16775643,16774079,16772249,16769126,16766011,16565273,16429061,16097024,15764480,15103744,16774374,16771276,16767144,16760952,16755021,16749099,16612884,16213767,15227148,14239759];
bonesColors = [38536,5025616,13491257,16771899,16761095,16733986,16764370,0,16007990,15277667,10233776,6765239,4149685,2201331,48340];
skullColors = [16007990,15277667,10233776,6765239,4149685,240116,38536,5025616,13491257,16771899,16750592,16733986,7951688,6323595,16777215];
noseCoords[0] = [300,323,324,347,348];
noseCoords[1] = [299,300,323,324];
noseCoords[2] = [300,324,347,348];
noseCoords[3] = [323,347,348];
noseCoords[4] = [299,323,347,348];
noseCoords[5] = [324,347,348];
noseCoords[6] = [323,324,347];
noseCoords[7] = [323,324,348];
teethCoords[0] = [394,396,419,421];
teethCoords[1] = [393,395,396,398,418,419,420,421,443,444];
teethCoords[2] = [394,396,398,417,419,420,421];
teethCoords[3] = [394,395,396,397,417,422];
teethCoords[4] = [394,395,396,398,417,419,420,421];
teethCoords[5] = [394,397,417,418,419,420,421,422,443,444];
teethCoords[6] = [394,395,396,419,420,421];
teethCoords[7] = [393,395,396,398,418,421];
teethCoords[8] = [393,398,418,421,443,444];
teethCoords[9] = [394,396,398,417,419,421];
teethCoords[10] = [393,395,397,418,420,422];
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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 (last updated v5.3.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
import {Panic} from "../Panic.sol";
import {SafeCast} from "./SafeCast.sol";
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Return the 512-bit addition of two uint256.
*
* The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.
*/
function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {
assembly ("memory-safe") {
low := add(a, b)
high := lt(low, a)
}
}
/**
* @dev Return the 512-bit multiplication of two uint256.
*
* The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.
*/
function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {
// 512-bit multiply [high low] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use
// the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = high * 2²⁵⁶ + low.
assembly ("memory-safe") {
let mm := mulmod(a, b, not(0))
low := mul(a, b)
high := sub(sub(mm, low), lt(mm, low))
}
}
/**
* @dev Returns the addition of two unsigned integers, with a success flag (no overflow).
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
uint256 c = a + b;
success = c >= a;
result = c * SafeCast.toUint(success);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
uint256 c = a - b;
success = c <= a;
result = c * SafeCast.toUint(success);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
uint256 c = a * b;
assembly ("memory-safe") {
// Only true when the multiplication doesn't overflow
// (c / a == b) || (a == 0)
success := or(eq(div(c, a), b), iszero(a))
}
// equivalent to: success ? c : 0
result = c * SafeCast.toUint(success);
}
}
/**
* @dev Returns the division of two unsigned integers, with a success flag (no division by zero).
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
success = b > 0;
assembly ("memory-safe") {
// The `DIV` opcode returns zero when the denominator is 0.
result := div(a, b)
}
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
success = b > 0;
assembly ("memory-safe") {
// The `MOD` opcode returns zero when the denominator is 0.
result := mod(a, b)
}
}
}
/**
* @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.
*/
function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {
(bool success, uint256 result) = tryAdd(a, b);
return ternary(success, result, type(uint256).max);
}
/**
* @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.
*/
function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {
(, uint256 result) = trySub(a, b);
return result;
}
/**
* @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.
*/
function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {
(bool success, uint256 result) = tryMul(a, b);
return ternary(success, result, type(uint256).max);
}
/**
* @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
*
* IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
* However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
* one branch when needed, making this function more expensive.
*/
function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {
unchecked {
// branchless ternary works because:
// b ^ (a ^ b) == a
// b ^ 0 == b
return b ^ ((a ^ b) * SafeCast.toUint(condition));
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return ternary(a > b, a, b);
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return ternary(a < b, a, b);
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
Panic.panic(Panic.DIVISION_BY_ZERO);
}
// The following calculation ensures accurate ceiling division without overflow.
// Since a is non-zero, (a - 1) / b will not overflow.
// The largest possible result occurs when (a - 1) / b is type(uint256).max,
// but the largest value we can obtain is type(uint256).max - 1, which happens
// when a = type(uint256).max and b = 1.
unchecked {
return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);
}
}
/**
* @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
*
* 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 {
(uint256 high, uint256 low) = mul512(x, y);
// Handle non-overflow cases, 256 by 256 division.
if (high == 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 low / denominator;
}
// Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.
if (denominator <= high) {
Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [high low].
uint256 remainder;
assembly ("memory-safe") {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
high := sub(high, gt(remainder, low))
low := sub(low, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly ("memory-safe") {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [high low] by twos.
low := div(low, twos)
// Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from high into low.
low |= high * twos;
// Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such
// that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv ≡ 1 mod 2⁴.
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⁸
inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶
inverse *= 2 - denominator * inverse; // inverse mod 2³²
inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴
inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸
inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶
// 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²⁵⁶. Since the preconditions guarantee that the outcome is
// less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and high
// is no longer required.
result = low * inverse;
return result;
}
}
/**
* @dev 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) {
return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);
}
/**
* @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.
*/
function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {
unchecked {
(uint256 high, uint256 low) = mul512(x, y);
if (high >= 1 << n) {
Panic.panic(Panic.UNDER_OVERFLOW);
}
return (high << (256 - n)) | (low >> n);
}
}
/**
* @dev Calculates x * y >> n with full precision, following the selected rounding direction.
*/
function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {
return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 0);
}
/**
* @dev Calculate the modular multiplicative inverse of a number in Z/nZ.
*
* If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.
* If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.
*
* If the input value is not inversible, 0 is returned.
*
* NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the
* inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.
*/
function invMod(uint256 a, uint256 n) internal pure returns (uint256) {
unchecked {
if (n == 0) return 0;
// The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)
// Used to compute integers x and y such that: ax + ny = gcd(a, n).
// When the gcd is 1, then the inverse of a modulo n exists and it's x.
// ax + ny = 1
// ax = 1 + (-y)n
// ax ≡ 1 (mod n) # x is the inverse of a modulo n
// If the remainder is 0 the gcd is n right away.
uint256 remainder = a % n;
uint256 gcd = n;
// Therefore the initial coefficients are:
// ax + ny = gcd(a, n) = n
// 0a + 1n = n
int256 x = 0;
int256 y = 1;
while (remainder != 0) {
uint256 quotient = gcd / remainder;
(gcd, remainder) = (
// The old remainder is the next gcd to try.
remainder,
// Compute the next remainder.
// Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd
// where gcd is at most n (capped to type(uint256).max)
gcd - remainder * quotient
);
(x, y) = (
// Increment the coefficient of a.
y,
// Decrement the coefficient of n.
// Can overflow, but the result is casted to uint256 so that the
// next value of y is "wrapped around" to a value between 0 and n - 1.
x - y * int256(quotient)
);
}
if (gcd != 1) return 0; // No inverse exists.
return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.
}
}
/**
* @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.
*
* From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is
* prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that
* `a**(p-2)` is the modular multiplicative inverse of a in Fp.
*
* NOTE: this function does NOT check that `p` is a prime greater than `2`.
*/
function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {
unchecked {
return Math.modExp(a, p - 2, p);
}
}
/**
* @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)
*
* Requirements:
* - modulus can't be zero
* - underlying staticcall to precompile must succeed
*
* IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make
* sure the chain you're using it on supports the precompiled contract for modular exponentiation
* at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,
* the underlying function will succeed given the lack of a revert, but the result may be incorrectly
* interpreted as 0.
*/
function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {
(bool success, uint256 result) = tryModExp(b, e, m);
if (!success) {
Panic.panic(Panic.DIVISION_BY_ZERO);
}
return result;
}
/**
* @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).
* It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying
* to operate modulo 0 or if the underlying precompile reverted.
*
* IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain
* you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in
* https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack
* of a revert, but the result may be incorrectly interpreted as 0.
*/
function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {
if (m == 0) return (false, 0);
assembly ("memory-safe") {
let ptr := mload(0x40)
// | Offset | Content | Content (Hex) |
// |-----------|------------|--------------------------------------------------------------------|
// | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x60:0x7f | value of b | 0x<.............................................................b> |
// | 0x80:0x9f | value of e | 0x<.............................................................e> |
// | 0xa0:0xbf | value of m | 0x<.............................................................m> |
mstore(ptr, 0x20)
mstore(add(ptr, 0x20), 0x20)
mstore(add(ptr, 0x40), 0x20)
mstore(add(ptr, 0x60), b)
mstore(add(ptr, 0x80), e)
mstore(add(ptr, 0xa0), m)
// Given the result < m, it's guaranteed to fit in 32 bytes,
// so we can use the memory scratch space located at offset 0.
success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)
result := mload(0x00)
}
}
/**
* @dev Variant of {modExp} that supports inputs of arbitrary length.
*/
function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {
(bool success, bytes memory result) = tryModExp(b, e, m);
if (!success) {
Panic.panic(Panic.DIVISION_BY_ZERO);
}
return result;
}
/**
* @dev Variant of {tryModExp} that supports inputs of arbitrary length.
*/
function tryModExp(
bytes memory b,
bytes memory e,
bytes memory m
) internal view returns (bool success, bytes memory result) {
if (_zeroBytes(m)) return (false, new bytes(0));
uint256 mLen = m.length;
// Encode call args in result and move the free memory pointer
result = abi.encodePacked(b.length, e.length, mLen, b, e, m);
assembly ("memory-safe") {
let dataPtr := add(result, 0x20)
// Write result on top of args to avoid allocating extra memory.
success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)
// Overwrite the length.
// result.length > returndatasize() is guaranteed because returndatasize() == m.length
mstore(result, mLen)
// Set the memory pointer after the returned data.
mstore(0x40, add(dataPtr, mLen))
}
}
/**
* @dev Returns whether the provided byte array is zero.
*/
function _zeroBytes(bytes memory byteArray) private pure returns (bool) {
for (uint256 i = 0; i < byteArray.length; ++i) {
if (byteArray[i] != 0) {
return false;
}
}
return true;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* This method is based on Newton's method for computing square roots; the algorithm is restricted to only
* using integer operations.
*/
function sqrt(uint256 a) internal pure returns (uint256) {
unchecked {
// Take care of easy edge cases when a == 0 or a == 1
if (a <= 1) {
return a;
}
// In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a
// sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between
// the current value as `ε_n = | x_n - sqrt(a) |`.
//
// For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root
// of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is
// bigger than any uint256.
//
// By noticing that
// `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`
// we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar
// to the msb function.
uint256 aa = a;
uint256 xn = 1;
if (aa >= (1 << 128)) {
aa >>= 128;
xn <<= 64;
}
if (aa >= (1 << 64)) {
aa >>= 64;
xn <<= 32;
}
if (aa >= (1 << 32)) {
aa >>= 32;
xn <<= 16;
}
if (aa >= (1 << 16)) {
aa >>= 16;
xn <<= 8;
}
if (aa >= (1 << 8)) {
aa >>= 8;
xn <<= 4;
}
if (aa >= (1 << 4)) {
aa >>= 4;
xn <<= 2;
}
if (aa >= (1 << 2)) {
xn <<= 1;
}
// We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).
//
// We can refine our estimation by noticing that the middle of that interval minimizes the error.
// If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).
// This is going to be our x_0 (and ε_0)
xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)
// From here, Newton's method give us:
// x_{n+1} = (x_n + a / x_n) / 2
//
// One should note that:
// x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a
// = ((x_n² + a) / (2 * x_n))² - a
// = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a
// = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)
// = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)
// = (x_n² - a)² / (2 * x_n)²
// = ((x_n² - a) / (2 * x_n))²
// ≥ 0
// Which proves that for all n ≥ 1, sqrt(a) ≤ x_n
//
// This gives us the proof of quadratic convergence of the sequence:
// ε_{n+1} = | x_{n+1} - sqrt(a) |
// = | (x_n + a / x_n) / 2 - sqrt(a) |
// = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |
// = | (x_n - sqrt(a))² / (2 * x_n) |
// = | ε_n² / (2 * x_n) |
// = ε_n² / | (2 * x_n) |
//
// For the first iteration, we have a special case where x_0 is known:
// ε_1 = ε_0² / | (2 * x_0) |
// ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))
// ≤ 2**(2*e-4) / (3 * 2**(e-1))
// ≤ 2**(e-3) / 3
// ≤ 2**(e-3-log2(3))
// ≤ 2**(e-4.5)
//
// For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:
// ε_{n+1} = ε_n² / | (2 * x_n) |
// ≤ (2**(e-k))² / (2 * 2**(e-1))
// ≤ 2**(2*e-2*k) / 2**e
// ≤ 2**(e-2*k)
xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above
xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5
xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9
xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18
xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36
xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72
// Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision
// ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either
// sqrt(a) or sqrt(a) + 1.
return xn - SafeCast.toUint(xn > a / xn);
}
}
/**
* @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 x) internal pure returns (uint256 r) {
// If value has upper 128 bits set, log2 result is at least 128
r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;
// If upper 64 bits of 128-bit half set, add 64 to result
r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;
// If upper 32 bits of 64-bit half set, add 32 to result
r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;
// If upper 16 bits of 32-bit half set, add 16 to result
r |= SafeCast.toUint((x >> r) > 0xffff) << 4;
// If upper 8 bits of 16-bit half set, add 8 to result
r |= SafeCast.toUint((x >> r) > 0xff) << 3;
// If upper 4 bits of 8-bit half set, add 4 to result
r |= SafeCast.toUint((x >> r) > 0xf) << 2;
// Shifts value right by the current result and use it as an index into this lookup table:
//
// | x (4 bits) | index | table[index] = MSB position |
// |------------|---------|-----------------------------|
// | 0000 | 0 | table[0] = 0 |
// | 0001 | 1 | table[1] = 0 |
// | 0010 | 2 | table[2] = 1 |
// | 0011 | 3 | table[3] = 1 |
// | 0100 | 4 | table[4] = 2 |
// | 0101 | 5 | table[5] = 2 |
// | 0110 | 6 | table[6] = 2 |
// | 0111 | 7 | table[7] = 2 |
// | 1000 | 8 | table[8] = 3 |
// | 1001 | 9 | table[9] = 3 |
// | 1010 | 10 | table[10] = 3 |
// | 1011 | 11 | table[11] = 3 |
// | 1100 | 12 | table[12] = 3 |
// | 1101 | 13 | table[13] = 3 |
// | 1110 | 14 | table[14] = 3 |
// | 1111 | 15 | table[15] = 3 |
//
// The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.
assembly ("memory-safe") {
r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))
}
}
/**
* @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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 x) internal pure returns (uint256 r) {
// If value has upper 128 bits set, log2 result is at least 128
r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;
// If upper 64 bits of 128-bit half set, add 64 to result
r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;
// If upper 32 bits of 64-bit half set, add 32 to result
r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;
// If upper 16 bits of 32-bit half set, add 16 to result
r |= SafeCast.toUint((x >> r) > 0xffff) << 4;
// Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8
return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);
}
/**
* @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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.
pragma solidity ^0.8.20;
/**
* @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow
* checks.
*
* Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such an operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeCast {
/**
* @dev Value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);
/**
* @dev An int value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedIntToUint(int256 value);
/**
* @dev Value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);
/**
* @dev An uint value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedUintToInt(uint256 value);
/**
* @dev Returns the downcasted uint248 from uint256, reverting on
* overflow (when the input is greater than largest uint248).
*
* Counterpart to Solidity's `uint248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toUint248(uint256 value) internal pure returns (uint248) {
if (value > type(uint248).max) {
revert SafeCastOverflowedUintDowncast(248, value);
}
return uint248(value);
}
/**
* @dev Returns the downcasted uint240 from uint256, reverting on
* overflow (when the input is greater than largest uint240).
*
* Counterpart to Solidity's `uint240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toUint240(uint256 value) internal pure returns (uint240) {
if (value > type(uint240).max) {
revert SafeCastOverflowedUintDowncast(240, value);
}
return uint240(value);
}
/**
* @dev Returns the downcasted uint232 from uint256, reverting on
* overflow (when the input is greater than largest uint232).
*
* Counterpart to Solidity's `uint232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toUint232(uint256 value) internal pure returns (uint232) {
if (value > type(uint232).max) {
revert SafeCastOverflowedUintDowncast(232, value);
}
return uint232(value);
}
/**
* @dev Returns the downcasted uint224 from uint256, reverting on
* overflow (when the input is greater than largest uint224).
*
* Counterpart to Solidity's `uint224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toUint224(uint256 value) internal pure returns (uint224) {
if (value > type(uint224).max) {
revert SafeCastOverflowedUintDowncast(224, value);
}
return uint224(value);
}
/**
* @dev Returns the downcasted uint216 from uint256, reverting on
* overflow (when the input is greater than largest uint216).
*
* Counterpart to Solidity's `uint216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toUint216(uint256 value) internal pure returns (uint216) {
if (value > type(uint216).max) {
revert SafeCastOverflowedUintDowncast(216, value);
}
return uint216(value);
}
/**
* @dev Returns the downcasted uint208 from uint256, reverting on
* overflow (when the input is greater than largest uint208).
*
* Counterpart to Solidity's `uint208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toUint208(uint256 value) internal pure returns (uint208) {
if (value > type(uint208).max) {
revert SafeCastOverflowedUintDowncast(208, value);
}
return uint208(value);
}
/**
* @dev Returns the downcasted uint200 from uint256, reverting on
* overflow (when the input is greater than largest uint200).
*
* Counterpart to Solidity's `uint200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toUint200(uint256 value) internal pure returns (uint200) {
if (value > type(uint200).max) {
revert SafeCastOverflowedUintDowncast(200, value);
}
return uint200(value);
}
/**
* @dev Returns the downcasted uint192 from uint256, reverting on
* overflow (when the input is greater than largest uint192).
*
* Counterpart to Solidity's `uint192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toUint192(uint256 value) internal pure returns (uint192) {
if (value > type(uint192).max) {
revert SafeCastOverflowedUintDowncast(192, value);
}
return uint192(value);
}
/**
* @dev Returns the downcasted uint184 from uint256, reverting on
* overflow (when the input is greater than largest uint184).
*
* Counterpart to Solidity's `uint184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toUint184(uint256 value) internal pure returns (uint184) {
if (value > type(uint184).max) {
revert SafeCastOverflowedUintDowncast(184, value);
}
return uint184(value);
}
/**
* @dev Returns the downcasted uint176 from uint256, reverting on
* overflow (when the input is greater than largest uint176).
*
* Counterpart to Solidity's `uint176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toUint176(uint256 value) internal pure returns (uint176) {
if (value > type(uint176).max) {
revert SafeCastOverflowedUintDowncast(176, value);
}
return uint176(value);
}
/**
* @dev Returns the downcasted uint168 from uint256, reverting on
* overflow (when the input is greater than largest uint168).
*
* Counterpart to Solidity's `uint168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toUint168(uint256 value) internal pure returns (uint168) {
if (value > type(uint168).max) {
revert SafeCastOverflowedUintDowncast(168, value);
}
return uint168(value);
}
/**
* @dev Returns the downcasted uint160 from uint256, reverting on
* overflow (when the input is greater than largest uint160).
*
* Counterpart to Solidity's `uint160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toUint160(uint256 value) internal pure returns (uint160) {
if (value > type(uint160).max) {
revert SafeCastOverflowedUintDowncast(160, value);
}
return uint160(value);
}
/**
* @dev Returns the downcasted uint152 from uint256, reverting on
* overflow (when the input is greater than largest uint152).
*
* Counterpart to Solidity's `uint152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toUint152(uint256 value) internal pure returns (uint152) {
if (value > type(uint152).max) {
revert SafeCastOverflowedUintDowncast(152, value);
}
return uint152(value);
}
/**
* @dev Returns the downcasted uint144 from uint256, reverting on
* overflow (when the input is greater than largest uint144).
*
* Counterpart to Solidity's `uint144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toUint144(uint256 value) internal pure returns (uint144) {
if (value > type(uint144).max) {
revert SafeCastOverflowedUintDowncast(144, value);
}
return uint144(value);
}
/**
* @dev Returns the downcasted uint136 from uint256, reverting on
* overflow (when the input is greater than largest uint136).
*
* Counterpart to Solidity's `uint136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toUint136(uint256 value) internal pure returns (uint136) {
if (value > type(uint136).max) {
revert SafeCastOverflowedUintDowncast(136, value);
}
return uint136(value);
}
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toUint128(uint256 value) internal pure returns (uint128) {
if (value > type(uint128).max) {
revert SafeCastOverflowedUintDowncast(128, value);
}
return uint128(value);
}
/**
* @dev Returns the downcasted uint120 from uint256, reverting on
* overflow (when the input is greater than largest uint120).
*
* Counterpart to Solidity's `uint120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toUint120(uint256 value) internal pure returns (uint120) {
if (value > type(uint120).max) {
revert SafeCastOverflowedUintDowncast(120, value);
}
return uint120(value);
}
/**
* @dev Returns the downcasted uint112 from uint256, reverting on
* overflow (when the input is greater than largest uint112).
*
* Counterpart to Solidity's `uint112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toUint112(uint256 value) internal pure returns (uint112) {
if (value > type(uint112).max) {
revert SafeCastOverflowedUintDowncast(112, value);
}
return uint112(value);
}
/**
* @dev Returns the downcasted uint104 from uint256, reverting on
* overflow (when the input is greater than largest uint104).
*
* Counterpart to Solidity's `uint104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toUint104(uint256 value) internal pure returns (uint104) {
if (value > type(uint104).max) {
revert SafeCastOverflowedUintDowncast(104, value);
}
return uint104(value);
}
/**
* @dev Returns the downcasted uint96 from uint256, reverting on
* overflow (when the input is greater than largest uint96).
*
* Counterpart to Solidity's `uint96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toUint96(uint256 value) internal pure returns (uint96) {
if (value > type(uint96).max) {
revert SafeCastOverflowedUintDowncast(96, value);
}
return uint96(value);
}
/**
* @dev Returns the downcasted uint88 from uint256, reverting on
* overflow (when the input is greater than largest uint88).
*
* Counterpart to Solidity's `uint88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toUint88(uint256 value) internal pure returns (uint88) {
if (value > type(uint88).max) {
revert SafeCastOverflowedUintDowncast(88, value);
}
return uint88(value);
}
/**
* @dev Returns the downcasted uint80 from uint256, reverting on
* overflow (when the input is greater than largest uint80).
*
* Counterpart to Solidity's `uint80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toUint80(uint256 value) internal pure returns (uint80) {
if (value > type(uint80).max) {
revert SafeCastOverflowedUintDowncast(80, value);
}
return uint80(value);
}
/**
* @dev Returns the downcasted uint72 from uint256, reverting on
* overflow (when the input is greater than largest uint72).
*
* Counterpart to Solidity's `uint72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toUint72(uint256 value) internal pure returns (uint72) {
if (value > type(uint72).max) {
revert SafeCastOverflowedUintDowncast(72, value);
}
return uint72(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toUint64(uint256 value) internal pure returns (uint64) {
if (value > type(uint64).max) {
revert SafeCastOverflowedUintDowncast(64, value);
}
return uint64(value);
}
/**
* @dev Returns the downcasted uint56 from uint256, reverting on
* overflow (when the input is greater than largest uint56).
*
* Counterpart to Solidity's `uint56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toUint56(uint256 value) internal pure returns (uint56) {
if (value > type(uint56).max) {
revert SafeCastOverflowedUintDowncast(56, value);
}
return uint56(value);
}
/**
* @dev Returns the downcasted uint48 from uint256, reverting on
* overflow (when the input is greater than largest uint48).
*
* Counterpart to Solidity's `uint48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toUint48(uint256 value) internal pure returns (uint48) {
if (value > type(uint48).max) {
revert SafeCastOverflowedUintDowncast(48, value);
}
return uint48(value);
}
/**
* @dev Returns the downcasted uint40 from uint256, reverting on
* overflow (when the input is greater than largest uint40).
*
* Counterpart to Solidity's `uint40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toUint40(uint256 value) internal pure returns (uint40) {
if (value > type(uint40).max) {
revert SafeCastOverflowedUintDowncast(40, value);
}
return uint40(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toUint32(uint256 value) internal pure returns (uint32) {
if (value > type(uint32).max) {
revert SafeCastOverflowedUintDowncast(32, value);
}
return uint32(value);
}
/**
* @dev Returns the downcasted uint24 from uint256, reverting on
* overflow (when the input is greater than largest uint24).
*
* Counterpart to Solidity's `uint24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toUint24(uint256 value) internal pure returns (uint24) {
if (value > type(uint24).max) {
revert SafeCastOverflowedUintDowncast(24, value);
}
return uint24(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toUint16(uint256 value) internal pure returns (uint16) {
if (value > type(uint16).max) {
revert SafeCastOverflowedUintDowncast(16, value);
}
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toUint8(uint256 value) internal pure returns (uint8) {
if (value > type(uint8).max) {
revert SafeCastOverflowedUintDowncast(8, value);
}
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*/
function toUint256(int256 value) internal pure returns (uint256) {
if (value < 0) {
revert SafeCastOverflowedIntToUint(value);
}
return uint256(value);
}
/**
* @dev Returns the downcasted int248 from int256, reverting on
* overflow (when the input is less than smallest int248 or
* greater than largest int248).
*
* Counterpart to Solidity's `int248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toInt248(int256 value) internal pure returns (int248 downcasted) {
downcasted = int248(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(248, value);
}
}
/**
* @dev Returns the downcasted int240 from int256, reverting on
* overflow (when the input is less than smallest int240 or
* greater than largest int240).
*
* Counterpart to Solidity's `int240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toInt240(int256 value) internal pure returns (int240 downcasted) {
downcasted = int240(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(240, value);
}
}
/**
* @dev Returns the downcasted int232 from int256, reverting on
* overflow (when the input is less than smallest int232 or
* greater than largest int232).
*
* Counterpart to Solidity's `int232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toInt232(int256 value) internal pure returns (int232 downcasted) {
downcasted = int232(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(232, value);
}
}
/**
* @dev Returns the downcasted int224 from int256, reverting on
* overflow (when the input is less than smallest int224 or
* greater than largest int224).
*
* Counterpart to Solidity's `int224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toInt224(int256 value) internal pure returns (int224 downcasted) {
downcasted = int224(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(224, value);
}
}
/**
* @dev Returns the downcasted int216 from int256, reverting on
* overflow (when the input is less than smallest int216 or
* greater than largest int216).
*
* Counterpart to Solidity's `int216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toInt216(int256 value) internal pure returns (int216 downcasted) {
downcasted = int216(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(216, value);
}
}
/**
* @dev Returns the downcasted int208 from int256, reverting on
* overflow (when the input is less than smallest int208 or
* greater than largest int208).
*
* Counterpart to Solidity's `int208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toInt208(int256 value) internal pure returns (int208 downcasted) {
downcasted = int208(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(208, value);
}
}
/**
* @dev Returns the downcasted int200 from int256, reverting on
* overflow (when the input is less than smallest int200 or
* greater than largest int200).
*
* Counterpart to Solidity's `int200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toInt200(int256 value) internal pure returns (int200 downcasted) {
downcasted = int200(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(200, value);
}
}
/**
* @dev Returns the downcasted int192 from int256, reverting on
* overflow (when the input is less than smallest int192 or
* greater than largest int192).
*
* Counterpart to Solidity's `int192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toInt192(int256 value) internal pure returns (int192 downcasted) {
downcasted = int192(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(192, value);
}
}
/**
* @dev Returns the downcasted int184 from int256, reverting on
* overflow (when the input is less than smallest int184 or
* greater than largest int184).
*
* Counterpart to Solidity's `int184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toInt184(int256 value) internal pure returns (int184 downcasted) {
downcasted = int184(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(184, value);
}
}
/**
* @dev Returns the downcasted int176 from int256, reverting on
* overflow (when the input is less than smallest int176 or
* greater than largest int176).
*
* Counterpart to Solidity's `int176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toInt176(int256 value) internal pure returns (int176 downcasted) {
downcasted = int176(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(176, value);
}
}
/**
* @dev Returns the downcasted int168 from int256, reverting on
* overflow (when the input is less than smallest int168 or
* greater than largest int168).
*
* Counterpart to Solidity's `int168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toInt168(int256 value) internal pure returns (int168 downcasted) {
downcasted = int168(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(168, value);
}
}
/**
* @dev Returns the downcasted int160 from int256, reverting on
* overflow (when the input is less than smallest int160 or
* greater than largest int160).
*
* Counterpart to Solidity's `int160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toInt160(int256 value) internal pure returns (int160 downcasted) {
downcasted = int160(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(160, value);
}
}
/**
* @dev Returns the downcasted int152 from int256, reverting on
* overflow (when the input is less than smallest int152 or
* greater than largest int152).
*
* Counterpart to Solidity's `int152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toInt152(int256 value) internal pure returns (int152 downcasted) {
downcasted = int152(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(152, value);
}
}
/**
* @dev Returns the downcasted int144 from int256, reverting on
* overflow (when the input is less than smallest int144 or
* greater than largest int144).
*
* Counterpart to Solidity's `int144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toInt144(int256 value) internal pure returns (int144 downcasted) {
downcasted = int144(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(144, value);
}
}
/**
* @dev Returns the downcasted int136 from int256, reverting on
* overflow (when the input is less than smallest int136 or
* greater than largest int136).
*
* Counterpart to Solidity's `int136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toInt136(int256 value) internal pure returns (int136 downcasted) {
downcasted = int136(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(136, value);
}
}
/**
* @dev Returns the downcasted int128 from int256, reverting on
* overflow (when the input is less than smallest int128 or
* greater than largest int128).
*
* Counterpart to Solidity's `int128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toInt128(int256 value) internal pure returns (int128 downcasted) {
downcasted = int128(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(128, value);
}
}
/**
* @dev Returns the downcasted int120 from int256, reverting on
* overflow (when the input is less than smallest int120 or
* greater than largest int120).
*
* Counterpart to Solidity's `int120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toInt120(int256 value) internal pure returns (int120 downcasted) {
downcasted = int120(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(120, value);
}
}
/**
* @dev Returns the downcasted int112 from int256, reverting on
* overflow (when the input is less than smallest int112 or
* greater than largest int112).
*
* Counterpart to Solidity's `int112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toInt112(int256 value) internal pure returns (int112 downcasted) {
downcasted = int112(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(112, value);
}
}
/**
* @dev Returns the downcasted int104 from int256, reverting on
* overflow (when the input is less than smallest int104 or
* greater than largest int104).
*
* Counterpart to Solidity's `int104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toInt104(int256 value) internal pure returns (int104 downcasted) {
downcasted = int104(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(104, value);
}
}
/**
* @dev Returns the downcasted int96 from int256, reverting on
* overflow (when the input is less than smallest int96 or
* greater than largest int96).
*
* Counterpart to Solidity's `int96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toInt96(int256 value) internal pure returns (int96 downcasted) {
downcasted = int96(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(96, value);
}
}
/**
* @dev Returns the downcasted int88 from int256, reverting on
* overflow (when the input is less than smallest int88 or
* greater than largest int88).
*
* Counterpart to Solidity's `int88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toInt88(int256 value) internal pure returns (int88 downcasted) {
downcasted = int88(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(88, value);
}
}
/**
* @dev Returns the downcasted int80 from int256, reverting on
* overflow (when the input is less than smallest int80 or
* greater than largest int80).
*
* Counterpart to Solidity's `int80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toInt80(int256 value) internal pure returns (int80 downcasted) {
downcasted = int80(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(80, value);
}
}
/**
* @dev Returns the downcasted int72 from int256, reverting on
* overflow (when the input is less than smallest int72 or
* greater than largest int72).
*
* Counterpart to Solidity's `int72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toInt72(int256 value) internal pure returns (int72 downcasted) {
downcasted = int72(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(72, value);
}
}
/**
* @dev Returns the downcasted int64 from int256, reverting on
* overflow (when the input is less than smallest int64 or
* greater than largest int64).
*
* Counterpart to Solidity's `int64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toInt64(int256 value) internal pure returns (int64 downcasted) {
downcasted = int64(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(64, value);
}
}
/**
* @dev Returns the downcasted int56 from int256, reverting on
* overflow (when the input is less than smallest int56 or
* greater than largest int56).
*
* Counterpart to Solidity's `int56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toInt56(int256 value) internal pure returns (int56 downcasted) {
downcasted = int56(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(56, value);
}
}
/**
* @dev Returns the downcasted int48 from int256, reverting on
* overflow (when the input is less than smallest int48 or
* greater than largest int48).
*
* Counterpart to Solidity's `int48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toInt48(int256 value) internal pure returns (int48 downcasted) {
downcasted = int48(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(48, value);
}
}
/**
* @dev Returns the downcasted int40 from int256, reverting on
* overflow (when the input is less than smallest int40 or
* greater than largest int40).
*
* Counterpart to Solidity's `int40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toInt40(int256 value) internal pure returns (int40 downcasted) {
downcasted = int40(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(40, value);
}
}
/**
* @dev Returns the downcasted int32 from int256, reverting on
* overflow (when the input is less than smallest int32 or
* greater than largest int32).
*
* Counterpart to Solidity's `int32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toInt32(int256 value) internal pure returns (int32 downcasted) {
downcasted = int32(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(32, value);
}
}
/**
* @dev Returns the downcasted int24 from int256, reverting on
* overflow (when the input is less than smallest int24 or
* greater than largest int24).
*
* Counterpart to Solidity's `int24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toInt24(int256 value) internal pure returns (int24 downcasted) {
downcasted = int24(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(24, value);
}
}
/**
* @dev Returns the downcasted int16 from int256, reverting on
* overflow (when the input is less than smallest int16 or
* greater than largest int16).
*
* Counterpart to Solidity's `int16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toInt16(int256 value) internal pure returns (int16 downcasted) {
downcasted = int16(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(16, value);
}
}
/**
* @dev Returns the downcasted int8 from int256, reverting on
* overflow (when the input is less than smallest int8 or
* greater than largest int8).
*
* Counterpart to Solidity's `int8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toInt8(int256 value) internal pure returns (int8 downcasted) {
downcasted = int8(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(8, value);
}
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*/
function toInt256(uint256 value) internal pure returns (int256) {
// Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
if (value > uint256(type(int256).max)) {
revert SafeCastOverflowedUintToInt(value);
}
return int256(value);
}
/**
* @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.
*/
function toUint(bool b) internal pure returns (uint256 u) {
assembly ("memory-safe") {
u := iszero(iszero(b))
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
import {SafeCast} from "./SafeCast.sol";
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
*
* IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
* However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
* one branch when needed, making this function more expensive.
*/
function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {
unchecked {
// branchless ternary works because:
// b ^ (a ^ b) == a
// b ^ 0 == b
return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));
}
}
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return ternary(a > b, a, b);
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return ternary(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 {
// Formula from the "Bit Twiddling Hacks" by Sean Eron Anderson.
// Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,
// taking advantage of the most significant (or "sign" bit) in two's complement representation.
// This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,
// the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).
int256 mask = n >> 255;
// A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.
return uint256((n + mask) ^ mask);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)
pragma solidity ^0.8.20;
/**
* @dev Helper library for emitting standardized panic codes.
*
* ```solidity
* contract Example {
* using Panic for uint256;
*
* // Use any of the declared internal constants
* function foo() { Panic.GENERIC.panic(); }
*
* // Alternatively
* function foo() { Panic.panic(Panic.GENERIC); }
* }
* ```
*
* Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].
*
* _Available since v5.1._
*/
// slither-disable-next-line unused-state
library Panic {
/// @dev generic / unspecified error
uint256 internal constant GENERIC = 0x00;
/// @dev used by the assert() builtin
uint256 internal constant ASSERT = 0x01;
/// @dev arithmetic underflow or overflow
uint256 internal constant UNDER_OVERFLOW = 0x11;
/// @dev division or modulo by zero
uint256 internal constant DIVISION_BY_ZERO = 0x12;
/// @dev enum conversion error
uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;
/// @dev invalid encoding in storage
uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;
/// @dev empty array pop
uint256 internal constant EMPTY_ARRAY_POP = 0x31;
/// @dev array out of bounds access
uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;
/// @dev resource error (too large allocation or too large array)
uint256 internal constant RESOURCE_ERROR = 0x41;
/// @dev calling invalid internal function
uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;
/// @dev Reverts with a panic code. Recommended to use with
/// the internal constants with predefined codes.
function panic(uint256 code) internal pure {
assembly ("memory-safe") {
mstore(0x00, 0x4e487b71)
mstore(0x20, code)
revert(0x1c, 0x24)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
import {Math} from "./math/Math.sol";
import {SafeCast} from "./math/SafeCast.sol";
import {SignedMath} from "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
using SafeCast for *;
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
uint256 private constant SPECIAL_CHARS_LOOKUP =
(1 << 0x08) | // backspace
(1 << 0x09) | // tab
(1 << 0x0a) | // newline
(1 << 0x0c) | // form feed
(1 << 0x0d) | // carriage return
(1 << 0x22) | // double quote
(1 << 0x5c); // backslash
/**
* @dev The `value` string doesn't fit in the specified `length`.
*/
error StringsInsufficientHexLength(uint256 value, uint256 length);
/**
* @dev The string being parsed contains characters that are not in scope of the given base.
*/
error StringsInvalidChar();
/**
* @dev The string being parsed is not a properly formatted address.
*/
error StringsInvalidAddressFormat();
/**
* @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;
assembly ("memory-safe") {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
assembly ("memory-safe") {
mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toStringSigned(int256 value) internal pure returns (string memory) {
return string.concat(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) {
uint256 localValue = value;
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = HEX_DIGITS[localValue & 0xf];
localValue >>= 4;
}
if (localValue != 0) {
revert StringsInsufficientHexLength(value, length);
}
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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal
* representation, according to EIP-55.
*/
function toChecksumHexString(address addr) internal pure returns (string memory) {
bytes memory buffer = bytes(toHexString(addr));
// hash the hex part of buffer (skip length + 2 bytes, length 40)
uint256 hashValue;
assembly ("memory-safe") {
hashValue := shr(96, keccak256(add(buffer, 0x22), 40))
}
for (uint256 i = 41; i > 1; --i) {
// possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)
if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {
// case shift by xoring with 0x20
buffer[i] ^= 0x20;
}
hashValue >>= 4;
}
return string(buffer);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
/**
* @dev Parse a decimal string and returns the value as a `uint256`.
*
* Requirements:
* - The string must be formatted as `[0-9]*`
* - The result must fit into an `uint256` type
*/
function parseUint(string memory input) internal pure returns (uint256) {
return parseUint(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseUint-string} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `[0-9]*`
* - The result must fit into an `uint256` type
*/
function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
(bool success, uint256 value) = tryParseUint(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {
return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid
* character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseUint(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, uint256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseUintUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseUint-string-uint256-uint256} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseUintUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, uint256 value) {
bytes memory buffer = bytes(input);
uint256 result = 0;
for (uint256 i = begin; i < end; ++i) {
uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
if (chr > 9) return (false, 0);
result *= 10;
result += chr;
}
return (true, result);
}
/**
* @dev Parse a decimal string and returns the value as a `int256`.
*
* Requirements:
* - The string must be formatted as `[-+]?[0-9]*`
* - The result must fit in an `int256` type.
*/
function parseInt(string memory input) internal pure returns (int256) {
return parseInt(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `[-+]?[0-9]*`
* - The result must fit in an `int256` type.
*/
function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {
(bool success, int256 value) = tryParseInt(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if
* the result does not fit in a `int256`.
*
* NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
*/
function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {
return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);
}
uint256 private constant ABS_MIN_INT256 = 2 ** 255;
/**
* @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid
* character or if the result does not fit in a `int256`.
*
* NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
*/
function tryParseInt(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, int256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseIntUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseInt-string-uint256-uint256} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseIntUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, int256 value) {
bytes memory buffer = bytes(input);
// Check presence of a negative sign.
bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
bool positiveSign = sign == bytes1("+");
bool negativeSign = sign == bytes1("-");
uint256 offset = (positiveSign || negativeSign).toUint();
(bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);
if (absSuccess && absValue < ABS_MIN_INT256) {
return (true, negativeSign ? -int256(absValue) : int256(absValue));
} else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {
return (true, type(int256).min);
} else return (false, 0);
}
/**
* @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as a `uint256`.
*
* Requirements:
* - The string must be formatted as `(0x)?[0-9a-fA-F]*`
* - The result must fit in an `uint256` type.
*/
function parseHexUint(string memory input) internal pure returns (uint256) {
return parseHexUint(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseHexUint-string} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `(0x)?[0-9a-fA-F]*`
* - The result must fit in an `uint256` type.
*/
function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
(bool success, uint256 value) = tryParseHexUint(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {
return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an
* invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseHexUint(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, uint256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseHexUintUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseHexUint-string-uint256-uint256} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseHexUintUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, uint256 value) {
bytes memory buffer = bytes(input);
// skip 0x prefix if present
bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
uint256 offset = hasPrefix.toUint() * 2;
uint256 result = 0;
for (uint256 i = begin + offset; i < end; ++i) {
uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
if (chr > 15) return (false, 0);
result *= 16;
unchecked {
// Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).
// This guarantees that adding a value < 16 will not cause an overflow, hence the unchecked.
result += chr;
}
}
return (true, result);
}
/**
* @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as an `address`.
*
* Requirements:
* - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`
*/
function parseAddress(string memory input) internal pure returns (address) {
return parseAddress(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseAddress-string} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`
*/
function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {
(bool success, address value) = tryParseAddress(input, begin, end);
if (!success) revert StringsInvalidAddressFormat();
return value;
}
/**
* @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly
* formatted address. See {parseAddress-string} requirements.
*/
function tryParseAddress(string memory input) internal pure returns (bool success, address value) {
return tryParseAddress(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly
* formatted address. See {parseAddress-string-uint256-uint256} requirements.
*/
function tryParseAddress(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, address value) {
if (end > bytes(input).length || begin > end) return (false, address(0));
bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
uint256 expectedLength = 40 + hasPrefix.toUint() * 2;
// check that input is the correct length
if (end - begin == expectedLength) {
// length guarantees that this does not overflow, and value is at most type(uint160).max
(bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);
return (s, address(uint160(v)));
} else {
return (false, address(0));
}
}
function _tryParseChr(bytes1 chr) private pure returns (uint8) {
uint8 value = uint8(chr);
// Try to parse `chr`:
// - Case 1: [0-9]
// - Case 2: [a-f]
// - Case 3: [A-F]
// - otherwise not supported
unchecked {
if (value > 47 && value < 58) value -= 48;
else if (value > 96 && value < 103) value -= 87;
else if (value > 64 && value < 71) value -= 55;
else return type(uint8).max;
}
return value;
}
/**
* @dev Escape special characters in JSON strings. This can be useful to prevent JSON injection in NFT metadata.
*
* WARNING: This function should only be used in double quoted JSON strings. Single quotes are not escaped.
*
* NOTE: This function escapes all unicode characters, and not just the ones in ranges defined in section 2.5 of
* RFC-4627 (U+0000 to U+001F, U+0022 and U+005C). ECMAScript's `JSON.parse` does recover escaped unicode
* characters that are not in this range, but other tooling may provide different results.
*/
function escapeJSON(string memory input) internal pure returns (string memory) {
bytes memory buffer = bytes(input);
bytes memory output = new bytes(2 * buffer.length); // worst case scenario
uint256 outputLength = 0;
for (uint256 i; i < buffer.length; ++i) {
bytes1 char = bytes1(_unsafeReadBytesOffset(buffer, i));
if (((SPECIAL_CHARS_LOOKUP & (1 << uint8(char))) != 0)) {
output[outputLength++] = "\\";
if (char == 0x08) output[outputLength++] = "b";
else if (char == 0x09) output[outputLength++] = "t";
else if (char == 0x0a) output[outputLength++] = "n";
else if (char == 0x0c) output[outputLength++] = "f";
else if (char == 0x0d) output[outputLength++] = "r";
else if (char == 0x5c) output[outputLength++] = "\\";
else if (char == 0x22) {
// solhint-disable-next-line quotes
output[outputLength++] = '"';
}
} else {
output[outputLength++] = char;
}
}
// write the actual length and deallocate unused memory
assembly ("memory-safe") {
mstore(output, outputLength)
mstore(0x40, add(output, shl(5, shr(5, add(outputLength, 63)))))
}
return string(output);
}
/**
* @dev Reads a bytes32 from a bytes array without bounds checking.
*
* NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the
* assembly block as such would prevent some optimizations.
*/
function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {
// This is not memory safe in the general case, but all calls to this private function are within bounds.
assembly ("memory-safe") {
value := mload(add(buffer, add(0x20, offset)))
}
}
}{
"evmVersion": "paris",
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"uint16","name":"startIndex","type":"uint16"},{"internalType":"uint8[][]","name":"_attrs","type":"uint8[][]"}],"name":"addAttrs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"startIndex","type":"uint8"},{"internalType":"int32[][]","name":"_beards","type":"int32[][]"}],"name":"addBeards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"startIndex","type":"uint8"},{"internalType":"int32[][]","name":"_eyes","type":"int32[][]"}],"name":"addEyes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"startIndex","type":"uint8"},{"internalType":"int32[][]","name":"_hair","type":"int32[][]"}],"name":"addHair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"index","type":"uint16"},{"internalType":"uint24[]","name":"data","type":"uint24[]"}],"name":"addLord","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"startIndex","type":"uint16"},{"internalType":"string[]","name":"_names","type":"string[]"}],"name":"addNames","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"index","type":"uint16"}],"name":"getAttrs","outputs":[{"internalType":"uint8[]","name":"","type":"uint8[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"index","type":"uint16"}],"name":"getName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"index","type":"uint16"}],"name":"getPixels","outputs":[{"internalType":"uint24[]","name":"","type":"uint24[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"index","type":"uint16"}],"name":"getSvg","outputs":[{"internalType":"string","name":"svg","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b5061001f6100b460201b60201c565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100915760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016100889190612a3b565b60405180910390fd5b6100a0816100bc60201b60201c565b506100af61018060201b60201c565b612a56565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b604051806108000160405280600361ffff168152602001600461ffff168152602001600561ffff168152602001601261ffff168152602001601361ffff168152602001601461ffff168152602001601b61ffff168152602001601d61ffff168152602001602a61ffff168152602001602c61ffff168152602001603161ffff168152602001603261ffff168152602001603561ffff168152602001604261ffff168152602001604561ffff168152602001604661ffff168152602001604961ffff168152602001604e61ffff168152602001605961ffff168152602001605e61ffff168152602001606161ffff168152602001606261ffff168152602001606361ffff168152602001606461ffff168152602001607361ffff168152602001607461ffff168152602001607561ffff168152602001607661ffff168152602001607d61ffff168152602001608a61ffff16815260200161016d61ffff16815260200161017a61ffff16815260200161018461ffff16815260200161018761ffff16815260200161018861ffff16815260200161018f61ffff16815260200161019061ffff16815260200161019361ffff16815260200161019961ffff16815260200161019a61ffff16815260200161019b61ffff1681526020016101ac61ffff1681526020016101ad61ffff1681526020016101ae61ffff1681526020016101b161ffff1681526020016101b661ffff1681526020016101c161ffff1681526020016101c661ffff1681526020016101c961ffff1681526020016101ca61ffff1681526020016101cd61ffff1681526020016101da61ffff1681526020016101dd61ffff1681526020016101de61ffff1681526020016101e361ffff1681526020016101e561ffff1681526020016101f261ffff1681526020016101f461ffff1681526020016101fb61ffff1681526020016101fc61ffff1681526020016101fd61ffff16815260200161020a61ffff16815260200161020b61ffff16815260200161020c61ffff16815250600190604061047c929190612135565b50604051806105c00160405280601c61ffff168152602001602b61ffff168152602001603361ffff168152602001603461ffff168152602001604361ffff168152602001604461ffff168152602001604a61ffff168152602001604b61ffff168152602001604c61ffff168152602001604d61ffff168152602001605a61ffff168152602001605b61ffff168152602001605c61ffff168152602001605d61ffff168152602001606561ffff168152602001606661ffff168152602001607161ffff168152602001607261ffff16815260200161016e61ffff16815260200161016f61ffff16815260200161017861ffff16815260200161017961ffff16815260200161018561ffff16815260200161018661ffff16815260200161019161ffff16815260200161019261ffff16815260200161019c61ffff16815260200161019d61ffff16815260200161019e61ffff1681526020016101a961ffff1681526020016101aa61ffff1681526020016101ab61ffff1681526020016101b261ffff1681526020016101b361ffff1681526020016101b461ffff1681526020016101b561ffff1681526020016101c261ffff1681526020016101c361ffff1681526020016101c461ffff1681526020016101c561ffff1681526020016101cb61ffff1681526020016101cc61ffff1681526020016101db61ffff1681526020016101dc61ffff1681526020016101e461ffff1681526020016101f361ffff16815250600290602e6106ad9291906121df565b50604051806106800160405280605061ffff168152602001605161ffff168152602001605261ffff168152602001605361ffff168152602001605461ffff168152602001605561ffff168152602001605661ffff168152602001605761ffff168152602001606761ffff168152602001607061ffff168152602001607e61ffff168152602001608961ffff168152602001609661ffff16815260200160a161ffff16815260200160ad61ffff16815260200160ba61ffff16815260200160c561ffff16815260200160d261ffff16815260200160dd61ffff16815260200160ea61ffff16815260200160f561ffff16815260200161010261ffff16815260200161010d61ffff16815260200161011a61ffff16815260200161012561ffff16815260200161012661ffff16815260200161013161ffff16815260200161013261ffff16815260200161013e61ffff16815260200161014961ffff16815260200161015661ffff16815260200161015761ffff16815260200161015861ffff16815260200161015f61ffff16815260200161016061ffff16815260200161016161ffff16815260200161017061ffff16815260200161017761ffff16815260200161019f61ffff1681526020016101a861ffff1681526020016101b761ffff1681526020016101b861ffff1681526020016101bf61ffff1681526020016101c061ffff1681526020016101d061ffff1681526020016101d161ffff1681526020016101d661ffff1681526020016101d761ffff1681526020016101ea61ffff1681526020016101eb61ffff1681526020016101ec61ffff1681526020016101ed61ffff168152506003906034610923929190612289565b50604051806112000160405280606861ffff168152602001606961ffff168152602001606a61ffff168152602001606b61ffff168152602001606c61ffff168152602001606d61ffff168152602001606e61ffff168152602001606f61ffff168152602001607f61ffff168152602001608061ffff168152602001608161ffff168152602001608261ffff168152602001608361ffff168152602001608461ffff168152602001608561ffff168152602001608661ffff168152602001608761ffff168152602001608861ffff168152602001609761ffff168152602001609861ffff168152602001609961ffff168152602001609a61ffff168152602001609b61ffff168152602001609c61ffff168152602001609d61ffff168152602001609e61ffff168152602001609f61ffff16815260200160a061ffff16815260200160ae61ffff16815260200160af61ffff16815260200160b061ffff16815260200160b161ffff16815260200160b261ffff16815260200160b361ffff16815260200160b461ffff16815260200160b561ffff16815260200160b661ffff16815260200160b761ffff16815260200160b861ffff16815260200160b961ffff16815260200160c661ffff16815260200160c761ffff16815260200160c861ffff16815260200160c961ffff16815260200160ca61ffff16815260200160cb61ffff16815260200160cc61ffff16815260200160cd61ffff16815260200160ce61ffff16815260200160cf61ffff16815260200160d061ffff16815260200160d161ffff16815260200160de61ffff16815260200160df61ffff16815260200160e061ffff16815260200160e161ffff16815260200160e261ffff16815260200160e361ffff16815260200160e461ffff16815260200160e561ffff16815260200160e661ffff16815260200160e761ffff16815260200160e861ffff16815260200160e961ffff16815260200160f661ffff16815260200160f761ffff16815260200160f861ffff16815260200160f961ffff16815260200160fa61ffff16815260200160fb61ffff16815260200160fc61ffff16815260200160fd61ffff16815260200160fe61ffff16815260200160ff61ffff16815260200161010061ffff16815260200161010161ffff16815260200161010e61ffff16815260200161010f61ffff16815260200161011061ffff16815260200161011161ffff16815260200161011261ffff16815260200161011361ffff16815260200161011461ffff16815260200161011561ffff16815260200161011661ffff16815260200161011761ffff16815260200161011861ffff16815260200161011961ffff16815260200161012761ffff16815260200161012861ffff16815260200161012961ffff16815260200161012a61ffff16815260200161012b61ffff16815260200161012c61ffff16815260200161012d61ffff16815260200161012e61ffff16815260200161012f61ffff16815260200161013061ffff16815260200161013f61ffff16815260200161014061ffff16815260200161014161ffff16815260200161014261ffff16815260200161014361ffff16815260200161014461ffff16815260200161014561ffff16815260200161014661ffff16815260200161014761ffff16815260200161014861ffff16815260200161015961ffff16815260200161015a61ffff16815260200161015b61ffff16815260200161015c61ffff16815260200161015d61ffff16815260200161015e61ffff16815260200161017161ffff16815260200161017261ffff16815260200161017361ffff16815260200161017461ffff16815260200161017561ffff16815260200161017661ffff16815260200161018961ffff16815260200161018a61ffff16815260200161018b61ffff16815260200161018c61ffff16815260200161018d61ffff16815260200161018e61ffff1681526020016101a061ffff1681526020016101a161ffff1681526020016101a261ffff1681526020016101a361ffff1681526020016101a461ffff1681526020016101a561ffff1681526020016101a661ffff1681526020016101a761ffff1681526020016101b961ffff1681526020016101ba61ffff1681526020016101bb61ffff1681526020016101bc61ffff1681526020016101bd61ffff1681526020016101be61ffff1681526020016101d261ffff1681526020016101d361ffff1681526020016101d461ffff1681526020016101d561ffff168152506004906090610fb4929190612333565b5060405180611080016040528062ffffff80168152602001600062ffffff16815260200162f8f9fa62ffffff16815260200162f1f3f562ffffff16815260200162e9ecef62ffffff16815260200162dee2e662ffffff16815260200162ced4da62ffffff16815260200162adb5bd62ffffff16815260200162868e9662ffffff1681526020016249505762ffffff16815260200162343a4062ffffff1681526020016221252962ffffff16815260200162fff5f562ffffff16815260200162ffe3e362ffffff16815260200162ffc9c962ffffff16815260200162ffa8a862ffffff16815260200162ff878762ffffff16815260200162ff6b6b62ffffff16815260200162fa525262ffffff16815260200162f03e3e62ffffff16815260200162e0313162ffffff16815260200162c92a2a62ffffff16815260200162fff0f662ffffff16815260200162ffdeeb62ffffff16815260200162fcc2d762ffffff16815260200162faa2c162ffffff16815260200162f783ac62ffffff16815260200162f0659562ffffff16815260200162e6498062ffffff16815260200162d6336c62ffffff16815260200162c2255c62ffffff16815260200162a61e4d62ffffff16815260200162f8f0fc62ffffff16815260200162f3d9fa62ffffff16815260200162eebefa62ffffff16815260200162e599f762ffffff16815260200162da77f262ffffff16815260200162cc5de862ffffff16815260200162be4bdb62ffffff16815260200162ae3ec962ffffff168152602001629c36b562ffffff16815260200162862e9c62ffffff16815260200162f3f0ff62ffffff16815260200162e5dbff62ffffff16815260200162d0bfff62ffffff16815260200162b197fc62ffffff168152602001629775fa62ffffff16815260200162845ef762ffffff168152602001627950f262ffffff168152602001627048e862ffffff168152602001626741d962ffffff168152602001625f3dc462ffffff16815260200162edf2ff62ffffff16815260200162dbe4ff62ffffff16815260200162bac8ff62ffffff1681526020016291a7ff62ffffff16815260200162748ffc62ffffff168152602001625c7cfa62ffffff168152602001624c6ef562ffffff168152602001624263eb62ffffff168152602001623b5bdb62ffffff16815260200162364fc762ffffff16815260200162e7f5ff62ffffff16815260200162d0ebff62ffffff16815260200162a5d8ff62ffffff1681526020016274c0fc62ffffff168152602001624dabf762ffffff16815260200162339af062ffffff16815260200162228be662ffffff168152602001621c7ed662ffffff168152602001621971c262ffffff168152602001621864ab62ffffff16815260200162e3fafc62ffffff16815260200162c5f6fa62ffffff1681526020016299e9f262ffffff1681526020016266d9e862ffffff168152602001623bc9db62ffffff1681526020016222b8cf62ffffff1681526020016215aabf62ffffff168152602001621098ad62ffffff168152602001620c859962ffffff168152602001620b728562ffffff16815260200162e6fcf562ffffff16815260200162c3fae862ffffff1681526020016296f2d762ffffff1681526020016263e6be62ffffff1681526020016238d9a962ffffff1681526020016220c99762ffffff1681526020016212b88662ffffff168152602001620ca67862ffffff1681526020016209926862ffffff16815260200162087f5b62ffffff16815260200162ebfbee62ffffff16815260200162d3f9d862ffffff16815260200162b2f2bb62ffffff168152602001628ce99a62ffffff1681526020016269db7c62ffffff1681526020016251cf6662ffffff1681526020016240c05762ffffff1681526020016237b24d62ffffff168152602001622f9e4462ffffff168152602001622b8a3e62ffffff16815260200162f4fce362ffffff16815260200162e9fac862ffffff16815260200162d8f5a262ffffff16815260200162c0eb7562ffffff16815260200162a9e34b62ffffff1681526020016294d82d62ffffff1681526020016282c91e62ffffff1681526020016274b81662ffffff1681526020016266a80f62ffffff168152602001625c940d62ffffff16815260200162fff9db62ffffff16815260200162fff3bf62ffffff16815260200162ffec9962ffffff16815260200162ffe06662ffffff16815260200162ffd43b62ffffff16815260200162fcc41962ffffff16815260200162fab00562ffffff16815260200162f59f0062ffffff16815260200162f08c0062ffffff16815260200162e6770062ffffff16815260200162fff4e662ffffff16815260200162ffe8cc62ffffff16815260200162ffd8a862ffffff16815260200162ffc07862ffffff16815260200162ffa94d62ffffff16815260200162ff922b62ffffff16815260200162fd7e1462ffffff16815260200162f7670762ffffff16815260200162e8590c62ffffff16815260200162d9480f62ffffff1681525060059060846117029291906123dd565b50604051806101e0016040528061968862ffffff168152602001624caf5062ffffff16815260200162cddc3962ffffff16815260200162ffeb3b62ffffff16815260200162ffc10762ffffff16815260200162ff572262ffffff16815260200162ffcdd262ffffff168152602001600062ffffff16815260200162f4433662ffffff16815260200162e91e6362ffffff168152602001629c27b062ffffff16815260200162673ab762ffffff168152602001623f51b562ffffff168152602001622196f362ffffff16815260200161bcd462ffffff16815250600690600f6117eb92919061248a565b50604051806101e0016040528062f4433662ffffff16815260200162e91e6362ffffff168152602001629c27b062ffffff16815260200162673ab762ffffff168152602001623f51b562ffffff1681526020016203a9f462ffffff16815260200161968862ffffff168152602001624caf5062ffffff16815260200162cddc3962ffffff16815260200162ffeb3b62ffffff16815260200162ff980062ffffff16815260200162ff572262ffffff1681526020016279554862ffffff16815260200162607d8b62ffffff16815260200162ffffff8016815250600790600f6118d492919061248a565b506040518060a0016040528061012c61ffff16815260200161014361ffff16815260200161014461ffff16815260200161015b61ffff16815260200161015c61ffff16815250600860008060ff16815260200190815260200160002090600561193e929190612537565b50604051806080016040528061012b61ffff16815260200161012c61ffff16815260200161014361ffff16815260200161014461ffff1681525060086000600160ff16815260200190815260200160002090600461199d9291906125e1565b50604051806080016040528061012c61ffff16815260200161014461ffff16815260200161015b61ffff16815260200161015c61ffff1681525060086000600260ff1681526020019081526020016000209060046119fc9291906125e1565b50604051806060016040528061014361ffff16815260200161015b61ffff16815260200161015c61ffff1681525060086000600360ff168152602001908152602001600020906003611a4f92919061268b565b50604051806080016040528061012b61ffff16815260200161014361ffff16815260200161015b61ffff16815260200161015c61ffff1681525060086000600460ff168152602001908152602001600020906004611aae9291906125e1565b50604051806060016040528061014461ffff16815260200161015b61ffff16815260200161015c61ffff1681525060086000600560ff168152602001908152602001600020906003611b0192919061268b565b50604051806060016040528061014361ffff16815260200161014461ffff16815260200161015b61ffff1681525060086000600660ff168152602001908152602001600020906003611b5492919061268b565b50604051806060016040528061014361ffff16815260200161014461ffff16815260200161015c61ffff1681525060086000600760ff168152602001908152602001600020906003611ba792919061268b565b50604051806080016040528061018a61ffff16815260200161018c61ffff1681526020016101a361ffff1681526020016101a561ffff16815250600960008060ff168152602001908152602001600020906004611c059291906125e1565b5060405180610140016040528061018961ffff16815260200161018b61ffff16815260200161018c61ffff16815260200161018e61ffff1681526020016101a261ffff1681526020016101a361ffff1681526020016101a461ffff1681526020016101a561ffff1681526020016101bb61ffff1681526020016101bc61ffff1681525060096000600160ff16815260200190815260200160002090600a611cad929190612735565b506040518060e0016040528061018a61ffff16815260200161018c61ffff16815260200161018e61ffff1681526020016101a161ffff1681526020016101a361ffff1681526020016101a461ffff1681526020016101a561ffff1681525060096000600260ff168152602001908152602001600020906007611d309291906127df565b506040518060c0016040528061018a61ffff16815260200161018b61ffff16815260200161018c61ffff16815260200161018d61ffff1681526020016101a161ffff1681526020016101a661ffff1681525060096000600360ff168152602001908152602001600020906006611da7929190612889565b5060405180610100016040528061018a61ffff16815260200161018b61ffff16815260200161018c61ffff16815260200161018e61ffff1681526020016101a161ffff1681526020016101a361ffff1681526020016101a461ffff1681526020016101a561ffff1681525060096000600460ff168152602001908152602001600020906008611e37929190612933565b5060405180610140016040528061018a61ffff16815260200161018d61ffff1681526020016101a161ffff1681526020016101a261ffff1681526020016101a361ffff1681526020016101a461ffff1681526020016101a561ffff1681526020016101a661ffff1681526020016101bb61ffff1681526020016101bc61ffff1681525060096000600560ff16815260200190815260200160002090600a611edf929190612735565b506040518060c0016040528061018a61ffff16815260200161018b61ffff16815260200161018c61ffff1681526020016101a361ffff1681526020016101a461ffff1681526020016101a561ffff1681525060096000600660ff168152602001908152602001600020906006611f56929190612889565b506040518060c0016040528061018961ffff16815260200161018b61ffff16815260200161018c61ffff16815260200161018e61ffff1681526020016101a261ffff1681526020016101a561ffff1681525060096000600760ff168152602001908152602001600020906006611fcd929190612889565b506040518060c0016040528061018961ffff16815260200161018e61ffff1681526020016101a261ffff1681526020016101a561ffff1681526020016101bb61ffff1681526020016101bc61ffff1681525060096000600860ff168152602001908152602001600020906006612044929190612889565b506040518060c0016040528061018a61ffff16815260200161018c61ffff16815260200161018e61ffff1681526020016101a161ffff1681526020016101a361ffff1681526020016101a561ffff1681525060096000600960ff1681526020019081526020016000209060066120bb929190612889565b506040518060c0016040528061018961ffff16815260200161018b61ffff16815260200161018d61ffff1681526020016101a261ffff1681526020016101a461ffff1681526020016101a661ffff1681525060096000600a60ff168152602001908152602001600020906006612132929190612889565b50565b82805482825590600052602060002090600f016010900481019282156121ce5791602002820160005b8382111561219e57835183826101000a81548161ffff021916908361ffff160217905550926020019260020160208160010104928301926001030261215e565b80156121cc5782816101000a81549061ffff021916905560020160208160010104928301926001030261219e565b505b5090506121db91906129dd565b5090565b82805482825590600052602060002090600f016010900481019282156122785791602002820160005b8382111561224857835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302612208565b80156122765782816101000a81549061ffff0219169055600201602081600101049283019260010302612248565b505b50905061228591906129dd565b5090565b82805482825590600052602060002090600f016010900481019282156123225791602002820160005b838211156122f257835183826101000a81548161ffff021916908361ffff16021790555092602001926002016020816001010492830192600103026122b2565b80156123205782816101000a81549061ffff02191690556002016020816001010492830192600103026122f2565b505b50905061232f91906129dd565b5090565b82805482825590600052602060002090600f016010900481019282156123cc5791602002820160005b8382111561239c57835183826101000a81548161ffff021916908361ffff160217905550926020019260020160208160010104928301926001030261235c565b80156123ca5782816101000a81549061ffff021916905560020160208160010104928301926001030261239c565b505b5090506123d991906129dd565b5090565b82805482825590600052602060002090600901600a900481019282156124795791602002820160005b8382111561244857835183826101000a81548162ffffff021916908362ffffff1602179055509260200192600301602081600201049283019260010302612406565b80156124775782816101000a81549062ffffff0219169055600301602081600201049283019260010302612448565b505b50905061248691906129dd565b5090565b82805482825590600052602060002090600901600a900481019282156125265791602002820160005b838211156124f557835183826101000a81548162ffffff021916908362ffffff16021790555092602001926003016020816002010492830192600103026124b3565b80156125245782816101000a81549062ffffff02191690556003016020816002010492830192600103026124f5565b505b50905061253391906129dd565b5090565b82805482825590600052602060002090600f016010900481019282156125d05791602002820160005b838211156125a057835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302612560565b80156125ce5782816101000a81549061ffff02191690556002016020816001010492830192600103026125a0565b505b5090506125dd91906129dd565b5090565b82805482825590600052602060002090600f0160109004810192821561267a5791602002820160005b8382111561264a57835183826101000a81548161ffff021916908361ffff160217905550926020019260020160208160010104928301926001030261260a565b80156126785782816101000a81549061ffff021916905560020160208160010104928301926001030261264a565b505b50905061268791906129dd565b5090565b82805482825590600052602060002090600f016010900481019282156127245791602002820160005b838211156126f457835183826101000a81548161ffff021916908361ffff16021790555092602001926002016020816001010492830192600103026126b4565b80156127225782816101000a81549061ffff02191690556002016020816001010492830192600103026126f4565b505b50905061273191906129dd565b5090565b82805482825590600052602060002090600f016010900481019282156127ce5791602002820160005b8382111561279e57835183826101000a81548161ffff021916908361ffff160217905550926020019260020160208160010104928301926001030261275e565b80156127cc5782816101000a81549061ffff021916905560020160208160010104928301926001030261279e565b505b5090506127db91906129dd565b5090565b82805482825590600052602060002090600f016010900481019282156128785791602002820160005b8382111561284857835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302612808565b80156128765782816101000a81549061ffff0219169055600201602081600101049283019260010302612848565b505b50905061288591906129dd565b5090565b82805482825590600052602060002090600f016010900481019282156129225791602002820160005b838211156128f257835183826101000a81548161ffff021916908361ffff16021790555092602001926002016020816001010492830192600103026128b2565b80156129205782816101000a81549061ffff02191690556002016020816001010492830192600103026128f2565b505b50905061292f91906129dd565b5090565b82805482825590600052602060002090600f016010900481019282156129cc5791602002820160005b8382111561299c57835183826101000a81548161ffff021916908361ffff160217905550926020019260020160208160010104928301926001030261295c565b80156129ca5782816101000a81549061ffff021916905560020160208160010104928301926001030261299c565b505b5090506129d991906129dd565b5090565b5b808211156129f65760008160009055506001016129de565b5090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a25826129fa565b9050919050565b612a3581612a1a565b82525050565b6000602082019050612a506000830184612a2c565b92915050565b612d4180612a656000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063715018a61161008c5780638da5cb5b116100665780638da5cb5b146101fa578063d74c766614610218578063f2fde38b14610248578063f386a26d14610264576100cf565b8063715018a6146101b8578063768a9d90146101c25780637a53d0d3146101de576100cf565b80630b361633146100d4578063236d064f146100f05780634743faff1461012057806352fbf1e11461013c57806364e7ca66146101585780636de9c65f14610188575b600080fd5b6100ee60048036038101906100e99190611be0565b610280565b005b61010a60048036038101906101059190611c3c565b6102bc565b6040516101179190611ce8565b60405180910390f35b61013a60048036038101906101359190611ee7565b610369565b005b610156600480360381019061015191906120d9565b6103f0565b005b610172600480360381019061016d9190611c3c565b610470565b60405161017f91906121f3565b60405180910390f35b6101a2600480360381019061019d9190611c3c565b610d7c565b6040516101af9190611ce8565b60405180910390f35b6101c0610eaa565b005b6101dc60048036038101906101d791906123f2565b610ebe565b005b6101f860048036038101906101f391906123f2565b610f41565b005b610202610fc4565b60405161020f919061248f565b60405180910390f35b610232600480360381019061022d9190611c3c565b610fed565b60405161023f9190612568565b60405180910390f35b610262600480360381019061025d91906125b6565b611086565b005b61027e600480360381019061027991906123f2565b61110c565b005b61028861118f565b80600d60008461ffff1661ffff16815260200190815260200160002090805190602001906102b79291906117da565b505050565b6060600f60008361ffff1661ffff16815260200190815260200160002080546102e490612612565b80601f016020809104026020016040519081016040528092919081815260200182805461031090612612565b801561035d5780601f106103325761010080835404028352916020019161035d565b820191906000526020600020905b81548152906001019060200180831161034057829003601f168201915b50505050509050919050565b61037161118f565b60005b81518161ffff1610156103eb57818161ffff168151811061039857610397612643565b5b6020026020010151600e600083866103b091906126a1565b61ffff1661ffff16815260200190815260200160002090805190602001906103d9929190611887565b50806103e4906126d7565b9050610374565b505050565b6103f861118f565b60005b81518161ffff16101561046b57818161ffff168151811061041f5761041e612643565b5b6020026020010151600f6000838661043791906126a1565b61ffff1661ffff168152602001908152602001600020908161045991906128b7565b5080610464906126d7565b90506103fb565b505050565b60606000600e60008461ffff1661ffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156104ff57602002820191906000526020600020906000905b82829054906101000a900460ff1660ff16815260200190600101906020826000010492830192600103820291508084116104c85790505b5050505050905060018160008151811061051c5761051b612643565b5b602002602001015160ff16036105c857600d60008461ffff1661ffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156105bb57602002820191906000526020600020906000905b82829054906101000a900462ffffff1662ffffff16815260200190600301906020826002010492830192600103820291508084116105805790505b5050505050915050610d77565b600061024061ffff1667ffffffffffffffff8111156105ea576105e9611a62565b5b6040519080825280602002602001820160405280156106185781602001602082028036833780820191505090505b509050600060058360018151811061063357610632612643565b5b602002602001015160ff168154811061064f5761064e612643565b5b90600052602060002090600a91828204019190066003029054906101000a900462ffffff16905060005b61024061ffff168161ffff1610156106c65781838261ffff16815181106106a3576106a2612643565b5b602002602001019062ffffff16908162ffffff1681525050806001019050610679565b50600e836007815181106106dd576106dc612643565b5b602002602001015160ff16116108495761076f600180548060200260200160405190810160405280929190818152602001828054801561076457602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff168152602001906002019060208260010104928301926001038202915080841161072b5790505b505050505083611216565b61084860028054806020026020016040519081016040528092919081815260200182805480156107e657602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116107ad5790505b505050505060068560078151811061080157610800612643565b5b602002602001015160ff168154811061081d5761081c612643565b5b90600052602060002090600a91828204019190066003029054906101000a900462ffffff168461128b565b5b6108cb60038054806020026020016040519081016040528092919081815260200182805480156108c057602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116108875790505b505050505083611216565b6109a4600480548060200260200160405190810160405280929190818152602001828054801561094257602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116109095790505b505050505060078560028151811061095d5761095c612643565b5b602002602001015160ff168154811061097957610978612643565b5b90600052602060002090600a91828204019190066003029054906101000a900462ffffff168461128b565b610a56600a6000856004815181106109bf576109be612643565b5b602002602001015160ff1660ff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610a4b57602002820191906000526020600020906000905b82829054906101000a900460030b60030b81526020019060040190602082600301049283019260010382029150808411610a145790505b5050505050836112fe565b610b0a6008600085600581518110610a7157610a70612643565b5b602002602001015160ff1660ff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610aff57602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411610ac65790505b505050505083611216565b610bbe6009600085600681518110610b2557610b24612643565b5b602002602001015160ff1660ff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610bb357602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411610b7a5790505b505050505083611216565b607983600381518110610bd457610bd3612643565b5b602002602001015160ff1611610c9757610c96600b600085600381518110610bff57610bfe612643565b5b602002602001015160ff1660ff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610c8b57602002820191906000526020600020906000905b82829054906101000a900460030b60030b81526020019060040190602082600301049283019260010382029150808411610c545790505b5050505050836112fe565b5b600783600881518110610cad57610cac612643565b5b602002602001015160ff1611610d7057610d6f600c600085600881518110610cd857610cd7612643565b5b602002602001015160ff1660ff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610d6457602002820191906000526020600020906000905b82829054906101000a900460030b60030b81526020019060040190602082600301049283019260010382029150808411610d2d5790505b5050505050836112fe565b5b8193505050505b919050565b60606000610d8983610470565b905060005b6018811015610e305760005b6018811015610e245783610dad826113de565b610db6846113de565b610df58685876018610dc89190612989565b610dd291906129cb565b81518110610de357610de2612643565b5b602002602001015162ffffff166114ac565b604051602001610e089493929190612b1f565b6040516020818303038152906040529350806001019050610d9a565b50806001019050610d8e565b506040518060800160405280604a8152602001612cc2604a9139826040518060400160405280600681526020017f3c2f7376673e0000000000000000000000000000000000000000000000000000815250604051602001610e9393929190612b95565b604051602081830303815290604052915050919050565b610eb261118f565b610ebc60006115bb565b565b610ec661118f565b60005b81518160ff161015610f3c57818160ff1681518110610eeb57610eea612643565b5b6020026020010151600b60008386610f039190612bc6565b60ff1660ff1681526020019081526020016000209080519060200190610f2a92919061192e565b5080610f3590612bfb565b9050610ec9565b505050565b610f4961118f565b60005b81518160ff161015610fbf57818160ff1681518110610f6e57610f6d612643565b5b6020026020010151600c60008386610f869190612bc6565b60ff1660ff1681526020019081526020016000209080519060200190610fad92919061192e565b5080610fb890612bfb565b9050610f4c565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600e60008361ffff1661ffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561107a57602002820191906000526020600020906000905b82829054906101000a900460ff1660ff16815260200190600101906020826000010492830192600103820291508084116110435790505b50505050509050919050565b61108e61118f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036111005760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016110f7919061248f565b60405180910390fd5b611109816115bb565b50565b61111461118f565b60005b81518160ff16101561118a57818160ff168151811061113957611138612643565b5b6020026020010151600a600083866111519190612bc6565b60ff1660ff168152602001908152602001600020908051906020019061117892919061192e565b508061118390612bfb565b9050611117565b505050565b61119761167f565b73ffffffffffffffffffffffffffffffffffffffff166111b5610fc4565b73ffffffffffffffffffffffffffffffffffffffff1614611214576111d861167f565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161120b919061248f565b60405180910390fd5b565b60005b82518160ff161015611286576226323882848360ff16815181106112405761123f612643565b5b602002602001015161ffff168151811061125d5761125c612643565b5b602002602001019062ffffff16908162ffffff16815250508061127f90612bfb565b9050611219565b505050565b60005b83518160ff1610156112f8578282858360ff16815181106112b2576112b1612643565b5b602002602001015161ffff16815181106112cf576112ce612643565b5b602002602001019062ffffff16908162ffffff1681525050806112f190612bfb565b905061128e565b50505050565b60008260008151811061131457611313612643565b5b602002602001015190506000600190505b83518160ff1610156113d8576000848260ff168151811061134957611348612643565b5b602002602001015160030b146113c75762ffffff848260ff168151811061137357611372612643565b5b6020026020010151168360018360ff168561138e9190612c24565b6113989190612c5b565b62ffffff16815181106113ae576113ad612643565b5b602002602001019062ffffff16908162ffffff16815250505b806113d190612bfb565b9050611325565b50505050565b6060600060016113ed84611687565b01905060008167ffffffffffffffff81111561140c5761140b611a62565b5b6040519080825280601f01601f19166020018201604052801561143e5781602001600182028036833780820191505090505b509050600082602001820190505b6001156114a1578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161149557611494612c92565b5b0494506000850361144c575b819350505050919050565b606060008290506000600660ff1667ffffffffffffffff8111156114d3576114d2611a62565b5b6040519080825280601f01601f1916602001820160405280156115055781602001600182028036833780820191505090505b5090506000600690505b60008160ff1611156115b0577f3031323334353637383961626364656600000000000000000000000000000000600f84166010811061155157611550612643565b5b1a60f81b826001830360ff168151811061156e5761156d612643565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600483901c92508060019003905061150f565b508092505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106116e5577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816116db576116da612c92565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310611722576d04ee2d6d415b85acef8100000000838161171857611717612c92565b5b0492506020810190505b662386f26fc10000831061175157662386f26fc10000838161174757611746612c92565b5b0492506010810190505b6305f5e100831061177a576305f5e10083816117705761176f612c92565b5b0492506008810190505b612710831061179f57612710838161179557611794612c92565b5b0492506004810190505b606483106117c257606483816117b8576117b7612c92565b5b0492506002810190505b600a83106117d1576001810190505b80915050919050565b82805482825590600052602060002090600901600a900481019282156118765791602002820160005b8382111561184557835183826101000a81548162ffffff021916908362ffffff1602179055509260200192600301602081600201049283019260010302611803565b80156118745782816101000a81549062ffffff0219169055600301602081600201049283019260010302611845565b505b50905061188391906119e1565b5090565b82805482825590600052602060002090601f0160209004810192821561191d5791602002820160005b838211156118ee57835183826101000a81548160ff021916908360ff16021790555092602001926001016020816000010492830192600103026118b0565b801561191b5782816101000a81549060ff02191690556001016020816000010492830192600103026118ee565b505b50905061192a91906119e1565b5090565b828054828255906000526020600020906007016008900481019282156119d05791602002820160005b8382111561199e57835183826101000a81548163ffffffff021916908360030b63ffffffff1602179055509260200192600401602081600301049283019260010302611957565b80156119ce5782816101000a81549063ffffffff021916905560040160208160030104928301926001030261199e565b505b5090506119dd91906119e1565b5090565b5b808211156119fa5760008160009055506001016119e2565b5090565b6000604051905090565b600080fd5b600080fd5b600061ffff82169050919050565b611a2981611a12565b8114611a3457600080fd5b50565b600081359050611a4681611a20565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611a9a82611a51565b810181811067ffffffffffffffff82111715611ab957611ab8611a62565b5b80604052505050565b6000611acc6119fe565b9050611ad88282611a91565b919050565b600067ffffffffffffffff821115611af857611af7611a62565b5b602082029050602081019050919050565b600080fd5b600062ffffff82169050919050565b611b2681611b0e565b8114611b3157600080fd5b50565b600081359050611b4381611b1d565b92915050565b6000611b5c611b5784611add565b611ac2565b90508083825260208201905060208402830185811115611b7f57611b7e611b09565b5b835b81811015611ba85780611b948882611b34565b845260208401935050602081019050611b81565b5050509392505050565b600082601f830112611bc757611bc6611a4c565b5b8135611bd7848260208601611b49565b91505092915050565b60008060408385031215611bf757611bf6611a08565b5b6000611c0585828601611a37565b925050602083013567ffffffffffffffff811115611c2657611c25611a0d565b5b611c3285828601611bb2565b9150509250929050565b600060208284031215611c5257611c51611a08565b5b6000611c6084828501611a37565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611ca3578082015181840152602081019050611c88565b60008484015250505050565b6000611cba82611c69565b611cc48185611c74565b9350611cd4818560208601611c85565b611cdd81611a51565b840191505092915050565b60006020820190508181036000830152611d028184611caf565b905092915050565b600067ffffffffffffffff821115611d2557611d24611a62565b5b602082029050602081019050919050565b600067ffffffffffffffff821115611d5157611d50611a62565b5b602082029050602081019050919050565b600060ff82169050919050565b611d7881611d62565b8114611d8357600080fd5b50565b600081359050611d9581611d6f565b92915050565b6000611dae611da984611d36565b611ac2565b90508083825260208201905060208402830185811115611dd157611dd0611b09565b5b835b81811015611dfa5780611de68882611d86565b845260208401935050602081019050611dd3565b5050509392505050565b600082601f830112611e1957611e18611a4c565b5b8135611e29848260208601611d9b565b91505092915050565b6000611e45611e4084611d0a565b611ac2565b90508083825260208201905060208402830185811115611e6857611e67611b09565b5b835b81811015611eaf57803567ffffffffffffffff811115611e8d57611e8c611a4c565b5b808601611e9a8982611e04565b85526020850194505050602081019050611e6a565b5050509392505050565b600082601f830112611ece57611ecd611a4c565b5b8135611ede848260208601611e32565b91505092915050565b60008060408385031215611efe57611efd611a08565b5b6000611f0c85828601611a37565b925050602083013567ffffffffffffffff811115611f2d57611f2c611a0d565b5b611f3985828601611eb9565b9150509250929050565b600067ffffffffffffffff821115611f5e57611f5d611a62565b5b602082029050602081019050919050565b600080fd5b600067ffffffffffffffff821115611f8f57611f8e611a62565b5b611f9882611a51565b9050602081019050919050565b82818337600083830152505050565b6000611fc7611fc284611f74565b611ac2565b905082815260208101848484011115611fe357611fe2611f6f565b5b611fee848285611fa5565b509392505050565b600082601f83011261200b5761200a611a4c565b5b813561201b848260208601611fb4565b91505092915050565b600061203761203284611f43565b611ac2565b9050808382526020820190506020840283018581111561205a57612059611b09565b5b835b818110156120a157803567ffffffffffffffff81111561207f5761207e611a4c565b5b80860161208c8982611ff6565b8552602085019450505060208101905061205c565b5050509392505050565b600082601f8301126120c0576120bf611a4c565b5b81356120d0848260208601612024565b91505092915050565b600080604083850312156120f0576120ef611a08565b5b60006120fe85828601611a37565b925050602083013567ffffffffffffffff81111561211f5761211e611a0d565b5b61212b858286016120ab565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61216a81611b0e565b82525050565b600061217c8383612161565b60208301905092915050565b6000602082019050919050565b60006121a082612135565b6121aa8185612140565b93506121b583612151565b8060005b838110156121e65781516121cd8882612170565b97506121d883612188565b9250506001810190506121b9565b5085935050505092915050565b6000602082019050818103600083015261220d8184612195565b905092915050565b600067ffffffffffffffff8211156122305761222f611a62565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561225c5761225b611a62565b5b602082029050602081019050919050565b60008160030b9050919050565b6122838161226d565b811461228e57600080fd5b50565b6000813590506122a08161227a565b92915050565b60006122b96122b484612241565b611ac2565b905080838252602082019050602084028301858111156122dc576122db611b09565b5b835b8181101561230557806122f18882612291565b8452602084019350506020810190506122de565b5050509392505050565b600082601f83011261232457612323611a4c565b5b81356123348482602086016122a6565b91505092915050565b600061235061234b84612215565b611ac2565b9050808382526020820190506020840283018581111561237357612372611b09565b5b835b818110156123ba57803567ffffffffffffffff81111561239857612397611a4c565b5b8086016123a5898261230f565b85526020850194505050602081019050612375565b5050509392505050565b600082601f8301126123d9576123d8611a4c565b5b81356123e984826020860161233d565b91505092915050565b6000806040838503121561240957612408611a08565b5b600061241785828601611d86565b925050602083013567ffffffffffffffff81111561243857612437611a0d565b5b612444858286016123c4565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006124798261244e565b9050919050565b6124898161246e565b82525050565b60006020820190506124a46000830184612480565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6124df81611d62565b82525050565b60006124f183836124d6565b60208301905092915050565b6000602082019050919050565b6000612515826124aa565b61251f81856124b5565b935061252a836124c6565b8060005b8381101561255b57815161254288826124e5565b975061254d836124fd565b92505060018101905061252e565b5085935050505092915050565b60006020820190508181036000830152612582818461250a565b905092915050565b6125938161246e565b811461259e57600080fd5b50565b6000813590506125b08161258a565b92915050565b6000602082840312156125cc576125cb611a08565b5b60006125da848285016125a1565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061262a57607f821691505b60208210810361263d5761263c6125e3565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006126ac82611a12565b91506126b783611a12565b9250828201905061ffff8111156126d1576126d0612672565b5b92915050565b60006126e282611a12565b915061ffff82036126f6576126f5612672565b5b600182019050919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026127637fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82612726565b61276d8683612726565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b60006127b46127af6127aa84612785565b61278f565b612785565b9050919050565b6000819050919050565b6127ce83612799565b6127e26127da826127bb565b848454612733565b825550505050565b600090565b6127f76127ea565b6128028184846127c5565b505050565b5b818110156128265761281b6000826127ef565b600181019050612808565b5050565b601f82111561286b5761283c81612701565b61284584612716565b81016020851015612854578190505b61286861286085612716565b830182612807565b50505b505050565b600082821c905092915050565b600061288e60001984600802612870565b1980831691505092915050565b60006128a7838361287d565b9150826002028217905092915050565b6128c082611c69565b67ffffffffffffffff8111156128d9576128d8611a62565b5b6128e38254612612565b6128ee82828561282a565b600060209050601f831160018114612921576000841561290f578287015190505b612919858261289b565b865550612981565b601f19841661292f86612701565b60005b8281101561295757848901518255600182019150602085019450602081019050612932565b868310156129745784890151612970601f89168261287d565b8355505b6001600288020188555050505b505050505050565b600061299482612785565b915061299f83612785565b92508282026129ad81612785565b915082820484148315176129c4576129c3612672565b5b5092915050565b60006129d682612785565b91506129e183612785565b92508282019050808211156129f9576129f8612672565b5b92915050565b600081905092915050565b6000612a1582611c69565b612a1f81856129ff565b9350612a2f818560208601611c85565b80840191505092915050565b7f3c7265637420783d220000000000000000000000000000000000000000000000815250565b7f2220793d22000000000000000000000000000000000000000000000000000000815250565b7f222077696474683d223122206865696768743d2231222073686170652d72656e60008201527f646572696e673d2263726973704564676573222066696c6c3d22230000000000602082015250565b6000612ae3603b836129ff565b9150612aee82612a87565b603b82019050919050565b7f222f3e0000000000000000000000000000000000000000000000000000000000815250565b6000612b2b8287612a0a565b9150612b3682612a3b565b600982019150612b468286612a0a565b9150612b5182612a61565b600582019150612b618285612a0a565b9150612b6c82612ad6565b9150612b788284612a0a565b9150612b8382612af9565b60038201915081905095945050505050565b6000612ba18286612a0a565b9150612bad8285612a0a565b9150612bb98284612a0a565b9150819050949350505050565b6000612bd182611d62565b9150612bdc83611d62565b9250828201905060ff811115612bf557612bf4612672565b5b92915050565b6000612c0682611d62565b915060ff8203612c1957612c18612672565b5b600182019050919050565b6000612c2f82611b0e565b9150612c3a83611b0e565b9250828201905062ffffff811115612c5557612c54612672565b5b92915050565b6000612c6682611b0e565b9150612c7183611b0e565b9250828203905062ffffff811115612c8c57612c8b612672565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfe3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667222076657273696f6e3d22312e32222076696577426f783d22302030203234203234223ea2646970667358221220c365b795cbee4ffa5ea4e21d6d283d4c8dc96e1d31030438442588d67154260d64736f6c634300081c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063715018a61161008c5780638da5cb5b116100665780638da5cb5b146101fa578063d74c766614610218578063f2fde38b14610248578063f386a26d14610264576100cf565b8063715018a6146101b8578063768a9d90146101c25780637a53d0d3146101de576100cf565b80630b361633146100d4578063236d064f146100f05780634743faff1461012057806352fbf1e11461013c57806364e7ca66146101585780636de9c65f14610188575b600080fd5b6100ee60048036038101906100e99190611be0565b610280565b005b61010a60048036038101906101059190611c3c565b6102bc565b6040516101179190611ce8565b60405180910390f35b61013a60048036038101906101359190611ee7565b610369565b005b610156600480360381019061015191906120d9565b6103f0565b005b610172600480360381019061016d9190611c3c565b610470565b60405161017f91906121f3565b60405180910390f35b6101a2600480360381019061019d9190611c3c565b610d7c565b6040516101af9190611ce8565b60405180910390f35b6101c0610eaa565b005b6101dc60048036038101906101d791906123f2565b610ebe565b005b6101f860048036038101906101f391906123f2565b610f41565b005b610202610fc4565b60405161020f919061248f565b60405180910390f35b610232600480360381019061022d9190611c3c565b610fed565b60405161023f9190612568565b60405180910390f35b610262600480360381019061025d91906125b6565b611086565b005b61027e600480360381019061027991906123f2565b61110c565b005b61028861118f565b80600d60008461ffff1661ffff16815260200190815260200160002090805190602001906102b79291906117da565b505050565b6060600f60008361ffff1661ffff16815260200190815260200160002080546102e490612612565b80601f016020809104026020016040519081016040528092919081815260200182805461031090612612565b801561035d5780601f106103325761010080835404028352916020019161035d565b820191906000526020600020905b81548152906001019060200180831161034057829003601f168201915b50505050509050919050565b61037161118f565b60005b81518161ffff1610156103eb57818161ffff168151811061039857610397612643565b5b6020026020010151600e600083866103b091906126a1565b61ffff1661ffff16815260200190815260200160002090805190602001906103d9929190611887565b50806103e4906126d7565b9050610374565b505050565b6103f861118f565b60005b81518161ffff16101561046b57818161ffff168151811061041f5761041e612643565b5b6020026020010151600f6000838661043791906126a1565b61ffff1661ffff168152602001908152602001600020908161045991906128b7565b5080610464906126d7565b90506103fb565b505050565b60606000600e60008461ffff1661ffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156104ff57602002820191906000526020600020906000905b82829054906101000a900460ff1660ff16815260200190600101906020826000010492830192600103820291508084116104c85790505b5050505050905060018160008151811061051c5761051b612643565b5b602002602001015160ff16036105c857600d60008461ffff1661ffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156105bb57602002820191906000526020600020906000905b82829054906101000a900462ffffff1662ffffff16815260200190600301906020826002010492830192600103820291508084116105805790505b5050505050915050610d77565b600061024061ffff1667ffffffffffffffff8111156105ea576105e9611a62565b5b6040519080825280602002602001820160405280156106185781602001602082028036833780820191505090505b509050600060058360018151811061063357610632612643565b5b602002602001015160ff168154811061064f5761064e612643565b5b90600052602060002090600a91828204019190066003029054906101000a900462ffffff16905060005b61024061ffff168161ffff1610156106c65781838261ffff16815181106106a3576106a2612643565b5b602002602001019062ffffff16908162ffffff1681525050806001019050610679565b50600e836007815181106106dd576106dc612643565b5b602002602001015160ff16116108495761076f600180548060200260200160405190810160405280929190818152602001828054801561076457602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff168152602001906002019060208260010104928301926001038202915080841161072b5790505b505050505083611216565b61084860028054806020026020016040519081016040528092919081815260200182805480156107e657602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116107ad5790505b505050505060068560078151811061080157610800612643565b5b602002602001015160ff168154811061081d5761081c612643565b5b90600052602060002090600a91828204019190066003029054906101000a900462ffffff168461128b565b5b6108cb60038054806020026020016040519081016040528092919081815260200182805480156108c057602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116108875790505b505050505083611216565b6109a4600480548060200260200160405190810160405280929190818152602001828054801561094257602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116109095790505b505050505060078560028151811061095d5761095c612643565b5b602002602001015160ff168154811061097957610978612643565b5b90600052602060002090600a91828204019190066003029054906101000a900462ffffff168461128b565b610a56600a6000856004815181106109bf576109be612643565b5b602002602001015160ff1660ff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610a4b57602002820191906000526020600020906000905b82829054906101000a900460030b60030b81526020019060040190602082600301049283019260010382029150808411610a145790505b5050505050836112fe565b610b0a6008600085600581518110610a7157610a70612643565b5b602002602001015160ff1660ff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610aff57602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411610ac65790505b505050505083611216565b610bbe6009600085600681518110610b2557610b24612643565b5b602002602001015160ff1660ff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610bb357602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411610b7a5790505b505050505083611216565b607983600381518110610bd457610bd3612643565b5b602002602001015160ff1611610c9757610c96600b600085600381518110610bff57610bfe612643565b5b602002602001015160ff1660ff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610c8b57602002820191906000526020600020906000905b82829054906101000a900460030b60030b81526020019060040190602082600301049283019260010382029150808411610c545790505b5050505050836112fe565b5b600783600881518110610cad57610cac612643565b5b602002602001015160ff1611610d7057610d6f600c600085600881518110610cd857610cd7612643565b5b602002602001015160ff1660ff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610d6457602002820191906000526020600020906000905b82829054906101000a900460030b60030b81526020019060040190602082600301049283019260010382029150808411610d2d5790505b5050505050836112fe565b5b8193505050505b919050565b60606000610d8983610470565b905060005b6018811015610e305760005b6018811015610e245783610dad826113de565b610db6846113de565b610df58685876018610dc89190612989565b610dd291906129cb565b81518110610de357610de2612643565b5b602002602001015162ffffff166114ac565b604051602001610e089493929190612b1f565b6040516020818303038152906040529350806001019050610d9a565b50806001019050610d8e565b506040518060800160405280604a8152602001612cc2604a9139826040518060400160405280600681526020017f3c2f7376673e0000000000000000000000000000000000000000000000000000815250604051602001610e9393929190612b95565b604051602081830303815290604052915050919050565b610eb261118f565b610ebc60006115bb565b565b610ec661118f565b60005b81518160ff161015610f3c57818160ff1681518110610eeb57610eea612643565b5b6020026020010151600b60008386610f039190612bc6565b60ff1660ff1681526020019081526020016000209080519060200190610f2a92919061192e565b5080610f3590612bfb565b9050610ec9565b505050565b610f4961118f565b60005b81518160ff161015610fbf57818160ff1681518110610f6e57610f6d612643565b5b6020026020010151600c60008386610f869190612bc6565b60ff1660ff1681526020019081526020016000209080519060200190610fad92919061192e565b5080610fb890612bfb565b9050610f4c565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600e60008361ffff1661ffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561107a57602002820191906000526020600020906000905b82829054906101000a900460ff1660ff16815260200190600101906020826000010492830192600103820291508084116110435790505b50505050509050919050565b61108e61118f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036111005760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016110f7919061248f565b60405180910390fd5b611109816115bb565b50565b61111461118f565b60005b81518160ff16101561118a57818160ff168151811061113957611138612643565b5b6020026020010151600a600083866111519190612bc6565b60ff1660ff168152602001908152602001600020908051906020019061117892919061192e565b508061118390612bfb565b9050611117565b505050565b61119761167f565b73ffffffffffffffffffffffffffffffffffffffff166111b5610fc4565b73ffffffffffffffffffffffffffffffffffffffff1614611214576111d861167f565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161120b919061248f565b60405180910390fd5b565b60005b82518160ff161015611286576226323882848360ff16815181106112405761123f612643565b5b602002602001015161ffff168151811061125d5761125c612643565b5b602002602001019062ffffff16908162ffffff16815250508061127f90612bfb565b9050611219565b505050565b60005b83518160ff1610156112f8578282858360ff16815181106112b2576112b1612643565b5b602002602001015161ffff16815181106112cf576112ce612643565b5b602002602001019062ffffff16908162ffffff1681525050806112f190612bfb565b905061128e565b50505050565b60008260008151811061131457611313612643565b5b602002602001015190506000600190505b83518160ff1610156113d8576000848260ff168151811061134957611348612643565b5b602002602001015160030b146113c75762ffffff848260ff168151811061137357611372612643565b5b6020026020010151168360018360ff168561138e9190612c24565b6113989190612c5b565b62ffffff16815181106113ae576113ad612643565b5b602002602001019062ffffff16908162ffffff16815250505b806113d190612bfb565b9050611325565b50505050565b6060600060016113ed84611687565b01905060008167ffffffffffffffff81111561140c5761140b611a62565b5b6040519080825280601f01601f19166020018201604052801561143e5781602001600182028036833780820191505090505b509050600082602001820190505b6001156114a1578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161149557611494612c92565b5b0494506000850361144c575b819350505050919050565b606060008290506000600660ff1667ffffffffffffffff8111156114d3576114d2611a62565b5b6040519080825280601f01601f1916602001820160405280156115055781602001600182028036833780820191505090505b5090506000600690505b60008160ff1611156115b0577f3031323334353637383961626364656600000000000000000000000000000000600f84166010811061155157611550612643565b5b1a60f81b826001830360ff168151811061156e5761156d612643565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600483901c92508060019003905061150f565b508092505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106116e5577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816116db576116da612c92565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310611722576d04ee2d6d415b85acef8100000000838161171857611717612c92565b5b0492506020810190505b662386f26fc10000831061175157662386f26fc10000838161174757611746612c92565b5b0492506010810190505b6305f5e100831061177a576305f5e10083816117705761176f612c92565b5b0492506008810190505b612710831061179f57612710838161179557611794612c92565b5b0492506004810190505b606483106117c257606483816117b8576117b7612c92565b5b0492506002810190505b600a83106117d1576001810190505b80915050919050565b82805482825590600052602060002090600901600a900481019282156118765791602002820160005b8382111561184557835183826101000a81548162ffffff021916908362ffffff1602179055509260200192600301602081600201049283019260010302611803565b80156118745782816101000a81549062ffffff0219169055600301602081600201049283019260010302611845565b505b50905061188391906119e1565b5090565b82805482825590600052602060002090601f0160209004810192821561191d5791602002820160005b838211156118ee57835183826101000a81548160ff021916908360ff16021790555092602001926001016020816000010492830192600103026118b0565b801561191b5782816101000a81549060ff02191690556001016020816000010492830192600103026118ee565b505b50905061192a91906119e1565b5090565b828054828255906000526020600020906007016008900481019282156119d05791602002820160005b8382111561199e57835183826101000a81548163ffffffff021916908360030b63ffffffff1602179055509260200192600401602081600301049283019260010302611957565b80156119ce5782816101000a81549063ffffffff021916905560040160208160030104928301926001030261199e565b505b5090506119dd91906119e1565b5090565b5b808211156119fa5760008160009055506001016119e2565b5090565b6000604051905090565b600080fd5b600080fd5b600061ffff82169050919050565b611a2981611a12565b8114611a3457600080fd5b50565b600081359050611a4681611a20565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611a9a82611a51565b810181811067ffffffffffffffff82111715611ab957611ab8611a62565b5b80604052505050565b6000611acc6119fe565b9050611ad88282611a91565b919050565b600067ffffffffffffffff821115611af857611af7611a62565b5b602082029050602081019050919050565b600080fd5b600062ffffff82169050919050565b611b2681611b0e565b8114611b3157600080fd5b50565b600081359050611b4381611b1d565b92915050565b6000611b5c611b5784611add565b611ac2565b90508083825260208201905060208402830185811115611b7f57611b7e611b09565b5b835b81811015611ba85780611b948882611b34565b845260208401935050602081019050611b81565b5050509392505050565b600082601f830112611bc757611bc6611a4c565b5b8135611bd7848260208601611b49565b91505092915050565b60008060408385031215611bf757611bf6611a08565b5b6000611c0585828601611a37565b925050602083013567ffffffffffffffff811115611c2657611c25611a0d565b5b611c3285828601611bb2565b9150509250929050565b600060208284031215611c5257611c51611a08565b5b6000611c6084828501611a37565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611ca3578082015181840152602081019050611c88565b60008484015250505050565b6000611cba82611c69565b611cc48185611c74565b9350611cd4818560208601611c85565b611cdd81611a51565b840191505092915050565b60006020820190508181036000830152611d028184611caf565b905092915050565b600067ffffffffffffffff821115611d2557611d24611a62565b5b602082029050602081019050919050565b600067ffffffffffffffff821115611d5157611d50611a62565b5b602082029050602081019050919050565b600060ff82169050919050565b611d7881611d62565b8114611d8357600080fd5b50565b600081359050611d9581611d6f565b92915050565b6000611dae611da984611d36565b611ac2565b90508083825260208201905060208402830185811115611dd157611dd0611b09565b5b835b81811015611dfa5780611de68882611d86565b845260208401935050602081019050611dd3565b5050509392505050565b600082601f830112611e1957611e18611a4c565b5b8135611e29848260208601611d9b565b91505092915050565b6000611e45611e4084611d0a565b611ac2565b90508083825260208201905060208402830185811115611e6857611e67611b09565b5b835b81811015611eaf57803567ffffffffffffffff811115611e8d57611e8c611a4c565b5b808601611e9a8982611e04565b85526020850194505050602081019050611e6a565b5050509392505050565b600082601f830112611ece57611ecd611a4c565b5b8135611ede848260208601611e32565b91505092915050565b60008060408385031215611efe57611efd611a08565b5b6000611f0c85828601611a37565b925050602083013567ffffffffffffffff811115611f2d57611f2c611a0d565b5b611f3985828601611eb9565b9150509250929050565b600067ffffffffffffffff821115611f5e57611f5d611a62565b5b602082029050602081019050919050565b600080fd5b600067ffffffffffffffff821115611f8f57611f8e611a62565b5b611f9882611a51565b9050602081019050919050565b82818337600083830152505050565b6000611fc7611fc284611f74565b611ac2565b905082815260208101848484011115611fe357611fe2611f6f565b5b611fee848285611fa5565b509392505050565b600082601f83011261200b5761200a611a4c565b5b813561201b848260208601611fb4565b91505092915050565b600061203761203284611f43565b611ac2565b9050808382526020820190506020840283018581111561205a57612059611b09565b5b835b818110156120a157803567ffffffffffffffff81111561207f5761207e611a4c565b5b80860161208c8982611ff6565b8552602085019450505060208101905061205c565b5050509392505050565b600082601f8301126120c0576120bf611a4c565b5b81356120d0848260208601612024565b91505092915050565b600080604083850312156120f0576120ef611a08565b5b60006120fe85828601611a37565b925050602083013567ffffffffffffffff81111561211f5761211e611a0d565b5b61212b858286016120ab565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61216a81611b0e565b82525050565b600061217c8383612161565b60208301905092915050565b6000602082019050919050565b60006121a082612135565b6121aa8185612140565b93506121b583612151565b8060005b838110156121e65781516121cd8882612170565b97506121d883612188565b9250506001810190506121b9565b5085935050505092915050565b6000602082019050818103600083015261220d8184612195565b905092915050565b600067ffffffffffffffff8211156122305761222f611a62565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561225c5761225b611a62565b5b602082029050602081019050919050565b60008160030b9050919050565b6122838161226d565b811461228e57600080fd5b50565b6000813590506122a08161227a565b92915050565b60006122b96122b484612241565b611ac2565b905080838252602082019050602084028301858111156122dc576122db611b09565b5b835b8181101561230557806122f18882612291565b8452602084019350506020810190506122de565b5050509392505050565b600082601f83011261232457612323611a4c565b5b81356123348482602086016122a6565b91505092915050565b600061235061234b84612215565b611ac2565b9050808382526020820190506020840283018581111561237357612372611b09565b5b835b818110156123ba57803567ffffffffffffffff81111561239857612397611a4c565b5b8086016123a5898261230f565b85526020850194505050602081019050612375565b5050509392505050565b600082601f8301126123d9576123d8611a4c565b5b81356123e984826020860161233d565b91505092915050565b6000806040838503121561240957612408611a08565b5b600061241785828601611d86565b925050602083013567ffffffffffffffff81111561243857612437611a0d565b5b612444858286016123c4565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006124798261244e565b9050919050565b6124898161246e565b82525050565b60006020820190506124a46000830184612480565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6124df81611d62565b82525050565b60006124f183836124d6565b60208301905092915050565b6000602082019050919050565b6000612515826124aa565b61251f81856124b5565b935061252a836124c6565b8060005b8381101561255b57815161254288826124e5565b975061254d836124fd565b92505060018101905061252e565b5085935050505092915050565b60006020820190508181036000830152612582818461250a565b905092915050565b6125938161246e565b811461259e57600080fd5b50565b6000813590506125b08161258a565b92915050565b6000602082840312156125cc576125cb611a08565b5b60006125da848285016125a1565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061262a57607f821691505b60208210810361263d5761263c6125e3565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006126ac82611a12565b91506126b783611a12565b9250828201905061ffff8111156126d1576126d0612672565b5b92915050565b60006126e282611a12565b915061ffff82036126f6576126f5612672565b5b600182019050919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026127637fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82612726565b61276d8683612726565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b60006127b46127af6127aa84612785565b61278f565b612785565b9050919050565b6000819050919050565b6127ce83612799565b6127e26127da826127bb565b848454612733565b825550505050565b600090565b6127f76127ea565b6128028184846127c5565b505050565b5b818110156128265761281b6000826127ef565b600181019050612808565b5050565b601f82111561286b5761283c81612701565b61284584612716565b81016020851015612854578190505b61286861286085612716565b830182612807565b50505b505050565b600082821c905092915050565b600061288e60001984600802612870565b1980831691505092915050565b60006128a7838361287d565b9150826002028217905092915050565b6128c082611c69565b67ffffffffffffffff8111156128d9576128d8611a62565b5b6128e38254612612565b6128ee82828561282a565b600060209050601f831160018114612921576000841561290f578287015190505b612919858261289b565b865550612981565b601f19841661292f86612701565b60005b8281101561295757848901518255600182019150602085019450602081019050612932565b868310156129745784890151612970601f89168261287d565b8355505b6001600288020188555050505b505050505050565b600061299482612785565b915061299f83612785565b92508282026129ad81612785565b915082820484148315176129c4576129c3612672565b5b5092915050565b60006129d682612785565b91506129e183612785565b92508282019050808211156129f9576129f8612672565b5b92915050565b600081905092915050565b6000612a1582611c69565b612a1f81856129ff565b9350612a2f818560208601611c85565b80840191505092915050565b7f3c7265637420783d220000000000000000000000000000000000000000000000815250565b7f2220793d22000000000000000000000000000000000000000000000000000000815250565b7f222077696474683d223122206865696768743d2231222073686170652d72656e60008201527f646572696e673d2263726973704564676573222066696c6c3d22230000000000602082015250565b6000612ae3603b836129ff565b9150612aee82612a87565b603b82019050919050565b7f222f3e0000000000000000000000000000000000000000000000000000000000815250565b6000612b2b8287612a0a565b9150612b3682612a3b565b600982019150612b468286612a0a565b9150612b5182612a61565b600582019150612b618285612a0a565b9150612b6c82612ad6565b9150612b788284612a0a565b9150612b8382612af9565b60038201915081905095945050505050565b6000612ba18286612a0a565b9150612bad8285612a0a565b9150612bb98284612a0a565b9150819050949350505050565b6000612bd182611d62565b9150612bdc83611d62565b9250828201905060ff811115612bf557612bf4612672565b5b92915050565b6000612c0682611d62565b915060ff8203612c1957612c18612672565b5b600182019050919050565b6000612c2f82611b0e565b9150612c3a83611b0e565b9250828201905062ffffff811115612c5557612c54612672565b5b92915050565b6000612c6682611b0e565b9150612c7183611b0e565b9250828203905062ffffff811115612c8c57612c8b612672565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfe3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667222076657273696f6e3d22312e32222076696577426f783d22302030203234203234223ea2646970667358221220c365b795cbee4ffa5ea4e21d6d283d4c8dc96e1d31030438442588d67154260d64736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.