GithubHelp home page GithubHelp logo

isabella232 / trustpoc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bankex/trustpoc

0.0 0.0 0.0 31 KB

Smart contract managing the fund PoC.

Home Page: https://trustpoc.bankex.com/

License: MIT License

JavaScript 100.00%

trustpoc's Introduction

Dependencies

You need to install NodeJS from https://nodejs.org/, truffle via command npm i -g truffle in the terminal.

You need to create account at infura for smart contract deployment.

You need metamask installed in your browser and you need some rinkeby ether for gas (may be obtained from here).

Smart contract deployment

To deploy smart contract on rinkeby network clone this repository and launch in the terminal following command from root folder of repository:

npm i
(export INFURA_TOKEN=$INFURA_TOKEN; export ETH_KEY=$ETH_KEY; truffle migrate --reset --network rinkeby)

Where $INFURA_TOKEN is access token you could obtain from infura and $ETH_KEY is your ethereum private key.

Deployment script prints to the terminal following log

Using network 'rinkeby'.

Running migration: 1_initial_migration.js
  Deploying Migrations...
  ... 0xfe81602413758016aebf9d5ee1314c17a91d2cb9182977f004b16fa7a101d979
  Migrations: 0x6d4968bb5cc23aba53bf3e1772493b5a4a252641
Saving successful migration to network...
  ... 0x8767b839776860abc65be45b868694d0821afe8970dea5f250d1df12531e1ad1
Saving artifacts...
Running migration: 2_deploy_fund.js
  Deploying CryptoYen...
  ... 0xc48d0b8edfbeb3e6b37bf6b8a40904b873ed79589ee7846823f3912583ae09f1
  CryptoYen: 0xe9b49a8947077ede9817a3a0d8978e0f7f124487
Saving successful migration to network...
  Deploying Fund...
  ... 0x53cf0b6680ad9505378a17f5a6419bccce4bb6a707e74cfb2e78eadbf4c8ac33
  ... 0xc40c318a402e02f97070408512102eeb72d5e55fe9cceb228fae450354885ba5
Saving artifacts...
  Fund: 0x4f724a33a013a4dfca92e57d4f3167733c6614ff
  ... 0x96757ea88eb211e4b051b1de5d94c7cd3d687d8e21cf91b6b0883cb3d9a726d6

There are two smart contracts, CryptoYen and Fund with addresses 0xe9b49a8947077ede9817a3a0d8978e0f7f124487 and 0x4f724a33a013a4dfca92e57d4f3167733c6614ff (during your own deployment there will be other addresses). You may use these addresses to interact with smart contract.

Interacting with smart contract

CryptoYen is standard mintable ERC20 token contract. And Fund is contract managing the fund. You may get actual information about CryptoYen from etherscan. For previous example the url is https://rinkeby.etherscan.io/token/0xe9b49a8947077ede9817a3a0d8978e0f7f124487 . To interact with fund contract open https://trustpoc.bankex.com/ and type here address of Fund smart contract (or type something like https://trustpoc.bankex.com/?contract=0x4f724a33a013a4dfca92e57d4f3167733c6614ff). You need Metamask extension installed with active rinkeby network and same wallet as you use during deplyment. Then init smart contract with initData.csv and initBenefeteary.csv files stored in csv folder in the repository. As a result you can manage fund, obtain reports and update fund state with OBK_$date.csv files.

Source code of the dApp.

Source code of the dApp is available at https://github.com/BANKEX/trustpoc_frontend .

trustpoc's People

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.