How to create and deploy an ether contract?

How to create and deploy an ether contract in web3.js? In strength, I know that this can be done as follows:

D newD = (new D).value(amount)(arg);
Run code

But how to write this in web3.js to test the contract. Thank you sincerely

+4
source share
1 answer

Just attach the "value: amount" attribute when creating the contract as follows: .new ({from: web3.eth.accounts [0], value: 5 wei}

+2
source

Source: https://habr.com/ru/post/1672804/


All Articles