Skip to content

Commit

Permalink
fix: arithmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
xenide committed Nov 20, 2024
1 parent 4803c67 commit 842db70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/asset-management/EulerV2Manager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ contract EulerV2Manager is IAssetManager, Owned(msg.sender), ReentrancyGuard {
function setVaultForAsset(IERC20 aAsset, IERC4626 aVault) external onlyOwner {
IERC4626 lVault = assetVault[aAsset];
// this is to prevent accidental moving of vaults when there are still shares outstanding
// as it will prevent the AMM pairs from getting their tokens back from the vault
// as it will prevent the AMM pairs from redeeming underlying tokens from the vault
if (address(lVault) != address(0) && totalShares[lVault] != 0) {
revert OutstandingSharesForVault();
}
Expand Down Expand Up @@ -309,7 +309,7 @@ contract EulerV2Manager is IAssetManager, Owned(msg.sender), ReentrancyGuard {
uint256 lLength = aPairs.length;
for (uint256 i = 0; i < lLength - 1; ++i) {
uint256 lOldShares = shares[aPairs[i]][aAsset];
uint256 lNewSharesEntitled = lOldShares.divWad(lOldShares);
uint256 lNewSharesEntitled = lNewShares.mulDiv( lOldShares, lOldTotalShares);
shares[aPairs[i]][aAsset] += lNewSharesEntitled;
lSharesAllocated += lNewSharesEntitled;
}
Expand Down

0 comments on commit 842db70

Please sign in to comment.