mjhm / create-react-dapp

Create React Ethereum dApps with no configuration.
MIT License
108 stars 19 forks source link

Issue with Migrations #9

Open saraolive opened 5 years ago

saraolive commented 5 years ago

Hello,

I'm getting the following issues when running migrate:

`> cd dapp && truffle migrate --reset --compile-all

Compiling ./contracts/Migrations.sol... Compiling ./contracts/Voting.sol... Compiling ./lib/mortal.sol... Compiling ./lib/owned.sol...

Compilation warnings encountered:

/Users/saraczyzewicz/Dev/slothio/dapp/lib/owned.sol:12:5: Warning: This declaration shadows an existing declaration. function owned() public { ^ (Relevant source part starts here and spans across multiple lines). /Users/saraczyzewicz/Dev/slothio/dapp/lib/owned.sol:3:1: The shadowed declaration is here: contract owned { ^ (Relevant source part starts here and spans across multiple lines).

,/Users/saraczyzewicz/Dev/slothio/dapp/contracts/Migrations.sol:13:3: Warning: This declaration shadows an existing declaration. function Migrations() public { ^ (Relevant source part starts here and spans across multiple lines). /Users/saraczyzewicz/Dev/slothio/dapp/contracts/Migrations.sol:5:1: The shadowed declaration is here: contract Migrations is mortal { ^ (Relevant source part starts here and spans across multiple lines).

,/Users/saraczyzewicz/Dev/slothio/dapp/contracts/Voting.sol:11:3: Warning: This declaration shadows an existing declaration. function Voting(bytes32[] candidateNames) public { ^ (Relevant source part starts here and spans across multiple lines). /Users/saraczyzewicz/Dev/slothio/dapp/contracts/Voting.sol:6:1: The shadowed declaration is here: contract Voting is mortal { ^ (Relevant source part starts here and spans across multiple lines).

/Users/saraczyzewicz/Dev/slothio/dapp/lib/owned.sol:1:1: SyntaxError: Source file requires different compiler version (current compiler is 0.5.0+commit.1d4f565a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version pragma solidity ^0.4.17; ^----------------------^ ,/Users/saraczyzewicz/Dev/slothio/dapp/lib/owned.sol:12:5: SyntaxError: Functions are not allowed to have the same name as the contract. If you intend this to be a constructor, use "constructor(...) { ... }" to define it. function owned() public { ^ (Relevant source part starts here and spans across multiple lines). ,/Users/saraczyzewicz/Dev/slothio/dapp/lib/mortal.sol:1:1: SyntaxError: Source file requires different compiler version (current compiler is 0.5.0+commit.1d4f565a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version pragma solidity ^0.4.17; ^----------------------^ ,/Users/saraczyzewicz/Dev/slothio/dapp/contracts/Migrations.sol:1:1: SyntaxError: Source file requires different compiler version (current compiler is 0.5.0+commit.1d4f565a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version pragma solidity ^0.4.17; ^----------------------^ ,/Users/saraczyzewicz/Dev/slothio/dapp/contracts/Migrations.sol:13:3: SyntaxError: Functions are not allowed to have the same name as the contract. If you intend this to be a constructor, use "constructor(...) { ... }" to define it. function Migrations() public { ^ (Relevant source part starts here and spans across multiple lines). ,/Users/saraczyzewicz/Dev/slothio/dapp/contracts/Voting.sol:1:1: SyntaxError: Source file requires different compiler version (current compiler is 0.5.0+commit.1d4f565a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version pragma solidity ^0.4.11; ^----------------------^ ,/Users/saraczyzewicz/Dev/slothio/dapp/contracts/Voting.sol:11:3: SyntaxError: Functions are not allowed to have the same name as the contract. If you intend this to be a constructor, use "constructor(...) { ... }" to define it. function Voting(bytes32[] candidateNames) public { ^ (Relevant source part starts here and spans across multiple lines). ,/Users/saraczyzewicz/Dev/slothio/dapp/lib/owned.sol:12:5: Warning: This declaration shadows an existing declaration. function owned() public { ^ (Relevant source part starts here and spans across multiple lines). /Users/saraczyzewicz/Dev/slothio/dapp/lib/owned.sol:3:1: The shadowed declaration is here: contract owned { ^ (Relevant source part starts here and spans across multiple lines).

,/Users/saraczyzewicz/Dev/slothio/dapp/contracts/Migrations.sol:13:3: Warning: This declaration shadows an existing declaration. function Migrations() public { ^ (Relevant source part starts here and spans across multiple lines). /Users/saraczyzewicz/Dev/slothio/dapp/contracts/Migrations.sol:5:1: The shadowed declaration is here: contract Migrations is mortal { ^ (Relevant source part starts here and spans across multiple lines).

,/Users/saraczyzewicz/Dev/slothio/dapp/contracts/Voting.sol:11:3: Warning: This declaration shadows an existing declaration. function Voting(bytes32[] candidateNames) public { ^ (Relevant source part starts here and spans across multiple lines). /Users/saraczyzewicz/Dev/slothio/dapp/contracts/Voting.sol:6:1: The shadowed declaration is here: contract Voting is mortal { ^ (Relevant source part starts here and spans across multiple lines).

,/Users/saraczyzewicz/Dev/slothio/dapp/contracts/Migrations.sol:22:5: TypeError: Name has to refer to a struct, enum or contract. Migrations upgraded = Migrations(new_address); ^--------^ Compilation failed. See above. Truffle v5.0.2 (core: 5.0.2) Node v11.6.0 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ migrate: cd dapp && truffle migrate --reset --compile-all npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ migrate script. npm ERR! This is probably not a problem with npm. There is likely additional log`


And the localhost page denotes 'Unhandled Rejection (Error): Couldn't find info file "contract-info/Voting.json". Perhaps you haven't run migrations for contract "Voting" yet, or the migrations aren't calling the "deployInfo" function.'

Please advise - thank you!