-
Notifications
You must be signed in to change notification settings - Fork 11
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
adds TrueFi adapter #21
base: main
Are you sure you want to change the base?
Conversation
contract TruefiAdapter is IVampireAdapter { | ||
IDrainController constant drainController = IDrainController(0x2e813f2e524dB699d279E631B0F2117856eb902C); | ||
ITrueFarm constant trueFarm = ITrueFarm(0xED45Cf4895C110f464cE857eBE5f270949eC2ff4); | ||
IUniswapV2Router02 constant router = IUniswapV2Router02(0x1d5C6F1607A171Ad52EFB270121331b3039dD83e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the wrong address being used. This is the LuaSwap router not Uniswap.
} | ||
|
||
function poolCount() external view override returns (uint256) { | ||
return trueFarm.totalStaked(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should return the number of pools, not the amount staked. Looking at TrueFi website (https://app.truefi.io/farm). There should be 3 pools we can support.
// Victim actions, requires impersonation via delegatecall | ||
function sellRewardForWeth(address, uint256 rewardAmount, address to) external override returns(uint256) { | ||
require(drainController.priceIsUnderRejectionTreshold(), "Possible price manipulation, drain rejected"); | ||
address[] memory path = new address[](2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is any reason to use router here. Probably cheaper to swap using the UniswapV2Pair interface. You can see examples in other adapters.
|
||
contract TruefiAdapter is IVampireAdapter { | ||
IDrainController constant drainController = IDrainController(0x2e813f2e524dB699d279E631B0F2117856eb902C); | ||
ITrueFarm constant trueFarm = ITrueFarm(0xED45Cf4895C110f464cE857eBE5f270949eC2ff4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only represents the UNI LP farm. We should aim to support all 3 farms on TrueFi.
No description provided.