I want to create a smart contract that users can send a number to and receive an amount of ether.
function airdrop(uint val) public payable {
require(airdrop == true);
if (val == 0x31){
msg.sender.transfer(1 ether);
airdrop = false;
}
}
If users send a 1
they get the ether. How can I do this?