Ethereum: functions Burn and Transfer source

0 votes

Hey people.. I was reading  an example for an ethereum token with such functionalities as transferring and burning coins. I found the following code:

function burn(uint256 _value) public returns (bool success) {
        require(balanceOf[msg.sender] >= _value);   // Check if the sender has enough
        balanceOf[msg.sender] -= _value;            // Subtract from the sender
        totalSupply -= _value;                      // Updates totalSupply
        Burn(msg.sender, _value);
        return true;
    }

I understood that we take coins from sender, then take it from the total supply, but I didnt get what this line does:

        Burn(msg.sender, _value);

Can someone tell me about this?

Oct 9, 2018 in Blockchain by digger
• 27,620 points

edited Oct 16, 2018 by Omkar 61 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

This statement is used to publish an event that is declared earlier in the code: 

event Burn(address indexed from, uint256 value);

To know more about this, visit: https://programtheblockchain.com/posts/2018/01/24/logging-and-watching-solidity-events/.

answered Oct 9, 2018 by Omkar
• 65,850 points

Related Questions In Blockchain

0 votes
0 answers

What happens to the ethereum mempool transaction of uncle and fork nodes

I understand that in Bitcoin network when ...READ MORE

Apr 7, 2018 in Blockchain by Christine
• 15,790 points
64 views
0 votes
1 answer
0 votes
1 answer

Smart contract limitations in Ethereum and Hyperledger Fabric

No, the contract cannot sign on behave of B. A ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
36 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
65 views
0 votes
1 answer
0 votes
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by ariaholic
• 7,320 points
43 views
+1 vote
2 answers

What is a blockchain and ethereum?

Some of the use-cases are: Healthcare Medical records are ...READ MORE

answered Aug 9, 2018 in Blockchain by Omkar
• 65,850 points
40 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.