Reputation: 25
I am struggling to verify a simple contract on the snowtrace that's using chainlink and keep getting this error : ParserError: Source "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol" not found: File import callback not supported
i will put the code below, i tried changing compiler version many times, tried with and without optimization, tried to copy the ABI but got this error:
the code:
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0;
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
contract AvaxConverter {
AggregatorV3Interface internal priceFeed;
constructor() {
priceFeed = AggregatorV3Interface(0x5498BB86BC934c8D34FDA08E81D444153d0D06aD);
}
function getCurrentPrice() public view returns (int) {
(
/*uint80 roundID*/,
int price,
/*uint startedAt*/,
/*uint timeStamp*/,
/*uint80 answeredInRound*/
) = priceFeed.latestRoundData();
return price;
}
function convertCurrency(int amount) public view returns (int) {
(
/*uint80 roundID*/,
int price,
/*uint startedAt*/,
/*uint timeStamp*/,
/*uint80 answeredInRound*/
) = priceFeed.latestRoundData();
return amount * 10**16/price;
}
}
The photo from inside remix
i need to verify only on snowtrace
Upvotes: 0
Views: 292
Reputation: 601
if you are using truffle i suggest you to take a look at the truffle-verify-plugin
.
After Adding the plugin in the truffle settings and adding the desired block explorer's API key you can verify a contract by doing this command:
truffle run verify SomeContractName AnotherContractName --network networkName
Upvotes: 0