ConsenSysMesh / ConsenSysMesh/mcit-training-poe

Warnings when compile using truffle

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Thank you for this amazing repo. Please find details about the warnings when executing truffle compile.

Truffle version: Truffle v4.1.7 (core: 4.1.7)
Solidity version: Solidity v0.4.23 (solc-js)
Current behavior: Showing some warning.
Expected behavior: Compiling without warnings.
Steps to reproduce: execute "truffle compile".

**The error lines:**

```
(master) % truffle compile
Compiling ./contracts/Migrations.sol...
Compiling ./contracts/Proof.sol...

Compilation warnings encountered:

./mcit-training-poe/contracts/Migrations.sol:11:3: Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
function Migrations() public {
^ (Relevant source part starts here and spans across multiple lines).
,./mcit-training-poe/contracts/Proof.sol:19:13: Warning: Invoking events without "emit" prefix is deprecated.
logFileAddedStatus(true, block.timestamp, owner, fileHash);
^--------------------------------------------------------^
,./mcit-training-poe/contracts/Proof.sol:23:13: Warning: Invoking events without "emit" prefix is deprecated.
logFileAddedStatus(false, block.timestamp, owner, fileHash);
^---------------------------------------------------------^
,./mcit-training-poe/contracts/Proof.sol:14:5: Warning: No visibility specified. Defaulting to "public".
function set(string owner, string fileHash)
^ (Relevant source part starts here and spans across multiple lines).
,./mcit-training-poe/contracts/Proof.sol:27:5: Warning: No visibility specified. Defaulting to "public".
function get(string fileHash) returns (uint timestamp, string owner)
^ (Relevant source part starts here and spans across multiple lines).
,./mcit-training-poe/contracts/Proof.sol:27:5: Warning: Function state mutability can be restricted to view
function get(string fileHash) returns (uint timestamp, string owner)
^ (Relevant source part starts here and spans across multiple lines).

Writing artifacts to ./build/contracts
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with contracts/Migrations.sol and contracts/Proof.sol, then run "truffle compile" using the versions listed in the issue. Address the deprecation, visibility, event, and mutability warnings shown in the compiler output; done means compilation completes without those warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, solidity
Domain
blockchain
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.