Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x63bB3D6A...A19B8cE44 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
Bridge
Compiler Version
v0.8.30+commit.73712a01
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity =0.8.30;
import { Ownable2StepUpgradeable } from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {
ReentrancyGuardUpgradeable
} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {
ERC20BurnableUpgradeable
} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol";
import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import { SafeERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import { ERC165Checker } from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import { IERC20Mintable } from "./../../interfaces/IERC20Mintable.sol";
import { ECDSAChecks } from "./../../libraries/ECDSAChecks.sol";
import { IMapper } from "./../mapper/interfaces/IMapper.sol";
import { IBridge } from "./interfaces/IBridge.sol";
/**
* @title Bridge
* @author Whitechain
* @notice Contract for cross-chain token and coin transfers.
*/
contract Bridge is Initializable, UUPSUpgradeable, Ownable2StepUpgradeable, ReentrancyGuardUpgradeable, IBridge {
/**
* @notice Using SafeERC20Upgradeable to ensure safe interactions with tokens.
* This prevents issues where some tokens return false instead of reverting.
*/
using SafeERC20Upgradeable for IERC20Upgradeable;
/**
* @notice Accumulated gas fees paid by users during bridging.
* Tracks the total amount of coins collected for gas compensation,
* which can later be withdrawn by the contract owner and is reset after each withdrawal.
*/
uint256 public gasAccumulated;
/**
* @notice Contract responsible for mapping tokens across chains.
* Used to check if a token is allowed for deposit or withdrawal.
*/
IMapper public Mapper;
/**
* @notice Tracks which message hashes have already been used to prevent replay attacks.
* The hash should be computed from all critical parameters and marked as used after successful execution.
*/
mapping(bytes32 hash => bool isUsed) public usedHashes;
/**
* @notice Reserved storage slots for future upgrades to avoid storage collisions.
*/
uint256[50] private __gap;
/**
* @notice Modifier to validate that an address is not the zero address.
* @param addr Address to be checked.
*/
modifier nonZeroAddress(address addr) {
require(addr != address(0), "Bridge: Address must be not equal zero");
_;
}
/**
* @notice Modifier to validate that a bytes32 identifier is not zero.
* @param _bytes The bytes32 value to be checked.
*/
modifier nonZeroBytes32(bytes32 _bytes) {
require(_bytes != bytes32(0), "Bridge: Bytes must be not equal zero");
_;
}
/**
* @notice Modifier to ensure a provided number is greater than zero.
* @param num The number to check.
*/
modifier nonZeroUint256(uint256 num) {
require(num > 0, "Bridge: Cannot be zero");
_;
}
/**
* @notice Constructor to disable initializers for security reasons.
* This is required for UUPS upgradeable contracts.
*/
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
/**
* @notice Allows the contract to receive coins.
* Triggered when coins is sent directly to the contract without any calldata.
* Emits a {CoinsDeposited} event for tracking the deposit.
*/
receive() external payable {
emit CoinsDeposited({ account: msg.sender, amount: msg.value });
}
/**
* @notice Initializes the contract with the given parameters.
* This function can only be called once due to the `initializer` modifier.
* @param initParams See {IBridge-InitParams}.
*/
function initialize(InitParams calldata initParams) external initializer nonZeroAddress(initParams.mapperAddress) {
__UUPSUpgradeable_init();
__Ownable2Step_init();
__ReentrancyGuard_init();
require(
ERC165Checker.supportsInterface({
account: initParams.mapperAddress,
interfaceId: type(IMapper).interfaceId
}),
"Bridge: New address does not support IMapper"
);
Mapper = IMapper(initParams.mapperAddress);
}
/**
* @notice See {IBridge-bridgeTokens}.
* @param bridgeTokensParams See {IBridge-BridgeTokensParams}.
*/
function bridgeTokens(
BridgeTokensParams calldata bridgeTokensParams
)
external
payable
nonReentrant
nonZeroBytes32(bridgeTokensParams.bridgeParams.toAddress)
nonZeroUint256(bridgeTokensParams.bridgeParams.amount)
{
IMapper.MapInfo memory _mapInfo = _getMapInfo({ mapId: bridgeTokensParams.bridgeParams.mapId });
require(_mapInfo.isAllowed, "Bridge: IsAllowed must be true");
require(_mapInfo.withdrawType == IMapper.WithdrawType.None, "Bridge: WithdrawType must be equal to None");
uint256 _amount = bridgeTokensParams.bridgeParams.amount;
uint256 _gasAmount;
if (_mapInfo.isCoin) {
require(msg.value >= _amount, "Bridge: The msg.value must be greater than or equal amount");
_gasAmount = msg.value - _amount;
} else {
_gasAmount = msg.value;
}
bytes32 _hash = _validateECDSA({
bridgeTokensParams: bridgeTokensParams,
mapInfo: _mapInfo,
gasAmount: _gasAmount
});
usedHashes[_hash] = true;
gasAccumulated = gasAccumulated + _gasAmount;
uint256 actualAmount;
if (_mapInfo.isCoin) {
require(_mapInfo.depositType == IMapper.DepositType.Lock, "Bridge: DepositType must be equal to Lock");
actualAmount = _amount;
} else {
require(_mapInfo.depositType != IMapper.DepositType.None, "Bridge: DepositType must not be equal to None");
uint256 balanceBefore = _getBalance({ tokenAddress: _mapInfo.originTokenAddress });
_executeTokenTransferFrom({
useTransfer: _mapInfo.useTransfer,
tokenAddress: _mapInfo.originTokenAddress,
from: msg.sender,
to: address(this),
amount: _amount
});
uint256 balanceAfter = _getBalance({ tokenAddress: _mapInfo.originTokenAddress });
// Calculate the actual received amount
actualAmount = balanceAfter - balanceBefore;
if (_mapInfo.depositType == IMapper.DepositType.Burn) {
ERC20BurnableUpgradeable(address(uint160(uint256(_mapInfo.originTokenAddress)))).burn({
amount: actualAmount
});
}
}
emit Deposit({
fromAddress: bytes32(uint256(uint160(msg.sender))),
toAddress: bridgeTokensParams.bridgeParams.toAddress,
originTokenAddress: _mapInfo.originTokenAddress,
targetTokenAddress: _mapInfo.targetTokenAddress,
amount: actualAmount,
originChainId: _mapInfo.originChainId,
targetChainId: _mapInfo.targetChainId
});
}
/**
* @notice See {IBridge-receiveTokens}.
* @param receiveTokensParams See {IBridge-ReceiveTokensParams}.
*/
function receiveTokens(
ReceiveTokensParams calldata receiveTokensParams
)
external
nonReentrant
onlyOwner
nonZeroBytes32(receiveTokensParams.fromAddress)
nonZeroBytes32(receiveTokensParams.toAddress)
nonZeroUint256(receiveTokensParams.amount)
{
IMapper.MapInfo memory _mapInfo = _getMapInfo({ mapId: receiveTokensParams.mapId });
require(_mapInfo.isAllowed, "Bridge: IsAllowed must be true");
require(_mapInfo.depositType == IMapper.DepositType.None, "Bridge: DepositType must be equal to None");
if (_mapInfo.isCoin) {
require(
_mapInfo.withdrawType == IMapper.WithdrawType.Unlock,
"Bridge: WithdrawType must be equal to Unlock"
);
uint256 _contractBalance = address(this).balance - gasAccumulated;
require(
_contractBalance >= receiveTokensParams.amount,
"Bridge: Contract coins balance must be greater or equal amount"
);
(bool success, ) = payable(address(uint160(uint256(receiveTokensParams.toAddress)))).call{
value: receiveTokensParams.amount
}("");
require(success, "Bridge: Failed to send coins");
} else {
require(
_mapInfo.withdrawType != IMapper.WithdrawType.None,
"Bridge: WithdrawType must not be equal to None"
);
if (_mapInfo.withdrawType == IMapper.WithdrawType.Mint) {
IERC20Mintable(address(uint160(uint256(_mapInfo.targetTokenAddress)))).mint({
to: address(uint160(uint256(receiveTokensParams.toAddress))),
amount: receiveTokensParams.amount
});
} else {
_executeTokenTransfer({
useTransfer: _mapInfo.useTransfer,
tokenAddress: _mapInfo.targetTokenAddress,
to: address(uint160(uint256(receiveTokensParams.toAddress))),
amount: receiveTokensParams.amount
});
}
}
emit Withdrawal({
fromAddress: receiveTokensParams.fromAddress,
toAddress: receiveTokensParams.toAddress,
targetTokenAddress: _mapInfo.targetTokenAddress,
originTokenAddress: _mapInfo.originTokenAddress,
externalId: receiveTokensParams.externalId,
amount: receiveTokensParams.amount,
originChainId: _mapInfo.originChainId,
targetChainId: _mapInfo.targetChainId
});
}
/**
* @notice See {IBridge-withdrawGasAccumulated}.
*/
function withdrawGasAccumulated() external nonReentrant onlyOwner nonZeroUint256(gasAccumulated) {
require(
address(this).balance >= gasAccumulated,
"Bridge: Coins balance must be greater or equal gasAccumulated"
);
uint256 amount = gasAccumulated;
gasAccumulated = 0;
(bool success, ) = payable(owner()).call{ value: amount }("");
require(success, "Bridge: Gas accumulated withdrawal failed");
emit GasAccumulatedWithdrawn({ account: owner(), amount: amount });
}
/**
* @notice See {IBridge-withdrawTokenLiquidity}.
* @param withdrawTokenLiquidityParams See {IBridge-WithdrawTokenLiquidityParams}.
*/
function withdrawTokenLiquidity(
WithdrawTokenLiquidityParams calldata withdrawTokenLiquidityParams
)
external
nonReentrant
onlyOwner
nonZeroUint256(withdrawTokenLiquidityParams.amount)
nonZeroAddress(withdrawTokenLiquidityParams.recipientAddress)
nonZeroBytes32(withdrawTokenLiquidityParams.tokenAddress)
{
_executeTokenTransfer({
useTransfer: withdrawTokenLiquidityParams.useTransfer,
tokenAddress: withdrawTokenLiquidityParams.tokenAddress,
to: withdrawTokenLiquidityParams.recipientAddress,
amount: withdrawTokenLiquidityParams.amount
});
emit LiquidityTokenWithdrawn({
account: withdrawTokenLiquidityParams.recipientAddress,
token: address(uint160(uint256(withdrawTokenLiquidityParams.tokenAddress))),
amount: withdrawTokenLiquidityParams.amount,
useTransfer: withdrawTokenLiquidityParams.useTransfer
});
}
/**
* @notice See {IBridge-withdrawCoinLiquidity}.
* @param withdrawCoinLiquidityParams See {IBridge-WithdrawCoinLiquidityParams}.
*/
function withdrawCoinLiquidity(
WithdrawCoinLiquidityParams calldata withdrawCoinLiquidityParams
)
external
nonReentrant
onlyOwner
nonZeroUint256(withdrawCoinLiquidityParams.amount)
nonZeroAddress(withdrawCoinLiquidityParams.recipientAddress)
{
uint256 _contractBalance = address(this).balance - gasAccumulated;
require(
_contractBalance >= withdrawCoinLiquidityParams.amount,
"Bridge: Contract coins balance must be greater or equal amount"
);
(bool success, ) = payable(withdrawCoinLiquidityParams.recipientAddress).call{
value: withdrawCoinLiquidityParams.amount
}("");
require(success, "Bridge: Failed to send coins");
emit LiquidityCoinWithdrawn({
account: withdrawCoinLiquidityParams.recipientAddress,
amount: withdrawCoinLiquidityParams.amount
});
}
/**
* @notice Allows users to deposit tokens into the contract.
* Requires prior approval from the user.
* Only the contract owner can call this function.
* Emits a {TokensDeposited} event.
* @param mapId The ID of the token mapping in the Mapper contract.
* @param amount Amount of tokens to deposit.
*/
function depositTokens(uint256 mapId, uint256 amount) external nonReentrant onlyOwner nonZeroUint256(amount) {
IMapper.MapInfo memory _mapInfo = _getMapInfo({ mapId: mapId });
require(_mapInfo.isAllowed, "Bridge: IsAllowed must be true");
require(!_mapInfo.isCoin, "Bridge: Deposit allowed only for token mappings");
require(_mapInfo.depositType == IMapper.DepositType.None, "Bridge: DepositType must be equal to None");
require(_mapInfo.targetTokenAddress != bytes32(0), "Bridge: TargetTokenAddress must be not equal zero");
uint256 balanceBefore = _getBalance({ tokenAddress: _mapInfo.targetTokenAddress });
_executeTokenTransferFrom({
useTransfer: _mapInfo.useTransfer,
tokenAddress: _mapInfo.targetTokenAddress,
from: msg.sender,
to: address(this),
amount: amount
});
uint256 balanceAfter = _getBalance({ tokenAddress: _mapInfo.targetTokenAddress });
// Calculate the actual received amount
uint256 actualAmount = balanceAfter - balanceBefore;
emit TokensDeposited({
account: msg.sender,
token: address(uint160(uint256(_mapInfo.targetTokenAddress))),
amount: actualAmount
});
}
/**
* @notice Allows users to deposit coins into the contract.
* Only the contract owner can call this function.
* Emits a {CoinsDeposited} event.
*/
function depositCoins() external payable onlyOwner nonZeroUint256(msg.value) {
emit CoinsDeposited({ account: msg.sender, amount: msg.value });
}
/**
* @notice Changes the address of the Mapper contract.
* Only the contract owner can call this function.
* Emits a {MapperAddressChanged} event on success.
* @param _newMapperAddress The new address of the Mapper contract.
*/
function changeMapperAddress(address _newMapperAddress) external onlyOwner nonZeroAddress(_newMapperAddress) {
require(
ERC165Checker.supportsInterface({ account: _newMapperAddress, interfaceId: type(IMapper).interfaceId }),
"Bridge: New address does not support IMapper"
);
address _oldMapperAddress = address(Mapper);
Mapper = IMapper(_newMapperAddress);
emit MapperAddressChanged({
account: msg.sender,
oldAddress: _oldMapperAddress,
newAddress: _newMapperAddress
});
}
/**
* @notice Authorizes the upgrade of the contract to a new implementation.
* This function overrides `_authorizeUpgrade` from UUPSUpgradeable.
* Only the contract owner can authorize an upgrade.
* @param newImplementation Address of the new implementation contract.
*/
function _authorizeUpgrade(address newImplementation) internal override(UUPSUpgradeable) onlyOwner {}
/**
* @notice Executes a token transfer from this contract to the specified recipient.
* Supports both standard `transfer` and `safeTransfer` methods.
* The token address is passed as `bytes32` and converted back to `address`.
* @param useTransfer If true, uses the standard `transfer`.
* @param tokenAddress The token contract address, stored as bytes32.
* @param to The recipient address that will receive the tokens.
* @param amount The number of tokens to transfer.
*/
function _executeTokenTransfer(bool useTransfer, bytes32 tokenAddress, address to, uint256 amount) private {
if (useTransfer) {
IERC20Upgradeable(address(uint160(uint256(tokenAddress)))).transfer({ to: to, amount: amount });
} else {
IERC20Upgradeable(address(uint160(uint256(tokenAddress)))).safeTransfer({ to: to, value: amount });
}
}
/**
* @notice Executes a token transfer from this contract to the specified recipient.
* Supports both standard `transfer` and `safeTransfer` methods.
* The token address is passed as `bytes32` and converted back to `address`.
* @param useTransfer If true, uses the standard `transfer`.
* @param tokenAddress The token contract address, stored as bytes32.
* @param from The address from which the tokens will be transferred.
* @param to The recipient address that will receive the tokens.
* @param amount The number of tokens to transfer.
*/
function _executeTokenTransferFrom(
bool useTransfer,
bytes32 tokenAddress,
address from,
address to,
uint256 amount
) private {
if (useTransfer) {
IERC20Upgradeable(address(uint160(uint256(tokenAddress)))).transferFrom({
from: from,
to: to,
amount: amount
});
} else {
IERC20Upgradeable(address(uint160(uint256(tokenAddress)))).safeTransferFrom({
from: from,
to: to,
value: amount
});
}
}
/**
* @notice Reads mapping info from Mapper and packs it into IMapper.MapInfo.
* @param mapId The ID of the token mapping in the Mapper contract.
* @return info Fully populated MapInfo struct.
*/
function _getMapInfo(uint256 mapId) private view returns (IMapper.MapInfo memory info) {
(
uint256 originChainId,
uint256 targetChainId,
IMapper.DepositType depositType,
IMapper.WithdrawType withdrawType,
bytes32 originTokenAddress,
bytes32 targetTokenAddress,
bool useTransfer,
bool isAllowed,
bool isCoin
) = Mapper.mapInfo(mapId);
return
IMapper.MapInfo({
originChainId: originChainId,
targetChainId: targetChainId,
depositType: depositType,
withdrawType: withdrawType,
originTokenAddress: originTokenAddress,
targetTokenAddress: targetTokenAddress,
useTransfer: useTransfer,
isAllowed: isAllowed,
isCoin: isCoin
});
}
/**
* @notice Returns the contract's current balance of the specified token.
* Converts a stored `bytes32` token address back to a normal `address`
* and calls `balanceOf(address(this))` on the token contract.
* @param tokenAddress The token contract address, stored as bytes32.
* @return balance The amount of tokens held by this contract.
*/
function _getBalance(bytes32 tokenAddress) private view returns (uint256 balance) {
return IERC20Upgradeable(address(uint160(uint256(tokenAddress)))).balanceOf({ account: address(this) });
}
/**
* @notice Validates the ECDSA signature and returns the computed message hash.
* - Computes a unique hash from all critical parameters of the bridging request.
* - Ensures the hash has not been used before to prevent replay attacks.
* - Recovers the signer address from the signature and verifies it matches the contract owner.
* @param bridgeTokensParams Struct containing parameters for the bridging process.
* @param mapInfo Struct containing detailed information about the mapping.
* @param gasAmount The amount of gas fee to be paid.
* @return hash The computed keccak256 hash of the signed message.
*/
function _validateECDSA(
BridgeTokensParams calldata bridgeTokensParams,
IMapper.MapInfo memory mapInfo,
uint256 gasAmount
) private view returns (bytes32 hash) {
// Recovering the address of the signer from the signature
hash = keccak256(
abi.encodePacked(
owner(),
msg.sender,
bridgeTokensParams.bridgeParams.toAddress,
mapInfo.targetTokenAddress,
gasAmount,
bridgeTokensParams.bridgeParams.amount,
mapInfo.originChainId,
mapInfo.targetChainId,
bridgeTokensParams.ECDSAParams.deadline,
bridgeTokensParams.ECDSAParams.salt
)
);
require(!usedHashes[hash], "Bridge: Hash already used");
// We do an ECDSA check
ECDSAChecks.validate(
ECDSAChecks.ECDSAParams({
hash: hash,
r: bridgeTokensParams.ECDSAParams.r,
s: bridgeTokensParams.ECDSAParams.s,
signerAddress: owner(),
deadline: bridgeTokensParams.ECDSAParams.deadline,
v: bridgeTokensParams.ECDSAParams.v
})
);
return hash;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.0;
import "./OwnableUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
function __Ownable2Step_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable2Step_init_unchained() internal onlyInitializing {
}
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
_transferOwnership(sender);
}
/**
* @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;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface IERC1822ProxiableUpgradeable {
/**
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
* address.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy.
*/
function proxiableUUID() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
*
* _Available since v4.8.3._
*/
interface IERC1967Upgradeable {
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Emitted when the beacon is changed.
*/
event BeaconUpgraded(address indexed beacon);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.0;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeaconUpgradeable {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {BeaconProxy} will check that this address is a contract.
*/
function implementation() external view returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)
pragma solidity ^0.8.2;
import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/IERC1967Upgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import {Initializable} from "../utils/Initializable.sol";
/**
* @dev This abstract contract provides getters and event emitting update functions for
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
*
* _Available since v4.1._
*/
abstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable {
// This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
function __ERC1967Upgrade_init() internal onlyInitializing {
}
function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
}
/**
* @dev Returns the current implementation address.
*/
function _getImplementation() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Perform implementation upgrade
*
* Emits an {Upgraded} event.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Perform implementation upgrade with additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {
_upgradeTo(newImplementation);
if (data.length > 0 || forceCall) {
AddressUpgradeable.functionDelegateCall(newImplementation, data);
}
}
/**
* @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {
// Upgrades from old implementations will perform a rollback test. This test requires the new
// implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
// this special case will break upgrade paths from old UUPS implementation to new ones.
if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
_setImplementation(newImplementation);
} else {
try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
} catch {
revert("ERC1967Upgrade: new implementation is not UUPS");
}
_upgradeToAndCall(newImplementation, data, forceCall);
}
}
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Returns the current admin.
*/
function _getAdmin() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
require(newAdmin != address(0), "ERC1967: new admin is the zero address");
StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {AdminChanged} event.
*/
function _changeAdmin(address newAdmin) internal {
emit AdminChanged(_getAdmin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
* This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
*/
bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Returns the current beacon.
*/
function _getBeacon() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the EIP1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
require(
AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
"ERC1967: beacon implementation is not a contract"
);
StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
}
/**
* @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
* not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
*
* Emits a {BeaconUpgraded} event.
*/
function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {
_setBeacon(newBeacon);
emit BeaconUpgraded(newBeacon);
if (data.length > 0 || forceCall) {
AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), 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;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.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]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.0;
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import {Initializable} from "./Initializable.sol";
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*
* _Available since v4.1._
*/
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address private immutable __self = address(this);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
require(address(this) != __self, "Function must be called through delegatecall");
require(_getImplementation() == __self, "Function must be called through active proxy");
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
_;
}
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/**
* @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate the implementation's compatibility when performing an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
return _IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeTo(address newImplementation) public virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data, true);
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeTo} and {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal override onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.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 Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20Upgradeable.sol";
import "./extensions/IERC20MetadataUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import {Initializable} from "../../proxy/utils/Initializable.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].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {
__ERC20_init_unchained(name_, symbol_);
}
function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[45] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)
pragma solidity ^0.8.0;
import "../ERC20Upgradeable.sol";
import "../../../utils/ContextUpgradeable.sol";
import {Initializable} from "../../../proxy/utils/Initializable.sol";
/**
* @dev Extension of {ERC20} that allows token holders to destroy both their own
* tokens and those that they have an allowance for, in a way that can be
* recognized off-chain (via event analysis).
*/
abstract contract ERC20BurnableUpgradeable is Initializable, ContextUpgradeable, ERC20Upgradeable {
function __ERC20Burnable_init() internal onlyInitializing {
}
function __ERC20Burnable_init_unchained() internal onlyInitializing {
}
/**
* @dev Destroys `amount` tokens from the caller.
*
* See {ERC20-_burn}.
*/
function burn(uint256 amount) public virtual {
_burn(_msgSender(), amount);
}
/**
* @dev Destroys `amount` tokens from `account`, deducting from the caller's
* allowance.
*
* See {ERC20-_burn} and {ERC20-allowance}.
*
* Requirements:
*
* - the caller must have allowance for ``accounts``'s tokens of at least
* `amount`.
*/
function burnFrom(address account, uint256 amount) public virtual {
_spendAllowance(account, _msgSender(), amount);
_burn(account, amount);
}
/**
* @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;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20PermitUpgradeable {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
import "../extensions/IERC20PermitUpgradeable.sol";
import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {
using AddressUpgradeable for address;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20Upgradeable 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(IERC20Upgradeable 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));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
IERC20PermitUpgradeable 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(IERC20Upgradeable 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");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {
// 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 cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
/**
* @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;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
import "../StringsUpgradeable.sol";
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSAUpgradeable {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV // Deprecated in v4.8
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, "\x19Ethereum Signed Message:\n32")
mstore(0x1c, hash)
message := keccak256(0x00, 0x3c)
}
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, "\x19\x01")
mstore(add(ptr, 0x02), domainSeparator)
mstore(add(ptr, 0x22), structHash)
data := keccak256(ptr, 0x42)
}
}
/**
* @dev Returns an Ethereum Signed Data with intended validator, created from a
* `validator` and `data` according to the version 0 of EIP-191.
*
* See {recover}.
*/
function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x00", validator, data));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165Upgradeable.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* 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;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface 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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library MathUpgradeable {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMathUpgradeable {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.0;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```solidity
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._
* _Available since v4.9 for `string`, `bytes`._
*/
library StorageSlotUpgradeable {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/MathUpgradeable.sol";
import "./math/SignedMathUpgradeable.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 `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, MathUpgradeable.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.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].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract 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}.
*
* 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 default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/introspection/ERC165Checker.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Library used to query support of an interface declared via {IERC165}.
*
* Note that these functions return the actual result of the query: they do not
* `revert` if an interface is not supported. It is up to the caller to decide
* what to do in these cases.
*/
library ERC165Checker {
// As per the EIP-165 spec, no interface should ever match 0xffffffff
bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;
/**
* @dev Returns true if `account` supports the {IERC165} interface.
*/
function supportsERC165(address account) internal view returns (bool) {
// Any contract that implements ERC165 must explicitly indicate support of
// InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
return
supportsERC165InterfaceUnchecked(account, type(IERC165).interfaceId) &&
!supportsERC165InterfaceUnchecked(account, _INTERFACE_ID_INVALID);
}
/**
* @dev Returns true if `account` supports the interface defined by
* `interfaceId`. Support for {IERC165} itself is queried automatically.
*
* See {IERC165-supportsInterface}.
*/
function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
// query support of both ERC165 as per the spec and support of _interfaceId
return supportsERC165(account) && supportsERC165InterfaceUnchecked(account, interfaceId);
}
/**
* @dev Returns a boolean array where each value corresponds to the
* interfaces passed in and whether they're supported or not. This allows
* you to batch check interfaces for a contract where your expectation
* is that some interfaces may not be supported.
*
* See {IERC165-supportsInterface}.
*
* _Available since v3.4._
*/
function getSupportedInterfaces(
address account,
bytes4[] memory interfaceIds
) internal view returns (bool[] memory) {
// an array of booleans corresponding to interfaceIds and whether they're supported or not
bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);
// query support of ERC165 itself
if (supportsERC165(account)) {
// query support of each interface in interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
interfaceIdsSupported[i] = supportsERC165InterfaceUnchecked(account, interfaceIds[i]);
}
}
return interfaceIdsSupported;
}
/**
* @dev Returns true if `account` supports all the interfaces defined in
* `interfaceIds`. Support for {IERC165} itself is queried automatically.
*
* Batch-querying can lead to gas savings by skipping repeated checks for
* {IERC165} support.
*
* See {IERC165-supportsInterface}.
*/
function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
// query support of ERC165 itself
if (!supportsERC165(account)) {
return false;
}
// query support of each interface in interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
if (!supportsERC165InterfaceUnchecked(account, interfaceIds[i])) {
return false;
}
}
// all interfaces supported
return true;
}
/**
* @notice Query if a contract implements an interface, does not check ERC165 support
* @param account The address of the contract to query for support of an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @return true if the contract at account indicates support of the interface with
* identifier interfaceId, false otherwise
* @dev Assumes that account contains a contract that supports ERC165, otherwise
* the behavior of this method is undefined. This precondition can be checked
* with {supportsERC165}.
*
* Some precompiled contracts will falsely indicate support for a given interface, so caution
* should be exercised when using this function.
*
* Interface identification is specified in ERC-165.
*/
function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) {
// prepare call
bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);
// perform static call
bool success;
uint256 returnSize;
uint256 returnValue;
assembly {
success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)
returnSize := returndatasize()
returnValue := mload(0x00)
}
return success && returnSize >= 0x20 && returnValue > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity =0.8.30;
/**
* @title IERC20Mintable
* @author Whitechain
* @notice Interface for tokens with minting functionality.
* This interface defines a function for minting new tokens to a specified address.
* Implement this interface if your token needs the ability to create (mint) new tokens.
*/
interface IERC20Mintable {
/**
* @notice Mints new tokens to a specified address.
* Creates `amount` new tokens and assigns them to the `to` address, increasing the total supply.
* This function can only be called by an entity with the appropriate minting privileges
* @param to The recipient address of the newly minted tokens.
* @param amount The number of tokens to mint.
*/
function mint(address to, uint256 amount) external;
}// SPDX-License-Identifier: MIT
pragma solidity =0.8.30;
import { ECDSAUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
/**
* @title ECDSAChecks library
* @author Whitechain
* @notice Library providing functions for validating ECDSA signatures.
* Utilizes OpenZeppelin's ECDSAUpgradeable library for signature verification.
* Use this library to ensure that a given signature was produced by the expected signer
* and to add additional safety checks for signature-based authorization.
*/
library ECDSAChecks {
/**
* Using the ECDSAUpgradeable library for working with digital signatures.
*/
using ECDSAUpgradeable for bytes32;
/**
* @notice Struct for storing parameters of an ECDSA signature.
* @param hash The message hash that was signed.
* @param r The r-component of the ECDSA signature.
* @param s The s-component of the ECDSA signature.
* @param signerAddress The address expected to have signed the message.
* @param deadline The timestamp until which the signature remains valid.
* @param v The recovery byte of the ECDSA signature.
*/
struct ECDSAParams {
bytes32 hash;
bytes32 r;
bytes32 s;
address signerAddress;
uint64 deadline;
uint8 v;
}
/**
* @notice Modifier to ensure that a provided address is not the zero address.
* @param _addr The address to validate.
*/
modifier nonZeroAddress(address _addr) {
require(_addr != address(0), "ECDSAChecks: Address must be not equal zero");
_;
}
/**
* @notice Validates an ECDSA signature based on provided parameters.
* Verifies that the signature is not expired and that the recovered signer
* matches the expected signer.
* @param _ECDSAParams A struct containing the signature parameters.
* @return isValid True if the signature is valid and matches the expected signer.
*/
function validate(
ECDSAParams memory _ECDSAParams
) internal view nonZeroAddress(_ECDSAParams.signerAddress) returns (bool isValid) {
require(_ECDSAParams.deadline >= block.timestamp, "ECDSAChecks: Signature Expired");
// Recovering the address of the signer from the signature
bytes32 _messageHash = _ECDSAParams.hash.toEthSignedMessageHash();
address _signer = _messageHash.recover({ v: _ECDSAParams.v, r: _ECDSAParams.r, s: _ECDSAParams.s });
// Verifying that the recovered signer matches the expected signer's address
require(_signer == _ECDSAParams.signerAddress, "ECDSAChecks: invalid signature");
return true;
}
}// SPDX-License-Identifier: MIT
pragma solidity =0.8.30;
/**
* @title IBridge
* @author Whitechain
* @notice Interface for a Bridge contract enabling cross-chain token transfers
* using a Lock/Burn and Unlock/Mint mechanism.
*/
interface IBridge {
/**
* @notice Struct for initializing the Bridge contract.
* @param mapperAddress The address of the Mapper contract used for token mapping.
*/
struct InitParams {
address mapperAddress;
}
/**
* @notice Struct for storing parameters of an ECDSA signature.
* @param r The r-component of the ECDSA signature.
* @param s The s-component of the ECDSA signature.
* @param salt A random value that allows creating different signatures for the same message having
* replay attack protection at the same time.
* @param deadline The timestamp until which the signature remains valid.
* @param v The recovery byte of the ECDSA signature.
*/
struct ECDSAParams {
bytes32 r;
bytes32 s;
bytes32 salt;
uint64 deadline;
uint8 v;
}
/**
* @notice Struct for storing parameters of a token bridge request.
* @param mapId The ID of the token mapping in the Mapper contract.
* @param amount The amount of tokens to be bridged.
* @param toAddress The recipient's address on the target chain.
*/
struct BridgeParams {
uint256 mapId;
uint256 amount;
bytes32 toAddress;
}
/**
* @notice Struct for storing parameters of a token receiving request.
* @param externalId An external identifier for tracking the bridge transaction.
* @param mapId The ID of the token mapping in the Mapper contract.
* @param amount The amount of tokens to be received.
* @param fromAddress The sender's address on the origin chain.
* @param toAddress The recipient's address on the target chain.
*/
struct ReceiveTokensParams {
bytes32 externalId;
uint256 mapId;
uint256 amount;
bytes32 fromAddress;
bytes32 toAddress;
}
/**
* @notice Struct for combining bridge parameters with an ECDSA signature.
* @param bridgeParams The struct containing token bridge details.
* @param ECDSAParams The struct containing ECDSA signature details.
*/
struct BridgeTokensParams {
BridgeParams bridgeParams;
ECDSAParams ECDSAParams;
}
/**
* @notice Struct for combining withdraw parameters with transfer method selection.
* @param tokenAddress The token address (bytes32) to withdraw liquidity for.
* @param recipientAddress The address that will receive the withdrawn tokens.
* @param amount The amount of tokens to withdraw.
* @param useTransfer Flag that determines which transfer method to use.
* If true, the contract will use a direct `transfer` call.
* If false, it will use a low-level call with safety checks `safeTransfer` or `safeTransferFore`.
*/
struct WithdrawTokenLiquidityParams {
bytes32 tokenAddress;
address recipientAddress;
uint256 amount;
bool useTransfer;
}
/**
* @notice Struct for combining withdraw parameters with transfer method selection.
* @param recipientAddress The address that will receive the withdrawn coins.
* @param amount The amount of coin to withdraw.
*/
struct WithdrawCoinLiquidityParams {
address recipientAddress;
uint256 amount;
}
/**
* @notice Emitted when tokens are deposited into the bridge.
* Triggered in the `bridgeTokens` function upon a successful deposit.
* @param fromAddress The sender's address on the origin chain.
* @param toAddress The recipient's address on the target chain.
* @param originTokenAddress The address of the token on the origin chain.
* @param targetTokenAddress The address of the token on the target chain.
* @param amount The amount of tokens deposited.
* @param originChainId The ID of the origin chain.
* @param targetChainId The ID of the target chain.
*/
event Deposit(
bytes32 indexed fromAddress,
bytes32 indexed toAddress,
bytes32 indexed originTokenAddress,
bytes32 targetTokenAddress,
uint256 amount,
uint256 originChainId,
uint256 targetChainId
);
/**
* @notice Emitted when tokens are withdrawn from the bridge.
* Triggered in the `receiveTokens` function upon a successful withdrawal.
* @param fromAddress The sender's address on the target chain.
* @param toAddress The recipient's address on the origin chain.
* @param targetTokenAddress The address of the token on the target chain.
* @param originTokenAddress The address of the token on the origin chain.
* @param externalId An external identifier for tracking the bridge transaction.
* @param amount The amount of tokens withdrawn.
* @param originChainId The ID of the origin chain.
* @param targetChainId The ID of the target chain.
*/
event Withdrawal(
bytes32 indexed fromAddress,
bytes32 indexed toAddress,
bytes32 indexed targetTokenAddress,
bytes32 originTokenAddress,
bytes32 externalId,
uint256 amount,
uint256 originChainId,
uint256 targetChainId
);
/**
* @notice Emitted when the Mapper contract address is updated.
* Triggered in the `changeMapperAddress` function.
* @param account The address of the account that initiated the change.
* @param oldAddress The previous address of the Mapper contract.
* @param newAddress The new address of the Mapper contract.
*/
event MapperAddressChanged(address indexed account, address indexed oldAddress, address indexed newAddress);
/**
* @notice Emitted when the owner withdraws accumulated gas funds.
* @param account The address that received the funds.
* @param amount The amount of gas funds withdrawn.
*/
event GasAccumulatedWithdrawn(address indexed account, uint256 indexed amount);
/**
* @notice Emitted when the owner withdraws liquidity from the contract.
* @param account The address that received the funds.
* @param token The token address.
* @param amount The amount of funds withdrawn.
* @param useTransfer Flag that determines which transfer method to use.
* If true, the contract will use a direct `transfer` call.
* If false, it will use a low-level call with safety checks `safeTransfer` or `safeTransferFore`.
*/
event LiquidityTokenWithdrawn(
address indexed account,
address indexed token,
uint256 indexed amount,
bool useTransfer
);
/**
* @notice Emitted when the owner withdraws liquidity from the contract.
* @param account The address that received the funds.
* @param amount The amount of funds withdrawn.
*/
event LiquidityCoinWithdrawn(address indexed account, uint256 indexed amount);
/**
* @notice Emitted when tokens are deposited into the contract.
* @param account The address that sent the tokens.
* @param token The token address.
* @param amount The amount of tokens deposited.
*/
event TokensDeposited(address indexed account, address indexed token, uint256 indexed amount);
/**
* @notice Emitted when native coins are deposited into the contract.
* @param account The address that sent the coins.
* @param amount The amount of coins deposited.
*/
event CoinsDeposited(address indexed account, uint256 indexed amount);
/**
* @notice Deposits tokens into the bridge contract.
* This function locks or burns tokens depending on the bridging mechanism.
* @param bridgeTokensParams The struct containing parameters for the bridging process.
*/
function bridgeTokens(BridgeTokensParams calldata bridgeTokensParams) external payable;
/**
* @notice Receives tokens from the bridge contract.
* This function unlocks or mints tokens depending on the withdrawal mechanism.
* Only the contract owner can call this function.
* @param receiveTokensParams The struct containing parameters for the receiving process.
*/
function receiveTokens(ReceiveTokensParams calldata receiveTokensParams) external;
/**
* @notice Withdraws accumulated gas compensation funds to the contract owner.
* Transfers the entire gasAccumulated balance to the owner and resets the counter.
* Only the contract owner can call this function.
* Emits a {GasAccumulatedWithdrawn} event on success.
*/
function withdrawGasAccumulated() external;
/**
* @notice Withdraws token liquidity from the contract to the withdrawRecipient.
* Transfers the balance held by the contract to the withdrawRecipient.
* Only the contract owner can call this function.
* @param withdrawTokenLiquidityParams The struct containing parameters for the withdraw process.
*/
function withdrawTokenLiquidity(WithdrawTokenLiquidityParams calldata withdrawTokenLiquidityParams) external;
/**
* @notice Withdraws coin liquidity from the contract to the withdrawRecipient.
* Transfers the balance held by the contract to the withdrawRecipient.
* Only the contract owner can call this function.
* @param withdrawCoinLiquidityParams The struct containing parameters for the withdraw process.
*/
function withdrawCoinLiquidity(WithdrawCoinLiquidityParams calldata withdrawCoinLiquidityParams) external;
}// SPDX-License-Identifier: MIT
pragma solidity =0.8.30;
/**
* @title IMapper
* @author Whitechain
* @notice Interface for the Mapper contract responsible for managing token mappings across chains.
* It defines enums, structures, events, and errors used in the token mapping process.
*/
interface IMapper {
/**
* @notice Enum representing the type of deposit.
* Used to specify how tokens are handled during deposit.
* - `None`: No deposit allowed.
* - `Lock`: Tokens are locked in the contract.
* - `Burn`: Tokens are burned from the user's balance.
*/
enum DepositType {
None,
Lock,
Burn
}
/**
* @notice Enum representing the type of withdrawal.
* Used to specify how tokens are handled during withdrawal.
* - `None`: No withdrawal allowed.
* - `Unlock`: Tokens are unlocked from the contract.
* - `Mint`: New tokens are minted on the target chain.
*/
enum WithdrawType {
None,
Unlock,
Mint
}
/**
* @notice Struct containing detailed information about a token mapping.
* Stores metadata for cross-chain token bridging.
* @param originChainId The ID of the origin chain.
* @param targetChainId The ID of the target chain.
* @param depositType The type of deposit (e.g., None, Lock, Burn).
* @param withdrawType The type of withdrawal (e.g., None, Unlock, Mint).
* @param originTokenAddress The token identifier on the origin chain, stored as bytes32.
* This format allows supporting token addresses from non‑EVM networks.
* For the bridge coin, this should be the address of the wrapped token on the origin chain.
* @param targetTokenAddress The token identifier on the target chain, stored as bytes32.
* This format allows supporting token addresses from non‑EVM networks.
* For the bridge coin, this should be the address of the wrapped token on the target chain.
* @param useTransfer Flag that determines which transfer method to use.
* If true, the contract will use a direct `transfer` call.
* If false, it will use a low-level call with safety checks `safeTransfer` or `safeTransferFore`.
* @param isAllowed Boolean flag indicating if the token is allowed for bridging.
* @param isCoin Boolean flag indicating if the token is a native coin or an token.
*/
struct MapInfo {
uint256 originChainId;
uint256 targetChainId;
DepositType depositType;
WithdrawType withdrawType;
bytes32 originTokenAddress;
bytes32 targetTokenAddress;
bool useTransfer;
bool isAllowed;
bool isCoin;
}
/**
* @notice Emitted when a new token mapping is added.
* Called in the `registerMapping` function of the Mapper contract.
* @param mapId The ID of the newly added token mapping.
* @param mapInfo Struct containing detailed information about the new mapping.
*/
event RegisteredMapping(uint256 indexed mapId, MapInfo mapInfo);
/**
* @notice Emitted when a token mapping is revoked.
* Called in the `disableMapping` function of the Mapper contract.
* @param mapId The ID of the revoked token mapping.
* @param mapInfo Struct containing detailed information about the revoked mapping.
*/
event DisabledMapping(uint256 indexed mapId, MapInfo mapInfo);
/**
* @notice Emitted when a restriction on a token mapping is updated.
* Called in the `enableMapping` function of the Mapper contract.
* @param mapId The ID of the token mapping with updated restriction.
* @param mapInfo Struct containing updated information about the mapping.
*/
event EnabledMapping(uint256 indexed mapId, MapInfo mapInfo);
/**
* @notice Emitted when a map entry is removed.
* This event is triggered when the `dropToken` function successfully deletes a mapping.
* @param mapId The unique identifier of the mapping that was deleted.
*/
event DropToken(uint256 indexed mapId);
/**
* @notice Updates the restriction status of a token.
* Sets the token mapping to allowed.
* Only the contract owner can call this function.
* Emits an {EnabledMapping} event on success.
* @param mapId The ID of the mapping to be updated.
*/
function enableMapping(uint256 mapId) external;
/**
* @notice Revokes a token mapping.
* Sets the token mapping to disallowed.
* Only the contract owner can call this function.
* Emits a {DisabledMapping} event on success.
* @param mapId The ID of the mapping to be revoked.
*/
function disableMapping(uint256 mapId) external;
/**
* @notice Adds a new token mapping.
* Registers a new token mapping that defines a one‑directional connection between chains.
* Each mapping is created specifically for either deposits or withdrawals.
* For the bridge coin, the address of the wrapped token must be provided in the parameters.
* Only the contract owner can call this function.
* Emits an {RegisteredMapping} event on success.
* @param mapInfo The type of mapping (MapInfo).
*/
function registerMapping(MapInfo calldata mapInfo) external;
/**
* @notice Deletes mapping information for a given mapId.
* Only the contract owner can call this function.
* The function ensures that the provided mapId is valid and belongs to the current chain.
* Depending on the deposit and withdraw types, it removes allowed token mappings.
* @param mapId The unique identifier of the map to be deleted.
*/
function removeMapping(uint256 mapId) external;
/**
* @notice Retrieves information about a token mapping.
* Returns the details of a mapping associated with a given map ID.
* This includes chain IDs, token addresses, deposit and withdrawal types, and status flags.
* @param mapId The ID of the token mapping to be retrieved.
* @return originChainId The ID of the origin chain.
* @return targetChainId The ID of the target chain.
* @return depositType The type of deposit (e.g., None, Lock, or Burn).
* @return withdrawType The type of withdrawal (e.g., None, Unlock, or Mint).
* @return originTokenAddress The token identifier on the origin chain, stored as bytes32.
* This format allows supporting token addresses from non‑EVM networks.
* @return targetTokenAddress The token identifier on the target chain, stored as bytes32.
* This format allows supporting token addresses from non‑EVM networks.
* @return useTransfer Flag that determines which transfer method to use.
* If true, the contract will use a direct `transfer` call.
* If false, it will use a low-level call with safety checks `safeTransfer` or `safeTransferFore`.
* @return isAllowed Boolean flag indicating if the token is allowed for bridging.
* @return isCoin Boolean flag indicating if the token is a native coin or an token.
*/
function mapInfo(
uint256 mapId
)
external
view
returns (
uint256 originChainId,
uint256 targetChainId,
IMapper.DepositType depositType,
IMapper.WithdrawType withdrawType,
bytes32 originTokenAddress,
bytes32 targetTokenAddress,
bool useTransfer,
bool isAllowed,
bool isCoin
);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
}
}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":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CoinsDeposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"fromAddress","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"toAddress","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"originTokenAddress","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"targetTokenAddress","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"originChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"targetChainId","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"GasAccumulatedWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LiquidityCoinWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"useTransfer","type":"bool"}],"name":"LiquidityTokenWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"MapperAddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensDeposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"fromAddress","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"toAddress","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"targetTokenAddress","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"originTokenAddress","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"externalId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"originChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"targetChainId","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"Mapper","outputs":[{"internalType":"contract IMapper","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"uint256","name":"mapId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"toAddress","type":"bytes32"}],"internalType":"struct IBridge.BridgeParams","name":"bridgeParams","type":"tuple"},{"components":[{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint64","name":"deadline","type":"uint64"},{"internalType":"uint8","name":"v","type":"uint8"}],"internalType":"struct IBridge.ECDSAParams","name":"ECDSAParams","type":"tuple"}],"internalType":"struct IBridge.BridgeTokensParams","name":"bridgeTokensParams","type":"tuple"}],"name":"bridgeTokens","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_newMapperAddress","type":"address"}],"name":"changeMapperAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositCoins","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mapId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gasAccumulated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"mapperAddress","type":"address"}],"internalType":"struct IBridge.InitParams","name":"initParams","type":"tuple"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"externalId","type":"bytes32"},{"internalType":"uint256","name":"mapId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"fromAddress","type":"bytes32"},{"internalType":"bytes32","name":"toAddress","type":"bytes32"}],"internalType":"struct IBridge.ReceiveTokensParams","name":"receiveTokensParams","type":"tuple"}],"name":"receiveTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"usedHashes","outputs":[{"internalType":"bool","name":"isUsed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"recipientAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IBridge.WithdrawCoinLiquidityParams","name":"withdrawCoinLiquidityParams","type":"tuple"}],"name":"withdrawCoinLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawGasAccumulated","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"tokenAddress","type":"bytes32"},{"internalType":"address","name":"recipientAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"useTransfer","type":"bool"}],"internalType":"struct IBridge.WithdrawTokenLiquidityParams","name":"withdrawTokenLiquidityParams","type":"tuple"}],"name":"withdrawTokenLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100e1565b600054610100900460ff161561008e5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116146100df576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b608051613150610118600039600081816105bb015281816105fb01528181610a9c01528181610adc0152610b6f01526131506000f3fe6080604052600436106101235760003560e01c806379ba5097116100a0578063c987658a11610064578063c987658a1461033a578063dc5eb87c1461034f578063e30c397814610362578063f16ad51e14610380578063f2fde38b146103a057600080fd5b806379ba50971461029e5780638da5cb5b146102b35780638f09926d146102d1578063aef18bf7146102f1578063c57895f31461033257600080fd5b80634c5f4156116100e75780634c5f41561461021c5780634f1ef2861461024157806352d1902d1461025457806364ad4eec14610269578063715018a61461028957600080fd5b80632002164a1461015c57806324bde2c21461019a57806328ae4a97146101bc5780633659cfe6146101dc5780633718ebba146101fc57600080fd5b3661015757604051349033907fa56aed091f8d10bafc9d812a245d3748a61cd543e528fed0a92fad8cadf8f72b90600090a3005b600080fd5b34801561016857600080fd5b5061012e5461017d906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101a657600080fd5b506101ba6101b5366004612a2e565b6103c0565b005b3480156101c857600080fd5b506101ba6101d7366004612a65565b6104ff565b3480156101e857600080fd5b506101ba6101f7366004612a65565b6105b1565b34801561020857600080fd5b506101ba610217366004612a80565b61068d565b34801561022857600080fd5b5061023361012d5481565b604051908152602001610191565b6101ba61024f366004612aa9565b610a92565b34801561026057600080fd5b50610233610b62565b34801561027557600080fd5b506101ba610284366004612b73565b610c15565b34801561029557600080fd5b506101ba610dbb565b3480156102aa57600080fd5b506101ba610dcf565b3480156102bf57600080fd5b506097546001600160a01b031661017d565b3480156102dd57600080fd5b506101ba6102ec366004612b86565b610e46565b3480156102fd57600080fd5b5061032261030c366004612b99565b61012f6020526000908152604090205460ff1681565b6040519015158152602001610191565b6101ba611002565b34801561034657600080fd5b506101ba61105b565b6101ba61035d366004612bb2565b61122d565b34801561036e57600080fd5b5060c9546001600160a01b031661017d565b34801561038c57600080fd5b506101ba61039b366004612bc6565b611640565b3480156103ac57600080fd5b506101ba6103bb366004612a65565b61183d565b6103c86118ae565b6103d0611907565b8060400135600081116103fe5760405162461bcd60e51b81526004016103f590612be8565b60405180910390fd5b61040e6040830160208401612a65565b6001600160a01b0381166104345760405162461bcd60e51b81526004016103f590612c18565b8235806104535760405162461bcd60e51b81526004016103f590612c5e565b6104826104666080860160608701612cb0565b85356104786040880160208901612a65565b8760400135611961565b604084018035906001600160a01b03863516906104a29060208801612a65565b6001600160a01b03167f87bb06522004c125e3575ff908c82c9d10079b93340ce2e2ce43ecda22f6245e6104dc6080890160608a01612cb0565b604051901515815260200160405180910390a45050506104fc600160fb55565b50565b610507611907565b806001600160a01b03811661052e5760405162461bcd60e51b81526004016103f590612c18565b61053f8263f4bcc14d60e01b611a01565b61055b5760405162461bcd60e51b81526004016103f590612cd4565b61012e80546001600160a01b038481166001600160a01b03198316811790935560405191169190829033907ff4d89cc3a3185b27460a1903a2367952b4934ca003b59d0da096332ae470d9d190600090a4505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036105f95760405162461bcd60e51b81526004016103f590612d20565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166106426000805160206130d4833981519152546001600160a01b031690565b6001600160a01b0316146106685760405162461bcd60e51b81526004016103f590612d6c565b61067181611a26565b604080516000808252602082019092526104fc91839190611a2e565b6106956118ae565b61069d611907565b6060810135806106bf5760405162461bcd60e51b81526004016103f590612c5e565b6080820135806106e15760405162461bcd60e51b81526004016103f590612c5e565b8260400135600081116107065760405162461bcd60e51b81526004016103f590612be8565b60006107158560200135611b9e565b90508060e001516107385760405162461bcd60e51b81526004016103f590612db8565b60008160400151600281111561075057610750612def565b1461076d5760405162461bcd60e51b81526004016103f590612e05565b806101000151156108d95760018160600151600281111561079057610790612def565b146107f25760405162461bcd60e51b815260206004820152602c60248201527f4272696467653a20576974686472617754797065206d7573742062652065717560448201526b616c20746f20556e6c6f636b60a01b60648201526084016103f5565b600061012d54476108039190612e64565b905085604001358110156108295760405162461bcd60e51b81526004016103f590612e77565b604080516000916001600160a01b0360808a0135169190890135908381818185875af1925050503d806000811461087c576040519150601f19603f3d011682016040523d82523d6000602084013e610881565b606091505b50509050806108d25760405162461bcd60e51b815260206004820152601c60248201527f4272696467653a204661696c656420746f2073656e6420636f696e730000000060448201526064016103f5565b5050610a04565b6000816060015160028111156108f1576108f1612def565b036109555760405162461bcd60e51b815260206004820152602e60248201527f4272696467653a20576974686472617754797065206d757374206e6f7420626560448201526d20657175616c20746f204e6f6e6560901b60648201526084016103f5565b60028160600151600281111561096d5761096d612def565b036109e55760a0810151604080516340c10f1960e01b81526001600160a01b036080890135811660048301529188013560248201529116906340c10f1990604401600060405180830381600087803b1580156109c857600080fd5b505af11580156109dc573d6000803e3d6000fd5b50505050610a04565b610a048160c001518260a00151876080013560001c8860400135611961565b8060a00151856080013586606001357fa8faf70e37416f5ce81c94de38462015f44afaf1da26125aa52b054820f84640846080015189600001358a6040013587600001518860200151604051610a7c959493929190948552602085019390935260408401919091526060830152608082015260a00190565b60405180910390a4505050506104fc600160fb55565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610ada5760405162461bcd60e51b81526004016103f590612d20565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610b236000805160206130d4833981519152546001600160a01b031690565b6001600160a01b031614610b495760405162461bcd60e51b81526004016103f590612d6c565b610b5282611a26565b610b5e82826001611a2e565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610c025760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016103f5565b506000805160206130d483398151915290565b610c1d6118ae565b610c25611907565b806020013560008111610c4a5760405162461bcd60e51b81526004016103f590612be8565b610c576020830183612a65565b6001600160a01b038116610c7d5760405162461bcd60e51b81526004016103f590612c18565b600061012d5447610c8e9190612e64565b90508360200135811015610cb45760405162461bcd60e51b81526004016103f590612e77565b6000610cc36020860186612a65565b6001600160a01b0316856020013560405160006040518083038185875af1925050503d8060008114610d11576040519150601f19603f3d011682016040523d82523d6000602084013e610d16565b606091505b5050905080610d675760405162461bcd60e51b815260206004820152601c60248201527f4272696467653a204661696c656420746f2073656e6420636f696e730000000060448201526064016103f5565b60208501803590610d789087612a65565b6001600160a01b03167f568032ae4578d65f7663bc34787597f6aec1c6d90135e2eb187f5e1cebf6e6c660405160405180910390a3505050506104fc600160fb55565b610dc3611907565b610dcd6000611caf565b565b60c95433906001600160a01b03168114610e3d5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084016103f5565b6104fc81611caf565b600054610100900460ff1615808015610e665750600054600160ff909116105b80610e805750303b158015610e80575060005460ff166001145b610ee35760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103f5565b6000805460ff191660011790558015610f06576000805461ff0019166101001790555b610f136020830183612a65565b6001600160a01b038116610f395760405162461bcd60e51b81526004016103f590612c18565b610f41611cc8565b610f49611cef565b610f51611d1e565b610f6e610f616020850185612a65565b63f4bcc14d60e01b611a01565b610f8a5760405162461bcd60e51b81526004016103f590612cd4565b610f976020840184612a65565b61012e80546001600160a01b0319166001600160a01b0392909216919091179055508015610b5e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b61100a611907565b346000811161102b5760405162461bcd60e51b81526004016103f590612be8565b604051349033907fa56aed091f8d10bafc9d812a245d3748a61cd543e528fed0a92fad8cadf8f72b90600090a350565b6110636118ae565b61106b611907565b61012d546000811161108f5760405162461bcd60e51b81526004016103f590612be8565b61012d544710156111085760405162461bcd60e51b815260206004820152603d60248201527f4272696467653a20436f696e732062616c616e6365206d75737420626520677260448201527f6561746572206f7220657175616c20676173416363756d756c6174656400000060648201526084016103f5565b61012d8054600091829055906111266097546001600160a01b031690565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114611170576040519150601f19603f3d011682016040523d82523d6000602084013e611175565b606091505b50509050806111d85760405162461bcd60e51b815260206004820152602960248201527f4272696467653a2047617320616363756d756c61746564207769746864726177604482015268185b0819985a5b195960ba1b60648201526084016103f5565b816111eb6097546001600160a01b031690565b6001600160a01b03167fec3b80c9664bec961294048161f6ee2f5801192a9abb2d056ac1bd79b50810f960405160405180910390a3505050610dcd600160fb55565b6112356118ae565b6040810135806112575760405162461bcd60e51b81526004016103f590612c5e565b6020820135806112795760405162461bcd60e51b81526004016103f590612be8565b60006112858435611b9e565b90508060e001516112a85760405162461bcd60e51b81526004016103f590612db8565b6000816060015160028111156112c0576112c0612def565b146113205760405162461bcd60e51b815260206004820152602a60248201527f4272696467653a20576974686472617754797065206d75737420626520657175604482015269616c20746f204e6f6e6560b01b60648201526084016103f5565b610100810151602085013590600090156113bb57813410156113aa5760405162461bcd60e51b815260206004820152603a60248201527f4272696467653a20546865206d73672e76616c7565206d75737420626520677260448201527f6561746572207468616e206f7220657175616c20616d6f756e7400000000000060648201526084016103f5565b6113b48234612e64565b90506113be565b50345b60006113cb878584611d4d565b600081815261012f60205260409020805460ff1916600117905561012d549091506113f7908390612ed4565b61012d55610100840151600090156114875760018560400151600281111561142157611421612def565b146114805760405162461bcd60e51b815260206004820152602960248201527f4272696467653a204465706f73697454797065206d75737420626520657175616044820152686c20746f204c6f636b60b81b60648201526084016103f5565b50826115c6565b60008560400151600281111561149f5761149f612def565b036115025760405162461bcd60e51b815260206004820152602d60248201527f4272696467653a204465706f73697454797065206d757374206e6f742062652060448201526c657175616c20746f204e6f6e6560981b60648201526084016103f5565b60006115118660800151611f0c565b90506115288660c001518760800151333089611f77565b60006115378760800151611f0c565b90506115438282612e64565b925060028760400151600281111561155d5761155d612def565b036115c3576080870151604051630852cd8d60e31b8152600481018590526001600160a01b03909116906342966c6890602401600060405180830381600087803b1580156115aa57600080fd5b505af11580156115be573d6000803e3d6000fd5b505050505b50505b608085015160a08601518651602088015160408051908d01359333937f22a290c1de94bc5f142308739aef5c8830b9bb5f23baa20e92968f2a384dd95e93611627938992919093845260208401929092526040830152606082015260800190565b60405180910390a4505050505050506104fc600160fb55565b6116486118ae565b611650611907565b80600081116116715760405162461bcd60e51b81526004016103f590612be8565b600061167c84611b9e565b90508060e0015161169f5760405162461bcd60e51b81526004016103f590612db8565b8061010001511561170a5760405162461bcd60e51b815260206004820152602f60248201527f4272696467653a204465706f73697420616c6c6f776564206f6e6c7920666f7260448201526e20746f6b656e206d617070696e677360881b60648201526084016103f5565b60008160400151600281111561172257611722612def565b1461173f5760405162461bcd60e51b81526004016103f590612e05565b60a08101516117aa5760405162461bcd60e51b815260206004820152603160248201527f4272696467653a20546172676574546f6b656e41646472657373206d757374206044820152706265206e6f7420657175616c207a65726f60781b60648201526084016103f5565b60006117b98260a00151611f0c565b90506117d08260c001518360a00151333088611f77565b60006117df8360a00151611f0c565b905060006117ed8383612e64565b60a085015160405191925082916001600160a01b039091169033907fcbc4a4091b012bb1329c38bbbb15455f5cac5aa3673da0a7f38cd61a4f49551790600090a45050505050610b5e600160fb55565b611845611907565b60c980546001600160a01b0383166001600160a01b031990911681179091556118766097546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600260fb54036119005760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103f5565b600260fb55565b6097546001600160a01b03163314610dcd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103f5565b83156119e05760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156119b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119da9190612ee7565b506119f4565b6119f46001600160a01b038416838361201a565b50505050565b600160fb55565b6000611a0c8361207d565b8015611a1d5750611a1d83836120b0565b90505b92915050565b6104fc611907565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611a6657611a6183612139565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611ac0575060408051601f3d908101601f19168201909252611abd91810190612f04565b60015b611b235760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016103f5565b6000805160206130d48339815191528114611b925760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016103f5565b50611a618383836121d5565b611ba66129d1565b61012e546040516313b1720d60e21b815260048101849052600091829182918291829182918291829182916001600160a01b031690634ec5c8349060240161012060405180830381865afa158015611c02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c269190612f2a565b9850985098509850985098509850985098506040518061012001604052808a8152602001898152602001886002811115611c6257611c62612def565b8152602001876002811115611c7957611c79612def565b815260208101969096526040860194909452911515606085015215156080840152151560a0909201919091529695505050505050565b60c980546001600160a01b03191690556104fc816121fa565b600054610100900460ff16610dcd5760405162461bcd60e51b81526004016103f590612fc8565b600054610100900460ff16611d165760405162461bcd60e51b81526004016103f590612fc8565b610dcd61224c565b600054610100900460ff16611d455760405162461bcd60e51b81526004016103f590612fc8565b610dcd61227c565b6000611d616097546001600160a01b031690565b60a08401518451602080870151339360408a01359390928892908b01359190611d9060e08d0160c08e01613013565b6040516060998a1b6bffffffffffffffffffffffff1990811660208301529890991b909716603489015260488801959095526068870193909352608886019190915260a885015260c884015260e883015260c01b6001600160c01b03191661010882015260a08501356101108201526101300160408051601f198184030181529181528151602092830120600081815261012f90935291205490915060ff1615611e7c5760405162461bcd60e51b815260206004820152601960248201527f4272696467653a204861736820616c726561647920757365640000000000000060448201526064016103f5565b611f046040518060c001604052808381526020018660600160000135815260200186606001602001358152602001611ebc6097546001600160a01b031690565b6001600160a01b03168152602001611eda60e0880160c08901613013565b67ffffffffffffffff168152602001611efa610100880160e0890161303d565b60ff1690526122a3565b509392505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015611f53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a209190612f04565b8415611ffe576040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390528516906323b872dd906064016020604051808303816000875af1158015611fd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ff89190612ee7565b50612013565b6120136001600160a01b038516848484612436565b5050505050565b6040516001600160a01b038316602482015260448101829052611a6190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261246e565b6000612090826301ffc9a760e01b6120b0565b8015611a2057506120a9826001600160e01b03196120b0565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d91506000519050828015612122575060208210155b801561212e5750600081115b979650505050505050565b6001600160a01b0381163b6121a65760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016103f5565b6000805160206130d483398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6121de83612543565b6000825111806121eb5750805b15611a61576119f48383612583565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166122735760405162461bcd60e51b81526004016103f590612fc8565b610dcd33611caf565b600054610100900460ff166119fa5760405162461bcd60e51b81526004016103f590612fc8565b60608101516000906001600160a01b0381166123155760405162461bcd60e51b815260206004820152602b60248201527f4543445341436865636b733a2041646472657373206d757374206265206e6f7460448201526a20657175616c207a65726f60a81b60648201526084016103f5565b42836080015167ffffffffffffffff1610156123735760405162461bcd60e51b815260206004820152601e60248201527f4543445341436865636b733a205369676e61747572652045787069726564000060448201526064016103f5565b82517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c812060a0850151602086015160408701519293926123c492859290916125a8565b905084606001516001600160a01b0316816001600160a01b03161461242b5760405162461bcd60e51b815260206004820152601e60248201527f4543445341436865636b733a20696e76616c6964207369676e6174757265000060448201526064016103f5565b506001949350505050565b6040516001600160a01b03808516602483015283166044820152606481018290526119f49085906323b872dd60e01b90608401612046565b60006124c3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166125d29092919063ffffffff16565b90508051600014806124e45750808060200190518101906124e49190612ee7565b611a615760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103f5565b61254c81612139565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060611a1d83836040518060600160405280602781526020016130f4602791396125e1565b60008060006125b987878787612659565b915091506125c68161271d565b5090505b949350505050565b60606125ca8484600085612867565b6060600080856001600160a01b0316856040516125fe9190613084565b600060405180830381855af49150503d8060008114612639576040519150601f19603f3d011682016040523d82523d6000602084013e61263e565b606091505b509150915061264f86838387612933565b9695505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156126905750600090506003612714565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156126e4573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661270d57600060019250925050612714565b9150600090505b94509492505050565b600081600481111561273157612731612def565b036127395750565b600181600481111561274d5761274d612def565b0361279a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016103f5565b60028160048111156127ae576127ae612def565b036127fb5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016103f5565b600381600481111561280f5761280f612def565b036104fc5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016103f5565b6060824710156128c85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103f5565b600080866001600160a01b031685876040516128e49190613084565b60006040518083038185875af1925050503d8060008114612921576040519150601f19603f3d011682016040523d82523d6000602084013e612926565b606091505b509150915061212e878383875b606083156129a257825160000361299b576001600160a01b0385163b61299b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103f5565b50816125ca565b6125ca83838151156129b75781518083602001fd5b8060405162461bcd60e51b81526004016103f591906130a0565b6040518061012001604052806000815260200160008152602001600060028111156129fe576129fe612def565b81526020016000815260006020820181905260408201819052606082018190526080820181905260a09091015290565b60006080828403128015612a4157600080fd5b509092915050565b80356001600160a01b0381168114612a6057600080fd5b919050565b600060208284031215612a7757600080fd5b611a1d82612a49565b600060a0828403128015612a4157600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060408385031215612abc57600080fd5b612ac583612a49565b9150602083013567ffffffffffffffff811115612ae157600080fd5b8301601f81018513612af257600080fd5b803567ffffffffffffffff811115612b0c57612b0c612a93565b604051601f8201601f19908116603f0116810167ffffffffffffffff81118282101715612b3b57612b3b612a93565b604052818152828201602001871015612b5357600080fd5b816020840160208301376000602083830101528093505050509250929050565b60006040828403128015612a4157600080fd5b60006020828403128015612a4157600080fd5b600060208284031215612bab57600080fd5b5035919050565b6000610100828403128015612a4157600080fd5b60008060408385031215612bd957600080fd5b50508035926020909101359150565b6020808252601690820152754272696467653a2043616e6e6f74206265207a65726f60501b604082015260600190565b60208082526026908201527f4272696467653a2041646472657373206d757374206265206e6f7420657175616040820152656c207a65726f60d01b606082015260800190565b60208082526024908201527f4272696467653a204279746573206d757374206265206e6f7420657175616c206040820152637a65726f60e01b606082015260800190565b80151581146104fc57600080fd5b600060208284031215612cc257600080fd5b8135612ccd81612ca2565b9392505050565b6020808252602c908201527f4272696467653a204e6577206164647265737320646f6573206e6f742073757060408201526b3837b93a1024a6b0b83832b960a11b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252601e908201527f4272696467653a204973416c6c6f776564206d75737420626520747275650000604082015260600190565b634e487b7160e01b600052602160045260246000fd5b60208082526029908201527f4272696467653a204465706f73697454797065206d75737420626520657175616040820152686c20746f204e6f6e6560b81b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b81810381811115611a2057611a20612e4e565b6020808252603e908201527f4272696467653a20436f6e747261637420636f696e732062616c616e6365206d60408201527f7573742062652067726561746572206f7220657175616c20616d6f756e740000606082015260800190565b80820180821115611a2057611a20612e4e565b600060208284031215612ef957600080fd5b8151612ccd81612ca2565b600060208284031215612f1657600080fd5b5051919050565b600381106104fc57600080fd5b60008060008060008060008060006101208a8c031215612f4957600080fd5b895160208b015160408c0151919a509850612f6381612f1d565b60608b0151909750612f7481612f1d565b60808b015160a08c015160c08d01519298509096509450612f9481612ca2565b60e08b0151909350612fa581612ca2565b6101008b0151909250612fb781612ca2565b809150509295985092959850929598565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006020828403121561302557600080fd5b813567ffffffffffffffff81168114612ccd57600080fd5b60006020828403121561304f57600080fd5b813560ff81168114612ccd57600080fd5b60005b8381101561307b578181015183820152602001613063565b50506000910152565b60008251613096818460208701613060565b9190910192915050565b60208152600082518060208401526130bf816040850160208701613060565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122078ae8e06eb6fed3dbcdf34810c2b3050a579363762c7393fceea433dda0aabd864736f6c634300081e0033
Deployed Bytecode
0x6080604052600436106101235760003560e01c806379ba5097116100a0578063c987658a11610064578063c987658a1461033a578063dc5eb87c1461034f578063e30c397814610362578063f16ad51e14610380578063f2fde38b146103a057600080fd5b806379ba50971461029e5780638da5cb5b146102b35780638f09926d146102d1578063aef18bf7146102f1578063c57895f31461033257600080fd5b80634c5f4156116100e75780634c5f41561461021c5780634f1ef2861461024157806352d1902d1461025457806364ad4eec14610269578063715018a61461028957600080fd5b80632002164a1461015c57806324bde2c21461019a57806328ae4a97146101bc5780633659cfe6146101dc5780633718ebba146101fc57600080fd5b3661015757604051349033907fa56aed091f8d10bafc9d812a245d3748a61cd543e528fed0a92fad8cadf8f72b90600090a3005b600080fd5b34801561016857600080fd5b5061012e5461017d906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101a657600080fd5b506101ba6101b5366004612a2e565b6103c0565b005b3480156101c857600080fd5b506101ba6101d7366004612a65565b6104ff565b3480156101e857600080fd5b506101ba6101f7366004612a65565b6105b1565b34801561020857600080fd5b506101ba610217366004612a80565b61068d565b34801561022857600080fd5b5061023361012d5481565b604051908152602001610191565b6101ba61024f366004612aa9565b610a92565b34801561026057600080fd5b50610233610b62565b34801561027557600080fd5b506101ba610284366004612b73565b610c15565b34801561029557600080fd5b506101ba610dbb565b3480156102aa57600080fd5b506101ba610dcf565b3480156102bf57600080fd5b506097546001600160a01b031661017d565b3480156102dd57600080fd5b506101ba6102ec366004612b86565b610e46565b3480156102fd57600080fd5b5061032261030c366004612b99565b61012f6020526000908152604090205460ff1681565b6040519015158152602001610191565b6101ba611002565b34801561034657600080fd5b506101ba61105b565b6101ba61035d366004612bb2565b61122d565b34801561036e57600080fd5b5060c9546001600160a01b031661017d565b34801561038c57600080fd5b506101ba61039b366004612bc6565b611640565b3480156103ac57600080fd5b506101ba6103bb366004612a65565b61183d565b6103c86118ae565b6103d0611907565b8060400135600081116103fe5760405162461bcd60e51b81526004016103f590612be8565b60405180910390fd5b61040e6040830160208401612a65565b6001600160a01b0381166104345760405162461bcd60e51b81526004016103f590612c18565b8235806104535760405162461bcd60e51b81526004016103f590612c5e565b6104826104666080860160608701612cb0565b85356104786040880160208901612a65565b8760400135611961565b604084018035906001600160a01b03863516906104a29060208801612a65565b6001600160a01b03167f87bb06522004c125e3575ff908c82c9d10079b93340ce2e2ce43ecda22f6245e6104dc6080890160608a01612cb0565b604051901515815260200160405180910390a45050506104fc600160fb55565b50565b610507611907565b806001600160a01b03811661052e5760405162461bcd60e51b81526004016103f590612c18565b61053f8263f4bcc14d60e01b611a01565b61055b5760405162461bcd60e51b81526004016103f590612cd4565b61012e80546001600160a01b038481166001600160a01b03198316811790935560405191169190829033907ff4d89cc3a3185b27460a1903a2367952b4934ca003b59d0da096332ae470d9d190600090a4505050565b6001600160a01b037f00000000000000000000000022c1663b0bcfe6688eef4cecc2be88525ad957d91630036105f95760405162461bcd60e51b81526004016103f590612d20565b7f00000000000000000000000022c1663b0bcfe6688eef4cecc2be88525ad957d96001600160a01b03166106426000805160206130d4833981519152546001600160a01b031690565b6001600160a01b0316146106685760405162461bcd60e51b81526004016103f590612d6c565b61067181611a26565b604080516000808252602082019092526104fc91839190611a2e565b6106956118ae565b61069d611907565b6060810135806106bf5760405162461bcd60e51b81526004016103f590612c5e565b6080820135806106e15760405162461bcd60e51b81526004016103f590612c5e565b8260400135600081116107065760405162461bcd60e51b81526004016103f590612be8565b60006107158560200135611b9e565b90508060e001516107385760405162461bcd60e51b81526004016103f590612db8565b60008160400151600281111561075057610750612def565b1461076d5760405162461bcd60e51b81526004016103f590612e05565b806101000151156108d95760018160600151600281111561079057610790612def565b146107f25760405162461bcd60e51b815260206004820152602c60248201527f4272696467653a20576974686472617754797065206d7573742062652065717560448201526b616c20746f20556e6c6f636b60a01b60648201526084016103f5565b600061012d54476108039190612e64565b905085604001358110156108295760405162461bcd60e51b81526004016103f590612e77565b604080516000916001600160a01b0360808a0135169190890135908381818185875af1925050503d806000811461087c576040519150601f19603f3d011682016040523d82523d6000602084013e610881565b606091505b50509050806108d25760405162461bcd60e51b815260206004820152601c60248201527f4272696467653a204661696c656420746f2073656e6420636f696e730000000060448201526064016103f5565b5050610a04565b6000816060015160028111156108f1576108f1612def565b036109555760405162461bcd60e51b815260206004820152602e60248201527f4272696467653a20576974686472617754797065206d757374206e6f7420626560448201526d20657175616c20746f204e6f6e6560901b60648201526084016103f5565b60028160600151600281111561096d5761096d612def565b036109e55760a0810151604080516340c10f1960e01b81526001600160a01b036080890135811660048301529188013560248201529116906340c10f1990604401600060405180830381600087803b1580156109c857600080fd5b505af11580156109dc573d6000803e3d6000fd5b50505050610a04565b610a048160c001518260a00151876080013560001c8860400135611961565b8060a00151856080013586606001357fa8faf70e37416f5ce81c94de38462015f44afaf1da26125aa52b054820f84640846080015189600001358a6040013587600001518860200151604051610a7c959493929190948552602085019390935260408401919091526060830152608082015260a00190565b60405180910390a4505050506104fc600160fb55565b6001600160a01b037f00000000000000000000000022c1663b0bcfe6688eef4cecc2be88525ad957d9163003610ada5760405162461bcd60e51b81526004016103f590612d20565b7f00000000000000000000000022c1663b0bcfe6688eef4cecc2be88525ad957d96001600160a01b0316610b236000805160206130d4833981519152546001600160a01b031690565b6001600160a01b031614610b495760405162461bcd60e51b81526004016103f590612d6c565b610b5282611a26565b610b5e82826001611a2e565b5050565b6000306001600160a01b037f00000000000000000000000022c1663b0bcfe6688eef4cecc2be88525ad957d91614610c025760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016103f5565b506000805160206130d483398151915290565b610c1d6118ae565b610c25611907565b806020013560008111610c4a5760405162461bcd60e51b81526004016103f590612be8565b610c576020830183612a65565b6001600160a01b038116610c7d5760405162461bcd60e51b81526004016103f590612c18565b600061012d5447610c8e9190612e64565b90508360200135811015610cb45760405162461bcd60e51b81526004016103f590612e77565b6000610cc36020860186612a65565b6001600160a01b0316856020013560405160006040518083038185875af1925050503d8060008114610d11576040519150601f19603f3d011682016040523d82523d6000602084013e610d16565b606091505b5050905080610d675760405162461bcd60e51b815260206004820152601c60248201527f4272696467653a204661696c656420746f2073656e6420636f696e730000000060448201526064016103f5565b60208501803590610d789087612a65565b6001600160a01b03167f568032ae4578d65f7663bc34787597f6aec1c6d90135e2eb187f5e1cebf6e6c660405160405180910390a3505050506104fc600160fb55565b610dc3611907565b610dcd6000611caf565b565b60c95433906001600160a01b03168114610e3d5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084016103f5565b6104fc81611caf565b600054610100900460ff1615808015610e665750600054600160ff909116105b80610e805750303b158015610e80575060005460ff166001145b610ee35760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103f5565b6000805460ff191660011790558015610f06576000805461ff0019166101001790555b610f136020830183612a65565b6001600160a01b038116610f395760405162461bcd60e51b81526004016103f590612c18565b610f41611cc8565b610f49611cef565b610f51611d1e565b610f6e610f616020850185612a65565b63f4bcc14d60e01b611a01565b610f8a5760405162461bcd60e51b81526004016103f590612cd4565b610f976020840184612a65565b61012e80546001600160a01b0319166001600160a01b0392909216919091179055508015610b5e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b61100a611907565b346000811161102b5760405162461bcd60e51b81526004016103f590612be8565b604051349033907fa56aed091f8d10bafc9d812a245d3748a61cd543e528fed0a92fad8cadf8f72b90600090a350565b6110636118ae565b61106b611907565b61012d546000811161108f5760405162461bcd60e51b81526004016103f590612be8565b61012d544710156111085760405162461bcd60e51b815260206004820152603d60248201527f4272696467653a20436f696e732062616c616e6365206d75737420626520677260448201527f6561746572206f7220657175616c20676173416363756d756c6174656400000060648201526084016103f5565b61012d8054600091829055906111266097546001600160a01b031690565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114611170576040519150601f19603f3d011682016040523d82523d6000602084013e611175565b606091505b50509050806111d85760405162461bcd60e51b815260206004820152602960248201527f4272696467653a2047617320616363756d756c61746564207769746864726177604482015268185b0819985a5b195960ba1b60648201526084016103f5565b816111eb6097546001600160a01b031690565b6001600160a01b03167fec3b80c9664bec961294048161f6ee2f5801192a9abb2d056ac1bd79b50810f960405160405180910390a3505050610dcd600160fb55565b6112356118ae565b6040810135806112575760405162461bcd60e51b81526004016103f590612c5e565b6020820135806112795760405162461bcd60e51b81526004016103f590612be8565b60006112858435611b9e565b90508060e001516112a85760405162461bcd60e51b81526004016103f590612db8565b6000816060015160028111156112c0576112c0612def565b146113205760405162461bcd60e51b815260206004820152602a60248201527f4272696467653a20576974686472617754797065206d75737420626520657175604482015269616c20746f204e6f6e6560b01b60648201526084016103f5565b610100810151602085013590600090156113bb57813410156113aa5760405162461bcd60e51b815260206004820152603a60248201527f4272696467653a20546865206d73672e76616c7565206d75737420626520677260448201527f6561746572207468616e206f7220657175616c20616d6f756e7400000000000060648201526084016103f5565b6113b48234612e64565b90506113be565b50345b60006113cb878584611d4d565b600081815261012f60205260409020805460ff1916600117905561012d549091506113f7908390612ed4565b61012d55610100840151600090156114875760018560400151600281111561142157611421612def565b146114805760405162461bcd60e51b815260206004820152602960248201527f4272696467653a204465706f73697454797065206d75737420626520657175616044820152686c20746f204c6f636b60b81b60648201526084016103f5565b50826115c6565b60008560400151600281111561149f5761149f612def565b036115025760405162461bcd60e51b815260206004820152602d60248201527f4272696467653a204465706f73697454797065206d757374206e6f742062652060448201526c657175616c20746f204e6f6e6560981b60648201526084016103f5565b60006115118660800151611f0c565b90506115288660c001518760800151333089611f77565b60006115378760800151611f0c565b90506115438282612e64565b925060028760400151600281111561155d5761155d612def565b036115c3576080870151604051630852cd8d60e31b8152600481018590526001600160a01b03909116906342966c6890602401600060405180830381600087803b1580156115aa57600080fd5b505af11580156115be573d6000803e3d6000fd5b505050505b50505b608085015160a08601518651602088015160408051908d01359333937f22a290c1de94bc5f142308739aef5c8830b9bb5f23baa20e92968f2a384dd95e93611627938992919093845260208401929092526040830152606082015260800190565b60405180910390a4505050505050506104fc600160fb55565b6116486118ae565b611650611907565b80600081116116715760405162461bcd60e51b81526004016103f590612be8565b600061167c84611b9e565b90508060e0015161169f5760405162461bcd60e51b81526004016103f590612db8565b8061010001511561170a5760405162461bcd60e51b815260206004820152602f60248201527f4272696467653a204465706f73697420616c6c6f776564206f6e6c7920666f7260448201526e20746f6b656e206d617070696e677360881b60648201526084016103f5565b60008160400151600281111561172257611722612def565b1461173f5760405162461bcd60e51b81526004016103f590612e05565b60a08101516117aa5760405162461bcd60e51b815260206004820152603160248201527f4272696467653a20546172676574546f6b656e41646472657373206d757374206044820152706265206e6f7420657175616c207a65726f60781b60648201526084016103f5565b60006117b98260a00151611f0c565b90506117d08260c001518360a00151333088611f77565b60006117df8360a00151611f0c565b905060006117ed8383612e64565b60a085015160405191925082916001600160a01b039091169033907fcbc4a4091b012bb1329c38bbbb15455f5cac5aa3673da0a7f38cd61a4f49551790600090a45050505050610b5e600160fb55565b611845611907565b60c980546001600160a01b0383166001600160a01b031990911681179091556118766097546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600260fb54036119005760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103f5565b600260fb55565b6097546001600160a01b03163314610dcd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103f5565b83156119e05760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156119b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119da9190612ee7565b506119f4565b6119f46001600160a01b038416838361201a565b50505050565b600160fb55565b6000611a0c8361207d565b8015611a1d5750611a1d83836120b0565b90505b92915050565b6104fc611907565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611a6657611a6183612139565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611ac0575060408051601f3d908101601f19168201909252611abd91810190612f04565b60015b611b235760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016103f5565b6000805160206130d48339815191528114611b925760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016103f5565b50611a618383836121d5565b611ba66129d1565b61012e546040516313b1720d60e21b815260048101849052600091829182918291829182918291829182916001600160a01b031690634ec5c8349060240161012060405180830381865afa158015611c02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c269190612f2a565b9850985098509850985098509850985098506040518061012001604052808a8152602001898152602001886002811115611c6257611c62612def565b8152602001876002811115611c7957611c79612def565b815260208101969096526040860194909452911515606085015215156080840152151560a0909201919091529695505050505050565b60c980546001600160a01b03191690556104fc816121fa565b600054610100900460ff16610dcd5760405162461bcd60e51b81526004016103f590612fc8565b600054610100900460ff16611d165760405162461bcd60e51b81526004016103f590612fc8565b610dcd61224c565b600054610100900460ff16611d455760405162461bcd60e51b81526004016103f590612fc8565b610dcd61227c565b6000611d616097546001600160a01b031690565b60a08401518451602080870151339360408a01359390928892908b01359190611d9060e08d0160c08e01613013565b6040516060998a1b6bffffffffffffffffffffffff1990811660208301529890991b909716603489015260488801959095526068870193909352608886019190915260a885015260c884015260e883015260c01b6001600160c01b03191661010882015260a08501356101108201526101300160408051601f198184030181529181528151602092830120600081815261012f90935291205490915060ff1615611e7c5760405162461bcd60e51b815260206004820152601960248201527f4272696467653a204861736820616c726561647920757365640000000000000060448201526064016103f5565b611f046040518060c001604052808381526020018660600160000135815260200186606001602001358152602001611ebc6097546001600160a01b031690565b6001600160a01b03168152602001611eda60e0880160c08901613013565b67ffffffffffffffff168152602001611efa610100880160e0890161303d565b60ff1690526122a3565b509392505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015611f53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a209190612f04565b8415611ffe576040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390528516906323b872dd906064016020604051808303816000875af1158015611fd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ff89190612ee7565b50612013565b6120136001600160a01b038516848484612436565b5050505050565b6040516001600160a01b038316602482015260448101829052611a6190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261246e565b6000612090826301ffc9a760e01b6120b0565b8015611a2057506120a9826001600160e01b03196120b0565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d91506000519050828015612122575060208210155b801561212e5750600081115b979650505050505050565b6001600160a01b0381163b6121a65760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016103f5565b6000805160206130d483398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6121de83612543565b6000825111806121eb5750805b15611a61576119f48383612583565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166122735760405162461bcd60e51b81526004016103f590612fc8565b610dcd33611caf565b600054610100900460ff166119fa5760405162461bcd60e51b81526004016103f590612fc8565b60608101516000906001600160a01b0381166123155760405162461bcd60e51b815260206004820152602b60248201527f4543445341436865636b733a2041646472657373206d757374206265206e6f7460448201526a20657175616c207a65726f60a81b60648201526084016103f5565b42836080015167ffffffffffffffff1610156123735760405162461bcd60e51b815260206004820152601e60248201527f4543445341436865636b733a205369676e61747572652045787069726564000060448201526064016103f5565b82517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c812060a0850151602086015160408701519293926123c492859290916125a8565b905084606001516001600160a01b0316816001600160a01b03161461242b5760405162461bcd60e51b815260206004820152601e60248201527f4543445341436865636b733a20696e76616c6964207369676e6174757265000060448201526064016103f5565b506001949350505050565b6040516001600160a01b03808516602483015283166044820152606481018290526119f49085906323b872dd60e01b90608401612046565b60006124c3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166125d29092919063ffffffff16565b90508051600014806124e45750808060200190518101906124e49190612ee7565b611a615760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103f5565b61254c81612139565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060611a1d83836040518060600160405280602781526020016130f4602791396125e1565b60008060006125b987878787612659565b915091506125c68161271d565b5090505b949350505050565b60606125ca8484600085612867565b6060600080856001600160a01b0316856040516125fe9190613084565b600060405180830381855af49150503d8060008114612639576040519150601f19603f3d011682016040523d82523d6000602084013e61263e565b606091505b509150915061264f86838387612933565b9695505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156126905750600090506003612714565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156126e4573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661270d57600060019250925050612714565b9150600090505b94509492505050565b600081600481111561273157612731612def565b036127395750565b600181600481111561274d5761274d612def565b0361279a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016103f5565b60028160048111156127ae576127ae612def565b036127fb5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016103f5565b600381600481111561280f5761280f612def565b036104fc5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016103f5565b6060824710156128c85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103f5565b600080866001600160a01b031685876040516128e49190613084565b60006040518083038185875af1925050503d8060008114612921576040519150601f19603f3d011682016040523d82523d6000602084013e612926565b606091505b509150915061212e878383875b606083156129a257825160000361299b576001600160a01b0385163b61299b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103f5565b50816125ca565b6125ca83838151156129b75781518083602001fd5b8060405162461bcd60e51b81526004016103f591906130a0565b6040518061012001604052806000815260200160008152602001600060028111156129fe576129fe612def565b81526020016000815260006020820181905260408201819052606082018190526080820181905260a09091015290565b60006080828403128015612a4157600080fd5b509092915050565b80356001600160a01b0381168114612a6057600080fd5b919050565b600060208284031215612a7757600080fd5b611a1d82612a49565b600060a0828403128015612a4157600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060408385031215612abc57600080fd5b612ac583612a49565b9150602083013567ffffffffffffffff811115612ae157600080fd5b8301601f81018513612af257600080fd5b803567ffffffffffffffff811115612b0c57612b0c612a93565b604051601f8201601f19908116603f0116810167ffffffffffffffff81118282101715612b3b57612b3b612a93565b604052818152828201602001871015612b5357600080fd5b816020840160208301376000602083830101528093505050509250929050565b60006040828403128015612a4157600080fd5b60006020828403128015612a4157600080fd5b600060208284031215612bab57600080fd5b5035919050565b6000610100828403128015612a4157600080fd5b60008060408385031215612bd957600080fd5b50508035926020909101359150565b6020808252601690820152754272696467653a2043616e6e6f74206265207a65726f60501b604082015260600190565b60208082526026908201527f4272696467653a2041646472657373206d757374206265206e6f7420657175616040820152656c207a65726f60d01b606082015260800190565b60208082526024908201527f4272696467653a204279746573206d757374206265206e6f7420657175616c206040820152637a65726f60e01b606082015260800190565b80151581146104fc57600080fd5b600060208284031215612cc257600080fd5b8135612ccd81612ca2565b9392505050565b6020808252602c908201527f4272696467653a204e6577206164647265737320646f6573206e6f742073757060408201526b3837b93a1024a6b0b83832b960a11b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252601e908201527f4272696467653a204973416c6c6f776564206d75737420626520747275650000604082015260600190565b634e487b7160e01b600052602160045260246000fd5b60208082526029908201527f4272696467653a204465706f73697454797065206d75737420626520657175616040820152686c20746f204e6f6e6560b81b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b81810381811115611a2057611a20612e4e565b6020808252603e908201527f4272696467653a20436f6e747261637420636f696e732062616c616e6365206d60408201527f7573742062652067726561746572206f7220657175616c20616d6f756e740000606082015260800190565b80820180821115611a2057611a20612e4e565b600060208284031215612ef957600080fd5b8151612ccd81612ca2565b600060208284031215612f1657600080fd5b5051919050565b600381106104fc57600080fd5b60008060008060008060008060006101208a8c031215612f4957600080fd5b895160208b015160408c0151919a509850612f6381612f1d565b60608b0151909750612f7481612f1d565b60808b015160a08c015160c08d01519298509096509450612f9481612ca2565b60e08b0151909350612fa581612ca2565b6101008b0151909250612fb781612ca2565b809150509295985092959850929598565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006020828403121561302557600080fd5b813567ffffffffffffffff81168114612ccd57600080fd5b60006020828403121561304f57600080fd5b813560ff81168114612ccd57600080fd5b60005b8381101561307b578181015183820152602001613063565b50506000910152565b60008251613096818460208701613060565b9190910192915050565b60208152600082518060208401526130bf816040850160208701613060565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122078ae8e06eb6fed3dbcdf34810c2b3050a579363762c7393fceea433dda0aabd864736f6c634300081e0033
Deployed Bytecode Sourcemap
1318:20983:32:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3877:58;;3923:9;;3903:10;;3877:58;;;;;1318:20983;;;;;2112:21;;;;;;;;;;-1:-1:-1;2112:21:32;;;;-1:-1:-1;;;;;2112:21:32;;;;;;-1:-1:-1;;;;;194:32:35;;;176:51;;164:2;149:18;2112:21:32;;;;;;;;11154:1008;;;;;;;;;;-1:-1:-1;11154:1008:32;;;;;:::i;:::-;;:::i;:::-;;15506:584;;;;;;;;;;-1:-1:-1;15506:584:32;;;;;:::i;:::-;;:::i;3408:195:7:-;;;;;;;;;;-1:-1:-1;3408:195:7;;;;;:::i;:::-;;:::i;7732:2635:32:-;;;;;;;;;;-1:-1:-1;7732:2635:32;;;;;:::i;:::-;;:::i;1920:29::-;;;;;;;;;;;;;;;;;;;1258:25:35;;;1246:2;1231:18;1920:29:32;1112:177:35;3922:220:7;;;;;;:::i;:::-;;:::i;3027:131::-;;;;;;;;;;;;;:::i;12321:943:32:-;;;;;;;;;;-1:-1:-1;12321:943:32;;;;;:::i;:::-;;:::i;2085:101:1:-;;;;;;;;;;;;;:::i;2031:212:0:-;;;;;;;;;;;;;:::i;1462:85:1:-;;;;;;;;;;-1:-1:-1;1534:6:1;;-1:-1:-1;;;;;1534:6:1;1462:85;;4162:528:32;;;;;;;;;;-1:-1:-1;4162:528:32;;;;;:::i;:::-;;:::i;2360:54::-;;;;;;;;;;-1:-1:-1;2360:54:32;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3682:14:35;;3675:22;3657:41;;3645:2;3630:18;2360:54:32;3517:187:35;15085:157:32;;;:::i;10442:550::-;;;;;;;;;;;;;:::i;4822:2775::-;;;;;;:::i;:::-;;:::i;1144:99:0:-;;;;;;;;;;-1:-1:-1;1223:13:0;;-1:-1:-1;;;;;1223:13:0;1144:99;;13614:1291:32;;;;;;;;;;-1:-1:-1;13614:1291:32;;;;;:::i;:::-;;:::i;1436:178:0:-;;;;;;;;;;-1:-1:-1;1436:178:0;;;;;:::i;:::-;;:::i;11154:1008:32:-;2526:21:8;:19;:21::i;:::-;1355:13:1::1;:11;:13::i;:::-;11347:28:32::2;:35;;;3310:1;3304:3;:7;3296:42;;;;-1:-1:-1::0;;;3296:42:32::2;;;;;;;:::i;:::-;;;;;;;;;11407:45:::3;::::0;;;::::3;::::0;::::3;;:::i;:::-;-1:-1:-1::0;;;;;2747:18:32;::::3;2739:69;;;;-1:-1:-1::0;;;2739:69:32::3;;;;;;;:::i;:::-;11477:41:::0;::::4;::::0;3027:69:::4;;;;-1:-1:-1::0;;;3027:69:32::4;;;;;;;:::i;:::-;11534:289:::5;11583:40;::::0;;;::::5;::::0;::::5;;:::i;:::-;11651:41:::0;::::5;11710:45;::::0;;;::::5;::::0;::::5;;:::i;:::-;11777:28;:35;;;11534:21;:289::i;:::-;12042:35;::::0;::::5;::::0;::::5;::::0;-1:-1:-1;;;;;11976:41:32;::::5;11839:316;::::0;11886:45:::5;::::0;::::5;::::0;::::5;;:::i;:::-;-1:-1:-1::0;;;;;11839:316:32::5;;12104:40;::::0;;;::::5;::::0;::::5;;:::i;:::-;11839:316;::::0;3682:14:35;;3675:22;3657:41;;3645:2;3630:18;11839:316:32::5;;;;;;;2818:1:::4;3348::::3;1378::1::2;2568:20:8::0;1808:1;3074:7;:22;2894:209;2568:20;11154:1008:32;:::o;15506:584::-;1355:13:1;:11;:13::i;:::-;15596:17:32;-1:-1:-1;;;;;2747:18:32;::::1;2739:69;;;;-1:-1:-1::0;;;2739:69:32::1;;;;;;;:::i;:::-;15646:103:::2;15689:17;-1:-1:-1::0;;;15646:31:32::2;:103::i;:::-;15625:194;;;;-1:-1:-1::0;;;15625:194:32::2;;;;;;;:::i;:::-;15865:6;::::0;;-1:-1:-1;;;;;15882:35:32;;::::2;-1:-1:-1::0;;;;;;15882:35:32;::::2;::::0;::::2;::::0;;;15932:151:::2;::::0;15865:6;::::2;::::0;15882:35;15865:6;;15976:10:::2;::::0;15932:151:::2;::::0;15829:25:::2;::::0;15932:151:::2;15615:475;1378:1:1::1;15506:584:32::0;:::o;3408:195:7:-;-1:-1:-1;;;;;1764:6:7;1747:23;1755:4;1747:23;1739:80;;;;-1:-1:-1;;;1739:80:7;;;;;;;:::i;:::-;1861:6;-1:-1:-1;;;;;1837:30:7;:20;-1:-1:-1;;;;;;;;;;;1557:65:4;-1:-1:-1;;;;;1557:65:4;;1478:151;1837:20:7;-1:-1:-1;;;;;1837:30:7;;1829:87;;;;-1:-1:-1;;;1829:87:7;;;;;;;:::i;:::-;3489:36:::1;3507:17;3489;:36::i;:::-;3576:12;::::0;;3586:1:::1;3576:12:::0;;;::::1;::::0;::::1;::::0;;;3535:61:::1;::::0;3557:17;;3576:12;3535:21:::1;:61::i;7732:2635:32:-:0;2526:21:8;:19;:21::i;:::-;1355:13:1::1;:11;:13::i;:::-;7898:31:32::2;::::0;::::2;;::::0;3027:69:::2;;;;-1:-1:-1::0;;;3027:69:32::2;;;;;;;:::i;:::-;7954:29:::3;::::0;::::3;;::::0;3027:69:::3;;;;-1:-1:-1::0;;;3027:69:32::3;;;;;;;:::i;:::-;8008:19:::4;:26;;;3310:1;3304:3;:7;3296:42;;;;-1:-1:-1::0;;;3296:42:32::4;;;;;;;:::i;:::-;8050:31:::5;8084:49;8105:19;:25;;;8084:11;:49::i;:::-;8050:83;;8152:8;:18;;;8144:61;;;;-1:-1:-1::0;;;8144:61:32::5;;;;;;;:::i;:::-;8247:24;8223:8;:20;;;:48;;;;;;;;:::i;:::-;;8215:102;;;;-1:-1:-1::0;;;8215:102:32::5;;;;;;;:::i;:::-;8332:8;:15;;;8328:1555;;;8413:27;8388:8;:21;;;:52;;;;;;;;:::i;:::-;;8363:155;;;::::0;-1:-1:-1;;;8363:155:32;;8181:2:35;8363:155:32::5;::::0;::::5;8163:21:35::0;8220:2;8200:18;;;8193:30;8259:34;8239:18;;;8232:62;-1:-1:-1;;;8310:18:35;;;8303:42;8362:19;;8363:155:32::5;7979:408:35::0;8363:155:32::5;8532:24;8583:14;;8559:21;:38;;;;:::i;:::-;8532:65;;8656:19;:26;;;8636:16;:46;;8611:167;;;;-1:-1:-1::0;;;8611:167:32::5;;;;;;;:::i;:::-;8907:26;8812:139:::0;;8794:12:::5;::::0;-1:-1:-1;;;;;8844:29:32::5;::::0;::::5;;8812:70;::::0;8907:26;;::::5;;::::0;8794:12;8812:139;8794:12;8812:139;8907:26;8812:70;:139:::5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8793:158;;;8974:7;8966:48;;;::::0;-1:-1:-1;;;8966:48:32;;9500:2:35;8966:48:32::5;::::0;::::5;9482:21:35::0;9539:2;9519:18;;;9512:30;9578;9558:18;;;9551:58;9626:18;;8966:48:32::5;9298:352:35::0;8966:48:32::5;8349:676;;8328:1555;;;9095:25;9070:8;:21;;;:50;;;;;;;;:::i;:::-;::::0;9045:155:::5;;;::::0;-1:-1:-1;;;9045:155:32;;9857:2:35;9045:155:32::5;::::0;::::5;9839:21:35::0;9896:2;9876:18;;;9869:30;9935:34;9915:18;;;9908:62;-1:-1:-1;;;9986:18:35;;;9979:44;10040:19;;9045:155:32::5;9655:410:35::0;9045:155:32::5;9244:25;9219:8;:21;;;:50;;;;;;;;:::i;:::-;::::0;9215:658:::5;;9328:27;::::0;::::5;::::0;9477:26:::5;9289:233:::0;;-1:-1:-1;;;9289:233:32;;-1:-1:-1;;;;;9415:29:32::5;::::0;::::5;;10262:32:35::0;;9289:233:32::5;::::0;::::5;10244:51:35::0;9477:26:32;;::::5;;10311:18:35::0;;;10304:34;9289:75:32;::::5;::::0;::::5;::::0;10217:18:35;;9289:233:32::5;;;;;;;;;;;;;;;;;::::0;::::5;;;;;;;;;;;;::::0;::::5;;;;;;;;;9215:658;;;9561:297;9618:8;:20;;;9674:8;:27;;;9751:19;:29;;;9743:38;;9813:19;:26;;;9561:21;:297::i;:::-;10055:8;:27;;;9992:19;:29;;;9936:19;:31;;;9898:462;10116:8;:27;;;10169:19;:30;;;10221:19;:26;;;10276:8;:22;;;10327:8;:22;;;9898:462;;;;;;;;;10608:25:35::0;;;10664:2;10649:18;;10642:34;;;;10707:2;10692:18;;10685:34;;;;10750:2;10735:18;;10728:34;10793:3;10778:19;;10771:35;10595:3;10580:19;;10349:463;9898:462:32::5;;;;;;;;8040:2327;3106:1:::4;::::3;1378::1::2;2568:20:8::0;1808:1;3074:7;:22;2894:209;3922:220:7;-1:-1:-1;;;;;1764:6:7;1747:23;1755:4;1747:23;1739:80;;;;-1:-1:-1;;;1739:80:7;;;;;;;:::i;:::-;1861:6;-1:-1:-1;;;;;1837:30:7;:20;-1:-1:-1;;;;;;;;;;;1557:65:4;-1:-1:-1;;;;;1557:65:4;;1478:151;1837:20:7;-1:-1:-1;;;;;1837:30:7;;1829:87;;;;-1:-1:-1;;;1829:87:7;;;;;;;:::i;:::-;4037:36:::1;4055:17;4037;:36::i;:::-;4083:52;4105:17;4124:4;4130;4083:21;:52::i;:::-;3922:220:::0;;:::o;3027:131::-;3105:7;2190:4;-1:-1:-1;;;;;2199:6:7;2182:23;;2174:92;;;;-1:-1:-1;;;2174:92:7;;11019:2:35;2174:92:7;;;11001:21:35;11058:2;11038:18;;;11031:30;11097:34;11077:18;;;11070:62;11168:26;11148:18;;;11141:54;11212:19;;2174:92:7;10817:420:35;2174:92:7;-1:-1:-1;;;;;;;;;;;;3027:131:7;:::o;12321:943:32:-;2526:21:8;:19;:21::i;:::-;1355:13:1::1;:11;:13::i;:::-;12511:27:32::2;:34;;;3310:1;3304:3;:7;3296:42;;;;-1:-1:-1::0;;;3296:42:32::2;;;;;;;:::i;:::-;12570:44:::3;;::::0;::::3;:27:::0;:44:::3;:::i;:::-;-1:-1:-1::0;;;;;2747:18:32;::::3;2739:69;;;;-1:-1:-1::0;;;2739:69:32::3;;;;;;;:::i;:::-;12630:24:::4;12681:14;;12657:21;:38;;;;:::i;:::-;12630:65;;12746:27;:34;;;12726:16;:54;;12705:163;;;;-1:-1:-1::0;;;12705:163:32::4;;;;;;;:::i;:::-;12880:12;12906:44;;::::0;::::4;:27:::0;:44:::4;:::i;:::-;-1:-1:-1::0;;;;;12898:58:32::4;12977:27;:34;;;12898:127;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12879:146;;;13044:7;13036:48;;;::::0;-1:-1:-1;;;13036:48:32;;9500:2:35;13036:48:32::4;::::0;::::4;9482:21:35::0;9539:2;9519:18;;;9512:30;9578;9558:18;;;9551:58;9626:18;;13036:48:32::4;9298:352:35::0;13036:48:32::4;13212:34;::::0;::::4;::::0;::::4;::::0;13146:44:::4;::::0;13212:27;13146:44:::4;:::i;:::-;-1:-1:-1::0;;;;;13100:157:32::4;;;;;;;;;;;12620:644;;3348:1:::3;1378::1::2;2568:20:8::0;1808:1;3074:7;:22;2894:209;2085:101:1;1355:13;:11;:13::i;:::-;2149:30:::1;2176:1;2149:18;:30::i;:::-;2085:101::o:0;2031:212:0:-;1223:13;;965:10:16;;-1:-1:-1;;;;;1223:13:0;2130:24;;2122:78;;;;-1:-1:-1;;;2122:78:0;;11444:2:35;2122:78:0;;;11426:21:35;11483:2;11463:18;;;11456:30;11522:34;11502:18;;;11495:62;-1:-1:-1;;;11573:18:35;;;11566:39;11622:19;;2122:78:0;11242:405:35;2122:78:0;2210:26;2229:6;2210:18;:26::i;4162:528:32:-;3279:19:6;3302:13;;;;;;3301:14;;3347:34;;;;-1:-1:-1;3365:12:6;;3380:1;3365:12;;;;:16;3347:34;3346:108;;;-1:-1:-1;3426:4:6;1713:19:15;:23;;;3387:66:6;;-1:-1:-1;3436:12:6;;;;;:17;3387:66;3325:201;;;;-1:-1:-1;;;3325:201:6;;11854:2:35;3325:201:6;;;11836:21:35;11893:2;11873:18;;;11866:30;11932:34;11912:18;;;11905:62;-1:-1:-1;;;11983:18:35;;;11976:44;12037:19;;3325:201:6;11652:410:35;3325:201:6;3536:12;:16;;-1:-1:-1;;3536:16:6;3551:1;3536:16;;;3562:65;;;;3596:13;:20;;-1:-1:-1;;3596:20:6;;;;;3562:65;4250:24:32::1;;::::0;::::1;:10:::0;:24:::1;:::i;:::-;-1:-1:-1::0;;;;;2747:18:32;::::1;2739:69;;;;-1:-1:-1::0;;;2739:69:32::1;;;;;;;:::i;:::-;4286:24:::2;:22;:24::i;:::-;4320:21;:19;:21::i;:::-;4351:24;:22;:24::i;:::-;4407:154;4466:24;;::::0;::::2;:10:::0;:24:::2;:::i;:::-;-1:-1:-1::0;;;4407:31:32::2;:154::i;:::-;4386:245;;;;-1:-1:-1::0;;;4386:245:32::2;;;;;;;:::i;:::-;4658:24;;::::0;::::2;:10:::0;:24:::2;:::i;:::-;4641:6;:42:::0;;-1:-1:-1;;;;;;4641:42:32::2;-1:-1:-1::0;;;;;4641:42:32;;;::::2;::::0;;;::::2;::::0;;-1:-1:-1;3647:99:6;;;;3697:5;3681:21;;-1:-1:-1;;3681:21:6;;;3721:14;;-1:-1:-1;12219:36:35;;3721:14:6;;12207:2:35;12192:18;3721:14:6;;;;;;;3269:483;4162:528:32;:::o;15085:157::-;1355:13:1;:11;:13::i;:::-;15151:9:32::1;3310:1;3304:3;:7;3296:42;;;;-1:-1:-1::0;;;3296:42:32::1;;;;;;;:::i;:::-;15177:58:::2;::::0;15223:9:::2;::::0;15203:10:::2;::::0;15177:58:::2;::::0;;;::::2;1378:1:1::1;15085:157:32:o:0;10442:550::-;2526:21:8;:19;:21::i;:::-;1355:13:1::1;:11;:13::i;:::-;10523:14:32::2;;3310:1;3304:3;:7;3296:42;;;;-1:-1:-1::0;;;3296:42:32::2;;;;;;;:::i;:::-;10595:14:::3;;10570:21;:39;;10549:147;;;::::0;-1:-1:-1;;;10549:147:32;;12468:2:35;10549:147:32::3;::::0;::::3;12450:21:35::0;12507:2;12487:18;;;12480:30;12546:34;12526:18;;;12519:62;12617:31;12597:18;;;12590:59;12666:19;;10549:147:32::3;12266:425:35::0;10549:147:32::3;10723:14;::::0;;10706::::3;10748:18:::0;;;;10723:14;10803:7:::3;1534:6:1::0;;-1:-1:-1;;;;;1534:6:1;;1462:85;10803:7:32::3;-1:-1:-1::0;;;;;10795:21:32::3;10825:6;10795:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10776:61;;;10855:7;10847:61;;;::::0;-1:-1:-1;;;10847:61:32;;12898:2:35;10847:61:32::3;::::0;::::3;12880:21:35::0;12937:2;12917:18;;;12910:30;12976:34;12956:18;;;12949:62;-1:-1:-1;;;13027:18:35;;;13020:39;13076:19;;10847:61:32::3;12696:405:35::0;10847:61:32::3;10976:6;10959:7;1534:6:1::0;;-1:-1:-1;;;;;1534:6:1;;1462:85;10959:7:32::3;-1:-1:-1::0;;;;;10924:61:32::3;;;;;;;;;;;10539:453;;1378:1:1::2;2568:20:8::0;1808:1;3074:7;:22;2894:209;4822:2775:32;2526:21:8;:19;:21::i;:::-;4983:41:32::1;::::0;::::1;;::::0;3027:69:::1;;;;-1:-1:-1::0;;;3027:69:32::1;;;;;;;:::i;:::-;5049:38:::2;::::0;::::2;;3304:7:::0;3296:42:::2;;;;-1:-1:-1::0;;;3296:42:32::2;;;;;;;:::i;:::-;5103:31:::3;5137:61;5158:37:::0;::::3;5137:11;:61::i;:::-;5103:95;;5217:8;:18;;;5209:61;;;;-1:-1:-1::0;;;5209:61:32::3;;;;;;;:::i;:::-;5313:25;5288:8;:21;;;:50;;;;;;;;:::i;:::-;;5280:105;;;::::0;-1:-1:-1;;;5280:105:32;;13308:2:35;5280:105:32::3;::::0;::::3;13290:21:35::0;13347:2;13327:18;;;13320:30;13386:34;13366:18;;;13359:62;-1:-1:-1;;;13437:18:35;;;13430:40;13487:19;;5280:105:32::3;13106:406:35::0;5280:105:32::3;5496:15;::::0;::::3;::::0;5414:38:::3;::::0;::::3;;::::0;5396:15:::3;::::0;5492:236:::3;;;5548:7;5535:9;:20;;5527:91;;;::::0;-1:-1:-1;;;5527:91:32;;13719:2:35;5527:91:32::3;::::0;::::3;13701:21:35::0;13758:2;13738:18;;;13731:30;13797:34;13777:18;;;13770:62;13868:28;13848:18;;;13841:56;13914:19;;5527:91:32::3;13517:422:35::0;5527:91:32::3;5645:19;5657:7:::0;5645:9:::3;:19;:::i;:::-;5632:32;;5492:236;;;-1:-1:-1::0;5708:9:32::3;5492:236;5738:13;5754:144;5803:18;5844:8;5877:10;5754:14;:144::i;:::-;5909:17;::::0;;;:10:::3;:17;::::0;;;;:24;;-1:-1:-1;;5909:24:32::3;5929:4;5909:24;::::0;;5960:14:::3;::::0;5738:160;;-1:-1:-1;5960:27:32::3;::::0;5977:10;;5960:27:::3;:::i;:::-;5943:14;:44:::0;6032:15:::3;::::0;::::3;::::0;5997:20:::3;::::0;6028:1140:::3;;;6095:24;6071:8;:20;;;:48;;;;;;;;:::i;:::-;;6063:102;;;::::0;-1:-1:-1;;;6063:102:32;;14276:2:35;6063:102:32::3;::::0;::::3;14258:21:35::0;14315:2;14295:18;;;14288:30;14354:34;14334:18;;;14327:62;-1:-1:-1;;;14405:18:35;;;14398:39;14454:19;;6063:102:32::3;14074:405:35::0;6063:102:32::3;-1:-1:-1::0;6194:7:32;6028:1140:::3;;;6264:24;6240:8;:20;;;:48;;;;;;;;:::i;:::-;::::0;6232:106:::3;;;::::0;-1:-1:-1;;;6232:106:32;;14686:2:35;6232:106:32::3;::::0;::::3;14668:21:35::0;14725:2;14705:18;;;14698:30;14764:34;14744:18;;;14737:62;-1:-1:-1;;;14815:18:35;;;14808:43;14868:19;;6232:106:32::3;14484:409:35::0;6232:106:32::3;6353:21;6377:58;6405:8;:27;;;6377:11;:58::i;:::-;6353:82;;6450:253;6507:8;:20;;;6559:8;:27;;;6610:10;6650:4;6681:7;6450:25;:253::i;:::-;6718:20;6741:58;6769:8;:27;;;6741:11;:58::i;:::-;6718:81:::0;-1:-1:-1;6881:28:32::3;6896:13:::0;6718:81;6881:28:::3;:::i;:::-;6866:43:::0;-1:-1:-1;6952:24:32::3;6928:8;:20;;;:48;;;;;;;;:::i;:::-;::::0;6924:234:::3;;7045:27;::::0;::::3;::::0;6996:147:::3;::::0;-1:-1:-1;;;6996:147:32;;::::3;::::0;::::3;1258:25:35::0;;;-1:-1:-1;;;;;6996:85:32;;::::3;::::0;::::3;::::0;1231:18:35;;6996:147:32::3;;;;;;;;;;;;;;;;;::::0;::::3;;;;;;;;;;;;::::0;::::3;;;;;;;;;6924:234;6218:950;;6028:1140;7355:27;::::0;::::3;::::0;7416::::3;::::0;::::3;::::0;7506:22;;7557::::3;::::0;::::3;::::0;7280:41:::3;7183:407:::0;;7280:41;;::::3;;::::0;7242:10:::3;::::0;7183:407:::3;::::0;::::3;::::0;7465:12;;7506:22;7557;15129:25:35;;;15185:2;15170:18;;15163:34;;;;15228:2;15213:18;;15206:34;15271:2;15256:18;;15249:34;15116:3;15101:19;;14898:391;7183:407:32::3;;;;;;;;5093:2504;;;;;3106:1:::2;2557::8::1;2568:20:::0;1808:1;3074:7;:22;2894:209;13614:1291:32;2526:21:8;:19;:21::i;:::-;1355:13:1::1;:11;:13::i;:::-;13715:6:32::2;3310:1;3304:3;:7;3296:42;;;;-1:-1:-1::0;;;3296:42:32::2;;;;;;;:::i;:::-;13733:31:::3;13767:29;13788:5;13767:11;:29::i;:::-;13733:63;;13815:8;:18;;;13807:61;;;;-1:-1:-1::0;;;13807:61:32::3;;;;;;;:::i;:::-;13887:8;:15;;;13886:16;13878:76;;;::::0;-1:-1:-1;;;13878:76:32;;15496:2:35;13878:76:32::3;::::0;::::3;15478:21:35::0;15535:2;15515:18;;;15508:30;15574:34;15554:18;;;15547:62;-1:-1:-1;;;15625:18:35;;;15618:45;15680:19;;13878:76:32::3;15294:411:35::0;13878:76:32::3;13996:24;13972:8;:20;;;:48;;;;;;;;:::i;:::-;;13964:102;;;;-1:-1:-1::0;;;13964:102:32::3;;;;;;;:::i;:::-;14084:27;::::0;::::3;::::0;14076:103:::3;;;::::0;-1:-1:-1;;;14076:103:32;;15912:2:35;14076:103:32::3;::::0;::::3;15894:21:35::0;15951:2;15931:18;;;15924:30;15990:34;15970:18;;;15963:62;-1:-1:-1;;;16041:18:35;;;16034:47;16098:19;;14076:103:32::3;15710:413:35::0;14076:103:32::3;14190:21;14214:58;14242:8;:27;;;14214:11;:58::i;:::-;14190:82;;14283:228;14336:8;:20;;;14384:8;:27;;;14431:10;14467:4;14494:6;14283:25;:228::i;:::-;14522:20;14545:58;14573:8;:27;;;14545:11;:58::i;:::-;14522:81:::0;-1:-1:-1;14662:20:32::3;14685:28;14700:13:::0;14522:81;14685:28:::3;:::i;:::-;14823:27;::::0;::::3;::::0;14729:169:::3;::::0;14662:51;;-1:-1:-1;14662:51:32;;-1:-1:-1;;;;;14729:169:32;;::::3;::::0;14768:10:::3;::::0;14729:169:::3;::::0;14815:36:::3;::::0;14729:169:::3;13723:1182;;;;1378:1:1::2;2568:20:8::0;1808:1;3074:7;:22;2894:209;1436:178:0;1355:13:1;:11;:13::i;:::-;1525::0::1;:24:::0;;-1:-1:-1;;;;;1525:24:0;::::1;-1:-1:-1::0;;;;;;1525:24:0;;::::1;::::0;::::1;::::0;;;1589:7:::1;1534:6:1::0;;-1:-1:-1;;;;;1534:6:1;;1462:85;1589:7:0::1;-1:-1:-1::0;;;;;1564:43:0::1;;;;;;;;;;;1436:178:::0;:::o;2601:287:8:-;1851:1;2733:7;;:19;2725:63;;;;-1:-1:-1;;;2725:63:8;;16330:2:35;2725:63:8;;;16312:21:35;16369:2;16349:18;;;16342:30;16408:33;16388:18;;;16381:61;16459:18;;2725:63:8;16128:355:35;2725:63:8;1851:1;2863:7;:18;2601:287::o;1620:130:1:-;1534:6;;-1:-1:-1;;;;;1534:6:1;965:10:16;1683:23:1;1675:68;;;;-1:-1:-1;;;1675:68:1;;16690:2:35;1675:68:1;;;16672:21:35;;;16709:18;;;16702:30;16768:34;16748:18;;;16741:62;16820:18;;1675:68:1;16488:356:35;17021:389:32;17142:11;17138:266;;;17169:95;;-1:-1:-1;;;17169:95:32;;-1:-1:-1;;;;;10262:32:35;;;17169:95:32;;;10244:51:35;10311:18;;;10304:34;;;17169:67:32;;;;;10217:18:35;;17169:95:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;17138:266;;;17295:98;-1:-1:-1;;;;;17295:71:32;;17373:2;17384:6;17295:71;:98::i;:::-;17021:389;;;;:::o;2894:209:8:-;1808:1;3074:7;:22;2894:209::o;1349:282:28:-;1436:4;1543:23;1558:7;1543:14;:23::i;:::-;:81;;;;;1570:54;1603:7;1612:11;1570:32;:54::i;:::-;1536:88;;1349:282;;;;;:::o;16397:101:32:-;1355:13:1;:11;:13::i;2841:944:4:-;839:66;3257:59;;;3253:526;;;3332:37;3351:17;3332:18;:37::i;:::-;2841:944;;;:::o;3253:526::-;3433:17;-1:-1:-1;;;;;3404:61:4;;:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3404:63:4;;;;;;;;-1:-1:-1;;3404:63:4;;;;;;;;;;;;:::i;:::-;;;3400:302;;3631:56;;-1:-1:-1;;;3631:56:4;;17536:2:35;3631:56:4;;;17518:21:35;17575:2;17555:18;;;17548:30;17614:34;17594:18;;;17587:62;-1:-1:-1;;;17665:18:35;;;17658:44;17719:19;;3631:56:4;17334:410:35;3400:302:4;-1:-1:-1;;;;;;;;;;;3517:28:4;;3509:82;;;;-1:-1:-1;;;3509:82:4;;17951:2:35;3509:82:4;;;17933:21:35;17990:2;17970:18;;;17963:30;18029:34;18009:18;;;18002:62;-1:-1:-1;;;18080:18:35;;;18073:39;18129:19;;3509:82:4;17749:405:35;3509:82:4;3468:138;3715:53;3733:17;3752:4;3758:9;3715:17;:53::i;18839:926:32:-;18897:27;;:::i;:::-;19274:6;;:21;;-1:-1:-1;;;19274:21:32;;;;;1258:25:35;;;18950:21:32;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;19274:6:32;;:14;;1231:18:35;;19274:21:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;18936:359;;;;;;;;;;;;;;;;;;19325:433;;;;;;;;19374:13;19325:433;;;;19420:13;19325:433;;;;19464:11;19325:433;;;;;;;;:::i;:::-;;;;;19507:12;19325:433;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19306:452;18839:926;-1:-1:-1;;;;;;18839:926:32:o;1798:153:0:-;1887:13;1880:20;;-1:-1:-1;;;;;;1880:20:0;;;1910:34;1935:8;1910:24;:34::i;2290:67:7:-;5374:13:6;;;;;;;5366:69;;;;-1:-1:-1;;;5366:69:6;;;;;;;:::i;889:100:0:-;5374:13:6;;;;;;;5366:69;;;;-1:-1:-1;;;5366:69:6;;;;;;;:::i;:::-;956:26:0::1;:24;:26::i;1889:111:8:-:0;5374:13:6;;;;;;;5366:69;;;;-1:-1:-1;;;5366:69:6;;;;;;;:::i;:::-;1959:34:8::1;:32;:34::i;21021:1278:32:-:0;21196:12;21351:7;1534:6:1;;-1:-1:-1;;;;;1534:6:1;;1462:85;21351:7:32;21463:26;;;;21590:21;;21534:38;21629:21;;;;21376:10;;21404:41;;;;;21463:26;;21507:9;;21534:38;;;;;21590:21;21668:39;;;;;;;;:::i;:::-;21725:35;21317:457;20657:2:35;20653:15;;;-1:-1:-1;;20649:53:35;;;21317:457:32;;;20637:66:35;20737:15;;;;20733:53;;;20719:12;;;20712:75;20803:12;;;20796:28;;;;20840:12;;;20833:28;;;;20877:13;;;20870:29;;;;20915:13;;;20908:29;20953:13;;;20946:29;20991:13;;;20984:29;21070:3;21048:16;-1:-1:-1;;;;;;21044:51:35;21029:13;;;21022:74;21725:35:32;;;;21112:13:35;;;21105:29;21150:13;;21317:457:32;;;-1:-1:-1;;21317:457:32;;;;;;;;;21294:490;;21317:457;21294:490;;;;21804:16;;;;:10;:16;;;;;;21294:490;;-1:-1:-1;21804:16:32;;21803:17;21795:55;;;;-1:-1:-1;;;21795:55:32;;21376:2:35;21795:55:32;;;21358:21:35;21415:2;21395:18;;;21388:30;21454:27;21434:18;;;21427:55;21499:18;;21795:55:32;21174:349:35;21795:55:32;21893:377;21927:333;;;;;;;;21975:4;21927:333;;;;22000:18;:30;;:32;;;21927:333;;;;22053:18;:30;;:32;;;21927:333;;;;22118:7;1534:6:1;;-1:-1:-1;;;;;1534:6:1;;1462:85;22118:7:32;-1:-1:-1;;;;;21927:333:32;;;;;22153:39;;;;;;;;:::i;:::-;21927:333;;;;;;22213:32;;;;;;;;:::i;:::-;21927:333;;;;21893:20;:377::i;:::-;;21021:1278;;;;;:::o;20149:202::-;20248:96;;-1:-1:-1;;;20248:96:32;;20336:4;20248:96;;;176:51:35;20214:15:32;;-1:-1:-1;;;;;20248:68:32;;;;;149:18:35;;20248:96:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;18007:605::-;18192:11;18188:418;;;18219:171;;-1:-1:-1;;;18219:171:32;;-1:-1:-1;;;;;22257:32:35;;;18219:171:32;;;22239:51:35;22326:32;;;22306:18;;;22299:60;22375:18;;;22368:34;;;18219:71:32;;;;;22212:18:35;;18219:171:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;18188:418;;;18421:174;-1:-1:-1;;;;;18421:75:32;;18521:4;18547:2;18574:6;18421:75;:174::i;:::-;18007:605;;;;;:::o;996:186:14:-;1116:58;;-1:-1:-1;;;;;10262:32:35;;1116:58:14;;;10244:51:35;10311:18;;;10304:34;;;1089:86:14;;1109:5;;-1:-1:-1;;;1139:23:14;10217:18:35;;1116:58:14;;;;-1:-1:-1;;1116:58:14;;;;;;;;;;;;;;-1:-1:-1;;;;;1116:58:14;-1:-1:-1;;;;;;1116:58:14;;;;;;;;;;1089:19;:86::i;704:427:28:-;768:4;975:68;1008:7;-1:-1:-1;;;975:32:28;:68::i;:::-;:149;;;;-1:-1:-1;1060:64:28;1093:7;-1:-1:-1;;;;;;1060:32:28;:64::i;:::-;1059:65;956:168;704:427;-1:-1:-1;;704:427:28:o;4421:647::-;4592:71;;;-1:-1:-1;;;;;;22575:33:35;;4592:71:28;;;;22557:52:35;;;;4592:71:28;;;;;;;;;;22530:18:35;;;;4592:71:28;;;;;;;;;-1:-1:-1;;;;;4592:71:28;-1:-1:-1;;;4592:71:28;;;4871:20;;4523:4;;4592:71;4523:4;;;;;;4592:71;4523:4;;4871:20;4836:7;4829:5;4818:86;4807:97;;4931:16;4917:30;;4981:4;4975:11;4960:26;;5013:7;:29;;;;;5038:4;5024:10;:18;;5013:29;:48;;;;;5060:1;5046:11;:15;5013:48;5006:55;4421:647;-1:-1:-1;;;;;;;4421:647:28:o;1720:281:4:-;-1:-1:-1;;;;;1713:19:15;;;1793:106:4;;;;-1:-1:-1;;;1793:106:4;;22822:2:35;1793:106:4;;;22804:21:35;22861:2;22841:18;;;22834:30;22900:34;22880:18;;;22873:62;-1:-1:-1;;;22951:18:35;;;22944:43;23004:19;;1793:106:4;22620:409:35;1793:106:4;-1:-1:-1;;;;;;;;;;;1909:85:4;;-1:-1:-1;;;;;;1909:85:4;-1:-1:-1;;;;;1909:85:4;;;;;;;;;;1720:281::o;2393:276::-;2501:29;2512:17;2501:10;:29::i;:::-;2558:1;2544:4;:11;:15;:28;;;;2563:9;2544:28;2540:123;;;2588:64;2628:17;2647:4;2588:39;:64::i;2687:187:1:-;2779:6;;;-1:-1:-1;;;;;2795:17:1;;;-1:-1:-1;;;;;;2795:17:1;;;;;;;2827:40;;2779:6;;;2795:17;2779:6;;2827:40;;2760:16;;2827:40;2750:124;2687:187;:::o;1125:111::-;5374:13:6;;;;;;;5366:69;;;;-1:-1:-1;;;5366:69:6;;;;;;;:::i;:::-;1197:32:1::1;965:10:16::0;1197:18:1::1;:32::i;2006:109:8:-:0;5374:13:6;;;;;;;5366:69;;;;-1:-1:-1;;;5366:69:6;;;;;;;:::i;1993:695:31:-;2087:26;;;;2124:12;;-1:-1:-1;;;;;1536:19:31;;1528:75;;;;-1:-1:-1;;;1528:75:31;;23236:2:35;1528:75:31;;;23218:21:35;23275:2;23255:18;;;23248:30;23314:34;23294:18;;;23287:62;-1:-1:-1;;;23365:18:35;;;23358:41;23416:19;;1528:75:31;23034:407:35;1528:75:31;2181:15:::1;2156:12;:21;;;:40;;;;2148:83;;;::::0;-1:-1:-1;;;2148:83:31;;23648:2:35;2148:83:31::1;::::0;::::1;23630:21:35::0;23687:2;23667:18;;;23660:30;23726:32;23706:18;;;23699:60;23776:18;;2148:83:31::1;23446:354:35::0;2148:83:31::1;2332:17:::0;;7411:34:19;2309:20:31::1;7398:48:19::0;;;7466:4;7459:18;;;;7517:4;7501:21;;2428:14:31::1;::::0;::::1;::::0;-1:-1:-1;2447:14:31;::::1;::::0;2466::::1;::::0;::::1;::::0;7501:21:19;;2309:20:31;2402:81:::1;::::0;7501:21:19;;2428:14:31;;2402:20:::1;:81::i;:::-;2384:99;;2598:12;:26;;;-1:-1:-1::0;;;;;2587:37:31::1;:7;-1:-1:-1::0;;;;;2587:37:31::1;;2579:80;;;::::0;-1:-1:-1;;;2579:80:31;;24007:2:35;2579:80:31::1;::::0;::::1;23989:21:35::0;24046:2;24026:18;;;24019:30;24085:32;24065:18;;;24058:60;24135:18;;2579:80:31::1;23805:354:35::0;2579:80:31::1;-1:-1:-1::0;2677:4:31::1;::::0;1993:695;-1:-1:-1;;;;1993:695:31:o;1421:214:14:-;1559:68;;-1:-1:-1;;;;;22257:32:35;;;1559:68:14;;;22239:51:35;22326:32;;22306:18;;;22299:60;22375:18;;;22368:34;;;1532:96:14;;1552:5;;-1:-1:-1;;;1582:27:14;22212:18:35;;1559:68:14;22037:371:35;5328:653:14;5758:23;5784:69;5812:4;5784:69;;;;;;;;;;;;;;;;;5792:5;-1:-1:-1;;;;;5784:27:14;;;:69;;;;;:::i;:::-;5758:95;;5871:10;:17;5892:1;5871:22;:56;;;;5908:10;5897:30;;;;;;;;;;;;:::i;:::-;5863:111;;;;-1:-1:-1;;;5863:111:14;;24366:2:35;5863:111:14;;;24348:21:35;24405:2;24385:18;;;24378:30;24444:34;24424:18;;;24417:62;-1:-1:-1;;;24495:18:35;;;24488:40;24545:19;;5863:111:14;24164:406:35;2107:152:4;2173:37;2192:17;2173:18;:37::i;:::-;2225:27;;-1:-1:-1;;;;;2225:27:4;;;;;;;;2107:152;:::o;6685:198:15:-;6768:12;6799:77;6820:6;6828:4;6799:77;;;;;;;;;;;;;;;;;:20;:77::i;6620:232:19:-;6705:7;6725:17;6744:18;6766:25;6777:4;6783:1;6786;6789;6766:10;:25::i;:::-;6724:67;;;;6801:18;6813:5;6801:11;:18::i;:::-;-1:-1:-1;6836:9:19;-1:-1:-1;6620:232:19;;;;;;;:::o;4119:223:15:-;4252:12;4283:52;4305:6;4313:4;4319:1;4322:12;4283:21;:52::i;7069:325::-;7210:12;7235;7249:23;7276:6;-1:-1:-1;;;;;7276:19:15;7296:4;7276:25;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7234:67;;;;7318:69;7345:6;7353:7;7362:10;7374:12;7318:26;:69::i;:::-;7311:76;7069:325;-1:-1:-1;;;;;;7069:325:15:o;5031:1456:19:-;5119:7;;6043:66;6030:79;;6026:161;;;-1:-1:-1;6141:1:19;;-1:-1:-1;6145:30:19;6125:51;;6026:161;6298:24;;;6281:14;6298:24;;;;;;;;;25349:25:35;;;25422:4;25410:17;;25390:18;;;25383:45;;;;25444:18;;;25437:34;;;25487:18;;;25480:34;;;6298:24:19;;25321:19:35;;6298:24:19;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;6298:24:19;;-1:-1:-1;;6298:24:19;;;-1:-1:-1;;;;;;;6336:20:19;;6332:101;;6388:1;6392:29;6372:50;;;;;;;6332:101;6451:6;-1:-1:-1;6459:20:19;;-1:-1:-1;5031:1456:19;;;;;;;;:::o;592:511::-;669:20;660:5;:29;;;;;;;;:::i;:::-;;656:441;;592:511;:::o;656:441::-;765:29;756:5;:38;;;;;;;;:::i;:::-;;752:345;;810:34;;-1:-1:-1;;;810:34:19;;25727:2:35;810:34:19;;;25709:21:35;25766:2;25746:18;;;25739:30;25805:26;25785:18;;;25778:54;25849:18;;810:34:19;25525:348:35;752:345:19;874:35;865:5;:44;;;;;;;;:::i;:::-;;861:236;;925:41;;-1:-1:-1;;;925:41:19;;26080:2:35;925:41:19;;;26062:21:35;26119:2;26099:18;;;26092:30;26158:33;26138:18;;;26131:61;26209:18;;925:41:19;25878:355:35;861:236:19;996:30;987:5;:39;;;;;;;;:::i;:::-;;983:114;;1042:44;;-1:-1:-1;;;1042:44:19;;26440:2:35;1042:44:19;;;26422:21:35;26479:2;26459:18;;;26452:30;26518:34;26498:18;;;26491:62;-1:-1:-1;;;26569:18:35;;;26562:32;26611:19;;1042:44:19;26238:398:35;5176:446:15;5341:12;5398:5;5373:21;:30;;5365:81;;;;-1:-1:-1;;;5365:81:15;;26843:2:35;5365:81:15;;;26825:21:35;26882:2;26862:18;;;26855:30;26921:34;26901:18;;;26894:62;-1:-1:-1;;;26972:18:35;;;26965:36;27018:19;;5365:81:15;26641:402:35;5365:81:15;5457:12;5471:23;5498:6;-1:-1:-1;;;;;5498:11:15;5517:5;5524:4;5498:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5456:73;;;;5546:69;5573:6;5581:7;5590:10;5602:12;7682:628;7862:12;7890:7;7886:418;;;7917:10;:17;7938:1;7917:22;7913:286;;-1:-1:-1;;;;;1713:19:15;;;8124:60;;;;-1:-1:-1;;;8124:60:15;;27250:2:35;8124:60:15;;;27232:21:35;27289:2;27269:18;;;27262:30;27328:31;27308:18;;;27301:59;27377:18;;8124:60:15;27048:353:35;8124:60:15;-1:-1:-1;8219:10:15;8212:17;;7886:418;8260:33;8268:10;8280:12;8991:17;;:21;8987:379;;9219:10;9213:17;9275:15;9262:10;9258:2;9254:19;9247:44;8987:379;9342:12;9335:20;;-1:-1:-1;;;9335:20:15;;;;;;;;:::i;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;238:252:35:-;345:6;405:3;393:9;384:7;380:23;376:33;421:2;418:22;;;436:1;433;426:12;418:22;-1:-1:-1;475:9:35;;238:252;-1:-1:-1;;238:252:35:o;495:173::-;563:20;;-1:-1:-1;;;;;612:31:35;;602:42;;592:70;;658:1;655;648:12;592:70;495:173;;;:::o;673:186::-;732:6;785:2;773:9;764:7;760:23;756:32;753:52;;;801:1;798;791:12;753:52;824:29;843:9;824:29;:::i;864:243::-;962:6;1022:3;1010:9;1001:7;997:23;993:33;1038:2;1035:22;;;1053:1;1050;1043:12;1294:127;1355:10;1350:3;1346:20;1343:1;1336:31;1386:4;1383:1;1376:15;1410:4;1407:1;1400:15;1426:1018;1503:6;1511;1564:2;1552:9;1543:7;1539:23;1535:32;1532:52;;;1580:1;1577;1570:12;1532:52;1603:29;1622:9;1603:29;:::i;:::-;1593:39;;1683:2;1672:9;1668:18;1655:32;1710:18;1702:6;1699:30;1696:50;;;1742:1;1739;1732:12;1696:50;1765:22;;1818:4;1810:13;;1806:27;-1:-1:-1;1796:55:35;;1847:1;1844;1837:12;1796:55;1887:2;1874:16;1913:18;1905:6;1902:30;1899:56;;;1935:18;;:::i;:::-;1984:2;1978:9;2076:2;2038:17;;-1:-1:-1;;2034:31:35;;;2067:2;2030:40;2026:54;2014:67;;2111:18;2096:34;;2132:22;;;2093:62;2090:88;;;2158:18;;:::i;:::-;2194:2;2187:22;2218;;;2259:15;;;2276:2;2255:24;2252:37;-1:-1:-1;2249:57:35;;;2302:1;2299;2292:12;2249:57;2358:6;2353:2;2349;2345:11;2340:2;2332:6;2328:15;2315:50;2411:1;2406:2;2397:6;2389;2385:19;2381:28;2374:39;2432:6;2422:16;;;;;1426:1018;;;;;:::o;2631:250::-;2737:6;2797:2;2785:9;2776:7;2772:23;2768:32;2812:2;2809:22;;;2827:1;2824;2817:12;3094:233;3183:6;3243:2;3231:9;3222:7;3218:23;3214:32;3258:2;3255:22;;;3273:1;3270;3263:12;3332:180;3391:6;3444:2;3432:9;3423:7;3419:23;3415:32;3412:52;;;3460:1;3457;3450:12;3412:52;-1:-1:-1;3483:23:35;;3332:180;-1:-1:-1;3332:180:35:o;3709:242::-;3806:6;3866:3;3854:9;3845:7;3841:23;3837:33;3882:2;3879:22;;;3897:1;3894;3887:12;3956:346;4024:6;4032;4085:2;4073:9;4064:7;4060:23;4056:32;4053:52;;;4101:1;4098;4091:12;4053:52;-1:-1:-1;;4146:23:35;;;4266:2;4251:18;;;4238:32;;-1:-1:-1;3956:346:35:o;4307:::-;4509:2;4491:21;;;4548:2;4528:18;;;4521:30;-1:-1:-1;;;4582:2:35;4567:18;;4560:52;4644:2;4629:18;;4307:346::o;4658:402::-;4860:2;4842:21;;;4899:2;4879:18;;;4872:30;4938:34;4933:2;4918:18;;4911:62;-1:-1:-1;;;5004:2:35;4989:18;;4982:36;5050:3;5035:19;;4658:402::o;5065:400::-;5267:2;5249:21;;;5306:2;5286:18;;;5279:30;5345:34;5340:2;5325:18;;5318:62;-1:-1:-1;;;5411:2:35;5396:18;;5389:34;5455:3;5440:19;;5065:400::o;5470:118::-;5556:5;5549:13;5542:21;5535:5;5532:32;5522:60;;5578:1;5575;5568:12;5593:241;5649:6;5702:2;5690:9;5681:7;5677:23;5673:32;5670:52;;;5718:1;5715;5708:12;5670:52;5757:9;5744:23;5776:28;5798:5;5776:28;:::i;:::-;5823:5;5593:241;-1:-1:-1;;;5593:241:35:o;5839:408::-;6041:2;6023:21;;;6080:2;6060:18;;;6053:30;6119:34;6114:2;6099:18;;6092:62;-1:-1:-1;;;6185:2:35;6170:18;;6163:42;6237:3;6222:19;;5839:408::o;6252:::-;6454:2;6436:21;;;6493:2;6473:18;;;6466:30;6532:34;6527:2;6512:18;;6505:62;-1:-1:-1;;;6598:2:35;6583:18;;6576:42;6650:3;6635:19;;6252:408::o;6665:::-;6867:2;6849:21;;;6906:2;6886:18;;;6879:30;6945:34;6940:2;6925:18;;6918:62;-1:-1:-1;;;7011:2:35;6996:18;;6989:42;7063:3;7048:19;;6665:408::o;7078:354::-;7280:2;7262:21;;;7319:2;7299:18;;;7292:30;7358:32;7353:2;7338:18;;7331:60;7423:2;7408:18;;7078:354::o;7437:127::-;7498:10;7493:3;7489:20;7486:1;7479:31;7529:4;7526:1;7519:15;7553:4;7550:1;7543:15;7569:405;7771:2;7753:21;;;7810:2;7790:18;;;7783:30;7849:34;7844:2;7829:18;;7822:62;-1:-1:-1;;;7915:2:35;7900:18;;7893:39;7964:3;7949:19;;7569:405::o;8392:127::-;8453:10;8448:3;8444:20;8441:1;8434:31;8484:4;8481:1;8474:15;8508:4;8505:1;8498:15;8524:128;8591:9;;;8612:11;;;8609:37;;;8626:18;;:::i;8657:426::-;8859:2;8841:21;;;8898:2;8878:18;;;8871:30;8937:34;8932:2;8917:18;;8910:62;9008:32;9003:2;8988:18;;8981:60;9073:3;9058:19;;8657:426::o;13944:125::-;14009:9;;;14030:10;;;14027:36;;;14043:18;;:::i;16849:245::-;16916:6;16969:2;16957:9;16948:7;16944:23;16940:32;16937:52;;;16985:1;16982;16975:12;16937:52;17017:9;17011:16;17036:28;17058:5;17036:28;:::i;17099:230::-;17169:6;17222:2;17210:9;17201:7;17197:23;17193:32;17190:52;;;17238:1;17235;17228:12;17190:52;-1:-1:-1;17283:16:35;;17099:230;-1:-1:-1;17099:230:35:o;18159:110::-;18243:1;18236:5;18233:12;18223:40;;18259:1;18256;18249:12;18274:1278;18440:6;18448;18456;18464;18472;18480;18488;18496;18504;18557:3;18545:9;18536:7;18532:23;18528:33;18525:53;;;18574:1;18571;18564:12;18525:53;18619:16;;18725:2;18710:18;;18704:25;18800:2;18785:18;;18779:25;18619:16;;-1:-1:-1;18704:25:35;-1:-1:-1;18813:42:35;18779:25;18813:42;:::i;:::-;18926:2;18911:18;;18905:25;18874:7;;-1:-1:-1;18939:42:35;18905:25;18939:42;:::i;:::-;19073:3;19058:19;;19052:26;19170:3;19155:19;;19149:26;19246:3;19231:19;;19225:26;19000:7;;-1:-1:-1;19052:26:35;;-1:-1:-1;19149:26:35;-1:-1:-1;19260:30:35;19225:26;19260:30;:::i;:::-;19361:3;19346:19;;19340:26;19309:7;;-1:-1:-1;19375:30:35;19340:26;19375:30;:::i;:::-;19476:3;19461:19;;19455:26;19424:7;;-1:-1:-1;19490:30:35;19455:26;19490:30;:::i;:::-;19539:7;19529:17;;;18274:1278;;;;;;;;;;;:::o;19557:407::-;19759:2;19741:21;;;19798:2;19778:18;;;19771:30;19837:34;19832:2;19817:18;;19810:62;-1:-1:-1;;;19903:2:35;19888:18;;19881:41;19954:3;19939:19;;19557:407::o;19969:284::-;20027:6;20080:2;20068:9;20059:7;20055:23;20051:32;20048:52;;;20096:1;20093;20086:12;20048:52;20135:9;20122:23;20185:18;20178:5;20174:30;20167:5;20164:41;20154:69;;20219:1;20216;20209:12;21528:269;21585:6;21638:2;21626:9;21617:7;21613:23;21609:32;21606:52;;;21654:1;21651;21644:12;21606:52;21693:9;21680:23;21743:4;21736:5;21732:16;21725:5;21722:27;21712:55;;21763:1;21760;21753:12;24575:250;24660:1;24670:113;24684:6;24681:1;24678:13;24670:113;;;24760:11;;;24754:18;24741:11;;;24734:39;24706:2;24699:10;24670:113;;;-1:-1:-1;;24817:1:35;24799:16;;24792:27;24575:250::o;24830:287::-;24959:3;24997:6;24991:13;25013:66;25072:6;25067:3;25060:4;25052:6;25048:17;25013:66;:::i;:::-;25095:16;;;;;24830:287;-1:-1:-1;;24830:287:35:o;27406:396::-;27555:2;27544:9;27537:21;27518:4;27587:6;27581:13;27630:6;27625:2;27614:9;27610:18;27603:34;27646:79;27718:6;27713:2;27702:9;27698:18;27693:2;27685:6;27681:15;27646:79;:::i;:::-;27786:2;27765:15;-1:-1:-1;;27761:29:35;27746:45;;;;27793:2;27742:54;;27406:396;-1:-1:-1;;27406:396:35:o
Swarm Source
ipfs://78ae8e06eb6fed3dbcdf34810c2b3050a579363762c7393fceea433dda0aabd8
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.