简体   繁体   English

Chainlink 返回错误:处理事务时出现 VM 异常:还原

[英]Chainlink Returned error: VM Exception while processing transaction: revert

I am testing this code on Remix:我正在 Remix 上测试这段代码

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";

contract PriceConsumerV3 {

    AggregatorV3Interface internal priceFeed;

    /**
     * Network: Kovan
     * Aggregator: ETH/USD
     * Address: 0x9326BFA02ADD2366b30bacB125260Af641031331
     */
    constructor() {
        priceFeed = AggregatorV3Interface(0x9326BFA02ADD2366b30bacB125260Af641031331);
    }

    /**
     * Returns the latest price
     */
    function getLatestPrice() public view returns (int) {
        (
            uint80 roundID, 
            int price,
            uint startedAt,
            uint timeStamp,
            uint80 answeredInRound
        ) = priceFeed.latestRoundData();
        return price;
    }
}

Compilation and deployment seem to be executed correctly, however I receive this error:编译和部署似乎正确执行,但是我收到此错误:

call to PriceConsumerV3.getLatestPrice errored: Returned error: VM Exception while processing transaction: revert调用 PriceConsumerV3.getLatestPrice 出错:返回错误:处理事务时出现 VM 异常:还原

Any suggestion?有什么建议吗?

I've seen this error when deploying to the Javascript VM我在部署到Javascript VM时看到了这个错误

部署中

It's due to the contract you are trying to call not being available on the VM you are using.这是因为您尝试调用的合同在您使用的 VM 上不可用。 You'll need to switch to the Injected Web3 option.您需要切换到Injected Web3选项。

The deployment will also require having a wallet set up as you interact with an actual blockchain.部署还需要在您与实际区块链交互时设置钱包。 The example you reference is using the Kovan Tes.net.您引用的示例使用的是 Kovan Tes.net。

Here are a few other links for reference这里有几个其他链接供参考

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “VM Exception while processing transaction: revert”,当运行chainlink节点并尝试部署TestnetConsumer合约时? - "VM Exception while processing transaction: revert", when running a chainlink node and try to deploy TestnetConsumer contract? 错误:返回错误:处理事务时出现 VM 异常:恢复余额不足 — 给出的原因:余额不足 - Error: Returned error: VM Exception while processing transaction: revert Not Enough Balance — Reason given: Not Enough Balance 松露错误:错误:处理事务时VM异常:恢复 - Truffle error: Error: VM Exception while processing transaction: revert 处理事务时出现 VM 异常:还原 - VM Exception while processing transaction: revert Openzepplin众包合同获得:处理事务时VM异常:恢复错误 - Openzepplin crowdsale contract got: VM Exception while processing transaction: revert error 无法弄清楚为什么在处理事务时出现 VM 异常:恢复错误 - Cannot figure out why I am getting VM Exception while processing transaction: revert error 错误 Truffle Migrate “处理事务时出现 VM 异常:操作码无效” - Error Truffle Migrate "VM Exception while processing transaction: invalid opcode" 处理事务时出现 VM 异常:恢复 TransferHelper: TRANSFER_FROM_FAILED 运行 bot.js 的 manipulatePrice.js 测试时 - VM Exception while processing transaction: revert TransferHelper: TRANSFER_FROM_FAILED when running manipulatePrice.js test for bot.js Chainlink submit_tx 错误:无法发送链 ID 上的交易 - Chainlink submit_tx Error: cannot send transaction on chain ID 在 solana 上传输 NFT 时交易失败:错误处理指令 0:自定义程序错误:0x1 - Transaction failing while transferring NFT on solana: Error processing Instruction 0: custom program error: 0x1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM