You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling a function which takes an interface as an argument, if that function is defined in a contract, the ABI indicates that the type of that interface argument is address (additional information that it is a contract is stored in the internalType field). However, when the same function which takes an interface as an argument is defined in a library, the ABI indicates that the type of that interface argument is the name of the interface (and not address) -- the internalType field remains unchanged.
As shown in the above results, the type for the argument of baz in the contract is {"internalType":"contract InterfaceExample","name":"i","type":"address"} but the argument of bar in the library is {"internalType":"contract InterfaceExample","name":"i","type":"InterfaceExample"}.
The text was updated successfully, but these errors were encountered:
Description
When compiling a function which takes an interface as an argument, if that function is defined in a contract, the ABI indicates that the
type
of that interface argument isaddress
(additional information that it is a contract is stored in theinternalType
field). However, when the same function which takes an interface as an argument is defined in a library, the ABI indicates that thetype
of that interface argument is the name of the interface (and notaddress
) -- theinternalType
field remains unchanged.Environment
shanghai
)Steps to Reproduce
Consider the following contract
Example
:along with the following library implementation:
When we run
solc Example.sol --combined-json abi
the following is output:As shown in the above results, the type for the argument of
baz
in the contract is{"internalType":"contract InterfaceExample","name":"i","type":"address"}
but the argument ofbar
in the library is{"internalType":"contract InterfaceExample","name":"i","type":"InterfaceExample"}
.The text was updated successfully, but these errors were encountered: