Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 0x5412dd6a177e92b352b29ce1ee11a206a9ab1160
- --------------------------------------------------------
- pragma solidity ^0.5.1;
- contract MyBdeToken {
- /* This creates an array with all balances */
- mapping (address => uint256) public balanceOf;
- string myName;
- /* Initializes contract with initial supply tokens to the creator of the contract */
- constructor(
- uint256 initialSupply
- ) public {
- balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens
- }
- 0xec61Cf4884EE475c14546296346cd5D8F955fdAc
- /* Send coins */
- function transfer(address _to, uint256 _value) public {
- require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
- require(balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
- balanceOf[msg.sender] -= _value; // Subtract from the sender
- balanceOf[_to] += _value; // Add the same to the recipient
- }
- function setName (string memory _name) public returns (string memory){
- myName = _name;
- return (myName);
- }
- function getName () public view returns (string memory ){
- return(myName);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement