From 197e0a4a169410e1820b5ccb4994129c6a8c2858 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Fri, 18 Nov 2022 15:41:28 -0800 Subject: [PATCH] working on batching logic --- src/Contracts.svelte | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Contracts.svelte b/src/Contracts.svelte index 5e1f04b..ac230b3 100644 --- a/src/Contracts.svelte +++ b/src/Contracts.svelte @@ -135,12 +135,23 @@ window.scrollTo(0, document.body.scrollHeight); } + function deriveTokenTotals(recipients, tokens) { + let totals = { + addresses: [], + tokenIds: [], + amounts: [] + }; + for (let i = 0; i < recipients.length; i++) { + // + } + } + async function estimateCBT(recipients, tokens, isERC1155) { si_gasLimit = 0; // TODO - erc1155 batching let fee = await $contracts.shipit.methods.usageFee().call(); if (isERC1155) { - // + } else { await $contracts.shipit.methods.erc721BulkTransfer(contractAddress, recipients, tokens).estimateGas({from: $selectedAccount, value: fee * recipients.length}, function(err, gas){ si_gasLimit += gas;