A solidity smart contract + dapp that combines the core features of renting a single property (e.g. an AirBnb rental) with an ERC-20 dividend paying token for multiple owners of the property:
- a group of owners/investors (shareholders) can buy a property together
- guests can book and pay rent for the property
- earnings (rent) can be withdrawn by a shareholder proportionally to their number of shares
- the dapp supports use cases for both guests and owners
-
Clone the project locally:
git clone https://github.com/mattmasteller/web3-bnb.git
-
Install dependencies:
yarn install
-
Start the local Hardhat node:
yarn hardhat node
-
With the Hardhat node running, deploy the smart contract to the local network in a separate terminal window:
yarn hardhat run ethereum/scripts/deploy.js --network localhost
-
Copy the contract address from the terminal and assign it to the REACT_APP_CONTRACT_ADDRESS environment variable in the .env file.
-
Configure .env file inside the root directory:
NETWORK_URL=https://eth-rinkeby.alchemyapi.io/v2/your-alchemy-key PRIVATE_KEY=your-private-key-used-to-deploy-the-contract REACT_APP_CONTRACT_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3
-
Launch the frontend client app:
yarn start
https://rinkeby.etherscan.io/address/0xa3Cbdaa189D193d905662bbb999446854C1a5480
- hardhat
- solidity
- openzeppelin
- react
- ethers
- chakra-ui