Skip to main content
Bumped by Community user
edited title
Link
X0r0N
  • 364
  • 1
  • 5
  • 17

How Do i Create a New Instance of a Contract and Call its Methods

Source Link
X0r0N
  • 364
  • 1
  • 5
  • 17

How Do i Create a New Instance of a Contract and Call its Methods

i am trying to figure out how i can deploy a new instance of a contract and setting some values by calling some of its methods.

i am trying to follow the example on the official docs website: https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#

const comment = new web3.eth.Contract(Comment.abi, { from: coinbase });

// comment object is available here. all properties at this point seem to be defined. the value is not null here.
console.log('comment:', comment);

comment.deploy()
    .send({ from: coinbase })
    .then(console.log);

but i get the error:

TypeError: Cannot read property 'send' of null