0%
HomeSmart contracts
LooksRareAirdrop

LooksRareAirdrop

Deploy on Alchemy
    Verified
  • Verified, Token
  • LooksRare
  • Fungible Token
  • ERC-20

The following smart contract is a LooksRareAirdrop contract that allows users to claim airdrop rewards in the form of ERC20 tokens. Users must provide a valid merkle proof and meet certain requirements, including having a signed maker order and approval for the collection. The contract is pausable and has a maximum amount that can be claimed. The owner can set the merkle root, update the end timestamp, and withdraw token rewards.

0xa35dce3e0e6ceb67a30b8d7f4aee721c949b5970
Copied
Copied
LooksRareAirdrop Source Code
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol"; import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import {OrderTypes} from "../../libraries/OrderTypes.sol"; import {SignatureChecker} from "../../libraries/SignatureChecker.sol"; /** * @title LooksRareAirdrop * @notice It distributes LOOKS tokens with a Merkle-tree airdrop. */ contract LooksRareAirdrop is Pausable, ReentrancyGuard, Ownable { using SafeERC20 for IERC20; using OrderTypes for OrderTypes.MakerOrder; IERC20 public immutable looksRareToken; address public immutable MAIN_STRATEGY; address public immutable TRANSFER_MANAGER_ERC721; address public immutable TRANSFER_MANAGER_ERC1155; address public immutable WETH; bytes32 public immutable DOMAIN_SEPARATOR_EXCHANGE; uint256 public immutable MAXIMUM_AMOUNT_TO_CLAIM; bool public isMerkleRootSet; bytes32 public merkleRoot; uint256 public endTimestamp; mapping(address => bool) public hasClaimed; event AirdropRewardsClaim(address indexed user, uint256 amount); event MerkleRootSet(bytes32 merkleRoot); event NewEndTimestamp(uint256 endTimestamp); event TokensWithdrawn(uint256 amount); /** * @notice Constructor * @param _endTimestamp end timestamp for claiming * @param _looksRareToken address of the LooksRare token * @param _domainSeparator domain separator for LooksRare exchange * @param _transferManagerERC721 address of the transfer manager for ERC721 for LooksRare exchange * @param _transferManagerERC1155 address of the transfer manager for ERC1155 for LooksRare exchange * @param _mainStrategy main strategy ("StandardSaleForFixedPrice") * @param _weth wrapped ETH address * @param _maximumAmountToClaim maximum amount to claim per a user */ constructor( uint256 _endTimestamp, uint256 _maximumAmountToClaim, address _looksRareToken, bytes32 _domainSeparator, address _transferManagerERC721, address _transferManagerERC1155, address _mainStrategy, address _weth ) { endTimestamp = _endTimestamp; MAXIMUM_AMOUNT_TO_CLAIM = _maximumAmountToClaim; looksRareToken = IERC20(_looksRareToken); DOMAIN_SEPARATOR_EXCHANGE = _domainSeparator; TRANSFER_MANAGER_ERC721 = _transferManagerERC721; TRANSFER_MANAGER_ERC1155 = _transferManagerERC1155; MAIN_STRATEGY = _mainStrategy; WETH = _weth; } /** * @notice Claim tokens for airdrop * @param amount amount to claim for the airdrop * @param merkleProof array containing the merkle proof * @param makerAsk makerAsk order * @param isERC721 whether the order is for ERC721 (true --> ERC721/ false --> ERC1155) */ function claim( uint256 amount, bytes32[] calldata merkleProof, OrderTypes.MakerOrder calldata makerAsk, bool isERC721 ) external whenNotPaused nonReentrant { require(isMerkleRootSet, "Airdrop: Merkle root not set"); require(amount <= MAXIMUM_AMOUNT_TO_CLAIM, "Airdrop: Amount too high"); require(block.timestamp <= endTimestamp, "Airdrop: Too late to claim"); // Verify the user has claimed require(!hasClaimed[msg.sender], "Airdrop: Already claimed"); // Checks on orders require(_isOrderMatchingRequirements(makerAsk), "Airdrop: Order not eligible for airdrop"); // Compute the hash bytes32 askHash = makerAsk.hash(); // Verify signature is legit require( SignatureChecker.verify( askHash, makerAsk.signer, makerAsk.v, makerAsk.r, makerAsk.s, DOMAIN_SEPARATOR_EXCHANGE ), "Airdrop: Signature invalid" ); // Verify tokens are approved if (isERC721) { require( IERC721(makerAsk.collection).isApprovedForAll(msg.sender, TRANSFER_MANAGER_ERC721), "Airdrop: Collection must be approved" ); } else { require( IERC1155(makerAsk.collection).isApprovedForAll(msg.sender, TRANSFER_MANAGER_ERC1155), "Airdrop: Collection must be approved" ); } // Compute the node and verify the merkle proof bytes32 node = keccak256(abi.encodePacked(msg.sender, amount)); require(MerkleProof.verify(merkleProof, merkleRoot, node), "Airdrop: Invalid proof"); // Set as claimed hasClaimed[msg.sender] = true; // Transfer tokens looksRareToken.safeTransfer(msg.sender, amount); emit AirdropRewardsClaim(msg.sender, amount); } /** * @notice Check whether it is possible to claim (it doesn't check orders) * @param user address of the user * @param amount amount to claim * @param merkleProof array containing the merkle proof */ function canClaim( address user, uint256 amount, bytes32[] calldata merkleProof ) external view returns (bool) { if (block.timestamp <= endTimestamp) { // Compute the node and verify the merkle proof bytes32 node = keccak256(abi.encodePacked(user, amount)); return MerkleProof.verify(merkleProof, merkleRoot, node); } else { return false; } } /** * @notice Pause airdrop */ function pauseAirdrop() external onlyOwner whenNotPaused { _pause(); } /** * @notice Set merkle root for airdrop * @param _merkleRoot merkle root */ function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner { require(!isMerkleRootSet, "Owner: Merkle root already set"); isMerkleRootSet = true; merkleRoot = _merkleRoot; emit MerkleRootSet(_merkleRoot); } /** * @notice Unpause airdrop */ function unpauseAirdrop() external onlyOwner whenPaused { _unpause(); } /** * @notice Update end timestamp * @param newEndTimestamp new endtimestamp * @dev Must be within 30 days */ function updateEndTimestamp(uint256 newEndTimestamp) external onlyOwner { require(block.timestamp + 30 days > newEndTimestamp, "Owner: New timestamp too far"); endTimestamp = newEndTimestamp; emit NewEndTimestamp(newEndTimestamp); } /** * @notice Transfer tokens back to owner */ function withdrawTokenRewards() external onlyOwner { require(block.timestamp > (endTimestamp + 1 days), "Owner: Too early to remove rewards"); uint256 balanceToWithdraw = looksRareToken.balanceOf(address(this)); looksRareToken.safeTransfer(msg.sender, balanceToWithdraw); emit TokensWithdrawn(balanceToWithdraw); } /** * @notice Check whether order is matching requirements for airdrop * @param makerAsk makerAsk order */ function _isOrderMatchingRequirements(OrderTypes.MakerOrder calldata makerAsk) internal view returns (bool) { return (makerAsk.isOrderAsk) &amp;&amp; (makerAsk.signer == msg.sender) &amp;&amp; (makerAsk.amount > 0) &amp;&amp; (makerAsk.currency == WETH) &amp;&amp; (makerAsk.strategy == MAIN_STRATEGY); } } // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } } // 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 // OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol) 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) { return processProof(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merklee 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 &amp; 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++) { 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)); } } return computedHash; } } // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) 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 v4.4.1 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; } // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title OrderTypes * @notice This library contains order types for the LooksRare exchange. */ library OrderTypes { // keccak256("MakerOrder(bool isOrderAsk,address signer,address collection,uint256 price,uint256 tokenId,uint256 amount,address strategy,address currency,uint256 nonce,uint256 startTime,uint256 endTime,uint256 minPercentageToAsk,bytes params)") bytes32 internal constant MAKER_ORDER_HASH = 0x40261ade532fa1d2c7293df30aaadb9b3c616fae525a0b56d3d411c841a85028; struct MakerOrder { bool isOrderAsk; // true --> ask / false --> bid address signer; // signer of the maker order address collection; // collection address uint256 price; // price (used as ) uint256 tokenId; // id of the token uint256 amount; // amount of tokens to sell/purchase (must be 1 for ERC721, 1+ for ERC1155) address strategy; // strategy for trade execution (e.g., DutchAuction, StandardSaleForFixedPrice) address currency; // currency (e.g., WETH) uint256 nonce; // order nonce (must be unique unless new maker order is meant to override existing one e.g., lower ask price) uint256 startTime; // startTime in timestamp uint256 endTime; // endTime in timestamp uint256 minPercentageToAsk; // slippage protection (9000 --> 90% of the final price must return to ask) bytes params; // additional parameters uint8 v; // v: parameter (27 or 28) bytes32 r; // r: parameter bytes32 s; // s: parameter } struct TakerOrder { bool isOrderAsk; // true --> ask / false --> bid address taker; // msg.sender uint256 price; // final price for the purchase uint256 tokenId; uint256 minPercentageToAsk; // // slippage protection (9000 --> 90% of the final price must return to ask) bytes params; // other params (e.g., tokenId) } function hash(MakerOrder memory makerOrder) internal pure returns (bytes32) { return keccak256( abi.encode( MAKER_ORDER_HASH, makerOrder.isOrderAsk, makerOrder.signer, makerOrder.collection, makerOrder.price, makerOrder.tokenId, makerOrder.amount, makerOrder.strategy, makerOrder.currency, makerOrder.nonce, makerOrder.startTime, makerOrder.endTime, makerOrder.minPercentageToAsk, keccak256(makerOrder.params) ) ); } } // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; /** * @title SignatureChecker * @notice This library allows verification of signatures for both EOAs and contracts. */ library SignatureChecker { /** * @notice Recovers the signer of a signature (for EOA) * @param hash the hash containing the signed mesage * @param v parameter (27 or 28). This prevents maleability since the public key recovery equation has two possible solutions. * @param r parameter * @param s parameter */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { // https://ethereum.stackexchange.com/questions/83174/is-it-best-practice-to-check-signature-malleability-in-ecrecover // https://crypto.iacr.org/2019/affevents/wac/medias/Heninger-BiasedNonceSense.pdf require( uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "Signature: Invalid s parameter" ); require(v == 27 || v == 28, "Signature: Invalid v parameter"); // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); require(signer != address(0), "Signature: Invalid signer"); return signer; } /** * @notice Returns whether the signer matches the signed message * @param hash the hash containing the signed mesage * @param signer the signer address to confirm message validity * @param v parameter (27 or 28) * @param r parameter * @param s parameter * @param domainSeparator paramer to prevent signature being executed in other chains and environments * @return true --> if valid // false --> if invalid */ function verify( bytes32 hash, address signer, uint8 v, bytes32 r, bytes32 s, bytes32 domainSeparator ) internal view returns (bool) { // \x19\x01 is the standardized encoding prefix // https://eips.ethereum.org/EIPS/eip-712#specification bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, hash)); if (Address.isContract(signer)) { // 0x1626ba7e is the interfaceId for signature contracts (see IERC1271) return IERC1271(signer).isValidSignature(digest, abi.encodePacked(r, s, v)) == 0x1626ba7e; } else { return recover(digest, v, r, s) == signer; } } } // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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; } } // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) 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 // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @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 * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 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 // 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 v4.4.1 (interfaces/IERC1271.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC1271 standard signature validation method for * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. * * _Available since v4.1._ */ interface IERC1271 { /** * @dev Should return whether the signature provided is valid for the provided data * @param hash Hash of the data to be signed * @param signature Signature byte array associated with _data */ function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); }
LooksRareAirdrop ABI
Copied
[{"inputs":[{"internalType":"uint256","name":"_endTimestamp","type":"uint256"},{"internalType":"uint256","name":"_maximumAmountToClaim","type":"uint256"},{"internalType":"address","name":"_looksRareToken","type":"address"},{"internalType":"bytes32","name":"_domainSeparator","type":"bytes32"},{"internalType":"address","name":"_transferManagerERC721","type":"address"},{"internalType":"address","name":"_transferManagerERC1155","type":"address"},{"internalType":"address","name":"_mainStrategy","type":"address"},{"internalType":"address","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AirdropRewardsClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"MerkleRootSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"endTimestamp","type":"uint256"}],"name":"NewEndTimestamp","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR_EXCHANGE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAIN_STRATEGY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_AMOUNT_TO_CLAIM","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TRANSFER_MANAGER_ERC1155","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TRANSFER_MANAGER_ERC721","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"canClaim","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"components":[{"internalType":"bool","name":"isOrderAsk","type":"bool"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"strategy","type":"address"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"minPercentageToAsk","type":"uint256"},{"internalType":"bytes","name":"params","type":"bytes"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct OrderTypes.MakerOrder","name":"makerAsk","type":"tuple"},{"internalType":"bool","name":"isERC721","type":"bool"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isMerkleRootSet","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"looksRareToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"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":[],"name":"pauseAirdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpauseAirdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newEndTimestamp","type":"uint256"}],"name":"updateEndTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawTokenRewards","outputs":[],"stateMutability":"nonpayable","type":"function"}]
LooksRareAirdrop Bytecode
Copied
6101606040523480156200001257600080fd5b5060405162002a8e38038062002a8e83398101604081905262000035916200010a565b6000805460ff19169055600180556200004e336200009b565b600497909755610140959095526001600160601b0319606094851b81166080526101209390935290831b821660c052821b811660e05291811b821660a0529190911b166101005262000197565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146200010557600080fd5b919050565b600080600080600080600080610100898b0312156200012857600080fd5b88519750602089015196506200014160408a01620000ed565b9550606089015194506200015860808a01620000ed565b93506200016860a08a01620000ed565b92506200017860c08a01620000ed565b91506200018860e08a01620000ed565b90509295985092959890939650565b60805160601c60a05160601c60c05160601c60e05160601c6101005160601c610120516101405161284e620002406000396000818161038801526107a301526000818161036101526109ef01526000818161031301526117000152600081816101fe0152610c3901526000818161033a0152610ad20152600081816102b201526117670152600081816101b201528181610535015281816105e00152610e80015261284e6000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c80637cb64759116100d8578063b344a1481161008c578063dc38bdb511610066578063dc38bdb5146103b2578063e96ad3ad146103c5578063f2fde38b146103cd57600080fd5b8063b344a1481461035c578063bd69ba5014610383578063c6afd5bb146103aa57600080fd5b8063a85adeab116100bd578063a85adeab14610305578063ad5c46481461030e578063b1357ddd1461033557600080fd5b80637cb64759146102d45780638da5cb5b146102e757600080fd5b80635c975abb1161013a578063715018a611610114578063715018a61461028257806373b2e80e1461028a5780637a6d39c6146102ad57600080fd5b80635c975abb146102335780635ff10e391461024a5780636e1613fb1461026f57600080fd5b806336db9fb21161016b57806336db9fb2146101ad57806338928956146101f95780634972a7a71461022057600080fd5b806315618acd146101875780632eb4a7ab14610191575b600080fd5b61018f6103e0565b005b61019a60035481565b6040519081526020015b60405180910390f35b6101d47f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101a4565b6101d47f000000000000000000000000000000000000000000000000000000000000000081565b61018f61022e3660046123cc565b61063e565b60005460ff165b60405190151581526020016101a4565b60025461023a9074010000000000000000000000000000000000000000900460ff1681565b61018f61027d366004612358565b610efe565b61018f611029565b61023a6102983660046122a9565b60056020526000908152604090205460ff1681565b6101d47f000000000000000000000000000000000000000000000000000000000000000081565b61018f6102e2366004612358565b6110b6565b60025473ffffffffffffffffffffffffffffffffffffffff166101d4565b61019a60045481565b6101d47f000000000000000000000000000000000000000000000000000000000000000081565b6101d47f000000000000000000000000000000000000000000000000000000000000000081565b61019a7f000000000000000000000000000000000000000000000000000000000000000081565b61019a7f000000000000000000000000000000000000000000000000000000000000000081565b61018f611232565b61023a6103c03660046122c4565b611328565b61018f6113dc565b61018f6103db3660046122a9565b6114d1565b60025473ffffffffffffffffffffffffffffffffffffffff163314610466576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b60045461047690620151806125eb565b4211610504576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f4f776e65723a20546f6f206561726c7920746f2072656d6f766520726577617260448201527f6473000000000000000000000000000000000000000000000000000000000000606482015260840161045d565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a082319060240160206040518083038186803b15801561058c57600080fd5b505afa1580156105a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c491906123b3565b905061060773ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163383611601565b6040518181527f9c6393f251205f9e03559951cab4c9ae71767b6174f77944a5b0c2fa51fbda9f906020015b60405180910390a150565b60005460ff16156106ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161045d565b60026001541415610718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161045d565b600260018190555474010000000000000000000000000000000000000000900460ff166107a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f41697264726f703a204d65726b6c6520726f6f74206e6f742073657400000000604482015260640161045d565b7f000000000000000000000000000000000000000000000000000000000000000085111561082b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f41697264726f703a20416d6f756e7420746f6f20686967680000000000000000604482015260640161045d565b600454421115610897576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f41697264726f703a20546f6f206c61746520746f20636c61696d000000000000604482015260640161045d565b3360009081526005602052604090205460ff1615610911576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f41697264726f703a20416c726561647920636c61696d65640000000000000000604482015260640161045d565b61091a82611693565b6109a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f41697264726f703a204f72646572206e6f7420656c696769626c6520666f722060448201527f61697264726f7000000000000000000000000000000000000000000000000000606482015260840161045d565b60006109b96109b484612603565b6117b5565b9050610a13816109cf60408601602087016122a9565b6109e16101c087016101a0880161245a565b866101c00135876101e001357f000000000000000000000000000000000000000000000000000000000000000061185c565b610a79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f41697264726f703a205369676e617475726520696e76616c6964000000000000604482015260640161045d565b8115610be657610a8f60608401604085016122a9565b6040517fe985e9c500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166024830152919091169063e985e9c59060440160206040518083038186803b158015610b1e57600080fd5b505afa158015610b32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b56919061233b565b610be1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f41697264726f703a20436f6c6c656374696f6e206d757374206265206170707260448201527f6f76656400000000000000000000000000000000000000000000000000000000606482015260840161045d565b610d48565b610bf660608401604085016122a9565b6040517fe985e9c500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166024830152919091169063e985e9c59060440160206040518083038186803b158015610c8557600080fd5b505afa158015610c99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbd919061233b565b610d48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f41697264726f703a20436f6c6c656374696f6e206d757374206265206170707260448201527f6f76656400000000000000000000000000000000000000000000000000000000606482015260840161045d565b6040517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b16602082015260348101879052600090605401604051602081830303815290604052805190602001209050610ddc868680806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506003549150849050611a29565b610e42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f41697264726f703a20496e76616c69642070726f6f6600000000000000000000604482015260640161045d565b33600081815260056020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610ebc907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169089611601565b60405187815233907f19552fadade1a47d8fa44f6487230cfff67275de6e68fbfba65171532768fd7d9060200160405180910390a25050600180555050505050565b60025473ffffffffffffffffffffffffffffffffffffffff163314610f7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045d565b80610f8d4262278d006125eb565b11610ff4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4f776e65723a204e65772074696d657374616d7020746f6f2066617200000000604482015260640161045d565b60048190556040518181527fac7d83845fcc6871010ded05a8cb9bddee5cc49fdb8f2d24b96141d401b6bfed90602001610633565b60025473ffffffffffffffffffffffffffffffffffffffff1633146110aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045d565b6110b46000611a41565b565b60025473ffffffffffffffffffffffffffffffffffffffff163314611137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045d565b60025474010000000000000000000000000000000000000000900460ff16156111bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e65723a204d65726b6c6520726f6f7420616c7265616479207365740000604482015260640161045d565b600280547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560038190556040517f42cbc405e4dbf1b691e85b9a34b08ecfcf7a9ad9078bf4d645ccfa1fac11c10b906106339083815260200190565b60025473ffffffffffffffffffffffffffffffffffffffff1633146112b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045d565b60005460ff1615611320576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161045d565b6110b4611ab8565b600060045442116113d0576040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b166020820152603481018590526000906054016040516020818303038152906040528051906020012090506113c8848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506003549150849050611a29565b9150506113d4565b5060005b949350505050565b60025473ffffffffffffffffffffffffffffffffffffffff16331461145d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045d565b60005460ff166114c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161045d565b6110b4611ba2565b60025473ffffffffffffffffffffffffffffffffffffffff163314611552576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045d565b73ffffffffffffffffffffffffffffffffffffffff81166115f5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161045d565b6115fe81611a41565b50565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905261168e908490611c5d565b505050565b60006116a2602083018361231e565b80156116d25750336116ba60408401602085016122a9565b73ffffffffffffffffffffffffffffffffffffffff16145b80156116e2575060008260a00135115b8015611749575073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016611731610100840160e085016122a9565b73ffffffffffffffffffffffffffffffffffffffff16145b80156117af575073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001661179760e0840160c085016122a9565b73ffffffffffffffffffffffffffffffffffffffff16145b92915050565b80516020808301516040808501516060860151608087015160a088015160c089015160e08a01516101008b01516101208c01516101408d01516101608e01516101808f01518051908e01209a5160009e61183f9e7f40261ade532fa1d2c7293df30aaadb9b3c616fae525a0b56d3d411c841a850289e919d919c9b9a9998979695949392016124db565b604051602081830303815290604052805190602001209050919050565b6040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018290526042810187905260009081906062016040516020818303038152906040528051906020012090506118bd873b151590565b156119e157604080516020810187905280820186905260f888901b7fff000000000000000000000000000000000000000000000000000000000000001660608201528151604181830301815260618201928390527f1626ba7e0000000000000000000000000000000000000000000000000000000090925273ffffffffffffffffffffffffffffffffffffffff891691631626ba7e91611961918591606501612595565b60206040518083038186803b15801561197957600080fd5b505afa15801561198d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b19190612371565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916631626ba7e60e01b14915050611a1f565b8673ffffffffffffffffffffffffffffffffffffffff16611a0482888888611d69565b73ffffffffffffffffffffffffffffffffffffffff16149150505b9695505050505050565b600082611a368584611f75565b1490505b9392505050565b6002805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005460ff1615611b25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161045d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611b783390565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b60005460ff16611c0e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161045d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33611b78565b6000611cbf826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120219092919063ffffffff16565b80519091501561168e5780806020019051810190611cdd919061233b565b61168e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161045d565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115611df5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f5369676e61747572653a20496e76616c6964207320706172616d657465720000604482015260640161045d565b8360ff16601b1480611e0a57508360ff16601c145b611e70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f5369676e61747572653a20496e76616c6964207620706172616d657465720000604482015260640161045d565b6040805160008082526020820180845288905260ff871692820192909252606081018590526080810184905260019060a0016020604051602081039080840390855afa158015611ec4573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116611f6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f5369676e61747572653a20496e76616c6964207369676e657200000000000000604482015260640161045d565b95945050505050565b600081815b8451811015612019576000858281518110611f9757611f976127ac565b60200260200101519050808311611fd9576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250612006565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061201181612744565b915050611f7a565b509392505050565b60606113d4848460008585843b612094576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161045d565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516120bd91906124bf565b60006040518083038185875af1925050503d80600081146120fa576040519150601f19603f3d011682016040523d82523d6000602084013e6120ff565b606091505b509150915061210f82828661211a565b979650505050505050565b60608315612129575081611a3a565b8251156121395782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045d91906125ae565b803573ffffffffffffffffffffffffffffffffffffffff8116811461219157600080fd5b919050565b60008083601f8401126121a857600080fd5b50813567ffffffffffffffff8111156121c057600080fd5b6020830191508360208260051b85010111156121db57600080fd5b9250929050565b80356121918161280a565b600082601f8301126121fe57600080fd5b813567ffffffffffffffff80821115612219576122196127db565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561225f5761225f6127db565b8160405283815286602085880101111561227857600080fd5b836020870160208301376000602085830101528094505050505092915050565b803560ff8116811461219157600080fd5b6000602082840312156122bb57600080fd5b611a3a8261216d565b600080600080606085870312156122da57600080fd5b6122e38561216d565b935060208501359250604085013567ffffffffffffffff81111561230657600080fd5b61231287828801612196565b95989497509550505050565b60006020828403121561233057600080fd5b8135611a3a8161280a565b60006020828403121561234d57600080fd5b8151611a3a8161280a565b60006020828403121561236a57600080fd5b5035919050565b60006020828403121561238357600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114611a3a57600080fd5b6000602082840312156123c557600080fd5b5051919050565b6000806000806000608086880312156123e457600080fd5b85359450602086013567ffffffffffffffff8082111561240357600080fd5b61240f89838a01612196565b9096509450604088013591508082111561242857600080fd5b508601610200818903121561243c57600080fd5b9150606086013561244c8161280a565b809150509295509295909350565b60006020828403121561246c57600080fd5b611a3a82612298565b6000815180845261248d816020860160208601612714565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600082516124d1818460208701612714565b9190910192915050565b8e81528d1515602082015273ffffffffffffffffffffffffffffffffffffffff8d811660408301528c1660608201526101c081018b60808301528a60a08301528960c083015261254360e083018a73ffffffffffffffffffffffffffffffffffffffff169052565b73ffffffffffffffffffffffffffffffffffffffff88166101008301526101208201969096526101408101949094526101608401929092526101808301526101a0909101529998505050505050505050565b8281526040602082015260006113d46040830184612475565b602081526000611a3a6020830184612475565b604051610200810167ffffffffffffffff811182821017156125e5576125e56127db565b60405290565b600082198211156125fe576125fe61277d565b500190565b6000610200823603121561261657600080fd5b61261e6125c1565b612627836121e2565b81526126356020840161216d565b60208201526126466040840161216d565b6040820152606083013560608201526080830135608082015260a083013560a082015261267560c0840161216d565b60c082015261268660e0840161216d565b60e082015261010083810135908201526101208084013590820152610140808401359082015261016080840135908201526101808084013567ffffffffffffffff8111156126d357600080fd5b6126df368287016121ed565b8284015250506101a06126f3818501612298565b908201526101c083810135908201526101e092830135928101929092525090565b60005b8381101561272f578181015183820152602001612717565b8381111561273e576000848401525b50505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156127765761277661277d565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146115fe57600080fdfea2646970667358221220d9402dfafada4c799b15917a760b8b1177e39c3be2014926d0d5576e04839d1164736f6c634300080700330000000000000000000000000000000000000000000000000000000061e91d8800000000000000000000000000000000000000000000021e19e0c9bab2400000000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421ead4d53a9c11a3edbe96e78e969291ab5248faeb3b8d4552c21e6bc72edb8cab3000000000000000000000000f42aa99f011a1fa7cda90e5e98b277e306bca83e000000000000000000000000fed24ec7e22f573c2e08aef55aa6797ca2b3a05100000000000000000000000056244bb70cbd3ea9dc8007399f61dfc065190031000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Smart Contracts contract page background

