Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RetroBooster & BoostedStrategyBase #130

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

a17
Copy link
Member

@a17 a17 commented May 12, 2024

  • RetroBooster
    • hold veNFT
    • increase lock period
    • cast vote
    • claim bribes
    • hold pool strategy positions (NFT and ALM LP)
    • store pool strategy earned Merkl rewards
  • LiquidToken
  • Platform
    • boosters management
  • Gauge
  • BoostedStrategyBase
    • skeleton
    • logic
  • tests
  • ...

@a17 a17 added enhancement New feature or request BASE STRATEGY Base strategy implementation labels May 12, 2024
@a17 a17 linked an issue May 12, 2024 that may be closed by this pull request
@a17 a17 marked this pull request as draft May 12, 2024 01:17
@a17 a17 changed the title RetroBooster: hold veNFT RetroBooster & BoostedStrategyBase May 12, 2024
@a17 a17 added the BOOSTER New Booster implementation label May 12, 2024
Copy link

codecov bot commented May 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 67 lines in your changes are missing coverage. Please review.

Project coverage is 93.27%. Comparing base (2fdd3bd) to head (c578963).

Files Patch % Lines
src/boosters/RetroBooster.sol 0.00% 31 Missing ⚠️
script/libs/DeployBoosterLib.sol 0.00% 11 Missing ⚠️
src/core/Platform.sol 0.00% 11 Missing ⚠️
src/core/tokens/LiquidToken.sol 0.00% 10 Missing ⚠️
src/strategies/base/BoostedStrategyBase.sol 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #130      +/-   ##
==========================================
- Coverage   94.73%   93.27%   -1.47%     
==========================================
  Files          58       62       +4     
  Lines        4273     4340      +67     
  Branches      465      473       +8     
==========================================
  Hits         4048     4048              
- Misses         77      144      +67     
  Partials      148      148              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +38 to +41
function __BoostedStrategyBase_init(address booster_) internal onlyInitializing {
BoostedStrategyBaseStorage storage $ = _getBoostedStrategyBaseStorage();
$.booster = booster_;
}

Check warning

Code scanning / Slither

Dead-code Warning

BoostedStrategyBase.__BoostedStrategyBase_init(address) is never used and should be removed
Comment on lines +10 to +62
abstract contract BoostedStrategyBase is StrategyBase, IBoostedStrategy {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CONSTANTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

/// @dev Version of BoostedStrategyBase implementation
string public constant VERSION_BOOSTED_STRATEGY_BASE = "1.0.0";

// todo set
// keccak256(abi.encode(uint256(keccak256("erc7201:stability.BoostedStrategyBase")) - 1)) & ~bytes32(uint256(0xff));
bytes32 private constant BOOSTEDSTRATEGYBASE_STORAGE_LOCATION =
0xe61f0a7b2953b9e28e48cc07562ad7979478dcaee972e68dcf3b10da2cba6000;

/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* DATA TYPES */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

/// @custom:storage-location erc7201:stability.BoostedStrategyBase
struct BoostedStrategyBaseStorage {
/// @inheritdoc IBoostedStrategy
address booster;
}

/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* INITIALIZATION */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

//slither-disable-next-line naming-convention
function __BoostedStrategyBase_init(address booster_) internal onlyInitializing {
BoostedStrategyBaseStorage storage $ = _getBoostedStrategyBaseStorage();
$.booster = booster_;
}

/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* VIEW FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

/// @inheritdoc IBoostedStrategy
function booster() external view returns (address) {
return _getBoostedStrategyBaseStorage().booster;
}

/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* INTERNAL LOGIC */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

function _getBoostedStrategyBaseStorage() internal pure returns (BoostedStrategyBaseStorage storage $) {
//slither-disable-next-line assembly
assembly {
$.slot := BOOSTEDSTRATEGYBASE_STORAGE_LOCATION
}
}
}
@a17 a17 self-assigned this May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BASE STRATEGY Base strategy implementation BOOSTER New Booster implementation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RetroBooster & Boosted strategy
1 participant