Learning Truffle

@dan-i
You’re confusing me with the wrong person. Don’t worry about it, I’ll figure it out.

Thank you for your help!!

1 Like

Hey @Zaqoy true I confused you with AX07 :joy: However I sent you a link to an FAQ to fix your problem, you just have to change the compiler version Truffle is using: FAQ - How do change truffle version

Hi Guys,

I’m testing eh Multisig wallet on truffle but I cannot hget it to migrate :slight_smile:

this is the error

Error: *** Deployment Failed ***

“Wallet” – Invalid number of parameters for “undefined”. Got 0 expected 2!.

my migration file looks like this :

const Wallet = artifacts.require("Wallet");

module.exports = function (deployer) {
  deployer.deploy(Wallet);
};

So not sure what’s happening …

1 Like

Hi guys, I’m having problems with the truffle assignment where we have to deploy the multisig wallet code.
It migrates successfully, but then when I type

let instance = await Wallet.deployed()

I get this error:

Error: Wallet has not been deployed to detected network (network/artifact mismatch)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Function.deployed (/usr/local/lib/node_modules/truffle/build/webpack:/packages/contract/lib/contract/constructorMethods.js:83:1)
    at Object.checkNetworkArtifactMatch (/usr/local/lib/node_modules/truffle/build/webpack:/packages/contract/lib/utils/index.js:245:1)

Could anyone help me out with this? I don’t understand what went wrong. Thank you!

1 Like

Hey @DavidV, @santiago, hope you guys are ok.

Does your multisig wallet contract contains a constructor? Would you please share the code?

@santiago are you trying to deploy into the truffle console? or through migrations? :face_with_monocle:

Carlos Z

HI Thecil,

The wallet is the contract that come from Fillip. So I’m not sure if that should be an issue. I’m also on a M1 Apple MacBook Air.

Here it is below :

pragma solidity 0.7.5;
pragma abicoder v2;

contract Wallet {
    address[] public owners;
    uint limit;
    
    struct Transfer{
        uint amount;
        address payable receiver;
        uint approvals;
        bool hasBeenSent;
        uint id;
    }
    
    event TransferRequestCreated(uint _id, uint _amount, address _initiator, address _receiver);
    event ApprovalReceived(uint _id, uint _approvals, address _approver);
    event TransferApproved(uint _id);

    Transfer[] transferRequests;
    
    mapping(address => mapping(uint => bool)) approvals;
    
    //Should only allow people in the owners list to continue the execution.
    modifier onlyOwners(){
        bool owner = false;
        for(uint i=0; i<owners.length;i++){
            if(owners[i] == msg.sender){
                owner = true;
            }
        }
        require(owner == true);
        _;
    }
    //Should initialize the owners list and the limit 
    constructor(address[] memory _owners, uint _limit) {
        owners = _owners;
        limit = _limit;
    }
    
    //Empty function
    function deposit() public payable {}
    
    //Create an instance of the Transfer struct and add it to the transferRequests array
    function createTransfer(uint _amount, address payable _receiver) public onlyOwners {
        emit TransferRequestCreated(transferRequests.length, _amount, msg.sender, _receiver);
        transferRequests.push(
            Transfer(_amount, _receiver, 0, false, transferRequests.length)
        );
        
    }
    
    //Set your approval for one of the transfer requests.
    //Need to update the Transfer object.
    //Need to update the mapping to record the approval for the msg.sender.
    //When the amount of approvals for a transfer has reached the limit, this function should send the transfer to the recipient.
    //An owner should not be able to vote twice.
    //An owner should not be able to vote on a tranfer request that has already been sent.
    function approve(uint _id) public onlyOwners {
        require(approvals[msg.sender][_id] == false);
        require(transferRequests[_id].hasBeenSent == false);
        
        approvals[msg.sender][_id] = true;
        transferRequests[_id].approvals++;
        
        emit ApprovalReceived(_id, transferRequests[_id].approvals, msg.sender);
        
        if(transferRequests[_id].approvals >= limit){
            transferRequests[_id].hasBeenSent = true;
            transferRequests[_id].receiver.transfer(transferRequests[_id].amount);
            emit TransferApproved(_id);
        }
    }
    
    //Should return all transfer requests
    function getTransferRequests() public view returns (Transfer[] memory){
        return transferRequests;
    }
    
    
}
1 Like

Hi @thecil,
I don’t understand the question. I use truffle develop and then I type in the commands
migrate
and
let instance = await Wallet.deployed()
in the same way Filip does in the instructional video. Everything worked fine when I was following the video trying it on my own. Only now with the multisig wallet assignment I’m getting this error. Not sure if I’m missing something. I also use the same wallet code from Filip’s Github. Thanks for helping!

Santiago

2 Likes

This one happens because your contract have a constructor which require some parameters to initialize properly, Invalid number of parameters for “undefined”. Got 0 expected 2!.

So your migration file should looks like this one, which sent the correct parameters to the constructor and then the contract is inizialited.

const Wallet = artifacts.require("Wallet");

