Warning Invoking events without emit prefix is deprecated while truffle compile

+4 votes

truffle compile outputs Warning: Invoking events without "emit" prefix is deprecated.

Compilation warnings encountered:

zeppelin-solidity/contracts/token/ERC20/BasicToken.sol:38:5: Warning: 
Invoking events without "emit" prefix is deprecated.
   Transfer(msg.sender, _to, _value);
Oct 15, 2018 in Blockchain by digger
• 26,740 points
1,812 views

2 answers to this question.

+2 votes
Best answer

As the warning mentions, add emit as a prefix like this:

emit Transfer(msg.sender, _to, _value);

The emit keyword is used to call the events explicitly. 

answered Oct 16, 2018 by Aisha

selected Oct 16, 2018 by Omkar
+1 vote

Try removing zeppelin-solidity and reinstalling version zeppelin-solidity 1.8.0

npm install --save zeppelin-solidity@1.8.0

This should help

answered Oct 15, 2018 by Omkar
• 69,220 points

Related Questions In Blockchain

+1 vote
1 answer
0 votes
1 answer

Truffle tutorials "Error:recipient address is not a contract address"

It appears like you have already migrated ...READ MORE

answered Aug 8, 2018 in Blockchain by slayer
• 29,370 points
1,155 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,947 views
0 votes
1 answer

Solidity geth: Error encountered during contract execution [Bad instruction]

recipes is a dynamic storage array. You need ...READ MORE

answered Oct 15, 2018 in Blockchain by Omkar
• 69,220 points
1,488 views
0 votes
2 answers

Why is network already up to date while trying to deploy a contract on truffle?

I guess you have ganache running already ...READ MORE

answered Apr 24, 2018 in Blockchain by Shashank
• 10,400 points
4,597 views
0 votes
1 answer

How can I deploy a HelloWorld contract on my testrpc network?

The problem lies in the command: truffle migrate Your truffle migrate command ...READ MORE

answered Apr 27, 2018 in Blockchain by Perry
• 17,100 points

edited Aug 10, 2018 by Omkar 2,890 views
0 votes
2 answers
0 votes
1 answer

Is it possible to claim BCH without knowing private key?

You can't claim BCH without knowing private ...READ MORE

answered Sep 5, 2018 in Blockchain by Christine
• 15,790 points
781 views
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