Hii I am just curious if we can add a system to revert the last Transaction.
Since Nowadays crypto scams are common and there is no way one gets their lost item once it is being transferred. So a solution would be very great for everyone.
Solution
Keep track of address last transaction using a map, with a check boolean if it is reverted or not and also add revert time of let say 2 days.
(Taking NFT example) -
I transfer my (Address = ad1) to some account (Address = ad2). So inside SafeTransferFrom call, we can add that transaction to a map (TransactionMap).
I think it is a little hard to revert a transaction that has been confirmed, in order to revert this transaction, you have got to have more mining power to mine a new longer block chain and broadcast out, so all miners will accept this new longer chain as valid main chain and all transactions on it.
So why not add a backlist function to your token, if someone losses their token, just add the scammer account to the blacklist, and disable him to transfer token.
Just like I said above, use more mining power to mine a new longer chain that does not contain the transaction that lost assets, and broadcast out, so it will revert some transaction totally just like they did not happen, but it is really hard to do. I would like to use the blacklists to freeze the scammer token and mine new token to the victim.