This commit is contained in:
2026-04-05 00:43:23 +05:30
commit 8be37d3e92
425 changed files with 101853 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
contract AgreementRegistry {
struct Agreement {
bytes32 agreementHash;
string featureType;
string summary;
uint256 timestamp;
address registeredBy;
}
mapping(string => Agreement) public agreements; // negotiationId => Agreement
string[] public agreementIds;
event AgreementRegistered(
string indexed negotiationId,
bytes32 agreementHash,
string featureType,
string summary,
uint256 timestamp
);
function registerAgreement(
string calldata negotiationId,
bytes32 agreementHash,
string calldata featureType,
string calldata summary
) external {
agreements[negotiationId] = Agreement({
agreementHash: agreementHash,
featureType: featureType,
summary: summary,
timestamp: block.timestamp,
registeredBy: msg.sender
});
agreementIds.push(negotiationId);
emit AgreementRegistered(
negotiationId, agreementHash, featureType, summary, block.timestamp
);
}
function getAgreement(string calldata negotiationId)
external view returns (Agreement memory)
{
return agreements[negotiationId];
}
function totalAgreements() external view returns (uint256) {
return agreementIds.length;
}
}