Is it possible to decline a transaction to a contract in Ethereum (with Solidity) (written here
This is a part of my code:
function accept() public payable {
if (msg.value == 1e18) { //1e18 wei = 1 ether
// do smth. special
} else {
// do nothing
}
}
I would like to decline a transaction of less than 1 ether, but I can only filter it that way. So if someone does not read that he must send 1 ether and sends more or less, how can I decline it completly?
selfdestructthan can used to forcefully push ether into a contract that doesn't necessarily want or expect it. It's a possible attack vector if the author thinks this is a fail-safe restriction and there is logic based on that assumption. – Rob Hitchens Mar 04 '18 at 20:31