A decentralized application (dApp) is wanted. It should make use of the ProductFactory
smart contract and transactions with it should be possible using Metamask wallet integration.
The dApp must allow the user:
- To see all the products from the contract including its details.
- To create a new product using Metamask.
- To delegate a product using Metamask.
- To accept a product delegation using Metamask.
- To have a section where all the products delegated to the connected wallet are visible and the user is able to accept them.
The ProductFactory
smart contract is deployed on Polygon's Mumbai Testnet and its address is:
0xd9E0b2C0724F3a01AaECe3C44F8023371f845196
(Official Challenge Contract)
The dApp must be developed with ReactJS
and make use of the web3.js
library.
It is not mandatory to solve every task but it's better if you do. If you have to prioritize assume a lower order number is of a higher priority.
Will value every piece of documentation and/or tests included in the final solution.
Instructions (Ver aquí la versión en español)
- Clone the repository
- Install dependencies using
yarn
- Create .env file following the example of the .env.example file
- Put
0x13881
as the value ofchain_id
and the address of the contract incontract_address
- Make sure you have the following Metamask RPC node configured for Polygon Mumbai Testnet:
https://matic-mumbai.chainstacklabs.com
- Run the project using
yarn start
-
It is possible to see the latest version of the solution deployed on Heroku at the following link. To avoid spam and exposure of the official challenge contract, the same (verified) challenge code was deployed using Remix IDE at another address:
0x34251Bd869e4A8ef4C2661E7b3bC68dba2E7aC48
(Custom Challenge Contract). That contract does NOT correspond to the challenge but its code is identical to the original. -
The Chainstack Labs RPC node was chosen for the connection with Polygon Mumbai Testnet because the Matic Vigil public node has a rate limit of 40 calls per second. Make sure you have it configured in Metamask's Networks section before running the project. Please see the following link for other RPC node options:
-
An older version of
react-scripts
was used to compile the solution due to an incompatibility between the latest version of webpack that required polyfills for various modules that are not exclusively meant for web use. One solution was to eject the application in order to modify webpack, which is not recommended. The chosen solution (downgrading) was the best choice for most of the project users. -
The library used to facilitate project configurations (
foundry
) set the default line ending of files toLF
instead ofCRLF
. When compiling on Windows this produced an error and the build stopped. A general fix was done by configuring theeslintrc.json
file but if you experience any problems locally you should try running the following commands:git config core.autocrlf false
git rm --cached -r .
git reset --hard