// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "./ILazyPayableClaim.sol";
/**
* Lazy Claim interface
*/
interface IERC1155LazyPayableClaim is ILazyPayableClaim {
struct ClaimParameters {
uint32 totalMax;
uint32 walletMax;
uint48 startDate;
uint48 endDate;
StorageProtocol storageProtocol;
bytes32 merkleRoot;
string location;
uint256 cost;
address payable paymentReceiver;
address erc20;
address signingAddress;
}
struct Claim {
uint32 total;
uint32 totalMax;
uint32 walletMax;
uint48 startDate;
uint48 endDate;
StorageProtocol storageProtocol;
bytes32 merkleRoot;
string location;
uint256 tokenId;
uint256 cost;
address payable paymentReceiver;
address erc20;
address signingAddress;
}
/**
* @notice initialize a new claim, emit initialize event
* @param creatorContractAddress the creator contract the claim will mint tokens for
* @param instanceId the claim instanceId for the creator contract
* @param claimParameters the parameters which will affect the minting behavior of the claim
*/
function initializeClaim(address creatorContractAddress, uint256 instanceId, ClaimParameters calldata claimParameters) external;
/**
* @notice update an existing claim at instanceId
* @param creatorContractAddress the creator contract corresponding to the claim
* @param instanceId the claim instanceId for the creator contract
* @param claimParameters the parameters which will affect the minting behavior of the claim
*/
function updateClaim(address creatorContractAddress, uint256 instanceId, ClaimParameters calldata claimParameters) external;
/**
* @notice update tokenURI parameters for an existing claim at instanceId
* @param creatorContractAddress the creator contract corresponding to the claim
* @param instanceId the claim instanceId for the creator contract
* @param storageProtocol the new storage protocol
* @param location the new location
*/
function updateTokenURIParams(address creatorContractAddress, uint256 instanceId, StorageProtocol storageProtocol, string calldata location) external;
/**
* @notice extend tokenURI parameters for an existing claim at instanceId. Must have NONE StorageProtocol
* @param creatorContractAddress the creator contract corresponding to the claim
* @param instanceId the claim instanceId for the creator contract
* @param locationChunk the additional location chunk
*/
function extendTokenURI(address creatorContractAddress, uint256 instanceId, string calldata locationChunk) external;
/**
* @notice get a claim corresponding to a creator contract and instanceId
* @param creatorContractAddress the address of the creator contract
* @param instanceId the claim instanceId for the creator contract
* @return the claim object
*/
function getClaim(address creatorContractAddress, uint256 instanceId) external view returns(Claim memory);
/**
* @notice get a claim corresponding to a token
* @param creatorContractAddress the address of the creator contract
* @param tokenId the tokenId of the claim
* @return the claim instanceId and claim object
*/
function getClaimForToken(address creatorContractAddress, uint256 tokenId) external view returns(uint256, Claim memory);
/**
* @notice allow admin to airdrop arbitrary tokens
* @param creatorContractAddress the creator contract the claim will mint tokens for
* @param instanceId the claim instanceId for the creator contract
* @param recipients addresses to airdrop to
* @param amounts number of tokens to airdrop to each address in addresses
*/
function airdrop(address creatorContractAddress, uint256 instanceId, address[] calldata recipients, uint256[] calldata amounts) external;
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "./ILazyPayableClaim.sol";
/**
* Lazy Payable Claim interface
*/
interface IERC721LazyPayableClaim is ILazyPayableClaim {
struct ClaimParameters {
uint32 totalMax;
uint32 walletMax;
uint48 startDate;
uint48 endDate;
StorageProtocol storageProtocol;
bool identical;
bytes32 merkleRoot;
string location;
uint256 cost;
address payable paymentReceiver;
address erc20;
address signingAddress;
}
struct Claim {
uint32 total;
uint32 totalMax;
uint32 walletMax;
uint48 startDate;
uint48 endDate;
StorageProtocol storageProtocol;
uint8 contractVersion;
bool identical;
bytes32 merkleRoot;
string location;
uint256 cost;
address payable paymentReceiver;
address erc20;
address signingAddress;
}
/**
* @notice initialize a new claim, emit initialize event
* @param creatorContractAddress the creator contract the claim will mint tokens for
* @param instanceId the claim instanceId for the creator contract
* @param claimParameters the parameters which will affect the minting behavior of the claim
*/
function initializeClaim(address creatorContractAddress, uint256 instanceId, ClaimParameters calldata claimParameters) external;
/**
* @notice update an existing claim at instanceId
* @param creatorContractAddress the creator contract corresponding to the claim
* @param instanceId the claim instanceId for the creator contract
* @param claimParameters the parameters which will affect the minting behavior of the claim
*/
function updateClaim(address creatorContractAddress, uint256 instanceId, ClaimParameters calldata claimParameters) external;
/**
* @notice update tokenURI parameters for an existing claim at instanceId
* @param creatorContractAddress the creator contract corresponding to the claim
* @param instanceId the claim instanceId for the creator contract
* @param storageProtocol the new storage protocol
* @param identical the new value of identical
* @param location the new location
*/
function updateTokenURIParams(address creatorContractAddress, uint256 instanceId, StorageProtocol storageProtocol, bool identical, string calldata location) external;
/**
* @notice extend tokenURI parameters for an existing claim at instanceId. Must have NONE StorageProtocol
* @param creatorContractAddress the creator contract corresponding to the claim
* @param instanceId the claim instanceId for the creator contract
* @param locationChunk the additional location chunk
*/
function extendTokenURI(address creatorContractAddress, uint256 instanceId, string calldata locationChunk) external;
/**
* @notice get a claim corresponding to a creator contract and instanceId
* @param creatorContractAddress the address of the creator contract
* @param instanceId the claim instanceId for the creator contract
* @return the claim object
*/
function getClaim(address creatorContractAddress, uint256 instanceId) external view returns(Claim memory);
/**
* @notice get a claim corresponding to a token
* @param creatorContractAddress the address of the creator contract
* @param tokenId the tokenId of the claim
* @return the claim instanceId and claim object
*/
function getClaimForToken(address creatorContractAddress, uint256 tokenId) external view returns(uint256, Claim memory);
/**
* @notice allow admin to airdrop arbitrary tokens
* @param creatorContractAddress the creator contract the claim will mint tokens for
* @param instanceId the claim instanceId for the creator contract
* @param recipients addresses to airdrop to
* @param amounts number of tokens to airdrop to each address in addresses
*/
function airdrop(address creatorContractAddress, uint256 instanceId, address[] calldata recipients, uint16[] calldata amounts) external;
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
/**
* Lazy Payable Claim interface
*/
interface ILazyPayableClaim {
enum StorageProtocol { INVALID, NONE, ARWEAVE, IPFS }
event ClaimInitialized(address indexed creatorContract, uint256 indexed instanceId, address initializer);
event ClaimUpdated(address indexed creatorContract, uint256 indexed instanceId);
event ClaimMint(address indexed creatorContract, uint256 indexed instanceId);
event ClaimMintBatch(address indexed creatorContract, uint256 indexed instanceId, uint16 mintCount);
event ClaimMintProxy(address indexed creatorContract, uint256 indexed instanceId, uint16 mintCount, address proxy, address mintFor);
event ClaimMintSignature(address indexed creatorContract, uint256 indexed instanceId, uint16 mintCount, address proxy, address mintFor, bytes32 nonce);
/**
* @notice Withdraw funds
*/
function withdraw(address payable receiver, uint256 amount) external;
/**
* @notice Set the Manifold Membership address
*/
function setMembershipAddress(address membershipAddress) external;
/**
* @notice check if a mint index has been consumed or not (only for merkle claims)
*
* @param creatorContractAddress the address of the creator contract for the claim
* @param instanceId the claim instanceId for the creator contract
* @param mintIndex the mint claim instance
* @return whether or not the mint index was consumed
*/
function checkMintIndex(address creatorContractAddress, uint256 instanceId, uint32 mintIndex) external view returns(bool);
/**
* @notice check if multiple mint indices has been consumed or not (only for merkle claims)
*
* @param creatorContractAddress the address of the creator contract for the claim
* @param instanceId the claim instanceId for the creator contract
* @param mintIndices the mint claim instance
* @return whether or not the mint index was consumed
*/
function checkMintIndices(address creatorContractAddress, uint256 instanceId, uint32[] calldata mintIndices) external view returns(bool[] memory);
/**
* @notice get mints made for a wallet (only for non-merkle claims with walletMax)
*
* @param minter the address of the minting address
* @param creatorContractAddress the address of the creator contract for the claim
* @param instanceId the claim instance for the creator contract
* @return how many mints the minter has made
*/
function getTotalMints(address minter, address creatorContractAddress, uint256 instanceId) external view returns(uint32);
/**
* @notice allow a wallet to lazily claim a token according to parameters
* @param creatorContractAddress the creator contract address
* @param instanceId the claim instanceId for the creator contract
* @param mintIndex the mint index (only needed for merkle claims)
* @param merkleProof if the claim has a merkleRoot, verifying merkleProof ensures that address + minterValue was used to construct it (only needed for merkle claims)
* @param mintFor mintFor must be the msg.sender or a delegate wallet address (in the case of merkle based mints)
*/
function mint(address creatorContractAddress, uint256 instanceId, uint32 mintIndex, bytes32[] calldata merkleProof, address mintFor) external payable;
/**
* @notice allow a wallet to lazily claim a token according to parameters
* @param creatorContractAddress the creator contract address
* @param instanceId the claim instanceId for the creator contract
* @param mintCount the number of claims to mint
* @param mintIndices the mint index (only needed for merkle claims)
* @param merkleProofs if the claim has a merkleRoot, verifying merkleProof ensures that address + minterValue was used to construct it (only needed for merkle claims)
* @param mintFor mintFor must be the msg.sender or a delegate wallet address (in the case of merkle based mints)
*/
function mintBatch(address creatorContractAddress, uint256 instanceId, uint16 mintCount, uint32[] calldata mintIndices, bytes32[][] calldata merkleProofs, address mintFor) external payable;
/**
* @notice allow a proxy to mint a token for another address
* @param creatorContractAddress the creator contract address
* @param instanceId the claim instanceId for the creator contract
* @param mintCount the number of claims to mint
* @param mintIndices the mint index (only needed for merkle claims)
* @param merkleProofs if the claim has a merkleRoot, verifying merkleProof ensures that address + minterValue was used to construct it (only needed for merkle claims)
* @param mintFor the address to mint for
*/
function mintProxy(address creatorContractAddress, uint256 instanceId, uint16 mintCount, uint32[] calldata mintIndices, bytes32[][] calldata merkleProofs, address mintFor) external payable;
/**
* @notice allowlist minting based on signatures
* @param creatorContractAddress the creator contract address
* @param instanceId the claim instanceId for the creator contract
* @param mintCount the number of claims to mint
* @param signature if the claim has a signerAddress, verifying signatures were signed by it
* @param message the message that was signed
* @param nonce the nonce that was signed
* @param mintFor the address to mint for
*/
function mintSignature(address creatorContractAddress, uint256 instanceId, uint16 mintCount, bytes calldata signature, bytes32 message, bytes32 nonce, address mintFor, uint256 expiration) external payable;
}
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
/// author: @yungwknd
import {IERC1155LazyPayableClaim} from "./IERC1155LazyPayableClaim.sol";
import {IERC721LazyPayableClaim} from "./IERC721LazyPayableClaim.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract ManifoldClaimShim is Ownable {
error InsufficientFee();
IERC1155LazyPayableClaim public manifold1155Claim;
IERC721LazyPayableClaim public manifold721Claim;
uint256 public MINT_FEE = 0.0005 ether;
constructor() Ownable(msg.sender) {}
// ============ ERC1155 Functions ============
function far1155_checkMintIndex(address creatorContractAddress, uint256 instanceId, uint32 mintIndex) external view returns(bool) {
return manifold1155Claim.checkMintIndex(creatorContractAddress, instanceId, mintIndex);
}
function far1155_checkMintIndices(address creatorContractAddress, uint256 instanceId, uint32[] calldata mintIndices) external view returns(bool[] memory) {
return manifold1155Claim.checkMintIndices(creatorContractAddress, instanceId, mintIndices);
}
function far1155_getTotalMints(address minter, address creatorContractAddress, uint256 instanceId) external view returns(uint32) {
return manifold1155Claim.getTotalMints(minter, creatorContractAddress, instanceId);
}
function far1155_mint(address creatorContractAddress, uint256 instanceId, uint32 mintIndex, bytes32[] calldata merkleProof, address mintFor) external payable {
if (msg.value < MINT_FEE) revert InsufficientFee();
uint256 remainingValue = msg.value - MINT_FEE;
// Check if it's an erc20 mint...
IERC1155LazyPayableClaim.Claim memory claim = manifold1155Claim.getClaim(creatorContractAddress, instanceId);
if (claim.erc20 != address(0)) {
// It's an erc20 mint, so we need to get the token address
address tokenAddress = claim.erc20;
// Approve the token to the manifold1155Claim contract
IERC20(tokenAddress).approve(address(manifold1155Claim), claim.cost);
// Take the cost from the user
IERC20(tokenAddress).transferFrom(mintFor, address(this), claim.cost);
}
manifold1155Claim.mint{value: remainingValue}(creatorContractAddress, instanceId, mintIndex, merkleProof, mintFor);
}
function far1155_mintBatch(address creatorContractAddress, uint256 instanceId, uint16 mintCount, uint32[] calldata mintIndices, bytes32[][] calldata merkleProofs, address mintFor) external payable {
uint256 totalFee = MINT_FEE * mintCount;
if (msg.value < totalFee) revert InsufficientFee();
uint256 remainingValue = msg.value - totalFee;
// Check if it's an erc20 mint...
IERC1155LazyPayableClaim.Claim memory claim = manifold1155Claim.getClaim(creatorContractAddress, instanceId);
if (claim.erc20 != address(0)) {
// It's an erc20 mint, so we need to get the token address
address tokenAddress = claim.erc20;
// Approve the token to the manifold1155Claim contract
IERC20(tokenAddress).approve(address(manifold1155Claim), claim.cost * mintCount);
// Take the cost from the user
IERC20(tokenAddress).transferFrom(mintFor, address(this), claim.cost * mintCount);
}
manifold1155Claim.mintBatch{value: remainingValue}(creatorContractAddress, instanceId, mintCount, mintIndices, merkleProofs, mintFor);
}
function far1155_mintProxy(address creatorContractAddress, uint256 instanceId, uint16 mintCount, uint32[] calldata mintIndices, bytes32[][] calldata merkleProofs, address mintFor) external payable {
uint256 totalFee = MINT_FEE * mintCount;
if (msg.value < totalFee) revert InsufficientFee();
uint256 remainingValue = msg.value - totalFee;
// Check if it's an erc20 mint...
IERC1155LazyPayableClaim.Claim memory claim = manifold1155Claim.getClaim(creatorContractAddress, instanceId);
if (claim.erc20 != address(0)) {
// It's an erc20 mint, so we need to get the token address
address tokenAddress = claim.erc20;
// Approve the token to the manifold1155Claim contract
IERC20(tokenAddress).approve(address(manifold1155Claim), claim.cost * mintCount);
// Take the cost from the user
IERC20(tokenAddress).transferFrom(mintFor, address(this), claim.cost * mintCount);
}
manifold1155Claim.mintProxy{value: remainingValue}(creatorContractAddress, instanceId, mintCount, mintIndices, merkleProofs, mintFor);
}
function far1155_mintSignature(address creatorContractAddress, uint256 instanceId, uint16 mintCount, bytes calldata signature, bytes32 message, bytes32 nonce, address mintFor, uint256 expiration) external payable {
uint256 totalFee = MINT_FEE * mintCount;
if (msg.value < totalFee) revert InsufficientFee();
uint256 remainingValue = msg.value - totalFee;
// Check if it's an erc20 mint...
IERC1155LazyPayableClaim.Claim memory claim = manifold1155Claim.getClaim(creatorContractAddress, instanceId);
if (claim.erc20 != address(0)) {
// It's an erc20 mint, so we need to get the token address
address tokenAddress = claim.erc20;
// Approve the token to the manifold1155Claim contract
IERC20(tokenAddress).approve(address(manifold1155Claim), claim.cost * mintCount);
// Take the cost from the user
IERC20(tokenAddress).transferFrom(mintFor, address(this), claim.cost * mintCount);
}
manifold1155Claim.mintSignature{value: remainingValue}(creatorContractAddress, instanceId, mintCount, signature, message, nonce, mintFor, expiration);
}
// ============ ERC721 Functions ============
function far721_checkMintIndex(address creatorContractAddress, uint256 instanceId, uint32 mintIndex) external view returns(bool) {
return manifold721Claim.checkMintIndex(creatorContractAddress, instanceId, mintIndex);
}
function far721_checkMintIndices(address creatorContractAddress, uint256 instanceId, uint32[] calldata mintIndices) external view returns(bool[] memory) {
return manifold721Claim.checkMintIndices(creatorContractAddress, instanceId, mintIndices);
}
function far721_getTotalMints(address minter, address creatorContractAddress, uint256 instanceId) external view returns(uint32) {
return manifold721Claim.getTotalMints(minter, creatorContractAddress, instanceId);
}
function far721_mint(address creatorContractAddress, uint256 instanceId, uint32 mintIndex, bytes32[] calldata merkleProof, address mintFor) external payable {
if (msg.value < MINT_FEE) revert InsufficientFee();
uint256 remainingValue = msg.value - MINT_FEE;
// Check if it's an erc20 mint...
IERC721LazyPayableClaim.Claim memory claim = manifold721Claim.getClaim(creatorContractAddress, instanceId);
if (claim.erc20 != address(0)) {
// It's an erc20 mint, so we need to get the token address
address tokenAddress = claim.erc20;
// Approve the token to the manifold721Claim contract
IERC20(tokenAddress).approve(address(manifold721Claim), claim.cost);
// Take the cost from the user
IERC20(tokenAddress).transferFrom(mintFor, address(this), claim.cost);
}
manifold721Claim.mint{value: remainingValue}(creatorContractAddress, instanceId, mintIndex, merkleProof, mintFor);
}
function far721_mintBatch(address creatorContractAddress, uint256 instanceId, uint16 mintCount, uint32[] calldata mintIndices, bytes32[][] calldata merkleProofs, address mintFor) external payable {
uint256 totalFee = MINT_FEE * mintCount;
if (msg.value < totalFee) revert InsufficientFee();
uint256 remainingValue = msg.value - totalFee;
// Check if it's an erc20 mint...
IERC721LazyPayableClaim.Claim memory claim = manifold721Claim.getClaim(creatorContractAddress, instanceId);
if (claim.erc20 != address(0)) {
// It's an erc20 mint, so we need to get the token address
address tokenAddress = claim.erc20;
// Approve the token to the manifold721Claim contract
IERC20(tokenAddress).approve(address(manifold721Claim), claim.cost * mintCount);
// Take the cost from the user
IERC20(tokenAddress).transferFrom(mintFor, address(this), claim.cost * mintCount);
}
manifold721Claim.mintBatch{value: remainingValue}(creatorContractAddress, instanceId, mintCount, mintIndices, merkleProofs, mintFor);
}
function far721_mintProxy(address creatorContractAddress, uint256 instanceId, uint16 mintCount, uint32[] calldata mintIndices, bytes32[][] calldata merkleProofs, address mintFor) external payable {
uint256 totalFee = MINT_FEE * mintCount;
if (msg.value < totalFee) revert InsufficientFee();
uint256 remainingValue = msg.value - totalFee;
// Check if it's an erc20 mint...
IERC721LazyPayableClaim.Claim memory claim = manifold721Claim.getClaim(creatorContractAddress, instanceId);
if (claim.erc20 != address(0)) {
// It's an erc20 mint, so we need to get the token address
address tokenAddress = claim.erc20;
// Approve the token to the manifold721Claim contract
IERC20(tokenAddress).approve(address(manifold721Claim), claim.cost * mintCount);
// Take the cost from the user
IERC20(tokenAddress).transferFrom(mintFor, address(this), claim.cost * mintCount);
}
manifold721Claim.mintProxy{value: remainingValue}(creatorContractAddress, instanceId, mintCount, mintIndices, merkleProofs, mintFor);
}
function far721_mintSignature(address creatorContractAddress, uint256 instanceId, uint16 mintCount, bytes calldata signature, bytes32 message, bytes32 nonce, address mintFor, uint256 expiration) external payable {
uint256 totalFee = MINT_FEE * mintCount;
if (msg.value < totalFee) revert InsufficientFee();
uint256 remainingValue = msg.value - totalFee;
// Check if it's an erc20 mint...
IERC721LazyPayableClaim.Claim memory claim = manifold721Claim.getClaim(creatorContractAddress, instanceId);
if (claim.erc20 != address(0)) {
// It's an erc20 mint, so we need to get the token address
address tokenAddress = claim.erc20;
// Approve the token to the manifold721Claim contract
IERC20(tokenAddress).approve(address(manifold721Claim), claim.cost * mintCount);
// Take the cost from the user
IERC20(tokenAddress).transferFrom(mintFor, address(this), claim.cost * mintCount);
}
manifold721Claim.mintSignature{value: remainingValue}(creatorContractAddress, instanceId, mintCount, signature, message, nonce, mintFor, expiration);
}
// ============ Admin Functions ============
function withdraw(address payable receiver, uint256 amount) external onlyOwner {
(bool success, ) = receiver.call{value: amount}("");
require(success, "Transfer failed");
}
function adminConfigure(address _manifold1155Claim, address _manifold721Claim) external onlyOwner {
manifold1155Claim = IERC1155LazyPayableClaim(_manifold1155Claim);
manifold721Claim = IERC721LazyPayableClaim(_manifold721Claim);
}
function configureMintFee(uint256 _mintFee) external onlyOwner {
MINT_FEE = _mintFee;
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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 {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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);
}
}
{
"compilationTarget": {
"src/ManifoldClaimShim.sol": "ManifoldClaimShim"
},
"evmVersion": "prague",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": [
":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
":forge-std/=lib/forge-std/src/",
":halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
":openzeppelin-contracts/=lib/openzeppelin-contracts/"
]
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InsufficientFee","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MINT_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_manifold1155Claim","type":"address"},{"internalType":"address","name":"_manifold721Claim","type":"address"}],"name":"adminConfigure","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintFee","type":"uint256"}],"name":"configureMintFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint32","name":"mintIndex","type":"uint32"}],"name":"far1155_checkMintIndex","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint32[]","name":"mintIndices","type":"uint32[]"}],"name":"far1155_checkMintIndices","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"}],"name":"far1155_getTotalMints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint32","name":"mintIndex","type":"uint32"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"internalType":"address","name":"mintFor","type":"address"}],"name":"far1155_mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint16","name":"mintCount","type":"uint16"},{"internalType":"uint32[]","name":"mintIndices","type":"uint32[]"},{"internalType":"bytes32[][]","name":"merkleProofs","type":"bytes32[][]"},{"internalType":"address","name":"mintFor","type":"address"}],"name":"far1155_mintBatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint16","name":"mintCount","type":"uint16"},{"internalType":"uint32[]","name":"mintIndices","type":"uint32[]"},{"internalType":"bytes32[][]","name":"merkleProofs","type":"bytes32[][]"},{"internalType":"address","name":"mintFor","type":"address"}],"name":"far1155_mintProxy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint16","name":"mintCount","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes32","name":"message","type":"bytes32"},{"internalType":"bytes32","name":"nonce","type":"bytes32"},{"internalType":"address","name":"mintFor","type":"address"},{"internalType":"uint256","name":"expiration","type":"uint256"}],"name":"far1155_mintSignature","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint32","name":"mintIndex","type":"uint32"}],"name":"far721_checkMintIndex","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint32[]","name":"mintIndices","type":"uint32[]"}],"name":"far721_checkMintIndices","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"}],"name":"far721_getTotalMints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint32","name":"mintIndex","type":"uint32"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"internalType":"address","name":"mintFor","type":"address"}],"name":"far721_mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint16","name":"mintCount","type":"uint16"},{"internalType":"uint32[]","name":"mintIndices","type":"uint32[]"},{"internalType":"bytes32[][]","name":"merkleProofs","type":"bytes32[][]"},{"internalType":"address","name":"mintFor","type":"address"}],"name":"far721_mintBatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint16","name":"mintCount","type":"uint16"},{"internalType":"uint32[]","name":"mintIndices","type":"uint32[]"},{"internalType":"bytes32[][]","name":"merkleProofs","type":"bytes32[][]"},{"internalType":"address","name":"mintFor","type":"address"}],"name":"far721_mintProxy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint16","name":"mintCount","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes32","name":"message","type":"bytes32"},{"internalType":"bytes32","name":"nonce","type":"bytes32"},{"internalType":"address","name":"mintFor","type":"address"},{"internalType":"uint256","name":"expiration","type":"uint256"}],"name":"far721_mintSignature","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"manifold1155Claim","outputs":[{"internalType":"contract IERC1155LazyPayableClaim","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manifold721Claim","outputs":[{"internalType":"contract IERC721LazyPayableClaim","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]