Hi to everyone here at Morales forum! I’m very new to all this but very excited as well
Following some tutorials I wrote a simple contract where people can deposit some ETH, (MATIC in my case) and I will be able to withdraw it.
For what I understand, in solidity I can’t specify any input field so I wish to know what’s the best way, to implement a simple interface with point 1 and 2 of my screenshot in a web page.
this is the Solidity code:
pragma solidity ^0.8.1;
contract test {
address public owner;
bool public paused;
constructor() {
owner = msg.sender;
}
function sendMoney() public payable { }
function setPaused(bool _paused) public {
require(msg.sender == owner, "You are not the owner"); paused = _paused;
}
function withdrawAllMoney(address payable _to) public {
require(owner == msg.sender, "You cannot withdraw.");
require(paused == false, "Contract Paused");
_to.transfer(address(this).balance);
}
}
thank you!