Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Web3 Function Call for Cryptopunks Smart Contract
//Load Cryptopunks contract and print the owner for each one - takes a long long time and freezes!
var PunkContract = web3.eth.contract(contract_abi);
var contractInstance = PunkContract.at('0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB');
var punk_id = 0;
for(punk_id=0;punk_id<10000;punk_id++)
{
var owner_address = contractInstance.punkIndexToAddress.call(punk_id);
punkOwners[punk_id] = owner_address;
console.log('owner of punk' + punk_id.toString() + ' is ' + owner_address.toString() )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment