node version:
node -v
v12.16.3
Install project dependencies
yarn install
Shell 1 - Launch an ethereum test chain (Hardhat)
yarn chain
Shell 2 - Start web client UI and connect to chain (scaffold-eth)
yarn start
Shell 3 - Deploy smart contract to chain (Solidity)
yarn deploy
When the browser loads, you will be introduced to an instance of scaffold-eth that provides you with a wallet and account so that you can interact with the Ethereum deployed Land Registry Smart Contract via your account.
- By default your account is the owner of the contract, and assumes the role of the Registrar.
- Alternative accounts (citizens) can be generated using another browser (incognito).
Before you begin, you need to fund your account with some gas. Almost all transaction calls incur gas.
- In the top right of your screen select 'Grab funds from the faucet'
Note: For the following scenarios the 'title' is the string representation of the title data, ie the JSON object for registration.
As a registrar
- enter the title
ATITLE
in theproofOfExistance
box - click send
- Registrar is notified by an exception 'this proof is NOT registered'.
As a registrar
- enter the title
ATITLE
in theregisterExistance
box - click send
- Everyone is notified his address 'has registered this proof'.
As a registrar
- enter the title
ATITLE
in theregisterExistance
box - click send
- Everyone is notified that this proof exists.
As a citizen
- enter the title
BTITLE
in theproofOfExistance
box - click send
- citizen is notified by an exception 'this proof is NOT registered'.
As a citizen
- enter the title
ATITLE
in theproofOfExistance
box - click send
- Everyone is notified his address 'has registered this proof'.
The smart contract is Ownable
meaning it is owned by the deploying account (Registrar)
- Role: Registrar
- Only the Registrar can register proofs
- The Registrar can transfer the ownership of the contract to another address ie another Registrar
- The Registrar can renounce ownership of the contract meaning it will noo longer accept registrations.
- Role: Citizen
- The citizen can only request the
proofOfExistance
service. - Access to all other methods is restricted to the owner of the contract.
- The citizen can only request the
There is an opportunity to introduce decentralised filestorage for the documnent that the proof represents and then render a link to that document on proof of existance. A content addressed storage such as IPFS or filecoin would be a good fit.
It would be better to have IPFS generate the hash of the content off chain, since all calls on chain incur gas.
🙏 This project is a fork of scaffold-eth, a rapid feedback etheruem SDK (https://github.com/austintgriffith/scaffold-eth.git)