https://final-project-jsur.vercel.app
- Node.js >= v14
- Truffle and Ganache
- Yarn
git fetch --all --tags
git checkout tags/v1.0 -b cert
- Run
yarn install
in project root to install Truffle build and smart contract dependencies - Run local testnet in port
7545
with an Ethereum client, e.g. Ganache truffle migrate --network development
truffle console --network development
- Run tests in Truffle console:
test
cd client
yarn install
yarn start
- Open
http://localhost:3000
truffle migrate --network development
truffle console --network development
let rr = await Rentals.deployed()
- Add two listings:
rr.addProperty(web3.utils.toWei("0.00156"), "Hämeentie 77", "Duplex with a nice view", "https://google.com","https://www.hermannikuvia.fi/wp-content/uploads/Hameentie-77-sisapiha.jpg")
rr.addProperty(web3.utils.toWei("0.002"), "Mannerheimintie 30 A", "Duplex with a really bad view", "https://google.com","https://www.finna.fi/Cover/Show?id=hkm.HKMS000005%3Akm002zsb&index=0&size=large&source=Solr")
- Send ETH to local wallet:
web3.eth.sendTransaction({ from: "<your local address>", to: "<your local network wallet>", value: web3.utils.toWei("10") })
cd client && yarn start
- Open local ui from
http://localhost:3000
- Make sure your Metamask localhost network is in port
7545
. - If you get
TXRejectedError
when sending a transaction, reset your Metamask account from Advanced settings.
0x109B58ED673Bb241d170b87e4F88c5f426781fC9
User and apartment owner enter an agreement for renting a property, i.e. exchanging usage rights to an apartment for as long as payments are made to a specific Ethereum account before the agreed deadline.
User receives a keycode / access token to the apartment after first payment. If a user's payments are late, they will receive a reminder after one week. After e.g. 30 days (variable depending on local jurisdiction) of no payments, usage rights will be automatically transferred back to owner and apartment access rights will be revoked from user. User agrees to this procedure when entering contract with owner.
- Checking for received payments and transferring ownership back to owner on non-payment cases could be scheduled with e.g. Gelato Network (https://docs.gelato.network/tutorial).
- Opening door locks could be done with an app with smart locks, e.g. https://api.getkisi.com/docs. Smart lock APIs won't be explored in this project.
- Enter service web site
- Login with Metamask
- Browse apartments
- Select apartment
- Agree on contract, pay first installment with Metamask (smart contract call)
- Tenantship is transferred to user account (smart contract call)
- Receive key phrase / token / OTP / etc. to access apartment with smart lock app (this part will be mocked in project)
- Run scheduled contract weekly (Gelato? https://docs.gelato.network/tutorial)
- Check for made payments for each rental agreement (from renter wallet to owner wallet)
- If last payment is late 7 days, send reminder
- If last payment is late >= 30 days, remove tenant. Revoke user token access rights to apartment smart lock.
client
: Project's React frontend.contracts
: Smart contracts that are deployed in the Ropsten testnet.migrations
: Migration files for deploying contracts incontracts
directory.test
: Tests for smart contracts.
ROPSTEN_INFURA_PROJECT_ID=
ROPSTEN_MNEMONIC=
- Tenant payments tracking
- Tenant removal
- Fund withdrawal