A recent case concerning a valid contract on assets and the impact of a will was discussed by the Wills, Trusts, & Estates Prof Blog in "Surrogate's Court Sets Aside Fraudulent Conveyance Violative of Contract to Make a Testamentary Disposition."
This type of contract is called a contract to make a testamentary disposition, which is legalese for an enforceable promise to leave someone something in a will.
The idea is very simple. If you sign a contract to bequeath a piece of property to someone and the other party to the contract performs his or her duties under the contract, then you cannot change your mind later and rewrite your estate plan to do something different.
While this specific issue does not come up all that often, it is important to understand that contract responsibilities survive your death and supersede your estate plan.
An estate planning attorney can advise you on creating an estate plan that fits your unique circumstances and could involve a contract obligation for specific assets.
Reference: Wills, Trusts & Estates Prof Blog (Dec. 16, 2017) "Surrogate's Court Sets Aside Fraudulent Conveyance Violative of Contract to Make a Testamentary Disposition."