Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 260 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Transfer Ownersh... | 23646660 | 120 days ago | IN | 0 ETH | 0.00003118 | ||||
| Claim ERC20 | 23643133 | 121 days ago | IN | 0 ETH | 0.0002021 | ||||
| Claim ERC20 | 23636765 | 122 days ago | IN | 0 ETH | 0.00020178 | ||||
| Claim ERC20 | 23635316 | 122 days ago | IN | 0 ETH | 0.0002119 | ||||
| Claim ERC20 | 23583038 | 129 days ago | IN | 0 ETH | 0.00017008 | ||||
| Claim ERC20 | 23570481 | 131 days ago | IN | 0 ETH | 0.00007777 | ||||
| Claim ERC20 | 23544811 | 135 days ago | IN | 0 ETH | 0.00016223 | ||||
| Claim ERC20 | 23539178 | 135 days ago | IN | 0 ETH | 0.0002242 | ||||
| Claim ERC20 | 23471126 | 145 days ago | IN | 0 ETH | 0.0002186 | ||||
| Claim ERC20 | 23471074 | 145 days ago | IN | 0 ETH | 0.00015994 | ||||
| Claim ERC20 | 23471023 | 145 days ago | IN | 0 ETH | 0.00017353 | ||||
| Claim ERC20 | 23415506 | 153 days ago | IN | 0 ETH | 0.00001128 | ||||
| Claim ERC20 | 23410145 | 153 days ago | IN | 0 ETH | 0.0000127 | ||||
| Claim ERC20 | 23386591 | 157 days ago | IN | 0 ETH | 0.00011481 | ||||
| Claim ERC20 | 23383730 | 157 days ago | IN | 0 ETH | 0.00022965 | ||||
| Claim ERC20 | 23382341 | 157 days ago | IN | 0 ETH | 0.00002861 | ||||
| Claim ERC20 | 23380376 | 158 days ago | IN | 0 ETH | 0.00001363 | ||||
| Claim ERC20 | 23380011 | 158 days ago | IN | 0 ETH | 0.00011245 | ||||
| Claim ERC20 | 23379969 | 158 days ago | IN | 0 ETH | 0.00010962 | ||||
| Claim ERC20 | 23346340 | 162 days ago | IN | 0 ETH | 0.00012358 | ||||
| Claim ERC20 | 23342145 | 163 days ago | IN | 0 ETH | 0.00000933 | ||||
| Claim ERC20 | 23342142 | 163 days ago | IN | 0 ETH | 0.00002641 | ||||
| Claim ERC20 | 23339117 | 163 days ago | IN | 0 ETH | 0.00012356 | ||||
| Claim ERC20 | 23334877 | 164 days ago | IN | 0 ETH | 0.00015744 | ||||
| Claim ERC20 | 23332785 | 164 days ago | IN | 0 ETH | 0.00015542 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
AirdropClaim
Compiler Version
v0.8.30+commit.73712a01
Optimization Enabled:
Yes with 1000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@lukso/lsp7-contracts/contracts/ILSP7DigitalAsset.sol";
import {
_INTERFACEID_LSP7,
_INTERFACEID_LSP7_V0_12_0,
_INTERFACEID_LSP7_V0_14_0
} from "@lukso/lsp7-contracts/contracts/LSP7Constants.sol";
/**
* @title AirdropClaim
* @dev Contract for claiming tokens from an airdrop using merkle proofs
*/
contract AirdropClaim is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
// The merkle root of the merkle tree containing the airdrop distribution
bytes32 public immutable merkleRoot;
// The token being distributed
address public immutable token;
bool public immutable isLSP7;
uint256 public totalClaimed;
// Mapping of addresses that have claimed their tokens
mapping(address => mapping(uint256 => bool)) public hasClaimed;
// Events
event AirdropClaimed(address indexed account, uint256 amount);
/**
* @dev Constructor to initialize the contract with the token address and merkle root
* @param _token The token contract address
* @param _merkleRoot The merkle root of the airdrop distribution
*/
constructor(address _token, bytes32 _merkleRoot) Ownable() {
token = _token;
merkleRoot = _merkleRoot;
isLSP7 = checkLSP7(token);
}
function checkLSP7(address target) internal view returns (bool) {
if (!ERC165Checker.supportsERC165(target)) {
return false;
}
return (
ERC165Checker.supportsInterface(target, _INTERFACEID_LSP7) ||
ERC165Checker.supportsInterface(target, _INTERFACEID_LSP7_V0_12_0) ||
ERC165Checker.supportsInterface(target, _INTERFACEID_LSP7_V0_14_0)
);
}
receive() external payable {
revert("This contract does not accept ETH");
}
fallback() external payable {
revert("This contract does not accept ETH");
}
function handleClaim(uint256 amount, bytes32[] memory merkleProof) internal {
require(hasClaimed[msg.sender][amount] == false, "Already claimed");
hasClaimed[msg.sender][amount] = true;
bytes32 leaf = keccak256(bytes.concat(keccak256(abi.encode(msg.sender, amount))));
require(MerkleProof.verify(merkleProof, merkleRoot, leaf), "Invalid proof");
totalClaimed += amount;
emit AirdropClaimed(msg.sender, amount);
}
function claimLSP7(uint256 amount, bytes32[] memory merkleProof, bool force) external nonReentrant {
require(isLSP7, "Token is not an LSP7 token");
handleClaim(amount, merkleProof);
ILSP7DigitalAsset(token).transfer(address(this), msg.sender, amount, force, "");
}
function claimERC20(uint256 amount, bytes32[] memory merkleProof) external nonReentrant {
require(!isLSP7, "Token is not an ERC20 token");
handleClaim(amount, merkleProof);
IERC20(token).safeTransfer(msg.sender, amount);
}
function recoverLSP7(address recoverToken) external onlyOwner nonReentrant {
uint256 balance = ILSP7DigitalAsset(recoverToken).balanceOf(address(this));
require(balance > 0, "No tokens to recover");
ILSP7DigitalAsset(recoverToken).transfer(address(this), owner(), balance, true, "");
}
function recoverERC20(address recoverToken) external onlyOwner nonReentrant {
uint256 balance = IERC20(recoverToken).balanceOf(address(this));
require(balance > 0, "No tokens to recover");
IERC20(recoverToken).safeTransfer(owner(), balance);
}
function renounceOwnership() public view override onlyOwner {
revert("Ownership cannot be renounced");
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/introspection/ERC165Checker.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Library used to query support of an interface declared via {IERC165}.
*
* Note that these functions return the actual result of the query: they do not
* `revert` if an interface is not supported. It is up to the caller to decide
* what to do in these cases.
*/
library ERC165Checker {
// As per the EIP-165 spec, no interface should ever match 0xffffffff
bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;
/**
* @dev Returns true if `account` supports the {IERC165} interface.
*/
function supportsERC165(address account) internal view returns (bool) {
// Any contract that implements ERC165 must explicitly indicate support of
// InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
return
supportsERC165InterfaceUnchecked(account, type(IERC165).interfaceId) &&
!supportsERC165InterfaceUnchecked(account, _INTERFACE_ID_INVALID);
}
/**
* @dev Returns true if `account` supports the interface defined by
* `interfaceId`. Support for {IERC165} itself is queried automatically.
*
* See {IERC165-supportsInterface}.
*/
function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
// query support of both ERC165 as per the spec and support of _interfaceId
return supportsERC165(account) && supportsERC165InterfaceUnchecked(account, interfaceId);
}
/**
* @dev Returns a boolean array where each value corresponds to the
* interfaces passed in and whether they're supported or not. This allows
* you to batch check interfaces for a contract where your expectation
* is that some interfaces may not be supported.
*
* See {IERC165-supportsInterface}.
*
* _Available since v3.4._
*/
function getSupportedInterfaces(
address account,
bytes4[] memory interfaceIds
) internal view returns (bool[] memory) {
// an array of booleans corresponding to interfaceIds and whether they're supported or not
bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);
// query support of ERC165 itself
if (supportsERC165(account)) {
// query support of each interface in interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
interfaceIdsSupported[i] = supportsERC165InterfaceUnchecked(account, interfaceIds[i]);
}
}
return interfaceIdsSupported;
}
/**
* @dev Returns true if `account` supports all the interfaces defined in
* `interfaceIds`. Support for {IERC165} itself is queried automatically.
*
* Batch-querying can lead to gas savings by skipping repeated checks for
* {IERC165} support.
*
* See {IERC165-supportsInterface}.
*/
function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
// query support of ERC165 itself
if (!supportsERC165(account)) {
return false;
}
// query support of each interface in interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
if (!supportsERC165InterfaceUnchecked(account, interfaceIds[i])) {
return false;
}
}
// all interfaces supported
return true;
}
/**
* @notice Query if a contract implements an interface, does not check ERC165 support
* @param account The address of the contract to query for support of an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @return true if the contract at account indicates support of the interface with
* identifier interfaceId, false otherwise
* @dev Assumes that account contains a contract that supports ERC165, otherwise
* the behavior of this method is undefined. This precondition can be checked
* with {supportsERC165}.
*
* Some precompiled contracts will falsely indicate support for a given interface, so caution
* should be exercised when using this function.
*
* Interface identification is specified in ERC-165.
*/
function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) {
// prepare call
bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);
// perform static call
bool success;
uint256 returnSize;
uint256 returnValue;
assembly {
success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)
returnSize := returndatasize()
returnValue := mload(0x00)
}
return success && returnSize >= 0x20 && returnValue > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/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;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(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));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
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");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface 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].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Tree proofs.
*
* The tree and the proofs can be generated using our
* https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
* You will find a quickstart guide in the readme.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the merkle tree could be reinterpreted as a leaf value.
* OpenZeppelin's JavaScript library generates merkle trees that are safe
* against this attack out of the box.
*/
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) {
return processProof(proof, leaf) == root;
}
/**
* @dev Calldata version of {verify}
*
* _Available since v4.7._
*/
function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Calldata version of {processProof}
*
* _Available since v4.7._
*/
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
*
* _Available since v4.7._
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
/**
* @dev Calldata version of {multiProofVerify}
*
* CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
*
* _Available since v4.7._
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* _Available since v4.7._
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofLen = proof.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
require(proofPos == proofLen, "MerkleProof: invalid multiproof");
unchecked {
return hashes[totalHashes - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Calldata version of {processMultiProof}.
*
* CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
*
* _Available since v4.7._
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofLen = proof.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
require(proofPos == proofLen, "MerkleProof: invalid multiproof");
unchecked {
return hashes[totalHashes - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.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 Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.4;
/**
* @title Interface of the LSP7 - Digital Asset standard, a fungible digital asset.
*/
interface ILSP7DigitalAsset {
// --- Events
/**
* @dev Emitted when the `from` transferred successfully `amount` of tokens to `to`.
* @param operator The address of the operator that executed the transfer.
* @param from The address which tokens were sent from (balance decreased by `-amount`).
* @param to The address that received the tokens (balance increased by `+amount`).
* @param amount The amount of tokens transferred.
* @param force if the transferred enforced the `to` recipient address to be a contract that implements the LSP1 standard or not.
* @param data Any additional data included by the caller during the transfer, and sent in the LSP1 hooks to the `from` and `to` addresses.
*/
event Transfer(
address indexed operator,
address indexed from,
address indexed to,
uint256 amount,
bool force,
bytes data
);
/**
* @dev Emitted when `tokenOwner` enables `operator` for `amount` tokens.
* @param operator The address authorized as an operator
* @param tokenOwner The token owner
* @param amount The amount of tokens `operator` address has access to from `tokenOwner`
* @param operatorNotificationData The data to notify the operator about via LSP1.
*/
event OperatorAuthorizationChanged(
address indexed operator,
address indexed tokenOwner,
uint256 indexed amount,
bytes operatorNotificationData
);
/**
* @dev Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its {`authorizedAmountFor(...)`} to `0`.
* @param operator The address revoked from operating
* @param tokenOwner The token owner
* @param notified Bool indicating whether the operator has been notified or not
* @param operatorNotificationData The data to notify the operator about via LSP1.
*/
event OperatorRevoked(
address indexed operator,
address indexed tokenOwner,
bool indexed notified,
bytes operatorNotificationData
);
// --- Token queries
/**
* @dev Returns the number of decimals used to get its user representation.
* If the asset contract has been set to be non-divisible via the `isNonDivisible_` parameter in
* the `constructor`, the decimals returned will be `0`. Otherwise `18` is the common value.
*
* @custom:notice This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {balanceOf} and {transfer}.
*
* @return the number of decimals. If `0` is returned, the asset is non-divisible.
*/
function decimals() external view returns (uint8);
/**
* @dev Returns the number of existing tokens that have been minted in this contract.
* @return The number of existing tokens.
*/
function totalSupply() external view returns (uint256);
// --- Token owner queries
/**
* @dev Get the number of tokens owned by `tokenOwner`.
* If the token is divisible (the {decimals} function returns `18`), the amount returned should be divided
* by 1e18 to get a better picture of the actual balance of the `tokenOwner`.
*
* _Example:_
*
* ```
* balanceOf(someAddress) -> 42_000_000_000_000_000_000 / 1e18 = 42 tokens
* ```
*
* @param tokenOwner The address of the token holder to query the balance for.
* @return The amount of tokens owned by `tokenOwner`.
*/
function balanceOf(address tokenOwner) external view returns (uint256);
// --- Operator functionality
/**
* @dev Sets an `amount` of tokens that an `operator` has access from the caller's balance (allowance). See {authorizedAmountFor}.
* Notify the operator based on the LSP1-UniversalReceiver standard
*
* @param operator The address to authorize as an operator.
* @param amount The allowance amount of tokens operator has access to.
* @param operatorNotificationData The data to notify the operator about via LSP1.
*
* @custom:requirements
* - `operator` cannot be the zero address.
*
* @custom:events {OperatorAuthorizationChanged} when allowance is given to a new operator or
* an existing operator's allowance is updated.
*/
function authorizeOperator(
address operator,
uint256 amount,
bytes memory operatorNotificationData
) external;
/**
* @dev Enables `tokenOwner` to remove `operator` for its tokens, disallowing it to send any amount of tokens on its behalf.
* This function also allows the `operator` to remove itself if it is the caller of this function
*
* @param operator The address to revoke as an operator.
* @param tokenOwner The address of the token owner.
* @param notify Boolean indicating whether to notify the operator or not.
* @param operatorNotificationData The data to notify the operator about via LSP1.
*
* @custom:requirements
* - caller MUST be `operator` or `tokenOwner`
* - `operator` cannot be the zero address.
*
* @custom:events {OperatorRevoked} event with address of the operator being revoked for the caller (token holder).
*/
function revokeOperator(
address operator,
address tokenOwner,
bool notify,
bytes memory operatorNotificationData
) external;
/**
* @custom:info This function in the LSP7 contract can be used as a prevention mechanism
* against double spending allowance vulnerability.
*
* @notice Increase the allowance of `operator` by +`addedAmount`
*
* @dev Atomically increases the allowance granted to `operator` by the caller.
* This is an alternative approach to {authorizeOperator} that can be used as a mitigation
* for the double spending allowance problem.
* Notify the operator based on the LSP1-UniversalReceiver standard
*
* @param operator The operator to increase the allowance for `msg.sender`
* @param addedAmount The additional amount to add on top of the current operator's allowance
*
* @custom:requirements
* - `operator` cannot be the same address as `msg.sender`
* - `operator` cannot be the zero address.
*
* @custom:events {OperatorAuthorizationChanged} indicating the updated allowance
*/
function increaseAllowance(
address operator,
uint256 addedAmount,
bytes memory operatorNotificationData
) external;
/**
* @custom:info This function in the LSP7 contract can be used as a prevention mechanism
* against the double spending allowance vulnerability.
*
* @notice Decrease the allowance of `operator` by -`subtractedAmount`
*
* @dev Atomically decreases the allowance granted to `operator` by the caller.
* This is an alternative approach to {authorizeOperator} that can be used as a mitigation
* for the double spending allowance problem.
* Notify the operator based on the LSP1-UniversalReceiver standard
*
* @custom:events
* - {OperatorAuthorizationChanged} event indicating the updated allowance after decreasing it.
* - {OperatorRevoked} event if `subtractedAmount` is the full allowance,
* indicating `operator` does not have any alauthorizedAmountForlowance left for `msg.sender`.
*
* @param operator The operator to decrease allowance for `msg.sender`
* @param tokenOwner The address of the token owner.
* @param subtractedAmount The amount to decrease by in the operator's allowance.
*
* @custom:requirements
* - `operator` cannot be the zero address.
* - `operator` must have allowance for the caller of at least `subtractedAmount`.
*/
function decreaseAllowance(
address operator,
address tokenOwner,
uint256 subtractedAmount,
bytes memory operatorNotificationData
) external;
/**
* @dev Get the amount of tokens `operator` address has access to from `tokenOwner`.
* Operators can send and burn tokens on behalf of their owners.
*
* @param operator The operator's address to query the authorized amount for.
* @param tokenOwner The token owner that `operator` has allowance on.
*
* @return The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance.
*
* @custom:info If this function is called with the same address for `operator` and `tokenOwner`, it will simply read the `tokenOwner`'s balance
* (since a tokenOwner is its own operator).
*/
function authorizedAmountFor(
address operator,
address tokenOwner
) external view returns (uint256);
/**
* @dev Returns all `operator` addresses that are allowed to transfer or burn on behalf of `tokenOwner`.
*
* @param tokenOwner The token owner to get the operators for.
* @return An array of operators allowed to transfer or burn tokens on behalf of `tokenOwner`.
*/
function getOperatorsOf(
address tokenOwner
) external view returns (address[] memory);
// --- Transfer functionality
/**
* @dev Transfers an `amount` of tokens from the `from` address to the `to` address and notify both sender and recipients via the LSP1 {`universalReceiver(...)`} function.
* If the tokens are transferred by an operator on behalf of a token holder, the allowance for the operator will be decreased by `amount` once the token transfer
* has been completed (See {authorizedAmountFor}).
*
* @param from The sender address.
* @param to The recipient address.
* @param amount The amount of tokens to transfer.
* @param force When set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard.
* @param data Any additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses.
*
* @custom:requirements
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` and `to` cannot be the same address (`from` cannot send tokens to itself).
* - `from` MUST have a balance of at least `amount` tokens.
* - If the caller is not `from`, it must be an operator for `from` with an allowance of at least `amount` of tokens.
*
* @custom:events
* - {Transfer} event when tokens get successfully transferred.
* - if the transfer is triggered by an operator, either the {OperatorAuthorizationChanged} event will be emitted with the updated allowance or the {OperatorRevoked}
* event will be emitted if the operator has no more allowance left.
*
* @custom:hint The `force` parameter **MUST be set to `true`** to transfer tokens to Externally Owned Accounts (EOAs)
* or contracts that do not implement the LSP1 Universal Receiver Standard. Otherwise the function will revert making the transfer fail.
*
* @custom:info if the `to` address is a contract that implements LSP1, it will always be notified via its `universalReceiver(...)` function, regardless if `force` is set to `true` or `false`.
*
* @custom:info Note that token transfers revert when no allowance is given, including when the `amount` is `0`.
* This is to prevent this function from being used maliciously, such as performing zero-value token transfer phishing attacks.
*
* @custom:warning Be aware that when either the sender or the recipient can have logic that revert in their `universalReceiver(...)` function when being notified.
* This even if the `force` was set to `true`.
*/
function transfer(
address from,
address to,
uint256 amount,
bool force,
bytes memory data
) external;
/**
* @dev Same as {`transfer(...)`} but transfer multiple tokens based on the arrays of `from`, `to`, `amount`.
*
* @custom:info If any transfer in the batch fail or revert, the whole call will revert.
*
* @param from An array of sending addresses.
* @param to An array of receiving addresses.
* @param amount An array of amount of tokens to transfer for each `from -> to` transfer.
* @param force For each transfer, when set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard.
* @param data An array of additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses.
*
* @custom:requirements
* - `from`, `to`, `amount` lists MUST be of the same length.
* - no values in `from` can be the zero address.
* - no values in `to` can be the zero address.
* - each `amount` tokens MUST be owned by `from`.
* - for each transfer, if the caller is not `from`, it MUST be an operator for `from` with access to at least `amount` tokens.
*
* @custom:events {Transfer} event **for each token transfer**.
*/
function transferBatch(
address[] memory from,
address[] memory to,
uint256[] memory amount,
bool[] memory force,
bytes[] memory data
) external;
/**
* @notice Executing the following batch of abi-encoded function calls on the contract: `data`.
*
* @dev Allows a caller to batch different function calls in one call. Perform a `delegatecall` on self, to call different functions with preserving the context.
* @param data An array of ABI encoded function calls to be called on the contract.
* @return results An array of abi-encoded data returned by the functions executed.
*/
function batchCalls(
bytes[] calldata data
) external returns (bytes[] memory results);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.4;
// --- ERC165 interface ids
bytes4 constant _INTERFACEID_LSP7 = 0xc52d6008;
bytes4 constant _INTERFACEID_LSP7_V0_12_0 = 0xdaa746b7;
bytes4 constant _INTERFACEID_LSP7_V0_14_0 = 0xb3c4928f;
// --- Token Hooks
// keccak256('LSP7Tokens_DelegatorNotification')
bytes32 constant _TYPEID_LSP7_DELEGATOR = 0x997bd66a7e7823b09383ec7ce65fc306af29b8f82a45627f8efc0408475de016;
// keccak256('LSP7Tokens_DelegateeNotification')
bytes32 constant _TYPEID_LSP7_DELEGATEE = 0x03fae98a28026f93c23e2c9438c2ef0faa101585127a89919d18f067d907b319;
// keccak256('LSP7Tokens_SenderNotification')
bytes32 constant _TYPEID_LSP7_TOKENSSENDER = 0x429ac7a06903dbc9c13dfcb3c9d11df8194581fa047c96d7a4171fc7402958ea;
// keccak256('LSP7Tokens_RecipientNotification')
bytes32 constant _TYPEID_LSP7_TOKENSRECIPIENT = 0x20804611b3e2ea21c480dc465142210acf4a2485947541770ec1fb87dee4a55c;
// keccak256('LSP7Tokens_OperatorNotification')
bytes32 constant _TYPEID_LSP7_TOKENOPERATOR = 0x386072cc5a58e61263b434c722725f21031cd06e7c552cfaa06db5de8a320dbc;{
"optimizer": {
"enabled": true,
"runs": 1000
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AirdropClaimed","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"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claimERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"internalType":"bool","name":"force","type":"bool"}],"name":"claimLSP7","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"hasClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isLSP7","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recoverToken","type":"address"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recoverToken","type":"address"}],"name":"recoverLSP7","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60e060405234801561001057600080fd5b5060405161149138038061149183398101604081905261002f916101f1565b61003833610066565b600180556001600160a01b03821660a08190526080829052610059906100b6565b151560c0525061022b9050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006100c182610112565b6100cd57506000919050565b6100de826318a5ac0160e31b610145565b806100f557506100f58263daa746b760e01b610145565b8061010c575061010c8263b3c4928f60e01b610145565b92915050565b6000610125826301ffc9a760e01b610168565b801561010c575061013e826001600160e01b0319610168565b1592915050565b600061015083610112565b801561016157506101618383610168565b9392505050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d915060005190508280156101da575060208210155b80156101e65750600081115b979650505050505050565b6000806040838503121561020457600080fd5b82516001600160a01b038116811461021b57600080fd5b6020939093015192949293505050565b60805160a05160c05161121461027d60003960008181610350015281816103cc015261048d01526000818161031c0152818161044f015261055301526000818161018b0152610a7201526112146000f3fe6080604052600436106100cb5760003560e01c8063a33c5c7d11610074578063f2fde38b1161004e578063f2fde38b146102ea578063fc0c546a1461030a578063ffe35a651461033e57610127565b8063a33c5c7d14610269578063b293109614610289578063d54ad2a1146102d457610127565b80639b2aa5e5116100a55780639b2aa5e5146102095780639e6398a5146102295780639e8c708e1461024957610127565b80632eb4a7ab14610179578063715018a6146101c05780638da5cb5b146101d757610127565b366101275760405162461bcd60e51b815260206004820152602160248201527f5468697320636f6e747261637420646f6573206e6f74206163636570742045546044820152600960fb1b60648201526084015b60405180910390fd5b60405162461bcd60e51b815260206004820152602160248201527f5468697320636f6e747261637420646f6573206e6f74206163636570742045546044820152600960fb1b606482015260840161011e565b34801561018557600080fd5b506101ad7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b3480156101cc57600080fd5b506101d5610372565b005b3480156101e357600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101b7565b34801561021557600080fd5b506101d5610224366004610fed565b6103c2565b34801561023557600080fd5b506101d5610244366004611042565b610483565b34801561025557600080fd5b506101d56102643660046110b9565b6105c5565b34801561027557600080fd5b506101d56102843660046110b9565b6106c5565b34801561029557600080fd5b506102c46102a43660046110d4565b600360209081526000928352604080842090915290825290205460ff1681565b60405190151581526020016101b7565b3480156102e057600080fd5b506101ad60025481565b3480156102f657600080fd5b506101d56103053660046110b9565b610852565b34801561031657600080fd5b506101f17f000000000000000000000000000000000000000000000000000000000000000081565b34801561034a57600080fd5b506102c47f000000000000000000000000000000000000000000000000000000000000000081565b61037a6108df565b60405162461bcd60e51b815260206004820152601d60248201527f4f776e6572736869702063616e6e6f742062652072656e6f756e636564000000604482015260640161011e565b6103ca61093b565b7f0000000000000000000000000000000000000000000000000000000000000000156104385760405162461bcd60e51b815260206004820152601b60248201527f546f6b656e206973206e6f7420616e20455243323020746f6b656e0000000000604482015260640161011e565b6104428282610994565b6104766001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163384610b34565b61047f60018055565b5050565b61048b61093b565b7f00000000000000000000000000000000000000000000000000000000000000006104f85760405162461bcd60e51b815260206004820152601a60248201527f546f6b656e206973206e6f7420616e204c53503720746f6b656e000000000000604482015260640161011e565b6105028383610994565b6040517f760d9bba00000000000000000000000000000000000000000000000000000000815230600482015233602482015260448101849052811515606482015260a06084820152600060a48201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063760d9bba9060c401600060405180830381600087803b15801561059f57600080fd5b505af11580156105b3573d6000803e3d6000fd5b505050506105c060018055565b505050565b6105cd6108df565b6105d561093b565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561061c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064091906110fe565b9050600081116106925760405162461bcd60e51b815260206004820152601460248201527f4e6f20746f6b656e7320746f207265636f766572000000000000000000000000604482015260640161011e565b6106b86106a76000546001600160a01b031690565b6001600160a01b0384169083610b34565b506106c260018055565b50565b6106cd6108df565b6106d561093b565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561071c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074091906110fe565b9050600081116107925760405162461bcd60e51b815260206004820152601460248201527f4e6f20746f6b656e7320746f207265636f766572000000000000000000000000604482015260640161011e565b816001600160a01b031663760d9bba306107b46000546001600160a01b031690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03928316600482015291166024820152604481018490526001606482015260a06084820152600060a482015260c401600060405180830381600087803b15801561083057600080fd5b505af1158015610844573d6000803e3d6000fd5b50505050506106c260018055565b61085a6108df565b6001600160a01b0381166108d65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161011e565b6106c281610bb4565b6000546001600160a01b031633146109395760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161011e565b565b60026001540361098d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161011e565b6002600155565b33600090815260036020908152604080832085845290915290205460ff16156109ff5760405162461bcd60e51b815260206004820152600f60248201527f416c726561647920636c61696d65640000000000000000000000000000000000604482015260640161011e565b3360008181526003602090815260408083208684528252808320805460ff191660011790558051918201939093529182018490529060600160408051601f1981840301815282825280516020918201209083015201604051602081830303815290604052805190602001209050610a97827f000000000000000000000000000000000000000000000000000000000000000083610c1c565b610ae35760405162461bcd60e51b815260206004820152600d60248201527f496e76616c69642070726f6f6600000000000000000000000000000000000000604482015260640161011e565b8260026000828254610af59190611117565b909155505060405183815233907f650e45f04ef8a0c267b2f78d983913f69ae3a353b2b32de5429307522be0ab559060200160405180910390a2505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526105c0908490610c32565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082610c298584610d1a565b14949350505050565b6000610c87826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610d5f9092919063ffffffff16565b9050805160001480610ca8575080806020019051810190610ca89190611138565b6105c05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161011e565b600081815b8451811015610d5557610d4b82868381518110610d3e57610d3e611155565b6020026020010151610d76565b9150600101610d1f565b5090505b92915050565b6060610d6e8484600085610da8565b949350505050565b6000818310610d92576000828152602084905260409020610da1565b60008381526020839052604090205b9392505050565b606082471015610e205760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161011e565b600080866001600160a01b03168587604051610e3c919061118f565b60006040518083038185875af1925050503d8060008114610e79576040519150601f19603f3d011682016040523d82523d6000602084013e610e7e565b606091505b5091509150610e8f87838387610e9a565b979650505050505050565b60608315610f09578251600003610f02576001600160a01b0385163b610f025760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161011e565b5081610d6e565b610d6e8383815115610f1e5781518083602001fd5b8060405162461bcd60e51b815260040161011e91906111ab565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610f5f57600080fd5b813567ffffffffffffffff811115610f7957610f79610f38565b8060051b604051601f19603f830116810181811067ffffffffffffffff82111715610fa657610fa6610f38565b604052918252602081850181019290810186841115610fc457600080fd5b6020860192505b83831015610fe3578235815260209283019201610fcb565b5095945050505050565b6000806040838503121561100057600080fd5b82359150602083013567ffffffffffffffff81111561101e57600080fd5b61102a85828601610f4e565b9150509250929050565b80151581146106c257600080fd5b60008060006060848603121561105757600080fd5b83359250602084013567ffffffffffffffff81111561107557600080fd5b61108186828701610f4e565b925050604084013561109281611034565b809150509250925092565b80356001600160a01b03811681146110b457600080fd5b919050565b6000602082840312156110cb57600080fd5b610da18261109d565b600080604083850312156110e757600080fd5b6110f08361109d565b946020939093013593505050565b60006020828403121561111057600080fd5b5051919050565b80820180821115610d5957634e487b7160e01b600052601160045260246000fd5b60006020828403121561114a57600080fd5b8151610da181611034565b634e487b7160e01b600052603260045260246000fd5b60005b8381101561118657818101518382015260200161116e565b50506000910152565b600082516111a181846020870161116b565b9190910192915050565b60208152600082518060208401526111ca81604085016020870161116b565b601f01601f1916919091016040019291505056fea26469706673582212203c31086a235c0a0d6e197eb5b08e732b4d72b2ec2faced326027cc81d8f7be4864736f6c634300081e0033000000000000000000000000ddeb1a370a88c5bcb6ec10191c03f8ec1d2bd6facb27a6b87aebe8b9bf0705c7fe30a5b005335665aaab35e26db55c3ab965b8a1
Deployed Bytecode
0x6080604052600436106100cb5760003560e01c8063a33c5c7d11610074578063f2fde38b1161004e578063f2fde38b146102ea578063fc0c546a1461030a578063ffe35a651461033e57610127565b8063a33c5c7d14610269578063b293109614610289578063d54ad2a1146102d457610127565b80639b2aa5e5116100a55780639b2aa5e5146102095780639e6398a5146102295780639e8c708e1461024957610127565b80632eb4a7ab14610179578063715018a6146101c05780638da5cb5b146101d757610127565b366101275760405162461bcd60e51b815260206004820152602160248201527f5468697320636f6e747261637420646f6573206e6f74206163636570742045546044820152600960fb1b60648201526084015b60405180910390fd5b60405162461bcd60e51b815260206004820152602160248201527f5468697320636f6e747261637420646f6573206e6f74206163636570742045546044820152600960fb1b606482015260840161011e565b34801561018557600080fd5b506101ad7fcb27a6b87aebe8b9bf0705c7fe30a5b005335665aaab35e26db55c3ab965b8a181565b6040519081526020015b60405180910390f35b3480156101cc57600080fd5b506101d5610372565b005b3480156101e357600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101b7565b34801561021557600080fd5b506101d5610224366004610fed565b6103c2565b34801561023557600080fd5b506101d5610244366004611042565b610483565b34801561025557600080fd5b506101d56102643660046110b9565b6105c5565b34801561027557600080fd5b506101d56102843660046110b9565b6106c5565b34801561029557600080fd5b506102c46102a43660046110d4565b600360209081526000928352604080842090915290825290205460ff1681565b60405190151581526020016101b7565b3480156102e057600080fd5b506101ad60025481565b3480156102f657600080fd5b506101d56103053660046110b9565b610852565b34801561031657600080fd5b506101f17f000000000000000000000000ddeb1a370a88c5bcb6ec10191c03f8ec1d2bd6fa81565b34801561034a57600080fd5b506102c47f000000000000000000000000000000000000000000000000000000000000000081565b61037a6108df565b60405162461bcd60e51b815260206004820152601d60248201527f4f776e6572736869702063616e6e6f742062652072656e6f756e636564000000604482015260640161011e565b6103ca61093b565b7f0000000000000000000000000000000000000000000000000000000000000000156104385760405162461bcd60e51b815260206004820152601b60248201527f546f6b656e206973206e6f7420616e20455243323020746f6b656e0000000000604482015260640161011e565b6104428282610994565b6104766001600160a01b037f000000000000000000000000ddeb1a370a88c5bcb6ec10191c03f8ec1d2bd6fa163384610b34565b61047f60018055565b5050565b61048b61093b565b7f00000000000000000000000000000000000000000000000000000000000000006104f85760405162461bcd60e51b815260206004820152601a60248201527f546f6b656e206973206e6f7420616e204c53503720746f6b656e000000000000604482015260640161011e565b6105028383610994565b6040517f760d9bba00000000000000000000000000000000000000000000000000000000815230600482015233602482015260448101849052811515606482015260a06084820152600060a48201527f000000000000000000000000ddeb1a370a88c5bcb6ec10191c03f8ec1d2bd6fa6001600160a01b03169063760d9bba9060c401600060405180830381600087803b15801561059f57600080fd5b505af11580156105b3573d6000803e3d6000fd5b505050506105c060018055565b505050565b6105cd6108df565b6105d561093b565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561061c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064091906110fe565b9050600081116106925760405162461bcd60e51b815260206004820152601460248201527f4e6f20746f6b656e7320746f207265636f766572000000000000000000000000604482015260640161011e565b6106b86106a76000546001600160a01b031690565b6001600160a01b0384169083610b34565b506106c260018055565b50565b6106cd6108df565b6106d561093b565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561071c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074091906110fe565b9050600081116107925760405162461bcd60e51b815260206004820152601460248201527f4e6f20746f6b656e7320746f207265636f766572000000000000000000000000604482015260640161011e565b816001600160a01b031663760d9bba306107b46000546001600160a01b031690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03928316600482015291166024820152604481018490526001606482015260a06084820152600060a482015260c401600060405180830381600087803b15801561083057600080fd5b505af1158015610844573d6000803e3d6000fd5b50505050506106c260018055565b61085a6108df565b6001600160a01b0381166108d65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161011e565b6106c281610bb4565b6000546001600160a01b031633146109395760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161011e565b565b60026001540361098d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161011e565b6002600155565b33600090815260036020908152604080832085845290915290205460ff16156109ff5760405162461bcd60e51b815260206004820152600f60248201527f416c726561647920636c61696d65640000000000000000000000000000000000604482015260640161011e565b3360008181526003602090815260408083208684528252808320805460ff191660011790558051918201939093529182018490529060600160408051601f1981840301815282825280516020918201209083015201604051602081830303815290604052805190602001209050610a97827fcb27a6b87aebe8b9bf0705c7fe30a5b005335665aaab35e26db55c3ab965b8a183610c1c565b610ae35760405162461bcd60e51b815260206004820152600d60248201527f496e76616c69642070726f6f6600000000000000000000000000000000000000604482015260640161011e565b8260026000828254610af59190611117565b909155505060405183815233907f650e45f04ef8a0c267b2f78d983913f69ae3a353b2b32de5429307522be0ab559060200160405180910390a2505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526105c0908490610c32565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082610c298584610d1a565b14949350505050565b6000610c87826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610d5f9092919063ffffffff16565b9050805160001480610ca8575080806020019051810190610ca89190611138565b6105c05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161011e565b600081815b8451811015610d5557610d4b82868381518110610d3e57610d3e611155565b6020026020010151610d76565b9150600101610d1f565b5090505b92915050565b6060610d6e8484600085610da8565b949350505050565b6000818310610d92576000828152602084905260409020610da1565b60008381526020839052604090205b9392505050565b606082471015610e205760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161011e565b600080866001600160a01b03168587604051610e3c919061118f565b60006040518083038185875af1925050503d8060008114610e79576040519150601f19603f3d011682016040523d82523d6000602084013e610e7e565b606091505b5091509150610e8f87838387610e9a565b979650505050505050565b60608315610f09578251600003610f02576001600160a01b0385163b610f025760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161011e565b5081610d6e565b610d6e8383815115610f1e5781518083602001fd5b8060405162461bcd60e51b815260040161011e91906111ab565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610f5f57600080fd5b813567ffffffffffffffff811115610f7957610f79610f38565b8060051b604051601f19603f830116810181811067ffffffffffffffff82111715610fa657610fa6610f38565b604052918252602081850181019290810186841115610fc457600080fd5b6020860192505b83831015610fe3578235815260209283019201610fcb565b5095945050505050565b6000806040838503121561100057600080fd5b82359150602083013567ffffffffffffffff81111561101e57600080fd5b61102a85828601610f4e565b9150509250929050565b80151581146106c257600080fd5b60008060006060848603121561105757600080fd5b83359250602084013567ffffffffffffffff81111561107557600080fd5b61108186828701610f4e565b925050604084013561109281611034565b809150509250925092565b80356001600160a01b03811681146110b457600080fd5b919050565b6000602082840312156110cb57600080fd5b610da18261109d565b600080604083850312156110e757600080fd5b6110f08361109d565b946020939093013593505050565b60006020828403121561111057600080fd5b5051919050565b80820180821115610d5957634e487b7160e01b600052601160045260246000fd5b60006020828403121561114a57600080fd5b8151610da181611034565b634e487b7160e01b600052603260045260246000fd5b60005b8381101561118657818101518382015260200161116e565b50506000910152565b600082516111a181846020870161116b565b9190910192915050565b60208152600082518060208401526111ca81604085016020870161116b565b601f01601f1916919091016040019291505056fea26469706673582212203c31086a235c0a0d6e197eb5b08e732b4d72b2ec2faced326027cc81d8f7be4864736f6c634300081e0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ddeb1a370a88c5bcb6ec10191c03f8ec1d2bd6facb27a6b87aebe8b9bf0705c7fe30a5b005335665aaab35e26db55c3ab965b8a1
-----Decoded View---------------
Arg [0] : _token (address): 0xDdeb1a370A88c5bcB6ec10191C03F8eC1d2Bd6fA
Arg [1] : _merkleRoot (bytes32): 0xcb27a6b87aebe8b9bf0705c7fe30a5b005335665aaab35e26db55c3ab965b8a1
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000ddeb1a370a88c5bcb6ec10191c03f8ec1d2bd6fa
Arg [1] : cb27a6b87aebe8b9bf0705c7fe30a5b005335665aaab35e26db55c3ab965b8a1
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.