Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

truffle migrate : sender account not recognized #13

Closed
shuizhongmose opened this issue Sep 19, 2022 · 3 comments
Closed

truffle migrate : sender account not recognized #13

shuizhongmose opened this issue Sep 19, 2022 · 3 comments

Comments

@shuizhongmose
Copy link

shuizhongmose commented Sep 19, 2022

按照部署智能合约方法部署,出现如下错误。
错误1信息如下:

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Error: Expected parameter 'from' not passed to function.
    at has (/usr/local/lib/node_modules/truffle/build/webpack:/packages/expect/dist/src/index.js:10:1)
    at Object.options (/usr/local/lib/node_modules/truffle/build/webpack:/packages/expect/dist/src/index.js:19:1)
    at Object.fork (/usr/local/lib/node_modules/truffle/build/webpack:/packages/environment/environment.js:30:1)
    at module.exports (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/setUpDryRunEnvironmentThenRunMigrations.js:12:1)
    at Object.module.exports [as run] (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/run.js:33:1)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at runCommand (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/command-utils.js:201:1)
Truffle v5.5.30 (core: 5.5.30)
Node v12.22.5

加上from字段后,出现如下错误2:

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.


Migrations dry-run (simulation)
===============================
> Network name:    'development-fork'
> Network id:      42
> Block gas limit: 4294967295 (0xffffffff)


1_initial_migration.js
======================

   Deploying 'Migrations'
   ----------------------
 *** Deployment Failed ***

"Migrations" -- sender account not recognized -- Reason given: Custom error (could not decode)..


Exiting: Review successful transactions manually by checking the transaction hashes above on Etherscan.


Error:  *** Deployment Failed ***

"Migrations" -- sender account not recognized -- Reason given: Custom error (could not decode)..

    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:330:1
    at Migration._deploy (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:68:1)
    at Migration._load (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:54:1)
    at Migration.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:202:1)
    at Object.runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:142:1)
    at Object.runFrom (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:107:1)
    at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:91:1)
    at module.exports (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/runMigrations.js:10:1)
    at module.exports (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/setUpDryRunEnvironmentThenRunMigrations.js:37:1)
    at Object.module.exports [as run] (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/run.js:33:1)
    at runCommand (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/command-utils.js:201:1)
Truffle v5.5.30 (core: 5.5.30)
Node v12.22.5

对应的配置文件如下:

module.exports = {
        networks: {
                development: {
                        url: "ws://10.9.40.7:9944",
                        network_id: "*", // Match any network id
                        from: "0xcee2b721fc2fcbb3c136effec5d555c9f9c97db1",
                        gas: 4294967295, 
                },
        },
}
@lencyforce
Copy link
Member

from字段填的账号,是ganache生成的吗?

@lencyforce
Copy link
Member

这个问题是由于Transaction在代码里没有签名,发送到测试用的Ganache节点,由节点选择一个账号来签,如果节点上没有能用的账号,就会报这个错误

@mh739025250
Copy link
Member

这个问题已经在 #18 中修复了。参考新的文档,使用v0.8.2版本可以正常在delta-chain上部署智能合约。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants