Okay, so basically I am working on a faucet. I have several nodes running on a digitalocean virtual machine. There's an account on those nodes with infinite ether. I wish to write a smart contract which could give any user ether (no time restrictions etc, for starters). So the flow would be, that there's a webpage, and the user would click on a "Get me test ether" button, which would invoke the smart contract's function and transfer ether to the msg.sender.
How do I do this? I've been stuck at the web3 part of it for over 48 hours now :(

Mar 4, 2019, 7:17 PM
This is my solidity file (I was trying to use the getName and setName functions just for debug purposes).
This is the js file where I'm trying to invoke the smart contract's function. This is the part where I'm stuck at. The solidity part works just fine when tested on Remix.
I would really really appreciate if anyone could help me out with this. Thanks!
Please feel free to use Kovan or any other test network as the network whose config has been mentioned in the file won't be up and running.
How do I transfer ether to the contract? I tried contractInstance.sendTransaction() but it didn't work..
What does that mean? Can you explain please?
How is that equivalent to sending some amount of ether to our contract?
Through metamask? Can you provide maybe some resource link, which I can go through?
Oh, right. Thanks!
I'll try it tomorrow and will provide updates here accordingly. Thanks again! :)
Do we pay to the contract for calling payable functions? Is that how it works? 🤔
Mar 4, 2019, 8:29 PM

© 2024 Draquery.com All rights reserved.