2

Im am relatively new to using ChainLinks ORACLE contract in solidity. I have recently managed to successfully integrate their VRFConsumerBase.sol in my consumer contract to generate random numbers. However, when i want to integrate and use their Client to make simple Get request to my API, it throws this error upon compiling

CompileError: TypeError: Member "add" not found or not visible after argument-dependent lookup in struct Chainlink.Request memory

I am currently using Truffle v5.1.65 & Sol 0.8.0. I am importing my ChainLink files as shown below :

import "@chainlink/contracts/src/v0.8/dev/ChainlinkClient.sol";

Here's My function :

    function uploadTokenDataToServer(NFT memory nft) public{

     require(LINK.balanceOf(address(this)) >= linkFee, "Not enough LINK - fill contract with faucet");


    Chainlink.Request memory request = buildChainlinkRequest(jobId, address(this), this.confirmUpload.selector);
    
    string memory finalURL = append(nft.ID,nft.creator,nft.desc) ;
    
    request.add("get", finalURL);
  
    return sendChainlinkRequestTo(oracle, request, linkFee);
}

It seems that the add function is not being detected when compiling. Any help would be greatly appreciated.

1 Answer 1

1

The solidity v0.8 contracts for Chainlink are still in active development, use the v0.6 contracts until they are ready.

import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol";

For future reference, the contracts are currently in the dev folder of the v0.8 directory, indicating they aren't ready for production.

2
  • Thank you for clarifying that! I could not find a direct answer
    – user72964
    May 18, 2021 at 21:55
  • UPDATE: As of Aug 07, 2021, The issue is still present even though the ChainlinkClient.sol isn't in the v0.8/dev/ directory.
    – metadata
    Aug 7, 2021 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy