Skip to content

block42-blockchain-company/smart-wedding-contract

Repository files navigation

Smart Wedding Contract 🤵👰


A smart marriage contract on Ethereum using Truffle, a plain HTML, JS + Bootstrap 4 frontend and Web3.

Install

Make sure npm, Truffle and Ganache is installed on your machine. Truffle is required with version v4.1.15. Use npm to download all project dependencies:

npm install

Development

First create a new file called secrets.js in the root of the project directory. The privage keys are used by Truffle to deploy the contract.

module.exports = {
  privateKeysPrivateTestnet: [
    "dd4e...fa41" // private testnet private key
  ],
  privateKeysRopstenTestnet: [
    "bc35...ffd6" // ropsten testnet private key
  ],
  privateKeysMainnet: [
    "ba1a...336e" // mainnet private key
  ],
  infuraApiKey: "f5db...da74" // infura api key (only required for ropsten and mainnet deployment)
}

Make sure there is enough ETH on the wallet to cover deployment costs. Compile and deploy the smart contract to the private testnet using Truffle:

truffle deploy

If you only want to deploy a specific migration (e.g. to save gas):

truffle deploy -f <migration number> --to <migration number>

Start the web server:

npm run dev

Usage

The smart contract is already deployed and can be found at:

Ethereum Networks

Ropsten (Testnet)

0xb586324bf62224b414849b9e77d4f57ed3f10dfe

👉 find it on Etherscan

Mainnet (Live)

0x6947335452cb7a452fc337c28cb0d597806c7672

👉 find it on Etherscan

Feel free to install MetaMask and interact with the contract (as far as you are allowed to 😉).

Assets

Assets are stored in an encrypted format on the blockchain to ensure privacy. Ethereum does not support encryption at the moment so CryptoJS is used to perform client side encryption/decryption. You can access the encrypted assets on the Ropsten testnet using the key: block42

Licence

This project is licensed under the MIT license. For more information see LICENSE.md.

The MIT License

Copyright (c) 2019 block42 Blockchain Company GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.