-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Liquidator contract Add pure liquidation function for simulating profit, refactor Convenience contract updates OEV bot Fix beacon-related issues Fix profit calculation Report fulfillment Cleanup on failed liquidation attempts Add bidding phase buffer and use placeBidWithExpiration Fix incorrect profit calculation Reduce diff Update API3 contracts Update Liquidator contract and related Code review update Update Api3ServerV1OevExtension address Updated Compound fork deployed
- Loading branch information
Showing
19 changed files
with
868 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
contracts/api3-contracts/access/interfaces/IAccessControlRegistryAdminned.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// SPDX-License-Identifier: MIT | ||
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 changes: 12 additions & 0 deletions
12
contracts/api3-contracts/access/interfaces/IAccessControlRegistryAdminnedWithManager.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import "./IAccessControlRegistryAdminned.sol"; | ||
|
||
interface IAccessControlRegistryAdminnedWithManager is | ||
IAccessControlRegistryAdminned | ||
{ | ||
function manager() external view returns (address); | ||
|
||
function adminRole() external view returns (bytes32); | ||
} |
92 changes: 92 additions & 0 deletions
92
contracts/api3-contracts/api3-server-v1/interfaces/IApi3ServerV1OevExtension.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import "../../access/interfaces/IAccessControlRegistryAdminnedWithManager.sol"; | ||
import "../interfaces/IDataFeedServer.sol"; | ||
|
||
interface IApi3ServerV1OevExtension is | ||
IAccessControlRegistryAdminnedWithManager, | ||
IDataFeedServer | ||
{ | ||
event Withdrew(address recipient, uint256 amount, address sender); | ||
|
||
event PaidOevBid( | ||
uint256 indexed dappId, | ||
address indexed updater, | ||
uint256 bidAmount, | ||
uint256 signedDataTimestampCutoff, | ||
address auctioneer | ||
); | ||
|
||
event UpdatedDappOevDataFeed( | ||
uint256 indexed dappId, | ||
address indexed updater, | ||
bytes32 dataFeedId, | ||
int224 updatedValue, | ||
uint32 updatedTimestamp | ||
); | ||
|
||
function withdraw(address recipient, uint256 amount) external; | ||
|
||
function payOevBid( | ||
uint256 dappId, | ||
uint32 signedDataTimestampCutoff, | ||
bytes calldata signature, | ||
uint256 bidAmount, | ||
bytes calldata data | ||
) external; | ||
|
||
function updateDappOevDataFeed( | ||
uint256 dappId, | ||
bytes[] calldata signedData | ||
) | ||
external | ||
returns ( | ||
bytes32 baseDataFeedId, | ||
int224 updatedValue, | ||
uint32 updatedTimestamp | ||
); | ||
|
||
function simulateDappOevDataFeedUpdate( | ||
uint256 dappId, | ||
bytes[] calldata signedData | ||
) | ||
external | ||
returns ( | ||
bytes32 baseDataFeedId, | ||
int224 updatedValue, | ||
uint32 updatedTimestamp | ||
); | ||
|
||
function simulateExternalCall( | ||
address target, | ||
bytes calldata data | ||
) external returns (bytes memory); | ||
|
||
function oevDataFeed( | ||
uint256 dappId, | ||
bytes32 dataFeedId | ||
) external view returns (int224 value, uint32 timestamp); | ||
|
||
// solhint-disable-next-line func-name-mixedcase | ||
function WITHDRAWER_ROLE_DESCRIPTION() | ||
external | ||
view | ||
returns (string memory); | ||
|
||
// solhint-disable-next-line func-name-mixedcase | ||
function AUCTIONEER_ROLE_DESCRIPTION() | ||
external | ||
view | ||
returns (string memory); | ||
|
||
function withdrawerRole() external view returns (bytes32); | ||
|
||
function auctioneerRole() external view returns (bytes32); | ||
|
||
function api3ServerV1() external view returns (address); | ||
|
||
function dappIdToLastPaidBid( | ||
uint256 dappId | ||
) external view returns (address updater, uint32 endTimestamp); | ||
} |
16 changes: 16 additions & 0 deletions
16
...s/api3-contracts/api3-server-v1/interfaces/IApi3ServerV1OevExtensionPayOevBidCallback.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
/// @title Callback for IApi3ServerV1OevExtension#payOevBid | ||
/// @notice Any contract that calls IApi3ServerV1OevExtension#payOevBid must implement this interface | ||
interface IApi3ServerV1OevExtensionPayOevBidCallback { | ||
/// @notice Called to `msg.sender` after granting the privilege to execute updates for the dApp from IApi3ServerV1OevExtension#payOevBid. | ||
/// @dev In the implementation you must repay the server the tokens owed for the payment of the OEV bid. | ||
/// The implementation is responsible to check that the caller of this method is the correct Api3ServerV1OevExtension. | ||
/// @param amountOwed The amount of tokens owed to the server for the payment of the OEV bid | ||
/// @param data Any data passed through by the caller via the IApi3ServerV1OevExtension#payOevBid call | ||
function api3ServerV1OevExtensionPayOevBidCallback( | ||
uint256 amountOwed, | ||
bytes calldata data | ||
) external; | ||
} |
22 changes: 22 additions & 0 deletions
22
contracts/api3-contracts/api3-server-v1/interfaces/IDataFeedServer.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: MIT | ||
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); | ||
} |
Oops, something went wrong.