Coder Social home page Coder Social logo

smart-contracts's Introduction

smart-contracts

TL;DR

An ERC20 token standard compliant “Emission Token” that uses blockchain technology to enable a decentralized emissions trading system, coded as a smart contract in Solidity and deployed on the Ethereum test net.

Limitations to the implementation

The code is mostly to be understood as proof of concept. Some challenges that remain include:

  • The initial distribution of emissions. In a real world scenario, a government would deal with the distribution according to different criteria such as historical production and others. So far, the contract creator initially gets all the emission tokens, and its up to him to transfer them. A way to deal with this could be some form of initial distribution similar to ICOs (initial coin offerings) or STO (security token offerings).
  • The registration of holders (e.g. institutions or firms which have a total emission balance) and associates (their subordinated parts, like a firm’s factory, which decrease that balance by emitting green house gases). In this implementation, the smart contract only allows holders to register their associates. This makes sense for example because it prevents competing businesses from registering smart meters to their rivals in order to decrease their emission balance. However, it does not solve the problem of an entity just deciding to cheat by not registering an associate to save emissions.
  • Automated punishments and regulations are not included yet. A spontaneous idea that just sprung to my mind is a decentralized way to let all participants regulate each other, maybe by appointing a suspected cheater and suspending him from the exchange for a set period of time when enough participants vote to do so. This would incentivize clean playing, but at the same time introduce mistrust between parties into the game.

Learnings

I initially planned to implement the whole transaction process, including tokens and compensation in form of Ether. Instead of transfer functions I had functions to sell and buy emissions, and a global conversionRate variable to calculate the price for each transaction. But I quickly ran against a wall here, because to do this I needed to match seller and buyer, having to implement a whole marketplace. This made me stumble upon the ERC20 token standard which delegates this to a third party using an approval mechanism.

smart-contracts's People

Contributors

manuelsinn avatar

Watchers

James Cloos avatar  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.