I've been working with ens via web3.js and ensutils.js but I'm stuck at startAuctionsAndBid function.

If I try :

var sbid = ethRegistrar.shaBid(web3.sha3('name'), eth.accounts[8], web3.toWei(0.01, 'ether'), web3.sha3('my secret phrase'))
ethRegistrar.startAuctionsAndBid(0x12345670159e0506114fee112628a969f587bf4b7bf4a728661705c08fa9ce82, sbid);

I'm getting:

TypeError: 'forEach' is not a function
    at web3.js:1553:13
    at web3.js:694:16
    at map (<native code>)
    at web3.js:693:20
    at web3.js:4059:46
    at web3.js:4130:19
    at apply (<native code>)
    at web3.js:4223:16
    at <anonymous>:1:1

Other functions, like startAuction, newBid, unsealBid work as expected, only startAuctionsAndBid gives me an error.
Any idea why?


The forEach error was fixed by providing an array as first argument. The function is now executed but it fails on contract execution

startAuctionsAndBid expects 2 arguments:

hashes bytes32[]
sealedBid bytes32

How can I construct the elements of the hashes array?
I tried hashes = [web3.sha3('name')], but no luck.


You have need to quote addresses as must be strings. The Javascript VM will not support such large numbers natively.

ethRegistrar.startAuctionsAndBid("0x12345670159e0506114fee112628a969f587bf4b7bf4a728661705c08fa9ce82", sbid);
  • hi there, it's quoted, hashes = [web3.sha3('name')] - ["0x12345db9720459d9b81668541cd4d26e42a037017ab1b813996a0d03926bf68"] Feb 4 '18 at 13:57

There might be two issues in your code,

  1. startAuctionsAndBid() is not return any value/non array value. Check once.

  2. startAuctionsAndBid(0x12345670159e0506114fee112628a969f587bf4b7bf4a728661705c08fa9ce82, sbid); Javascipt will convert 1st argument to equivalent integer. Js may not not hold that much of integer. So please add single or double quotes.

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.