Filecoin Filrep Oracle: Obtain miner reputations on-chain
Midpoint
Contract
0x83986ff4fbcaa2acf6092930fcebbe25583be452// SPDX-License-Identifier: MIT
// This is a test contract deployed by Midpoint for demonstrating
pragma solidity>=0.8.0;
interface IMidpoint {
function callMidpoint(uint64 midpointId) external returns(uint64 requestId);
function callMidpoint(uint64 midpointId, bytes calldata _data) external returns(uint64 requestId);
}
address constant startpointAddress = 0x0705c34AA032354A7966776098E0c12cc5539Bc8;
address constant midpointCallbackAddress = 0xC0FFEE4a3A2D488B138d090b8112875B90b5e6D9;
contract MidpointOracleTestContract {
event ResultReturned(uint64 midpointId);
event ResultReturnedBool(uint64 midpointId, bool response);
event ResultReturnedI16(uint64 midpointId, int16 response);
event ResultReturnedI256(uint64 midpointId, int256 response);
event ResultReturnedU16(uint64 midpointId, uint16 response);
event ResultReturnedU256(uint64 midpointId, uint256 response);
event ResultReturnedAddr(uint64 midpointId, address response);
event ResultReturnedStr(uint64 midpointId, string response);
event ResultReturnedBoolArr(uint64 midpointId, bool[] response);
event ResultReturnedI16Arr(uint64 midpointId, int16[] response);
event ResultReturnedI256Arr(uint64 midpointId, int256[] response);
event ResultReturnedU16Arr(uint64 midpointId, uint16[] response);
event ResultReturnedU256Arr(uint64 midpointId, uint256[] response);
event ResultReturnedAddrArr(uint64 midpointId, address[] response);
event ResultReturnedStrArr(uint64 midpointId, string[] response);
event ResultReturnedU256U256(uint64 midpointId, uint256 response1, uint256 response2);
event ResultReturnedU256Str(uint64 midpointId, uint256 response1, string response2);
event ResultReturnedStrStr(uint64 midpointId, string response1, string response2);
event ResultReturnedU256U256U256(uint64 midpointId, uint256 response1, uint256 response2, uint256 response3);
event ResultReturnedU256U256Str(uint64 midpointId, uint256 response1, uint256 response2, string response3);
event ResultReturnedU256StrStr(uint64 midpointId, uint256 response1, string response2, string response3);
event ResultReturnedStrStrStr(uint64 midpointId, string response1, string response2, string response3);
function testCallToMidpoint(uint64 midpointId) public {
IMidpoint(startpointAddress).callMidpoint(midpointId);
}
function testCallToMidpoint(uint64 midpointId, bool var1) public {
bytes memory args = abi.encodePacked(var1);
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, uint16 var1) public {
bytes memory args = abi.encodePacked(var1);
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, uint256 var1) public {
bytes memory args = abi.encodePacked(var1);
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, int16 var1) public {
bytes memory args = abi.encodePacked(var1);
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, int256 var1) public {
bytes memory args = abi.encodePacked(var1);
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, address var1) public {
bytes memory args = abi.encodePacked(var1);
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, string calldata var1) public {
bytes memory args = abi.encodePacked(var1, bytes1(0x00));
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, bool var1, bool var2) public {
bytes memory args = abi.encodePacked(var1, var2);
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, uint16 var1, uint16 var2) public {
bytes memory args = abi.encodePacked(var1, var2);
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, int16 var1, uint16 var2) public {
bytes memory args = abi.encodePacked(var1, var2);
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, uint256 var1, int256 var2) public {
bytes memory args = abi.encodePacked(var1, var2);
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, int256 var1, int256 var2) public {
bytes memory args = abi.encodePacked(var1, var2);
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, address var1, address var2) public {
bytes memory args = abi.encodePacked(var1, var2);
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, string calldata var1, string calldata var2) public {
bytes memory args = abi.encodePacked(var1, bytes1(0x00), var2, bytes1(0x00));
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, bool var1, string calldata var2) public {
bytes memory args = abi.encodePacked(var1, var2, bytes1(0x00));
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, int16 var1, string calldata var2) public {
bytes memory args = abi.encodePacked(var1, var2, bytes1(0x00));
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, int256 var1, string calldata var2) public {
bytes memory args = abi.encodePacked(var1, var2, bytes1(0x00));
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, uint16 var1, string calldata var2) public {
bytes memory args = abi.encodePacked(var1, var2, bytes1(0x00));
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, uint256 var1, string calldata var2) public {
bytes memory args = abi.encodePacked(var1, var2, bytes1(0x00));
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, address var1, string calldata var2) public {
bytes memory args = abi.encodePacked(var1, var2, bytes1(0x00));
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function testCallToMidpoint(uint64 midpointId, string calldata var1, string calldata var2, string calldata var3) public {
bytes memory args = abi.encodePacked(var1, bytes1(0x00), var2, bytes1(0x00), var3, bytes1(0x00));
IMidpoint(startpointAddress).callMidpoint(midpointId, args);
}
function callback(uint64 midpointId) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturned(midpointId);
}
function callback(uint64 midpointId, bool response) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedBool(midpointId, response);
}
function callback(uint64 midpointId, int16 response) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedI16(midpointId, response);
}
function callback(uint64 midpointId, int256 response) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedI256(midpointId, response);
}
function callback(uint64 midpointId, uint16 response) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedU16(midpointId, response);
}
function callback(uint64 midpointId, uint256 response) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedU256(midpointId, response);
}
function callback(uint64 midpointId, address response) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedAddr(midpointId, response);
}
function callback(uint64 midpointId, string calldata response) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedStr(midpointId, response);
}
function callback(uint64 midpointId, bool[] calldata response) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedBoolArr(midpointId, response);
}
function callback(uint64 midpointId, int16[] calldata response) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedI16Arr(midpointId, response);
}
function callback(uint64 midpointId, int256[] calldata response) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedI256Arr(midpointId, response);
}
function callback(uint64 midpointId, uint16[] calldata response) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedU16Arr(midpointId, response);
}
function callback(uint64 midpointId, uint256[] calldata response) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedU256Arr(midpointId, response);
}
function callback(uint64 midpointId, address[] calldata response) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedAddrArr(midpointId, response);
}
function callback(uint64 midpointId, string[] calldata response) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedStrArr(midpointId, response);
}
function callback(uint64 midpointId, uint256 response1, uint256 response2) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedU256U256(midpointId, response1, response2);
}
function callback(uint64 midpointId, uint256 response1, string calldata response2) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedU256Str(midpointId, response1, response2);
}
function callback(uint64 midpointId, string calldata response1, string calldata response2) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedStrStr(midpointId, response1, response2);
}
function callback(uint64 midpointId, uint256 response1, uint256 response2, uint256 response3) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedU256U256U256(midpointId, response1, response2, response3);
}
function callback(uint64 midpointId, uint256 response1, uint256 response2, string calldata response3) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedU256U256Str(midpointId, response1, response2, response3);
}
function callback(uint64 midpointId, uint256 response1, string calldata response2, string calldata response3) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedU256StrStr(midpointId, response1, response2, response3);
}
function callback(uint64 midpointId, string calldata response1, string calldata response2, string calldata response3) public {
require(tx.origin == midpointCallbackAddress, "Invalid EOA");
emit ResultReturnedStrStrStr(midpointId, response1, response2, response3);
}
}




Last updated