This repository contains all the source code of a property decentralized application built on Ethereum Blockchain (Goerli Test Network).
This is a property marketplace where user can mint their property information as an NFT
and can trade these NFTs to others. So, basically, anyone can buy properties in a form of NFTs. Also, the users need to trade their property NFTs with a custom ERC20 standard token called AWT (Awesome Token)
instead of native Ethereum currency (ETH).
Following technologies, frameworks and libraries are used to build this project:
- Solidity for smart contract development
- Openzepplin Contracts for EC20 and ERC721 (NFT) tokens
- Truffle Suit (test and development framework)
- web3.js
- React
- Next.js
- Semantic UI React
Property DApp provides the following features:
- Add/Mint new property
- Buy properties
- Set property availability status
- Set approval status
- Property purchases records
- Get details of AWT and vendor contract
- Purchase and Sell AWT
- Mint and Burn AWTs
- Withdraw vendor balance
- AWT transfer records
To interact with this decentralized application you must need a Metamask
wallet, must have some test ETH, and an Infura API Key
for the Goerli
test network. If you have all of these then you can jump to the Project Setup
section skipping the following steps.
Get Metamask
wallet extension to your browser and set up your Metamask wallet account. When you set up a Metamask wallet, you will be asked to note down and then re-enter 12 words. These words are your Mnemonic
seed phrase. Keep it somewhere safe.
Make sure in your Metamask wallet Goerli Testnet
is selected instead of Ethereum Mainnet.
Now you need some test Ethers
in your wallet. To get free test ETH you can go to any of the following Goerli Faucet
links:
Provide your Metamask account address and get free test ETH.
To communicate with the Ethereum blockchain you need Infura API Key. Go to the Infura website, register, and create a new API key for Web3 API.
Before you begin, make sure you have the following installed:
- Clone the project by running the following git command in your git-CLI:
git clone https://github.com/ishtian-revee/property-dapp.git
- Execute the following command in the project root folder:
npm install --legacy-peer-deps
Go to the ethereum
directory and create a config file named config.json
. Then add the following lines to this file:
{
"mnemonic" : "{YOUR_METAMASK_MNEMONIC_PHRASE}",
"infura_api_key" : "{YOUR_GOERLI_INFURA_API_KEY}",
"token_address" : "0x8F4cA6f968Ed3276f871C5AF6237FF4e143538d7",
"vendor_address": "0x6074B60E0a6659aF74012278Cd55971B5aAE082d",
"property_address": "0x9FBB7A582B7Cb5f5Ec952B4564d54dDB9Cc22a7c",
"registry_address": "0x5f6d3e3590b0CCbc7CEf36fC519d334261df6B74"
}
Insert your Metamask Mnemonic Phrase and Goerli Infura API Key to the "mnemonic"
and "infura_api_key"
parameters accordingly.
- Now go back to the root directory and run the following command:
npm run dev
-
After that visit http://locahost:3000/
-
Metamask should be prompted. Connect to your wallet and you are all set! 🎉
- Initially users can go to the
Get AWT
tab. Here they can see all the basic information about this custom ERC20 token. Also some other information like total available tokens, vendor contract balance, minter account address, etc. - Next a user can purchase or sell AWTs. Before purchasing a key point to remember:
1 ETH = 100 AWT
So, if a user wants to buy 10 AWT then they need to pay 0.1 ETH.
- In the
AWT Transfers
tab anyone can see all the AWT transaction records. - Now, on click top left tab
Property DApp
the property marketplace page will load. From here users can buy any property NFT. - On
Owned Properties
page users can see a list of properties that they own. They can change the availability status of these property NFTs at any time. Also, a user needs to set the approval status so that others can buy their NFTs. - On
Add Property
page anyone can add or mint their property as NFT. They just simply need to insert the location, size, and prince (in AWT). - In the
Purchase History
page all the purchase records are displayed.