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
• 27,620 points
50 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
• 67,120 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,050 points
176 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
105 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
• 67,120 points
54 views
0 votes
2 answers
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,010 points

edited Aug 10, 2018 by Omkar 407 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
49 views