Skip to content

Commit

Permalink
fix: ordering of locking
Browse files Browse the repository at this point in the history
Signed-off-by: Silas Davis <[email protected]>
  • Loading branch information
silasdavis committed Nov 20, 2024
1 parent 19cfafd commit 9219c5c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contracts/ConfidentialERC20/ConfidentialERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ abstract contract ConfidentialERC20 is Ownable, IConfidentialERC20, IERC20Metada
bool exists;
}

mapping(address account => uint256 requestId) public burnRuquestIds;
mapping(uint256 => BurnRq) public burnRqs;
/**
* @dev Returns the name of the token.
Expand Down Expand Up @@ -285,9 +286,9 @@ abstract contract ConfidentialERC20 is Ownable, IConfidentialERC20, IERC20Metada
if (account == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
// Unconditionally lock the burn amount
_lockedBalances[account] = _lockedBalances[account] + amount;
ebool enoughBalance = _hasSufficientBalance(account, amount);
// Unconditionally lock the burn amount after calculating sufficient balance
_lockedBalances[account] = _lockedBalances[account] + amount;
TFHE.allow(enoughBalance, address(this));
uint256[] memory cts = new uint256[](1);
cts[0] = Gateway.toUint256(enoughBalance);
Expand Down

0 comments on commit 9219c5c

Please sign in to comment.