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

feat: release 0.4.4 #542

Merged
merged 35 commits into from
Oct 25, 2022
Merged

feat: release 0.4.4 #542

merged 35 commits into from
Oct 25, 2022

Conversation

pandadefi
Copy link
Contributor

@pandadefi pandadefi commented Jul 20, 2022

Candidate for next release.
Do not merge until it's ready for a release.

Change Log:

  • Remove balanceOf dependency for estimatedTotalAssets (airdrop protection)
  • allow harvest on same block as addStrategy
  • upgrade vyper 0.3.3
  • upgrade sol 0.8.x
  • add deposit/withdraw events
  • reduce BaseStrategy size
  • add setLockedProfitDegradation event
  • add FeeReport event
  • add NewPendingGovernance event
  • additional testing
  • remove BaseWrapper
  • remove yToken
  • prevent fork EIP712 replay

closes #153

Steffel and others added 13 commits February 24, 2022 10:24
* refactor: reduce base strategy size

* fix: do not add onlyManagement
* fix: allow harvest on add strategy block

* docs: comment

Co-authored-by: El De-dog-lo <3859395+fubuloubu@users.noreply.github.com>

Co-authored-by: El De-dog-lo <3859395+fubuloubu@users.noreply.github.com>
* fix: implement modifiers

* fix: typo

* fix: formatting
@pandadefi pandadefi changed the title Release 0.4.4 feat: release 0.4.4 Jul 20, 2022
Copy link
Contributor

@storming0x storming0x left a comment

Choose a reason for hiding this comment

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

LGTM overall, minor comments around a few test cases we should add and gas optimization

contracts/Vault.vy Show resolved Hide resolved
tests/functional/vault/test_misc.py Show resolved Hide resolved
@pandadefi
Copy link
Contributor Author

@storming0x
Can you please have a in detail look at the transition from safe math to math, I see one issue was introduced but lucky for us tests got it: ed04590

@storming0x
Copy link
Contributor

storming0x commented Jul 21, 2022

@storming0x Can you please have a in detail look at the transition from safe math to math, I see one issue was introduced but lucky for us tests got it: ed04590

yeah this one seems to match what we have on the branch here

return (profitFactor * callCost < credit + profit);

Also diff here from the 0.4.3-sol8 branch vrs BaseStrategy here https://www.diffchecker.com/Su6r0fw9 LGTM!

Copy link
Contributor

@storming0x storming0x left a comment

Choose a reason for hiding this comment

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

LGTM!

@pandadefi
Copy link
Contributor Author

Do not merge into master yet.
We have to make a rc tag to start using it while we are doing audit.

Copy link

@rareweasel rareweasel left a comment

Choose a reason for hiding this comment

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

LGTM, Great job Panda! I left a minor comment.

}

function _onlyAuthorized() internal {
require(msg.sender == strategist || msg.sender == governance());

Choose a reason for hiding this comment

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

I would keep the error messages in the require statements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Strategies have some issues with gas limit, I don't think it's necessary to get an error message.

Choose a reason for hiding this comment

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

any reason not to swap over to using Custom Errors as you've moved to solc > 8.4?

@@ -221,6 +233,7 @@ emergencyShutdown: public(bool)

depositLimit: public(uint256) # Limit for totalAssets the Vault can hold
debtRatio: public(uint256) # Debt ratio for the Vault across all strategies (in BPS, <= 10k)
totalIdle: public(uint256) # Amount of tokens that are on the vault
Copy link
Contributor

Choose a reason for hiding this comment

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

*"on" should be come "in"

or change comment to "balance of underlying tokens tracked by the vault"

contracts/Vault.vy Show resolved Hide resolved
Copy link

@invader-tak invader-tak left a comment

Choose a reason for hiding this comment

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

  • Recommend replacing require with customer errors in a future iteration
  • vyper 3.4 borked the tests for me, but the previous commit using 3.3 looked fine (passed manual inspection/testing)

@storming0x
Copy link
Contributor

storming0x commented Aug 1, 2022

  • vyper 3.4 borked the tests for me, but the previous commit using 3.3 looked fine (passed manual inspection/testing)

latest commit rollbacks to 0.3.3 FYI

@pandadefi
Copy link
Contributor Author

Associated PR: yearn/brownie-strategy-mix#88

@banteg
Copy link
Member

banteg commented Sep 5, 2022

can we squeeze this in? #545

@@ -741,7 +763,7 @@ def decreaseAllowance(spender: address, amount: uint256) -> bool:


@external
def permit(owner: address, spender: address, amount: uint256, expiry: uint256, signature: Bytes[65]) -> bool:
def permit(owner: address, spender: address, amount: uint256, deadline: uint256, v: uint8, r: bytes32, s: bytes32) -> bool:
Copy link
Contributor

@storming0x storming0x Oct 20, 2022

Choose a reason for hiding this comment

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

from @xgambitox

Think it might break the interface that other integrators use, like Portals zaps, on withdrawing with permit. Take a look here https://etherscan.io/address/0x70ed999E2849A3C85EB4a6288B90c7ecA7b807F4#code#F9#L152

We probably need to either keep this interface or make a second permit that keeps backward compatibility to avoid breaking interface

Copy link
Contributor Author

@pandadefi pandadefi Oct 21, 2022

Choose a reason for hiding this comment

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

It's not possible to define multiple functions with the same name using vyper.

Copy link
Contributor Author

@pandadefi pandadefi Oct 21, 2022

Choose a reason for hiding this comment

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

I have made the changes, since optimism is already using 0.4.4, this might need to be pushed to 0.4.5. 1446bc4

Copy link
Contributor

Choose a reason for hiding this comment

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

agree it makes sense to move to 0.4.5 to avoid confusion , so i guess next steps is release 0.4.4 and then 0.4.5 with this change

Copy link
Contributor Author

@pandadefi pandadefi Oct 24, 2022

Choose a reason for hiding this comment

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

I would like permit to be eip-2612 compliant and would instead use 0.4.4. The best would be for vyper to support multiple function definitions.

Copy link
Member

Choose a reason for hiding this comment

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

As a hack, you can define the permit function to be 2612 compliant, and then farm another function name that has the same method ID as permit(address,address,uint256,uint256,Bytes[65]) and accepts the same type arguments, and then just have that split the signature into components and forward to the correct method

@yearn yearn deleted a comment from mariuspod Oct 21, 2022
@pandadefi
Copy link
Contributor Author

pandadefi commented Oct 24, 2022

I will merge this into master and cut 0.4.4 release if none express any issues @storming0x @banteg @rareweasel

@storming0x
Copy link
Contributor

I will merge this into master and cut 0.4.4 release if none express any issues @storming0x @banteg @rareweasel

asking in the protocol group so we are sure that we are all in sync w the plan

@pandadefi pandadefi merged commit 3362e89 into yearn:master Oct 25, 2022
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.

Upgrade to Solidity 0.8.x Series
9 participants