Source Code
Overview
MNT Balance
MNT Value
$0.00Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers.
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | ||||
|---|---|---|---|---|---|---|---|
| 69705274 | 484 days ago | 0 MNT | |||||
| 69556947 | 488 days ago | 0 MNT | |||||
| 69544322 | 488 days ago | 0 MNT | |||||
| 69536806 | 488 days ago | 0 MNT | |||||
| 69536528 | 488 days ago | 0 MNT | |||||
| 69536078 | 488 days ago | 0 MNT | |||||
| 69535873 | 488 days ago | 0 MNT | |||||
| 69535718 | 488 days ago | 0 MNT | |||||
| 69535053 | 488 days ago | 0 MNT | |||||
| 69534537 | 488 days ago | 0 MNT | |||||
| 69532990 | 488 days ago | 0 MNT | |||||
| 69532722 | 488 days ago | 0 MNT | |||||
| 69532023 | 488 days ago | 0 MNT | |||||
| 69530733 | 488 days ago | 0 MNT | |||||
| 69528424 | 488 days ago | 0 MNT | |||||
| 69527057 | 488 days ago | 0 MNT | |||||
| 69526850 | 488 days ago | 0 MNT | |||||
| 69525987 | 488 days ago | 0 MNT | |||||
| 69516210 | 489 days ago | 0 MNT | |||||
| 69509258 | 489 days ago | 0 MNT | |||||
| 69500192 | 489 days ago | 0 MNT | |||||
| 69489383 | 489 days ago | 0 MNT | |||||
| 69483637 | 489 days ago | 0 MNT | |||||
| 69481345 | 489 days ago | 0 MNT | |||||
| 69479328 | 489 days ago | 0 MNT |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Vault
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity)
/**
*Submitted for verification at mantlescan.xyz on 2024-07-23
*/
// File: Address.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return 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: AddressUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return 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 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: Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: IAccessControlUpgradeable.sol
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
/**
* @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: IERC165Upgradeable.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
/**
* @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: IERC20.sol
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
/**
* @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: MathUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)
/**
* @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) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 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 10, 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 * 8) < value ? 1 : 0);
}
}
}
// File: draft-IERC20Permit.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
/**
* @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 IERC20Permit {
/**
* @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: IERC20Metadata.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
/**
* @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: Initializable.sol
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* 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: SafeERC20.sol
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: StringsUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)
/**
* @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 `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);
}
}
// File: iface.sol
interface IMintableContract is IERC20 {
function mint(address account, uint256 amount) external;
function burn(uint256 amount) external;
function burnFrom(address account, uint256 amount) external;
}
interface ISGNFeeQuerier {
function feeBase() external view returns (uint256);
function feePerByte() external view returns (uint256);
}
// File: ContextUpgradeable.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
// File: ERC165Upgradeable.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165Upgradeable).interfaceId;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
// File: ERC20.sol
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)
/**
* @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].
*
* 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 ERC20 is Context, IERC20, IERC20Metadata {
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}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_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 value {ERC20} uses, unless this function is
* 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 {}
}
// File: ReentrancyGuardUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
/**
* @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 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: AccessControlUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
function __AccessControl_init() internal onlyInitializing {
}
function __AccessControl_init_unchained() internal onlyInitializing {
}
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
StringsUpgradeable.toHexString(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: PausableUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
function __Pausable_init() internal onlyInitializing {
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal onlyInitializing {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_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: Vault.sol
contract Vault is Initializable, AccessControlUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable {
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
using SafeERC20 for IERC20;
using Address for address payable;
address private _DEPRECATED_WBTC_;
address public uniBTC;
mapping(address => uint256) public caps;
mapping(address => bool) public paused;
bool public redeemable;
address public constant NATIVE_BTC = address(0xbeDFFfFfFFfFfFfFFfFfFFFFfFFfFFffffFFFFFF);
uint8 public constant NATIVE_BTC_DECIMALS = 18;
uint256 public constant EXCHANGE_RATE_BASE = 1e10;
modifier whenRedeemable() {
require(redeemable, "SYS009");
_;
}
receive() external payable {
revert("value only accepted by the mint function");
}
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
/**
* @dev mint uniBTC with native BTC
*/
function mint() external payable {
require(!paused[NATIVE_BTC], "SYS002");
_mint(msg.sender, msg.value);
}
/**
* @dev mint uniBTC with the given type of wrapped BTC
*/
function mint(address _token, uint256 _amount) external {
require(!paused[_token], "SYS002");
_mint(msg.sender, _token, _amount);
}
/**
* @dev burn uniBTC and redeem native BTC
*/
function redeem(uint256 _amount) external nonReentrant whenRedeemable {
_redeem(msg.sender, _amount);
}
/**
* @dev burn uniBTC and redeem the given type of wrapped BTC
*/
function redeem(address _token, uint256 _amount) external whenRedeemable {
_redeem(msg.sender, _token, _amount);
}
/**
* ======================================================================================
*
* ADMIN
*
* ======================================================================================
*/
function initialize(address _defaultAdmin, address _uniBTC) initializer public {
__AccessControl_init();
__Pausable_init();
__ReentrancyGuard_init();
require(_uniBTC != address(0x0), "SYS001");
_grantRole(DEFAULT_ADMIN_ROLE, _defaultAdmin);
_grantRole(PAUSER_ROLE, _defaultAdmin);
uniBTC = _uniBTC;
}
/**
* @dev a pauser pause the minting of a token
*/
function pauseToken(address _token) public onlyRole(PAUSER_ROLE) {
paused[_token] = true;
emit TokenPaused(_token);
}
/**
* @dev a pauser unpause the minting of a token
*/
function unpauseToken(address _token) public onlyRole(PAUSER_ROLE) {
paused[_token] = false;
emit TokenUnpaused(_token);
}
/**
* @dev enable or disable redemption feature
*/
function toggleRedemption() external onlyRole(DEFAULT_ADMIN_ROLE) {
redeemable = !redeemable;
if (redeemable) {
emit RedemptionOn();
} else {
emit RedemptionOff();
}
}
/**
* @dev set cap for a specific type of wrapped BTC
*/
function setCap(address _token, uint256 _cap) external onlyRole(DEFAULT_ADMIN_ROLE) {
require(_token != address(0x0), "SYS003");
uint8 decs = NATIVE_BTC_DECIMALS;
if (_token != NATIVE_BTC) decs = ERC20(_token).decimals();
require(decs == 8 || decs == 18, "SYS004");
caps[_token] = _cap;
}
/**
* @dev withdraw native BTC
*/
function adminWithdraw(uint256 _amount, address _target) external nonReentrant onlyRole(DEFAULT_ADMIN_ROLE) {
emit Withdrawed(NATIVE_BTC, _amount, _target);
payable(_target).sendValue(_amount);
}
/**
* @dev withdraw wrapped BTC
*/
function adminWithdraw(address _token, uint256 _amount, address _target) external onlyRole(DEFAULT_ADMIN_ROLE) {
IERC20(_token).safeTransfer(_target, _amount);
emit Withdrawed(_token, _amount, _target);
}
/**
* ======================================================================================
*
* INTERNAL
*
* ======================================================================================
*/
/**
* @dev mint uniBTC with native BTC tokens
*/
function _mint(address _sender, uint256 _amount) internal {
(, uint256 uniBTCAmount) = _amounts(_amount);
require(uniBTCAmount > 0, "USR010");
require(address(this).balance <= caps[NATIVE_BTC], "USR003");
IMintableContract(uniBTC).mint(_sender, uniBTCAmount);
emit Minted(NATIVE_BTC, _amount);
}
/**
* @dev mint uniBTC with wrapped BTC tokens
*/
function _mint(address _sender, address _token, uint256 _amount) internal {
(, uint256 uniBTCAmount) = _amounts(_token, _amount);
require(uniBTCAmount > 0, "USR010");
require(IERC20(_token).balanceOf(address(this)) + _amount <= caps[_token], "USR003");
IERC20(_token).safeTransferFrom(_sender, address(this), _amount);
IMintableContract(uniBTC).mint(_sender, uniBTCAmount);
emit Minted(_token, _amount);
}
/**
* @dev burn uniBTC and return native BTC tokens
*/
function _redeem(address _sender, uint256 _amount) internal {
(uint256 actualAmount, uint256 uniBTCAmount) = _amounts(_amount);
require(uniBTCAmount > 0, "USR010");
IMintableContract(uniBTC).burnFrom(_sender, uniBTCAmount);
emit Redeemed(NATIVE_BTC, _amount);
payable(_sender).sendValue(actualAmount);
}
/**
* @dev burn uniBTC and return wrapped BTC tokens
*/
function _redeem(address _sender, address _token, uint256 _amount) internal {
(uint256 actualAmount, uint256 uniBTCAmount) = _amounts(_token, _amount);
require(uniBTCAmount > 0, "USR010");
IMintableContract(uniBTC).burnFrom(_sender, uniBTCAmount);
IERC20(_token).safeTransfer(_sender, actualAmount);
emit Redeemed(_token, _amount);
}
/**
* @dev determine the valid native BTC amount and the corresponding uniBTC amount.
*/
function _amounts(uint256 _amount) internal returns (uint256, uint256) {
uint256 uniBTCAmt = _amount /EXCHANGE_RATE_BASE;
return (uniBTCAmt * EXCHANGE_RATE_BASE, uniBTCAmt);
}
/**
* @dev determine the valid wrapped BTC amount and the corresponding uniBTC amount.
*/
function _amounts(address _token, uint256 _amount) internal returns (uint256, uint256) {
uint8 decs = ERC20(_token).decimals();
if (decs == 8) return (_amount, _amount);
if (decs == 18) {
uint256 uniBTCAmt = _amount /EXCHANGE_RATE_BASE;
return (uniBTCAmt * EXCHANGE_RATE_BASE, uniBTCAmt);
}
return (0, 0);
}
/**
* ======================================================================================
*
* EVENTS
*
* ======================================================================================
*/
event Withdrawed(address token, uint256 amount, address target);
event Minted(address token, uint256 amount);
event Redeemed(address token, uint256 amount);
event TokenPaused(address token);
event TokenUnpaused(address token);
event RedemptionOn();
event RedemptionOff();
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Redeemed","type":"event"},{"anonymous":false,"inputs":[],"name":"RedemptionOff","type":"event"},{"anonymous":false,"inputs":[],"name":"RedemptionOn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"TokenPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"TokenUnpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"target","type":"address"}],"name":"Withdrawed","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EXCHANGE_RATE_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_BTC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_BTC_DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_target","type":"address"}],"name":"adminWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_target","type":"address"}],"name":"adminWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"caps","outputs":[{"internalType":"uint256","name":"","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":"_defaultAdmin","type":"address"},{"internalType":"address","name":"_uniBTC","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"pauseToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redeemable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_cap","type":"uint256"}],"name":"setCap","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":"toggleRedemption","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniBTC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"unpauseToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
608060405234801561001057600080fd5b5061001961001e565b6100de565b600054610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100dc576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611f4c806100ed6000396000f3fe6080604052600436106101a05760003560e01c806359f3d39b116100ec5780638e702f451161008a578063b7b038da11610064578063b7b038da14610518578063d547741f14610531578063db006a7514610551578063e63ab1e91461057157600080fd5b80638e702f45146104bc57806391d14854146104e3578063a217fddf1461050357600080fd5b806363b20fff116100c657806363b20fff1461043a57806366d97b211461044f5780637c41ad2c1461047c57806380ad2cf31461049c57600080fd5b806359f3d39b146103e25780635a09a413146104025780635c975abb1461042257600080fd5b80632f2ff15d116101595780633b3bff0f116101335780633b3bff0f1461036257806340c10f1914610382578063485cc955146103a257806356e1887d146103c257600080fd5b80632f2ff15d146102ee57806336568abe1461030e5780633af02ff31461032e57600080fd5b806301ffc9a7146102085780631249c58b1461023d5780631e9a695014610247578063248a9ca3146102675780632d7ecd11146102a55780632e48152c146102be57600080fd5b366102035760405162461bcd60e51b815260206004820152602860248201527f76616c7565206f6e6c7920616363657074656420627920746865206d696e7420604482015267333ab731ba34b7b760c11b60648201526084015b60405180910390fd5b600080fd5b34801561021457600080fd5b50610228610223366004611b6a565b610593565b60405190151581526020015b60405180910390f35b6102456105ca565b005b34801561025357600080fd5b50610245610262366004611bb0565b610642565b34801561027357600080fd5b50610297610282366004611bda565b60009081526065602052604090206001015490565b604051908152602001610234565b3480156102b157600080fd5b5060ff8054610228911681565b3480156102ca57600080fd5b506102286102d9366004611bf3565b60fe6020526000908152604090205460ff1681565b3480156102fa57600080fd5b50610245610309366004611c0e565b61068b565b34801561031a57600080fd5b50610245610329366004611c0e565b6106b5565b34801561033a57600080fd5b5061034a60016105f760951b0381565b6040516001600160a01b039091168152602001610234565b34801561036e57600080fd5b5061024561037d366004611bf3565b61072f565b34801561038e57600080fd5b5061024561039d366004611bb0565b6107a0565b3480156103ae57600080fd5b506102456103bd366004611c3a565b6107fd565b3480156103ce57600080fd5b506102456103dd366004611c64565b61099d565b3480156103ee57600080fd5b5060fc5461034a906001600160a01b031681565b34801561040e57600080fd5b5061024561041d366004611c0e565b610a11565b34801561042e57600080fd5b5060975460ff16610228565b34801561044657600080fd5b50610245610a92565b34801561045b57600080fd5b5061029761046a366004611bf3565b60fd6020526000908152604090205481565b34801561048857600080fd5b50610245610497366004611bf3565b610b0e565b3480156104a857600080fd5b506102456104b7366004611bb0565b610b7a565b3480156104c857600080fd5b506104d1601281565b60405160ff9091168152602001610234565b3480156104ef57600080fd5b506102286104fe366004611c0e565b610cab565b34801561050f57600080fd5b50610297600081565b34801561052457600080fd5b506102976402540be40081565b34801561053d57600080fd5b5061024561054c366004611c0e565b610cd6565b34801561055d57600080fd5b5061024561056c366004611bda565b610cfb565b34801561057d57600080fd5b50610297600080516020611ef783398151915281565b60006001600160e01b03198216637965db0b60e01b14806105c457506301ffc9a760e01b6001600160e01b03198316145b92915050565b60016105f760951b0360005260fe6020527f97005f4e3e2b9249dea61c76539a90f6484c8f52e9e5fe5c577d3296c6e3ce475460ff16156106365760405162461bcd60e51b815260206004820152600660248201526529aca998181960d11b60448201526064016101fa565b6106403334610d51565b565b60ff80541661067c5760405162461bcd60e51b815260206004820152600660248201526553595330303960d01b60448201526064016101fa565b610687338383610e8f565b5050565b6000828152606560205260409020600101546106a681610f84565b6106b08383610f8e565b505050565b6001600160a01b03811633146107255760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016101fa565b6106878282611014565b600080516020611ef783398151915261074781610f84565b6001600160a01b038216600081815260fe6020908152604091829020805460ff1916905590519182527ff38578ed892ce2ce655ca8ae03c73464ad74915a1331a9b4085e637534daeedf91015b60405180910390a15050565b6001600160a01b038216600090815260fe602052604090205460ff16156107f25760405162461bcd60e51b815260206004820152600660248201526529aca998181960d11b60448201526064016101fa565b61068733838361107b565b600054610100900460ff161580801561081d5750600054600160ff909116105b806108375750303b158015610837575060005460ff166001145b61089a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016101fa565b6000805460ff1916600117905580156108bd576000805461ff0019166101001790555b6108c5611221565b6108cd611248565b6108d5611277565b6001600160a01b0382166109145760405162461bcd60e51b815260206004820152600660248201526553595330303160d01b60448201526064016101fa565b61091f600084610f8e565b610937600080516020611ef783398151915284610f8e565b60fc80546001600160a01b0319166001600160a01b03841617905580156106b0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a1505050565b60006109a881610f84565b6109bc6001600160a01b03851683856112a6565b604080516001600160a01b038087168252602082018690528416918101919091527f1a2300999b4959e261a233e8ed4ab5fc3bdb62fccad4b8f623f995dfda127c90906060015b60405180910390a150505050565b610a19611309565b6000610a2481610f84565b6040805160016105f760951b038152602081018590526001600160a01b0384168183015290517f1a2300999b4959e261a233e8ed4ab5fc3bdb62fccad4b8f623f995dfda127c909181900360600190a1610a876001600160a01b03831684611362565b50610687600160c955565b6000610a9d81610f84565b60ff805460ff1981169082161590811782551615610ae1576040517f212d2a3cd7b5214eb619332689c12e883f94fc9e77c12fc2950e7e0ca06d694190600090a150565b6040517f9b29d553f3bc46ebc6b3f07492e083319eff8c2938a603630774aafc21e4c63490600090a15b50565b600080516020611ef7833981519152610b2681610f84565b6001600160a01b038216600081815260fe6020908152604091829020805460ff1916600117905590519182527ff017c0de579727a3cd3ee18077ee8b4c43bf21892985952d1d5a0d52f983502d9101610794565b6000610b8581610f84565b6001600160a01b038316610bc45760405162461bcd60e51b815260206004820152600660248201526553595330303360d01b60448201526064016101fa565b60126001600160a01b03841660016105f760951b0314610c4357836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c409190611ca0565b90505b8060ff1660081480610c5857508060ff166012145b610c8d5760405162461bcd60e51b815260206004820152600660248201526514d654cc0c0d60d21b60448201526064016101fa565b50506001600160a01b03909116600090815260fd6020526040902055565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600082815260656020526040902060010154610cf181610f84565b6106b08383611014565b610d03611309565b60ff805416610d3d5760405162461bcd60e51b815260206004820152600660248201526553595330303960d01b60448201526064016101fa565b610d473382611482565b610b0b600160c955565b6000610d5c82611573565b91505060008111610d7f5760405162461bcd60e51b81526004016101fa90611cc3565b60016105f760951b0360005260fd6020527fb0c8e905921952986442d56db0c6725eecd8413d65df5bdbe8a4ca5880f7cfee54471115610dea5760405162461bcd60e51b815260206004820152600660248201526555535230303360d01b60448201526064016101fa565b60fc546040516340c10f1960e01b81526001600160a01b03858116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b158015610e3857600080fd5b505af1158015610e4c573d6000803e3d6000fd5b50506040805160016105f760951b038152602081018690527f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe9350019050610990565b600080610e9c84846115a0565b9150915060008111610ec05760405162461bcd60e51b81526004016101fa90611cc3565b60fc5460405163079cc67960e41b81526001600160a01b03878116600483015260248201849052909116906379cc679090604401600060405180830381600087803b158015610f0e57600080fd5b505af1158015610f22573d6000803e3d6000fd5b50610f3b925050506001600160a01b03851686846112a6565b604080516001600160a01b0386168152602081018590527f4896181ff8f4543cc00db9fe9b6fb7e6f032b7eb772c72ab1ec1b4d2e03b9369910160405180910390a15050505050565b610b0b8133611668565b610f988282610cab565b6106875760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610fd03390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61101e8282610cab565b156106875760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061108783836115a0565b915050600081116110aa5760405162461bcd60e51b81526004016101fa90611cc3565b6001600160a01b038316600081815260fd6020526040908190205490516370a0823160e01b8152306004820152909184916370a0823190602401602060405180830381865afa158015611101573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111259190611ce3565b61112f9190611d12565b11156111665760405162461bcd60e51b815260206004820152600660248201526555535230303360d01b60448201526064016101fa565b61117b6001600160a01b0384168530856116c1565b60fc546040516340c10f1960e01b81526001600160a01b03868116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b1580156111c957600080fd5b505af11580156111dd573d6000803e3d6000fd5b5050604080516001600160a01b0387168152602081018690527f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe9350019050610a03565b600054610100900460ff166106405760405162461bcd60e51b81526004016101fa90611d25565b600054610100900460ff1661126f5760405162461bcd60e51b81526004016101fa90611d25565b6106406116f9565b600054610100900460ff1661129e5760405162461bcd60e51b81526004016101fa90611d25565b61064061172c565b6040516001600160a01b0383166024820152604481018290526106b090849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611753565b600260c9540361135b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101fa565b600260c955565b804710156113b25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016101fa565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146113ff576040519150601f19603f3d011682016040523d82523d6000602084013e611404565b606091505b50509050806106b05760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016101fa565b600160c955565b60008061148e83611573565b91509150600081116114b25760405162461bcd60e51b81526004016101fa90611cc3565b60fc5460405163079cc67960e41b81526001600160a01b03868116600483015260248201849052909116906379cc679090604401600060405180830381600087803b15801561150057600080fd5b505af1158015611514573d6000803e3d6000fd5b50506040805160016105f760951b038152602081018790527f4896181ff8f4543cc00db9fe9b6fb7e6f032b7eb772c72ab1ec1b4d2e03b9369935001905060405180910390a161156d6001600160a01b03851683611362565b50505050565b600080806115866402540be40085611d70565b90506115976402540be40082611d92565b94909350915050565b6000806000846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116079190611ca0565b90508060ff166008036116205783849250925050611661565b8060ff1660120361165857600061163c6402540be40086611d70565b905061164d6402540be40082611d92565b935091506116619050565b60008092509250505b9250929050565b6116728282610cab565b6106875761167f81611825565b61168a836020611837565b60405160200161169b929190611dcd565b60408051601f198184030181529082905262461bcd60e51b82526101fa91600401611e42565b6040516001600160a01b038085166024830152831660448201526064810182905261156d9085906323b872dd60e01b906084016112d2565b600054610100900460ff166117205760405162461bcd60e51b81526004016101fa90611d25565b6097805460ff19169055565b600054610100900460ff1661147b5760405162461bcd60e51b81526004016101fa90611d25565b60006117a8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166119da9092919063ffffffff16565b8051909150156106b057808060200190518101906117c69190611e75565b6106b05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101fa565b60606105c46001600160a01b03831660145b60606000611846836002611d92565b611851906002611d12565b67ffffffffffffffff81111561186957611869611e97565b6040519080825280601f01601f191660200182016040528015611893576020820181803683370190505b509050600360fc1b816000815181106118ae576118ae611ead565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106118dd576118dd611ead565b60200101906001600160f81b031916908160001a9053506000611901846002611d92565b61190c906001611d12565b90505b6001811115611984576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061194057611940611ead565b1a60f81b82828151811061195657611956611ead565b60200101906001600160f81b031916908160001a90535060049490941c9361197d81611ec3565b905061190f565b5083156119d35760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016101fa565b9392505050565b60606119e984846000856119f1565b949350505050565b606082471015611a525760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101fa565b600080866001600160a01b03168587604051611a6e9190611eda565b60006040518083038185875af1925050503d8060008114611aab576040519150601f19603f3d011682016040523d82523d6000602084013e611ab0565b606091505b5091509150611ac187838387611acc565b979650505050505050565b60608315611b3b578251600003611b34576001600160a01b0385163b611b345760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101fa565b50816119e9565b6119e98383815115611b505781518083602001fd5b8060405162461bcd60e51b81526004016101fa9190611e42565b600060208284031215611b7c57600080fd5b81356001600160e01b0319811681146119d357600080fd5b80356001600160a01b0381168114611bab57600080fd5b919050565b60008060408385031215611bc357600080fd5b611bcc83611b94565b946020939093013593505050565b600060208284031215611bec57600080fd5b5035919050565b600060208284031215611c0557600080fd5b6119d382611b94565b60008060408385031215611c2157600080fd5b82359150611c3160208401611b94565b90509250929050565b60008060408385031215611c4d57600080fd5b611c5683611b94565b9150611c3160208401611b94565b600080600060608486031215611c7957600080fd5b611c8284611b94565b925060208401359150611c9760408501611b94565b90509250925092565b600060208284031215611cb257600080fd5b815160ff811681146119d357600080fd5b60208082526006908201526505553523031360d41b604082015260600190565b600060208284031215611cf557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156105c4576105c4611cfc565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082611d8d57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176105c4576105c4611cfc565b60005b83811015611dc4578181015183820152602001611dac565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611e05816017850160208801611da9565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611e36816028840160208801611da9565b01602801949350505050565b6020815260008251806020840152611e61816040850160208701611da9565b601f01601f19169190910160400192915050565b600060208284031215611e8757600080fd5b815180151581146119d357600080fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081611ed257611ed2611cfc565b506000190190565b60008251611eec818460208701611da9565b919091019291505056fe65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862aa26469706673582212203c0f9a638f7778b8f4f885d67fccb2185a385202dea6a45354a01d3322c6842164736f6c63430008110033
Deployed Bytecode
0x6080604052600436106101a05760003560e01c806359f3d39b116100ec5780638e702f451161008a578063b7b038da11610064578063b7b038da14610518578063d547741f14610531578063db006a7514610551578063e63ab1e91461057157600080fd5b80638e702f45146104bc57806391d14854146104e3578063a217fddf1461050357600080fd5b806363b20fff116100c657806363b20fff1461043a57806366d97b211461044f5780637c41ad2c1461047c57806380ad2cf31461049c57600080fd5b806359f3d39b146103e25780635a09a413146104025780635c975abb1461042257600080fd5b80632f2ff15d116101595780633b3bff0f116101335780633b3bff0f1461036257806340c10f1914610382578063485cc955146103a257806356e1887d146103c257600080fd5b80632f2ff15d146102ee57806336568abe1461030e5780633af02ff31461032e57600080fd5b806301ffc9a7146102085780631249c58b1461023d5780631e9a695014610247578063248a9ca3146102675780632d7ecd11146102a55780632e48152c146102be57600080fd5b366102035760405162461bcd60e51b815260206004820152602860248201527f76616c7565206f6e6c7920616363657074656420627920746865206d696e7420604482015267333ab731ba34b7b760c11b60648201526084015b60405180910390fd5b600080fd5b34801561021457600080fd5b50610228610223366004611b6a565b610593565b60405190151581526020015b60405180910390f35b6102456105ca565b005b34801561025357600080fd5b50610245610262366004611bb0565b610642565b34801561027357600080fd5b50610297610282366004611bda565b60009081526065602052604090206001015490565b604051908152602001610234565b3480156102b157600080fd5b5060ff8054610228911681565b3480156102ca57600080fd5b506102286102d9366004611bf3565b60fe6020526000908152604090205460ff1681565b3480156102fa57600080fd5b50610245610309366004611c0e565b61068b565b34801561031a57600080fd5b50610245610329366004611c0e565b6106b5565b34801561033a57600080fd5b5061034a60016105f760951b0381565b6040516001600160a01b039091168152602001610234565b34801561036e57600080fd5b5061024561037d366004611bf3565b61072f565b34801561038e57600080fd5b5061024561039d366004611bb0565b6107a0565b3480156103ae57600080fd5b506102456103bd366004611c3a565b6107fd565b3480156103ce57600080fd5b506102456103dd366004611c64565b61099d565b3480156103ee57600080fd5b5060fc5461034a906001600160a01b031681565b34801561040e57600080fd5b5061024561041d366004611c0e565b610a11565b34801561042e57600080fd5b5060975460ff16610228565b34801561044657600080fd5b50610245610a92565b34801561045b57600080fd5b5061029761046a366004611bf3565b60fd6020526000908152604090205481565b34801561048857600080fd5b50610245610497366004611bf3565b610b0e565b3480156104a857600080fd5b506102456104b7366004611bb0565b610b7a565b3480156104c857600080fd5b506104d1601281565b60405160ff9091168152602001610234565b3480156104ef57600080fd5b506102286104fe366004611c0e565b610cab565b34801561050f57600080fd5b50610297600081565b34801561052457600080fd5b506102976402540be40081565b34801561053d57600080fd5b5061024561054c366004611c0e565b610cd6565b34801561055d57600080fd5b5061024561056c366004611bda565b610cfb565b34801561057d57600080fd5b50610297600080516020611ef783398151915281565b60006001600160e01b03198216637965db0b60e01b14806105c457506301ffc9a760e01b6001600160e01b03198316145b92915050565b60016105f760951b0360005260fe6020527f97005f4e3e2b9249dea61c76539a90f6484c8f52e9e5fe5c577d3296c6e3ce475460ff16156106365760405162461bcd60e51b815260206004820152600660248201526529aca998181960d11b60448201526064016101fa565b6106403334610d51565b565b60ff80541661067c5760405162461bcd60e51b815260206004820152600660248201526553595330303960d01b60448201526064016101fa565b610687338383610e8f565b5050565b6000828152606560205260409020600101546106a681610f84565b6106b08383610f8e565b505050565b6001600160a01b03811633146107255760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016101fa565b6106878282611014565b600080516020611ef783398151915261074781610f84565b6001600160a01b038216600081815260fe6020908152604091829020805460ff1916905590519182527ff38578ed892ce2ce655ca8ae03c73464ad74915a1331a9b4085e637534daeedf91015b60405180910390a15050565b6001600160a01b038216600090815260fe602052604090205460ff16156107f25760405162461bcd60e51b815260206004820152600660248201526529aca998181960d11b60448201526064016101fa565b61068733838361107b565b600054610100900460ff161580801561081d5750600054600160ff909116105b806108375750303b158015610837575060005460ff166001145b61089a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016101fa565b6000805460ff1916600117905580156108bd576000805461ff0019166101001790555b6108c5611221565b6108cd611248565b6108d5611277565b6001600160a01b0382166109145760405162461bcd60e51b815260206004820152600660248201526553595330303160d01b60448201526064016101fa565b61091f600084610f8e565b610937600080516020611ef783398151915284610f8e565b60fc80546001600160a01b0319166001600160a01b03841617905580156106b0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a1505050565b60006109a881610f84565b6109bc6001600160a01b03851683856112a6565b604080516001600160a01b038087168252602082018690528416918101919091527f1a2300999b4959e261a233e8ed4ab5fc3bdb62fccad4b8f623f995dfda127c90906060015b60405180910390a150505050565b610a19611309565b6000610a2481610f84565b6040805160016105f760951b038152602081018590526001600160a01b0384168183015290517f1a2300999b4959e261a233e8ed4ab5fc3bdb62fccad4b8f623f995dfda127c909181900360600190a1610a876001600160a01b03831684611362565b50610687600160c955565b6000610a9d81610f84565b60ff805460ff1981169082161590811782551615610ae1576040517f212d2a3cd7b5214eb619332689c12e883f94fc9e77c12fc2950e7e0ca06d694190600090a150565b6040517f9b29d553f3bc46ebc6b3f07492e083319eff8c2938a603630774aafc21e4c63490600090a15b50565b600080516020611ef7833981519152610b2681610f84565b6001600160a01b038216600081815260fe6020908152604091829020805460ff1916600117905590519182527ff017c0de579727a3cd3ee18077ee8b4c43bf21892985952d1d5a0d52f983502d9101610794565b6000610b8581610f84565b6001600160a01b038316610bc45760405162461bcd60e51b815260206004820152600660248201526553595330303360d01b60448201526064016101fa565b60126001600160a01b03841660016105f760951b0314610c4357836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c409190611ca0565b90505b8060ff1660081480610c5857508060ff166012145b610c8d5760405162461bcd60e51b815260206004820152600660248201526514d654cc0c0d60d21b60448201526064016101fa565b50506001600160a01b03909116600090815260fd6020526040902055565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600082815260656020526040902060010154610cf181610f84565b6106b08383611014565b610d03611309565b60ff805416610d3d5760405162461bcd60e51b815260206004820152600660248201526553595330303960d01b60448201526064016101fa565b610d473382611482565b610b0b600160c955565b6000610d5c82611573565b91505060008111610d7f5760405162461bcd60e51b81526004016101fa90611cc3565b60016105f760951b0360005260fd6020527fb0c8e905921952986442d56db0c6725eecd8413d65df5bdbe8a4ca5880f7cfee54471115610dea5760405162461bcd60e51b815260206004820152600660248201526555535230303360d01b60448201526064016101fa565b60fc546040516340c10f1960e01b81526001600160a01b03858116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b158015610e3857600080fd5b505af1158015610e4c573d6000803e3d6000fd5b50506040805160016105f760951b038152602081018690527f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe9350019050610990565b600080610e9c84846115a0565b9150915060008111610ec05760405162461bcd60e51b81526004016101fa90611cc3565b60fc5460405163079cc67960e41b81526001600160a01b03878116600483015260248201849052909116906379cc679090604401600060405180830381600087803b158015610f0e57600080fd5b505af1158015610f22573d6000803e3d6000fd5b50610f3b925050506001600160a01b03851686846112a6565b604080516001600160a01b0386168152602081018590527f4896181ff8f4543cc00db9fe9b6fb7e6f032b7eb772c72ab1ec1b4d2e03b9369910160405180910390a15050505050565b610b0b8133611668565b610f988282610cab565b6106875760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610fd03390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61101e8282610cab565b156106875760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061108783836115a0565b915050600081116110aa5760405162461bcd60e51b81526004016101fa90611cc3565b6001600160a01b038316600081815260fd6020526040908190205490516370a0823160e01b8152306004820152909184916370a0823190602401602060405180830381865afa158015611101573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111259190611ce3565b61112f9190611d12565b11156111665760405162461bcd60e51b815260206004820152600660248201526555535230303360d01b60448201526064016101fa565b61117b6001600160a01b0384168530856116c1565b60fc546040516340c10f1960e01b81526001600160a01b03868116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b1580156111c957600080fd5b505af11580156111dd573d6000803e3d6000fd5b5050604080516001600160a01b0387168152602081018690527f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe9350019050610a03565b600054610100900460ff166106405760405162461bcd60e51b81526004016101fa90611d25565b600054610100900460ff1661126f5760405162461bcd60e51b81526004016101fa90611d25565b6106406116f9565b600054610100900460ff1661129e5760405162461bcd60e51b81526004016101fa90611d25565b61064061172c565b6040516001600160a01b0383166024820152604481018290526106b090849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611753565b600260c9540361135b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101fa565b600260c955565b804710156113b25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016101fa565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146113ff576040519150601f19603f3d011682016040523d82523d6000602084013e611404565b606091505b50509050806106b05760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016101fa565b600160c955565b60008061148e83611573565b91509150600081116114b25760405162461bcd60e51b81526004016101fa90611cc3565b60fc5460405163079cc67960e41b81526001600160a01b03868116600483015260248201849052909116906379cc679090604401600060405180830381600087803b15801561150057600080fd5b505af1158015611514573d6000803e3d6000fd5b50506040805160016105f760951b038152602081018790527f4896181ff8f4543cc00db9fe9b6fb7e6f032b7eb772c72ab1ec1b4d2e03b9369935001905060405180910390a161156d6001600160a01b03851683611362565b50505050565b600080806115866402540be40085611d70565b90506115976402540be40082611d92565b94909350915050565b6000806000846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116079190611ca0565b90508060ff166008036116205783849250925050611661565b8060ff1660120361165857600061163c6402540be40086611d70565b905061164d6402540be40082611d92565b935091506116619050565b60008092509250505b9250929050565b6116728282610cab565b6106875761167f81611825565b61168a836020611837565b60405160200161169b929190611dcd565b60408051601f198184030181529082905262461bcd60e51b82526101fa91600401611e42565b6040516001600160a01b038085166024830152831660448201526064810182905261156d9085906323b872dd60e01b906084016112d2565b600054610100900460ff166117205760405162461bcd60e51b81526004016101fa90611d25565b6097805460ff19169055565b600054610100900460ff1661147b5760405162461bcd60e51b81526004016101fa90611d25565b60006117a8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166119da9092919063ffffffff16565b8051909150156106b057808060200190518101906117c69190611e75565b6106b05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101fa565b60606105c46001600160a01b03831660145b60606000611846836002611d92565b611851906002611d12565b67ffffffffffffffff81111561186957611869611e97565b6040519080825280601f01601f191660200182016040528015611893576020820181803683370190505b509050600360fc1b816000815181106118ae576118ae611ead565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106118dd576118dd611ead565b60200101906001600160f81b031916908160001a9053506000611901846002611d92565b61190c906001611d12565b90505b6001811115611984576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061194057611940611ead565b1a60f81b82828151811061195657611956611ead565b60200101906001600160f81b031916908160001a90535060049490941c9361197d81611ec3565b905061190f565b5083156119d35760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016101fa565b9392505050565b60606119e984846000856119f1565b949350505050565b606082471015611a525760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101fa565b600080866001600160a01b03168587604051611a6e9190611eda565b60006040518083038185875af1925050503d8060008114611aab576040519150601f19603f3d011682016040523d82523d6000602084013e611ab0565b606091505b5091509150611ac187838387611acc565b979650505050505050565b60608315611b3b578251600003611b34576001600160a01b0385163b611b345760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101fa565b50816119e9565b6119e98383815115611b505781518083602001fd5b8060405162461bcd60e51b81526004016101fa9190611e42565b600060208284031215611b7c57600080fd5b81356001600160e01b0319811681146119d357600080fd5b80356001600160a01b0381168114611bab57600080fd5b919050565b60008060408385031215611bc357600080fd5b611bcc83611b94565b946020939093013593505050565b600060208284031215611bec57600080fd5b5035919050565b600060208284031215611c0557600080fd5b6119d382611b94565b60008060408385031215611c2157600080fd5b82359150611c3160208401611b94565b90509250929050565b60008060408385031215611c4d57600080fd5b611c5683611b94565b9150611c3160208401611b94565b600080600060608486031215611c7957600080fd5b611c8284611b94565b925060208401359150611c9760408501611b94565b90509250925092565b600060208284031215611cb257600080fd5b815160ff811681146119d357600080fd5b60208082526006908201526505553523031360d41b604082015260600190565b600060208284031215611cf557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156105c4576105c4611cfc565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082611d8d57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176105c4576105c4611cfc565b60005b83811015611dc4578181015183820152602001611dac565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611e05816017850160208801611da9565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611e36816028840160208801611da9565b01602801949350505050565b6020815260008251806020840152611e61816040850160208701611da9565b601f01601f19169190910160400192915050565b600060208284031215611e8757600080fd5b815180151581146119d357600080fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081611ed257611ed2611cfc565b506000190190565b60008251611eec818460208701611da9565b919091019291505056fe65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862aa26469706673582212203c0f9a638f7778b8f4f885d67fccb2185a385202dea6a45354a01d3322c6842164736f6c63430008110033
Deployed Bytecode Sourcemap
86105:7655:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;86897:50;;-1:-1:-1;;;86897:50:0;;216:2:1;86897:50:0;;;198:21:1;255:2;235:18;;;228:30;294:34;274:18;;;267:62;-1:-1:-1;;;345:18:1;;;338:38;393:19;;86897:50:0;;;;;;;;86105:7655;;;;77018:215;;;;;;;;;;-1:-1:-1;77018:215:0;;;;;:::i;:::-;;:::i;:::-;;;879:14:1;;872:22;854:41;;842:2;827:18;77018:215:0;;;;;;;;87139:129;;;:::i;:::-;;87790:128;;;;;;;;;;-1:-1:-1;87790:128:0;;;;;:::i;:::-;;:::i;78846:131::-;;;;;;;;;;-1:-1:-1;78846:131:0;;;;;:::i;:::-;78920:7;78947:12;;;:6;:12;;;;;:22;;;;78846:131;;;;1674:25:1;;;1662:2;1647:18;78846:131:0;1528:177:1;86526:22:0;;;;;;;;;;-1:-1:-1;86526:22:0;;;;;;;;86479:38;;;;;;;;;;-1:-1:-1;86479:38:0;;;;;:::i;:::-;;;;;;;;;;;;;;;;79287:147;;;;;;;;;;-1:-1:-1;79287:147:0;;;;;:::i;:::-;;:::i;80431:218::-;;;;;;;;;;-1:-1:-1;80431:218:0;;;;;:::i;:::-;;:::i;86557:88::-;;;;;;;;;;;;-1:-1:-1;;;;;86557:88:0;;;;;-1:-1:-1;;;;;2324:32:1;;;2306:51;;2294:2;2279:18;86557:88:0;2160:203:1;88834:145:0;;;;;;;;;;-1:-1:-1;88834:145:0;;;;;:::i;:::-;;:::i;87354:154::-;;;;;;;;;;-1:-1:-1;87354:154:0;;;;;:::i;:::-;;:::i;88164:374::-;;;;;;;;;;-1:-1:-1;88164:374:0;;;;;:::i;:::-;;:::i;90054:227::-;;;;;;;;;;-1:-1:-1;90054:227:0;;;;;:::i;:::-;;:::i;86403:21::-;;;;;;;;;;-1:-1:-1;86403:21:0;;;;-1:-1:-1;;;;;86403:21:0;;;89776:218;;;;;;;;;;-1:-1:-1;89776:218:0;;;;;:::i;:::-;;:::i;84803:86::-;;;;;;;;;;-1:-1:-1;84874:7:0;;;;84803:86;;89055:234;;;;;;;;;;;;;:::i;86433:39::-;;;;;;;;;;-1:-1:-1;86433:39:0;;;;;:::i;:::-;;;;;;;;;;;;;;88615:140;;;;;;;;;;-1:-1:-1;88615:140:0;;;;;:::i;:::-;;:::i;89371:346::-;;;;;;;;;;-1:-1:-1;89371:346:0;;;;;:::i;:::-;;:::i;86652:46::-;;;;;;;;;;;;86696:2;86652:46;;;;;3579:4:1;3567:17;;;3549:36;;3537:2;3522:18;86652:46:0;3407:184:1;77325:147:0;;;;;;;;;;-1:-1:-1;77325:147:0;;;;;:::i;:::-;;:::i;76419:49::-;;;;;;;;;;-1:-1:-1;76419:49:0;76464:4;76419:49;;86707;;;;;;;;;;;;86752:4;86707:49;;79727:149;;;;;;;;;;-1:-1:-1;79727:149:0;;;;;:::i;:::-;;:::i;87581:117::-;;;;;;;;;;-1:-1:-1;87581:117:0;;;;;:::i;:::-;;:::i;86219:62::-;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;86219:62:0;;77018:215;77103:4;-1:-1:-1;;;;;;77127:58:0;;-1:-1:-1;;;77127:58:0;;:98;;-1:-1:-1;;;;;;;;;;57276:51:0;;;77189:36;77120:105;77018:215;-1:-1:-1;;77018:215:0:o;87139:129::-;-1:-1:-1;;;;;87192:18:0;;:6;:18;;;;;;87191:19;87183:38;;;;-1:-1:-1;;;87183:38:0;;3983:2:1;87183:38:0;;;3965:21:1;4022:1;4002:18;;;3995:29;-1:-1:-1;;;4040:18:1;;;4033:36;4086:18;;87183:38:0;3781:329:1;87183:38:0;87232:28;87238:10;87250:9;87232:5;:28::i;:::-;87139:129::o;87790:128::-;86810:10;;;;86802:29;;;;-1:-1:-1;;;86802:29:0;;4317:2:1;86802:29:0;;;4299:21:1;4356:1;4336:18;;;4329:29;-1:-1:-1;;;4374:18:1;;;4367:36;4420:18;;86802:29:0;4115:329:1;86802:29:0;87874:36:::1;87882:10;87894:6;87902:7;87874;:36::i;:::-;87790:128:::0;;:::o;79287:147::-;78920:7;78947:12;;;:6;:12;;;;;:22;;;76910:16;76921:4;76910:10;:16::i;:::-;79401:25:::1;79412:4;79418:7;79401:10;:25::i;:::-;79287:147:::0;;;:::o;80431:218::-;-1:-1:-1;;;;;80527:23:0;;55755:10;80527:23;80519:83;;;;-1:-1:-1;;;80519:83:0;;4651:2:1;80519:83:0;;;4633:21:1;4690:2;4670:18;;;4663:30;4729:34;4709:18;;;4702:62;-1:-1:-1;;;4780:18:1;;;4773:45;4835:19;;80519:83:0;4449:411:1;80519:83:0;80615:26;80627:4;80633:7;80615:11;:26::i;88834:145::-;-1:-1:-1;;;;;;;;;;;76910:16:0;76921:4;76910:10;:16::i;:::-;-1:-1:-1;;;;;88912:14:0;::::1;88929:5;88912:14:::0;;;:6:::1;:14;::::0;;;;;;;;:22;;-1:-1:-1;;88912:22:0::1;::::0;;88950:21;;2306:51:1;;;88950:21:0::1;::::0;2279:18:1;88950:21:0::1;;;;;;;;88834:145:::0;;:::o;87354:154::-;-1:-1:-1;;;;;87430:14:0;;;;;;:6;:14;;;;;;;;87429:15;87421:34;;;;-1:-1:-1;;;87421:34:0;;3983:2:1;87421:34:0;;;3965:21:1;4022:1;4002:18;;;3995:29;-1:-1:-1;;;4040:18:1;;;4033:36;4086:18;;87421:34:0;3781:329:1;87421:34:0;87466;87472:10;87484:6;87492:7;87466:5;:34::i;88164:374::-;44310:19;44333:13;;;;;;44332:14;;44380:34;;;;-1:-1:-1;44398:12:0;;44413:1;44398:12;;;;:16;44380:34;44379:108;;;-1:-1:-1;44459:4:0;10860:19;:23;;;44420:66;;-1:-1:-1;44469:12:0;;;;;:17;44420:66;44357:204;;;;-1:-1:-1;;;44357:204:0;;5067:2:1;44357:204:0;;;5049:21:1;5106:2;5086:18;;;5079:30;5145:34;5125:18;;;5118:62;-1:-1:-1;;;5196:18:1;;;5189:44;5250:19;;44357:204:0;4865:410:1;44357:204:0;44572:12;:16;;-1:-1:-1;;44572:16:0;44587:1;44572:16;;;44599:67;;;;44634:13;:20;;-1:-1:-1;;44634:20:0;;;;;44599:67;88254:22:::1;:20;:22::i;:::-;88287:17;:15;:17::i;:::-;88315:24;:22;:24::i;:::-;-1:-1:-1::0;;;;;88360:23:0;::::1;88352:42;;;::::0;-1:-1:-1;;;88352:42:0;;5482:2:1;88352:42:0::1;::::0;::::1;5464:21:1::0;5521:1;5501:18;;;5494:29;-1:-1:-1;;;5539:18:1;;;5532:36;5585:18;;88352:42:0::1;5280:329:1::0;88352:42:0::1;88407:45;76464:4;88438:13:::0;88407:10:::1;:45::i;:::-;88463:38;-1:-1:-1::0;;;;;;;;;;;88487:13:0::1;88463:10;:38::i;:::-;88514:6;:16:::0;;-1:-1:-1;;;;;;88514:16:0::1;-1:-1:-1::0;;;;;88514:16:0;::::1;;::::0;;44688:102;;;;44739:5;44723:21;;-1:-1:-1;;44723:21:0;;;44764:14;;-1:-1:-1;3549:36:1;;44764:14:0;;3537:2:1;3522:18;44764:14:0;;;;;;;;44299:498;88164:374;;:::o;90054:227::-;76464:4;76910:16;76464:4;76910:10;:16::i;:::-;90176:45:::1;-1:-1:-1::0;;;;;90176:27:0;::::1;90204:7:::0;90213;90176:27:::1;:45::i;:::-;90237:36;::::0;;-1:-1:-1;;;;;6071:15:1;;;6053:34;;6118:2;6103:18;;6096:34;;;6166:15;;6146:18;;;6139:43;;;;90237:36:0::1;::::0;6003:2:1;5988:18;90237:36:0::1;;;;;;;;90054:227:::0;;;;:::o;89776:218::-;73384:21;:19;:21::i;:::-;76464:4:::1;76910:16;76464:4:::0;76910:10:::1;:16::i;:::-;89900:40:::2;::::0;;-1:-1:-1;;;;;6053:34:1;;6118:2;6103:18;;6096:34;;;-1:-1:-1;;;;;6166:15:1;;6146:18;;;6139:43;89900:40:0;;::::2;::::0;;;;6003:2:1;89900:40:0;;::::2;89951:35;-1:-1:-1::0;;;;;89951:26:0;::::2;89978:7:::0;89951:26:::2;:35::i;:::-;73416:1:::1;73428:20:::0;72645:1;73948:7;:22;73765:213;89055:234;76464:4;76910:16;76464:4;76910:10;:16::i;:::-;89146:10:::1;::::0;;-1:-1:-1;;89132:24:0;::::1;89146:10:::0;;::::1;89145:11;89132:24:::0;;::::1;::::0;;89171:10;89167:115:::1;;;89203:14;::::0;::::1;::::0;;;::::1;89055:234:::0;:::o;89167:115::-:1;89255:15;::::0;::::1;::::0;;;::::1;89167:115;89055:234:::0;:::o;88615:140::-;-1:-1:-1;;;;;;;;;;;76910:16:0;76921:4;76910:10;:16::i;:::-;-1:-1:-1;;;;;88691:14:0;::::1;;::::0;;;:6:::1;:14;::::0;;;;;;;;:21;;-1:-1:-1;;88691:21:0::1;88708:4;88691:21;::::0;;88728:19;;2306:51:1;;;88728:19:0::1;::::0;2279:18:1;88728:19:0::1;2160:203:1::0;89371:346:0;76464:4;76910:16;76464:4;76910:10;:16::i;:::-;-1:-1:-1;;;;;89474:22:0;::::1;89466:41;;;::::0;-1:-1:-1;;;89466:41:0;;6395:2:1;89466:41:0::1;::::0;::::1;6377:21:1::0;6434:1;6414:18;;;6407:29;-1:-1:-1;;;6452:18:1;;;6445:36;6498:18;;89466:41:0::1;6193:329:1::0;89466:41:0::1;86696:2;-1:-1:-1::0;;;;;89569:20:0;::::1;-1:-1:-1::0;;;;;89569:20:0::1;89565:57;;89604:6;-1:-1:-1::0;;;;;89598:22:0::1;;:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;89591:31;;89565:57;89643:4;:9;;89651:1;89643:9;:23;;;;89656:4;:10;;89664:2;89656:10;89643:23;89635:42;;;::::0;-1:-1:-1;;;89635:42:0;;7007:2:1;89635:42:0::1;::::0;::::1;6989:21:1::0;7046:1;7026:18;;;7019:29;-1:-1:-1;;;7064:18:1;;;7057:36;7110:18;;89635:42:0::1;6805:329:1::0;89635:42:0::1;-1:-1:-1::0;;;;;;;89690:12:0;;::::1;;::::0;;;:4:::1;:12;::::0;;;;:19;89371:346::o;77325:147::-;77411:4;77435:12;;;:6;:12;;;;;;;;-1:-1:-1;;;;;77435:29:0;;;;;;;;;;;;;;;77325:147::o;79727:149::-;78920:7;78947:12;;;:6;:12;;;;;:22;;;76910:16;76921:4;76910:10;:16::i;:::-;79842:26:::1;79854:4;79860:7;79842:11;:26::i;87581:117::-:0;73384:21;:19;:21::i;:::-;86810:10:::1;::::0;;::::1;86802:29;;;::::0;-1:-1:-1;;;86802:29:0;;4317:2:1;86802:29:0::1;::::0;::::1;4299:21:1::0;4356:1;4336:18;;;4329:29;-1:-1:-1;;;4374:18:1;;;4367:36;4420:18;;86802:29:0::1;4115:329:1::0;86802:29:0::1;87662:28:::2;87670:10;87682:7;87662;:28::i;:::-;73428:20:::0;72645:1;73948:7;:22;73765:213;90598:351;90670:20;90694:17;90703:7;90694:8;:17::i;:::-;90667:44;;;90745:1;90730:12;:16;90722:35;;;;-1:-1:-1;;;90722:35:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;90803:16:0;;:4;:16;;;;90778:21;:41;;90770:60;;;;-1:-1:-1;;;90770:60:0;;7675:2:1;90770:60:0;;;7657:21:1;7714:1;7694:18;;;7687:29;-1:-1:-1;;;7732:18:1;;;7725:36;7778:18;;90770:60:0;7473:329:1;90770:60:0;90861:6;;90843:53;;-1:-1:-1;;;90843:53:0;;-1:-1:-1;;;;;7999:32:1;;;90843:53:0;;;7981:51:1;8048:18;;;8041:34;;;90861:6:0;;;;90843:30;;7954:18:1;;90843:53:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;90914:27:0;;;-1:-1:-1;;;;;7981:51:1;;8063:2;8048:18;;8041:34;;;90914:27:0;;-1:-1:-1;7954:18:1;;-1:-1:-1;90914:27:0;7807:274:1;92012:387:0;92100:20;92122;92146:25;92155:6;92163:7;92146:8;:25::i;:::-;92099:72;;;;92205:1;92190:12;:16;92182:35;;;;-1:-1:-1;;;92182:35:0;;;;;;;:::i;:::-;92248:6;;92230:57;;-1:-1:-1;;;92230:57:0;;-1:-1:-1;;;;;7999:32:1;;;92230:57:0;;;7981:51:1;8048:18;;;8041:34;;;92248:6:0;;;;92230:34;;7954:18:1;;92230:57:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;92298:50:0;;-1:-1:-1;;;;;;;;92298:27:0;;92326:7;92335:12;92298:27;:50::i;:::-;92366:25;;;-1:-1:-1;;;;;7999:32:1;;7981:51;;8063:2;8048:18;;8041:34;;;92366:25:0;;7954:18:1;92366:25:0;;;;;;;92088:311;;92012:387;;;:::o;77776:105::-;77843:30;77854:4;55755:10;77843;:30::i;82028:238::-;82112:22;82120:4;82126:7;82112;:22::i;:::-;82107:152;;82151:12;;;;:6;:12;;;;;;;;-1:-1:-1;;;;;82151:29:0;;;;;;;;;:36;;-1:-1:-1;;82151:36:0;82183:4;82151:36;;;82234:12;55755:10;;55675:98;82234:12;-1:-1:-1;;;;;82207:40:0;82225:7;-1:-1:-1;;;;;82207:40:0;82219:4;82207:40;;;;;;;;;;82028:238;;:::o;82446:239::-;82530:22;82538:4;82544:7;82530;:22::i;:::-;82526:152;;;82601:5;82569:12;;;:6;:12;;;;;;;;-1:-1:-1;;;;;82569:29:0;;;;;;;;;;:37;;-1:-1:-1;;82569:37:0;;;82626:40;55755:10;;82569:12;;82626:40;;82601:5;82626:40;82446:239;;:::o;91024:470::-;91112:20;91136:25;91145:6;91153:7;91136:8;:25::i;:::-;91109:52;;;91195:1;91180:12;:16;91172:35;;;;-1:-1:-1;;;91172:35:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;91281:12:0;;;;;;:4;:12;;;;;;;;91228:39;;-1:-1:-1;;;91228:39:0;;91261:4;91228:39;;;2306:51:1;91281:12:0;;91270:7;;91228:24;;2279:18:1;;91228:39:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:49;;;;:::i;:::-;:65;;91220:84;;;;-1:-1:-1;;;91220:84:0;;7675:2:1;91220:84:0;;;7657:21:1;7714:1;7694:18;;;7687:29;-1:-1:-1;;;7732:18:1;;;7725:36;7778:18;;91220:84:0;7473:329:1;91220:84:0;91317:64;-1:-1:-1;;;;;91317:31:0;;91349:7;91366:4;91373:7;91317:31;:64::i;:::-;91410:6;;91392:53;;-1:-1:-1;;;91392:53:0;;-1:-1:-1;;;;;7999:32:1;;;91392:53:0;;;7981:51:1;8048:18;;;8041:34;;;91410:6:0;;;;91392:30;;7954:18:1;;91392:53:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;91463:23:0;;;-1:-1:-1;;;;;7999:32:1;;7981:51;;8063:2;8048:18;;8041:34;;;91463:23:0;;-1:-1:-1;7954:18:1;;-1:-1:-1;91463:23:0;7807:274:1;76108:66:0;46453:13;;;;;;;46445:69;;;;-1:-1:-1;;;46445:69:0;;;;;;;:::i;83973:99::-;46453:13;;;;;;;46445:69;;;;-1:-1:-1;;;46445:69:0;;;;;;;:::i;:::-;84037:27:::1;:25;:27::i;72731:113::-:0;46453:13;;;;;;;46445:69;;;;-1:-1:-1;;;46445:69:0;;;;;;;:::i;:::-;72802:34:::1;:32;:34::i;48392:211::-:0;48536:58;;-1:-1:-1;;;;;7999:32:1;;48536:58:0;;;7981:51:1;8048:18;;;8041:34;;;48509:86:0;;48529:5;;-1:-1:-1;;;48559:23:0;7954:18:1;;48536:58:0;;;;-1:-1:-1;;48536:58:0;;;;;;;;;;;;;;-1:-1:-1;;;;;48536:58:0;-1:-1:-1;;;;;;48536:58:0;;;;;;;;;;48509:19;:86::i;73464:293::-;72689:1;73598:7;;:19;73590:63;;;;-1:-1:-1;;;73590:63:0;;9151:2:1;73590:63:0;;;9133:21:1;9190:2;9170:18;;;9163:30;9229:33;9209:18;;;9202:61;9280:18;;73590:63:0;8949:355:1;73590:63:0;72689:1;73731:7;:18;73464:293::o;2435:317::-;2550:6;2525:21;:31;;2517:73;;;;-1:-1:-1;;;2517:73:0;;9511:2:1;2517:73:0;;;9493:21:1;9550:2;9530:18;;;9523:30;9589:31;9569:18;;;9562:59;9638:18;;2517:73:0;9309:353:1;2517:73:0;2604:12;2622:9;-1:-1:-1;;;;;2622:14:0;2644:6;2622:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2603:52;;;2674:7;2666:78;;;;-1:-1:-1;;;2666:78:0;;10079:2:1;2666:78:0;;;10061:21:1;10118:2;10098:18;;;10091:30;10157:34;10137:18;;;10130:62;10228:28;10208:18;;;10201:56;10274:19;;2666:78:0;9877:422:1;73765:213:0;72645:1;73948:7;:22;73765:213::o;91574:357::-;91646:20;91668;91692:17;91701:7;91692:8;:17::i;:::-;91645:64;;;;91743:1;91728:12;:16;91720:35;;;;-1:-1:-1;;;91720:35:0;;;;;;;:::i;:::-;91786:6;;91768:57;;-1:-1:-1;;;91768:57:0;;-1:-1:-1;;;;;7999:32:1;;;91768:57:0;;;7981:51:1;8048:18;;;8041:34;;;91786:6:0;;;;91768:34;;7954:18:1;;91768:57:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;91841:29:0;;;-1:-1:-1;;;;;7981:51:1;;8063:2;8048:18;;8041:34;;;91841:29:0;;-1:-1:-1;7954:18:1;;-1:-1:-1;91841:29:0;;;;;;;91883:40;-1:-1:-1;;;;;91883:26:0;;91910:12;91883:26;:40::i;:::-;91634:297;;91574:357;;:::o;92513:198::-;92566:7;;;92615:27;86752:4;92615:7;:27;:::i;:::-;92595:47;-1:-1:-1;92661:30:0;86752:4;92595:47;92661:30;:::i;:::-;92653:50;92693:9;;-1:-1:-1;92513:198:0;-1:-1:-1;;92513:198:0:o;92826:383::-;92895:7;92904;92924:10;92943:6;-1:-1:-1;;;;;92937:22:0;;:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;92924:37;;92976:4;:9;;92984:1;92976:9;92972:40;;92995:7;93004;92987:25;;;;;;;92972:40;93027:4;:10;;93035:2;93027:10;93023:155;;93054:17;93074:27;86752:4;93074:7;:27;:::i;:::-;93054:47;-1:-1:-1;93124:30:0;86752:4;93054:47;93124:30;:::i;:::-;93116:50;-1:-1:-1;93156:9:0;-1:-1:-1;93116:50:0;;-1:-1:-1;93116:50:0;93023:155;93196:1;93199;93188:13;;;;;92826:383;;;;;;:::o;78171:486::-;78260:22;78268:4;78274:7;78260;:22::i;:::-;78255:395;;78436:39;78467:7;78436:30;:39::i;:::-;78540:49;78579:4;78586:2;78540:30;:49::i;:::-;78349:259;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;78349:259:0;;;;;;;;;;-1:-1:-1;;;78299:339:0;;;;;;;:::i;48611:248::-;48782:68;;-1:-1:-1;;;;;12430:15:1;;;48782:68:0;;;12412:34:1;12482:15;;12462:18;;;12455:43;12514:18;;;12507:34;;;48755:96:0;;48775:5;;-1:-1:-1;;;48805:27:0;12347:18:1;;48782:68:0;12172:375:1;84080:97:0;46453:13;;;;;;;46445:69;;;;-1:-1:-1;;;46445:69:0;;;;;;;:::i;:::-;84154:7:::1;:15:::0;;-1:-1:-1;;84154:15:0::1;::::0;;84080:97::o;72852:111::-;46453:13;;;;;;;46445:69;;;;-1:-1:-1;;;46445:69:0;;;;;;;:::i;51459:716::-;51883:23;51909:69;51937:4;51909:69;;;;;;;;;;;;;;;;;51917:5;-1:-1:-1;;;;;51909:27:0;;;:69;;;;;:::i;:::-;51993:17;;51883:95;;-1:-1:-1;51993:21:0;51989:179;;52090:10;52079:30;;;;;;;;;;;;:::i;:::-;52071:85;;;;-1:-1:-1;;;52071:85:0;;13036:2:1;52071:85:0;;;13018:21:1;13075:2;13055:18;;;13048:30;13114:34;13094:18;;;13087:62;-1:-1:-1;;;13165:18:1;;;13158:40;13215:19;;52071:85:0;12834:406:1;54325:151:0;54383:13;54416:52;-1:-1:-1;;;;;54428:22:0;;52462:2;53721:447;53796:13;53822:19;53854:10;53858:6;53854:1;:10;:::i;:::-;:14;;53867:1;53854:14;:::i;:::-;53844:25;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;53844:25:0;;53822:47;;-1:-1:-1;;;53880:6:0;53887:1;53880:9;;;;;;;;:::i;:::-;;;;:15;-1:-1:-1;;;;;53880:15:0;;;;;;;;;-1:-1:-1;;;53906:6:0;53913:1;53906:9;;;;;;;;:::i;:::-;;;;:15;-1:-1:-1;;;;;53906:15:0;;;;;;;;-1:-1:-1;53937:9:0;53949:10;53953:6;53949:1;:10;:::i;:::-;:14;;53962:1;53949:14;:::i;:::-;53937:26;;53932:131;53969:1;53965;:5;53932:131;;;-1:-1:-1;;;54013:5:0;54021:3;54013:11;54004:21;;;;;;;:::i;:::-;;;;53992:6;53999:1;53992:9;;;;;;;;:::i;:::-;;;;:33;-1:-1:-1;;;;;53992:33:0;;;;;;;;-1:-1:-1;54050:1:0;54040:11;;;;;53972:3;;;:::i;:::-;;;53932:131;;;-1:-1:-1;54081:10:0;;54073:55;;;;-1:-1:-1;;;54073:55:0;;13852:2:1;54073:55:0;;;13834:21:1;;;13871:18;;;13864:30;13930:34;13910:18;;;13903:62;13982:18;;54073:55:0;13650:356:1;54073:55:0;54153:6;53721:447;-1:-1:-1;;;53721:447:0:o;3931:229::-;4068:12;4100:52;4122:6;4130:4;4136:1;4139:12;4100:21;:52::i;:::-;4093:59;3931:229;-1:-1:-1;;;;3931:229:0:o;5051:455::-;5221:12;5279:5;5254:21;:30;;5246:81;;;;-1:-1:-1;;;5246:81:0;;14213:2:1;5246:81:0;;;14195:21:1;14252:2;14232:18;;;14225:30;14291:34;14271:18;;;14264:62;-1:-1:-1;;;14342:18:1;;;14335:36;14388:19;;5246:81:0;14011:402:1;5246:81:0;5339:12;5353:23;5380:6;-1:-1:-1;;;;;5380:11:0;5399:5;5406:4;5380:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5338:73;;;;5429:69;5456:6;5464:7;5473:10;5485:12;5429:26;:69::i;:::-;5422:76;5051:455;-1:-1:-1;;;;;;;5051:455:0:o;7624:644::-;7809:12;7838:7;7834:427;;;7866:10;:17;7887:1;7866:22;7862:290;;-1:-1:-1;;;;;10860:19:0;;;8076:60;;;;-1:-1:-1;;;8076:60:0;;14912:2:1;8076:60:0;;;14894:21:1;14951:2;14931:18;;;14924:30;14990:31;14970:18;;;14963:59;15039:18;;8076:60:0;14710:353:1;8076:60:0;-1:-1:-1;8173:10:0;8166:17;;7834:427;8216:33;8224:10;8236:12;8971:17;;:21;8967:388;;9203:10;9197:17;9260:15;9247:10;9243:2;9239:19;9232:44;8967:388;9330:12;9323:20;;-1:-1:-1;;;9323:20:0;;;;;;;;:::i;423:286:1:-;481:6;534:2;522:9;513:7;509:23;505:32;502:52;;;550:1;547;540:12;502:52;576:23;;-1:-1:-1;;;;;;628:32:1;;618:43;;608:71;;675:1;672;665:12;906:173;974:20;;-1:-1:-1;;;;;1023:31:1;;1013:42;;1003:70;;1069:1;1066;1059:12;1003:70;906:173;;;:::o;1084:254::-;1152:6;1160;1213:2;1201:9;1192:7;1188:23;1184:32;1181:52;;;1229:1;1226;1219:12;1181:52;1252:29;1271:9;1252:29;:::i;:::-;1242:39;1328:2;1313:18;;;;1300:32;;-1:-1:-1;;;1084:254:1:o;1343:180::-;1402:6;1455:2;1443:9;1434:7;1430:23;1426:32;1423:52;;;1471:1;1468;1461:12;1423:52;-1:-1:-1;1494:23:1;;1343:180;-1:-1:-1;1343:180:1:o;1710:186::-;1769:6;1822:2;1810:9;1801:7;1797:23;1793:32;1790:52;;;1838:1;1835;1828:12;1790:52;1861:29;1880:9;1861:29;:::i;1901:254::-;1969:6;1977;2030:2;2018:9;2009:7;2005:23;2001:32;1998:52;;;2046:1;2043;2036:12;1998:52;2082:9;2069:23;2059:33;;2111:38;2145:2;2134:9;2130:18;2111:38;:::i;:::-;2101:48;;1901:254;;;;;:::o;2368:260::-;2436:6;2444;2497:2;2485:9;2476:7;2472:23;2468:32;2465:52;;;2513:1;2510;2503:12;2465:52;2536:29;2555:9;2536:29;:::i;:::-;2526:39;;2584:38;2618:2;2607:9;2603:18;2584:38;:::i;2633:328::-;2710:6;2718;2726;2779:2;2767:9;2758:7;2754:23;2750:32;2747:52;;;2795:1;2792;2785:12;2747:52;2818:29;2837:9;2818:29;:::i;:::-;2808:39;;2894:2;2883:9;2879:18;2866:32;2856:42;;2917:38;2951:2;2940:9;2936:18;2917:38;:::i;:::-;2907:48;;2633:328;;;;;:::o;6527:273::-;6595:6;6648:2;6636:9;6627:7;6623:23;6619:32;6616:52;;;6664:1;6661;6654:12;6616:52;6696:9;6690:16;6746:4;6739:5;6735:16;6728:5;6725:27;6715:55;;6766:1;6763;6756:12;7139:329;7341:2;7323:21;;;7380:1;7360:18;;;7353:29;-1:-1:-1;;;7413:2:1;7398:18;;7391:36;7459:2;7444:18;;7139:329::o;8086:184::-;8156:6;8209:2;8197:9;8188:7;8184:23;8180:32;8177:52;;;8225:1;8222;8215:12;8177:52;-1:-1:-1;8248:16:1;;8086:184;-1:-1:-1;8086:184:1:o;8275:127::-;8336:10;8331:3;8327:20;8324:1;8317:31;8367:4;8364:1;8357:15;8391:4;8388:1;8381:15;8407:125;8472:9;;;8493:10;;;8490:36;;;8506:18;;:::i;8537:407::-;8739:2;8721:21;;;8778:2;8758:18;;;8751:30;8817:34;8812:2;8797:18;;8790:62;-1:-1:-1;;;8883:2:1;8868:18;;8861:41;8934:3;8919:19;;8537:407::o;10304:217::-;10344:1;10370;10360:132;;10414:10;10409:3;10405:20;10402:1;10395:31;10449:4;10446:1;10439:15;10477:4;10474:1;10467:15;10360:132;-1:-1:-1;10506:9:1;;10304:217::o;10526:168::-;10599:9;;;10630;;10647:15;;;10641:22;;10627:37;10617:71;;10668:18;;:::i;10699:250::-;10784:1;10794:113;10808:6;10805:1;10802:13;10794:113;;;10884:11;;;10878:18;10865:11;;;10858:39;10830:2;10823:10;10794:113;;;-1:-1:-1;;10941:1:1;10923:16;;10916:27;10699:250::o;10954:812::-;11365:25;11360:3;11353:38;11335:3;11420:6;11414:13;11436:75;11504:6;11499:2;11494:3;11490:12;11483:4;11475:6;11471:17;11436:75;:::i;:::-;-1:-1:-1;;;11570:2:1;11530:16;;;11562:11;;;11555:40;11620:13;;11642:76;11620:13;11704:2;11696:11;;11689:4;11677:17;;11642:76;:::i;:::-;11738:17;11757:2;11734:26;;10954:812;-1:-1:-1;;;;10954:812:1:o;11771:396::-;11920:2;11909:9;11902:21;11883:4;11952:6;11946:13;11995:6;11990:2;11979:9;11975:18;11968:34;12011:79;12083:6;12078:2;12067:9;12063:18;12058:2;12050:6;12046:15;12011:79;:::i;:::-;12151:2;12130:15;-1:-1:-1;;12126:29:1;12111:45;;;;12158:2;12107:54;;11771:396;-1:-1:-1;;11771:396:1:o;12552:277::-;12619:6;12672:2;12660:9;12651:7;12647:23;12643:32;12640:52;;;12688:1;12685;12678:12;12640:52;12720:9;12714:16;12773:5;12766:13;12759:21;12752:5;12749:32;12739:60;;12795:1;12792;12785:12;13245:127;13306:10;13301:3;13297:20;13294:1;13287:31;13337:4;13334:1;13327:15;13361:4;13358:1;13351:15;13377:127;13438:10;13433:3;13429:20;13426:1;13419:31;13469:4;13466:1;13459:15;13493:4;13490:1;13483:15;13509:136;13548:3;13576:5;13566:39;;13585:18;;:::i;:::-;-1:-1:-1;;;13621:18:1;;13509:136::o;14418:287::-;14547:3;14585:6;14579:13;14601:66;14660:6;14655:3;14648:4;14640:6;14636:17;14601:66;:::i;:::-;14683:16;;;;;14418:287;-1:-1:-1;;14418:287:1:o
Swarm Source
ipfs://3c0f9a638f7778b8f4f885d67fccb2185a385202dea6a45354a01d3322c68421
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in MNT
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.