This is a great idea and it is absolutely doable already with smart contract wallets. MEV contracts already implement this kind of check in order to revert if the transaction in its whole didn't generate enough profits. One could imagine a function in say Safe wallets that executes and checks that the outcome was the one expected in terms of balance changes, if not, revert the whole transaction.
Would it make sense to tackle the problem at the protocol level?
e.g. add a new instruction that, when added to a transaction, guarantees that the user receives 143.45 ETH, otherwise the transaction fails.
This is a great idea and it is absolutely doable already with smart contract wallets. MEV contracts already implement this kind of check in order to revert if the transaction in its whole didn't generate enough profits. One could imagine a function in say Safe wallets that executes and checks that the outcome was the one expected in terms of balance changes, if not, revert the whole transaction.
Really well written. Thanks for sharing.