current position:Home>Web3 calls the smart contract method. Can you call multiple contract methods at one time? Either they all succeed or they all fail

Web3 calls the smart contract method. Can you call multiple contract methods at one time? Either they all succeed or they all fail

2022-02-03 23:26:10 Q & A of Denglian community

web3 When adjusting some finished product smart contract methods , The core is to deliver the method of smart contract encodeABI Encoded string , Usually, the method is called one at a time , Sometimes you need to call multiple methods of a smart contract at once , Or call multiple methods of multiple smart contracts , By splicing the method of smart contract encodeABI Encoded string , Is it possible to achieve

Or other implementation methods can also , The premise is to send a blockchain request once , And you don't need to write your own smart contract to package these methods

Write your own smart contract and package these methods , It can call many methods at one time , However, we should be flexible to call many methods of many contracts at one time , You can't always write smart contracts to package these methods






Other answers 1:

copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032326082134.html

Random recommended