Skip to content

Commit

Permalink
add check on balance
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandroscifoni committed Jan 5, 2024
1 parent 3d2fd66 commit 0f7a5be
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions smart_contract/Geth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ contract Geth is ERC20, Ownable {
* @dev function to buy Ether with tokens and transfer them to the buyer.
*/
function purchaseWei(uint256 tokenAmount) external {
require(balanceOf(msg.sender) >= tokenAmount);
uint256 WeiAmount = calculateWeiAmount(tokenAmount);


Expand Down

0 comments on commit 0f7a5be

Please sign in to comment.