Skip to Content
Courses

Add Contracts

View the Full Course Now 

Remove the existing SimpleStorage Smart Contract but leave the ā€œMigrations.solā€ file:

ethereum-blockchain-developer-image

Add in our Files:

ethereum-blockchain-developer-image

Then modify the ā€œmigrationā€ file in the migrations/ folder:

var ItemManager = artifacts.require("./ItemManager.sol"); module.exports = function(deployer) { deployer.deploy(ItemManager); };

Modify the truffle-config.js file to lock in a specific compiler version:

const path = require("path"); module.exports = { // See <http://truffleframework.com/docs/advanced/configuration> // to customize your Truffle configuration! contracts_build_directory: path.join(__dirname, "client/src/contracts"), networks: { develop: { port: 8545 } }, compilers: { solc: { version: "^0.6.0" } } };
Compiler Versions

You can choose the version to be an exact version like ā€œ0.6.4ā€, or you could add the ā€^ā€ to specify all versions above greater or equal to 0.6.0, which means, it will download the latest 0.6.x version.

Run the truffle develop console to check if everything is alright and can be migrated. On the terminal/powershell run

truffle develop

and then simply type in

migrate

ethereum-blockchain-developer-image

Last updated on