Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Cross-Chain Transactions
Loading...
Loading
Contract Name:
NextAlchemicToken
Compiler Version
v0.8.13+commit.abaa5c0e
Contract Source Code (Solidity)
/**
*Submitted for verification at optimistic.etherscan.io on 2023-06-27
*/
// Sources flattened with hardhat v2.11.1 https://hardhat.org
// File src/base/Errors.sol
pragma solidity ^0.8.13;
/// @notice An error used to indicate that an action could not be completed because either the `msg.sender` or
/// `msg.origin` is not authorized.
error Unauthorized();
/// @notice An error used to indicate that an action could not be completed because the contract either already existed
/// or entered an illegal condition which is not recoverable from.
error IllegalState();
/// @notice An error used to indicate that an action could not be completed because of an illegal argument was passed
/// to the function.
error IllegalArgument();
// File lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
// File src/interfaces/IERC20Mintable.sol
pragma solidity >=0.5.0;
/// @title IERC20Mintable
/// @author Alchemix Finance
interface IERC20Mintable is IERC20 {
/// @notice Mints `amount` tokens to `recipient`.
///
/// @param recipient The address which will receive the minted tokens.
/// @param amount The amount of tokens to mint.
function mint(address recipient, uint256 amount) external;
}
// File src/interfaces/IERC20Burnable.sol
pragma solidity >=0.5.0;
/// @title IERC20Burnable
/// @author Alchemix Finance
interface IERC20Burnable is IERC20 {
/// @notice Burns `amount` tokens from the balance of `msg.sender`.
///
/// @param amount The amount of tokens to burn.
///
/// @return If burning the tokens was successful.
function burn(uint256 amount) external returns (bool);
/// @notice Burns `amount` tokens from `owner`'s balance.
///
/// @param owner The address to burn tokens from.
/// @param amount The amount of tokens to burn.
///
/// @return If burning the tokens was successful.
function burnFrom(address owner, uint256 amount) external returns (bool);
}
// File lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// File src/libraries/TokenUtils.sol
pragma solidity ^0.8.13;
/// @title TokenUtils
/// @author Alchemix Finance
library TokenUtils {
/// @notice An error used to indicate that a call to an ERC20 contract failed.
///
/// @param target The target address.
/// @param success If the call to the token was a success.
/// @param data The resulting data from the call. This is error data when the call was not a success. Otherwise,
/// this is malformed data when the call was a success.
error ERC20CallFailed(address target, bool success, bytes data);
/// @dev A safe function to get the decimals of an ERC20 token.
///
/// @dev Reverts with a {CallFailed} error if execution of the query fails or returns an unexpected value.
///
/// @param token The target token.
///
/// @return The amount of decimals of the token.
function expectDecimals(address token) internal view returns (uint8) {
(bool success, bytes memory data) = token.staticcall(
abi.encodeWithSelector(IERC20Metadata.decimals.selector)
);
if (token.code.length == 0 || !success || data.length < 32) {
revert ERC20CallFailed(token, success, data);
}
return abi.decode(data, (uint8));
}
/// @dev Gets the balance of tokens held by an account.
///
/// @dev Reverts with a {CallFailed} error if execution of the query fails or returns an unexpected value.
///
/// @param token The token to check the balance of.
/// @param account The address of the token holder.
///
/// @return The balance of the tokens held by an account.
function safeBalanceOf(address token, address account) internal view returns (uint256) {
(bool success, bytes memory data) = token.staticcall(
abi.encodeWithSelector(IERC20.balanceOf.selector, account)
);
if (token.code.length == 0 || !success || data.length < 32) {
revert ERC20CallFailed(token, success, data);
}
return abi.decode(data, (uint256));
}
/// @dev Transfers tokens to another address.
///
/// @dev Reverts with a {CallFailed} error if execution of the transfer failed or returns an unexpected value.
///
/// @param token The token to transfer.
/// @param recipient The address of the recipient.
/// @param amount The amount of tokens to transfer.
function safeTransfer(address token, address recipient, uint256 amount) internal {
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(IERC20.transfer.selector, recipient, amount)
);
if (token.code.length == 0 || !success || (data.length != 0 && !abi.decode(data, (bool)))) {
revert ERC20CallFailed(token, success, data);
}
}
/// @dev Approves tokens for the smart contract.
///
/// @dev Reverts with a {CallFailed} error if execution of the approval fails or returns an unexpected value.
///
/// @param token The token to approve.
/// @param spender The contract to spend the tokens.
/// @param value The amount of tokens to approve.
function safeApprove(address token, address spender, uint256 value) internal {
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(IERC20.approve.selector, spender, value)
);
if (token.code.length == 0 || !success || (data.length != 0 && !abi.decode(data, (bool)))) {
revert ERC20CallFailed(token, success, data);
}
}
/// @dev Transfer tokens from one address to another address.
///
/// @dev Reverts with a {CallFailed} error if execution of the transfer fails or returns an unexpected value.
///
/// @param token The token to transfer.
/// @param owner The address of the owner.
/// @param recipient The address of the recipient.
/// @param amount The amount of tokens to transfer.
function safeTransferFrom(address token, address owner, address recipient, uint256 amount) internal {
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(IERC20.transferFrom.selector, owner, recipient, amount)
);
if (token.code.length == 0 || !success || (data.length != 0 && !abi.decode(data, (bool)))) {
revert ERC20CallFailed(token, success, data);
}
}
/// @dev Mints tokens to an address.
///
/// @dev Reverts with a {CallFailed} error if execution of the mint fails or returns an unexpected value.
///
/// @param token The token to mint.
/// @param recipient The address of the recipient.
/// @param amount The amount of tokens to mint.
function safeMint(address token, address recipient, uint256 amount) internal {
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(IERC20Mintable.mint.selector, recipient, amount)
);
if (token.code.length == 0 || !success || (data.length != 0 && !abi.decode(data, (bool)))) {
revert ERC20CallFailed(token, success, data);
}
}
/// @dev Burns tokens.
///
/// Reverts with a `CallFailed` error if execution of the burn fails or returns an unexpected value.
///
/// @param token The token to burn.
/// @param amount The amount of tokens to burn.
function safeBurn(address token, uint256 amount) internal {
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(IERC20Burnable.burn.selector, amount)
);
if (token.code.length == 0 || !success || (data.length != 0 && !abi.decode(data, (bool)))) {
revert ERC20CallFailed(token, success, data);
}
}
/// @dev Burns tokens from its total supply.
///
/// @dev Reverts with a {CallFailed} error if execution of the burn fails or returns an unexpected value.
///
/// @param token The token to burn.
/// @param owner The owner of the tokens.
/// @param amount The amount of tokens to burn.
function safeBurnFrom(address token, address owner, uint256 amount) internal {
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(IERC20Burnable.burnFrom.selector, owner, amount)
);
if (token.code.length == 0 || !success || (data.length != 0 && !abi.decode(data, (bool)))) {
revert ERC20CallFailed(token, success, data);
}
}
}
// File lib/openzeppelin-contracts-upgradeable/contracts/access/IAccessControlUpgradeable.sol
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControlUpgradeable {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}
// File lib/openzeppelin-contracts-upgradeable/contracts/utils/math/MathUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library MathUpgradeable {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}
// File lib/openzeppelin-contracts-upgradeable/contracts/utils/math/SignedMathUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMathUpgradeable {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}
// File lib/openzeppelin-contracts-upgradeable/contracts/utils/StringsUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = MathUpgradeable.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.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, MathUpgradeable.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}
// File lib/openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
// File lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}
// File lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
// File lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/IERC165Upgradeable.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165Upgradeable {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165Upgradeable).interfaceId;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
// File lib/openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
function __AccessControl_init() internal onlyInitializing {
}
function __AccessControl_init_unchained() internal onlyInitializing {
}
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
StringsUpgradeable.toHexString(account),
" is missing role ",
StringsUpgradeable.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* May emit a {RoleGranted} event.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
// File lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
// File lib/openzeppelin-contracts/contracts/interfaces/IERC3156FlashBorrower.sol
// OpenZeppelin Contracts (last updated v4.7.0) (interfaces/IERC3156FlashBorrower.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC3156 FlashBorrower, as defined in
* https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].
*
* _Available since v4.1._
*/
interface IERC3156FlashBorrower {
/**
* @dev Receive a flash loan.
* @param initiator The initiator of the loan.
* @param token The loan currency.
* @param amount The amount of tokens lent.
* @param fee The additional amount of tokens to repay.
* @param data Arbitrary data structure, intended to contain user-defined parameters.
* @return The keccak256 hash of "ERC3156FlashBorrower.onFlashLoan"
*/
function onFlashLoan(
address initiator,
address token,
uint256 amount,
uint256 fee,
bytes calldata data
) external returns (bytes32);
}
// File lib/openzeppelin-contracts/contracts/interfaces/IERC3156FlashLender.sol
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC3156FlashLender.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC3156 FlashLender, as defined in
* https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].
*
* _Available since v4.1._
*/
interface IERC3156FlashLender {
/**
* @dev The amount of currency available to be lended.
* @param token The loan currency.
* @return The amount of `token` that can be borrowed.
*/
function maxFlashLoan(address token) external view returns (uint256);
/**
* @dev The fee to be charged for a given loan.
* @param token The loan currency.
* @param amount The amount of tokens lent.
* @return The amount of `token` to be charged for the loan, on top of the returned principal.
*/
function flashFee(address token, uint256 amount) external view returns (uint256);
/**
* @dev Initiate a flash loan.
* @param receiver The receiver of the tokens in the loan, and the receiver of the callback.
* @param token The loan currency.
* @param amount The amount of tokens lent.
* @param data Arbitrary data structure, intended to contain user-defined parameters.
*/
function flashLoan(
IERC3156FlashBorrower receiver,
address token,
uint256 amount,
bytes calldata data
) external returns (bool);
}
// File src/interfaces/IAlchemicToken.sol
pragma solidity >=0.5.0;
/// @title IAlchemicToken
/// @author Alchemix Finance
interface IAlchemicToken is IERC20 {
/// @notice Gets the total amount of minted tokens for an account.
///
/// @param account The address of the account.
///
/// @return The total minted.
function hasMinted(address account) external view returns (uint256);
/// @notice Lowers the number of tokens which the `msg.sender` has minted.
///
/// This reverts if the `msg.sender` is not whitelisted.
///
/// @param amount The amount to lower the minted amount by.
function lowerHasMinted(uint256 amount) external;
/// @notice Sets the mint allowance for a given account'
///
/// This reverts if the `msg.sender` is not admin
///
/// @param toSetCeiling The account whos allowance to update
/// @param ceiling The amount of tokens allowed to mint
function setCeiling(address toSetCeiling, uint256 ceiling) external;
/// @notice Updates the state of an address in the whitelist map
///
/// This reverts if msg.sender is not admin
///
/// @param toWhitelist the address whos state is being updated
/// @param state the boolean state of the whitelist
function setWhitelist(address toWhitelist, bool state) external;
function mint(address recipient, uint256 amount) external;
function burn(uint256 amount) external;
function burnFrom(address account, uint256 amount) external;
}
// File lib/openzeppelin-contracts-upgradeable/contracts/security/ReentrancyGuardUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuardUpgradeable is Initializable {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
// File lib/openzeppelin-contracts-upgradeable/contracts/utils/CountersUpgradeable.sol
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library CountersUpgradeable {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
// File lib/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/ECDSAUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSAUpgradeable {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV // Deprecated in v4.8
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, "\x19Ethereum Signed Message:\n32")
mstore(0x1c, hash)
message := keccak256(0x00, 0x3c)
}
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, "\x19\x01")
mstore(add(ptr, 0x02), domainSeparator)
mstore(add(ptr, 0x22), structHash)
data := keccak256(ptr, 0x42)
}
}
/**
* @dev Returns an Ethereum Signed Data with intended validator, created from a
* `validator` and `data` according to the version 0 of EIP-191.
*
* See {recover}.
*/
function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x00", validator, data));
}
}
// File lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC5267Upgradeable.sol
pragma solidity ^0.8.0;
interface IERC5267Upgradeable {
/**
* @dev MAY be emitted to signal that the domain could have changed.
*/
event EIP712DomainChanged();
/**
* @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
* signature.
*/
function eip712Domain()
external
view
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
);
}
// File lib/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/EIP712Upgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)
pragma solidity ^0.8.8;
/**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
*
* The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
* thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
* they need in their contracts using a combination of `abi.encode` and `keccak256`.
*
* This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
* scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
* ({_hashTypedDataV4}).
*
* The implementation of the domain separator was designed to be as efficient as possible while still properly updating
* the chain id to protect against replay attacks on an eventual fork of the chain.
*
* NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
* https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
*
* NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
* separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the
* separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
*
* _Available since v3.4._
*
* @custom:storage-size 52
*/
abstract contract EIP712Upgradeable is Initializable, IERC5267Upgradeable {
bytes32 private constant _TYPE_HASH =
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
/// @custom:oz-renamed-from _HASHED_NAME
bytes32 private _hashedName;
/// @custom:oz-renamed-from _HASHED_VERSION
bytes32 private _hashedVersion;
string private _name;
string private _version;
/**
* @dev Initializes the domain separator and parameter caches.
*
* The meaning of `name` and `version` is specified in
* https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
*
* - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
* - `version`: the current major version of the signing domain.
*
* NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
* contract upgrade].
*/
function __EIP712_init(string memory name, string memory version) internal onlyInitializing {
__EIP712_init_unchained(name, version);
}
function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {
_name = name;
_version = version;
// Reset prior values in storage if upgrading
_hashedName = 0;
_hashedVersion = 0;
}
/**
* @dev Returns the domain separator for the current chain.
*/
function _domainSeparatorV4() internal view returns (bytes32) {
return _buildDomainSeparator();
}
function _buildDomainSeparator() private view returns (bytes32) {
return keccak256(abi.encode(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash(), block.chainid, address(this)));
}
/**
* @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
* function returns the hash of the fully encoded EIP712 message for this domain.
*
* This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
*
* ```solidity
* bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
* keccak256("Mail(address to,string contents)"),
* mailTo,
* keccak256(bytes(mailContents))
* )));
* address signer = ECDSA.recover(digest, signature);
* ```
*/
function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);
}
/**
* @dev See {EIP-5267}.
*
* _Available since v4.9._
*/
function eip712Domain()
public
view
virtual
override
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
)
{
// If the hashed name and version in storage are non-zero, the contract hasn't been properly initialized
// and the EIP712 domain is not reliable, as it will be missing name and version.
require(_hashedName == 0 && _hashedVersion == 0, "EIP712: Uninitialized");
return (
hex"0f", // 01111
_EIP712Name(),
_EIP712Version(),
block.chainid,
address(this),
bytes32(0),
new uint256[](0)
);
}
/**
* @dev The name parameter for the EIP712 domain.
*
* NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
* are a concern.
*/
function _EIP712Name() internal virtual view returns (string memory) {
return _name;
}
/**
* @dev The version parameter for the EIP712 domain.
*
* NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
* are a concern.
*/
function _EIP712Version() internal virtual view returns (string memory) {
return _version;
}
/**
* @dev The hash of the name parameter for the EIP712 domain.
*
* NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead.
*/
function _EIP712NameHash() internal view returns (bytes32) {
string memory name = _EIP712Name();
if (bytes(name).length > 0) {
return keccak256(bytes(name));
} else {
// If the name is empty, the contract may have been upgraded without initializing the new storage.
// We return the name hash in storage if non-zero, otherwise we assume the name is empty by design.
bytes32 hashedName = _hashedName;
if (hashedName != 0) {
return hashedName;
} else {
return keccak256("");
}
}
}
/**
* @dev The hash of the version parameter for the EIP712 domain.
*
* NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead.
*/
function _EIP712VersionHash() internal view returns (bytes32) {
string memory version = _EIP712Version();
if (bytes(version).length > 0) {
return keccak256(bytes(version));
} else {
// If the version is empty, the contract may have been upgraded without initializing the new storage.
// We return the version hash in storage if non-zero, otherwise we assume the version is empty by design.
bytes32 hashedVersion = _hashedVersion;
if (hashedVersion != 0) {
return hashedVersion;
} else {
return keccak256("");
}
}
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[48] private __gap;
}
// File lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/IERC20Upgradeable.sol
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
// File lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/IERC20MetadataUpgradeable.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// File lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {
__ERC20_init_unchained(name_, symbol_);
}
function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[45] private __gap;
}
// File lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/IERC20PermitUpgradeable.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20PermitUpgradeable {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
// File lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/ERC20PermitUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/extensions/ERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* _Available since v3.4._
*
* @custom:storage-size 51
*/
abstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {
using CountersUpgradeable for CountersUpgradeable.Counter;
mapping(address => CountersUpgradeable.Counter) private _nonces;
// solhint-disable-next-line var-name-mixedcase
bytes32 private constant _PERMIT_TYPEHASH =
keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
/**
* @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.
* However, to ensure consistency with the upgradeable transpiler, we will continue
* to reserve a slot.
* @custom:oz-renamed-from _PERMIT_TYPEHASH
*/
// solhint-disable-next-line var-name-mixedcase
bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;
/**
* @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`.
*
* It's a good idea to use the same `name` that is defined as the ERC20 token name.
*/
function __ERC20Permit_init(string memory name) internal onlyInitializing {
__EIP712_init_unchained(name, "1");
}
function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}
/**
* @dev See {IERC20Permit-permit}.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public virtual override {
require(block.timestamp <= deadline, "ERC20Permit: expired deadline");
bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));
bytes32 hash = _hashTypedDataV4(structHash);
address signer = ECDSAUpgradeable.recover(hash, v, r, s);
require(signer == owner, "ERC20Permit: invalid signature");
_approve(owner, spender, value);
}
/**
* @dev See {IERC20Permit-nonces}.
*/
function nonces(address owner) public view virtual override returns (uint256) {
return _nonces[owner].current();
}
/**
* @dev See {IERC20Permit-DOMAIN_SEPARATOR}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view override returns (bytes32) {
return _domainSeparatorV4();
}
/**
* @dev "Consume a nonce": return the current value and increment.
*
* _Available since v4.1._
*/
function _useNonce(address owner) internal virtual returns (uint256 current) {
CountersUpgradeable.Counter storage nonce = _nonces[owner];
current = nonce.current();
nonce.increment();
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
// File lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/extensions/draft-ERC20Permit.sol)
pragma solidity ^0.8.0;
// EIP-2612 is Final as of 2022-11-01. This file is deprecated.
// File src/NextAlchemicToken.sol
pragma solidity ^0.8.13;
struct InitializationParams {
string name;
string symbol;
}
/// @title NextAlchemicToken
/// @author Alchemix Finance
///
/// @notice This is the contract for connext bridge token versions of al assets.
contract NextAlchemicToken is ERC20PermitUpgradeable, AccessControlUpgradeable, OwnableUpgradeable, ReentrancyGuardUpgradeable {
/// @notice The identifier of the role which maintains other roles.
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN");
/// @notice The identifier of the role which allows accounts to mint tokens.
bytes32 public constant SENTINEL_ROLE = keccak256("SENTINEL");
/// @notice A set of addresses which are whitelisted for minting new tokens.
mapping(address => bool) public whitelisted;
/// @notice A set of addresses which are paused from minting new tokens.
mapping(address => bool) public paused;
constructor() initializer {}
/// @notice An event which is emitted when a minter is paused from minting.
///
/// @param minter The address of the minter which was paused.
/// @param state A flag indicating if the alchemist is paused or unpaused.
event Paused(address minter, bool state);
/// @notice An event which is emitted when a minter is updated in the whitelist.
///
/// @param minter The address of the minter.
/// @param state Whether or not the minter is actively able to mint.
event WhitelistSet(address minter, bool state);
function initialize(InitializationParams memory params) public initializer {
_setupRole(ADMIN_ROLE, msg.sender);
_setupRole(SENTINEL_ROLE, msg.sender);
_setRoleAdmin(SENTINEL_ROLE, ADMIN_ROLE);
_setRoleAdmin(ADMIN_ROLE, ADMIN_ROLE);
__Context_init_unchained();
__Ownable_init_unchained();
__ERC20_init_unchained(params.name, params.symbol);
__ERC20Permit_init_unchained(params.name);
__ReentrancyGuard_init_unchained();
}
/// @dev A modifier which checks that the caller has the admin role.
modifier onlyAdmin() {
if (!hasRole(ADMIN_ROLE, msg.sender)) {
revert Unauthorized();
}
_;
}
/// @dev A modifier which checks that the caller has the sentinel role.
modifier onlySentinel() {
if(!hasRole(SENTINEL_ROLE, msg.sender)) {
revert Unauthorized();
}
_;
}
/// @dev A modifier which checks if whitelisted for minting.
modifier onlyWhitelisted() {
if(!whitelisted[msg.sender]) {
revert Unauthorized();
}
_;
}
/// @notice Mints tokens to `a recipient.`
///
/// @notice This function reverts if `msg.sender` is not whitelisted.
/// @notice This function reverts if `msg.sender` is paused.
///
/// @param recipient The address to mint the tokens to.
/// @param amount The amount of tokens to mint.
function mint(address recipient, uint256 amount) external onlyWhitelisted {
if (paused[msg.sender]) {
revert IllegalState();
}
_mint(recipient, amount);
}
/// @notice Sets `minter` as whitelisted to mint.
///
/// @notice This function reverts if `msg.sender` is not an admin.
///
/// @param minter The account to permit to mint.
/// @param state A flag indicating if the minter should be able to mint.
function setWhitelist(address minter, bool state) external onlyAdmin {
whitelisted[minter] = state;
emit WhitelistSet(minter, state);
}
/// @notice Pauses `minter` from minting tokens.
///
/// @notice This function reverts if `msg.sender` is not a sentinel.
///
/// @param minter The address to set as paused or unpaused.
/// @param state A flag indicating if the minter should be paused or unpaused.
function pauseMinter(address minter, bool state) external onlySentinel {
paused[minter] = state;
emit Paused(minter, state);
}
/// @notice Burns `amount` tokens from `account`.
///
/// @param amount The amount of tokens to be burned.
/// @param account The address to burn from.
function burn(address account, uint256 amount) external {
uint256 newAllowance = allowance(account, msg.sender) - amount;
_approve(account, msg.sender, newAllowance);
_burn(account, amount);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"IllegalState","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"bool","name":"state","type":"bool"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"bool","name":"state","type":"bool"}],"name":"WhitelistSet","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SENTINEL_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"internalType":"struct InitializationParams","name":"params","type":"tuple"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"bool","name":"state","type":"bool"}],"name":"pauseMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"bool","name":"state","type":"bool"}],"name":"setWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b50600054610100900460ff1615808015620000335750600054600160ff909116105b8062000063575062000050306200013d60201b62000de61760201c565b15801562000063575060005460ff166001145b620000cb5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff191660011790558015620000ef576000805461ff0019166101001790555b801562000136576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b506200014c565b6001600160a01b03163b151590565b6122bc806200015c6000396000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c806375b238fc1161011a578063a457c2d7116100ad578063d936547e1161007c578063d936547e1461046a578063dd62ed3e1461048e578063e2b243ed146104a1578063e68b14ff146104b4578063f2fde38b146104c757600080fd5b8063a457c2d71461041e578063a9059cbb14610431578063d505accf14610444578063d547741f1461045757600080fd5b806391d14854116100e957806391d14854146103e857806395d89b41146103fb5780639dc29fac14610403578063a217fddf1461041657600080fd5b806375b238fc146103895780637ecebe001461039e57806384b0196e146103b15780638da5cb5b146103cc57600080fd5b80632f2ff15d1161019d578063395093511161016c578063395093511461031f57806340c10f191461033257806353d6fd591461034557806370a0823114610358578063715018a61461038157600080fd5b80632f2ff15d146102e0578063313ce567146102f55780633644e5151461030457806336568abe1461030c57600080fd5b806318160ddd116101d957806318160ddd1461027e57806323b872dd14610286578063248a9ca3146102995780632e48152c146102bc57600080fd5b806301ffc9a71461020b57806306fdde0314610233578063095ea7b31461024857806313430d921461025b575b600080fd5b61021e610219366004611c7b565b6104da565b60405190151581526020015b60405180910390f35b61023b610511565b60405161022a9190611cfd565b61021e610256366004611d2c565b6105a3565b61027060008051602061226783398151915281565b60405190815260200161022a565b603554610270565b61021e610294366004611d56565b6105bb565b6102706102a7366004611d92565b600090815260fe602052604090206001015490565b61021e6102ca366004611dab565b6101956020526000908152604090205460ff1681565b6102f36102ee366004611dc6565b6105df565b005b6040516012815260200161022a565b610270610609565b6102f361031a366004611dc6565b610618565b61021e61032d366004611d2c565b61069b565b6102f3610340366004611d2c565b6106bd565b6102f3610353366004611df2565b610729565b610270610366366004611dab565b6001600160a01b031660009081526033602052604090205490565b6102f36107c2565b61027060008051602061224783398151915281565b6102706103ac366004611dab565b6107d6565b6103b96107f4565b60405161022a9796959493929190611e2e565b610130546040516001600160a01b03909116815260200161022a565b61021e6103f6366004611dc6565b610892565b61023b6108bd565b6102f3610411366004611d2c565b6108cc565b610270600081565b61021e61042c366004611d2c565b6108fa565b61021e61043f366004611d2c565b610975565b6102f3610452366004611ec4565b610983565b6102f3610465366004611dc6565b610ae7565b61021e610478366004611dab565b6101946020526000908152604090205460ff1681565b61027061049c366004611f37565b610b0c565b6102f36104af366004612004565b610b37565b6102f36104c2366004611df2565b610cdc565b6102f36104d5366004611dab565b610d6d565b60006001600160e01b03198216637965db0b60e01b148061050b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060368054610520906120ab565b80601f016020809104026020016040519081016040528092919081815260200182805461054c906120ab565b80156105995780601f1061056e57610100808354040283529160200191610599565b820191906000526020600020905b81548152906001019060200180831161057c57829003601f168201915b5050505050905090565b6000336105b1818585610df5565b5060019392505050565b6000336105c9858285610f19565b6105d4858585610f93565b506001949350505050565b600082815260fe60205260409020600101546105fa8161113e565b6106048383611148565b505050565b60006106136111ce565b905090565b6001600160a01b038116331461068d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61069782826111d8565b5050565b6000336105b18185856106ae8383610b0c565b6106b891906120f5565b610df5565b336000908152610194602052604090205460ff166106ed576040516282b42960e81b815260040160405180910390fd5b336000908152610195602052604090205460ff161561071f57604051634a613c4160e01b815260040160405180910390fd5b610697828261123f565b61074160008051602061224783398151915233610892565b61075d576040516282b42960e81b815260040160405180910390fd5b6001600160a01b03821660008181526101946020908152604091829020805460ff19168515159081179091558251938452908301527f0aa5ec5ffdc7f6f9c4d0dded489d7450297155cb2f71cb771e02427f7dff4f5191015b60405180910390a15050565b6107ca611300565b6107d4600061135b565b565b6001600160a01b03811660009081526099602052604081205461050b565b6000606080600080600060606065546000801b1480156108145750606654155b6108585760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610684565b6108606113ae565b6108686113bd565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b600091825260fe602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060378054610520906120ab565b6000816108d98433610b0c565b6108e3919061210d565b90506108f0833383610df5565b61060483836113cc565b600033816109088286610b0c565b9050838110156109685760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610684565b6105d48286868403610df5565b6000336105b1818585610f93565b834211156109d35760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610684565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610a028c611500565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610a5d82611528565b90506000610a6d82878787611555565b9050896001600160a01b0316816001600160a01b031614610ad05760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610684565b610adb8a8a8a610df5565b50505050505050505050565b600082815260fe6020526040902060010154610b028161113e565b61060483836111d8565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b600054610100900460ff1615808015610b575750600054600160ff909116105b80610b715750303b158015610b71575060005460ff166001145b610bd45760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610684565b6000805460ff191660011790558015610bf7576000805461ff0019166101001790555b610c0f6000805160206122478339815191523361157d565b610c276000805160206122678339815191523361157d565b610c4d600080516020612267833981519152600080516020612247833981519152611587565b610c6560008051602061224783398151915280611587565b610c6d6115d2565b610c756115f9565b610c8782600001518360200151611629565b8151610c9290611677565b610c9a61169e565b8015610697576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016107b6565b610cf460008051602061226783398151915233610892565b610d10576040516282b42960e81b815260040160405180910390fd5b6001600160a01b03821660008181526101956020908152604091829020805460ff19168515159081179091558251938452908301527fe8699cf681560fd07de85543bd994263f4557bdc5179dd702f256d15fd083e1d91016107b6565b610d75611300565b6001600160a01b038116610dda5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610684565b610de38161135b565b50565b6001600160a01b03163b151590565b6001600160a01b038316610e575760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610684565b6001600160a01b038216610eb85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610684565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610f258484610b0c565b90506000198114610f8d5781811015610f805760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610684565b610f8d8484848403610df5565b50505050565b6001600160a01b038316610ff75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610684565b6001600160a01b0382166110595760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610684565b6001600160a01b038316600090815260336020526040902054818110156110d15760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610684565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111319086815260200190565b60405180910390a3610f8d565b610de381336116cd565b6111528282610892565b61069757600082815260fe602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561118a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610613611726565b6111e28282610892565b1561069757600082815260fe602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b0382166112955760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610684565b80603560008282546112a791906120f5565b90915550506001600160a01b0382166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b610130546001600160a01b031633146107d45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610684565b61013080546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606060678054610520906120ab565b606060688054610520906120ab565b6001600160a01b03821661142c5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610684565b6001600160a01b038216600090815260336020526040902054818110156114a05760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610684565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b6001600160a01b03811660009081526099602052604090208054600181018255905b50919050565b600061050b6115356111ce565b8360405161190160f01b8152600281019290925260228201526042902090565b60008060006115668787878761179a565b915091506115738161185e565b5095945050505050565b6106978282611148565b600082815260fe6020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b600054610100900460ff166107d45760405162461bcd60e51b815260040161068490612124565b600054610100900460ff166116205760405162461bcd60e51b815260040161068490612124565b6107d43361135b565b600054610100900460ff166116505760405162461bcd60e51b815260040161068490612124565b8151611663906036906020850190611beb565b508051610604906037906020840190611beb565b600054610100900460ff16610de35760405162461bcd60e51b815260040161068490612124565b600054610100900460ff166116c55760405162461bcd60e51b815260040161068490612124565b600161016255565b6116d78282610892565b610697576116e4816119a8565b6116ef8360206119ba565b60405160200161170092919061216f565b60408051601f198184030181529082905262461bcd60e51b825261068491600401611cfd565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611751611b5d565b611759611bba565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156117d15750600090506003611855565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611825573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661184e57600060019250925050611855565b9150600090505b94509492505050565b6000816004811115611872576118726121e4565b0361187a5750565b600181600481111561188e5761188e6121e4565b036118db5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610684565b60028160048111156118ef576118ef6121e4565b0361193c5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610684565b6003816004811115611950576119506121e4565b03610de35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610684565b606061050b6001600160a01b03831660145b606060006119c98360026121fa565b6119d49060026120f5565b67ffffffffffffffff8111156119ec576119ec611f61565b6040519080825280601f01601f191660200182016040528015611a16576020820181803683370190505b509050600360fc1b81600081518110611a3157611a31612219565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611a6057611a60612219565b60200101906001600160f81b031916908160001a9053506000611a848460026121fa565b611a8f9060016120f5565b90505b6001811115611b07576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611ac357611ac3612219565b1a60f81b828281518110611ad957611ad9612219565b60200101906001600160f81b031916908160001a90535060049490941c93611b008161222f565b9050611a92565b508315611b565760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610684565b9392505050565b600080611b686113ae565b805190915015611b7f578051602090910120919050565b6065548015611b8e5792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b5090565b600080611bc56113bd565b805190915015611bdc578051602090910120919050565b6066548015611b8e5792915050565b828054611bf7906120ab565b90600052602060002090601f016020900481019282611c195760008555611c5f565b82601f10611c3257805160ff1916838001178555611c5f565b82800160010185558215611c5f579182015b82811115611c5f578251825591602001919060010190611c44565b50611bb69291505b80821115611bb65760008155600101611c67565b600060208284031215611c8d57600080fd5b81356001600160e01b031981168114611b5657600080fd5b60005b83811015611cc0578181015183820152602001611ca8565b83811115610f8d5750506000910152565b60008151808452611ce9816020860160208601611ca5565b601f01601f19169290920160200192915050565b602081526000611b566020830184611cd1565b80356001600160a01b0381168114611d2757600080fd5b919050565b60008060408385031215611d3f57600080fd5b611d4883611d10565b946020939093013593505050565b600080600060608486031215611d6b57600080fd5b611d7484611d10565b9250611d8260208501611d10565b9150604084013590509250925092565b600060208284031215611da457600080fd5b5035919050565b600060208284031215611dbd57600080fd5b611b5682611d10565b60008060408385031215611dd957600080fd5b82359150611de960208401611d10565b90509250929050565b60008060408385031215611e0557600080fd5b611e0e83611d10565b915060208301358015158114611e2357600080fd5b809150509250929050565b60ff60f81b881681526000602060e081840152611e4e60e084018a611cd1565b8381036040850152611e60818a611cd1565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015611eb257835183529284019291840191600101611e96565b50909c9b505050505050505050505050565b600080600080600080600060e0888a031215611edf57600080fd5b611ee888611d10565b9650611ef660208901611d10565b95506040880135945060608801359350608088013560ff81168114611f1a57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215611f4a57600080fd5b611f5383611d10565b9150611de960208401611d10565b634e487b7160e01b600052604160045260246000fd5b600082601f830112611f8857600080fd5b813567ffffffffffffffff80821115611fa357611fa3611f61565b604051601f8301601f19908116603f01168101908282118183101715611fcb57611fcb611f61565b81604052838152866020858801011115611fe457600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006020828403121561201657600080fd5b813567ffffffffffffffff8082111561202e57600080fd5b908301906040828603121561204257600080fd5b60405160408101818110838211171561205d5761205d611f61565b60405282358281111561206f57600080fd5b61207b87828601611f77565b82525060208301358281111561209057600080fd5b61209c87828601611f77565b60208301525095945050505050565b600181811c908216806120bf57607f821691505b60208210810361152257634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115612108576121086120df565b500190565b60008282101561211f5761211f6120df565b500390565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516121a7816017850160208801611ca5565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516121d8816028840160208801611ca5565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b6000816000190483118215151615612214576122146120df565b500290565b634e487b7160e01b600052603260045260246000fd5b60008161223e5761223e6120df565b50600019019056fedf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec42d3eedd6d69d410e954f4c622838ecc3acae9fdcd83cad412075c85b092770656a264697066735822122083608443b775cac1035c6343f1c06db4bb739e8dfd6c75367e37a00ae46fb3a164736f6c634300080d0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102065760003560e01c806375b238fc1161011a578063a457c2d7116100ad578063d936547e1161007c578063d936547e1461046a578063dd62ed3e1461048e578063e2b243ed146104a1578063e68b14ff146104b4578063f2fde38b146104c757600080fd5b8063a457c2d71461041e578063a9059cbb14610431578063d505accf14610444578063d547741f1461045757600080fd5b806391d14854116100e957806391d14854146103e857806395d89b41146103fb5780639dc29fac14610403578063a217fddf1461041657600080fd5b806375b238fc146103895780637ecebe001461039e57806384b0196e146103b15780638da5cb5b146103cc57600080fd5b80632f2ff15d1161019d578063395093511161016c578063395093511461031f57806340c10f191461033257806353d6fd591461034557806370a0823114610358578063715018a61461038157600080fd5b80632f2ff15d146102e0578063313ce567146102f55780633644e5151461030457806336568abe1461030c57600080fd5b806318160ddd116101d957806318160ddd1461027e57806323b872dd14610286578063248a9ca3146102995780632e48152c146102bc57600080fd5b806301ffc9a71461020b57806306fdde0314610233578063095ea7b31461024857806313430d921461025b575b600080fd5b61021e610219366004611c7b565b6104da565b60405190151581526020015b60405180910390f35b61023b610511565b60405161022a9190611cfd565b61021e610256366004611d2c565b6105a3565b61027060008051602061226783398151915281565b60405190815260200161022a565b603554610270565b61021e610294366004611d56565b6105bb565b6102706102a7366004611d92565b600090815260fe602052604090206001015490565b61021e6102ca366004611dab565b6101956020526000908152604090205460ff1681565b6102f36102ee366004611dc6565b6105df565b005b6040516012815260200161022a565b610270610609565b6102f361031a366004611dc6565b610618565b61021e61032d366004611d2c565b61069b565b6102f3610340366004611d2c565b6106bd565b6102f3610353366004611df2565b610729565b610270610366366004611dab565b6001600160a01b031660009081526033602052604090205490565b6102f36107c2565b61027060008051602061224783398151915281565b6102706103ac366004611dab565b6107d6565b6103b96107f4565b60405161022a9796959493929190611e2e565b610130546040516001600160a01b03909116815260200161022a565b61021e6103f6366004611dc6565b610892565b61023b6108bd565b6102f3610411366004611d2c565b6108cc565b610270600081565b61021e61042c366004611d2c565b6108fa565b61021e61043f366004611d2c565b610975565b6102f3610452366004611ec4565b610983565b6102f3610465366004611dc6565b610ae7565b61021e610478366004611dab565b6101946020526000908152604090205460ff1681565b61027061049c366004611f37565b610b0c565b6102f36104af366004612004565b610b37565b6102f36104c2366004611df2565b610cdc565b6102f36104d5366004611dab565b610d6d565b60006001600160e01b03198216637965db0b60e01b148061050b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060368054610520906120ab565b80601f016020809104026020016040519081016040528092919081815260200182805461054c906120ab565b80156105995780601f1061056e57610100808354040283529160200191610599565b820191906000526020600020905b81548152906001019060200180831161057c57829003601f168201915b5050505050905090565b6000336105b1818585610df5565b5060019392505050565b6000336105c9858285610f19565b6105d4858585610f93565b506001949350505050565b600082815260fe60205260409020600101546105fa8161113e565b6106048383611148565b505050565b60006106136111ce565b905090565b6001600160a01b038116331461068d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61069782826111d8565b5050565b6000336105b18185856106ae8383610b0c565b6106b891906120f5565b610df5565b336000908152610194602052604090205460ff166106ed576040516282b42960e81b815260040160405180910390fd5b336000908152610195602052604090205460ff161561071f57604051634a613c4160e01b815260040160405180910390fd5b610697828261123f565b61074160008051602061224783398151915233610892565b61075d576040516282b42960e81b815260040160405180910390fd5b6001600160a01b03821660008181526101946020908152604091829020805460ff19168515159081179091558251938452908301527f0aa5ec5ffdc7f6f9c4d0dded489d7450297155cb2f71cb771e02427f7dff4f5191015b60405180910390a15050565b6107ca611300565b6107d4600061135b565b565b6001600160a01b03811660009081526099602052604081205461050b565b6000606080600080600060606065546000801b1480156108145750606654155b6108585760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610684565b6108606113ae565b6108686113bd565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b600091825260fe602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060378054610520906120ab565b6000816108d98433610b0c565b6108e3919061210d565b90506108f0833383610df5565b61060483836113cc565b600033816109088286610b0c565b9050838110156109685760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610684565b6105d48286868403610df5565b6000336105b1818585610f93565b834211156109d35760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610684565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610a028c611500565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610a5d82611528565b90506000610a6d82878787611555565b9050896001600160a01b0316816001600160a01b031614610ad05760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610684565b610adb8a8a8a610df5565b50505050505050505050565b600082815260fe6020526040902060010154610b028161113e565b61060483836111d8565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b600054610100900460ff1615808015610b575750600054600160ff909116105b80610b715750303b158015610b71575060005460ff166001145b610bd45760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610684565b6000805460ff191660011790558015610bf7576000805461ff0019166101001790555b610c0f6000805160206122478339815191523361157d565b610c276000805160206122678339815191523361157d565b610c4d600080516020612267833981519152600080516020612247833981519152611587565b610c6560008051602061224783398151915280611587565b610c6d6115d2565b610c756115f9565b610c8782600001518360200151611629565b8151610c9290611677565b610c9a61169e565b8015610697576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016107b6565b610cf460008051602061226783398151915233610892565b610d10576040516282b42960e81b815260040160405180910390fd5b6001600160a01b03821660008181526101956020908152604091829020805460ff19168515159081179091558251938452908301527fe8699cf681560fd07de85543bd994263f4557bdc5179dd702f256d15fd083e1d91016107b6565b610d75611300565b6001600160a01b038116610dda5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610684565b610de38161135b565b50565b6001600160a01b03163b151590565b6001600160a01b038316610e575760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610684565b6001600160a01b038216610eb85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610684565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610f258484610b0c565b90506000198114610f8d5781811015610f805760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610684565b610f8d8484848403610df5565b50505050565b6001600160a01b038316610ff75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610684565b6001600160a01b0382166110595760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610684565b6001600160a01b038316600090815260336020526040902054818110156110d15760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610684565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111319086815260200190565b60405180910390a3610f8d565b610de381336116cd565b6111528282610892565b61069757600082815260fe602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561118a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610613611726565b6111e28282610892565b1561069757600082815260fe602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b0382166112955760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610684565b80603560008282546112a791906120f5565b90915550506001600160a01b0382166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b610130546001600160a01b031633146107d45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610684565b61013080546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606060678054610520906120ab565b606060688054610520906120ab565b6001600160a01b03821661142c5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610684565b6001600160a01b038216600090815260336020526040902054818110156114a05760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610684565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b6001600160a01b03811660009081526099602052604090208054600181018255905b50919050565b600061050b6115356111ce565b8360405161190160f01b8152600281019290925260228201526042902090565b60008060006115668787878761179a565b915091506115738161185e565b5095945050505050565b6106978282611148565b600082815260fe6020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b600054610100900460ff166107d45760405162461bcd60e51b815260040161068490612124565b600054610100900460ff166116205760405162461bcd60e51b815260040161068490612124565b6107d43361135b565b600054610100900460ff166116505760405162461bcd60e51b815260040161068490612124565b8151611663906036906020850190611beb565b508051610604906037906020840190611beb565b600054610100900460ff16610de35760405162461bcd60e51b815260040161068490612124565b600054610100900460ff166116c55760405162461bcd60e51b815260040161068490612124565b600161016255565b6116d78282610892565b610697576116e4816119a8565b6116ef8360206119ba565b60405160200161170092919061216f565b60408051601f198184030181529082905262461bcd60e51b825261068491600401611cfd565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611751611b5d565b611759611bba565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156117d15750600090506003611855565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611825573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661184e57600060019250925050611855565b9150600090505b94509492505050565b6000816004811115611872576118726121e4565b0361187a5750565b600181600481111561188e5761188e6121e4565b036118db5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610684565b60028160048111156118ef576118ef6121e4565b0361193c5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610684565b6003816004811115611950576119506121e4565b03610de35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610684565b606061050b6001600160a01b03831660145b606060006119c98360026121fa565b6119d49060026120f5565b67ffffffffffffffff8111156119ec576119ec611f61565b6040519080825280601f01601f191660200182016040528015611a16576020820181803683370190505b509050600360fc1b81600081518110611a3157611a31612219565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611a6057611a60612219565b60200101906001600160f81b031916908160001a9053506000611a848460026121fa565b611a8f9060016120f5565b90505b6001811115611b07576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611ac357611ac3612219565b1a60f81b828281518110611ad957611ad9612219565b60200101906001600160f81b031916908160001a90535060049490941c93611b008161222f565b9050611a92565b508315611b565760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610684565b9392505050565b600080611b686113ae565b805190915015611b7f578051602090910120919050565b6065548015611b8e5792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b5090565b600080611bc56113bd565b805190915015611bdc578051602090910120919050565b6066548015611b8e5792915050565b828054611bf7906120ab565b90600052602060002090601f016020900481019282611c195760008555611c5f565b82601f10611c3257805160ff1916838001178555611c5f565b82800160010185558215611c5f579182015b82811115611c5f578251825591602001919060010190611c44565b50611bb69291505b80821115611bb65760008155600101611c67565b600060208284031215611c8d57600080fd5b81356001600160e01b031981168114611b5657600080fd5b60005b83811015611cc0578181015183820152602001611ca8565b83811115610f8d5750506000910152565b60008151808452611ce9816020860160208601611ca5565b601f01601f19169290920160200192915050565b602081526000611b566020830184611cd1565b80356001600160a01b0381168114611d2757600080fd5b919050565b60008060408385031215611d3f57600080fd5b611d4883611d10565b946020939093013593505050565b600080600060608486031215611d6b57600080fd5b611d7484611d10565b9250611d8260208501611d10565b9150604084013590509250925092565b600060208284031215611da457600080fd5b5035919050565b600060208284031215611dbd57600080fd5b611b5682611d10565b60008060408385031215611dd957600080fd5b82359150611de960208401611d10565b90509250929050565b60008060408385031215611e0557600080fd5b611e0e83611d10565b915060208301358015158114611e2357600080fd5b809150509250929050565b60ff60f81b881681526000602060e081840152611e4e60e084018a611cd1565b8381036040850152611e60818a611cd1565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015611eb257835183529284019291840191600101611e96565b50909c9b505050505050505050505050565b600080600080600080600060e0888a031215611edf57600080fd5b611ee888611d10565b9650611ef660208901611d10565b95506040880135945060608801359350608088013560ff81168114611f1a57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215611f4a57600080fd5b611f5383611d10565b9150611de960208401611d10565b634e487b7160e01b600052604160045260246000fd5b600082601f830112611f8857600080fd5b813567ffffffffffffffff80821115611fa357611fa3611f61565b604051601f8301601f19908116603f01168101908282118183101715611fcb57611fcb611f61565b81604052838152866020858801011115611fe457600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006020828403121561201657600080fd5b813567ffffffffffffffff8082111561202e57600080fd5b908301906040828603121561204257600080fd5b60405160408101818110838211171561205d5761205d611f61565b60405282358281111561206f57600080fd5b61207b87828601611f77565b82525060208301358281111561209057600080fd5b61209c87828601611f77565b60208301525095945050505050565b600181811c908216806120bf57607f821691505b60208210810361152257634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115612108576121086120df565b500190565b60008282101561211f5761211f6120df565b500390565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516121a7816017850160208801611ca5565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516121d8816028840160208801611ca5565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b6000816000190483118215151615612214576122146120df565b500290565b634e487b7160e01b600052603260045260246000fd5b60008161223e5761223e6120df565b50600019019056fedf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec42d3eedd6d69d410e954f4c622838ecc3acae9fdcd83cad412075c85b092770656a264697066735822122083608443b775cac1035c6343f1c06db4bb739e8dfd6c75367e37a00ae46fb3a164736f6c634300080d0033
Deployed Bytecode Sourcemap
117365:4032:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;56142:215;;;;;;:::i;:::-;;:::i;:::-;;;470:14:1;;463:22;445:41;;433:2;418:18;56142:215:0;;;;;;;;99155:100;;;:::i;:::-;;;;;;;:::i;101515:201::-;;;;;;:::i;:::-;;:::i;117710:61::-;;-1:-1:-1;;;;;;;;;;;117710:61:0;;;;;1831:25:1;;;1819:2;1804:18;117710:61:0;1685:177:1;100284:108:0;100372:12;;100284:108;;102296:261;;;;;;:::i;:::-;;:::i;57998:131::-;;;;;;:::i;:::-;58072:7;58099:12;;;:6;:12;;;;;:22;;;;57998:131;117984:38;;;;;;:::i;:::-;;;;;;;;;;;;;;;;58439:147;;;;;;:::i;:::-;;:::i;:::-;;100126:93;;;100209:2;3159:36:1;;3147:2;3132:18;100126:93:0;3017:184:1;115986:115:0;;;:::i;59583:218::-;;;;;;:::i;:::-;;:::i;102966:238::-;;;;;;:::i;:::-;;:::i;119979:181::-;;;;;;:::i;:::-;;:::i;120432:150::-;;;;;;:::i;:::-;;:::i;100455:127::-;;;;;;:::i;:::-;-1:-1:-1;;;;;100556:18:0;100529:7;100556:18;;;:9;:18;;;;;;;100455:127;64243:103;;;:::i;117568:55::-;;-1:-1:-1;;;;;;;;;;;117568:55:0;;115728:128;;;;;;:::i;:::-;;:::i;89388:889::-;;;:::i;:::-;;;;;;;;;;;;;:::i;63602:87::-;63675:6;;63602:87;;-1:-1:-1;;;;;63675:6:0;;;4968:51:1;;4956:2;4941:18;63602:87:0;4822:203:1;56449:147:0;;;;;;:::i;:::-;;:::i;99374:104::-;;;:::i;121182:212::-;;;;;;:::i;:::-;;:::i;55543:49::-;;55588:4;55543:49;;103707:436;;;;;;:::i;:::-;;:::i;100788:193::-;;;;;;:::i;:::-;;:::i;115006:656::-;;;;;;:::i;:::-;;:::i;58879:149::-;;;;;;:::i;:::-;;:::i;117858:43::-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;101044:151;;;;;;:::i;:::-;;:::i;118610:471::-;;;;;;:::i;:::-;;:::i;120872:139::-;;;;;;:::i;:::-;;:::i;64501:201::-;;;;;;:::i;:::-;;:::i;56142:215::-;56227:4;-1:-1:-1;;;;;;56251:58:0;;-1:-1:-1;;;56251:58:0;;:98;;-1:-1:-1;;;;;;;;;;52824:51:0;;;56313:36;56244:105;56142:215;-1:-1:-1;;56142:215:0:o;99155:100::-;99209:13;99242:5;99235:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;99155:100;:::o;101515:201::-;101598:4;50241:10;101654:32;50241:10;101670:7;101679:6;101654:8;:32::i;:::-;-1:-1:-1;101704:4:0;;101515:201;-1:-1:-1;;;101515:201:0:o;102296:261::-;102393:4;50241:10;102451:38;102467:4;50241:10;102482:6;102451:15;:38::i;:::-;102500:27;102510:4;102516:2;102520:6;102500:9;:27::i;:::-;-1:-1:-1;102545:4:0;;102296:261;-1:-1:-1;;;;102296:261:0:o;58439:147::-;58072:7;58099:12;;;:6;:12;;;;;:22;;;56034:16;56045:4;56034:10;:16::i;:::-;58553:25:::1;58564:4;58570:7;58553:10;:25::i;:::-;58439:147:::0;;;:::o;115986:115::-;116046:7;116073:20;:18;:20::i;:::-;116066:27;;115986:115;:::o;59583:218::-;-1:-1:-1;;;;;59679:23:0;;50241:10;59679:23;59671:83;;;;-1:-1:-1;;;59671:83:0;;8387:2:1;59671:83:0;;;8369:21:1;8426:2;8406:18;;;8399:30;8465:34;8445:18;;;8438:62;-1:-1:-1;;;8516:18:1;;;8509:45;8571:19;;59671:83:0;;;;;;;;;59767:26;59779:4;59785:7;59767:11;:26::i;:::-;59583:218;;:::o;102966:238::-;103054:4;50241:10;103110:64;50241:10;103126:7;103163:10;103135:25;50241:10;103126:7;103135:9;:25::i;:::-;:38;;;;:::i;:::-;103110:8;:64::i;119979:181::-;119599:10;119587:23;;;;:11;:23;;;;;;;;119583:67;;119628:14;;-1:-1:-1;;;119628:14:0;;;;;;;;;;;119583:67;120071:10:::1;120064:18;::::0;;;:6:::1;:18;::::0;;;;;::::1;;120060:62;;;120100:14;;-1:-1:-1::0;;;120100:14:0::1;;;;;;;;;;;120060:62;120130:24;120136:9;120147:6;120130:5;:24::i;120432:150::-:0;119192:31;-1:-1:-1;;;;;;;;;;;119212:10:0;119192:7;:31::i;:::-;119187:76;;119241:14;;-1:-1:-1;;;119241:14:0;;;;;;;;;;;119187:76;-1:-1:-1;;;;;120508:19:0;::::1;;::::0;;;:11:::1;:19;::::0;;;;;;;;:27;;-1:-1:-1;;120508:27:0::1;::::0;::::1;;::::0;;::::1;::::0;;;120549;;9034:51:1;;;9101:18;;;9094:50;120549:27:0::1;::::0;9007:18:1;120549:27:0::1;;;;;;;;120432:150:::0;;:::o;64243:103::-;63488:13;:11;:13::i;:::-;64308:30:::1;64335:1;64308:18;:30::i;:::-;64243:103::o:0;115728:128::-;-1:-1:-1;;;;;115824:14:0;;115797:7;115824:14;;;:7;:14;;;;;74161;115824:24;74069:114;89388:889;89509:13;89537:18;89570:21;89606:15;89636:25;89676:12;89703:27;89971:11;;89986:1;89971:16;;;:39;;;;-1:-1:-1;89991:14:0;;:19;89971:39;89963:73;;;;-1:-1:-1;;;89963:73:0;;9357:2:1;89963:73:0;;;9339:21:1;9396:2;9376:18;;;9369:30;-1:-1:-1;;;9415:18:1;;;9408:51;9476:18;;89963:73:0;9155:345:1;89963:73:0;90102:13;:11;:13::i;:::-;90130:16;:14;:16::i;:::-;90242;;;90225:1;90242:16;;;;;;;;;-1:-1:-1;;;90049:220:0;;;-1:-1:-1;90049:220:0;;-1:-1:-1;90161:13:0;;-1:-1:-1;90197:4:0;;-1:-1:-1;90225:1:0;-1:-1:-1;90242:16:0;-1:-1:-1;90049:220:0;-1:-1:-1;89388:889:0:o;56449:147::-;56535:4;56559:12;;;:6;:12;;;;;;;;-1:-1:-1;;;;;56559:29:0;;;;;;;;;;;;;;;56449:147::o;99374:104::-;99430:13;99463:7;99456:14;;;;;:::i;121182:212::-;121245:20;121301:6;121268:30;121278:7;121287:10;121268:9;:30::i;:::-;:39;;;;:::i;:::-;121245:62;;121316:43;121325:7;121334:10;121346:12;121316:8;:43::i;:::-;121366:22;121372:7;121381:6;121366:5;:22::i;103707:436::-;103800:4;50241:10;103800:4;103883:25;50241:10;103900:7;103883:9;:25::i;:::-;103856:52;;103947:15;103927:16;:35;;103919:85;;;;-1:-1:-1;;;103919:85:0;;9837:2:1;103919:85:0;;;9819:21:1;9876:2;9856:18;;;9849:30;9915:34;9895:18;;;9888:62;-1:-1:-1;;;9966:18:1;;;9959:35;10011:19;;103919:85:0;9635:401:1;103919:85:0;104040:60;104049:5;104056:7;104084:15;104065:16;:34;104040:8;:60::i;100788:193::-;100867:4;50241:10;100923:28;50241:10;100940:2;100944:6;100923:9;:28::i;115006:656::-;115250:8;115231:15;:27;;115223:69;;;;-1:-1:-1;;;115223:69:0;;10243:2:1;115223:69:0;;;10225:21:1;10282:2;10262:18;;;10255:30;10321:31;10301:18;;;10294:59;10370:18;;115223:69:0;10041:353:1;115223:69:0;115305:18;114017:95;115365:5;115372:7;115381:5;115388:16;115398:5;115388:9;:16::i;:::-;115336:79;;;;;;10686:25:1;;;;-1:-1:-1;;;;;10785:15:1;;;10765:18;;;10758:43;10837:15;;;;10817:18;;;10810:43;10869:18;;;10862:34;10912:19;;;10905:35;10956:19;;;10949:35;;;10658:19;;115336:79:0;;;;;;;;;;;;115326:90;;;;;;115305:111;;115429:12;115444:28;115461:10;115444:16;:28::i;:::-;115429:43;;115485:14;115502:39;115527:4;115533:1;115536;115539;115502:24;:39::i;:::-;115485:56;;115570:5;-1:-1:-1;;;;;115560:15:0;:6;-1:-1:-1;;;;;115560:15:0;;115552:58;;;;-1:-1:-1;;;115552:58:0;;11197:2:1;115552:58:0;;;11179:21:1;11236:2;11216:18;;;11209:30;11275:32;11255:18;;;11248:60;11325:18;;115552:58:0;10995:354:1;115552:58:0;115623:31;115632:5;115639:7;115648:5;115623:8;:31::i;:::-;115212:450;;;115006:656;;;;;;;:::o;58879:149::-;58072:7;58099:12;;;:6;:12;;;;;:22;;;56034:16;56045:4;56034:10;:16::i;:::-;58994:26:::1;59006:4;59012:7;58994:11;:26::i;101044:151::-:0;-1:-1:-1;;;;;101160:18:0;;;101133:7;101160:18;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;101044:151::o;118610:471::-;45829:19;45852:13;;;;;;45851:14;;45899:34;;;;-1:-1:-1;45917:12:0;;45932:1;45917:12;;;;:16;45899:34;45898:108;;;-1:-1:-1;45978:4:0;34591:19;:23;;;45939:66;;-1:-1:-1;45988:12:0;;;;;:17;45939:66;45876:204;;;;-1:-1:-1;;;45876:204:0;;11556:2:1;45876:204:0;;;11538:21:1;11595:2;11575:18;;;11568:30;11634:34;11614:18;;;11607:62;-1:-1:-1;;;11685:18:1;;;11678:44;11739:19;;45876:204:0;11354:410:1;45876:204:0;46091:12;:16;;-1:-1:-1;;46091:16:0;46106:1;46091:16;;;46118:67;;;;46153:13;:20;;-1:-1:-1;;46153:20:0;;;;;46118:67;118692:34:::1;-1:-1:-1::0;;;;;;;;;;;118715:10:0::1;118692;:34::i;:::-;118733:37;-1:-1:-1::0;;;;;;;;;;;118759:10:0::1;118733;:37::i;:::-;118777:40;-1:-1:-1::0;;;;;;;;;;;;;;;;;;;;;;118777:13:0::1;:40::i;:::-;118824:37;-1:-1:-1::0;;;;;;;;;;;117605:18:0;118824:13:::1;:37::i;:::-;118870:26;:24;:26::i;:::-;118903;:24;:26::i;:::-;118936:50;118959:6;:11;;;118972:6;:13;;;118936:22;:50::i;:::-;119022:11:::0;;118993:41:::1;::::0;:28:::1;:41::i;:::-;119041:34;:32;:34::i;:::-;46211:14:::0;46207:102;;;46258:5;46242:21;;-1:-1:-1;;46242:21:0;;;46283:14;;-1:-1:-1;3159:36:1;;46283:14:0;;3147:2:1;3132:18;46283:14:0;3017:184:1;120872:139:0;119392:34;-1:-1:-1;;;;;;;;;;;119415:10:0;119392:7;:34::i;:::-;119388:78;;119444:14;;-1:-1:-1;;;119444:14:0;;;;;;;;;;;119388:78;-1:-1:-1;;;;;120950:14:0;::::1;;::::0;;;:6:::1;:14;::::0;;;;;;;;:22;;-1:-1:-1;;120950:22:0::1;::::0;::::1;;::::0;;::::1;::::0;;;120984:21;;9034:51:1;;;9101:18;;;9094:50;120984:21:0::1;::::0;9007:18:1;120984:21:0::1;8866:284:1::0;64501:201:0;63488:13;:11;:13::i;:::-;-1:-1:-1;;;;;64590:22:0;::::1;64582:73;;;::::0;-1:-1:-1;;;64582:73:0;;12170:2:1;64582:73:0::1;::::0;::::1;12152:21:1::0;12209:2;12189:18;;;12182:30;12248:34;12228:18;;;12221:62;-1:-1:-1;;;12299:18:1;;;12292:36;12345:19;;64582:73:0::1;11968:402:1::0;64582:73:0::1;64666:28;64685:8;64666:18;:28::i;:::-;64501:201:::0;:::o;34296:326::-;-1:-1:-1;;;;;34591:19:0;;:23;;;34296:326::o;107700:346::-;-1:-1:-1;;;;;107802:19:0;;107794:68;;;;-1:-1:-1;;;107794:68:0;;12577:2:1;107794:68:0;;;12559:21:1;12616:2;12596:18;;;12589:30;12655:34;12635:18;;;12628:62;-1:-1:-1;;;12706:18:1;;;12699:34;12750:19;;107794:68:0;12375:400:1;107794:68:0;-1:-1:-1;;;;;107881:21:0;;107873:68;;;;-1:-1:-1;;;107873:68:0;;12982:2:1;107873:68:0;;;12964:21:1;13021:2;13001:18;;;12994:30;13060:34;13040:18;;;13033:62;-1:-1:-1;;;13111:18:1;;;13104:32;13153:19;;107873:68:0;12780:398:1;107873:68:0;-1:-1:-1;;;;;107954:18:0;;;;;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;:36;;;108006:32;;1831:25:1;;;108006:32:0;;1804:18:1;108006:32:0;;;;;;;107700:346;;;:::o;108337:419::-;108438:24;108465:25;108475:5;108482:7;108465:9;:25::i;:::-;108438:52;;-1:-1:-1;;108505:16:0;:37;108501:248;;108587:6;108567:16;:26;;108559:68;;;;-1:-1:-1;;;108559:68:0;;13385:2:1;108559:68:0;;;13367:21:1;13424:2;13404:18;;;13397:30;13463:31;13443:18;;;13436:59;13512:18;;108559:68:0;13183:353:1;108559:68:0;108671:51;108680:5;108687:7;108715:6;108696:16;:25;108671:8;:51::i;:::-;108427:329;108337:419;;;:::o;104613:806::-;-1:-1:-1;;;;;104710:18:0;;104702:68;;;;-1:-1:-1;;;104702:68:0;;13743:2:1;104702:68:0;;;13725:21:1;13782:2;13762:18;;;13755:30;13821:34;13801:18;;;13794:62;-1:-1:-1;;;13872:18:1;;;13865:35;13917:19;;104702:68:0;13541:401:1;104702:68:0;-1:-1:-1;;;;;104789:16:0;;104781:64;;;;-1:-1:-1;;;104781:64:0;;14149:2:1;104781:64:0;;;14131:21:1;14188:2;14168:18;;;14161:30;14227:34;14207:18;;;14200:62;-1:-1:-1;;;14278:18:1;;;14271:33;14321:19;;104781:64:0;13947:399:1;104781:64:0;-1:-1:-1;;;;;104931:15:0;;104909:19;104931:15;;;:9;:15;;;;;;104965:21;;;;104957:72;;;;-1:-1:-1;;;104957:72:0;;14553:2:1;104957:72:0;;;14535:21:1;14592:2;14572:18;;;14565:30;14631:34;14611:18;;;14604:62;-1:-1:-1;;;14682:18:1;;;14675:36;14728:19;;104957:72:0;14351:402:1;104957:72:0;-1:-1:-1;;;;;105065:15:0;;;;;;;:9;:15;;;;;;105083:20;;;105065:38;;105283:13;;;;;;;;;;:23;;;;;;105335:26;;;;;;105097:6;1831:25:1;;1819:2;1804:18;;1685:177;105335:26:0;;;;;;;;105374:37;58439:147;56900:105;56967:30;56978:4;50241:10;56967;:30::i;61180:238::-;61264:22;61272:4;61278:7;61264;:22::i;:::-;61259:152;;61303:12;;;;:6;:12;;;;;;;;-1:-1:-1;;;;;61303:29:0;;;;;;;;;:36;;-1:-1:-1;;61303:36:0;61335:4;61303:36;;;61386:12;50241:10;;50161:98;61386:12;-1:-1:-1;;;;;61359:40:0;61377:7;-1:-1:-1;;;;;61359:40:0;61371:4;61359:40;;;;;;;;;;61180:238;;:::o;88160:111::-;88213:7;88240:23;:21;:23::i;61598:239::-;61682:22;61690:4;61696:7;61682;:22::i;:::-;61678:152;;;61753:5;61721:12;;;:6;:12;;;;;;;;-1:-1:-1;;;;;61721:29:0;;;;;;;;;;:37;;-1:-1:-1;;61721:37:0;;;61778:40;50241:10;;61721:12;;61778:40;;61753:5;61778:40;61598:239;;:::o;105706:548::-;-1:-1:-1;;;;;105790:21:0;;105782:65;;;;-1:-1:-1;;;105782:65:0;;14960:2:1;105782:65:0;;;14942:21:1;14999:2;14979:18;;;14972:30;15038:33;15018:18;;;15011:61;15089:18;;105782:65:0;14758:355:1;105782:65:0;105938:6;105922:12;;:22;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;;;106093:18:0;;;;;;:9;:18;;;;;;;;:28;;;;;;106148:37;1831:25:1;;;106148:37:0;;1804:18:1;106148:37:0;;;;;;;59583:218;;:::o;63767:132::-;63675:6;;-1:-1:-1;;;;;63675:6:0;50241:10;63831:23;63823:68;;;;-1:-1:-1;;;63823:68:0;;15320:2:1;63823:68:0;;;15302:21:1;;;15339:18;;;15332:30;15398:34;15378:18;;;15371:62;15450:18;;63823:68:0;15118:356:1;64862:191:0;64955:6;;;-1:-1:-1;;;;;64972:17:0;;;-1:-1:-1;;;;;;64972:17:0;;;;;;;65005:40;;64955:6;;;64972:17;64955:6;;65005:40;;64936:16;;65005:40;64925:128;64862:191;:::o;90509:100::-;90563:13;90596:5;90589:12;;;;;:::i;90844:106::-;90901:13;90934:8;90927:15;;;;;:::i;106587:675::-;-1:-1:-1;;;;;106671:21:0;;106663:67;;;;-1:-1:-1;;;106663:67:0;;15681:2:1;106663:67:0;;;15663:21:1;15720:2;15700:18;;;15693:30;15759:34;15739:18;;;15732:62;-1:-1:-1;;;15810:18:1;;;15803:31;15851:19;;106663:67:0;15479:397:1;106663:67:0;-1:-1:-1;;;;;106830:18:0;;106805:22;106830:18;;;:9;:18;;;;;;106867:24;;;;106859:71;;;;-1:-1:-1;;;106859:71:0;;16083:2:1;106859:71:0;;;16065:21:1;16122:2;16102:18;;;16095:30;16161:34;16141:18;;;16134:62;-1:-1:-1;;;16212:18:1;;;16205:32;16254:19;;106859:71:0;15881:398:1;106859:71:0;-1:-1:-1;;;;;106966:18:0;;;;;;:9;:18;;;;;;;;106987:23;;;106966:44;;107105:12;:22;;;;;;;107156:37;1831:25:1;;;106966:18:0;;;107156:37;;1804:18:1;107156:37:0;;;;;;;58439:147;;;:::o;116239:218::-;-1:-1:-1;;;;;116371:14:0;;116299:15;116371:14;;;:7;:14;;;;;74161;;74298:1;74280:19;;;;74161:14;116432:17;116316:141;116239:218;;;:::o;89115:178::-;89192:7;89219:66;89252:20;:18;:20::i;:::-;89274:10;83460:4;83454:11;-1:-1:-1;;;83479:23:0;;83532:4;83523:14;;83516:39;;;;83585:4;83576:14;;83569:34;83640:4;83625:20;;;83257:406;81462:236;81547:7;81568:17;81587:18;81609:25;81620:4;81626:1;81629;81632;81609:10;:25::i;:::-;81567:67;;;;81645:18;81657:5;81645:11;:18::i;:::-;-1:-1:-1;81681:9:0;81462:236;-1:-1:-1;;;;;81462:236:0:o;60508:112::-;60587:25;60598:4;60604:7;60587:10;:25::i;60752:251::-;60836:25;58099:12;;;:6;:12;;;;;;:22;;;;60893:34;;;;60943:52;;58099:22;;60893:34;;58099:22;;:12;;60943:52;;60836:25;60943:52;60825:178;60752:251;;:::o;50085:70::-;47972:13;;;;;;;47964:69;;;;-1:-1:-1;;;47964:69:0;;;;;;;:::i;63250:113::-;47972:13;;;;;;;47964:69;;;;-1:-1:-1;;;47964:69:0;;;;;;;:::i;:::-;63323:32:::1;50241:10:::0;63323:18:::1;:32::i;98923:162::-:0;47972:13;;;;;;;47964:69;;;;-1:-1:-1;;;47964:69:0;;;;;;;:::i;:::-;99036:13;;::::1;::::0;:5:::1;::::0;:13:::1;::::0;::::1;::::0;::::1;:::i;:::-;-1:-1:-1::0;99060:17:0;;::::1;::::0;:7:::1;::::0;:17:::1;::::0;::::1;::::0;::::1;:::i;114859:81::-:0;47972:13;;;;;;;47964:69;;;;-1:-1:-1;;;47964:69:0;;;;;;;:::i;71426:111::-;47972:13;;;;;;;47964:69;;;;-1:-1:-1;;;47964:69:0;;;;;;;:::i;:::-;71219:1:::1;71507:7;:22:::0;71426:111::o;57295:514::-;57384:22;57392:4;57398:7;57384;:22::i;:::-;57379:423;;57572:39;57603:7;57572:30;:39::i;:::-;57684:49;57723:4;57730:2;57684:30;:49::i;:::-;57477:279;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;57477:279:0;;;;;;;;;;-1:-1:-1;;;57423:367:0;;;;;;;:::i;88279:194::-;88334:7;86731:95;88394:17;:15;:17::i;:::-;88413:20;:18;:20::i;:::-;88371:93;;;;;;17746:25:1;;;;17787:18;;17780:34;;;;17830:18;;;17823:34;88435:13:0;17873:18:1;;;17866:34;88458:4:0;17916:19:1;;;17909:61;17718:19;;88371:93:0;;;;;;;;;;;;88361:104;;;;;;88354:111;;88279:194;:::o;79846:1477::-;79934:7;;80868:66;80855:79;;80851:163;;;-1:-1:-1;80967:1:0;;-1:-1:-1;80971:30:0;80951:51;;80851:163;81128:24;;;81111:14;81128:24;;;;;;;;;18208:25:1;;;18281:4;18269:17;;18249:18;;;18242:45;;;;18303:18;;;18296:34;;;18346:18;;;18339:34;;;81128:24:0;;18180:19:1;;81128:24:0;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;81128:24:0;;-1:-1:-1;;81128:24:0;;;-1:-1:-1;;;;;;;81167:20:0;;81163:103;;81220:1;81224:29;81204:50;;;;;;;81163:103;81286:6;-1:-1:-1;81294:20:0;;-1:-1:-1;79846:1477:0;;;;;;;;:::o;75306:521::-;75384:20;75375:5;:29;;;;;;;;:::i;:::-;;75371:449;;75306:521;:::o;75371:449::-;75482:29;75473:5;:38;;;;;;;;:::i;:::-;;75469:351;;75528:34;;-1:-1:-1;;;75528:34:0;;18718:2:1;75528:34:0;;;18700:21:1;18757:2;18737:18;;;18730:30;18796:26;18776:18;;;18769:54;18840:18;;75528:34:0;18516:348:1;75469:351:0;75593:35;75584:5;:44;;;;;;;;:::i;:::-;;75580:240;;75645:41;;-1:-1:-1;;;75645:41:0;;19071:2:1;75645:41:0;;;19053:21:1;19110:2;19090:18;;;19083:30;19149:33;19129:18;;;19122:61;19200:18;;75645:41:0;18869:355:1;75580:240:0;75717:30;75708:5;:39;;;;;;;;:::i;:::-;;75704:116;;75764:44;;-1:-1:-1;;;75764:44:0;;19431:2:1;75764:44:0;;;19413:21:1;19470:2;19450:18;;;19443:30;19509:34;19489:18;;;19482:62;-1:-1:-1;;;19560:18:1;;;19553:32;19602:19;;75764:44:0;19229:398:1;32390:151:0;32448:13;32481:52;-1:-1:-1;;;;;32493:22:0;;30232:2;31786:447;31861:13;31887:19;31919:10;31923:6;31919:1;:10;:::i;:::-;:14;;31932:1;31919:14;:::i;:::-;31909:25;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;31909:25:0;;31887:47;;-1:-1:-1;;;31945:6:0;31952:1;31945:9;;;;;;;;:::i;:::-;;;;:15;-1:-1:-1;;;;;31945:15:0;;;;;;;;;-1:-1:-1;;;31971:6:0;31978:1;31971:9;;;;;;;;:::i;:::-;;;;:15;-1:-1:-1;;;;;31971:15:0;;;;;;;;-1:-1:-1;32002:9:0;32014:10;32018:6;32014:1;:10;:::i;:::-;:14;;32027:1;32014:14;:::i;:::-;32002:26;;31997:131;32034:1;32030;:5;31997:131;;;-1:-1:-1;;;32078:5:0;32086:3;32078:11;32069:21;;;;;;;:::i;:::-;;;;32057:6;32064:1;32057:9;;;;;;;;:::i;:::-;;;;:33;-1:-1:-1;;;;;32057:33:0;;;;;;;;-1:-1:-1;32115:1:0;32105:11;;;;;32037:3;;;:::i;:::-;;;31997:131;;;-1:-1:-1;32146:10:0;;32138:55;;;;-1:-1:-1;;;32138:55:0;;20280:2:1;32138:55:0;;;20262:21:1;;;20299:18;;;20292:30;20358:34;20338:18;;;20331:62;20410:18;;32138:55:0;20078:356:1;32138:55:0;32218:6;31786:447;-1:-1:-1;;;31786:447:0:o;91172:644::-;91222:7;91242:18;91263:13;:11;:13::i;:::-;91291:18;;91242:34;;-1:-1:-1;91291:22:0;91287:522;;91337:22;;;;;;;;91172:644;-1:-1:-1;91172:644:0:o;91287:522::-;91638:11;;91668:15;;91664:134;;91711:10;91172:644;-1:-1:-1;;91172:644:0:o;91664:134::-;91769:13;91762:20;;;;91172:644;:::o;91287:522::-;91231:585;91172:644;:::o;92044:680::-;92097:7;92117:21;92141:16;:14;:16::i;:::-;92172:21;;92117:40;;-1:-1:-1;92172:25:0;92168:549;;92221:25;;;;;;;;92044:680;-1:-1:-1;92044:680:0:o;92168:549::-;92537:14;;92570:18;;92566:140;;92616:13;92044:680;-1:-1:-1;;92044:680:0:o;-1:-1:-1:-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14:286:1;72:6;125:2;113:9;104:7;100:23;96:32;93:52;;;141:1;138;131:12;93:52;167:23;;-1:-1:-1;;;;;;219:32:1;;209:43;;199:71;;266:1;263;256:12;497:258;569:1;579:113;593:6;590:1;587:13;579:113;;;669:11;;;663:18;650:11;;;643:39;615:2;608:10;579:113;;;710:6;707:1;704:13;701:48;;;-1:-1:-1;;745:1:1;727:16;;720:27;497:258::o;760:::-;802:3;840:5;834:12;867:6;862:3;855:19;883:63;939:6;932:4;927:3;923:14;916:4;909:5;905:16;883:63;:::i;:::-;1000:2;979:15;-1:-1:-1;;975:29:1;966:39;;;;1007:4;962:50;;760:258;-1:-1:-1;;760:258:1:o;1023:220::-;1172:2;1161:9;1154:21;1135:4;1192:45;1233:2;1222:9;1218:18;1210:6;1192:45;:::i;1248:173::-;1316:20;;-1:-1:-1;;;;;1365:31:1;;1355:42;;1345:70;;1411:1;1408;1401:12;1345:70;1248:173;;;:::o;1426:254::-;1494:6;1502;1555:2;1543:9;1534:7;1530:23;1526:32;1523:52;;;1571:1;1568;1561:12;1523:52;1594:29;1613:9;1594:29;:::i;:::-;1584:39;1670:2;1655:18;;;;1642:32;;-1:-1:-1;;;1426:254:1:o;2049:328::-;2126:6;2134;2142;2195:2;2183:9;2174:7;2170:23;2166:32;2163:52;;;2211:1;2208;2201:12;2163:52;2234:29;2253:9;2234:29;:::i;:::-;2224:39;;2282:38;2316:2;2305:9;2301:18;2282:38;:::i;:::-;2272:48;;2367:2;2356:9;2352:18;2339:32;2329:42;;2049:328;;;;;:::o;2382:180::-;2441:6;2494:2;2482:9;2473:7;2469:23;2465:32;2462:52;;;2510:1;2507;2500:12;2462:52;-1:-1:-1;2533:23:1;;2382:180;-1:-1:-1;2382:180:1:o;2567:186::-;2626:6;2679:2;2667:9;2658:7;2654:23;2650:32;2647:52;;;2695:1;2692;2685:12;2647:52;2718:29;2737:9;2718:29;:::i;2758:254::-;2826:6;2834;2887:2;2875:9;2866:7;2862:23;2858:32;2855:52;;;2903:1;2900;2893:12;2855:52;2939:9;2926:23;2916:33;;2968:38;3002:2;2991:9;2987:18;2968:38;:::i;:::-;2958:48;;2758:254;;;;;:::o;3206:347::-;3271:6;3279;3332:2;3320:9;3311:7;3307:23;3303:32;3300:52;;;3348:1;3345;3338:12;3300:52;3371:29;3390:9;3371:29;:::i;:::-;3361:39;;3450:2;3439:9;3435:18;3422:32;3497:5;3490:13;3483:21;3476:5;3473:32;3463:60;;3519:1;3516;3509:12;3463:60;3542:5;3532:15;;;3206:347;;;;;:::o;3558:1259::-;3964:3;3959;3955:13;3947:6;3943:26;3932:9;3925:45;3906:4;3989:2;4027:3;4022:2;4011:9;4007:18;4000:31;4054:46;4095:3;4084:9;4080:19;4072:6;4054:46;:::i;:::-;4148:9;4140:6;4136:22;4131:2;4120:9;4116:18;4109:50;4182:33;4208:6;4200;4182:33;:::i;:::-;4246:2;4231:18;;4224:34;;;-1:-1:-1;;;;;4295:32:1;;4289:3;4274:19;;4267:61;4315:3;4344:19;;4337:35;;;4409:22;;;4403:3;4388:19;;4381:51;4481:13;;4503:22;;;4579:15;;;;-1:-1:-1;4541:15:1;;;;-1:-1:-1;4622:169:1;4636:6;4633:1;4630:13;4622:169;;;4697:13;;4685:26;;4766:15;;;;4731:12;;;;4658:1;4651:9;4622:169;;;-1:-1:-1;4808:3:1;;3558:1259;-1:-1:-1;;;;;;;;;;;;3558:1259:1:o;5030:693::-;5141:6;5149;5157;5165;5173;5181;5189;5242:3;5230:9;5221:7;5217:23;5213:33;5210:53;;;5259:1;5256;5249:12;5210:53;5282:29;5301:9;5282:29;:::i;:::-;5272:39;;5330:38;5364:2;5353:9;5349:18;5330:38;:::i;:::-;5320:48;;5415:2;5404:9;5400:18;5387:32;5377:42;;5466:2;5455:9;5451:18;5438:32;5428:42;;5520:3;5509:9;5505:19;5492:33;5565:4;5558:5;5554:16;5547:5;5544:27;5534:55;;5585:1;5582;5575:12;5534:55;5030:693;;;;-1:-1:-1;5030:693:1;;;;5608:5;5660:3;5645:19;;5632:33;;-1:-1:-1;5712:3:1;5697:19;;;5684:33;;5030:693;-1:-1:-1;;5030:693:1:o;5728:260::-;5796:6;5804;5857:2;5845:9;5836:7;5832:23;5828:32;5825:52;;;5873:1;5870;5863:12;5825:52;5896:29;5915:9;5896:29;:::i;:::-;5886:39;;5944:38;5978:2;5967:9;5963:18;5944:38;:::i;5993:127::-;6054:10;6049:3;6045:20;6042:1;6035:31;6085:4;6082:1;6075:15;6109:4;6106:1;6099:15;6125:719;6168:5;6221:3;6214:4;6206:6;6202:17;6198:27;6188:55;;6239:1;6236;6229:12;6188:55;6275:6;6262:20;6301:18;6338:2;6334;6331:10;6328:36;;;6344:18;;:::i;:::-;6419:2;6413:9;6387:2;6473:13;;-1:-1:-1;;6469:22:1;;;6493:2;6465:31;6461:40;6449:53;;;6517:18;;;6537:22;;;6514:46;6511:72;;;6563:18;;:::i;:::-;6603:10;6599:2;6592:22;6638:2;6630:6;6623:18;6684:3;6677:4;6672:2;6664:6;6660:15;6656:26;6653:35;6650:55;;;6701:1;6698;6691:12;6650:55;6765:2;6758:4;6750:6;6746:17;6739:4;6731:6;6727:17;6714:54;6812:1;6805:4;6800:2;6792:6;6788:15;6784:26;6777:37;6832:6;6823:15;;;;;;6125:719;;;;:::o;6849:946::-;6946:6;6999:2;6987:9;6978:7;6974:23;6970:32;6967:52;;;7015:1;7012;7005:12;6967:52;7055:9;7042:23;7084:18;7125:2;7117:6;7114:14;7111:34;;;7141:1;7138;7131:12;7111:34;7164:22;;;;7220:4;7202:16;;;7198:27;7195:47;;;7238:1;7235;7228:12;7195:47;7271:4;7265:11;7315:4;7307:6;7303:17;7370:6;7358:10;7355:22;7350:2;7338:10;7335:18;7332:46;7329:72;;;7381:18;;:::i;:::-;7417:4;7410:24;7459:16;;7487;;;7484:36;;;7516:1;7513;7506:12;7484:36;7544:45;7581:7;7570:8;7566:2;7562:17;7544:45;:::i;:::-;7536:6;7529:61;;7636:2;7632;7628:11;7615:25;7665:2;7655:8;7652:16;7649:36;;;7681:1;7678;7671:12;7649:36;7718:45;7755:7;7744:8;7740:2;7736:17;7718:45;:::i;:::-;7713:2;7701:15;;7694:70;-1:-1:-1;7705:6:1;6849:946;-1:-1:-1;;;;;6849:946:1:o;7800:380::-;7879:1;7875:12;;;;7922;;;7943:61;;7997:4;7989:6;7985:17;7975:27;;7943:61;8050:2;8042:6;8039:14;8019:18;8016:38;8013:161;;8096:10;8091:3;8087:20;8084:1;8077:31;8131:4;8128:1;8121:15;8159:4;8156:1;8149:15;8601:127;8662:10;8657:3;8653:20;8650:1;8643:31;8693:4;8690:1;8683:15;8717:4;8714:1;8707:15;8733:128;8773:3;8804:1;8800:6;8797:1;8794:13;8791:39;;;8810:18;;:::i;:::-;-1:-1:-1;8846:9:1;;8733:128::o;9505:125::-;9545:4;9573:1;9570;9567:8;9564:34;;;9578:18;;:::i;:::-;-1:-1:-1;9615:9:1;;9505:125::o;16284:407::-;16486:2;16468:21;;;16525:2;16505:18;;;16498:30;16564:34;16559:2;16544:18;;16537:62;-1:-1:-1;;;16630:2:1;16615:18;;16608:41;16681:3;16666:19;;16284:407::o;16696:786::-;17107:25;17102:3;17095:38;17077:3;17162:6;17156:13;17178:62;17233:6;17228:2;17223:3;17219:12;17212:4;17204:6;17200:17;17178:62;:::i;:::-;-1:-1:-1;;;17299:2:1;17259:16;;;17291:11;;;17284:40;17349:13;;17371:63;17349:13;17420:2;17412:11;;17405:4;17393:17;;17371:63;:::i;:::-;17454:17;17473:2;17450:26;;16696:786;-1:-1:-1;;;;16696:786:1:o;18384:127::-;18445:10;18440:3;18436:20;18433:1;18426:31;18476:4;18473:1;18466:15;18500:4;18497:1;18490:15;19632:168;19672:7;19738:1;19734;19730:6;19726:14;19723:1;19720:21;19715:1;19708:9;19701:17;19697:45;19694:71;;;19745:18;;:::i;:::-;-1:-1:-1;19785:9:1;;19632:168::o;19805:127::-;19866:10;19861:3;19857:20;19854:1;19847:31;19897:4;19894:1;19887:15;19921:4;19918:1;19911:15;19937:136;19976:3;20004:5;19994:39;;20013:18;;:::i;:::-;-1:-1:-1;;;20049:18:1;;19937:136::o
Swarm Source
ipfs://83608443b775cac1035c6343f1c06db4bb739e8dfd6c75367e37a00ae46fb3a1
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.