🚀 Blockchain Hash Validation with PEG
Check out the PEG-powered contract that logs hash values and TPS on the blockchain! 💥 This smart contract, PegHashLogger, allows anyone to log performance data (like TPS) and retrieve it securely on the blockchain. 🚀
📜 Contract Code:
solidity
Copy
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract PegHashLogger {
event HashLogged(address indexed sender, string hashValue, uint256 tps, uint256 timestamp);
struct HashRecord {
string hashValue;
uint256 tps;
uint256 timestamp;
}
HashRecord[] public records;
function logHash(string memory hashValue, uint256 tps) external {
records.push(HashRecord(hashValue, tps, block.timestamp));
emit HashLogged(msg.sender, hashValue, tps, block.timestamp);
}
function getRecord(uint index) public view returns (string memory, uint256, uint256) {
require(index < records.length, "Index out of range");
HashRecord memory record = records[index];
return (record.hashValue, record.tps, record.timestamp);
}
function totalRecords() public view returns (uint256) {
return records.length;
}
}
⚡ How It Works:
Logs TPS values and hash records on the blockchain.
Securely stores and retrieves logs.
Anyone can validate the integrity of performance data over time!
💡 Instructions to run:
Copy the contract code to Remix IDE.
Deploy it to a testnet like Goerli or Sepolia.
Log TPS values and test how PEG operates in real-world environments.
Use the getRecord function to validate data integrity.
🌍 Perfect for validating your TPS performance on the blockchain!
Let’s push the limits of decentralized validation! 🌐