Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 17390915 | 448 days ago | IN | 0 ETH | 0.0510228 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
EqbMinterMainchain
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "./EqbMinterBaseUpg.sol"; contract EqbMinterMainchain is EqbMinterBaseUpg { uint256 public constant _1_MILLION = 1e24; uint256 public multiplier; uint256 public deflation; uint256 public totalMintedAmount; mapping(uint256 => uint256) public mintedAmounts; event MultiplierUpdated(uint256 _multiplier); event DeflationUpdated(uint256 _deflation); event TotalMintedAmountUpdated(uint256 _totalMintedAmount); event MintedAmountsUpdated(uint256 _chainId, uint256 _amount); event FactorBroadcasted(uint256[] _chainIds, uint256 _factor); function initialize( address _eqb, address _eqbMsgSendEndpoint, uint256 _approxDstExecutionGas, address _eqbMsgReceiveEndpoint ) public initializer { __EqbMinterBase_init( _eqb, _eqbMsgSendEndpoint, _approxDstExecutionGas, _eqbMsgReceiveEndpoint ); multiplier = DENOMINATOR; deflation = DENOMINATOR; emit MultiplierUpdated(DENOMINATOR); emit DeflationUpdated(DENOMINATOR); } function setMultiplier( uint256 _multiplier, uint256[] calldata _chainIds ) external payable onlyOwner { multiplier = _multiplier; emit MultiplierUpdated(_multiplier); if (_chainIds.length > 0) { broadcastFactor(_chainIds); } } function broadcastFactor( uint256[] calldata _chainIds ) public payable refundUnusedEth { if (_chainIds.length == 0) { revert Errors.ArrayEmpty(); } uint256 factor = getFactor(); for (uint256 i = 0; i < _chainIds.length; i++) { _sendMessage(_chainIds[i], abi.encode(factor)); } emit FactorBroadcasted(_chainIds, factor); } function _executeMessage( uint256 _srcChainId, address, bytes memory _message ) internal override { uint256 amount = abi.decode(_message, (uint256)); _updateAmountForChain(_srcChainId, amount); } function _afterMint() internal override { _updateAmountForChain(block.chainid, mintedAmount); } function _updateAmountForChain(uint256 _chainId, uint256 _amount) internal { uint256 curMintedAmount = mintedAmounts[_chainId]; mintedAmounts[_chainId] = _amount; uint256 power = ((totalMintedAmount + _amount - curMintedAmount) / _1_MILLION) - (totalMintedAmount / _1_MILLION); for (uint256 i = 0; i < power; i++) { deflation = (deflation * 95) / 100; } totalMintedAmount = totalMintedAmount - curMintedAmount + _amount; emit DeflationUpdated(deflation); emit MintedAmountsUpdated(_chainId, mintedAmounts[_chainId]); emit TotalMintedAmountUpdated(totalMintedAmount); } function getFactor() public view override returns (uint256) { return (multiplier * deflation) / DENOMINATOR; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../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 anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing 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.7.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] * ``` * 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. Equivalent to `reinitializer(1)`. */ 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. * * `initializer` is equivalent to `reinitializer(1)`, so 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. * * 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. */ 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. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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 * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "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"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(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) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason 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 { // 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 v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../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; } /** * @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/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "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"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(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) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(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) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason 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 { // 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.7.0) (utils/structs/EnumerableMap.sol) pragma solidity ^0.8.0; import "./EnumerableSet.sol"; /** * @dev Library for managing an enumerable variant of Solidity's * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`] * type. * * Maps have the following properties: * * - Entries are added, removed, and checked for existence in constant time * (O(1)). * - Entries are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableMap for EnumerableMap.UintToAddressMap; * * // Declare a set state variable * EnumerableMap.UintToAddressMap private myMap; * } * ``` * * The following map types are supported: * * - `uint256 -> address` (`UintToAddressMap`) since v3.0.0 * - `address -> uint256` (`AddressToUintMap`) since v4.6.0 * - `bytes32 -> bytes32` (`Bytes32ToBytes32`) since v4.6.0 * - `uint256 -> uint256` (`UintToUintMap`) since v4.7.0 * - `bytes32 -> uint256` (`Bytes32ToUintMap`) since v4.7.0 * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an array of EnumerableMap. * ==== */ library EnumerableMap { using EnumerableSet for EnumerableSet.Bytes32Set; // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Map type with // bytes32 keys and values. // The Map implementation uses private functions, and user-facing // implementations (such as Uint256ToAddressMap) are just wrappers around // the underlying Map. // This means that we can only create new EnumerableMaps for types that fit // in bytes32. struct Bytes32ToBytes32Map { // Storage of keys EnumerableSet.Bytes32Set _keys; mapping(bytes32 => bytes32) _values; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set( Bytes32ToBytes32Map storage map, bytes32 key, bytes32 value ) internal returns (bool) { map._values[key] = value; return map._keys.add(key); } /** * @dev Removes a key-value pair from a map. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(Bytes32ToBytes32Map storage map, bytes32 key) internal returns (bool) { delete map._values[key]; return map._keys.remove(key); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool) { return map._keys.contains(key); } /** * @dev Returns the number of key-value pairs in the map. O(1). */ function length(Bytes32ToBytes32Map storage map) internal view returns (uint256) { return map._keys.length(); } /** * @dev Returns the key-value pair stored at position `index` in the map. O(1). * * Note that there are no guarantees on the ordering of entries inside the * array, and it may change when more entries are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32ToBytes32Map storage map, uint256 index) internal view returns (bytes32, bytes32) { bytes32 key = map._keys.at(index); return (key, map._values[key]); } /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ function tryGet(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool, bytes32) { bytes32 value = map._values[key]; if (value == bytes32(0)) { return (contains(map, key), bytes32(0)); } else { return (true, value); } } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bytes32) { bytes32 value = map._values[key]; require(value != 0 || contains(map, key), "EnumerableMap: nonexistent key"); return value; } /** * @dev Same as {_get}, with a custom error message when `key` is not in the map. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {_tryGet}. */ function get( Bytes32ToBytes32Map storage map, bytes32 key, string memory errorMessage ) internal view returns (bytes32) { bytes32 value = map._values[key]; require(value != 0 || contains(map, key), errorMessage); return value; } // UintToUintMap struct UintToUintMap { Bytes32ToBytes32Map _inner; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set( UintToUintMap storage map, uint256 key, uint256 value ) internal returns (bool) { return set(map._inner, bytes32(key), bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(UintToUintMap storage map, uint256 key) internal returns (bool) { return remove(map._inner, bytes32(key)); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(UintToUintMap storage map, uint256 key) internal view returns (bool) { return contains(map._inner, bytes32(key)); } /** * @dev Returns the number of elements in the map. O(1). */ function length(UintToUintMap storage map) internal view returns (uint256) { return length(map._inner); } /** * @dev Returns the element stored at position `index` in the set. O(1). * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintToUintMap storage map, uint256 index) internal view returns (uint256, uint256) { (bytes32 key, bytes32 value) = at(map._inner, index); return (uint256(key), uint256(value)); } /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ function tryGet(UintToUintMap storage map, uint256 key) internal view returns (bool, uint256) { (bool success, bytes32 value) = tryGet(map._inner, bytes32(key)); return (success, uint256(value)); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(UintToUintMap storage map, uint256 key) internal view returns (uint256) { return uint256(get(map._inner, bytes32(key))); } /** * @dev Same as {get}, with a custom error message when `key` is not in the map. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryGet}. */ function get( UintToUintMap storage map, uint256 key, string memory errorMessage ) internal view returns (uint256) { return uint256(get(map._inner, bytes32(key), errorMessage)); } // UintToAddressMap struct UintToAddressMap { Bytes32ToBytes32Map _inner; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set( UintToAddressMap storage map, uint256 key, address value ) internal returns (bool) { return set(map._inner, bytes32(key), bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) { return remove(map._inner, bytes32(key)); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) { return contains(map._inner, bytes32(key)); } /** * @dev Returns the number of elements in the map. O(1). */ function length(UintToAddressMap storage map) internal view returns (uint256) { return length(map._inner); } /** * @dev Returns the element stored at position `index` in the set. O(1). * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) { (bytes32 key, bytes32 value) = at(map._inner, index); return (uint256(key), address(uint160(uint256(value)))); } /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. * * _Available since v3.4._ */ function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) { (bool success, bytes32 value) = tryGet(map._inner, bytes32(key)); return (success, address(uint160(uint256(value)))); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(UintToAddressMap storage map, uint256 key) internal view returns (address) { return address(uint160(uint256(get(map._inner, bytes32(key))))); } /** * @dev Same as {get}, with a custom error message when `key` is not in the map. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryGet}. */ function get( UintToAddressMap storage map, uint256 key, string memory errorMessage ) internal view returns (address) { return address(uint160(uint256(get(map._inner, bytes32(key), errorMessage)))); } // AddressToUintMap struct AddressToUintMap { Bytes32ToBytes32Map _inner; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set( AddressToUintMap storage map, address key, uint256 value ) internal returns (bool) { return set(map._inner, bytes32(uint256(uint160(key))), bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(AddressToUintMap storage map, address key) internal returns (bool) { return remove(map._inner, bytes32(uint256(uint160(key)))); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(AddressToUintMap storage map, address key) internal view returns (bool) { return contains(map._inner, bytes32(uint256(uint160(key)))); } /** * @dev Returns the number of elements in the map. O(1). */ function length(AddressToUintMap storage map) internal view returns (uint256) { return length(map._inner); } /** * @dev Returns the element stored at position `index` in the set. O(1). * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressToUintMap storage map, uint256 index) internal view returns (address, uint256) { (bytes32 key, bytes32 value) = at(map._inner, index); return (address(uint160(uint256(key))), uint256(value)); } /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ function tryGet(AddressToUintMap storage map, address key) internal view returns (bool, uint256) { (bool success, bytes32 value) = tryGet(map._inner, bytes32(uint256(uint160(key)))); return (success, uint256(value)); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(AddressToUintMap storage map, address key) internal view returns (uint256) { return uint256(get(map._inner, bytes32(uint256(uint160(key))))); } /** * @dev Same as {get}, with a custom error message when `key` is not in the map. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryGet}. */ function get( AddressToUintMap storage map, address key, string memory errorMessage ) internal view returns (uint256) { return uint256(get(map._inner, bytes32(uint256(uint160(key))), errorMessage)); } // Bytes32ToUintMap struct Bytes32ToUintMap { Bytes32ToBytes32Map _inner; } /** * @dev Adds a key-value pair to a map, or updates the value for an existing * key. O(1). * * Returns true if the key was added to the map, that is if it was not * already present. */ function set( Bytes32ToUintMap storage map, bytes32 key, uint256 value ) internal returns (bool) { return set(map._inner, key, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the key was removed from the map, that is if it was present. */ function remove(Bytes32ToUintMap storage map, bytes32 key) internal returns (bool) { return remove(map._inner, key); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool) { return contains(map._inner, key); } /** * @dev Returns the number of elements in the map. O(1). */ function length(Bytes32ToUintMap storage map) internal view returns (uint256) { return length(map._inner); } /** * @dev Returns the element stored at position `index` in the set. O(1). * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32ToUintMap storage map, uint256 index) internal view returns (bytes32, uint256) { (bytes32 key, bytes32 value) = at(map._inner, index); return (key, uint256(value)); } /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ function tryGet(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool, uint256) { (bool success, bytes32 value) = tryGet(map._inner, key); return (success, uint256(value)); } /** * @dev Returns the value associated with `key`. O(1). * * Requirements: * * - `key` must be in the map. */ function get(Bytes32ToUintMap storage map, bytes32 key) internal view returns (uint256) { return uint256(get(map._inner, key)); } /** * @dev Same as {get}, with a custom error message when `key` is not in the map. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryGet}. */ function get( Bytes32ToUintMap storage map, bytes32 key, string memory errorMessage ) internal view returns (uint256) { return uint256(get(map._inner, key, errorMessage)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "../Interfaces/IEqbMsgReceiver.sol"; import "../Dependencies/Errors.sol"; abstract contract EqbMsgReceiverUpg is IEqbMsgReceiver, OwnableUpgradeable { address public eqbMsgReceiveEndpoint; uint256[100] private __gap; modifier onlyFromEqbMsgReceiveEndpoint() { if (msg.sender != eqbMsgReceiveEndpoint) revert Errors.MsgNotFromReceiveEndpoint(msg.sender); _; } /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function __EqbMsgReceiver_init( address _eqbMsgReceiveEndpoint ) internal onlyInitializing { __EqbMsgReceiver_init_unchained(_eqbMsgReceiveEndpoint); } function __EqbMsgReceiver_init_unchained( address _eqbMsgReceiveEndpoint ) internal onlyInitializing { __Ownable_init_unchained(); eqbMsgReceiveEndpoint = _eqbMsgReceiveEndpoint; } function executeMessage( uint256 _srcChainId, address _srcAddr, bytes calldata _message ) external virtual onlyFromEqbMsgReceiveEndpoint { _executeMessage(_srcChainId, _srcAddr, _message); } function _executeMessage( uint256 _srcChainId, address _srcAddr, bytes memory _message ) internal virtual; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "@openzeppelin/contracts/utils/structs/EnumerableMap.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "../Interfaces/IEqbMsgSendEndpoint.sol"; import "../Dependencies/Errors.sol"; abstract contract EqbMsgSenderUpg is OwnableUpgradeable { using EnumerableMap for EnumerableMap.UintToAddressMap; IEqbMsgSendEndpoint public eqbMsgSendEndpoint; uint256 public approxDstExecutionGas; // destinationContracts mapping contains one address for each chainId only EnumerableMap.UintToAddressMap internal destinationContracts; uint256[100] private __gap; event MsgSent(uint256 indexed _chainId, bytes _message); modifier refundUnusedEth() { _; if (address(this).balance > 0) { AddressUpgradeable.sendValue( payable(msg.sender), address(this).balance ); } } /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function __EqbMsgSender_init( address _eqbMsgSendEndpoint, uint256 _approxDstExecutionGas ) internal onlyInitializing { __EqbMsgSender_init_unchained( _eqbMsgSendEndpoint, _approxDstExecutionGas ); } function __EqbMsgSender_init_unchained( address _eqbMsgSendEndpoint, uint256 _approxDstExecutionGas ) internal onlyInitializing { __Ownable_init_unchained(); eqbMsgSendEndpoint = IEqbMsgSendEndpoint(_eqbMsgSendEndpoint); approxDstExecutionGas = _approxDstExecutionGas; } function _sendMessage(uint256 _chainId, bytes memory _message) internal { assert(destinationContracts.contains(_chainId)); address toAddr = destinationContracts.get(_chainId); uint256 estimatedGasAmount = approxDstExecutionGas; uint256 fee = eqbMsgSendEndpoint.calcFee( _chainId, toAddr, _message, estimatedGasAmount ); // LM contracts won't hold ETH on its own so this is fine if (address(this).balance < fee) { revert Errors.InsufficientFeeToSendMsg(address(this).balance, fee); } eqbMsgSendEndpoint.sendMessage{value: fee}( _chainId, toAddr, _message, estimatedGasAmount ); emit MsgSent(_chainId, _message); } function addDestinationContract( uint256 _chainId, address _address ) external payable onlyOwner { destinationContracts.set(_chainId, _address); } function setApproxDstExecutionGas(uint256 _gas) external onlyOwner { approxDstExecutionGas = _gas; } function getAllDestinationContracts() public view returns (uint256[] memory chainIds, address[] memory addrs) { uint256 length = destinationContracts.length(); chainIds = new uint256[](length); addrs = new address[](length); for (uint256 i = 0; i < length; ++i) { (chainIds[i], addrs[i]) = destinationContracts.at(i); } } function _getSendMessageFee( uint256 chainId, bytes memory message ) internal view returns (uint256) { return eqbMsgSendEndpoint.calcFee( chainId, destinationContracts.get(chainId), message, approxDstExecutionGas ); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; library Errors { error ArrayEmpty(); error InsufficientBalance(uint256 balance, uint256 required); error InvalidMerkleProof(); // cross chain error InsufficientFeeToSendMsg(uint256 currentFee, uint256 requiredFee); error OnlyLayerZeroEndpoint(); error MsgNotFromSendEndpoint(uint16 srcChainId, bytes path); error MsgNotFromReceiveEndpoint(address sender); error OnlyWhitelisted(); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./CrossChain/EqbMsgSenderUpg.sol"; import "./CrossChain/EqbMsgReceiverUpg.sol"; import "./Dependencies/Errors.sol"; import "./Interfaces/IEqbMinter.sol"; abstract contract EqbMinterBaseUpg is IEqbMinter, EqbMsgSenderUpg, EqbMsgReceiverUpg { using SafeERC20 for IERC20; address public eqb; uint256 public constant DENOMINATOR = 10000; uint256 public mintedAmount; mapping(address => bool) public access; uint256[100] private __gap; /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function __EqbMinterBase_init( address _eqb, address _eqbMsgSendEndpoint, uint256 _approxDstExecutionGas, address _eqbMsgReceiveEndpoint ) internal onlyInitializing { __EqbMinterBase_init_unchained( _eqb, _eqbMsgSendEndpoint, _approxDstExecutionGas, _eqbMsgReceiveEndpoint ); } function __EqbMinterBase_init_unchained( address _eqb, address _eqbMsgSendEndpoint, uint256 _approxDstExecutionGas, address _eqbMsgReceiveEndpoint ) internal onlyInitializing { __EqbMsgSender_init_unchained( _eqbMsgSendEndpoint, _approxDstExecutionGas ); __EqbMsgReceiver_init_unchained(_eqbMsgReceiveEndpoint); eqb = _eqb; } function setAccess(address _operator, bool _access) external onlyOwner { require(_operator != address(0), "invalid _operator!"); access[_operator] = _access; emit AccessUpdated(_operator, _access); } function mint(address _to, uint256 _amount) external returns (uint256) { require(access[msg.sender], "!auth"); uint256 mintAmount = (_amount * getFactor()) / DENOMINATOR; uint256 eqbBal = IERC20(eqb).balanceOf(address(this)); if (eqbBal < mintAmount) { revert Errors.InsufficientBalance(eqbBal, mintAmount); } IERC20(eqb).safeTransfer(_to, mintAmount); mintedAmount += mintAmount; _afterMint(); emit MintedAmountUpdated(mintedAmount); emit Minted(_to, mintAmount); return mintAmount; } function _afterMint() internal virtual {} function getFactor() public view virtual returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface IEqbMinter { function mint(address _to, uint256 _amount) external returns (uint256); event Minted(address indexed _to, uint256 _amount); event MintedAmountUpdated(uint256 _amount); event AccessUpdated(address _operator, bool _access); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface IEqbMsgReceiver { function executeMessage( uint256 _srcChainId, address _srcAddr, bytes calldata _message ) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface IEqbMsgSendEndpoint { function calcFee( uint256 _dstChainId, address _dstAddress, bytes memory _payload, uint256 _estimatedGasAmount ) external view returns (uint256 fee); function sendMessage( uint256 _dstChainId, address _dstAddress, bytes calldata _payload, uint256 _estimatedGasAmount ) external payable; event MsgSent( uint256 _dstChainId, address _dstAddress, bytes _payload, uint256 _estimatedGasAmount ); }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"ArrayEmpty","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"required","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[{"internalType":"uint256","name":"currentFee","type":"uint256"},{"internalType":"uint256","name":"requiredFee","type":"uint256"}],"name":"InsufficientFeeToSendMsg","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"MsgNotFromReceiveEndpoint","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"bool","name":"_access","type":"bool"}],"name":"AccessUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_deflation","type":"uint256"}],"name":"DeflationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"_chainIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"_factor","type":"uint256"}],"name":"FactorBroadcasted","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":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"MintedAmountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_chainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"MintedAmountsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_chainId","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_message","type":"bytes"}],"name":"MsgSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_multiplier","type":"uint256"}],"name":"MultiplierUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_totalMintedAmount","type":"uint256"}],"name":"TotalMintedAmountUpdated","type":"event"},{"inputs":[],"name":"DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_1_MILLION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"access","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"address","name":"_address","type":"address"}],"name":"addDestinationContract","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"approxDstExecutionGas","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_chainIds","type":"uint256[]"}],"name":"broadcastFactor","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"deflation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eqb","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eqbMsgReceiveEndpoint","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eqbMsgSendEndpoint","outputs":[{"internalType":"contract IEqbMsgSendEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_srcChainId","type":"uint256"},{"internalType":"address","name":"_srcAddr","type":"address"},{"internalType":"bytes","name":"_message","type":"bytes"}],"name":"executeMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAllDestinationContracts","outputs":[{"internalType":"uint256[]","name":"chainIds","type":"uint256[]"},{"internalType":"address[]","name":"addrs","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_eqb","type":"address"},{"internalType":"address","name":"_eqbMsgSendEndpoint","type":"address"},{"internalType":"uint256","name":"_approxDstExecutionGas","type":"uint256"},{"internalType":"address","name":"_eqbMsgReceiveEndpoint","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintedAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"multiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"_access","type":"bool"}],"name":"setAccess","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gas","type":"uint256"}],"name":"setApproxDstExecutionGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_multiplier","type":"uint256"},{"internalType":"uint256[]","name":"_chainIds","type":"uint256[]"}],"name":"setMultiplier","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"totalMintedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506200001c62000036565b6200002662000036565b6200003062000036565b620000f8565b600054610100900460ff1615620000a35760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000f6576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611f6580620001086000396000f3fe6080604052600436106101965760003560e01c80638d4f550e116100e1578063baedcd2c1161008a578063d45f5e2111610064578063d45f5e2114610422578063d65b394314610442578063dd64e57c14610462578063f2fde38b1461048257600080fd5b8063baedcd2c146103c1578063be203094146103ef578063cc4cf85b1461040f57600080fd5b80639efc7575116100bb5780639efc757514610374578063a337f6211461038a578063b84614a5146103a157600080fd5b80638d4f550e146103225780638da5cb5b14610340578063918f86741461035e57600080fd5b80636349d251116101435780636fae3d761161011d5780636fae3d76146102b9578063715018a6146102fa578063799233e41461030f57600080fd5b80636349d25114610249578063646fcdd2146102815780636f865e6f146102a257600080fd5b80633e39b650116101745780633e39b650146101f157806340c10f19146102145780635184cc431461023457600080fd5b80630c30ff631461019b5780631b3ed722146101b05780632d380242146101da575b600080fd5b6101ae6101a9366004611a49565b6104a2565b005b3480156101bc57600080fd5b506101c761019a5481565b6040519081526020015b60405180910390f35b3480156101e657600080fd5b506101c76101345481565b3480156101fd57600080fd5b506102066104f8565b6040516101d1929190611a95565b34801561022057600080fd5b506101c761022f366004611b35565b61060e565b34801561024057600080fd5b506101c7610828565b34801561025557600080fd5b50606554610269906001600160a01b031681565b6040516001600160a01b0390911681526020016101d1565b34801561028d57600080fd5b5061013354610269906001600160a01b031681565b3480156102ae57600080fd5b506101c761019c5481565b3480156102c557600080fd5b506102ea6102d4366004611b5f565b6101356020526000908152604090205460ff1681565b60405190151581526020016101d1565b34801561030657600080fd5b506101ae61084e565b6101ae61031d366004611b7a565b610862565b34801561032e57600080fd5b506101c769d3c21bcecceda100000081565b34801561034c57600080fd5b506033546001600160a01b0316610269565b34801561036a57600080fd5b506101c761271081565b34801561038057600080fd5b506101c760665481565b34801561039657600080fd5b506101c761019b5481565b3480156103ad57600080fd5b506101ae6103bc366004611bb4565b610876565b3480156103cd57600080fd5b506101c76103dc366004611beb565b61019d6020526000908152604090205481565b3480156103fb57600080fd5b506101ae61040a366004611c04565b610938565b6101ae61041d366004611c51565b610ad7565b34801561042e57600080fd5b506101ae61043d366004611beb565b610bcf565b34801561044e57600080fd5b5060ce54610269906001600160a01b031681565b34801561046e57600080fd5b506101ae61047d366004611c93565b610bdc565b34801561048e57600080fd5b506101ae61049d366004611b5f565b610c69565b6104aa610cf9565b61019a8390556040518381527f4dbe4840d7465bd162f67814cea0b519567a2e0e578bcde61e7f4ced361e5a3d9060200160405180910390a180156104f3576104f38282610ad7565b505050565b60608060006105076067610d53565b90508067ffffffffffffffff81111561052257610522611d1a565b60405190808252806020026020018201604052801561054b578160200160208202803683370190505b5092508067ffffffffffffffff81111561056757610567611d1a565b604051908082528060200260200182016040528015610590578160200160208202803683370190505b50915060005b81811015610608576105a9606782610d5e565b8583815181106105bb576105bb611d30565b602002602001018584815181106105d4576105d4611d30565b60200260200101826001600160a01b03166001600160a01b03168152508281525050508061060190611d5c565b9050610596565b50509091565b336000908152610135602052604081205460ff166106735760405162461bcd60e51b815260206004820152600560248201527f216175746800000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6000612710610680610828565b61068a9085611d75565b6106949190611d8c565b610133546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156106fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107209190611dae565b905081811015610766576040517fcf479181000000000000000000000000000000000000000000000000000000008152600481018290526024810183905260440161066a565b6101335461077e906001600160a01b03168684610d7c565b8161013460008282546107919190611dc7565b9091555061079f9050610dfc565b7f2c52407333436f259bf6a809fe1ea51b8fbf1cde1a7d084fe1f1091b6502a204610134546040516107d391815260200190565b60405180910390a1846001600160a01b03167f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe8360405161081691815260200190565b60405180910390a25090505b92915050565b600061271061019b5461019a5461083f9190611d75565b6108499190611d8c565b905090565b610856610cf9565b6108606000610e09565b565b61086a610cf9565b6104f360678383610e68565b61087e610cf9565b6001600160a01b0382166108d45760405162461bcd60e51b815260206004820152601260248201527f696e76616c6964205f6f70657261746f72210000000000000000000000000000604482015260640161066a565b6001600160a01b03821660008181526101356020908152604091829020805460ff19168515159081179091558251938452908301527f18ac1b80d115f1f71f132ed0e5ffe7a01649c5e7a4687b7aa8bdcbde68455939910160405180910390a15050565b600054610100900460ff16158080156109585750600054600160ff909116105b806109725750303b158015610972575060005460ff166001145b6109e45760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161066a565b6000805460ff191660011790558015610a07576000805461ff0019166101001790555b610a1385858585610e88565b61271061019a81905561019b8190556040519081527f4dbe4840d7465bd162f67814cea0b519567a2e0e578bcde61e7f4ced361e5a3d9060200160405180910390a160405161271081527fc1dd44af29fde88feb16621a1f45f37857c28330bee5113257ddf833919e93089060200160405180910390a18015610ad0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6000819003610b12576040517ff1364a7400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610b1c610828565b905060005b82811015610b7e57610b6c848483818110610b3e57610b3e611d30565b9050602002013583604051602001610b5891815260200190565b604051602081830303815290604052610eff565b80610b7681611d5c565b915050610b21565b507ff1a55e829f8dfcf616ba7e5c4c100d683365797114feb39598ad48afb379f76f838383604051610bb293929190611dda565b60405180910390a1504715610bcb57610bcb33476110c3565b5050565b610bd7610cf9565b606655565b60ce546001600160a01b03163314610c22576040517f56b82aea00000000000000000000000000000000000000000000000000000000815233600482015260240161066a565b610c63848484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506111dc92505050565b50505050565b610c71610cf9565b6001600160a01b038116610ced5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161066a565b610cf681610e09565b50565b6033546001600160a01b031633146108605760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161066a565b6000610822826111fe565b6000808080610d6d8686611209565b909450925050505b9250929050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526104f3908490611234565b6108604661013454611319565b603380546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000610e7e84846001600160a01b0385166114a2565b90505b9392505050565b600054610100900460ff16610ef35760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161066a565b610c63848484846114bf565b610f0a606783611571565b610f1657610f16611e31565b6000610f2360678461157d565b6066546065546040517feb0af6ba00000000000000000000000000000000000000000000000000000000815292935090916000916001600160a01b03169063eb0af6ba90610f7b908890879089908890600401611e97565b602060405180830381865afa158015610f98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbc9190611dae565b905080471015611001576040517fe098b7ca0000000000000000000000000000000000000000000000000000000081524760048201526024810182905260440161066a565b6065546040517f74e583fc0000000000000000000000000000000000000000000000000000000081526001600160a01b03909116906374e583fc90839061105290899088908a908990600401611e97565b6000604051808303818588803b15801561106b57600080fd5b505af115801561107f573d6000803e3d6000fd5b5050505050847fc712776e3ba1c0956ddaa7dddccc9d5307821c4f2f2dd03d581164ba6faf5d22856040516110b49190611ed0565b60405180910390a25050505050565b804710156111135760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161066a565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611160576040519150601f19603f3d011682016040523d82523d6000602084013e611165565b606091505b50509050806104f35760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161066a565b6000818060200190518101906111f29190611dae565b9050610c638482611319565b600061082282611589565b600080806112178585611593565b600081815260029690960160205260409095205494959350505050565b6000611289826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661159f9092919063ffffffff16565b8051909150156104f357808060200190518101906112a79190611ee3565b6104f35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161066a565b600082815261019d6020526040812080549083905561019c5490919061134a9069d3c21bcecceda100000090611d8c565b69d3c21bcecceda1000000838561019c546113659190611dc7565b61136f9190611f00565b6113799190611d8c565b6113839190611f00565b905060005b818110156113c257606461019b54605f6113a29190611d75565b6113ac9190611d8c565b61019b55806113ba81611d5c565b915050611388565b50828261019c546113d39190611f00565b6113dd9190611dc7565b61019c5561019b546040519081527fc1dd44af29fde88feb16621a1f45f37857c28330bee5113257ddf833919e93089060200160405180910390a1600084815261019d6020908152604091829020548251878152918201527f88cad96e50aa424ad96ef701e605ebc5e04a827d85690e4b9bfcf84603ecaf67910160405180910390a17f7002a7132fd3afea0f6ddc3dded6468b6ea8aca4a47543fea66b4f496f53e2e961019c5460405161149491815260200190565b60405180910390a150505050565b60008281526002840160205260408120829055610e7e84846115ae565b600054610100900460ff1661152a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161066a565b61153483836115ba565b61153d81611660565b5050610133805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03939093169290921790915550565b6000610e818383611702565b6000610e81838361170e565b6000610822825490565b6000610e81838361177e565b6060610e7e84846000856117a8565b6000610e8183836118f0565b600054610100900460ff166116255760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161066a565b61162d61193f565b6065805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039390931692909217909155606655565b600054610100900460ff166116cb5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161066a565b6116d361193f565b60ce805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000610e8183836119b3565b60008181526002830160205260408120548015158061173257506117328484611702565b610e815760405162461bcd60e51b815260206004820152601e60248201527f456e756d657261626c654d61703a206e6f6e6578697374656e74206b65790000604482015260640161066a565b600082600001828154811061179557611795611d30565b9060005260206000200154905092915050565b6060824710156118205760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161066a565b6001600160a01b0385163b6118775760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161066a565b600080866001600160a01b031685876040516118939190611f13565b60006040518083038185875af1925050503d80600081146118d0576040519150601f19603f3d011682016040523d82523d6000602084013e6118d5565b606091505b50915091506118e58282866119cb565b979650505050505050565b600081815260018301602052604081205461193757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610822565b506000610822565b600054610100900460ff166119aa5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161066a565b61086033610e09565b60008181526001830160205260408120541515610e81565b606083156119da575081610e81565b8251156119ea5782518084602001fd5b8160405162461bcd60e51b815260040161066a9190611ed0565b60008083601f840112611a1657600080fd5b50813567ffffffffffffffff811115611a2e57600080fd5b6020830191508360208260051b8501011115610d7557600080fd5b600080600060408486031215611a5e57600080fd5b83359250602084013567ffffffffffffffff811115611a7c57600080fd5b611a8886828701611a04565b9497909650939450505050565b604080825283519082018190526000906020906060840190828701845b82811015611ace57815184529284019290840190600101611ab2565b5050508381038285015284518082528583019183019060005b81811015611b0c5783516001600160a01b031683529284019291840191600101611ae7565b5090979650505050505050565b80356001600160a01b0381168114611b3057600080fd5b919050565b60008060408385031215611b4857600080fd5b611b5183611b19565b946020939093013593505050565b600060208284031215611b7157600080fd5b610e8182611b19565b60008060408385031215611b8d57600080fd5b82359150611b9d60208401611b19565b90509250929050565b8015158114610cf657600080fd5b60008060408385031215611bc757600080fd5b611bd083611b19565b91506020830135611be081611ba6565b809150509250929050565b600060208284031215611bfd57600080fd5b5035919050565b60008060008060808587031215611c1a57600080fd5b611c2385611b19565b9350611c3160208601611b19565b925060408501359150611c4660608601611b19565b905092959194509250565b60008060208385031215611c6457600080fd5b823567ffffffffffffffff811115611c7b57600080fd5b611c8785828601611a04565b90969095509350505050565b60008060008060608587031215611ca957600080fd5b84359350611cb960208601611b19565b9250604085013567ffffffffffffffff80821115611cd657600080fd5b818701915087601f830112611cea57600080fd5b813581811115611cf957600080fd5b886020828501011115611d0b57600080fd5b95989497505060200194505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611d6e57611d6e611d46565b5060010190565b808202811582820484141761082257610822611d46565b600082611da957634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215611dc057600080fd5b5051919050565b8082018082111561082257610822611d46565b6040815282604082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841115611e1357600080fd5b8360051b808660608501376020830193909352500160600192915050565b634e487b7160e01b600052600160045260246000fd5b60005b83811015611e62578181015183820152602001611e4a565b50506000910152565b60008151808452611e83816020860160208601611e47565b601f01601f19169290920160200192915050565b8481526001600160a01b0384166020820152608060408201526000611ebf6080830185611e6b565b905082606083015295945050505050565b602081526000610e816020830184611e6b565b600060208284031215611ef557600080fd5b8151610e8181611ba6565b8181038181111561082257610822611d46565b60008251611f25818460208701611e47565b919091019291505056fea2646970667358221220f1601be3e34a6846754e4cca4ce2ff1a7254b245dd76440cecd35aaf28d1552764736f6c63430008110033
Deployed Bytecode
0x6080604052600436106101965760003560e01c80638d4f550e116100e1578063baedcd2c1161008a578063d45f5e2111610064578063d45f5e2114610422578063d65b394314610442578063dd64e57c14610462578063f2fde38b1461048257600080fd5b8063baedcd2c146103c1578063be203094146103ef578063cc4cf85b1461040f57600080fd5b80639efc7575116100bb5780639efc757514610374578063a337f6211461038a578063b84614a5146103a157600080fd5b80638d4f550e146103225780638da5cb5b14610340578063918f86741461035e57600080fd5b80636349d251116101435780636fae3d761161011d5780636fae3d76146102b9578063715018a6146102fa578063799233e41461030f57600080fd5b80636349d25114610249578063646fcdd2146102815780636f865e6f146102a257600080fd5b80633e39b650116101745780633e39b650146101f157806340c10f19146102145780635184cc431461023457600080fd5b80630c30ff631461019b5780631b3ed722146101b05780632d380242146101da575b600080fd5b6101ae6101a9366004611a49565b6104a2565b005b3480156101bc57600080fd5b506101c761019a5481565b6040519081526020015b60405180910390f35b3480156101e657600080fd5b506101c76101345481565b3480156101fd57600080fd5b506102066104f8565b6040516101d1929190611a95565b34801561022057600080fd5b506101c761022f366004611b35565b61060e565b34801561024057600080fd5b506101c7610828565b34801561025557600080fd5b50606554610269906001600160a01b031681565b6040516001600160a01b0390911681526020016101d1565b34801561028d57600080fd5b5061013354610269906001600160a01b031681565b3480156102ae57600080fd5b506101c761019c5481565b3480156102c557600080fd5b506102ea6102d4366004611b5f565b6101356020526000908152604090205460ff1681565b60405190151581526020016101d1565b34801561030657600080fd5b506101ae61084e565b6101ae61031d366004611b7a565b610862565b34801561032e57600080fd5b506101c769d3c21bcecceda100000081565b34801561034c57600080fd5b506033546001600160a01b0316610269565b34801561036a57600080fd5b506101c761271081565b34801561038057600080fd5b506101c760665481565b34801561039657600080fd5b506101c761019b5481565b3480156103ad57600080fd5b506101ae6103bc366004611bb4565b610876565b3480156103cd57600080fd5b506101c76103dc366004611beb565b61019d6020526000908152604090205481565b3480156103fb57600080fd5b506101ae61040a366004611c04565b610938565b6101ae61041d366004611c51565b610ad7565b34801561042e57600080fd5b506101ae61043d366004611beb565b610bcf565b34801561044e57600080fd5b5060ce54610269906001600160a01b031681565b34801561046e57600080fd5b506101ae61047d366004611c93565b610bdc565b34801561048e57600080fd5b506101ae61049d366004611b5f565b610c69565b6104aa610cf9565b61019a8390556040518381527f4dbe4840d7465bd162f67814cea0b519567a2e0e578bcde61e7f4ced361e5a3d9060200160405180910390a180156104f3576104f38282610ad7565b505050565b60608060006105076067610d53565b90508067ffffffffffffffff81111561052257610522611d1a565b60405190808252806020026020018201604052801561054b578160200160208202803683370190505b5092508067ffffffffffffffff81111561056757610567611d1a565b604051908082528060200260200182016040528015610590578160200160208202803683370190505b50915060005b81811015610608576105a9606782610d5e565b8583815181106105bb576105bb611d30565b602002602001018584815181106105d4576105d4611d30565b60200260200101826001600160a01b03166001600160a01b03168152508281525050508061060190611d5c565b9050610596565b50509091565b336000908152610135602052604081205460ff166106735760405162461bcd60e51b815260206004820152600560248201527f216175746800000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6000612710610680610828565b61068a9085611d75565b6106949190611d8c565b610133546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156106fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107209190611dae565b905081811015610766576040517fcf479181000000000000000000000000000000000000000000000000000000008152600481018290526024810183905260440161066a565b6101335461077e906001600160a01b03168684610d7c565b8161013460008282546107919190611dc7565b9091555061079f9050610dfc565b7f2c52407333436f259bf6a809fe1ea51b8fbf1cde1a7d084fe1f1091b6502a204610134546040516107d391815260200190565b60405180910390a1846001600160a01b03167f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe8360405161081691815260200190565b60405180910390a25090505b92915050565b600061271061019b5461019a5461083f9190611d75565b6108499190611d8c565b905090565b610856610cf9565b6108606000610e09565b565b61086a610cf9565b6104f360678383610e68565b61087e610cf9565b6001600160a01b0382166108d45760405162461bcd60e51b815260206004820152601260248201527f696e76616c6964205f6f70657261746f72210000000000000000000000000000604482015260640161066a565b6001600160a01b03821660008181526101356020908152604091829020805460ff19168515159081179091558251938452908301527f18ac1b80d115f1f71f132ed0e5ffe7a01649c5e7a4687b7aa8bdcbde68455939910160405180910390a15050565b600054610100900460ff16158080156109585750600054600160ff909116105b806109725750303b158015610972575060005460ff166001145b6109e45760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161066a565b6000805460ff191660011790558015610a07576000805461ff0019166101001790555b610a1385858585610e88565b61271061019a81905561019b8190556040519081527f4dbe4840d7465bd162f67814cea0b519567a2e0e578bcde61e7f4ced361e5a3d9060200160405180910390a160405161271081527fc1dd44af29fde88feb16621a1f45f37857c28330bee5113257ddf833919e93089060200160405180910390a18015610ad0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6000819003610b12576040517ff1364a7400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610b1c610828565b905060005b82811015610b7e57610b6c848483818110610b3e57610b3e611d30565b9050602002013583604051602001610b5891815260200190565b604051602081830303815290604052610eff565b80610b7681611d5c565b915050610b21565b507ff1a55e829f8dfcf616ba7e5c4c100d683365797114feb39598ad48afb379f76f838383604051610bb293929190611dda565b60405180910390a1504715610bcb57610bcb33476110c3565b5050565b610bd7610cf9565b606655565b60ce546001600160a01b03163314610c22576040517f56b82aea00000000000000000000000000000000000000000000000000000000815233600482015260240161066a565b610c63848484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506111dc92505050565b50505050565b610c71610cf9565b6001600160a01b038116610ced5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161066a565b610cf681610e09565b50565b6033546001600160a01b031633146108605760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161066a565b6000610822826111fe565b6000808080610d6d8686611209565b909450925050505b9250929050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526104f3908490611234565b6108604661013454611319565b603380546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000610e7e84846001600160a01b0385166114a2565b90505b9392505050565b600054610100900460ff16610ef35760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161066a565b610c63848484846114bf565b610f0a606783611571565b610f1657610f16611e31565b6000610f2360678461157d565b6066546065546040517feb0af6ba00000000000000000000000000000000000000000000000000000000815292935090916000916001600160a01b03169063eb0af6ba90610f7b908890879089908890600401611e97565b602060405180830381865afa158015610f98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbc9190611dae565b905080471015611001576040517fe098b7ca0000000000000000000000000000000000000000000000000000000081524760048201526024810182905260440161066a565b6065546040517f74e583fc0000000000000000000000000000000000000000000000000000000081526001600160a01b03909116906374e583fc90839061105290899088908a908990600401611e97565b6000604051808303818588803b15801561106b57600080fd5b505af115801561107f573d6000803e3d6000fd5b5050505050847fc712776e3ba1c0956ddaa7dddccc9d5307821c4f2f2dd03d581164ba6faf5d22856040516110b49190611ed0565b60405180910390a25050505050565b804710156111135760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161066a565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611160576040519150601f19603f3d011682016040523d82523d6000602084013e611165565b606091505b50509050806104f35760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161066a565b6000818060200190518101906111f29190611dae565b9050610c638482611319565b600061082282611589565b600080806112178585611593565b600081815260029690960160205260409095205494959350505050565b6000611289826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661159f9092919063ffffffff16565b8051909150156104f357808060200190518101906112a79190611ee3565b6104f35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161066a565b600082815261019d6020526040812080549083905561019c5490919061134a9069d3c21bcecceda100000090611d8c565b69d3c21bcecceda1000000838561019c546113659190611dc7565b61136f9190611f00565b6113799190611d8c565b6113839190611f00565b905060005b818110156113c257606461019b54605f6113a29190611d75565b6113ac9190611d8c565b61019b55806113ba81611d5c565b915050611388565b50828261019c546113d39190611f00565b6113dd9190611dc7565b61019c5561019b546040519081527fc1dd44af29fde88feb16621a1f45f37857c28330bee5113257ddf833919e93089060200160405180910390a1600084815261019d6020908152604091829020548251878152918201527f88cad96e50aa424ad96ef701e605ebc5e04a827d85690e4b9bfcf84603ecaf67910160405180910390a17f7002a7132fd3afea0f6ddc3dded6468b6ea8aca4a47543fea66b4f496f53e2e961019c5460405161149491815260200190565b60405180910390a150505050565b60008281526002840160205260408120829055610e7e84846115ae565b600054610100900460ff1661152a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161066a565b61153483836115ba565b61153d81611660565b5050610133805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03939093169290921790915550565b6000610e818383611702565b6000610e81838361170e565b6000610822825490565b6000610e81838361177e565b6060610e7e84846000856117a8565b6000610e8183836118f0565b600054610100900460ff166116255760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161066a565b61162d61193f565b6065805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039390931692909217909155606655565b600054610100900460ff166116cb5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161066a565b6116d361193f565b60ce805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000610e8183836119b3565b60008181526002830160205260408120548015158061173257506117328484611702565b610e815760405162461bcd60e51b815260206004820152601e60248201527f456e756d657261626c654d61703a206e6f6e6578697374656e74206b65790000604482015260640161066a565b600082600001828154811061179557611795611d30565b9060005260206000200154905092915050565b6060824710156118205760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161066a565b6001600160a01b0385163b6118775760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161066a565b600080866001600160a01b031685876040516118939190611f13565b60006040518083038185875af1925050503d80600081146118d0576040519150601f19603f3d011682016040523d82523d6000602084013e6118d5565b606091505b50915091506118e58282866119cb565b979650505050505050565b600081815260018301602052604081205461193757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610822565b506000610822565b600054610100900460ff166119aa5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161066a565b61086033610e09565b60008181526001830160205260408120541515610e81565b606083156119da575081610e81565b8251156119ea5782518084602001fd5b8160405162461bcd60e51b815260040161066a9190611ed0565b60008083601f840112611a1657600080fd5b50813567ffffffffffffffff811115611a2e57600080fd5b6020830191508360208260051b8501011115610d7557600080fd5b600080600060408486031215611a5e57600080fd5b83359250602084013567ffffffffffffffff811115611a7c57600080fd5b611a8886828701611a04565b9497909650939450505050565b604080825283519082018190526000906020906060840190828701845b82811015611ace57815184529284019290840190600101611ab2565b5050508381038285015284518082528583019183019060005b81811015611b0c5783516001600160a01b031683529284019291840191600101611ae7565b5090979650505050505050565b80356001600160a01b0381168114611b3057600080fd5b919050565b60008060408385031215611b4857600080fd5b611b5183611b19565b946020939093013593505050565b600060208284031215611b7157600080fd5b610e8182611b19565b60008060408385031215611b8d57600080fd5b82359150611b9d60208401611b19565b90509250929050565b8015158114610cf657600080fd5b60008060408385031215611bc757600080fd5b611bd083611b19565b91506020830135611be081611ba6565b809150509250929050565b600060208284031215611bfd57600080fd5b5035919050565b60008060008060808587031215611c1a57600080fd5b611c2385611b19565b9350611c3160208601611b19565b925060408501359150611c4660608601611b19565b905092959194509250565b60008060208385031215611c6457600080fd5b823567ffffffffffffffff811115611c7b57600080fd5b611c8785828601611a04565b90969095509350505050565b60008060008060608587031215611ca957600080fd5b84359350611cb960208601611b19565b9250604085013567ffffffffffffffff80821115611cd657600080fd5b818701915087601f830112611cea57600080fd5b813581811115611cf957600080fd5b886020828501011115611d0b57600080fd5b95989497505060200194505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611d6e57611d6e611d46565b5060010190565b808202811582820484141761082257610822611d46565b600082611da957634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215611dc057600080fd5b5051919050565b8082018082111561082257610822611d46565b6040815282604082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841115611e1357600080fd5b8360051b808660608501376020830193909352500160600192915050565b634e487b7160e01b600052600160045260246000fd5b60005b83811015611e62578181015183820152602001611e4a565b50506000910152565b60008151808452611e83816020860160208601611e47565b601f01601f19169290920160200192915050565b8481526001600160a01b0384166020820152608060408201526000611ebf6080830185611e6b565b905082606083015295945050505050565b602081526000610e816020830184611e6b565b600060208284031215611ef557600080fd5b8151610e8181611ba6565b8181038181111561082257610822611d46565b60008251611f25818460208701611e47565b919091019291505056fea2646970667358221220f1601be3e34a6846754e4cca4ce2ff1a7254b245dd76440cecd35aaf28d1552764736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ARB | 100.00% | $0.205027 | 145,364.5308 | $29,803.61 |
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.