module.exports = function(deployer, network, accounts) {
    // [multisig constructor] 
    // Should initialize the owners list and the limit 
    // constructor(address[] memory _owners, uint _limit) {
    //     owners = _owners;
    //     limit = _limit;
    // }
    const accountArray = [accounts[0], accounts[1], accounts[2]] 

    deployer.deploy(
      Wallet,
      accountArray, // this is _owners Array
      2 // this is _limit
    );
};

Carlos Z

2 Likes

@santiago, check the post above this one, when you migrate your contract should contain a migration file which is going to deploy the contract when the migrate command is invoked.

while deployed() is used once the contract has been deployed from its migration file (so if none exist, the contract has not been deployed)

Carlos Z

2 Likes

Thank you @thecil! It worked. Isn’t a lot of people going to have this problem? Because the link for the assignment sends to Filip’s github code, which includes the constructor. But in the instructional video Filip doesn’t say anything about the need to construct the migrations file differently if you have a constructor in the contract. Just wondering.

1 Like

Not that many students, but time to time they come here with a similar question :slight_smile:

Probably filip just forgot to mentioned it, there are so many steps that might be that he just forget to mention it :nerd_face:

Carlos Z

2 Likes

i am having that problem too. i tryed looking it on google but couldnt find anything…
I have now copied the code on the migrations file and tried to migrate on the terminal but i still get the error. I think its because the constructor isnt defined??`Deploying ‘Wallet’

Error: *** Deployment Failed ***

“Wallet” – Invalid number of parameters for “undefined”. Got 0 expected 2!.

at C:\Users\alexp\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\deployer\src\deployment.js:365:1
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at Migration._deploy (C:\Users\alexp\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:75:1)
at Migration._load (C:\Users\alexp\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:61:1)
at Migration.run (C:\Users\alexp\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:218:1)
at Object.runMigrations (C:\Users\alexp\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:150:1)
at Object.runFrom (C:\Users\alexp\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:110:1)

`

Probably, console said “Wallet” – Invalid number of parameters for “undefined”. Got 0 expected 2!. :nerd_face:

Carlos Z

Hello everyone,

I’ve been having some issues with installing truffle. I’ve tried the following methods.

  • Uninstall Truffle
  • Reinstall Truffle
  • Uninstall Truffle
  • Reinstall --force
  • sudo (which was not recognized as an internal or external command.)

Help would be much appreciated. Thanks.

Microsoft Windows [Version 10.0.19043.1110]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Lili>npm install -g truffle
npm WARN deprecated [email protected]: This package has been deprecated and now it only exports makeExecutableSchema.\nWe recommend you to migrate to scoped packages.\nCheck out https://www.graphql-tools.com for more information
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: stable api reached
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: This package has been deprecated and now it only exports makeExecutableSchema.\nWe recommend you to migrate to scoped packages.\nCheck out https://www.graphql-tools.com for more information
npm WARN deprecated [email protected]: The functionality provided by the `apollo-cache-control` package is built in to `apollo-server-core` starting with Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#cachecontrol for details.
npm WARN deprecated [email protected]: The `apollo-tracing` package is no longer part of Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#tracing for details
npm WARN deprecated [email protected]: The `graphql-extensions` API has been removed from Apollo Server 3. Use the plugin API instead: https://www.apollographql.com/docs/apollo-server/integrations/plugins/
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Package moved to @redux-devtools/instrument.
npm WARN deprecated [email protected]: Package moved to @redux-devtools/app.
npm WARN deprecated [email protected]: Package moved to @redux-devtools/serialize.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: "Please update to latest v2.3 or v2.2"
C:\Users\Lili\AppData\Roaming\npm\truffle -> C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js

