CSA Farm Token

Code to create framework to model CSA (Community Supported Agriculture) Farms on Ethereum blockchain. More details regarding CSA.

The idea is to model the current CSA subscription model on the Ethereum blockchain.

  • The farmer creates a token to represent a crop share for the following season. They determine the number of shares to offer, and the price per share.
  • Consumers purchase these shares so that will receive part of the harvest when it's ready. Typically there are a number of food deliveries during a season, so the token maybe bundled in groups.
  • When the shareholder receives their food, the farmer accepts one of the tokens, which is then burned.
  • When food is not picked up, charities can monitor the blockchain, so they can get the food before it spoils.
  • The blockchain provides transparency into this system, so customer's know how many shares they offer, what other farms offer shares, and can compare price per share.
  • We can also add a rating system, so the community can have more information when buying their food.

Work in progress, started at ETHWaterloo hackathon 10/13/2017.

setup (for testing with testrpc), I assume nodejs, Truffle Framework and testrpc are installed:

npm install

then start testrpc

testrpc

Migrate contracts with Truffle (in different terminal)

truffle migrate

The copy the address for CSATokenFactory to replace the address in line 4 of file src/js/app.js

Then start the nodejs test server

node src/js/server.js

Browse to localhost:8080 and enjoy this demonstration of modeling a CSA Farm Subscription on the Ethereum blockchain.

There are also test cases created it the test directory for your review. These can be run with:

truffle test

Enjoy!

Share this project:
×

Updates