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