go-nitro icon indicating copy to clipboard operation
go-nitro copied to clipboard

Allow batched deposits into single channel

Open NiloCK opened this issue 2 years ago • 0 comments

Per discussion w/ @nksazonov and others, some channels may want to manage several types of assets simultaneously. Performing a separate deposit transaction for each asset is inefficient.

#1574 introduced batch deposits of either ETH or a single ERC20 into many channels simultaneously via a proxy BatchOperator contract. The same approach will not work in this case, because each individual ERC20 token would require its own

Plan / recommendation: implement a depositAssetBatch function directly on MultiAssetHolder. The implementation can follow the pattern established in BatchOperator - just receive arrays of data that will be forwarded into the existing deposit function.

Might also be nice to have some gas benchmarks to compare an n-ERC20 token deposit against n calls to deposit.

NiloCK avatar Sep 14 '23 14:09 NiloCK