Skip to content

Instantly share code, notes, and snippets.

@ryanpedersen42
Created December 27, 2019 19:23
Show Gist options
  • Save ryanpedersen42/67ad31c7656cd24cd02a7634575b1826 to your computer and use it in GitHub Desktop.
Save ryanpedersen42/67ad31c7656cd24cd02a7634575b1826 to your computer and use it in GitHub Desktop.
getContractAndPosts
getContractAndPosts = async () => {
const { setCurrentIPFS, setContract } = this.props
const contract = await new web3.eth // eslint-disable-line
.Contract(Pet.abi, '0x892de2063c8F898E21A9A1d4b981F7446a561Fe3');
await setContract(contract)
const petHashes = await contract.methods.getHashes().call()
await setCurrentIPFS(petHashes)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment