ConsenSysMesh / Stow-Smart-Contracts

Formerly Linnia-Smart-Contracts
https://stow-protocol.com/
MIT License
56 stars 39 forks source link

Linnia*.sol: Invoking events without "emit" prefix is deprecated #20

Closed lookfwd closed 6 years ago

lookfwd commented 6 years ago

In the latest truffle (v4.1.5) // MacOS 10.13 , node v8.9.1

$ truffle compile
Compiling ./contracts/LinniaHub.sol...
Compiling ./contracts/LinniaPermissions.sol...
Compiling ./contracts/LinniaRecords.sol...
Compiling ./contracts/LinniaRoles.sol...
Compiling node_modules/zeppelin-solidity/contracts/math/SafeMath.sol...
Compiling node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol...

Compilation warnings encountered:

node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol:38:5: Warning: Invoking events without "emit" prefix is deprecated.
    OwnershipTransferred(owner, newOwner);
    ^-----------------------------------^
,Linnia-Smart-Contracts/contracts/LinniaRoles.sol:44:9: Warning: Invoking events without "emit" prefix is deprecated.
        LogPatientRegistered(msg.sender);
        ^------------------------------^
,Linnia-Smart-Contracts/contracts/LinniaRoles.sol:56:9: Warning: Invoking events without "emit" prefix is deprecated.
        LogProviderRegistered(user);
        ^-------------------------^
,Linnia-Smart-Contracts/contracts/LinniaRoles.sol:67:9: Warning: Invoking events without "emit" prefix is deprecated.
        LogProviderRemoved(user);
        ^----------------------^
,Linnia-Smart-Contracts/contracts/LinniaRecords.sol:183:9: Warning: Invoking events without "emit" prefix is deprecated.
        LogRecordAdded(fileHash, patient);
        ^-------------------------------^
,Linnia-Smart-Contracts/contracts/LinniaRecords.sol:205:9: Warning: Invoking events without "emit" prefix is deprecated.
        LogRecordSigAdded(fileHash, provider, record.irisScore);
        ^-----------------------------------------------------^
,Linnia-Smart-Contracts/contracts/LinniaPermissions.sol:57:9: Warning: Invoking events without "emit" prefix is deprecated.
        LogAccessGranted(msg.sender, viewer, fileHash);
        ^--------------------------------------------^
,Linnia-Smart-Contracts/contracts/LinniaPermissions.sol:77:9: Warning: Invoking events without "emit" prefix is deprecated.
        LogAccessRevoked(msg.sender, viewer, fileHash);
        ^--------------------------------------------^
,Linnia-Smart-Contracts/contracts/LinniaHub.sol:29:9: Warning: Invoking events without "emit" prefix is deprecated.
        LogRolesContractSet(prev, _rolesContract);
        ^---------------------------------------^
,Linnia-Smart-Contracts/contracts/LinniaHub.sol:40:9: Warning: Invoking events without "emit" prefix is deprecated.
        LogRecordsContractSet(prev, _recordsContract);
        ^-------------------------------------------^
,Linnia-Smart-Contracts/contracts/LinniaHub.sol:51:9: Warning: Invoking events without "emit" prefix is deprecated.
        LogPermissionsContractSet(prev, _permissionsContract);
        ^---------------------------------------------------^
libertylocked commented 6 years ago

emit is a keyword introduced in solidity 0.4.21. The contracts have only been tested with solc 0.4.19. I think eventually we would upgrade, but for now it has to work with other tools (like solidity-coverage and solium).

Please avoid using the global truffle. Use the installed truffle with npx truffle.

I just noticed that it says run truffle migrate in README. We should probably change that.

tomachinz commented 6 years ago

erm.... this is not a good developer first experience. did sol compiler just make a breaking change? not sure my next steps. how does one add an "emit" prefix then?

OwnershipTransferred(owner, newOwner, emit); /* ?????? */

lookfwd commented 6 years ago

emit OwnershipTransferred(owner, newOwner); (see https://github.com/ConsenSys/Linnia-Smart-Contracts/pull/19)

but not big deal - it's backwards compatible - just ignore the warning. Note that solidity is constant work in progress... :) i.e. things always change.