MultiversX Tracker is Live!

My code is so dumb. I just want the sender had enough money to commit transactions. Can you fix it? Thanks.

Etherum Reddit

More / Etherum Reddit 202 Views

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; } } 
submitted by /u/octor_stranger
[link] [comments]
Get BONUS $200 for FREE!

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