编译器
0.8.17+commit.8df45f5f
文件 1 的 30:AccessControlRegistryAdminned.sol
pragma solidity ^0.8.0;
import "../utils/SelfMulticall.sol";
import "./RoleDeriver.sol";
import "./interfaces/IAccessControlRegistryAdminned.sol";
import "./interfaces/IAccessControlRegistry.sol";
contract AccessControlRegistryAdminned is
SelfMulticall,
RoleDeriver,
IAccessControlRegistryAdminned
{
address public immutable override accessControlRegistry;
string public override adminRoleDescription;
bytes32 internal immutable adminRoleDescriptionHash;
constructor(
address _accessControlRegistry,
string memory _adminRoleDescription
) {
require(_accessControlRegistry != address(0), "ACR address zero");
require(
bytes(_adminRoleDescription).length > 0,
"Admin role description empty"
);
accessControlRegistry = _accessControlRegistry;
adminRoleDescription = _adminRoleDescription;
adminRoleDescriptionHash = keccak256(
abi.encodePacked(_adminRoleDescription)
);
}
function _deriveAdminRole(
address manager
) internal view returns (bytes32 adminRole) {
adminRole = _deriveRole(
_deriveRootRole(manager),
adminRoleDescriptionHash
);
}
}
文件 2 的 30:AccessControlRegistryAdminnedWithManager.sol
pragma solidity ^0.8.0;
import "./AccessControlRegistryAdminned.sol";
import "./interfaces/IAccessControlRegistryAdminnedWithManager.sol";
contract AccessControlRegistryAdminnedWithManager is
AccessControlRegistryAdminned,
IAccessControlRegistryAdminnedWithManager
{
address public immutable override manager;
bytes32 public immutable override adminRole;
constructor(
address _accessControlRegistry,
string memory _adminRoleDescription,
address _manager
)
AccessControlRegistryAdminned(
_accessControlRegistry,
_adminRoleDescription
)
{
require(_manager != address(0), "Manager address zero");
manager = _manager;
adminRole = _deriveAdminRole(_manager);
}
}
文件 3 的 30:Api3ServerV1.sol
pragma solidity 0.8.17;
import "./OevDapiServer.sol";
import "./BeaconUpdatesWithSignedData.sol";
import "./interfaces/IApi3ServerV1.sol";
contract Api3ServerV1 is
OevDapiServer,
BeaconUpdatesWithSignedData,
IApi3ServerV1
{
constructor(
address _accessControlRegistry,
string memory _adminRoleDescription,
address _manager
) OevDapiServer(_accessControlRegistry, _adminRoleDescription, _manager) {}
function readDataFeedWithId(
bytes32 dataFeedId
) external view override returns (int224 value, uint32 timestamp) {
return _readDataFeedWithId(dataFeedId);
}
function readDataFeedWithDapiNameHash(
bytes32 dapiNameHash
) external view override returns (int224 value, uint32 timestamp) {
return _readDataFeedWithDapiNameHash(dapiNameHash);
}
function readDataFeedWithIdAsOevProxy(
bytes32 dataFeedId
) external view override returns (int224 value, uint32 timestamp) {
return _readDataFeedWithIdAsOevProxy(dataFeedId);
}
function readDataFeedWithDapiNameHashAsOevProxy(
bytes32 dapiNameHash
) external view override returns (int224 value, uint32 timestamp) {
return _readDataFeedWithDapiNameHashAsOevProxy(dapiNameHash);
}
function dataFeeds(
bytes32 dataFeedId
) external view override returns (int224 value, uint32 timestamp) {
DataFeed storage dataFeed = _dataFeeds[dataFeedId];
(value, timestamp) = (dataFeed.value, dataFeed.timestamp);
}
function oevProxyToIdToDataFeed(
address proxy,
bytes32 dataFeedId
) external view override returns (int224 value, uint32 timestamp) {
DataFeed storage dataFeed = _oevProxyToIdToDataFeed[proxy][dataFeedId];
(value, timestamp) = (dataFeed.value, dataFeed.timestamp);
}
}
文件 4 的 30:BeaconUpdatesWithSignedData.sol
pragma solidity 0.8.17;
import "./DataFeedServer.sol";
import "./interfaces/IBeaconUpdatesWithSignedData.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract BeaconUpdatesWithSignedData is
DataFeedServer,
IBeaconUpdatesWithSignedData
{
using ECDSA for bytes32;
function updateBeaconWithSignedData(
address airnode,
bytes32 templateId,
uint256 timestamp,
bytes calldata data,
bytes calldata signature
) external override returns (bytes32 beaconId) {
require(
(
keccak256(abi.encodePacked(templateId, timestamp, data))
.toEthSignedMessageHash()
).recover(signature) == airnode,
"Signature mismatch"
);
beaconId = deriveBeaconId(airnode, templateId);
int224 updatedValue = processBeaconUpdate(beaconId, timestamp, data);
emit UpdatedBeaconWithSignedData(
beaconId,
updatedValue,
uint32(timestamp)
);
}
}
文件 5 的 30:DapiServer.sol
pragma solidity 0.8.17;
import "../access-control-registry/AccessControlRegistryAdminnedWithManager.sol";
import "./DataFeedServer.sol";
import "./interfaces/IDapiServer.sol";
contract DapiServer is
AccessControlRegistryAdminnedWithManager,
DataFeedServer,
IDapiServer
{
string public constant override DAPI_NAME_SETTER_ROLE_DESCRIPTION =
"dAPI name setter";
bytes32 public immutable override dapiNameSetterRole;
mapping(bytes32 => bytes32) public override dapiNameHashToDataFeedId;
constructor(
address _accessControlRegistry,
string memory _adminRoleDescription,
address _manager
)
AccessControlRegistryAdminnedWithManager(
_accessControlRegistry,
_adminRoleDescription,
_manager
)
{
dapiNameSetterRole = _deriveRole(
_deriveAdminRole(manager),
DAPI_NAME_SETTER_ROLE_DESCRIPTION
);
}
function setDapiName(
bytes32 dapiName,
bytes32 dataFeedId
) external override {
require(dapiName != bytes32(0), "dAPI name zero");
require(
msg.sender == manager ||
IAccessControlRegistry(accessControlRegistry).hasRole(
dapiNameSetterRole,
msg.sender
),
"Sender cannot set dAPI name"
);
dapiNameHashToDataFeedId[
keccak256(abi.encodePacked(dapiName))
] = dataFeedId;
emit SetDapiName(dataFeedId, dapiName, msg.sender);
}
function dapiNameToDataFeedId(
bytes32 dapiName
) external view override returns (bytes32) {
return dapiNameHashToDataFeedId[keccak256(abi.encodePacked(dapiName))];
}
function _readDataFeedWithDapiNameHash(
bytes32 dapiNameHash
) internal view returns (int224 value, uint32 timestamp) {
bytes32 dataFeedId = dapiNameHashToDataFeedId[dapiNameHash];
require(dataFeedId != bytes32(0), "dAPI name not set");
DataFeed storage dataFeed = _dataFeeds[dataFeedId];
(value, timestamp) = (dataFeed.value, dataFeed.timestamp);
require(timestamp > 0, "Data feed not initialized");
}
}
文件 6 的 30:DataFeedServer.sol
pragma solidity 0.8.17;
import "../utils/ExtendedSelfMulticall.sol";
import "./aggregation/Median.sol";
import "./interfaces/IDataFeedServer.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract DataFeedServer is ExtendedSelfMulticall, Median, IDataFeedServer {
using ECDSA for bytes32;
struct DataFeed {
int224 value;
uint32 timestamp;
}
mapping(bytes32 => DataFeed) internal _dataFeeds;
modifier onlyValidTimestamp(uint256 timestamp) virtual {
unchecked {
require(
timestamp < block.timestamp + 1 hours,
"Timestamp not valid"
);
}
_;
}
function updateBeaconSetWithBeacons(
bytes32[] memory beaconIds
) public override returns (bytes32 beaconSetId) {
(int224 updatedValue, uint32 updatedTimestamp) = aggregateBeacons(
beaconIds
);
beaconSetId = deriveBeaconSetId(beaconIds);
DataFeed storage beaconSet = _dataFeeds[beaconSetId];
if (beaconSet.timestamp == updatedTimestamp) {
require(
beaconSet.value != updatedValue,
"Does not update Beacon set"
);
}
_dataFeeds[beaconSetId] = DataFeed({
value: updatedValue,
timestamp: updatedTimestamp
});
emit UpdatedBeaconSetWithBeacons(
beaconSetId,
updatedValue,
updatedTimestamp
);
}
function _readDataFeedWithId(
bytes32 dataFeedId
) internal view returns (int224 value, uint32 timestamp) {
DataFeed storage dataFeed = _dataFeeds[dataFeedId];
(value, timestamp) = (dataFeed.value, dataFeed.timestamp);
require(timestamp > 0, "Data feed not initialized");
}
function deriveBeaconId(
address airnode,
bytes32 templateId
) internal pure returns (bytes32 beaconId) {
beaconId = keccak256(abi.encodePacked(airnode, templateId));
}
function deriveBeaconSetId(
bytes32[] memory beaconIds
) internal pure returns (bytes32 beaconSetId) {
beaconSetId = keccak256(abi.encode(beaconIds));
}
function processBeaconUpdate(
bytes32 beaconId,
uint256 timestamp,
bytes calldata data
)
internal
onlyValidTimestamp(timestamp)
returns (int224 updatedBeaconValue)
{
updatedBeaconValue = decodeFulfillmentData(data);
require(
timestamp > _dataFeeds[beaconId].timestamp,
"Does not update timestamp"
);
_dataFeeds[beaconId] = DataFeed({
value: updatedBeaconValue,
timestamp: uint32(timestamp)
});
}
function decodeFulfillmentData(
bytes memory data
) internal pure returns (int224) {
require(data.length == 32, "Data length not correct");
int256 decodedData = abi.decode(data, (int256));
require(
decodedData >= type(int224).min && decodedData <= type(int224).max,
"Value typecasting error"
);
return int224(decodedData);
}
function aggregateBeacons(
bytes32[] memory beaconIds
) internal view returns (int224 value, uint32 timestamp) {
uint256 beaconCount = beaconIds.length;
require(beaconCount > 1, "Specified less than two Beacons");
int256[] memory values = new int256[](beaconCount);
int256[] memory timestamps = new int256[](beaconCount);
for (uint256 ind = 0; ind < beaconCount; ) {
DataFeed storage dataFeed = _dataFeeds[beaconIds[ind]];
values[ind] = dataFeed.value;
timestamps[ind] = int256(uint256(dataFeed.timestamp));
unchecked {
ind++;
}
}
value = int224(median(values));
timestamp = uint32(uint256(median(timestamps)));
}
}
文件 7 的 30:ECDSA.sol
pragma solidity ^0.8.0;
import "../Strings.sol";
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return;
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
}
}
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}
文件 8 的 30:ExtendedSelfMulticall.sol
pragma solidity ^0.8.7;
import "./SelfMulticall.sol";
import "./interfaces/IExtendedSelfMulticall.sol";
contract ExtendedSelfMulticall is SelfMulticall, IExtendedSelfMulticall {
function getChainId() external view override returns (uint256) {
return block.chainid;
}
function getBalance(
address account
) external view override returns (uint256) {
return account.balance;
}
function containsBytecode(
address account
) external view override returns (bool) {
return account.code.length > 0;
}
function getBlockNumber() external view override returns (uint256) {
return block.number;
}
function getBlockTimestamp() external view override returns (uint256) {
return block.timestamp;
}
function getBlockBasefee() external view override returns (uint256) {
return block.basefee;
}
}
文件 9 的 30:IAccessControl.sol
pragma solidity ^0.8.0;
interface IAccessControl {
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
function hasRole(bytes32 role, address account) external view returns (bool);
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
function renounceRole(bytes32 role, address account) external;
}
文件 10 的 30:IAccessControlRegistry.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/IAccessControl.sol";
import "../../utils/interfaces/ISelfMulticall.sol";
interface IAccessControlRegistry is IAccessControl, ISelfMulticall {
event InitializedManager(
bytes32 indexed rootRole,
address indexed manager,
address sender
);
event InitializedRole(
bytes32 indexed role,
bytes32 indexed adminRole,
string description,
address sender
);
function initializeManager(address manager) external;
function initializeRoleAndGrantToSender(
bytes32 adminRole,
string calldata description
) external returns (bytes32 role);
}
文件 11 的 30:IAccessControlRegistryAdminned.sol
pragma solidity ^0.8.0;
import "../../utils/interfaces/ISelfMulticall.sol";
interface IAccessControlRegistryAdminned is ISelfMulticall {
function accessControlRegistry() external view returns (address);
function adminRoleDescription() external view returns (string memory);
}
文件 12 的 30:IAccessControlRegistryAdminnedWithManager.sol
pragma solidity ^0.8.0;
import "./IAccessControlRegistryAdminned.sol";
interface IAccessControlRegistryAdminnedWithManager is
IAccessControlRegistryAdminned
{
function manager() external view returns (address);
function adminRole() external view returns (bytes32);
}
文件 13 的 30:IApi3ServerV1.sol
pragma solidity ^0.8.0;
import "./IOevDapiServer.sol";
import "./IBeaconUpdatesWithSignedData.sol";
interface IApi3ServerV1 is IOevDapiServer, IBeaconUpdatesWithSignedData {
function readDataFeedWithId(
bytes32 dataFeedId
) external view returns (int224 value, uint32 timestamp);
function readDataFeedWithDapiNameHash(
bytes32 dapiNameHash
) external view returns (int224 value, uint32 timestamp);
function readDataFeedWithIdAsOevProxy(
bytes32 dataFeedId
) external view returns (int224 value, uint32 timestamp);
function readDataFeedWithDapiNameHashAsOevProxy(
bytes32 dapiNameHash
) external view returns (int224 value, uint32 timestamp);
function dataFeeds(
bytes32 dataFeedId
) external view returns (int224 value, uint32 timestamp);
function oevProxyToIdToDataFeed(
address proxy,
bytes32 dataFeedId
) external view returns (int224 value, uint32 timestamp);
}
文件 14 的 30:IBeaconUpdatesWithSignedData.sol
pragma solidity ^0.8.0;
import "./IDataFeedServer.sol";
interface IBeaconUpdatesWithSignedData is IDataFeedServer {
function updateBeaconWithSignedData(
address airnode,
bytes32 templateId,
uint256 timestamp,
bytes calldata data,
bytes calldata signature
) external returns (bytes32 beaconId);
}
文件 15 的 30:IDapiServer.sol
pragma solidity ^0.8.0;
import "../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol";
import "./IDataFeedServer.sol";
interface IDapiServer is
IAccessControlRegistryAdminnedWithManager,
IDataFeedServer
{
event SetDapiName(
bytes32 indexed dataFeedId,
bytes32 indexed dapiName,
address sender
);
function setDapiName(bytes32 dapiName, bytes32 dataFeedId) external;
function dapiNameToDataFeedId(
bytes32 dapiName
) external view returns (bytes32);
function DAPI_NAME_SETTER_ROLE_DESCRIPTION()
external
view
returns (string memory);
function dapiNameSetterRole() external view returns (bytes32);
function dapiNameHashToDataFeedId(
bytes32 dapiNameHash
) external view returns (bytes32 dataFeedId);
}
文件 16 的 30:IDataFeedServer.sol
pragma solidity ^0.8.0;
import "../../utils/interfaces/IExtendedSelfMulticall.sol";
interface IDataFeedServer is IExtendedSelfMulticall {
event UpdatedBeaconWithSignedData(
bytes32 indexed beaconId,
int224 value,
uint32 timestamp
);
event UpdatedBeaconSetWithBeacons(
bytes32 indexed beaconSetId,
int224 value,
uint32 timestamp
);
function updateBeaconSetWithBeacons(
bytes32[] memory beaconIds
) external returns (bytes32 beaconSetId);
}
文件 17 的 30:IExtendedSelfMulticall.sol
pragma solidity ^0.8.0;
import "./ISelfMulticall.sol";
interface IExtendedSelfMulticall is ISelfMulticall {
function getChainId() external view returns (uint256);
function getBalance(address account) external view returns (uint256);
function containsBytecode(address account) external view returns (bool);
function getBlockNumber() external view returns (uint256);
function getBlockTimestamp() external view returns (uint256);
function getBlockBasefee() external view returns (uint256);
}
文件 18 的 30:IOevDapiServer.sol
pragma solidity ^0.8.0;
import "./IOevDataFeedServer.sol";
import "./IDapiServer.sol";
interface IOevDapiServer is IOevDataFeedServer, IDapiServer {}
文件 19 的 30:IOevDataFeedServer.sol
pragma solidity ^0.8.0;
import "./IDataFeedServer.sol";
interface IOevDataFeedServer is IDataFeedServer {
event UpdatedOevProxyBeaconWithSignedData(
bytes32 indexed beaconId,
address indexed proxy,
bytes32 indexed updateId,
int224 value,
uint32 timestamp
);
event UpdatedOevProxyBeaconSetWithSignedData(
bytes32 indexed beaconSetId,
address indexed proxy,
bytes32 indexed updateId,
int224 value,
uint32 timestamp
);
event Withdrew(
address indexed oevProxy,
address oevBeneficiary,
uint256 amount
);
function updateOevProxyDataFeedWithSignedData(
address oevProxy,
bytes32 dataFeedId,
bytes32 updateId,
uint256 timestamp,
bytes calldata data,
bytes[] calldata packedOevUpdateSignatures
) external payable;
function withdraw(address oevProxy) external;
function oevProxyToBalance(
address oevProxy
) external view returns (uint256 balance);
}
文件 20 的 30:IOevProxy.sol
pragma solidity ^0.8.0;
interface IOevProxy {
function oevBeneficiary() external view returns (address);
}
文件 21 的 30:ISelfMulticall.sol
pragma solidity ^0.8.0;
interface ISelfMulticall {
function multicall(
bytes[] calldata data
) external returns (bytes[] memory returndata);
function tryMulticall(
bytes[] calldata data
) external returns (bool[] memory successes, bytes[] memory returndata);
}
文件 22 的 30:Math.sol
pragma solidity ^0.8.0;
library Math {
enum Rounding {
Down,
Up,
Zero
}
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a & b) + (a ^ b) / 2;
}
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
return a == 0 ? 0 : (a - 1) / b + 1;
}
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
uint256 prod0;
uint256 prod1;
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
if (prod1 == 0) {
return prod0 / denominator;
}
require(denominator > prod1);
uint256 remainder;
assembly {
remainder := mulmod(x, y, denominator)
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
uint256 twos = denominator & (~denominator + 1);
assembly {
denominator := div(denominator, twos)
prod0 := div(prod0, twos)
twos := add(div(sub(0, twos), twos), 1)
}
prod0 |= prod1 * twos;
uint256 inverse = (3 * denominator) ^ 2;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
result = prod0 * inverse;
return result;
}
}
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 result = 1 << (log2(a) >> 1);
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}
文件 23 的 30:Median.sol
pragma solidity ^0.8.0;
import "./Sort.sol";
import "./QuickSelect.sol";
contract Median is Sort, Quickselect {
function median(int256[] memory array) internal pure returns (int256) {
uint256 arrayLength = array.length;
if (arrayLength <= MAX_SORT_LENGTH) {
sort(array);
if (arrayLength % 2 == 1) {
return array[arrayLength / 2];
} else {
assert(arrayLength != 0);
unchecked {
return
average(
array[arrayLength / 2 - 1],
array[arrayLength / 2]
);
}
}
} else {
if (arrayLength % 2 == 1) {
return array[quickselectK(array, arrayLength / 2)];
} else {
uint256 mid1;
uint256 mid2;
unchecked {
(mid1, mid2) = quickselectKPlusOne(
array,
arrayLength / 2 - 1
);
}
return average(array[mid1], array[mid2]);
}
}
}
function average(int256 x, int256 y) private pure returns (int256) {
unchecked {
int256 averageRoundedDownToNegativeInfinity = (x >> 1) +
(y >> 1) +
(x & y & 1);
return
averageRoundedDownToNegativeInfinity +
(int256(
(uint256(averageRoundedDownToNegativeInfinity) >> 255)
) & (x ^ y));
}
}
}
文件 24 的 30:OevDapiServer.sol
pragma solidity 0.8.17;
import "./OevDataFeedServer.sol";
import "./DapiServer.sol";
import "./interfaces/IOevDapiServer.sol";
contract OevDapiServer is OevDataFeedServer, DapiServer, IOevDapiServer {
constructor(
address _accessControlRegistry,
string memory _adminRoleDescription,
address _manager
) DapiServer(_accessControlRegistry, _adminRoleDescription, _manager) {}
function _readDataFeedWithDapiNameHashAsOevProxy(
bytes32 dapiNameHash
) internal view returns (int224 value, uint32 timestamp) {
bytes32 dataFeedId = dapiNameHashToDataFeedId[dapiNameHash];
require(dataFeedId != bytes32(0), "dAPI name not set");
DataFeed storage oevDataFeed = _oevProxyToIdToDataFeed[msg.sender][
dataFeedId
];
DataFeed storage dataFeed = _dataFeeds[dataFeedId];
if (oevDataFeed.timestamp > dataFeed.timestamp) {
(value, timestamp) = (oevDataFeed.value, oevDataFeed.timestamp);
} else {
(value, timestamp) = (dataFeed.value, dataFeed.timestamp);
}
require(timestamp > 0, "Data feed not initialized");
}
}
文件 25 的 30:OevDataFeedServer.sol
pragma solidity 0.8.17;
import "./DataFeedServer.sol";
import "./interfaces/IOevDataFeedServer.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./proxies/interfaces/IOevProxy.sol";
contract OevDataFeedServer is DataFeedServer, IOevDataFeedServer {
using ECDSA for bytes32;
mapping(address => mapping(bytes32 => DataFeed))
internal _oevProxyToIdToDataFeed;
mapping(address => uint256) public override oevProxyToBalance;
function updateOevProxyDataFeedWithSignedData(
address oevProxy,
bytes32 dataFeedId,
bytes32 updateId,
uint256 timestamp,
bytes calldata data,
bytes[] calldata packedOevUpdateSignatures
) external payable override onlyValidTimestamp(timestamp) {
require(
timestamp > _oevProxyToIdToDataFeed[oevProxy][dataFeedId].timestamp,
"Does not update timestamp"
);
bytes32 oevUpdateHash = keccak256(
abi.encodePacked(
block.chainid,
address(this),
oevProxy,
dataFeedId,
updateId,
timestamp,
data,
msg.sender,
msg.value
)
);
int224 updatedValue = decodeFulfillmentData(data);
uint32 updatedTimestamp = uint32(timestamp);
uint256 beaconCount = packedOevUpdateSignatures.length;
if (beaconCount > 1) {
bytes32[] memory beaconIds = new bytes32[](beaconCount);
uint256 validSignatureCount;
for (uint256 ind = 0; ind < beaconCount; ) {
bool signatureIsNotOmitted;
(
signatureIsNotOmitted,
beaconIds[ind]
) = unpackAndValidateOevUpdateSignature(
oevUpdateHash,
packedOevUpdateSignatures[ind]
);
if (signatureIsNotOmitted) {
unchecked {
validSignatureCount++;
}
}
unchecked {
ind++;
}
}
require(
validSignatureCount > beaconCount / 2,
"Not enough signatures"
);
require(
dataFeedId == deriveBeaconSetId(beaconIds),
"Beacon set ID mismatch"
);
emit UpdatedOevProxyBeaconSetWithSignedData(
dataFeedId,
oevProxy,
updateId,
updatedValue,
updatedTimestamp
);
} else if (beaconCount == 1) {
{
(
bool signatureIsNotOmitted,
bytes32 beaconId
) = unpackAndValidateOevUpdateSignature(
oevUpdateHash,
packedOevUpdateSignatures[0]
);
require(signatureIsNotOmitted, "Missing signature");
require(dataFeedId == beaconId, "Beacon ID mismatch");
}
emit UpdatedOevProxyBeaconWithSignedData(
dataFeedId,
oevProxy,
updateId,
updatedValue,
updatedTimestamp
);
} else {
revert("Did not specify any Beacons");
}
_oevProxyToIdToDataFeed[oevProxy][dataFeedId] = DataFeed({
value: updatedValue,
timestamp: updatedTimestamp
});
oevProxyToBalance[oevProxy] += msg.value;
}
function withdraw(address oevProxy) external override {
address oevBeneficiary = IOevProxy(oevProxy).oevBeneficiary();
require(oevBeneficiary != address(0), "Beneficiary address zero");
uint256 balance = oevProxyToBalance[oevProxy];
require(balance != 0, "OEV proxy balance zero");
oevProxyToBalance[oevProxy] = 0;
emit Withdrew(oevProxy, oevBeneficiary, balance);
(bool success, ) = oevBeneficiary.call{value: balance}("");
require(success, "Withdrawal reverted");
}
function _readDataFeedWithIdAsOevProxy(
bytes32 dataFeedId
) internal view returns (int224 value, uint32 timestamp) {
DataFeed storage oevDataFeed = _oevProxyToIdToDataFeed[msg.sender][
dataFeedId
];
DataFeed storage dataFeed = _dataFeeds[dataFeedId];
if (oevDataFeed.timestamp > dataFeed.timestamp) {
(value, timestamp) = (oevDataFeed.value, oevDataFeed.timestamp);
} else {
(value, timestamp) = (dataFeed.value, dataFeed.timestamp);
}
require(timestamp > 0, "Data feed not initialized");
}
function unpackAndValidateOevUpdateSignature(
bytes32 oevUpdateHash,
bytes calldata packedOevUpdateSignature
) private pure returns (bool signatureIsNotOmitted, bytes32 beaconId) {
(address airnode, bytes32 templateId, bytes memory signature) = abi
.decode(packedOevUpdateSignature, (address, bytes32, bytes));
beaconId = deriveBeaconId(airnode, templateId);
if (signature.length != 0) {
require(
(
keccak256(abi.encodePacked(oevUpdateHash, templateId))
.toEthSignedMessageHash()
).recover(signature) == airnode,
"Signature mismatch"
);
signatureIsNotOmitted = true;
}
}
}
文件 26 的 30:QuickSelect.sol
pragma solidity ^0.8.0;
contract Quickselect {
function quickselectK(
int256[] memory array,
uint256 k
) internal pure returns (uint256 indK) {
uint256 arrayLength = array.length;
assert(arrayLength > 0);
unchecked {
(indK, ) = quickselect(array, 0, arrayLength - 1, k, false);
}
}
function quickselectKPlusOne(
int256[] memory array,
uint256 k
) internal pure returns (uint256 indK, uint256 indKPlusOne) {
uint256 arrayLength = array.length;
assert(arrayLength > 1);
unchecked {
(indK, indKPlusOne) = quickselect(
array,
0,
arrayLength - 1,
k,
true
);
}
}
function quickselect(
int256[] memory array,
uint256 lo,
uint256 hi,
uint256 k,
bool selectKPlusOne
) private pure returns (uint256 indK, uint256 indKPlusOne) {
if (lo == hi) {
return (k, 0);
}
uint256 indPivot = partition(array, lo, hi);
if (k < indPivot) {
unchecked {
(indK, ) = quickselect(array, lo, indPivot - 1, k, false);
}
} else if (k > indPivot) {
unchecked {
(indK, ) = quickselect(array, indPivot + 1, hi, k, false);
}
} else {
indK = indPivot;
}
if (selectKPlusOne) {
unchecked {
indKPlusOne = indK + 1;
}
uint256 i;
unchecked {
i = indKPlusOne + 1;
}
uint256 arrayLength = array.length;
for (; i < arrayLength; ) {
if (array[i] < array[indKPlusOne]) {
indKPlusOne = i;
}
unchecked {
i++;
}
}
}
}
function partition(
int256[] memory array,
uint256 lo,
uint256 hi
) private pure returns (uint256 pivotInd) {
if (lo == hi) {
return lo;
}
int256 pivot = array[lo];
uint256 i = lo;
unchecked {
pivotInd = hi + 1;
}
while (true) {
do {
unchecked {
i++;
}
} while (i < array.length && array[i] < pivot);
do {
unchecked {
pivotInd--;
}
} while (array[pivotInd] > pivot);
if (i >= pivotInd) {
(array[lo], array[pivotInd]) = (array[pivotInd], array[lo]);
return pivotInd;
}
(array[i], array[pivotInd]) = (array[pivotInd], array[i]);
}
}
}
文件 27 的 30:RoleDeriver.sol
pragma solidity ^0.8.0;
contract RoleDeriver {
function _deriveRootRole(
address manager
) internal pure returns (bytes32 rootRole) {
rootRole = keccak256(abi.encodePacked(manager));
}
function _deriveRole(
bytes32 adminRole,
string memory description
) internal pure returns (bytes32 role) {
role = _deriveRole(adminRole, keccak256(abi.encodePacked(description)));
}
function _deriveRole(
bytes32 adminRole,
bytes32 descriptionHash
) internal pure returns (bytes32 role) {
role = keccak256(abi.encodePacked(adminRole, descriptionHash));
}
}
文件 28 的 30:SelfMulticall.sol
pragma solidity ^0.8.0;
import "./interfaces/ISelfMulticall.sol";
contract SelfMulticall is ISelfMulticall {
function multicall(
bytes[] calldata data
) external override returns (bytes[] memory returndata) {
uint256 callCount = data.length;
returndata = new bytes[](callCount);
for (uint256 ind = 0; ind < callCount; ) {
bool success;
(success, returndata[ind]) = address(this).delegatecall(data[ind]);
if (!success) {
bytes memory returndataWithRevertData = returndata[ind];
if (returndataWithRevertData.length > 0) {
assembly {
let returndata_size := mload(returndataWithRevertData)
revert(
add(32, returndataWithRevertData),
returndata_size
)
}
} else {
revert("Multicall: No revert string");
}
}
unchecked {
ind++;
}
}
}
function tryMulticall(
bytes[] calldata data
)
external
override
returns (bool[] memory successes, bytes[] memory returndata)
{
uint256 callCount = data.length;
successes = new bool[](callCount);
returndata = new bytes[](callCount);
for (uint256 ind = 0; ind < callCount; ) {
(successes[ind], returndata[ind]) = address(this).delegatecall(
data[ind]
);
unchecked {
ind++;
}
}
}
}
文件 29 的 30:Sort.sol
pragma solidity ^0.8.0;
contract Sort {
uint256 internal constant MAX_SORT_LENGTH = 9;
function sort(int256[] memory array) internal pure {
uint256 arrayLength = array.length;
require(arrayLength <= MAX_SORT_LENGTH, "Array too long to sort");
if (arrayLength < 6) {
if (arrayLength < 4) {
if (arrayLength == 3) {
swapIfFirstIsLarger(array, 0, 1);
swapIfFirstIsLarger(array, 1, 2);
swapIfFirstIsLarger(array, 0, 1);
} else if (arrayLength == 2) {
swapIfFirstIsLarger(array, 0, 1);
}
} else {
if (arrayLength == 5) {
swapIfFirstIsLarger(array, 1, 2);
swapIfFirstIsLarger(array, 3, 4);
swapIfFirstIsLarger(array, 1, 3);
swapIfFirstIsLarger(array, 0, 2);
swapIfFirstIsLarger(array, 2, 4);
swapIfFirstIsLarger(array, 0, 3);
swapIfFirstIsLarger(array, 0, 1);
swapIfFirstIsLarger(array, 2, 3);
swapIfFirstIsLarger(array, 1, 2);
} else {
swapIfFirstIsLarger(array, 0, 1);
swapIfFirstIsLarger(array, 2, 3);
swapIfFirstIsLarger(array, 1, 3);
swapIfFirstIsLarger(array, 0, 2);
swapIfFirstIsLarger(array, 1, 2);
}
}
} else {
if (arrayLength < 8) {
if (arrayLength == 7) {
swapIfFirstIsLarger(array, 1, 2);
swapIfFirstIsLarger(array, 3, 4);
swapIfFirstIsLarger(array, 5, 6);
swapIfFirstIsLarger(array, 0, 2);
swapIfFirstIsLarger(array, 4, 6);
swapIfFirstIsLarger(array, 3, 5);
swapIfFirstIsLarger(array, 2, 6);
swapIfFirstIsLarger(array, 1, 5);
swapIfFirstIsLarger(array, 0, 4);
swapIfFirstIsLarger(array, 2, 5);
swapIfFirstIsLarger(array, 0, 3);
swapIfFirstIsLarger(array, 2, 4);
swapIfFirstIsLarger(array, 1, 3);
swapIfFirstIsLarger(array, 0, 1);
swapIfFirstIsLarger(array, 2, 3);
swapIfFirstIsLarger(array, 4, 5);
} else {
swapIfFirstIsLarger(array, 0, 1);
swapIfFirstIsLarger(array, 2, 3);
swapIfFirstIsLarger(array, 4, 5);
swapIfFirstIsLarger(array, 1, 3);
swapIfFirstIsLarger(array, 3, 5);
swapIfFirstIsLarger(array, 1, 3);
swapIfFirstIsLarger(array, 2, 4);
swapIfFirstIsLarger(array, 0, 2);
swapIfFirstIsLarger(array, 2, 4);
swapIfFirstIsLarger(array, 3, 4);
swapIfFirstIsLarger(array, 1, 2);
swapIfFirstIsLarger(array, 2, 3);
}
} else {
if (arrayLength == 9) {
swapIfFirstIsLarger(array, 1, 8);
swapIfFirstIsLarger(array, 2, 7);
swapIfFirstIsLarger(array, 3, 6);
swapIfFirstIsLarger(array, 4, 5);
swapIfFirstIsLarger(array, 1, 4);
swapIfFirstIsLarger(array, 5, 8);
swapIfFirstIsLarger(array, 0, 2);
swapIfFirstIsLarger(array, 6, 7);
swapIfFirstIsLarger(array, 2, 6);
swapIfFirstIsLarger(array, 7, 8);
swapIfFirstIsLarger(array, 0, 3);
swapIfFirstIsLarger(array, 4, 5);
swapIfFirstIsLarger(array, 0, 1);
swapIfFirstIsLarger(array, 3, 5);
swapIfFirstIsLarger(array, 6, 7);
swapIfFirstIsLarger(array, 2, 4);
swapIfFirstIsLarger(array, 1, 3);
swapIfFirstIsLarger(array, 5, 7);
swapIfFirstIsLarger(array, 4, 6);
swapIfFirstIsLarger(array, 1, 2);
swapIfFirstIsLarger(array, 3, 4);
swapIfFirstIsLarger(array, 5, 6);
swapIfFirstIsLarger(array, 7, 8);
swapIfFirstIsLarger(array, 2, 3);
swapIfFirstIsLarger(array, 4, 5);
} else {
swapIfFirstIsLarger(array, 0, 7);
swapIfFirstIsLarger(array, 1, 6);
swapIfFirstIsLarger(array, 2, 5);
swapIfFirstIsLarger(array, 3, 4);
swapIfFirstIsLarger(array, 0, 3);
swapIfFirstIsLarger(array, 4, 7);
swapIfFirstIsLarger(array, 1, 2);
swapIfFirstIsLarger(array, 5, 6);
swapIfFirstIsLarger(array, 0, 1);
swapIfFirstIsLarger(array, 2, 3);
swapIfFirstIsLarger(array, 4, 5);
swapIfFirstIsLarger(array, 6, 7);
swapIfFirstIsLarger(array, 3, 5);
swapIfFirstIsLarger(array, 2, 4);
swapIfFirstIsLarger(array, 1, 2);
swapIfFirstIsLarger(array, 3, 4);
swapIfFirstIsLarger(array, 5, 6);
swapIfFirstIsLarger(array, 2, 3);
swapIfFirstIsLarger(array, 4, 5);
swapIfFirstIsLarger(array, 3, 4);
}
}
}
}
function swapIfFirstIsLarger(
int256[] memory array,
uint256 ind1,
uint256 ind2
) private pure {
if (array[ind1] > array[ind2]) {
(array[ind1], array[ind2]) = (array[ind2], array[ind1]);
}
}
}
文件 30 的 30:Strings.sol
pragma solidity ^0.8.0;
import "./math/Math.sol";
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
{
"compilationTarget": {
"contracts/api3-server-v1/Api3ServerV1.sol": "Api3ServerV1"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 1000
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"_accessControlRegistry","type":"address"},{"internalType":"string","name":"_adminRoleDescription","type":"string"},{"internalType":"address","name":"_manager","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"dataFeedId","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"dapiName","type":"bytes32"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"SetDapiName","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"beaconSetId","type":"bytes32"},{"indexed":false,"internalType":"int224","name":"value","type":"int224"},{"indexed":false,"internalType":"uint32","name":"timestamp","type":"uint32"}],"name":"UpdatedBeaconSetWithBeacons","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"beaconId","type":"bytes32"},{"indexed":false,"internalType":"int224","name":"value","type":"int224"},{"indexed":false,"internalType":"uint32","name":"timestamp","type":"uint32"}],"name":"UpdatedBeaconWithSignedData","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"beaconSetId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"proxy","type":"address"},{"indexed":true,"internalType":"bytes32","name":"updateId","type":"bytes32"},{"indexed":false,"internalType":"int224","name":"value","type":"int224"},{"indexed":false,"internalType":"uint32","name":"timestamp","type":"uint32"}],"name":"UpdatedOevProxyBeaconSetWithSignedData","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"beaconId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"proxy","type":"address"},{"indexed":true,"internalType":"bytes32","name":"updateId","type":"bytes32"},{"indexed":false,"internalType":"int224","name":"value","type":"int224"},{"indexed":false,"internalType":"uint32","name":"timestamp","type":"uint32"}],"name":"UpdatedOevProxyBeaconWithSignedData","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oevProxy","type":"address"},{"indexed":false,"internalType":"address","name":"oevBeneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrew","type":"event"},{"inputs":[],"name":"DAPI_NAME_SETTER_ROLE_DESCRIPTION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accessControlRegistry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminRole","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminRoleDescription","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"containsBytecode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"dapiNameHashToDataFeedId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dapiNameSetterRole","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dapiName","type":"bytes32"}],"name":"dapiNameToDataFeedId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dataFeedId","type":"bytes32"}],"name":"dataFeeds","outputs":[{"internalType":"int224","name":"value","type":"int224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBlockBasefee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBlockTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"returndata","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"oevProxyToBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"proxy","type":"address"},{"internalType":"bytes32","name":"dataFeedId","type":"bytes32"}],"name":"oevProxyToIdToDataFeed","outputs":[{"internalType":"int224","name":"value","type":"int224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dapiNameHash","type":"bytes32"}],"name":"readDataFeedWithDapiNameHash","outputs":[{"internalType":"int224","name":"value","type":"int224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dapiNameHash","type":"bytes32"}],"name":"readDataFeedWithDapiNameHashAsOevProxy","outputs":[{"internalType":"int224","name":"value","type":"int224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dataFeedId","type":"bytes32"}],"name":"readDataFeedWithId","outputs":[{"internalType":"int224","name":"value","type":"int224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dataFeedId","type":"bytes32"}],"name":"readDataFeedWithIdAsOevProxy","outputs":[{"internalType":"int224","name":"value","type":"int224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dapiName","type":"bytes32"},{"internalType":"bytes32","name":"dataFeedId","type":"bytes32"}],"name":"setDapiName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"tryMulticall","outputs":[{"internalType":"bool[]","name":"successes","type":"bool[]"},{"internalType":"bytes[]","name":"returndata","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"beaconIds","type":"bytes32[]"}],"name":"updateBeaconSetWithBeacons","outputs":[{"internalType":"bytes32","name":"beaconSetId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"airnode","type":"address"},{"internalType":"bytes32","name":"templateId","type":"bytes32"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"updateBeaconWithSignedData","outputs":[{"internalType":"bytes32","name":"beaconId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"oevProxy","type":"address"},{"internalType":"bytes32","name":"dataFeedId","type":"bytes32"},{"internalType":"bytes32","name":"updateId","type":"bytes32"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes[]","name":"packedOevUpdateSignatures","type":"bytes[]"}],"name":"updateOevProxyDataFeedWithSignedData","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"oevProxy","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]