I have been on this to test how requests will be canceled.

i go this error enter image description here

the has of the transaction here: https://testnet.bscscan.com/tx/0x9ace618d75687e59a7f4ca727fbb8c595a7b94491679c7963521daa2ee50f1ad

what I did found here:

function cancelRequest( bytes32 _requestId) public  onlyOwner {
    cancelChainlinkRequest(_requestId, 0.1e18, this.requested.selector,block.timestamp);

function requested(bytes32 _requestId, uint256 _volume) public recordChainlinkFulfillment(_requestId) {
    myQuerie = 100;

how I got the hash was my suspect:

bytes32 queries; queries = sendChainlinkRequestTo(oracle, request, 0.1e18);

return queries ;

the transaction keeps failing and reverted, not suspecting gas and if it is how to get my way around it. to reproduce here is the link to the gist: https://gist.github.com/OnahProsperity/2317454faa8c92c31ce1d7659968a7d7

2 Answers 2


it looks like you're doing 2 requests there in your code. Can you try do only 1 call to sendChainlinkRequestTo. eg have your first line there, but change the second one to 'return queries;'

  • Thanks, Harry for your response. I set as a public variable on the contract so I used the request ID that I set to update the queries then pass it in this function: function cancelRequest( bytes32 _requestId) public onlyOwner { cancelChainlinkRequest(_requestId, 0.1e18, this.requested.selector,block.timestamp); } so this is to update the public variable that I declare on my contract. queries = sendChainlinkRequestTo(oracle, request, 0.1e18); and this is to return request return sendChainlinkRequestTo(oracle, request, 0.1e18); as requested by the oracle.
    – Prosperity
    Commented Sep 29, 2021 at 7:30
  • thanks. Can you please update your first thread with your full contract source code, then the steps you follow to get the error, including any parameters passed to functions. That will allow me to try replicate and see what the issue is Commented Sep 30, 2021 at 0:33
  • thanks Harry, I just re-edited the question and added the gist link to reproduce.
    – Prosperity
    Commented Sep 30, 2021 at 1:48

In case an oracle node does not respond, it may be necessary to retrieve the LINK used to pay for the unfulfilled request. The cancelChainlinkRequest will send the cancel request to the address used for the request, which transfers the amount of LINK back to the requesting contract and deletes it from the tracked requests.

The default expiration for a request is five minutes, after which it can be cancelled. The cancellation must be sent by the address which was specified as the callback location of the contract.

For the sake of efficient gas usage, only a hash of the request's parameters are stored on-chain. In order to validate the terms of the request and that it can be calculated, the request parameters must be provided. Additionally, cancellation must be called by the address to which the callback would otherwise have been called on.

sight this and it became more clearer that a request can only be canceled when a node failed to fulfill the request. https://docs.chain.link/docs/chainlink-framework/#cancelchainlinkrequest

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.