Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MetAirdrop
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "./dependencies/openzeppelin/utils/math/Math.sol";
import "./utils/RecurringAirdrop.sol";
import "./interfaces/external/IESMET.sol";
/**
* @title MET Airdrop contract
*/
contract MetAirdrop is RecurringAirdrop {
using SafeERC20 for IERC20;
using Math for uint256;
IESMET public constant ESMET = IESMET(0xA28D70795a61Dc925D4c220762A4344803876bb8);
IERC20 public constant MET = IERC20(0x2Ebd53d035150f328bd754D6DC66B99B0eDB89aa);
/// @notice For how long `MET` tokens will be locked
uint256 public lockPeriod = 7 days;
constructor() RecurringAirdrop(MET) {}
/**
* @inheritdoc RecurringAirdrop
* @dev Locks the `MET` into `esMET` on user's behalf.
* The `lockPeriod` starts from the current merkle root update (i.e. `updatedAt`)
*/
function _transferReward(address to_, uint256 amount_) internal override {
uint256 _end = updatedAt + lockPeriod;
if (_end < block.timestamp) {
MET.safeTransfer(to_, amount_);
return;
}
uint256 _min = ESMET.MINIMUM_LOCK_PERIOD() + 1;
uint256 _max = ESMET.MAXIMUM_LOCK_PERIOD();
// Ensures valid lock period
uint256 _remainLockPeriod = Math.min(Math.max(_end - block.timestamp, _min), _max);
token.safeApprove(address(ESMET), 0);
token.safeApprove(address(ESMET), amount_);
ESMET.lockFor(to_, amount_, _remainLockPeriod);
}
/**
* @notice Update esMET lock period
* @param lockPeriod_ The new value
*/
function updateLockPeriod(uint256 lockPeriod_) public onlyGovernor {
lockPeriod = lockPeriod_;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "../dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol";
import "../utils/TokenHolder.sol";
import "../interfaces/IGovernable.sol";
error SenderIsNotGovernor();
error ProposedGovernorIsNull();
error SenderIsNotTheProposedGovernor();
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (governor) that can be granted exclusive access to
* specific functions.
*
* By default, the governor account will be the one that deploys the contract. This
* can later be changed with {transferGovernorship}.
*
*/
abstract contract Governable is IGovernable, TokenHolder, Initializable {
/**
* @notice The governor
* @dev By default the contract deployer is the initial governor
*/
address public governor;
/**
* @notice The proposed governor
* @dev It will be empty (address(0)) if there isn't a proposed governor
*/
address public proposedGovernor;
event UpdatedGovernor(address indexed previousGovernor, address indexed proposedGovernor);
constructor() {
governor = msg.sender;
emit UpdatedGovernor(address(0), msg.sender);
}
/**
* @dev If inheriting child is using proxy then child contract can use
* __Governable_init() function to initialization this contract
*/
// solhint-disable-next-line func-name-mixedcase
function __Governable_init() internal onlyInitializing {
governor = msg.sender;
emit UpdatedGovernor(address(0), msg.sender);
}
/**
* @dev Throws if called by any account other than the governor.
*/
modifier onlyGovernor() {
if (governor != msg.sender) revert SenderIsNotGovernor();
_;
}
/// @inheritdoc TokenHolder
// solhint-disable-next-line no-empty-blocks
function _requireCanSweep() internal view override onlyGovernor {}
/**
* @notice Transfers governorship of the contract to a new account (`proposedGovernor`).
* @dev Can only be called by the current owner.
* @param proposedGovernor_ The new proposed governor
*/
function transferGovernorship(address proposedGovernor_) external onlyGovernor {
if (proposedGovernor_ == address(0)) revert ProposedGovernorIsNull();
proposedGovernor = proposedGovernor_;
}
/**
* @notice Allows new governor to accept governorship of the contract.
*/
function acceptGovernorship() external {
address _proposedGovernor = proposedGovernor;
if (msg.sender != _proposedGovernor) revert SenderIsNotTheProposedGovernor();
emit UpdatedGovernor(governor, _proposedGovernor);
governor = _proposedGovernor;
proposedGovernor = address(0);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 = _setInitializedVersion(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) {
bool isTopLevelCall = _setInitializedVersion(version);
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_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 {
_setInitializedVersion(type(uint8).max);
}
function _setInitializedVersion(uint8 version) private returns (bool) {
// If the contract is initializing we ignore whether _initialized is set in order to support multiple
// inheritance patterns, but we only do this in the context of a constructor, and for the lowest level
// of initializers, because in other contexts the contract may have been reentered.
if (_initializing) {
require(
version == 1 && !AddressUpgradeable.isContract(address(this)),
"Initializable: contract is already initialized"
);
return false;
} else {
require(_initialized < version, "Initializable: contract is already initialized");
_initialized = version;
return true;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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 `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @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);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC20.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));
}
}
/**
* @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.5.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
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
} else {
// Hash(current element of the proof + current computed hash)
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
}
// Check if the computed hash (root) is equal to the provided root
return computedHash == root;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a / b + (a % b == 0 ? 0 : 1);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
/**
* @notice Governable interface
*/
interface IGovernable {
function governor() external view returns (address _governor);
function transferGovernorship(address _proposedGovernor) external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "../../dependencies/openzeppelin/token/ERC20/IERC20.sol";
interface IESMET is IERC20 {
struct LockPosition {
uint256 lockedAmount; // MET locked
uint256 boostedAmount; // based on the `lockPeriod`
uint256 unlockTime; // now + `lockPeriod`
}
function positions(uint256) external view returns (LockPosition memory);
function MINIMUM_LOCK_PERIOD() external view returns (uint256);
function MAXIMUM_LOCK_PERIOD() external view returns (uint256);
function balanceOf(address account_) external view returns (uint256);
function lock(uint256 amount_, uint256 lockPeriod_) external;
function lockFor(address to_, uint256 amount_, uint256 lockPeriod_) external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "../dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol";
import "../dependencies/openzeppelin/security/ReentrancyGuard.sol";
import "../dependencies/openzeppelin/utils/cryptography/MerkleProof.sol";
import "../access/Governable.sol";
error NothingToClaim();
error InvalidProof();
error NewMerkleRootSameAsCurrent();
error ProofsFileIsNull();
/**
* @title Generic Recurring Airdrop contract
*/
contract RecurringAirdrop is ReentrancyGuard, Governable {
using SafeERC20 for IERC20;
/// @notice The token to distribute
IERC20 public immutable token;
/// @notice The merkle root for the current distribution
bytes32 public merkleRoot;
/// @notice The proofs file's IPFS hash
bytes32 public proofsFileHash;
/// @notice The timestamp of the latest merkle root update
uint256 public updatedAt;
/// @notice The Accumulated amount claimed for a given account
mapping(address => uint256) public claimed;
/// @notice Emitted when an account claims reward
event RewardClaimed(address indexed to, uint256 amount);
/// @notice Emitted when the merkle root is updated
event MerkleRootUpdated(bytes32 merkleRoot, uint256 createdAt);
constructor(IERC20 token_) {
token = token_;
}
/**
* @notice Claim reward
* @dev Every tree leaf is a `[account, amount]` tuple, we assume that the `msg.sender` is the account
* @param amount_ The amount to claim
* @param proof_ The merkle tree proof for the given leaf
*/
function claim(uint256 amount_, bytes32[] calldata proof_) external nonReentrant {
if (merkleRoot == bytes32(0)) revert NothingToClaim();
bytes32 _leaf = keccak256(abi.encodePacked(msg.sender, amount_));
if (!MerkleProof.verify(proof_, merkleRoot, _leaf)) revert InvalidProof();
uint256 _claimable = amount_ - claimed[msg.sender];
if (_claimable == 0) revert NothingToClaim();
claimed[msg.sender] += _claimable;
_transferReward(msg.sender, _claimable);
emit RewardClaimed(msg.sender, _claimable);
}
/**
* @notice Transfer reward to the user
* @param to_ The claim account
* @param amount_ The reward amount
*/
function _transferReward(address to_, uint256 amount_) internal virtual {
token.safeTransfer(to_, amount_);
}
/**
* @notice Update merkle tree root
* @param merkleRoot_ The merkle root
*/
function updateMerkleRoot(bytes32 merkleRoot_, bytes32 proofsFileHash_) external onlyGovernor {
if (merkleRoot_ == merkleRoot) revert NewMerkleRootSameAsCurrent();
if (proofsFileHash_ == bytes32(0)) revert ProofsFileIsNull();
merkleRoot = merkleRoot_;
updatedAt = block.timestamp;
proofsFileHash = proofsFileHash_;
emit MerkleRootUpdated(merkleRoot_, block.timestamp);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "../dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol";
error FallbackIsNotAllowed();
error ReceiveIsNotAllowed();
/**
* @title Utils contract that handles tokens sent to it
*/
abstract contract TokenHolder {
using SafeERC20 for IERC20;
/**
* @dev Revert fallback calls
*/
fallback() external payable {
revert FallbackIsNotAllowed();
}
/**
* @dev Revert when receiving by default
*/
receive() external payable virtual {
revert ReceiveIsNotAllowed();
}
/**
* @notice ERC20 recovery in case of stuck tokens due direct transfers to the contract address.
* @param token_ The token to transfer
* @param to_ The recipient of the transfer
* @param amount_ The amount to send
*/
function sweep(IERC20 token_, address to_, uint256 amount_) external {
_requireCanSweep();
if (address(token_) == address(0)) {
Address.sendValue(payable(to_), amount_);
} else {
token_.safeTransfer(to_, amount_);
}
}
/**
* @notice Function that reverts if the caller isn't allowed to sweep tokens
* @dev Usually requires the owner or governor as the caller
*/
function _requireCanSweep() internal view virtual;
}{
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"FallbackIsNotAllowed","type":"error"},{"inputs":[],"name":"InvalidProof","type":"error"},{"inputs":[],"name":"NewMerkleRootSameAsCurrent","type":"error"},{"inputs":[],"name":"NothingToClaim","type":"error"},{"inputs":[],"name":"ProofsFileIsNull","type":"error"},{"inputs":[],"name":"ProposedGovernorIsNull","type":"error"},{"inputs":[],"name":"ReceiveIsNotAllowed","type":"error"},{"inputs":[],"name":"SenderIsNotGovernor","type":"error"},{"inputs":[],"name":"SenderIsNotTheProposedGovernor","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"createdAt","type":"uint256"}],"name":"MerkleRootUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousGovernor","type":"address"},{"indexed":true,"internalType":"address","name":"proposedGovernor","type":"address"}],"name":"UpdatedGovernor","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"ESMET","outputs":[{"internalType":"contract IESMET","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MET","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptGovernorship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"bytes32[]","name":"proof_","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proofsFileHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proposedGovernor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"proposedGovernor_","type":"address"}],"name":"transferGovernorship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockPeriod_","type":"uint256"}],"name":"updateLockPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"},{"internalType":"bytes32","name":"proofsFileHash_","type":"bytes32"}],"name":"updateMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updatedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60a060405262093a8060075534801561001757600080fd5b5060016000818155815462010000600160b01b0319163362010000810291909117909255604051732ebd53d035150f328bd754d6dc66b99b0edb89aa9291907fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d0908290a36001600160a01b03166080526080516112926100b06000396000818161033d015281816109a901526109f201526112926000f3fe6080604052600436106100f75760003560e01c806391db7b0d1161008a578063c3249e6311610059578063c3249e63146102c1578063c884ef83146102e9578063f3b27bc314610316578063fc0c546a1461032b57610115565b806391db7b0d1461024b578063a6a13bdc1461026b578063af88790514610281578063b6aa515b146102a157610115565b806348c5d41a116100c657806348c5d41a146101cd57806362c06767146101f55780637519ab50146102155780638a11a3701461022b57610115565b80630c340a241461012e5780632eb4a7ab146101715780632f52ebb7146101955780633fd8b02f146101b757610115565b3661011557604051636436c22d60e11b815260040160405180910390fd5b60405163a0152e6360e01b815260040160405180910390fd5b34801561013a57600080fd5b50600154610154906201000090046001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561017d57600080fd5b5061018760035481565b604051908152602001610168565b3480156101a157600080fd5b506101b56101b0366004610ffc565b61035f565b005b3480156101c357600080fd5b5061018760075481565b3480156101d957600080fd5b5061015473a28d70795a61dc925d4c220762a4344803876bb881565b34801561020157600080fd5b506101b5610210366004611093565b610524565b34801561022157600080fd5b5061018760055481565b34801561023757600080fd5b50600254610154906001600160a01b031681565b34801561025757600080fd5b506101b56102663660046110d4565b61055d565b34801561027757600080fd5b5061018760045481565b34801561028d57600080fd5b506101b561029c3660046110ed565b610593565b3480156102ad57600080fd5b506101b56102bc36600461110f565b610653565b3480156102cd57600080fd5b50610154732ebd53d035150f328bd754d6dc66b99b0edb89aa81565b3480156102f557600080fd5b5061018761030436600461110f565b60066020526000908152604090205481565b34801561032257600080fd5b506101b56106cd565b34801561033757600080fd5b506101547f000000000000000000000000000000000000000000000000000000000000000081565b600260005414156103b75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026000556003546103dc576040516312d37ee560e31b815260040160405180910390fd5b6040516bffffffffffffffffffffffff193360601b1660208201526034810184905260009060540160405160208183030381529060405280519060200120905061045d838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506003549150849050610773565b61047a576040516309bde33960e01b815260040160405180910390fd5b336000908152600660205260408120546104949086611142565b9050806104b4576040516312d37ee560e31b815260040160405180910390fd5b33600090815260066020526040812080548392906104d3908490611159565b909155506104e390503382610824565b60405181815233907f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f72419060200160405180910390a250506001600055505050565b61052c610ab0565b6001600160a01b038316610549576105448282610ae3565b505050565b6105446001600160a01b0384168383610bfc565b6001546201000090046001600160a01b0316331461058e57604051634b98449160e11b815260040160405180910390fd5b600755565b6001546201000090046001600160a01b031633146105c457604051634b98449160e11b815260040160405180910390fd5b6003548214156105e7576040516349b716b760e01b815260040160405180910390fd5b80610605576040516375cad62960e11b815260040160405180910390fd5b600382905542600581905560048290556040805184815260208101929092527fecb6e184c8c1ff50ab199b30650a76b7eb56fe2f261becc6284e0a3a1707be48910160405180910390a15050565b6001546201000090046001600160a01b0316331461068457604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166106ab57604051634c267bfb60e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b03163381146106f95760405163038cdbad60e31b815260040160405180910390fd5b6001546040516001600160a01b038084169262010000900416907fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d090600090a3600180546001600160a01b03909216620100000262010000600160b01b0319909216919091179055600280546001600160a01b0319169055565b600081815b855181101561081757600086828151811061079557610795611171565b602002602001015190508083116107d7576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250610804565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061080f81611187565b915050610778565b50831490505b9392505050565b60006007546005546108369190611159565b90504281101561085f57610544732ebd53d035150f328bd754d6dc66b99b0edb89aa8484610bfc565b600073a28d70795a61dc925d4c220762a4344803876bb86001600160a01b03166321a405896040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ae57600080fd5b505afa1580156108c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e691906111a2565b6108f1906001611159565b9050600073a28d70795a61dc925d4c220762a4344803876bb86001600160a01b0316637faf90576040518163ffffffff1660e01b815260040160206040518083038186803b15801561094257600080fd5b505afa158015610956573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097a91906111a2565b9050600061099a61099461098e4287611142565b85610c5f565b83610c76565b90506109e56001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001673a28d70795a61dc925d4c220762a4344803876bb86000610c85565b610a2d6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001673a28d70795a61dc925d4c220762a4344803876bb887610c85565b6040516341f12fc560e11b81526001600160a01b0387166004820152602481018690526044810182905273a28d70795a61dc925d4c220762a4344803876bb8906383e25f8a90606401600060405180830381600087803b158015610a9057600080fd5b505af1158015610aa4573d6000803e3d6000fd5b50505050505050505050565b6001546201000090046001600160a01b03163314610ae157604051634b98449160e11b815260040160405180910390fd5b565b80471015610b335760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016103ae565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610b80576040519150601f19603f3d011682016040523d82523d6000602084013e610b85565b606091505b50509050806105445760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016103ae565b6040516001600160a01b03831660248201526044810182905261054490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610da9565b600081831015610c6f578161081d565b5090919050565b6000818310610c6f578161081d565b801580610d0e5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015610cd457600080fd5b505afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c91906111a2565b155b610d795760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016103ae565b6040516001600160a01b03831660248201526044810182905261054490849063095ea7b360e01b90606401610c28565b6000610dfe826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610e7b9092919063ffffffff16565b8051909150156105445780806020019051810190610e1c91906111bb565b6105445760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103ae565b6060610e8a8484600085610e92565b949350505050565b606082471015610ef35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103ae565b6001600160a01b0385163b610f4a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103ae565b600080866001600160a01b03168587604051610f66919061120d565b60006040518083038185875af1925050503d8060008114610fa3576040519150601f19603f3d011682016040523d82523d6000602084013e610fa8565b606091505b5091509150610fb8828286610fc3565b979650505050505050565b60608315610fd257508161081d565b825115610fe25782518084602001fd5b8160405162461bcd60e51b81526004016103ae9190611229565b60008060006040848603121561101157600080fd5b83359250602084013567ffffffffffffffff8082111561103057600080fd5b818601915086601f83011261104457600080fd5b81358181111561105357600080fd5b8760208260051b850101111561106857600080fd5b6020830194508093505050509250925092565b6001600160a01b038116811461109057600080fd5b50565b6000806000606084860312156110a857600080fd5b83356110b38161107b565b925060208401356110c38161107b565b929592945050506040919091013590565b6000602082840312156110e657600080fd5b5035919050565b6000806040838503121561110057600080fd5b50508035926020909101359150565b60006020828403121561112157600080fd5b813561081d8161107b565b634e487b7160e01b600052601160045260246000fd5b6000828210156111545761115461112c565b500390565b6000821982111561116c5761116c61112c565b500190565b634e487b7160e01b600052603260045260246000fd5b600060001982141561119b5761119b61112c565b5060010190565b6000602082840312156111b457600080fd5b5051919050565b6000602082840312156111cd57600080fd5b8151801515811461081d57600080fd5b60005b838110156111f85781810151838201526020016111e0565b83811115611207576000848401525b50505050565b6000825161121f8184602087016111dd565b9190910192915050565b60208152600082518060208401526112488160408501602087016111dd565b601f01601f1916919091016040019291505056fea26469706673582212209cf8da6b86f2a75cfd06648a72cc9c3d4c3cde4247ce2aba437b40885908ccb364736f6c63430008090033
Deployed Bytecode
0x6080604052600436106100f75760003560e01c806391db7b0d1161008a578063c3249e6311610059578063c3249e63146102c1578063c884ef83146102e9578063f3b27bc314610316578063fc0c546a1461032b57610115565b806391db7b0d1461024b578063a6a13bdc1461026b578063af88790514610281578063b6aa515b146102a157610115565b806348c5d41a116100c657806348c5d41a146101cd57806362c06767146101f55780637519ab50146102155780638a11a3701461022b57610115565b80630c340a241461012e5780632eb4a7ab146101715780632f52ebb7146101955780633fd8b02f146101b757610115565b3661011557604051636436c22d60e11b815260040160405180910390fd5b60405163a0152e6360e01b815260040160405180910390fd5b34801561013a57600080fd5b50600154610154906201000090046001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561017d57600080fd5b5061018760035481565b604051908152602001610168565b3480156101a157600080fd5b506101b56101b0366004610ffc565b61035f565b005b3480156101c357600080fd5b5061018760075481565b3480156101d957600080fd5b5061015473a28d70795a61dc925d4c220762a4344803876bb881565b34801561020157600080fd5b506101b5610210366004611093565b610524565b34801561022157600080fd5b5061018760055481565b34801561023757600080fd5b50600254610154906001600160a01b031681565b34801561025757600080fd5b506101b56102663660046110d4565b61055d565b34801561027757600080fd5b5061018760045481565b34801561028d57600080fd5b506101b561029c3660046110ed565b610593565b3480156102ad57600080fd5b506101b56102bc36600461110f565b610653565b3480156102cd57600080fd5b50610154732ebd53d035150f328bd754d6dc66b99b0edb89aa81565b3480156102f557600080fd5b5061018761030436600461110f565b60066020526000908152604090205481565b34801561032257600080fd5b506101b56106cd565b34801561033757600080fd5b506101547f0000000000000000000000002ebd53d035150f328bd754d6dc66b99b0edb89aa81565b600260005414156103b75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026000556003546103dc576040516312d37ee560e31b815260040160405180910390fd5b6040516bffffffffffffffffffffffff193360601b1660208201526034810184905260009060540160405160208183030381529060405280519060200120905061045d838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506003549150849050610773565b61047a576040516309bde33960e01b815260040160405180910390fd5b336000908152600660205260408120546104949086611142565b9050806104b4576040516312d37ee560e31b815260040160405180910390fd5b33600090815260066020526040812080548392906104d3908490611159565b909155506104e390503382610824565b60405181815233907f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f72419060200160405180910390a250506001600055505050565b61052c610ab0565b6001600160a01b038316610549576105448282610ae3565b505050565b6105446001600160a01b0384168383610bfc565b6001546201000090046001600160a01b0316331461058e57604051634b98449160e11b815260040160405180910390fd5b600755565b6001546201000090046001600160a01b031633146105c457604051634b98449160e11b815260040160405180910390fd5b6003548214156105e7576040516349b716b760e01b815260040160405180910390fd5b80610605576040516375cad62960e11b815260040160405180910390fd5b600382905542600581905560048290556040805184815260208101929092527fecb6e184c8c1ff50ab199b30650a76b7eb56fe2f261becc6284e0a3a1707be48910160405180910390a15050565b6001546201000090046001600160a01b0316331461068457604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166106ab57604051634c267bfb60e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b03163381146106f95760405163038cdbad60e31b815260040160405180910390fd5b6001546040516001600160a01b038084169262010000900416907fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d090600090a3600180546001600160a01b03909216620100000262010000600160b01b0319909216919091179055600280546001600160a01b0319169055565b600081815b855181101561081757600086828151811061079557610795611171565b602002602001015190508083116107d7576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250610804565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061080f81611187565b915050610778565b50831490505b9392505050565b60006007546005546108369190611159565b90504281101561085f57610544732ebd53d035150f328bd754d6dc66b99b0edb89aa8484610bfc565b600073a28d70795a61dc925d4c220762a4344803876bb86001600160a01b03166321a405896040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ae57600080fd5b505afa1580156108c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e691906111a2565b6108f1906001611159565b9050600073a28d70795a61dc925d4c220762a4344803876bb86001600160a01b0316637faf90576040518163ffffffff1660e01b815260040160206040518083038186803b15801561094257600080fd5b505afa158015610956573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097a91906111a2565b9050600061099a61099461098e4287611142565b85610c5f565b83610c76565b90506109e56001600160a01b037f0000000000000000000000002ebd53d035150f328bd754d6dc66b99b0edb89aa1673a28d70795a61dc925d4c220762a4344803876bb86000610c85565b610a2d6001600160a01b037f0000000000000000000000002ebd53d035150f328bd754d6dc66b99b0edb89aa1673a28d70795a61dc925d4c220762a4344803876bb887610c85565b6040516341f12fc560e11b81526001600160a01b0387166004820152602481018690526044810182905273a28d70795a61dc925d4c220762a4344803876bb8906383e25f8a90606401600060405180830381600087803b158015610a9057600080fd5b505af1158015610aa4573d6000803e3d6000fd5b50505050505050505050565b6001546201000090046001600160a01b03163314610ae157604051634b98449160e11b815260040160405180910390fd5b565b80471015610b335760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016103ae565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610b80576040519150601f19603f3d011682016040523d82523d6000602084013e610b85565b606091505b50509050806105445760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016103ae565b6040516001600160a01b03831660248201526044810182905261054490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610da9565b600081831015610c6f578161081d565b5090919050565b6000818310610c6f578161081d565b801580610d0e5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015610cd457600080fd5b505afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c91906111a2565b155b610d795760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016103ae565b6040516001600160a01b03831660248201526044810182905261054490849063095ea7b360e01b90606401610c28565b6000610dfe826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610e7b9092919063ffffffff16565b8051909150156105445780806020019051810190610e1c91906111bb565b6105445760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103ae565b6060610e8a8484600085610e92565b949350505050565b606082471015610ef35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103ae565b6001600160a01b0385163b610f4a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103ae565b600080866001600160a01b03168587604051610f66919061120d565b60006040518083038185875af1925050503d8060008114610fa3576040519150601f19603f3d011682016040523d82523d6000602084013e610fa8565b606091505b5091509150610fb8828286610fc3565b979650505050505050565b60608315610fd257508161081d565b825115610fe25782518084602001fd5b8160405162461bcd60e51b81526004016103ae9190611229565b60008060006040848603121561101157600080fd5b83359250602084013567ffffffffffffffff8082111561103057600080fd5b818601915086601f83011261104457600080fd5b81358181111561105357600080fd5b8760208260051b850101111561106857600080fd5b6020830194508093505050509250925092565b6001600160a01b038116811461109057600080fd5b50565b6000806000606084860312156110a857600080fd5b83356110b38161107b565b925060208401356110c38161107b565b929592945050506040919091013590565b6000602082840312156110e657600080fd5b5035919050565b6000806040838503121561110057600080fd5b50508035926020909101359150565b60006020828403121561112157600080fd5b813561081d8161107b565b634e487b7160e01b600052601160045260246000fd5b6000828210156111545761115461112c565b500390565b6000821982111561116c5761116c61112c565b500190565b634e487b7160e01b600052603260045260246000fd5b600060001982141561119b5761119b61112c565b5060010190565b6000602082840312156111b457600080fd5b5051919050565b6000602082840312156111cd57600080fd5b8151801515811461081d57600080fd5b60005b838110156111f85781810151838201526020016111e0565b83811115611207576000848401525b50505050565b6000825161121f8184602087016111dd565b9190910192915050565b60208152600082518060208401526112488160408501602087016111dd565b601f01601f1916919091016040019291505056fea26469706673582212209cf8da6b86f2a75cfd06648a72cc9c3d4c3cde4247ce2aba437b40885908ccb364736f6c63430008090033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.