Skip to content

pabloruiz55/Marriage_Ethereum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Marriage_Ethereum

A Marriage contract on Ethereum

1-💍 Propose marriage to someone: Marriage contracts can only be generated by the MarriageRegistry contract, so, if you want to propose to someone, all you have to do to initiate the process is calling the proposeMarriage() function on MarriageRegistry and specify the address of the person you are proposing to.

2- 🌹 Have your significant other accept or reject the proposal: The person being proposed marriage now has the option to either reject or accept the proposal. If they reject the proposal by calling rejectProposal() on the newly created Marriage contract, the marriage is off and the contract is destroyed. On the other hand, if they call acceptProposal() then it’s official, you are married! 

When you called proposeMarriage() it generated a new Marriage contract tying both you and the recipient of the proposal. You have to share the address of that contract with the other person for them to act upon it. You can either find it on Etherscan.com or call getMarriageContract() on MarriageRegistry by passing either address as parameter.

3- 📙 Get your marriage certificate: You (or anyone) can query the MarriageRegistry to get the marriage certificate stating the address of both spouses as well as the marriage date. To get the marriage certificate just call getMarriageCertificate() and pass the marriage contract address as parameter.

4-💔 Getting divorced: Sometimes married life is not as we thought it would be and the couple feels it is best to get divorced. For situations like this, we have the requestDivorce() function. As with the marriage proposal, both spouses have to agree on this in order for the divorce to be performed. Once both parties call this function, the contract will be destroyed and they will be free to marry someone else. (Or to stay single 🎊)

The MarriageRegistry contract has been deployed in Ropsten testnet and verified through Etherscan at address: 0x57f38682c5E802f78cCC71B2D2932230b1C41c47

For more info, read my article on Medium.

About

A Marriage contract on Ethereum

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published