-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Full fuzz-invariant-integration testing for an open position
- Loading branch information
Showing
7 changed files
with
484 additions
and
18 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,23 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
import { WConvexBooster } from "@contracts/wrapper/WConvexBooster.sol"; | ||
|
||
pragma solidity 0.8.22; | ||
|
||
contract WConvexBoosterMock is WConvexBooster { | ||
function cvxPerShareByPid(uint256 pid) public returns (uint256) { | ||
return _cvxPerShareByPid[pid]; | ||
} | ||
|
||
function cvxPerShareDebt(uint256 pid) public returns (uint256) { | ||
return _cvxPerShareDebt[pid]; | ||
} | ||
|
||
function lastCrvPerTokenByPid(uint256 pid) public returns (uint256) { | ||
return _lastCrvPerTokenByPid[pid]; | ||
} | ||
|
||
function getCvxPendingReward(uint256 amount) public returns (uint256) { | ||
return _getCvxPendingReward(amount); | ||
} | ||
} |
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,68 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.8.22; | ||
|
||
import { IBaseOracle } from "@contracts/interfaces/IBaseOracle.sol"; | ||
|
||
/** | ||
* @title IExtCoreOracle | ||
* @notice Interface for the CoreOracle contract which provides price feed data for assets in the Blueberry protocol. | ||
*/ | ||
interface IExtCoreOracle is IBaseOracle { | ||
/*////////////////////////////////////////////////////////////////////////// | ||
EVENTS | ||
//////////////////////////////////////////////////////////////////////////*/ | ||
|
||
/** | ||
* @notice Event emitted when the owner sets a new oracle route for a given token. | ||
* @param token The ERC20 token for which the oracle route is set. | ||
* @param route The address of the oracle route. | ||
*/ | ||
event SetRoute(address indexed token, address route); | ||
|
||
/*////////////////////////////////////////////////////////////////////////// | ||
FUNCTIONS | ||
//////////////////////////////////////////////////////////////////////////*/ | ||
|
||
/** | ||
* @notice Check if the given ERC20 token is supported by the oracle. | ||
* @param token The ERC20 token to check support for. | ||
* @return A boolean indicating whether the token is supported or not. | ||
*/ | ||
function isTokenSupported(address token) external view returns (bool); | ||
|
||
/** | ||
* @notice Check if the oracle supports the underlying token of a given ERC1155 wrapper. | ||
* @dev Only meant to validate wrappers of the Blueberry protocol, such as WERC20. | ||
* @param token ERC1155 token address to check support for. | ||
* @param tokenId ERC1155 token id to check support for. | ||
* @return A boolean indicating whether the wrapped token is supported or not. | ||
*/ | ||
function isWrappedTokenSupported(address token, uint256 tokenId) external view returns (bool); | ||
|
||
/** | ||
* @notice Returns the USD value of a specific wrapped ERC1155 token. | ||
* @param token ERC1155 token address. | ||
* @param id ERC1155 token id. | ||
* @param amount Amount of the token for which to get the USD value, normalized to 1e18 decimals. | ||
* @return The USD value of the given wrapped token amount. | ||
*/ | ||
function getWrappedTokenValue(address token, uint256 id, uint256 amount) external view returns (uint256); | ||
|
||
/** | ||
* @notice Returns the USD value of a given amount of a specific ERC20 token. | ||
* @param token ERC20 token address. | ||
* @param amount Amount of the ERC20 token for which to get the USD value. | ||
* @return The USD value of the given token amount. | ||
*/ | ||
function getTokenValue(address token, uint256 amount) external view returns (uint256); | ||
|
||
/** | ||
* @notice Fetches the oracle route for the given token. | ||
* @param token Address of the token to get the route for. | ||
* @return The address of the oracle route for the given token. | ||
*/ | ||
function getRoute(address token) external view returns (address); | ||
|
||
function setRoutes(address[] calldata tokens, address[] calldata oracleRoutes) external; | ||
} |
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,27 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.22; | ||
|
||
interface IStakingRewards { | ||
// Views | ||
function lastTimeRewardApplicable() external view returns (uint256); | ||
|
||
function rewardPerToken() external view returns (uint256); | ||
|
||
function earned(address account) external view returns (uint256); | ||
|
||
function getRewardForDuration() external view returns (uint256); | ||
|
||
function totalSupply() external view returns (uint256); | ||
|
||
function balanceOf(address account) external view returns (uint256); | ||
|
||
// Mutative | ||
|
||
function stake(uint256 amount) external; | ||
|
||
function withdraw(uint256 amount) external; | ||
|
||
function getReward() external; | ||
|
||
function exit() external; | ||
} |