Skip to content

Comments

[WIP] Beefy support#16

Open
acamill wants to merge 27 commits intodevelopfrom
integration/beefy-vault
Open

[WIP] Beefy support#16
acamill wants to merge 27 commits intodevelopfrom
integration/beefy-vault

Conversation

@acamill
Copy link
Member

@acamill acamill commented Jan 10, 2023

No tested yet

@acamill acamill requested a review from WarTech9 January 10, 2023 03:01
@acamill acamill self-assigned this Jan 10, 2023
revert UnsupportedAsset(asset);
}
netAssetDeposits += assetAmount;
IERC20(assetToken).approve(address(BeefyVaultV7(vaultWrapper.vault()).want()), assetAmount);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here the approval should be fore vaultWrapper.vault() (The first parameter to approve().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be the token deposited (if so it's currently correct) or the destination address? I don't have much autocompletion or advices in my IDE

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also types barely show not sure why

console.log("Saving contract addresses...");
const config = `
{
"rageTrade": "${depository.address}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We currently have only one depository per chain. If we have multiple we would want to first read the depositories file, then add to that, so in this case you should write:

{
    "rageTrade": "${depositories.rageTrade}", // just re-writing the existing value
    "beefyFinance": "${depository.address}" // write the new depository address
}

Current script would overwrite the rageTrade depository address with the beefy one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would also need to load that depositories.rageTrade from somewhere first?

}
vaultWrapper = BeefyWrapper(_vaultWrapper);
controller = IUXDController(_controller);
assetToken = address(BeefyVaultV7(vaultWrapper.vault()).want());
Copy link
Collaborator

@WarTech9 WarTech9 Jan 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

want is the asset token in the Beefy vault?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's the deposited token (in token idk how to call it)

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