Solidity 导入多个声明

Solidity Import Multiple Declarations

我需要使用外部合同 (AAVE),以便调用我导入它们的方法。然而,这个导入与之前的 ERC20 声明冲突,我有下一个错误:

browser/Project.sol:10:1: DeclarationError: Identifier already declared. import "https://github.com/aave/protocol-v2/blob/master/contracts/interfaces/IAToken.sol"; ^----------------------------------------------------------------------------------------^ https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.3.0/contracts/token/ERC20/IERC20.sol:8:1: The previous declaration is here: interface IERC20 { ^ (Relevant source part starts here and spans across multiple lines).

您可以删除第二个导入并仍然使用 IERC20 接口,因为它已经由第一个导入导入。