harmony-one / sdk

Javascript SDK of Harmony protocol.
MIT License
92 stars 43 forks source link

The truffleprovider version needs to be updated #28

Open vikramIde opened 4 years ago

vikramIde commented 4 years ago

Hi Guys,

I had tried to compile one of the Ethereum smartcontract basically a NFT token standard, but it said the truffle version needs to updated to the latest.

the standard i was testing is ERC721Full

Thanks

gupadhyaya commented 4 years ago

@vikramIde need more information. can you copy paste the error you are getting and output of truffle version?

vikramIde commented 4 years ago

@gupadhyaya Sure


vikrams-mbp:soccerplayers vikrambhushan$ truffle migrate --reset --network testnet

Compiling your contracts...
===========================
> Compiling ./contracts/ViperToken.sol

/Users/vikrambhushan/Documents/Harmony/soccerplayers/contracts/ViperToken.sol:3:1: ParserError: Source file requires different compiler version (current compiler is 0.5.16+commit.9c3226ce.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity 0.5.3;
^--------------------^

Error: Truffle is currently using solc 0.5.16, but one or more of your contracts specify "pragma solidity 0.5.3".
Please update your truffle config or pragma statement(s).
(See https://truffleframework.com/docs/truffle/reference/configuration#compiler-configuration for information on
configuring Truffle to use a specific solc compiler version.)

Compilation failed. See above.
Truffle v5.1.31 (core: 5.1.31)
Node v13.13.0```

Let me know if this helps
gupadhyaya commented 4 years ago

@vikramIde try changing the line to pragma solidity ^0.5.3 , it will allow any higher versions of 0.5.x too compile.

vikramIde commented 4 years ago

@gupadhyaya sure let me try that

neeboo commented 4 years ago

Hi Guys,

I had tried to compile one of the Ethereum smartcontract basically a NFT token standard, but it said the truffle version needs to updated to the latest.

the standard i was testing is ERC721Full

Thanks

Truffle provider is only a bridge connecting harmony to truffle suite. It's not using any solc or compiler, so you should check with your '.sol' file

vikramIde commented 4 years ago

@neeboo and @gupadhyaya

So I tried changing the lines

pragma solidity ^0.5.3;

But now I am getting a different error


Could not find suitable configuration file.
Truffle v5.1.31 (core: 5.1.31)
Node v13.13.0```
gupadhyaya commented 4 years ago

@vikramIde try using Node v10 here is my truffle version

Truffle v5.0.38 (core: 5.0.38)
Solidity v0.5.8 (solc-js)
Node v10.17.0
Web3.js v1.2.1