-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3cf557b
commit 8a1b16e
Showing
3 changed files
with
52 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.7.0; | ||
|
||
interface ILiquidityGaugeV6 { | ||
function deposit_reward_token(address _reward_token, uint256 _amount, uint256 _epoch) 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,40 @@ | ||
from great_ape_safe import GreatApeSafe | ||
from helpers.addresses import r | ||
from brownie import interface | ||
|
||
STETH = r.treasury_tokens.STETH | ||
WSTETH = r.treasury_tokens.WSTETH | ||
GAUGE = r.crv_gauges.ebtc_wsteth_gauge | ||
|
||
TROPS = r.badger_wallets.treasury_ops_multisig | ||
|
||
MONTH = 60 * 60 * 24 * 7 * 4 # Epoch | ||
|
||
def main(amount=0, epoch=MONTH, use_wsteth=True): | ||
""" | ||
Deposit stETH or wstETH into the eBTC/wstETH Curve gauge for a given epoch | ||
Args: | ||
amount (int): Decimal amount of stETH or wstETH to deposit | ||
epoch (int): Epoch length to deposit the amount, default 1 month | ||
use_wsteth (bool): Use wstETH instead of stETH | ||
""" | ||
safe = GreatApeSafe(TROPS) | ||
gauge = safe.contract(GAUGE, Interface=interface.ILiquidityGaugeV6) | ||
amount = int(float(amount) * 1e18) | ||
|
||
if use_wsteth: | ||
token = safe.contract(WSTETH) | ||
else: | ||
token = safe.contract(STETH) | ||
|
||
# 1. Approve amount | ||
token.approve(GAUGE, amount) | ||
|
||
# 2. Deposit amount | ||
gauge.deposit_reward_token(token.address, amount, epoch) | ||
|
||
# 3. Confirm deposit | ||
print(gauge.reward_data(token)) | ||
|
||
safe.post_safe_tx() |