Chainlink 消费者合约中的回调地址有什么用?

What is the use of callback addresses in a Chainlink Consumer contract?

我对 RSK 集成有疑问(特别是关于如何使用回调地址) https://github.com/smartcontractkit/chainlink-RSK/blob/master/test-runner/src/contracts/Consumer.sol

 function requestRIFPriceByCallback(uint256 _payment, address _callback) public {
    Chainlink.Request memory req = buildChainlinkRequest(specId, _callback, this.fulfill.selector);
    req.add("get", "https://api.liquid.com/products/580");
    req.add("path", "last_traded_price");
    req.addInt("times", 100000000);
    sendChainlinkRequest(req, _payment);
  }

https://github.com/smartcontractkit/chainlink/blob/develop/evm-contracts/src/v0.4/tests/Consumer.sol

function requestEthereumPrice(string _currency) public {
    Chainlink.Request memory req = buildChainlinkRequest(specId, this, this.fulfill.selector);
    req.add("get", "https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD,EUR,JPY");
    string[] memory path = new string[](1);
    path[0] = _currency;
    req.addStringArray("path", path);
    sendChainlinkRequest(req, ORACLE_PAYMENT);
  }

这些来自 Consumer.sol(上方来自 RSK,下方来自原始) 为什么 RSK 消费者需要一个回调地址,那是什么 do/how 它有效吗?

这两个函数都有回调地址。您会在第二种方法中看到他们只使用“this”。回调地址是“buildChainlinkRequest”函数中的一个参数。它指定 return 将数据发送到哪个合约。结合函数选择器,您可以选择要将数据 return 发送到的合约和函数。

第二个方法没有回调地址,因为它设置为'this'。第一个函数让你选择。