Created
December 27, 2020 20:51
-
-
Save wissalHaji/9352df718e02441baa465fe10d3a2b1f to your computer and use it in GitHub Desktop.
This file contains 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
const getContract = async (web3) => { | |
const data = await $.getJSON("./contracts/Greeting.json"); | |
const netId = await web3.eth.net.getId(); | |
const deployedNetwork = data.networks[netId]; | |
const greeting = new web3.eth.Contract( | |
data.abi, | |
deployedNetwork && deployedNetwork.address | |
); | |
return greeting; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment