by heptathorp · 8y ago · 0 comments
There's no way to revoke a transaction but you could implement a hold so ETH could only be withdrawn from the contract x days after the charge is incurred, within such time the owner could cancel the withdrawal.
As far as notifications are concerned, there are events in Ethereum that you can subscribe to. So for example you could subscribe to a charge event, and go in and dispute it.
Not disagreeing, just wanted to point out that one needs to be careful with timestamps in Ethereum, as the source of truth is miner. Using timestamps could result in security vulnerabilities.
However, on the scale of a month, the miners aren't going to be able to mess with you. A block stamped with a significantly incorrect timestamp won't be accepted by other miners.
On the flip side, I'm sure there are/will be oracles for approx. block time, so this is still a solveable issue.
https://github.com/ethereum/wiki/blob/c02254611f218f43cbb075...
From the block validation section: "Is block.timestamp <= now + 900 and is block.timestamp >= parent.timestamp?"
(In Solidity, block.timestamp is in seconds, and I think that's a direct translation from the underlying opcode, so I assume it's 900 seconds here.)