yvesbou / deposit_erc20

Fullstack DApp in the making (incl. tests, e2e)
0 stars 0 forks source link

checks added #15

Closed yvesbou closed 2 years ago

yvesbou commented 2 years ago
yvesbou commented 2 years ago

Normal Behavior Tested Add Tests for checks

if (_amount <= 0) {
       revert InsufficientAmount({depositAmount: _amount});
        }

if (!addressToFundingStatus[address(msg.sender)]) {
      // this address has not funded the contract
      revert UserNotAFunder();
      }

if (addressToFunds[address(msg.sender)] < _amount) {
        // the user wanted to withdraw more than deposited
        revert InsufficientBalance({available: addressToFunds[address(msg.sender)], required: _amount});
        }