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

Aerodrome OETH AMO #2019

Open
wants to merge 63 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
e034bc3
feat: aerodrome strategy init
PraneshASP Apr 3, 2024
7865712
feat: add withdraw() method
PraneshASP Apr 3, 2024
905c594
feat: add IPool interface
PraneshASP Apr 3, 2024
6b32048
feat: add checkBalance() method
PraneshASP Apr 4, 2024
33944f3
config: base fork test
PraneshASP Apr 4, 2024
379b94e
config: base chain fork-test
PraneshASP Apr 4, 2024
95ec7ec
Add Tooling for Base network (#2016)
shahthepro Apr 5, 2024
7639831
wip: fork tests
PraneshASP Apr 6, 2024
289ecdc
wip: update fixture for fork tests
PraneshASP Apr 6, 2024
f791714
chore: update fixture to deposit lp tokens to gauge
PraneshASP Apr 6, 2024
d644dff
chore: add checkBalance() test
PraneshASP Apr 6, 2024
179b337
wip fork tests with vault
PraneshASP Apr 7, 2024
92ca0db
wip fork tests with vault
PraneshASP Apr 7, 2024
c696253
Prettier changes
shahthepro Apr 8, 2024
b260b0e
Add MockVaultForBase skeleton (#2017)
shahthepro Apr 8, 2024
2ed76d7
feat: deposit fork tests
PraneshASP Apr 8, 2024
d373fe0
feat: deposit fork tests
PraneshASP Apr 8, 2024
20069ba
feat: withdraw() fork tests
PraneshASP Apr 9, 2024
4c4ea22
chore: change wad to 1e18
PraneshASP Apr 9, 2024
511734e
fix: update lpPrice formula
PraneshASP Apr 10, 2024
6bb14a4
test: add lpPrice() fork test
PraneshASP Apr 10, 2024
01e361a
chore: make the reserve index dynamic
PraneshASP Apr 10, 2024
b52dfa5
wip: aeroAmoStrat task
PraneshASP Apr 10, 2024
b24018b
wip: aeroAmoStrat task
PraneshASP Apr 10, 2024
840d047
feat: aeroAmoStrat task without vault stuff
PraneshASP Apr 10, 2024
fd69d1b
feat: aeroAmoStrat task with vault calcs
PraneshASP Apr 10, 2024
1d1b781
feat: add swapAndRebalance() method
PraneshASP Apr 11, 2024
d654f17
fix: use inputs from quoteAddLiquidity() to addLiquidity()
PraneshASP Apr 11, 2024
8267236
feat: more tests
PraneshASP Apr 12, 2024
f0c4939
chore: cleanup
PraneshASP Apr 12, 2024
9da5a55
fix: remove modifier in deposit()
PraneshASP Apr 14, 2024
dcdb9e3
fix: revert formatting
PraneshASP Apr 15, 2024
b45a9e3
fix: add min amounts in deposit()
PraneshASP Apr 15, 2024
66332e7
Merge branch 'master' into PraneshASP/aerodrome-amo
shahthepro Apr 18, 2024
5afa21c
Update deployment ID
shahthepro Apr 18, 2024
563775d
Deploy 092 - wOETH on Base (#2022)
shahthepro May 2, 2024
ac29eaf
Add AERO/WETH Oracle (#2043)
PraneshASP May 13, 2024
3343e42
Merge branch 'PraneshASP/aerodrome-amo' of https://github.com/OriginP…
PraneshASP May 14, 2024
7933c0e
fix: update improvePoolBalance() modifier
PraneshASP May 14, 2024
1ae65ef
refactor: update tests for swapAndRebalance() method
PraneshASP May 14, 2024
48d4f7c
refactor: update fixture
PraneshASP May 14, 2024
1409ba0
fix: update oracle and harvester tests
PraneshASP May 14, 2024
247144b
merge master
PraneshASP May 15, 2024
f107a06
chore: fix config
PraneshASP May 15, 2024
4fbad41
chore: fix some linting issues
PraneshASP May 17, 2024
1522fe1
OETH Base deploy script (#2061)
PraneshASP May 28, 2024
a70b2af
feat: add performance fees to base harvester
PraneshASP May 28, 2024
177483a
refactor: fix naming and formula
PraneshASP May 30, 2024
b44066a
fix: linter issues
PraneshASP Jun 1, 2024
c89d1b1
chore: fmt
PraneshASP Jun 1, 2024
59ae88e
chore: add solady to slither filter
PraneshASP Jun 1, 2024
a464207
fix: slither issues
PraneshASP Jun 1, 2024
2511b4b
fix: slither issues
PraneshASP Jun 1, 2024
42aa0bd
chore: add fork test for collectRewardTokens()
PraneshASP Jun 2, 2024
78d2a00
chore: remove getReward() during withdrawal
PraneshASP Jun 3, 2024
e00972e
fix: add mev protection during withdrawal
PraneshASP Jun 3, 2024
555aa16
fix: _deposit() logic
PraneshASP Jun 4, 2024
8cf38d0
fix: forked node config
PraneshASP Jun 4, 2024
212f59e
chore: rename oracle test file
PraneshASP Jun 4, 2024
e64996c
fix: swapAndRebalance() and fork tests
PraneshASP Jun 5, 2024
a561b43
chore: hardhat config fix
PraneshASP Jun 6, 2024
92816b4
test: add governable behavior test
PraneshASP Jun 6, 2024
37817e0
fix: config
PraneshASP Jun 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/defi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,54 @@ jobs:
./contracts/coverage/**/*
retention-days: 1

contracts-base-forktest:
name: "Base Fork Tests"
runs-on: ubuntu-latest
continue-on-error: true
env:
HARDHAT_CACHE_DIR: ./cache
PROVIDER_URL: ${{ secrets.PROVIDER_URL }}
BASE_PROVIDER_URL: ${{ secrets.BASE_PROVIDER_URL }}
steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "yarn"
cache-dependency-path: contracts/yarn.lock

- uses: actions/cache@v3
id: hardhat-cache
with:
path: contracts/cache
key: ${{ runner.os }}-hardhat-${{ hashFiles('contracts/cache/*.json') }}
restore-keys: |
${{ runner.os }}-hardhat-cache

- run: yarn install --frozen-lockfile
working-directory: ./contracts

- run: yarn run test:coverage:base-fork
working-directory: ./contracts

- uses: actions/upload-artifact@v3
with:
name: fork-test-base-coverage-${{ github.sha }}
path: |
./contracts/coverage.json
./contracts/coverage/**/*
retention-days: 1

coverage-uploader:
name: "Upload Coverage Reports"
runs-on: ubuntu-latest
needs:
- contracts-unit-coverage
- contracts-forktest
- contracts-arb-forktest
- contracts-base-forktest
steps:
- uses: actions/checkout@v3

Expand Down
108 changes: 108 additions & 0 deletions contracts/contracts/interfaces/aerodrome/IGauge.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IGauge {
error NotAlive();
error NotAuthorized();
error NotVoter();
error NotTeam();
error RewardRateTooHigh();
error ZeroAmount();
error ZeroRewardRate();

event Deposit(address indexed from, address indexed to, uint256 amount);
event Withdraw(address indexed from, uint256 amount);
event NotifyReward(address indexed from, uint256 amount);
event ClaimFees(address indexed from, uint256 claimed0, uint256 claimed1);
event ClaimRewards(address indexed from, uint256 amount);

/// @notice Address of the pool LP token which is deposited (staked) for rewards
function stakingToken() external view returns (address);

/// @notice Address of the token (AERO) rewarded to stakers
function rewardToken() external view returns (address);

/// @notice Address of the FeesVotingReward contract linked to the gauge
function feesVotingReward() external view returns (address);

/// @notice Address of Protocol Voter
function voter() external view returns (address);

/// @notice Address of Protocol Voting Escrow
function ve() external view returns (address);

/// @notice Returns if gauge is linked to a legitimate Protocol pool
function isPool() external view returns (bool);

/// @notice Timestamp end of current rewards period
function periodFinish() external view returns (uint256);

/// @notice Current reward rate of rewardToken to distribute per second
function rewardRate() external view returns (uint256);

/// @notice Most recent timestamp contract has updated state
function lastUpdateTime() external view returns (uint256);

/// @notice Most recent stored value of rewardPerToken
function rewardPerTokenStored() external view returns (uint256);

/// @notice Amount of stakingToken deposited for rewards
function totalSupply() external view returns (uint256);

/// @notice Get the amount of stakingToken deposited by an account
function balanceOf(address) external view returns (uint256);

/// @notice Cached rewardPerTokenStored for an account based on their most recent action
function userRewardPerTokenPaid(address) external view returns (uint256);

/// @notice Cached amount of rewardToken earned for an account
function rewards(address) external view returns (uint256);

/// @notice View to see the rewardRate given the timestamp of the start of the epoch
function rewardRateByEpoch(uint256) external view returns (uint256);

/// @notice Cached amount of fees generated from the Pool linked to the Gauge of token0
function fees0() external view returns (uint256);

/// @notice Cached amount of fees generated from the Pool linked to the Gauge of token1
function fees1() external view returns (uint256);

/// @notice Get the current reward rate per unit of stakingToken deposited
function rewardPerToken() external view returns (uint256 _rewardPerToken);

/// @notice Returns the last time the reward was modified or periodFinish if the reward has ended
function lastTimeRewardApplicable() external view returns (uint256 _time);

/// @notice Returns accrued balance to date from last claim / first deposit.
function earned(address _account) external view returns (uint256 _earned);

/// @notice Total amount of rewardToken to distribute for the current rewards period
function left() external view returns (uint256 _left);

/// @notice Retrieve rewards for an address.
/// @dev Throws if not called by same address or voter.
/// @param _account .
function getReward(address _account) external;

/// @notice Deposit LP tokens into gauge for msg.sender
/// @param _amount .
function deposit(uint256 _amount) external;

/// @notice Deposit LP tokens into gauge for any user
/// @param _amount .
/// @param _recipient Recipient to give balance to
function deposit(uint256 _amount, address _recipient) external;

/// @notice Withdraw LP tokens for user
/// @param _amount .
function withdraw(uint256 _amount) external;

/// @dev Notifies gauge of gauge rewards. Assumes gauge reward tokens is 18 decimals.
/// If not 18 decimals, rewardRate may have rounding issues.
function notifyRewardAmount(uint256 amount) external;

/// @dev Notifies gauge of gauge rewards without distributing its fees.
/// Assumes gauge reward tokens is 18 decimals.
/// If not 18 decimals, rewardRate may have rounding issues.
function notifyRewardWithoutClaim(uint256 amount) external;
}