Checkout more smart contracts

    Ethereum  logo

    SHILAINU

    Verified

    The following smart contract is the SHILAINU token contract, which is an ERC20 token with a total supply of 1 trillion. It includes features such as transaction limits, fees, and automatic liquidity provision. The contract also has a blacklist mode and the ability to set fee and transaction exemptions for specific addresses. The purpose of the contract is to provide a decentralized currency for the Shiba Inu community.

    0x20c3fa331a385b63ee39137e99d0cf2db142fce1
    Copied
    • Verified
    • Fungible Token
    • ERC20
    Ethereum  logo

    LooksRareAirdrop

    Verified

    The following smart contract is a LooksRareAirdrop contract that allows users to claim airdrop rewards in the form of ERC20 tokens. Users must provide a valid merkle proof and meet certain requirements, including having a signed maker order and approval for the collection. The contract is pausable and has a maximum amount that can be claimed. The owner can set the merkle root, update the end timestamp, and withdraw token rewards.

    0xa35dce3e0e6ceb67a30b8d7f4aee721c949b5970
    Copied
    • Verified, Token
    • LooksRare
    • Fungible Token
    • ERC-20
    Ethereum  logo

    WETH9

    Verified

    The following smart contract is a basic implementation of the Wrapped Ether (WETH) token on the Ethereum blockchain. It allows users to deposit Ether into the contract and receive WETH tokens in return, which can be transferred to other users or contracts. The contract also includes functions for withdrawing Ether, checking balances, and approving transfers. The WETH token has a fixed supply of 18 decimal places and is represented by the symbol "WETH".

    0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
    Copied
    • Verified, Token
    • Fungible Token
    • ERC-20
Section background image

Build blockchain magic

Alchemy combines the most powerful web3 developer products and tools with resources, community and legendary support.

Get your API key