current position:Home>How to pass in parameters when deploying smart contracts with geth

How to pass in parameters when deploying smart contracts with geth

2022-02-03 23:02:06 Q & A of Denglian community

My code is as follows

pragma solidity ^0.4.10;contract AttackKing {   function () public{        revert();    }    constructor (address _target) payable public{        _target.call.value(msg.value)(bytes4(keccak256("becomeking()")));    }}

address _target You can fill in here 20200707194122.png that msg.value Well , How do I get in ?




Take the answer 1:

When you submit a transaction , You should see the transaction option parameters like the following :

{     from: web3.eth.accounts[0],      data: '...',      gas: '...'   },

Add one to this value:

{     from: web3.eth.accounts[0],      data: '...',      gas: '...',    value:  '1000000000'},

You can view the transaction option parameters web3.js file - Launch a deal






Other answers 1:

copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032302039279.html

Random recommended