1

I'm trying to compile a contract that imports Chainlink's Operator.sol, but when I do I get the below error.

Contract:

// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "@chainlink/contracts/src/v0.7/Operator.sol";

Error:

@chainlink/contracts/src/v0.7/Operator.sol:540:37: TypeError: The suffixes .offset and .slot can only be used on storage variables.
      firstDataWord := calldataload(data.offset)
                                    ^---------^

Relevant part of Operator.sol:

  modifier validateMultiWordResponseId(bytes32 requestId, bytes calldata data) {
    require(data.length >= 32, "Response must be > 32 bytes");
    bytes32 firstDataWord;
    assembly {
      firstDataWord := calldataload(data.offset)
    }
    require(requestId == firstDataWord, "First word must be requestId");
    _;
  }

Thanks

2
  • Can you share the version of compiler and source code of the operator.sol? I compiled operator smart contract and did not get the issue.
    – Frank Kong
    Commented May 11, 2023 at 8:01
  • Compiler version is 0.7.0, getting the same error in Hardhat and Remix. This is where I got Operator.sol: github.com/EverID/everest-chainlink-consumer/blob/master/… Thank you.
    – palmcivet
    Commented May 11, 2023 at 15:13

1 Answer 1

0

The contract compiled with 0.7.6.

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.