@@ -8,21 +8,30 @@ This project is connected to a EVM (Ethereum Virtual Machine) compatible test bl
A direct connection to the blockchain cannot be established through the internet alone. Instead, it is essential to utilize a middleware service known as 'Nodes' to facilitate communication with the blockchain. For this project, we use a node provided by 'Alchemy', which offers additional useful services such as traffic analysis graphs and transaction logs. This setup ensures a reliable and efficient connection to the blockchain, allowing for seamless interaction with the network while also providing valuable insights into network activity and transaction history.
## Functionalities
As name before this project will be use to create, test and deploy the contracts. It is also possible to run the contracts locally for test support.
-**Create:** The contracts are code by using their own programming language, Solidity.
-**Test:** For the testing of the contracts, The projects uses the library "Chai" that is included when a Hardhat project is installed. In addition a package called 'Gas-Reporter' is implemented in the project. This will generate a document with the estimate the gass price of the tested function. The estimate price will be represented in USD and ETH.
For run the test use the following commnad
To test the contract, use the command:
```bash
npm run test:unit
```
-**Deploy:** For the deployment of the contracts in the blockchain.
-**Deploy:** To facilitate the deployment of contracts on the blockchain, the project employs the 'deploy' command, powered by Hardhat. This command takes advantage of the project's node to publish the contracts onto the blockchain. Specific contracts and their parameters for deployment are determined by JavaScript files located in the 'deploy' folder. These files are prefixed with numbers indicating the order of deployment, an essential feature for larger projects that might deploy multiple independent contracts. However, in this project's case, there is only one primary contract, simplifying the process.
To deploy the contract locally, use the command:
```bash
npm run deploy
```
To deploy the contract on the Sepolia tesnet, use the command:
```bash
npm run deploy:sepolia
```
It's crucial to understand that contract deployment should only occur after thorough testing. This is to ensure that potential system errors, which could negatively impact users, are minimized. Careful testing before deployment not only enhances system reliability but also helps avoid the complexities and additional efforts associated with deploying a new, revised contract on the blockchain.
## Contracts
...
...
@@ -37,3 +46,33 @@ npm run test:unit
### Libraries
-**TransactionStruct:** This library is essential for the TokenTrivia ecosystem, providing a standardized format for handling transaction data. It enables other contracts to efficiently manage and record various transactions, ensuring that all transactional information is consistently structured and easily accessible.
## Installation
To set up TokenTrivia web3 project on your local machine, follow these steps: