Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1.  
  2. 0x5412dd6a177e92b352b29ce1ee11a206a9ab1160
  3.  
  4. --------------------------------------------------------
  5.  
  6. pragma solidity ^0.5.1;
  7. contract MyBdeToken {
  8. /* This creates an array with all balances */
  9. mapping (address => uint256) public balanceOf;
  10. string myName;
  11.  
  12. /* Initializes contract with initial supply tokens to the creator of the contract */
  13. constructor(
  14. uint256 initialSupply
  15. ) public {
  16. balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens
  17. }
  18. 0xec61Cf4884EE475c14546296346cd5D8F955fdAc
  19. /* Send coins */
  20. function transfer(address _to, uint256 _value) public {
  21. require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
  22. require(balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
  23. balanceOf[msg.sender] -= _value; // Subtract from the sender
  24. balanceOf[_to] += _value; // Add the same to the recipient
  25. }
  26.  
  27. function setName (string memory _name) public returns (string memory){
  28. myName = _name;
  29. return (myName);
  30. }
  31.  
  32. function getName () public view returns (string memory ){
  33. return(myName);
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement