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

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.