Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/loopring_v3/contracts/amm/AmplifiedAmmController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ contract AmplifiedAmmController is IAmmController, Claimable
uint96[] memory vTokenBalancesL2 = new uint96[](joinAmounts.length);
for (uint i = 0; i < joinAmounts.length; i++) {
vTokenBalancesL2[i] = (uint(joinAmounts[i]).mul(amplificationFactor) / AMPLIFICATION_FACTOR_BASE).toUint96();
require(vTokenBalancesL2[i] > 0, "ZERO_VIRTUAL_BALANCE");
}
return vTokenBalancesL2;
}
Expand Down Expand Up @@ -128,11 +129,11 @@ contract AmplifiedAmmController is IAmmController, Claimable
returns (bool authorized)
{
uint timestamp = curveChangeAuthorization[pool];
authorized = (timestamp <= block.timestamp) &&
authorized = (timestamp <= block.timestamp) &&
(block.timestamp <= timestamp + CURVE_CHANGE_AUTH_WINDOW);

// Remove authorization
if (timestamp > 0) {
if (authorized) {
delete curveChangeAuthorization[pool];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ library AmmDepositProcess
internal
view
{
if (amount == 0) {
return;
}

// Verify deposit data
// Start by reading the first 27 bytes into packedData
uint txsDataPtr = ctx.txsDataPtr + 27;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ library AmmJoinProcess

// Update virtual balances
ctx.vTokenBalancesL2[i] = (uint(ctx.vTokenBalancesL2[i]).mul(newTotalSupply) / ctx.totalSupply).toUint96();
require(ctx.vTokenBalancesL2[i] > 0, "ZERO_VIRTUAL_BALANCE");
}

slippageOK = (mintAmount >= join.mintMinAmount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ library AmmWithdrawProcess
internal
view
{
if (amount == 0) {
return;
}

bytes20 onchainDataHash = WithdrawTransaction.hashOnchainData(
0, // Withdrawal needs to succeed no matter the gas coast
address(this), // Withdraw to this contract first
Expand Down