0

I've been running into an error when I attempt to seed my exchange/contracts on the kovan test network. Any help would be appreciated.

Using network 'kovan'.

Token fetched 0x69e0a4354aa5c2Ba68D4DF44D05f91BaEB3701Ed
Exchange fetched 0x700Be86E624f370202169C4F352db5Bf8464d7E8
{ Error: invalid address (arg="_to", coderType="address", value=undefined)
    at Object.throwError (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-abi/~/ethers/utils/errors.js:68:1)
    at CoderAddress.encode (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-abi/~/ethers/utils/abi-coder.js:467:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-abi/~/ethers/utils/abi-coder.js:605:21
    at Array.forEach (<anonymous>)
    at pack (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-abi/~/ethers/utils/abi-coder.js:604:1)
    at CoderTuple.encode (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-abi/~/ethers/utils/abi-coder.js:764:1)
    at AbiCoder.encode (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-abi/~/ethers/utils/abi-coder.js:897:1)
    at ABICoder.encodeParameters (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-abi/src/index.js:96:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-contract/src/index.js:426:1
    at Array.map (<anonymous>)
    at Object._encodeMethodABI (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-contract/src/index.js:425:10)
    at constructor.detectNetwork.then.network (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/lib/execute.js:170:1)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:118:7)
  reason: 'invalid address',
  code: 'INVALID_ARGUMENT',
  arg: '_to',
  coderType: 'address',
  value: undefined }```
| improve this question | | | | |
  • did you get this fixed? I'm having the same problem. – Chris McCluskey Apr 6 at 10:04
1

I had the same issue and found that by using console.log(accounts) in seed-exhcange.js only one account was making it to this point.

So I checked truffle-config.js with some console.log() throughout.

I found that I had put a space after the comma between my PRIVATE_KEYS in the .env file.

After removing that space everything worked great.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.