ERC1155Airdrop
Functionality available for contracts that implement the
ERC1155Airdrop
extension.
Deploy an ERC1155Airdrop
contract from the Explore page:
drop
Airdrop ERC1155 tokens to multiple recipients.
// Airdrop content array, with recipients and tokenIds
const contents = [
{
recipient: "0xabc...", // first recipient address
tokenId: 0,
amount: "10" // number of tokens
},
{
recipient: "0x123...", // second recipient address
tokenId: 0
amount: "20" // number of tokens
}
]
const tokenAddress = "0x..." // Address of the ERC1155 token being airdropped
const tokenOwner = "0x..." // Address of the owner of the tokens being airdropped
const output = await contract.airdrop1155.drop(tokenAddress, tokenOwner, contents);
// the `output` return value above contains:
// - count of successful and failed drops
// - array containing failed drops, if any
Return Value
The drop
function returns an array of recipients for who the airdrop failed (empty means all transfers were successful).