Skip to content

Commit

Permalink
feat: new events added to revoke/approve policy
Browse files Browse the repository at this point in the history
  • Loading branch information
geolffreym committed Sep 16, 2024
1 parent ccf93e6 commit 0157098
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion contracts/ContentVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.24;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "contracts/interfaces/IContentVault.sol";

// TODO upgradeable y inicializar con DRM
// TODO upgradeable y inicializar con Ownership
contract ContentVault is Initializable, IContentVault {
mapping(uint256 => bytes) secured; // Mapping to store encrypted content by content ID

Expand All @@ -14,6 +14,8 @@ contract ContentVault is Initializable, IContentVault {
return secured[contentId];
}

// TODO need access control

/// @notice Stores encrypted content in the vault.
/// @param contentId The identifier of the content.
/// @param encryptedContent The encrypted content to store.
Expand Down
12 changes: 8 additions & 4 deletions contracts/RightsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ contract RightsManager is
/// @param policy The policy contract address whose rights are being revoked.
/// @param holder The address of the content rights holder.
event RightsRevoked(address indexed policy, address holder);
event PolicyApproved(address indexed policy, address auditor);
event PolicyRevoked(address indexed policy, address auditor);

/// KIM: any initialization here is ephimeral and not included in bytecode..
/// so the code within a logic contract’s constructor or global declaration
Expand Down Expand Up @@ -291,8 +293,9 @@ contract RightsManager is
function approveAudit(
address policy
) external onlyPolicyContract(policy) onlyMod {
_approveAudit(policy, _msgSender());
// TODO add events
address auditor = _msgSender();
_approveAudit(policy, auditor);
emit PolicyApproved(policy, auditor);
}

/// @inheritdoc IRightsPolicyAuditor
Expand All @@ -301,8 +304,9 @@ contract RightsManager is
function revokeAudit(
address policy
) external onlyPolicyContract(policy) onlyMod {
_revokeAudit(policy, _msgSender());
// TODO add events
address auditor = _msgSender();
_revokeAudit(policy, auditor);
emit PolicyRevoked(policy, auditor);
}

/// @inheritdoc IRightsPolicyController
Expand Down

0 comments on commit 0157098

Please sign in to comment.