Source Code
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 5316488 | 602 days ago | Contract Creation | 0 FRAX |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
DapiProxyWithOev
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity)
/**
*Submitted for verification at fraxscan.com on 2024-06-05
*/
// Sources flattened with hardhat v2.22.2 https://hardhat.org
// SPDX-License-Identifier: MIT
// File contracts/utils/interfaces/ISelfMulticall.sol
// Original license: SPDX_License_Identifier: MIT
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);
}
// File contracts/access/interfaces/IAccessControlRegistryAdminned.sol
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
interface IAccessControlRegistryAdminned is ISelfMulticall {
function accessControlRegistry() external view returns (address);
function adminRoleDescription() external view returns (string memory);
}
// File contracts/access/interfaces/IAccessControlRegistryAdminnedWithManager.sol
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
interface IAccessControlRegistryAdminnedWithManager is
IAccessControlRegistryAdminned
{
function manager() external view returns (address);
function adminRole() external view returns (bytes32);
}
// File contracts/utils/interfaces/IExtendedSelfMulticall.sol
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
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);
}
// File contracts/api3-server-v1/interfaces/IDataFeedServer.sol
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
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);
}
// File contracts/api3-server-v1/interfaces/IBeaconUpdatesWithSignedData.sol
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
interface IBeaconUpdatesWithSignedData is IDataFeedServer {
function updateBeaconWithSignedData(
address airnode,
bytes32 templateId,
uint256 timestamp,
bytes calldata data,
bytes calldata signature
) external returns (bytes32 beaconId);
}
// File contracts/api3-server-v1/interfaces/IDapiServer.sol
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
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);
// solhint-disable-next-line func-name-mixedcase
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);
}
// File contracts/api3-server-v1/interfaces/IOevDataFeedServer.sol
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
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);
}
// File contracts/api3-server-v1/interfaces/IOevDapiServer.sol
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
interface IOevDapiServer is IOevDataFeedServer, IDapiServer {}
// File contracts/api3-server-v1/interfaces/IApi3ServerV1.sol
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
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);
}
// File contracts/api3-server-v1/proxies/interfaces/IProxy.sol
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
/// @dev See DapiProxy.sol for comments about usage
interface IProxy {
function read() external view returns (int224 value, uint32 timestamp);
function api3ServerV1() external view returns (address);
}
// File contracts/api3-server-v1/proxies/interfaces/IDapiProxy.sol
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
interface IDapiProxy is IProxy {
function dapiNameHash() external view returns (bytes32);
}
// File contracts/api3-server-v1/proxies/DapiProxy.sol
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
/// @title An immutable proxy contract that is used to read a specific dAPI of
/// a specific Api3ServerV1 contract
/// @notice In an effort to reduce the bytecode of this contract, its
/// constructor arguments are validated by ProxyFactory, rather than
/// internally. If you intend to deploy this contract without using
/// ProxyFactory, you are recommended to implement an equivalent validation.
/// @dev The proxy contracts are generalized to support most types of numerical
/// data feeds. This means that the user of this proxy is expected to validate
/// the read values according to the specific use-case. For example, `value` is
/// a signed integer, yet it being negative may not make sense in the case that
/// the data feed represents the spot price of an asset. In that case, the user
/// is responsible with ensuring that `value` is not negative.
/// In the case that the data feed is from a single source, `timestamp` is the
/// system time of the Airnode when it signed the data. In the case that the
/// data feed is from multiple sources, `timestamp` is the median of system
/// times of the Airnodes when they signed the respective data. There are two
/// points to consider while using `timestamp` in your contract logic: (1) It
/// is based on the system time of the Airnodes, and not the block timestamp.
/// This may be relevant when either of them drifts. (2) `timestamp` is an
/// off-chain value that is being reported, similar to `value`. Both should
/// only be trusted as much as the Airnode(s) that report them.
contract DapiProxy is IDapiProxy {
/// @notice Api3ServerV1 address
address public immutable override api3ServerV1;
/// @notice Hash of the dAPI name
bytes32 public immutable override dapiNameHash;
/// @param _api3ServerV1 Api3ServerV1 address
/// @param _dapiNameHash Hash of the dAPI name
constructor(address _api3ServerV1, bytes32 _dapiNameHash) {
api3ServerV1 = _api3ServerV1;
dapiNameHash = _dapiNameHash;
}
/// @notice Reads the dAPI that this proxy maps to
/// @return value dAPI value
/// @return timestamp dAPI timestamp
function read()
external
view
virtual
override
returns (int224 value, uint32 timestamp)
{
(value, timestamp) = IApi3ServerV1(api3ServerV1)
.readDataFeedWithDapiNameHash(dapiNameHash);
}
}
// File contracts/api3-server-v1/proxies/interfaces/IOevProxy.sol
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
interface IOevProxy {
function oevBeneficiary() external view returns (address);
}
// File contracts/api3-server-v1/proxies/DapiProxyWithOev.sol
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
/// @title An immutable proxy contract that is used to read a specific dAPI of
/// a specific Api3ServerV1 contract and inform Api3ServerV1 about the
/// beneficiary of the respective OEV proceeds
/// @notice In an effort to reduce the bytecode of this contract, its
/// constructor arguments are validated by ProxyFactory, rather than
/// internally. If you intend to deploy this contract without using
/// ProxyFactory, you are recommended to implement an equivalent validation.
/// @dev See DapiProxy.sol for comments about usage
contract DapiProxyWithOev is DapiProxy, IOevProxy {
/// @notice OEV beneficiary address
address public immutable override oevBeneficiary;
/// @param _api3ServerV1 Api3ServerV1 address
/// @param _dapiNameHash Hash of the dAPI name
/// @param _oevBeneficiary OEV beneficiary
constructor(
address _api3ServerV1,
bytes32 _dapiNameHash,
address _oevBeneficiary
) DapiProxy(_api3ServerV1, _dapiNameHash) {
oevBeneficiary = _oevBeneficiary;
}
/// @notice Reads the dAPI that this proxy maps to
/// @return value dAPI value
/// @return timestamp dAPI timestamp
function read()
external
view
virtual
override
returns (int224 value, uint32 timestamp)
{
(value, timestamp) = IApi3ServerV1(api3ServerV1)
.readDataFeedWithDapiNameHashAsOevProxy(dapiNameHash);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_api3ServerV1","type":"address"},{"internalType":"bytes32","name":"_dapiNameHash","type":"bytes32"},{"internalType":"address","name":"_oevBeneficiary","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"api3ServerV1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dapiNameHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oevBeneficiary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"read","outputs":[{"internalType":"int224","name":"value","type":"int224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60e060405234801561001057600080fd5b5060405161035d38038061035d83398101604081905261002f91610068565b6001600160a01b0392831660805260a0919091521660c0526100a4565b80516001600160a01b038116811461006357600080fd5b919050565b60008060006060848603121561007d57600080fd5b6100868461004c565b92506020840151915061009b6040850161004c565b90509250925092565b60805160a05160c05161027f6100de6000396000605601526000818160f5015261014d01526000818160a7015261018d015261027f6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630e15999d146100515780632d6a744e146100a257806357de26a4146100c9578063dcf8da92146100f0575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6100d1610125565b60408051601b9390930b835263ffffffff909116602083015201610099565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610099565b6040517f32be8f0b0000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906332be8f0b906024016040805180830381865afa1580156101d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f79190610200565b90939092509050565b6000806040838503121561021357600080fd5b825180601b0b811461022457600080fd5b602084015190925063ffffffff8116811461023e57600080fd5b80915050925092905056fea2646970667358221220165f090121acbfb6f16face0e037df12b601e08d2e0fd3fd3f5e021e053308ce64736f6c63430008110033000000000000000000000000709944a48caf83535e43471680fda4905fb3920a3a2e6bd5fde1dc2d933b41ba2383af82a4c2c314548446a924f97655f5ec968400000000000000000000000014a9e40fcada95a273ce3c8d4ccf7ea3280bdd26
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80630e15999d146100515780632d6a744e146100a257806357de26a4146100c9578063dcf8da92146100f0575b600080fd5b6100787f00000000000000000000000014a9e40fcada95a273ce3c8d4ccf7ea3280bdd2681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100787f000000000000000000000000709944a48caf83535e43471680fda4905fb3920a81565b6100d1610125565b60408051601b9390930b835263ffffffff909116602083015201610099565b6101177f3a2e6bd5fde1dc2d933b41ba2383af82a4c2c314548446a924f97655f5ec968481565b604051908152602001610099565b6040517f32be8f0b0000000000000000000000000000000000000000000000000000000081527f3a2e6bd5fde1dc2d933b41ba2383af82a4c2c314548446a924f97655f5ec96846004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000709944a48caf83535e43471680fda4905fb3920a16906332be8f0b906024016040805180830381865afa1580156101d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f79190610200565b90939092509050565b6000806040838503121561021357600080fd5b825180601b0b811461022457600080fd5b602084015190925063ffffffff8116811461023e57600080fd5b80915050925092905056fea2646970667358221220165f090121acbfb6f16face0e037df12b601e08d2e0fd3fd3f5e021e053308ce64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000709944a48caf83535e43471680fda4905fb3920a3a2e6bd5fde1dc2d933b41ba2383af82a4c2c314548446a924f97655f5ec968400000000000000000000000014a9e40fcada95a273ce3c8d4ccf7ea3280bdd26
-----Decoded View---------------
Arg [0] : _api3ServerV1 (address): 0x709944a48cAf83535e43471680fDA4905FB3920a
Arg [1] : _dapiNameHash (bytes32): 0x3a2e6bd5fde1dc2d933b41ba2383af82a4c2c314548446a924f97655f5ec9684
Arg [2] : _oevBeneficiary (address): 0x14A9E40FcAdA95A273ce3c8d4ccF7EA3280BDd26
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000709944a48caf83535e43471680fda4905fb3920a
Arg [1] : 3a2e6bd5fde1dc2d933b41ba2383af82a4c2c314548446a924f97655f5ec9684
Arg [2] : 00000000000000000000000014a9e40fcada95a273ce3c8d4ccf7ea3280bdd26
Deployed Bytecode Sourcemap
10454:929:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10552:48;;;;;;;;190:42:1;178:55;;;160:74;;148:2;133:18;10552:48:0;;;;;;;;8722:46;;;;;11108:272;;;:::i;:::-;;;;444:2:1;433:22;;;;415:41;;504:10;492:23;;;487:2;472:18;;465:51;388:18;11108:272:0;245:277:1;8814:46:0;;;;;;;;673:25:1;;;661:2;646:18;8814:46:0;527:177:1;11108:272:0;11278:94;;;;;11359:12;11278:94;;;673:25:1;11209:12:0;;;;11278:80;11292:12;11278:80;;;;646:18:1;;11278:94:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;11257:115;;;;-1:-1:-1;11108:272:0;-1:-1:-1;11108:272:0:o;709:444:1:-;786:6;794;847:2;835:9;826:7;822:23;818:32;815:52;;;863:1;860;853:12;815:52;895:9;889:16;949:5;945:2;934:21;927:5;924:32;914:60;;970:1;967;960:12;914:60;1043:2;1028:18;;1022:25;993:5;;-1:-1:-1;1091:10:1;1078:24;;1066:37;;1056:65;;1117:1;1114;1107:12;1056:65;1140:7;1130:17;;;709:444;;;;;:::o
Swarm Source
ipfs://165f090121acbfb6f16face0e037df12b601e08d2e0fd3fd3f5e021e053308ce
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in FRAX
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.