current position:Home>Why use call? Can't you directly use the method to import the interface of the contract

Why use call? Can't you directly use the method to import the interface of the contract

2022-02-03 23:18:45 Q & A of Denglian community

call.png A call in a smart contract must be a method in a contract , Then import the interface of that contract , If you generate an instance, you can call it directly with the function name , Why use low-level call What about this kind of way ?




Take the answer 1:

The main reason is to get transferFrom To determine whether the transfer is successful .

And because of some transferFrom The implementation of does not follow the standard ERC20 The request returns a value of success . This leads to the use of transferFrom Function cannot get the return value directly .




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

Random recommended