Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. contract P {
  2. mapping(address => uint) public balanceOf;
  3. uint public totalSupply;
  4.  
  5. modifier check {
  6. _;
  7. assert(this.balance >= totalSupply);
  8. }
  9.  
  10. function dee(uint amount) payable check {
  11. balanceOf[msg.sender] += amount;
  12. totalSupply += amount;
  13. }
  14.  
  15. function ex(address to, uint value) payable check {
  16. if (balanceOf[msg.sender] >= value) {
  17. balanceOf[to] += value;
  18. balanceOf[msg.sender] -= value;
  19. }
  20. }
  21.  
  22. function eff() payable check {
  23. uint balance = balanceOf[msg.sender];
  24. if (msg.sender.call.value(balance)()) {
  25. totalSupply -= balance;
  26. balanceOf[msg.sender] = 0;
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement