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

C4 audit mitigations #9

Merged
merged 22 commits into from
Jul 15, 2021
Merged

C4 audit mitigations #9

merged 22 commits into from
Jul 15, 2021

Conversation

@@ -261,7 +313,7 @@ contract YearnV2YieldSource is IYieldSource, ERC20Upgradeable, OwnableUpgradeabl
/// @dev used to calculate how many shares to mint / burn when depositing / withdrawing
/// @return tokens number of tokens equivalent (in value) to the amount of Yield Source shares
function _sharesToToken(uint256 shares) internal view returns (uint256 tokens) {
if(totalSupply() == 0) {
if (totalSupply() == 0) {

Choose a reason for hiding this comment

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

let's pull this into a variable, as it's a public function call

Copy link
Author

Choose a reason for hiding this comment

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

Done: 32b130d

@@ -248,7 +300,7 @@ contract YearnV2YieldSource is IYieldSource, ERC20Upgradeable, OwnableUpgradeabl
/// @param tokens amount of tokens to be converted
/// @return shares number of shares equivalent to the amount of tokens
function _tokenToShares(uint256 tokens) internal view returns (uint256 shares) {
if(totalSupply() == 0) {
if (totalSupply() == 0) {

Choose a reason for hiding this comment

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

let's pull this into a variable

Copy link
Author

Choose a reason for hiding this comment

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

Done: 32b130d

@PierrickGT PierrickGT merged commit 12c1fb5 into master Jul 15, 2021
@PierrickGT PierrickGT deleted the fixes/c4-audit branch July 15, 2021 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants