0

How do I get the instance of sol in browser using js. In React it happens like:

import SimpleStorageContract from '../build/contracts/SimpleStorage.json'
const simpleStorage = contract(SimpleStorageContract)
simpleStorage.setProvider(this.state.web3.currentProvider)
this.state.web3.eth.getAccounts((error, accounts) => {
      simpleStorage.deployed().then((instance) => {
      this.simpleStorageInstance = instance;
});

What is the equivalent code for vanilla js?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.