Skip to content

Conversation

@iamsahu
Copy link
Contributor

@iamsahu iamsahu commented May 3, 2023

This PR contains the fixes based on the reports the auditors submitted. The fixes were first implemented in the auditor-specific repos and then after their approval were aggregated and implemented in this repo. You can find the reports and PRs here:

  1. https://github.com/yieldprotocol/variable-rate-audit-DecorativePineapple
  2. https://github.com/yieldprotocol/variable-rate-audit-gogoauditor
  3. https://github.com/yieldprotocol/variable-rate-audit-parth-15
  4. https://github.com/yieldprotocol/variable-rate-audit-obheda12

We need to review if all the accepted changes in the above reports were implemented in this one.

@iamsahu iamsahu marked this pull request as ready for review May 4, 2023 13:57
@iamsahu iamsahu requested review from Sabnock01 and alcueca May 4, 2023 13:57
erc3156/=lib/ERC3156/
dss-interfaces/=lib/dss-interfaces/
openzeppelin/=lib/openzeppelin-contracts/
@openzeppelin/=lib/openzeppelin-contracts/
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need node convention here?

IJoin baseJoin = getJoin(vault.baseId);
if (base < 0) baseJoin.join(vault.owner, uint128(-base));
if (base > 0) baseJoin.exit(to, uint128(base));
else baseJoin.exit(to, uint128(base));
Copy link
Contributor

Choose a reason for hiding this comment

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

What if base is 0? That wasn't being checked before but is now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On 325 we are checking that base != 0

// ---- Asset and debt management ----

/// @dev Move collateral and debt between vaults.
function stir(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was stir moved exactly?

Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't update the global debt counters when ilkId != baseId. It could be fixed, but at the same time we haven't ever used it, so better to just reduce the attack surface.

}
}

contract FlashLoanEnabledStateTests is FlashLoanEnabledState {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove all these tests exactly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since, flash loan was removed the tests are removed as well.

ladle.give(vaultId, admin);
}

function testOnlyOwnerCouldMove() public {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove so many tests from this file? Is it because they're already tested elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The tests related to stir were removed.

Copy link
Contributor

@alcueca alcueca left a comment

Choose a reason for hiding this comment

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

Just cosmetic changes required.

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.

4 participants