Skip to content

Commit

Permalink
Merge pull request #288 from Gearbox-protocol/simplify-tumbler-deploy…
Browse files Browse the repository at this point in the history
…ment

feat: simplify `TumblerV3`'s deployment
  • Loading branch information
0xmikko authored Sep 13, 2024
2 parents 20ec014 + 53506f5 commit c4049a7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions contracts/pool/TumblerV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ contract TumblerV3 is ITumblerV3, ControlledTrait, SanityCheckTrait {
mapping(address => uint16) internal _rates;

/// @notice Constructor
/// @param pool_ Pool whose quota rates to set by this contract
/// @param poolQuotaKeeper_ Quota keeper of the pool whose rates to set by this contract
/// @param epochLength_ Epoch length in seconds
/// @custom:tests U:[TU-1]
constructor(address pool_, uint256 epochLength_) ControlledTrait(ControlledTrait(pool_).acl()) {
pool = pool_;
underlying = IPoolV3(pool_).underlyingToken();
poolQuotaKeeper = IPoolV3(pool_).poolQuotaKeeper();
constructor(address poolQuotaKeeper_, uint256 epochLength_)
ControlledTrait(ControlledTrait(IPoolQuotaKeeperV3(poolQuotaKeeper_).pool()).acl())
{
pool = IPoolQuotaKeeperV3(poolQuotaKeeper_).pool();
underlying = IPoolQuotaKeeperV3(poolQuotaKeeper_).underlying();
poolQuotaKeeper = poolQuotaKeeper_;
epochLength = epochLength_;
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/integration/governance/QuotaRates.int.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contract QuotaRatesIntegrationTest is Test {
quotaKeeper = new PoolQuotaKeeperV3(address(pool));
pool.setPoolQuotaKeeper(address(quotaKeeper));

tumbler = new TumblerV3(address(pool), 1 days);
tumbler = new TumblerV3(address(quotaKeeper), 1 days);
quotaKeeper.setGauge(address(tumbler));
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/unit/pool/TumblerV3.unit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ contract TumblerV3UnitTest is Test, ITumblerV3Events {
poolQuotaKeeper.set_lastQuotaRateUpdate(uint40(block.timestamp));
pool.setPoolQuotaKeeper(address(poolQuotaKeeper));

tumbler = new TumblerV3(address(pool), 1 days);
tumbler = new TumblerV3(address(poolQuotaKeeper), 1 days);
}

/// @notice U:[TU-1]: Constructor works as expected
Expand Down

0 comments on commit c4049a7

Please sign in to comment.