انجمن توسعه قرارداد هوشمند

خطا در دپلوی قرارداد

سلام وقتتون بخیر
من در قسمت اشاره شده به ارور ذیل برخورد کردم ممکنه کمکم کنید حلش کنم

Hi I encountered this error in Introduction to Truffle Suite — Part 2 of Chapter 03 when I try to migrate my SimpleStorage contract:

2_deploy_contracts.js

Error: Migration /home/majidclick/SimpleStorage/migrations/2_deploy_contracts.js invalid or does not take any parameters
at Migration._load (/home/majidclick/.nvm/versions/node/v14.17.5/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:50:1)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at Migration.run (/home/majidclick/.nvm/versions/node/v14.17.5/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:217:1)
at Object.runMigrations (/home/majidclick/.nvm/versions/node/v14.17.5/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
at Object.runFrom (/home/majidclick/.nvm/versions/node/v14.17.5/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
at Object.run (/home/majidclick/.nvm/versions/node/v14.17.5/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:87:1)
at runMigrations (/home/majidclick/.nvm/versions/node/v14.17.5/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:258:1)
at Object.run (/home/majidclick/.nvm/versions/node/v14.17.5/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:223:1)
at Command.run (/home/majidclick/.nvm/versions/node/v14.17.5/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:183:1)

I even don’t know what the error is! I think it might be because before I type “migrate” in truffle develop, I by mistake typed “cd SimpleStorage” to creat 2_deploy_contracts.js and then when I again typed migrate in fron of truffle develop I encountered above error …
Also I see vscode says there is 12 problems in SimpleStorage.sol file the first is about version problem:
home/majidclick/SimpleStorage/contracts/SimpleStorage.sol:2:1: SyntaxError: Source file requires different compiler version (current compiler is 0.4.17+commit.bdeb9e52.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity >=0.4.21 <0.7.0;

now what should I do?
Regards

1 Likes

سلام،
اطلاعیه ثبت نام و نحوه شرکت در دوره در مردادماه توسط کوین ایران منتشر شده بود.