We had a little Ethereum drinkup in Utrecht, The Netherlands where Nick, Yves and Joris did a little pair programming on a marriage contract with divorce clause:
https://github.com/jorisbontje/cll-sim/blob/master/examples/i_want_half.cllWith CLL Simulation testing all the marriage scenarios :
https://github.com/jorisbontje/cll-sim/blob/master/examples/i_want_half.pyUsage:
* Both parties should send their marriage proposal to the contract; with the address of other partner that they'd like to marry.
* Once they are married, they can deposit whatever value to this shared contract.
* To withdraw, both parties should send a transaction with the withdrawal request, recipient and amount. Once both request the same the transaction is made.
* To divorce, both parties should send a transaction with a divorce request. Once both send the request, the remaining balance is split 50-50 among both partners... I WANT HALF!
Comments
line 45: contract.storage[I_WITHDRAW_AMOUNT] = 0
seem to be redundant.
If you dont marry you cant get your money out. You could say you should just put a minimum in to engage, but that doesnt work well many cultures.