Skip to content

verifyas/contract

Repository files navigation

Verify Smart Contracts

Contract is currently deployed on Ropsten. Mainnet release is forthcoming

The goal of this project is to provide the smart contract that will be used by the buyer, the seller, and Verify in order to conduct the transactions described in the Verify whitepaper. This includes sending the funds to Verify, converting 1% of the funds to CRED and storing it in the Verify account, converting the remaining 99% to the Dai stablecoin and storing it in the Verify escrow account, sending the funds stored in escrow to the seller, and allowing for refunds (in some fashion), in which case Verify refunds any money in the escrow account that hasn't been given to the seller yet.

  1. Getting Started
  2. Code Structure
  3. Contribution Guidelines
  4. Support

Getting Started

To get started:

  1. Download or clone this repository
  2. Run the command npm install to install dependencies
  3. Follow the instructions in the Testing section

Testing

To test the smart contracts, follow the below instructions:

  1. Run truffle develop. This sets up a local ganache-cli test server equipped with a copy of the Ethereum blockchain for you to run on. It also creates ten test Ethereum accounts, each with 100 test Ether. Their addresses and private keys will be listed after you run the command. You can plug those into the deploy_contract migration file in the migrations/ folder. Do not close the test server - keep the test server running
  2. Open another terminal and run the command truffle test. This does three things:
  • Compiles the smart contracts.
  • Runs the migrations to deploy the contracts to the network. For testing purposes, we'll use a test network, in this case testrpc. Running on the main Ethereum network would be very slow and expensive.
  • Runs the tests (in the test/ folder) against the smart contracts deployed on the network.

Code Structure

The contracts are stored in the folder marked contracts/. In this folder, there are currently two files - Migrations.sol and Purchase.sol. Migration.sol is auto-generated by Truffle. Purchase.sol is the main smart contract currently under development.

The migrations are stored in the folder marked migrations/. In this folder, there are currently two files, both of which are numbered. The file starting with 1_... is auto-generated by Truffle. The one starting with 2_... is used to deploy the smart contract to the ganache-cli test server.

The unit tests are stored in the folder marked test. In the folder, there is currently one file - purchase.js. It contains several unit tests to run against the smart contract. The unit tests follow the Truffle testing specification (which is based off of the Mocha testing specification).

Contribution Guidelines

This project uses the official Solidity style guidelines, which can be found here: http://solidity.readthedocs.io/en/v0.4.24/style-guide.html

A couple of important things to note from the guidelines:

  • We use four spaces per indentation level - use spaces, mixing tabs and spaces should be avoided.
  • Strings are double-quoted instead of single-quoted.
  • Functions should be grouped according to their visibility and ordered in the following way:
    • constructor
    • fallback function (if exists)
    • external
    • public
    • internal
    • private

Support

If you need any help getting the smart contracts running on your computer, feel free to open an issue or contact us at [email protected].

About

Smart contracts for the Verify Ethereum protocol

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •