Skip to content

Instantly share code, notes, and snippets.

@AlecAivazis
Created March 7, 2019 10:21
Show Gist options
  • Save AlecAivazis/f361c255b59408c3fb73893b9a400a28 to your computer and use it in GitHub Desktop.
Save AlecAivazis/f361c255b59408c3fb73893b9a400a28 to your computer and use it in GitHub Desktop.
// create a reference to the hub contract we created earlier
const hub = new web3.eth.Contract(HubABI, 'hub address from earlier')
// build the list of auctions
const auctions = []
for (let i = 0; i < (await hub.methods.auctionCount().call()); i++) {
auctions.push(new web3.eth.Contract(AuctionABI, await hub.methods.auctions(i).call()))
}
return auctions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment