0

Can anyone give me a straight answer, (not trained stranded in no man lands) do I just change the words from (functions to Constructor) yellow warnings below.

browser/ballot.sol:77:5: Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
    function Owned() public {
    ^ (Relevant source part starts here and spans across multiple lines).

browser/ballot.sol:118:5: Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
    function ?name?Token() public {
    ^ (Relevant source part starts here and spans across multiple lines).

browser/ballot.sol:91:9: Warning: Invoking events without "emit" prefix is deprecated.
        OwnershipTransferred(owner, newOwner);

        ^-----------------------------------^
browser/ballot.sol:152:9: Warning: Invoking events without "emit" prefix is deprecated.
        Transfer(msg.sender, to, tokens);
        ^------------------------------^
browser/ballot.sol:167:9: Warning: Invoking events without "emit" prefix is deprecated.
        Approval(msg.sender, spender, tokens);
        ^-----------------------------------^
browser/ballot.sol:185:9: Warning: Invoking events without "emit" prefix is deprecated.
        Transfer(from, to, tokens);
        ^------------------------^
browser/ballot.sol:206:9: Warning: Invoking events without "emit" prefix is deprecated.
        Approval(msg.sender, spender, tokens);
        ^-----------------------------------^
browser/ballot.sol:224:9: Warning: Invoking events without "emit" prefix is deprecated.
        Transfer(address(0), msg.sender, tokens);
        ^--------------------------------------^
Achala Dissanayake
  • 5,819
  • 15
  • 28
  • 38
ABonney
  • 25
  • 5
  • Achala, hello, I see that you edit the above warnings, are you stating that I can amend the yellow warnings? If so thank you. Anne, Blocker I will read your post, thank you. – ABonney May 13 '18 at 13:27
  • 1
    All the warnings you have here are deprecated warnings, In short term it may not cause a problem, but in a long run you may need to think about seriously. However it is always good to fix the warnings. Check this quora post as well. – Achala Dissanayake May 13 '18 at 16:12
  • Thank you, I sorted all yellows now I gone up to red!, I am now getting a red Parser Error: Expected token Semicolon got 'LParen' I worked in India since 2005, my IOC includes working in Indian, Nepal, and I hope Sri Lanka. – ABonney May 13 '18 at 16:20
  • so the error is linked to Constructor Owed () public {owner = msg.sender:} – ABonney May 13 '18 at 16:21
  • hi, thank you, it worked I now have another red Parser Error, just seeing if I can work it out, Anne, – ABonney May 13 '18 at 16:49

1 Answers1

3

Change

function Owned() public {
    //....
}

to

constructor() public {
    /...
}

And

Change all

Transfer(msg.sender, to, tokens); to emit Transfer(msg.sender, to, tokens);

and

Approval(msg.sender, spender, tokens); to emit Approval(msg.sender, spender, tokens);

As I mentioned in the comments, all the warnings you have here are deprecated warnings, However it is always good to fix the warnings. So just do the above changes. Check this post for more on warnings.

Achala Dissanayake
  • 5,819
  • 15
  • 28
  • 38
  • Manage to fix red Parsen, have more warnings so giving up for today! Thank you many need help tomorrow! Anne, – ABonney May 13 '18 at 18:03