Skip to content

Commit

Permalink
fix: formatting (#78)
Browse files Browse the repository at this point in the history
* fix: naming

* fix: pack struct (#81)

* fix: pack struct further

* fix: format

* chore: dont use modifier require

* chore: organize

* chore: remove is functions

* chore: add chain id to symbol

* chore: organize

* fix: revert symbol change

* chore: fix symbol bakc
  • Loading branch information
Schlagonia authored Feb 1, 2024
1 parent d1fb237 commit a3ace32
Show file tree
Hide file tree
Showing 8 changed files with 222 additions and 166 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"solidity.compileUsingRemoteVersion": "v0.8.18",
"solidity.remappings": [
"@openzeppelin/=./lib/openzeppelin-contracts/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"forge-std/=lib/forge-std/src/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/erc4626-tests/"
Expand Down
30 changes: 15 additions & 15 deletions src/BaseStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ abstract contract BaseStrategy {
* @dev Use to assure that the call is coming from the strategies management.
*/
modifier onlyManagement() {
TokenizedStrategy.isManagement(msg.sender);
TokenizedStrategy.requireManagement(msg.sender);
_;
}

Expand All @@ -61,7 +61,7 @@ abstract contract BaseStrategy {
* management or the keeper.
*/
modifier onlyKeepers() {
TokenizedStrategy.isKeeperOrManagement(msg.sender);
TokenizedStrategy.requireKeeperOrManagement(msg.sender);
_;
}

Expand All @@ -70,7 +70,7 @@ abstract contract BaseStrategy {
* management or the emergency admin.
*/
modifier onlyEmergencyAuthorized() {
TokenizedStrategy.isEmergencyAuthorized(msg.sender);
TokenizedStrategy.requireEmergencyAuthorized(msg.sender);
_;
}

Expand Down Expand Up @@ -105,6 +105,12 @@ abstract contract BaseStrategy {
IMMUTABLES
//////////////////////////////////////////////////////////////*/

/**
* @dev Underlying asset the Strategy is earning yield on.
* Stored here for cheap retrievals within the strategy.
*/
ERC20 internal immutable asset;

/**
* @dev This variable is set to address(this) during initialization of each strategy.
*
Expand All @@ -119,12 +125,6 @@ abstract contract BaseStrategy {
*/
ITokenizedStrategy internal immutable TokenizedStrategy;

/**
* @dev Underlying asset the Strategy is earning yield on.
* Stored here for cheap retrievals within the strategy.
*/
ERC20 internal immutable asset;

/**
* @notice Used to initialize the strategy on deployment.
*
Expand All @@ -145,7 +145,7 @@ abstract contract BaseStrategy {
// Initialize the strategy's storage variables.
_delegateCall(
abi.encodeCall(
ITokenizedStrategy.init,
ITokenizedStrategy.initialize,
(_asset, _name, msg.sender, msg.sender, msg.sender)
)
);
Expand All @@ -167,7 +167,7 @@ abstract contract BaseStrategy {
//////////////////////////////////////////////////////////////*/

/**
* @dev Should deploy up to '_amount' of 'asset' in the yield source.
* @dev Can deploy up to '_amount' of 'asset' in the yield source.
*
* This function is called at the end of a {deposit} or {mint}
* call. Meaning that unless a whitelist is implemented it will
Expand All @@ -180,9 +180,9 @@ abstract contract BaseStrategy {
function _deployFunds(uint256 _amount) internal virtual;

/**
* @dev Will attempt to free the '_amount' of 'asset'.
* @dev Should attempt to free the '_amount' of 'asset'.
*
* The amount of 'asset' that is already loose has already
* NOTE: The amount of 'asset' that is already loose has already
* been accounted for.
*
* This function is called during {withdraw} and {redeem} calls.
Expand Down Expand Up @@ -360,7 +360,7 @@ abstract contract BaseStrategy {
//////////////////////////////////////////////////////////////*/

/**
* @notice Should deploy up to '_amount' of 'asset' in yield source.
* @notice Can deploy up to '_amount' of 'asset' in yield source.
* @dev Callback for the TokenizedStrategy to call during a {deposit}
* or {mint} to tell the strategy it can deploy funds.
*
Expand All @@ -378,7 +378,7 @@ abstract contract BaseStrategy {
}

/**
* @notice Will attempt to free the '_amount' of 'asset'.
* @notice Should attempt to free the '_amount' of 'asset'.
* @dev Callback for the TokenizedStrategy to call during a withdraw
* or redeem to free the needed funds to service the withdraw.
*
Expand Down
Loading

0 comments on commit a3ace32

Please sign in to comment.