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
• 26,740 points

edited Oct 16, 2018 by Omkar 2,106 views

1 answer to this question.

0 votes

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

event Burn(address indexed from, uint256 value);

answered Oct 9, 2018 by Omkar
• 69,220 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 8, 2018 in Blockchain by Christine
• 15,790 points
1,035 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
694 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
1,942 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,468 views
+1 vote
1 answer

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

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,460 points
1,459 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
• 69,220 points
903 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP