Batch Operations

Published by Marianne Poser on

Last Updated on 22. May 2023 by Marianne Poser

Since all tokens are within a contract, multiple queries and operations can be performed in one transaction. Batch operations were introduced for this purpose. For the batch balance query, the address of the owner and the tokenIDs being queried would be included in two arrays and the number would also be returned in an array. Also, the transfer function is extended in the batch variant by two arrays with information of tokenID and amount. For the approval functions, however, the approach is “all or nothing”. There are no restrictions in amount or tokenID.

However, all functions will also be available without a batch feature to remain gas-efficient for single operations. In general, the approach of a multi-token contract is extremely gas-efficient since there is no need to create multiple contracts for the different token types and the transactions also take place within one contract.

Categories:

https://blockchain-academy.hs-mittweida.de/wp-content/uploads/2021/04/logo_bcam_rgb_gross.png

Welcome

Blockchain Academy

Continue with credential

No account yet?

Powered by Hidy

Register with Hidy


Register
Sign in

We need the following credential to register:

please select:

To create a new account, we need the following data from you:

We would appreciate the following additional information from you for the creation of your account:

Welcome

Blockchain Academy

Continue with credential

Already have an account?

Powered by Hidy

Sign in with Hidy


Register
Sign in

We need the following credential to log in:

please select: