Last active
December 23, 2019 06:46
-
-
Save ryanpedersen42/24d91b69674e8cf7ee7167776a7cfe2d to your computer and use it in GitHub Desktop.
Get Contract in App.jsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getContractAndPosts = async () => { | |
const { setCurrentIPFS, setContract } = this.props | |
const contract = await new web3.eth // eslint-disable-line | |
.Contract(Pet.abi, '<your-contract-hash>'); | |
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