@alfabc/contract-terms

1.0.1 • Public • Published

pipeline status coverage report

Terms fields for smart-contracts

Overview

Smart-contract Solidity library which provides two fields to store both terms & conditions location and hash :

  • location : a string containing a link to the document
  • hash : 32-bytes hash associated to this document. Usually KECCAK256 (SHA-3)

Usage

  • Import library from npm :
npm install @alfabc/contract-terms
  • Import library in your code to use it :
pragma solidity ^0.4.25;

import "@alfabc/contract-terms/contracts/ContractTerms.sol";

contract NewContract is ContractTerms {
  constructor() ContractTerms(
    "/url/location/of/document",
    "0x9c22ff5f21f0b81b113e63f7db6da94fedef11b2119b4088b89664fb9a3cb658"
  ) public {
    // Put your code here
  }
}

Interface

This library exposes two external getters... and that's all :

  • getLocation() : returns the location of the terms document
  • getHash() : returns the hash of the terms document

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i @alfabc/contract-terms

    Weekly Downloads

    1

    Version

    1.0.1

    License

    none

    Unpacked Size

    4.45 kB

    Total Files

    9

    Last publish

    Collaborators

    • thexpert
    • josecruset