Code Monkey home page Code Monkey logo

knowledge-contracts's Introduction

Knowledge Ethereum Contracts

StandardJS Style Collaborative Etiquete Travis FOSSA Status Gitter

This repository contains all Ethereum Smart Contracts used at Knowledge.

Truffle is our development, testing and deployment framework.
OpenZeppelin is the solidity library we use for writing secure Smart Contracts on Ethereum.
We follow the Knowledge Project Guidelines and Consensys Best Practices.

Knowledge Token Sale

The Knowledge Token Sale starts on January 15, 2018 and it ends April 8th at 12pm. For more information visit knowledge.io or join the Knowledge Token Channel on Telegram where we'll be happy to discuss any questions you may have about our platform.

Contents

Features

  • Smart contract compilation, deployment and binary management with Truffle.
  • Automated contract testing with Mocha and Chai.
  • Solidity code linting with Solium.
  • Automated known vulnerability checks with Solium.
  • JavaScript code linting with StandardJS.
  • Secure solidity utility functions with OpenZeppelin Solidity
  • Continuous integration testing with Travis CI
  • Code testing coverage reports with solidity-coverage and codecov
  • Ethereum gas cost reporter with eth-gas-reporter
  • Configurable build pipeline with support for custom build processes.
  • Scriptable deployment & migrations with Truffle framework.
  • Upgradable ERC20 Token contract.
  • Network management for deploying to many public & private networks.
  • Ropsten TestNet deployment script.
  • Interactive console for direct contract communication.
  • Instant rebuilding of assets during development.
  • External script runner that executes scripts within a Truffle environment.

Contracts

All ethereum solidity smart contracts can be found in the /contracts directory.

  • ERC20Token.sol is a standard ERC20 token contract, based on OpenZeppelin implementation.
  • KnowledgeToken.sol is the ERC20 Token contract implementation for the KNW token. 150,000,000.00000000 tokens are created in total.
  • UpgradableToken.sol is used to be able to upgrade the contract. If we ever discover a security vulnerability or have the need to publish a another version of the token contract users will be able to migrate their tokens to the new contract version. It's inspired by Lunyr and Civic token contract.
  • PayableToken.sol is used to receive payments at the Knowledge Marketplace and Adviser Self Service Platform. It can generate payment requests and manage fees.
  • /utils/ is meant for utilitarian contracts, such as SafeMath or Ownable.
  • /interfaces/ are contracts used just for type safety.

Getting Started

For you to able to understand and execute the code in this repository advanced knowledge of JavaScript, Node.js and Ethereum is required. If you are not familiar with these technologies we suggest you to visit ethereum.org and learnnode.com.

To get started with smart contract programming with Solidity you can find an introduction to the language in the Solidity documentation. In the documentation, you can find code examples as well as a reference of the syntax and details on how to write smart contracts.

You can start using Solidity in your browser with no need to download or compile anything.

Environment Dependencies

You need some global environment configurations

Project Dependencies

In the project root directory run npm install to install all project dependencies

Running Development Mode

In separate tabs of your console run the following commands:

npm run ganache
npm run develop
npm run deploy

For more information visit the Truffle Framework documentation.

Testing your code

We do both static linting and analysis and functional tests.

npm run ganache
npm run lint
npm run test

Deploying to the Ropsten Testnet

We use Ropsten (revived) Tesnet as our user testing environment for our contracts. The deployment is done through Infura.io. To create Ropsten Wallet Addresses and make use of the Knowledge contracts on the Ropsten TestNet you can use metamask.io or a command line tool like geth.

If you chose metamask in order to interact with the contract follow these instructions https://support.metamask.io/kb/article/4-managing-tokens

To deploy from your computer first you need create the .env file on your machine based on .env-sample. Then run following command:

npm run deploy-ropsten

Contributing

Read the contributing guidelines for details.

Bug Reporting

Please report bugs big and small by opening an issue. No possible bug report is too small.

License

MIT © Knowledge
See LICENSE for more info

FOSSA Status


About Knowledge

Blockchain technology is rebuilding the internet in a trustless, decentralized way, allowing for fundamental core improvements on existing business models and industries, and a new breed of dot-io powerhouse frameworks are emerging. Knowledge.io is producing an ecosystem that offers significant improvement in the areas of ad tech, commerce, education, and employment, and a supply and demand marketplace of goods and services, all based around rewarding users for what the massive and centralized supergiants utilize to make extraordinary profits - people’s data. The Knowledge.io ecosystem is built on the foundation of decentralization and rewarding people for sharing their knowledge.

knowledge.io

Knowledge Twitter Knowledge Facebook Knowledge Github

knowledge-contracts's People

Contributors

gaboesquivel avatar diestrin avatar sci4punk avatar fossabot avatar

Watchers

James Cloos avatar Will avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.