0

Suppose MyContract is the name of the given contract. I tried two commands to deploy that, MyContract.new(...) and MyContract.deploy().send(...), and the both worked. So, i interest to know which of them is better and What difference do they make in performance?

  • 1
    I believe that MyContract.new only works under Truffle environment. If you don't mind importing that dependency in your script, app or whatever, then there shouldn't be any difference. Truffle simply wraps web3.eth.Contract (or web3.eth.contract in earlier versions). – goodvibration Apr 7 at 8:32
  • You also forgot to mention that you've used truffle-contract for the first case and web3.eth.Contract for the second case. I'm concluding these facts from your previous question, but you should make them explicitly visible in this question as well, because they are obviously relevant here. – goodvibration Apr 7 at 8:51

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.