Skip to content

Commit

Permalink
chore: refactored _mint in DEX contract
Browse files Browse the repository at this point in the history
  • Loading branch information
jatZama committed Mar 8, 2024
1 parent af70794 commit bb0a6e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contracts/EncryptedDEXPair.sol
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,16 @@ contract EncryptedDEXPair is EncryptedERC20 {

function claimMint(uint256 tradingEpoch, address user) external {
require(tradingEpoch < currentTradingEpoch, "tradingEpoch is not settled yet");
_mint(tradingEpoch, user);
pendingMints[tradingEpoch][user] = ZERO;
}

function _mint(uint256 tradingEpoch, address user) internal {
if (tradingEpoch == 0) {
balances[user] = TFHE.sub(balances[user] + pendingMints[tradingEpoch][user], MINIMIMUM_LIQUIDITY); // this could never underflow from the contract logic

Check failure on line 198 in contracts/EncryptedDEXPair.sol

View workflow job for this annotation

GitHub Actions / ci

Line length must be no more than 120 but current length is 164
} else {
balances[user] = balances[user] + pendingMints[tradingEpoch][user];
}
pendingMints[tradingEpoch][user] = ZERO;
}

function claimBurn(uint256 tradingEpoch, address user) external {
Expand Down

0 comments on commit bb0a6e3

Please sign in to comment.