Skip to content

Commit

Permalink
Merge pull request #10 from traderjoe-xyz/redeem-claim-fix
Browse files Browse the repository at this point in the history
Redeem claim fix
  • Loading branch information
cryptofish7 committed Dec 5, 2021
2 parents 4a2ebe6 + bcfc027 commit 8f98610
Show file tree
Hide file tree
Showing 4 changed files with 2,714 additions and 5 deletions.
6 changes: 6 additions & 0 deletions contracts/JCollateralCapErc20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ contract JCollateralCapErc20 is JToken, JCollateralCapErc20Interface, JProtocolS
vars.redeemAmount = redeemAmountIn;
}


/**
* For every user, accountTokens must be greater than or equal to accountCollateralTokens.
* The buffer between the two values will be redeemed first.
Expand All @@ -698,6 +699,11 @@ contract JCollateralCapErc20 is JToken, JCollateralCapErc20Interface, JProtocolS
collateralTokens = vars.redeemTokens - bufferTokens;
}

uint256 allowed = joetroller.redeemAllowed(address(this), redeemer, collateralTokens);
if (allowed != 0) {
return failOpaque(Error.JOETROLLER_REJECTION, FailureInfo.REDEEM_JOETROLLER_REJECTION, allowed);
}

/* Verify market's block timestamp equals current block timestamp */
if (accrualBlockTimestamp != getBlockTimestamp()) {
return fail(Error.MARKET_NOT_FRESH, FailureInfo.REDEEM_FRESHNESS_CHECK);
Expand Down
5 changes: 0 additions & 5 deletions deployments/avalanche/JUsdcDelegate.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
<<<<<<< HEAD
"address": "0x4A586DAA5D5EDCD8182339C24291FB510fA4d271",
=======
"address": "0xeBeA851D28722E53AaCdC831d2894E25f460e62E",
>>>>>>> df7b2b5 (Update JUsdcDelegate address)
"abi": [
{
"inputs": [],
Expand Down Expand Up @@ -2566,4 +2562,3 @@
}
}
}

Loading

0 comments on commit 8f98610

Please sign in to comment.