// Solidity interface
struct ClaimCheck {
address projectAddress;
address currency;
uint256 amount;
uint256[] tokenIds; // used for NFTs
uint256[] amounts; // used for NFTs
}
const claimChecks = [
{
projectAddress: '0x1234', // On the settings section on the app
currency: '0x0000000000000000000000000000000000000000',
amount: ethers.utils.formatEther(10),
tokenIds: [], // Empty because it's an ERC20
amounts: [], // Empty because it's an ERC20
},
];
// Build claimChecks
const claimChecks = [
{
projectAddress: 'FuulProject contract address', // On the Handy Links section on the app
currency: '0x0000000000000000000000000000000000000000',
amount: ethers.utils.formatEther(10),
tokenIds: [], // Empty because it's an ERC20
amounts: [], // Empty because it's an ERC20
},
];
// Get FuulManager contract
const address = "0xC38E3A10B5818601b29c83F195E8b5854AAE45aF";
const abi = [
"function claim(ClaimCheck[] calldata claimChecks) external"
];
const [user1] = await ethers.getSigners();
const fuulManager = new ethers.Contract(address, abi, user1);
// Make the transaction
const tx = await fuulManager.claim(claimChecks);