Skip to content

t-markey/spring-collab

Repository files navigation

Chainlink/Solana 2022 Hackathon Submission : Block Garden

  • Building a landleasing agreement ecosystem for smaller suburban plots of land to utilize empty space and increase local food production.
  • The contract requires margin to be posted by each party which is transferred to the other party if one is to void the contract for any reason if they are not satisfied with the arrangement.
  • If either Party voids before a pre-determined Harvest date, bother parties loose their margins and it is donated to a charity. If the void occurs after the harvest date, the voiding parties margin is transferred to the other participant in the lease.

Roadmap Checkpoints

The Current state is as follows:

  • Almost all Basic functionality laid out in the design doc have been implemeted and manually tested
  • Automated test estimated to be around 60%
  • Chainklink Keepers Utilization mocked up in archive/remix_testing/margin_with_link.sol
  • Web3 Ui with React Mix has been started and tested on both Ropsten and Rinkeby (Not all functionality is implemented here. It also is deployed such that one account funds both parties for ease of testing)

  • 03 JUN TBD - (Wrap up / Discuss any Further Developement Plans)

Next Steps

  • Finish Unit tests for cashout and void functions

  • Obvious Audit Risks - setAttribute functions, more modifiers

  • Fix factory function working as expected to keep track of all instances of contracts

  • Finish Chainlink Keepers Implementaion

  • Web3 stuff - Add buttons for Funding, Voids, Cashouts, Balances, Multiple User End to End testing

Test Concept Block-Garden

Small Land-leasing contracts verifed via chainlink funded by Solana diagram

Prototype Contract

Sample contract with variables. diagram

Installation

Installing pipx

brew install pipx

Installing brownie Link

pipx install eth-brownie

Alternative Installation of brownie using pipenv (encountered error brownie using pyhotn 3.1)

pipenv --python 3.8
pipenv shell
pipenv install eth-brownie

Installing ganache-cli

npm install -g ganache-cli

Adding ganache as a test network

brownie networks add Ethereum ganache host=http://localhost:8545 chainid=1337

Running base tests (run commands in multiple terminals)

	npx ganache-cli
	brownie test —network ganache

Running Tests

brownie test

Also to be noted that in the deploy.py , this is being funded automatically with one account. In remix the work flow is easier to see by funding the margins with seperate accounts. The setAttributes function is currently used to iterate over days of the contract. getDaysInContract() needs to be uncommented to go live.

Running the Web3 client locally from deployment You will need to make a .env file to store Infura Node and Private metamask wallet key

	brownie run scripts/deploy.py
cd client
yarn start 

Useful links




  • Basic smart contract that displays how many times you access it Here
  • Simple Tutorial to send yourself test Solanas Here
  • Web3 Setting up Ropsten and Metamask Here
  • All you need smart contract resource Learn x in y minutes

Land Leasing Sample contract

California Farm Link: Model Short Term Crop Lease Agreement

License

MIT

About

Contribution to Spring 2022 Chainlink/ Solana Hackathon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •