Coder Social home page Coder Social logo

ox24 / b2e2_contracts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from b2e2/b2e2_contracts

0.0 0.0 0.0 2.29 MB

Smart contracts referenced in the 'Energy Token Model' whitepaper.

Home Page: https://it-architecture.enbw.com/whitepaper-energy-token-model

License: MIT License

Solidity 55.96% JavaScript 44.04%

b2e2_contracts's Introduction

B2E2 - Smart Contracts

Based on experience with prototypical use cases, our team at Energie Baden-Württemberg AG (EnBW) has written the whitepaper 'EnergyTokenModel'. In this paper we describe how distributed ledger technology or blockchain can be used in the energy industry providing a basis for a blockchain based energy ecosystem in which usecases as i.e. energy sharing, proof of origin, local markets can be realized. The presented approach shows a way how real-world objects can be digitally mapped on a blockchain and how properties and transactions can be documented in a trustworthy way. The White Paper is currently available for download in German language here.

With the publication of the smart contracts in this repository we are taking the next step. After we have explained in the white paper how DLT mechanisms can be applied in the energy industry, we show here how the implementation looks like. Since we believe that the advantage of using DLT is to have a common transaction layer, we publish the repository under a MIT open source license.

With our publications, we are contributing to the public discussion on how the block chain can be used in the energy industry and hope to receive further ideas and impulses.

The Blockchain identities are implemented with the ERC725 and ERC735 standards. The energy tokens are implemented with the ERC1155 standard.

The latest version of the sequence and entity relationship diagrams from the whitepaper can be found in the directory './documentation'.

Cloning the repository

git clone --recursive https://github.com/B2E2/b2e2_contracts.git

Installing Dependencies

sudo npm install -g truffle ganache ganache-cli
cd Energietokens-Implementierung
npm install
cd dependencies/jsmnSol
npm install

Building & Deployment

Launch Ganache:

npx ganache-cli -l 1000000000

Choose a sender address from the list that's printed and replace the address in the line containing from: in truffle-config.js by it.

Then (in a different terminal instance) compile the contracts and deploy them:

npx truffle compile
npx truffle deploy

Testing

Alternative 1

Launch Ganache:

npx ganache-cli -l 1000000000 -m "hire fancy burst fresh gadget theme cloud broom insane screen foster where"

Copy sender address 0 from the list that's printed and replace the address in the line containing from: in truffle-config.js by it.

Copy private key 9 and change the definition of account9Sk at the top of test/IdentityContract.test.js to it.

Run the tests (in a different terminal instance):

npx truffle deploy # required for tests to run successfully
npx truffle test

Alternative 2

    npm run build
    npm run tests

b2e2_contracts's People

Contributors

chrisagithub avatar cleanunicorn avatar m1cm1c avatar mgsgde avatar mstumpp 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.