0
I can able to deploy on kovan network and get this running fine but cannot able to deploy on bsc testnet
tried with this RPC URL
https://data-seed-prebsc-1-s1.binance.org:8545/ Chain ID : 97
and also
RPC UrL : https://data-seed-prebsc-1-s2.binance.org:8545/ Chain ID : 97
but it didn't help.
Here is the error I get:
Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? Internal JSON-RPC error. { "code": -32000, "message": "execution reverted" }
Here is the contract I'm trying to run.
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.7;
import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol";
/**
* THIS IS AN EXAMPLE CONTRACT WHICH USES HARDCODED VALUES FOR CLARITY.
* PLEASE DO NOT USE THIS CODE IN PRODUCTION.
*/
contract APIConsumer is ChainlinkClient {
using Chainlink for Chainlink.Request;
uint256 public volume;
address private oracle;
bytes32 private jobId;
uint256 private fee;
/**
* Network: Kovan
* Oracle: 0xc57B33452b4F7BB189bB5AfaE9cc4aBa1f7a4FD8 (Chainlink Devrel
* Node)
* Job ID: d5270d1c311941d0b08bead21fea7747
* Fee: 0.1 LINK
*/
constructor() public {
setPublicChainlinkToken();
//oracle = 0xc57B33452b4F7BB189bB5AfaE9cc4aBa1f7a4FD8; //Kovan
//jobId = "d5270d1c311941d0b08bead21fea7747"; //kovan
//fee = 0.1 * 10 ** 18; // (Varies by network and job) //kovan
oracle = 0x63B72AF260E8b40A7b89E238FeB53448A97b03D2; // BSC Testnet
jobId = "e07f08e39d2c448d9696319bae8eeddf"; // BSC Testnet
fee = 0.1 * 10 ** 18; // (Varies by network and job) // BSC Testnet
}
/**
* Create a Chainlink request to retrieve API response, find the target
* data, then multiply by 1000000000000000000 (to remove decimal places from data).
*/
function requestVolumeData() public returns (bytes32 requestId)
{
Chainlink.Request memory request = buildChainlinkRequest(jobId, address(this), this.fulfill.selector);
// Set the URL to perform the GET request on
request.add("get", "https://min-api.cryptocompare.com/data/pricemultifull?fsyms=ETH&tsyms=USD");
// Set the path to find the desired data in the API response, where the response format is:
// {"RAW":
// {"ETH":
// {"USD":
// {
// "VOLUME24HOUR": xxx.xxx,
// }
// }
// }
// }
request.add("path", "RAW.ETH.USD.VOLUME24HOUR");
// Multiply the result by 1000000000000000000 to remove decimals
int timesAmount = 10**18;
request.addInt("times", timesAmount);
// Sends the request
return sendChainlinkRequestTo(oracle, request, fee);
}
//Receive the response in the form of uint256
function fulfill(bytes32 _requestId, uint256 _volume) public recordChainlinkFulfillment(_requestId)
{
volume = _volume;
}
// function withdrawLink() external {} - Implement a withdraw function to avoid locking your LINK in the contract
}
Any help
Thanks