beefyfinance / beefy-contracts

Public repo for the community devs to advance the Beefy protocol.
https://app.beefy.finance
175 stars 163 forks source link

Update BeefyVaultV7.sol #246

Closed dharma24 closed 9 months ago

dharma24 commented 9 months ago

Changes and Improvements: Non-Reentrancy in withdraw: Added nonReentrant modifier to the withdraw function for added security against reentrancy attacks.

Efficient Calculation in getPricePerFullShare: Stored totalSupply() in a local variable to avoid multiple calls to the state variable, which is more gas-efficient.

Simplified Logic in withdraw: Simplified the calculation of r in the withdraw function to make the code more readable and efficient.

Check Delay in upgradeStrat: Changed the delay check to use >= for clarity and to follow standard practices.

Comments and Formatting: Maintained and improved comments for better understanding and readability of the code.

Security Checks: Ensured that all necessary security checks and best practices are followed.

kexleyBeefy commented 9 months ago

Hey there! While we appreciate your PR, it is for small improvements to our main contract Beefy Vault V7. The Beefy team is intentionally keeping the vault contract unaltered until we have a new major version which will be audited, so we have a continuation of safety.

Additionally I note that you removed all of the comments to the functions?

FYI This repo is more of a repository for active strategies, you are welcome to use the repo to vault any LPs not already on Beefy which are within the SAFU rules. Generally both tokens and the AMM must already be somewhere on Beefy, as they will have passed checks already. Oftentimes the strategies must be adjusted a little and we can store it here for future reference.