Context: I'm trying to integrate a contract call in React and I need to need call another contract call if the previous one is completed successfully. Is there any other way that we can know if the safeTransaction
is completed? One way I can see is to use this API - https://safe-transaction-mainnet.safe.global/api/v1/multisig-transactions/ and use isSuccessful
key from the response. But is there any other alternative method using web3.js or ether.js or any other web3 solution?
1 Answer
It depends if both of them called by your code or not.
If the fist call of another contract called is not code in your side(for example a DEX smart contract called by a user who is not your user, in this case you should use emitted events.
But if not(if your contract called by a user and you want to called another a function in another contract), you can return a bool from first call that shows if tx is failed or not, if returns true sends second call (to doing this you can use useState
and useEffect
from React
.
I hope it makes sense