pragma solidity >=0.7.0 < 0.9.0; contract Coin { address public minter; mapping(address => uint) public balance; constructor(){ minter = msg.sender; } function mint(address reciver, uint amount) public { require(msg.sender == minter, "Not the creator, not the creator"); require(amount < 1e60); balance[reciver] += amount; } // I just want sender had enough money to commit trasaction. // Ex: Sender got 100 ETH, send 10. // : The trasaction must go through, but nope, something nasty happend. // When i type a valid number. Transaction didn't go through // And throw error "Insuficent balance" function send(address reciver, uint amount) public { require(amount <= balance[msg.sender], "Insuficent balance"); balance[msg.sender] -= amount; balance[reciver] += amount; } }
[link] [comments]

You can get bonuses upto $100 FREE BONUS when you:
💰 Install these recommended apps:
💲 SocialGood - 100% Crypto Back on Everyday Shopping
💲 xPortal - The DeFi For The Next Billion
💲 CryptoTab Browser - Lightweight, fast, and ready to mine!
💰 Register on these recommended exchanges:
🟡 Binance🟡 Bitfinex🟡 Bitmart🟡 Bittrex🟡 Bitget
🟡 CoinEx🟡 Crypto.com🟡 Gate.io🟡 Huobi🟡 Kucoin.
Comments