Skip to content

adds TrueFi adapter#21

Open
intothemoonlite wants to merge 1 commit intoDracula-Protocol:mainfrom
intothemoonlite:main
Open

adds TrueFi adapter#21
intothemoonlite wants to merge 1 commit intoDracula-Protocol:mainfrom
intothemoonlite:main

Conversation

@intothemoonlite
Copy link

No description provided.

contract TruefiAdapter is IVampireAdapter {
IDrainController constant drainController = IDrainController(0x2e813f2e524dB699d279E631B0F2117856eb902C);
ITrueFarm constant trueFarm = ITrueFarm(0xED45Cf4895C110f464cE857eBE5f270949eC2ff4);
IUniswapV2Router02 constant router = IUniswapV2Router02(0x1d5C6F1607A171Ad52EFB270121331b3039dD83e);

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();

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);

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);

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants