我正在尝试在操作系统macOS上建立区块链,当我尝试执行“松露迁移”或“松露测试”命令时,我会收到错误消息。
我尝试更改网络ID /主机/端口,但无济于事。
Compiling your contracts...
===========================
> Compiling ./contracts/CorderCurrency.sol
> Compiling ./contracts/Migrations.sol
> compilation warnings encountered:
/Users/name/token_sale/contracts/CorderCurrency.sol:9:2: Warning: This declaration shadows an existing declaration.
function CorderCurrency () public {
^ (Relevant source part starts here and spans across multiple lines).
/Users/hanschristianmidelfart/token_sale/contracts/CorderCurrency.sol:3:1: The shadowed declaration is here:
contract CorderCurrency {
^ (Relevant source part starts here and spans across multiple lines).
Error: CompileError: /Users/name/token_sale/contracts/CorderCurrency.sol:9:2: 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 CorderCurrency () public {
^ (Relevant source part starts here and spans across multiple lines).
Compilation failed. See above.
at Object.compile (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-workflow-compile/legacy/index.js:72:1)
Truffle v5.0.32 (core: 5.0.32)
Node v10.16.3```