masaun / time-based-energy-payment

This is the smart-contract for realizing the time based energy payment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Time based energy payment ⚡️


【Introduction of the time based energy payment ⚡️】

  • This is the smart-contract for realizing the time based energy payment.
  • Payment: using the Matic Network of layer 2 solution for avoiding expensive gas fee when payment tokens (ERC20) are transferred.
    • Matic Energy Token (ERC20. Symbol: MET) is used as a payment token.

  • Stack
    • Solidity-v0.6.12
    • @openzeppelin/contracts-v3.1.0

 

【User Flow】

① User register as a "prosumer" (Both of producer and consumer) ② Measured values of the smart-meter are measured at the end of every month by instruction of smart-contract. (measured smart-meter are both that from production and from consumption) ③ Measured values from production and measured value from consumption are compared. ④ Transfer
・If the measured value from production is greater than measured value from consumption, the smart-contract transfer payment tokens into the prosumer's wallet. ・If the measured value from consumption is greater than measured value from production, the prosumer transfer payment tokens into the smart-contract. ⑤ Invoices of monthly result are sent to each prosumers. (at the end of every month)

 


【Setup】

Setup smart-contract

  • Compile
cd smart-contract

ganache-cli -d

npm run compile: local

Setup backend

 

Setup frontend

 


【References】



About

This is the smart-contract for realizing the time based energy payment.


Languages

Language:JavaScript 100.0%