Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- web3.eth.getBalance('0x123').then(console.log) // 0
- address public recipient; // The account receiving the payments.
- function receive(uint256 amount) public {
- require(msg.sender == recipient);
- recipient.transfer(amount);
- }
- constructor(address _recipient)
- public
- payable
- {
- recipient = _recipient;
- }
- var contractInstance = new web3.eth.Contract(abi, '0x456' /*0x456 is contract address*/);
- contractInstance.methods.close(10 /*0x123 wants to receive 10 wei*/).send({ from: '0x123' }, function(error, result) {
- console.log(error);
- console.log(result)
- });
Add Comment
Please, Sign In to add comment