-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed the stack-too-deep issue * Implemented a data provider contract * Fixed most of the tests * Fixed the remaining tests * Configured the workflows to use repository secrets for RPC URLs * Updated the Python test * Update contracts/src/instances/AaveHyperdriveDataProvider.sol Co-authored-by: Jonny Rhea <[email protected]> * Addressed review feedback from @jhrea --------- Co-authored-by: Jonny Rhea <[email protected]>
- Loading branch information
1 parent
9e960c5
commit 0bf7a64
Showing
57 changed files
with
1,323 additions
and
1,075 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# ethereum rpc endpoints used in fork tests and migration scripts | ||
GOERLI_RPC_URL= | ||
MAINNET_RPC_URL= | ||
|
||
# private key used for running migration scripts | ||
PRIVATE_KEY= |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.18; | ||
|
||
import { Errors } from "./libraries/Errors.sol"; | ||
|
||
/// @author DELV | ||
/// @title DataProvider | ||
/// @notice Implements a fallback function that serves as a generalized getter. | ||
/// This helps contracts stay under the code size limit. | ||
/// @custom:disclaimer The language used in this code is for coding convenience | ||
/// only, and is not intended to, and does not, have any | ||
/// particular legal or regulatory significance. | ||
contract DataProvider { | ||
address internal immutable dataProvider; | ||
|
||
/// @notice Initializes the data provider. | ||
/// @param _dataProvider The address of the data provider. | ||
constructor(address _dataProvider) { | ||
dataProvider = _dataProvider; | ||
} | ||
|
||
/// @notice Fallback function that delegates calls to the data provider. | ||
/// @param _data The data to be passed to the data provider. | ||
/// @return The return data from the data provider. | ||
fallback(bytes calldata _data) external returns (bytes memory) { | ||
// Delegatecall into the data provider. We use a force-revert | ||
// delegatecall pattern to ensure that no state changes were made | ||
// during the call to the data provider. | ||
(bool success, bytes memory returndata) = dataProvider.delegatecall( | ||
_data | ||
); | ||
if (success) { | ||
revert Errors.UnexpectedSuccess(); | ||
} | ||
return returndata; | ||
} | ||
} |
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
Oops, something went wrong.