I am trying to deploy a contract on react. But I can't seem to pull it off :(

This is my code:

          data:[big boi bytecode here],
          arguments: ['name', 'description', 20, 20]

And this is the error I am receiving: "TypeError: this.gamechanger.deploy is not a function"

I have also tried using:

this.myContract.deployed().then(() => [...]

However, it would not deploy.

How should I go about doing this? Help would be insanely appreciated!

P.s. I am using Web3 version 1.2.6

1 Answer 1


It looks like this.myContract is undefined in your scope.

Also you forgot .send() to deploy a contract


   data:[big boi bytecode here], // Don't forget about '0x' on the start of bytecode
   arguments: ['name', 'description', 20, 20]
}).send({ from: account });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.