I’m not a lawyer, but I don’t think “Donating your assets” would work (in any jurisdiction, but as I said, I’m not a lawyer, certainly not one versed in law in all countries of the world). Lawyers will argue that the fact that you set this up x months before death doesn’t mean that you still wanted it to happen when you died and/or that, at the time the assets were transferred you weren’t alive, so you couldn’t own the assets.
Yes, last wills do both, too, but they have a long history with lots of jurisprudence about what you can and cannot arrange for after you die, and how you should arrange that (https://en.wikipedia.org/wiki/Will_and_testament#Requirement...)