ERC20 batchTransfer functionality

I like this abstraction, however, would there be an example walking us through a use case?

function multicall(bytes[] calldata data) external returns (bytes[] memory results) {
    results = new bytes[](data.length);
    for (uint i = 0; i < data.length; i++) {
        results[i] = Address.functionDelegateCall(address(this), data[i]);
    }
    return results;
}

Like how someone can pass input parameters and what will be returned? No example can be better than a batchTransfer of ERC20 tokens. Thanks.

1 Like