Skip to content

Commit

Permalink
refactor: check contract balance in xchain voucher
Browse files Browse the repository at this point in the history
  • Loading branch information
fnanni-0 committed May 20, 2023
1 parent ffe0025 commit 0d6a62d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contracts/multichain/GnosisChainReceiverV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ contract GnosisChainReceiver is IXReceiver {
predictions[i] = prediction >> (8 * (32 - elementSize));
}

if (voucherBalance[user] >= price && marketsWhitelist[address(market)]) {
if (
voucherBalance[user] >= price &&
address(this).balance >= price &&
marketsWhitelist[address(market)]
) {
// Use voucher
voucherBalance[user] -= price;
voucherTotalSupply -= price;
Expand Down

0 comments on commit 0d6a62d

Please sign in to comment.