ABI is incomplete for contract written in "Solidity Multiple files format", e.g. 0xedfcb78e73f7ba6ad2d829bf5d462a0924da28ed

427 Views Asked by At

For this contract https://bscscan.com/address/0xedfcb78e73f7ba6ad2d829bf5d462a0924da28ed#code There are eight source files which are known as "Solidity Multiple files format"

However neither the bscscan website: https://bscscan.com/address/0xedfcb78e73f7ba6ad2d829bf5d462a0924da28ed#code nor the bscscan API: https://api.bscscan.com/api?module=contract&action=getabi&address=0xedfcb78e73f7ba6ad2d829bf5d462a0924da28ed can get full ABI.

They only provide the ABI for the first source file.

How do I get the full and functional ABI to interact with?

1

There are 1 best solutions below

0
Petr Hejda On

They only provide the ABI for the first source file.

That's an expected result. The ABI JSON is generated only for public and external functions, as well as for autogenerated functions from public properties of the main contract and its parents.

The imported contracts are usually called from or inherited by the main contract, but theoretically they can be unused as well.

Note: It doesn't need to be the first contract in the order, you pass the main contract name as one of the options for compilation.


In your example, the AdminUpgradeabilityProxy is the main contract, deriving from UpgradeabilityProxy, which derives from Proxy. So the ABI json contains all public and external functions and events from these three contracts.