0

I have assigned my variables here

> var contractAddress = 0xb5A5F22694352C15B00323844aD545ABb2B11028

> var cont = new web3.eth.Contract(abi, contractAddress)

I am getting the error :

Error: Provided address "1.2870172725867908e+48" is invalid, the capitalization checksum test failed, or its an indrect IBAN address which can't be converted. at Object.inputAddressFormatter (/Users/tycooperaow/node_modules/web3/node_modules/web3-core-helpers/src/formatters.js:409:11) at Object.set [as address] (/Users/tycooperaow/node_modules/web3/node_modules/web3-eth-contract/src/index.js:92:69) at Contract (/Users/tycooperaow/node_modules/web3/node_modules/web3-eth-contract/src/index.js:217:26) at new Contract (/Users/tycooperaow/node_modules/web3/node_modules/web3-eth/src/index.js:149:22)

This is the variable I used to assign the abi

var abi = [ { constant: false,
    inputs: [ [Object], [Object] ],
    name: 'approve',
    outputs: [ [Object] ],
    payable: false,
    type: 'function' },
  { constant: true,
    inputs: [],
    name: 'totalSupply',
    outputs: [ [Object] ],
    payable: false,
    type: 'function' },
  { constant: false,
    inputs: [ [Object], [Object], [Object] ],
    name: 'transferFrom',
    outputs: [ [Object] ],
    payable: false,
    type: 'function' },
  { constant: false,
    inputs: [],
    name: 'enableTokenTransfer',
    outputs: [],
    payable: false,
    type: 'function' },
  { constant: false,
    inputs: [ [Object], [Object] ],
    name: 'unlockAddress',
    outputs: [],
    payable: false,
    type: 'function' },
  { constant: true,
    inputs: [],
    name: 'walletAddress',
    outputs: [ [Object] ],
    payable: false,
    type: 'function' },
  { constant: true,
    inputs: [],
    name: 'tokenTransfer',
    outputs: [ [Object] ],
    payable: false,
    type: 'function' },
  { constant: false,
    inputs: [ [Object] ],
    name: 'burnTokens',
    outputs: [],
    payable: false,
    type: 'function' },
  { constant: true,
    inputs: [ [Object] ],
    name: 'balanceOf',
    outputs: [ [Object] ],
    payable: false,
    type: 'function' },
  { constant: true,
    inputs: [],
    name: 'owner',
    outputs: [ [Object] ],
    payable: false,
    type: 'function' },
  { constant: false,
    inputs: [ [Object], [Object] ],
    name: 'transfer',
    outputs: [ [Object] ],
    payable: false,
    type: 'function' },
  { constant: true,
    inputs: [ [Object] ],
    name: 'lockaddress',
    outputs: [ [Object] ],
    payable: false,
    type: 'function' },
  { constant: true,
    inputs: [],
    name: 'creationTime',
    outputs: [ [Object] ],
    payable: false,
    type: 'function' },
  { constant: true,
    inputs: [ [Object], [Object] ],
    name: 'allowance',
    outputs: [ [Object] ],
    payable: false,
    type: 'function' },
  { constant: false,
    inputs: [],
    name: 'disableTokenTransfer',
    outputs: [],
    payable: false,
    type: 'function' },
  { constant: true,
    inputs: [ [Object] ],
    name: 'unlockaddress',
    outputs: [ [Object] ],
    payable: false,
    type: 'function' },
  { constant: false,
    inputs: [ [Object], [Object] ],
    name: 'lockAddress',
    outputs: [],
    payable: false,
    type: 'function' },
  { constant: true,
    inputs: [],
    name: 'lock',
    outputs: [ [Object] ],
    payable: false,
    type: 'function' },
  { inputs: [ [Object], [Object] ],
    payable: false,
    type: 'constructor' },
  { anonymous: false,
    inputs: [ [Object], [Object] ],
    name: 'TokenBurned',
    type: 'event' },
  { anonymous: false,
    inputs: [],
    name: 'TokenTransfer',
    type: 'event' },
  { anonymous: false,
    inputs: [ [Object], [Object] ],
    name: 'Locked',
    type: 'event' },
  { anonymous: false,
    inputs: [ [Object], [Object] ],
    name: 'Unlocked',
    type: 'event' },
  { anonymous: false,
    inputs: [ [Object], [Object], [Object] ],
    name: 'Transfer',
    type: 'event' },
  { anonymous: false,
    inputs: [ [Object], [Object], [Object] ],
    name: 'Approval',
    type: 'event' } ]
1

Contract address should be a string (use the quotes)

var contractAddress = '0xb5A5F22694352C15B00323844aD545ABb2B11028'

Hope this helps

  • In addition to that, the value of 0xb5A5F22694352C15B00323844aD545ABb2B11028 is larger than Javascript's Number.MAX_SAFE_INTEGER. So even if it was allowed to pass a web3.BigNumber here, the user would still need to encapsulate this value with quotes (or double-quotes). – goodvibration Nov 4 '18 at 10:24

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.