> [email protected] install C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (C:\Users\Lili\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack     at PythonFinder.runChecks (C:\Users\Lili\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\Lili\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack     at PythonFinder.execFileCallback (C:\Users\Lili\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack     at exithandler (child_process.js:326:5)
gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:338:5)
gyp ERR! stack     at ChildProcess.emit (events.js:375:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! stack     at onErrorNT (internal/child_process.js:467:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:82:21)
gyp ERR! System Windows_NT 10.0.19043
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Lili\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\Lili\\AppData\\Roaming\\npm\\node_modules\\truffle\\node_modules\\sqlite3\\lib\\binding\\node-v83-win32-x64\\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\\Users\\Lili\\AppData\\Roaming\\npm\\node_modules\\truffle\\node_modules\\sqlite3\\lib\\binding\\node-v83-win32-x64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\sqlite3
gyp ERR! node -v v14.17.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Lili\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\sqlite3\lib\binding\node-v83-win32-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:375:28)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1055:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Windows_NT 10.0.19043
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Lili\\AppData\\Roaming\\npm\\node_modules\\truffle\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\sqlite3
node-pre-gyp ERR! node -v v14.17.3
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Lili\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\sqlite3\lib\binding\node-v83-win32-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)

> [email protected] postinstall C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle
> node ./scripts/postinstall.js

- Fetching solc version list from solc-bin. Attempt #1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @zondax/filecoin-signing-tools@github:Digital-MOB-Filecoin/filecoin-signing-tools-js (node_modules\truffle\node_modules\filecoin.js\node_modules\@zondax\filecoin-signing-tools):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: Error while executing:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: undefined ls-remote -h -t ssh://[email protected]/Digital-MOB-Filecoin/filecoin-signing-tools-js.git
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: spawn git ENOENT
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules\truffle\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\truffle\node_modules\sqlite3):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-pre-gyp install --fallback-to-build`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ [email protected]
added 8 packages from 11 contributors and updated 1 package in 686.217s

C:\Users\Lili>npm uninstall -g truffle
npm WARN deprecated [email protected]: This package has been deprecated and now it only exports makeExecutableSchema.\nWe recommend you to migrate to scoped packages.\nCheck out https://www.graphql-tools.com for more information
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: stable api reached
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: This package has been deprecated and now it only exports makeExecutableSchema.\nWe recommend you to migrate to scoped packages.\nCheck out https://www.graphql-tools.com for more information
npm WARN deprecated [email protected]: The functionality provided by the `apollo-cache-control` package is built in to `apollo-server-core` starting with Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#cachecontrol for details.
npm WARN deprecated [email protected]: The `graphql-extensions` API has been removed from Apollo Server 3. Use the plugin API instead: https://www.apollographql.com/docs/apollo-server/integrations/plugins/
npm WARN deprecated [email protected]: The `apollo-tracing` package is no longer part of Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#tracing for details
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated [email protected]: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @zondax/filecoin-signing-tools@github:Digital-MOB-Filecoin/filecoin-signing-tools-js (node_modules\filecoin.js\node_modules\@zondax\filecoin-signing-tools):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: Error while executing:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: undefined ls-remote -h -t ssh://[email protected]/Digital-MOB-Filecoin/filecoin-signing-tools-js.git
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: spawn git ENOENT
npm WARN @graphql-tools/[email protected] requires a peer of graphql@^14.0.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @graphql-tools/[email protected] requires a peer of graphql@^14.0.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @graphql-tools/[email protected] requires a peer of graphql@^14.0.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself.

removed 1688 packages and moved 35 packages in 616.605s

how do i define it??
isnt it already defined?
I have the same code you put…

const Wallet = artifacts.require("Wallet");

module.exports = function(deployer, network, accounts) {
    // [multisig constructor] 
    // Should initialize the owners list and the limit 
    // constructor(address[] memory _owners, uint _limit) {
    //     owners = _owners;
    //     limit = _limit;
    // }
    const accountArray = [accounts[0], accounts[1], accounts[2]] 

    deployer.deploy(
      Wallet,
      accountArray, // this is _owners Array
      2 // this is _limit
    );
};

From your logs I can see that one error is You need to install the latest version of Python.
So let’s install it.
Go here and install Python: https://www.python.org/downloads/windows/

Then run again the truffle installation command. Sudo is a command for bash terminal, you are in windows therefore you should open the prompt as administrator (right click on it).
Then npm i -g truffle

Please share your code in the following way so we can review it :face_with_monocle:

Carlos Z

2 Likes

got it, it was just that i didnt save the code you gave me, so obviously the constructor wasnt defined.

Hi again, I am doing the ERC20 coding and when i compile i get this error witch says that the import statement for the openzeppelin is not found but i have it on the folder and i dont know what is the problem. could you help me out??

Compiling your contracts...
===========================
> Compiling .\contracts\Migrations.sol
> Compiling .\contracts\NewToken.sol

/C/Users/alexp/Desktop/alex/truffel/ERC20 token/contracts/NewToken.sol:1:1: ParserError: Source file requires different compiler version (current compiler is 0.5.16+commit.9c3226ce.Emscripten.clang - note tha
t nightly builds are considered to be strictly less than the released version
pragma solidity ^0.8.0;
^---------------------^

Error: Truffle is currently using solc 0.5.16, but one or more of your contracts specify "pragma solidity ^0.8.0".

Please update your truffle config or pragma statement(s).
(See https://trufflesuite.com/docs/truffle/reference/configuration#compiler-configuration for information on
configuring Truffle to use a specific solc compiler version.)

Compilation failed. See above.

truffle(develop)> compile

Compiling your contracts...
===========================
ifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> /C/Users/alexp/Desktop/alex/truffel/ERC20 token/contracts/NewToken.sol


ParserError: Source "/C/Users/alexp/Desktop/alex/truffel/ERC20 token/node_modules/@OpenZeppelin/contras/token/ERC20/ERC20.sol" not found
 --> /C/Users/alexp/Desktop/alex/truffel/ERC20 token/contracts/NewToken.sol:3:1:
  |
3 | import "../node_modules/@OpenZeppelin/contras/token/ERC20/ERC20.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Compilation failed. See above.
- Fetching solc version list from solc-bin. Attempt #1
- Fetching solc version list from solc-bin. Attempt #1

Here it is in the folder, hope you can see the folder path in the pic.
image