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