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

V4 #2

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open

V4 #2

wants to merge 33 commits into from

Conversation

ewansheldon
Copy link
Member

No description provided.

@ewansheldon
Copy link
Member Author

@wsdt

@@ -185,15 +188,16 @@ contract SmartVaultYieldManager is ISmartVaultYieldManager, Ownable {
if (_hypervisorData.hypervisor != _hypervisor) revert InvalidRequest();
IHypervisor(_hypervisor).withdraw(_thisBalanceOf(_hypervisor), address(this), address(this), [uint256(0),uint256(0),uint256(0),uint256(0)]);
_swapToSingleAsset(_hypervisor, _token, uniswapRouter, _hypervisorData.poolFee);
IERC20(_token).safeTransfer(msg.sender, _thisBalanceOf(_token));
}

function withdraw(address _hypervisor, address _token) external {
IERC20(_hypervisor).safeTransferFrom(msg.sender, address(this), IERC20(_hypervisor).balanceOf(msg.sender));
Copy link

Choose a reason for hiding this comment

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

super minor, but code might become much more readable with interface wrappings being class defined instead of the member always being wrapped multiple times in every function call.

@@ -166,7 +169,7 @@ contract SmartVaultYieldManager is ISmartVaultYieldManager, Ownable {
IERC20(EURA).safeApprove(uniswapRouter, _balance);
ISwapRouter(uniswapRouter).exactInput(ISwapRouter.ExactInputParams({
path: _pathFromEURA,
recipient: msg.sender,
recipient: address(this),
deadline: block.timestamp + 60,
Copy link

Choose a reason for hiding this comment

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

Do we want to have that configurable possibly (with a require min value of 60 for example). This way we can increase the deadline enforced when unforeseen issues arise, the network being congested, etc. --> it at least allows you to react if something breaks at this point.

Copy link
Member Author

Choose a reason for hiding this comment

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

probably a good idea!

@@ -151,13 +153,14 @@ contract SmartVaultYieldManager is ISmartVaultYieldManager, Ownable {

function deposit(address _collateralToken, uint256 _euroPercentage) external returns (address _hypervisor0, address _hypervisor1) {
// TODO min _euroPercentage of 10%
Copy link

Choose a reason for hiding this comment

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

why don't we add the require statement as pointed out in the Todo?

Copy link
Member Author

Choose a reason for hiding this comment

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

that's done now, was not yet finished developing that out

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