Skip to content

Commit

Permalink
tests: balance conciliation
Browse files Browse the repository at this point in the history
  • Loading branch information
geolffreym committed Jul 31, 2024
1 parent 21a7448 commit 1b994de
Show file tree
Hide file tree
Showing 10 changed files with 1,000 additions and 8 deletions.
940 changes: 940 additions & 0 deletions .openzeppelin/unknown-80002.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/Referendum.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "@openzeppelin/contracts/utils/Address.sol";
import "contracts/base/upgradeable/GovernableUpgradeable.sol";
import "contracts/base/upgradeable/QuorumUpgradeable.sol";
import "contracts/interfaces/IContentReferendum.sol";
import "contracts/libraries/constants/Types.sol";
import "contracts/libraries/Types.sol";

/// @title Content curation contract.
/// @notice This contract allows for the submission, voting, and approval/rejection of content.
Expand Down
2 changes: 1 addition & 1 deletion contracts/Repository.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

import "contracts/interfaces/IRepository.sol";
import "contracts/libraries/constants/Types.sol";
import "contracts/libraries/Types.sol";

/// @title Repository Contract
/// @notice Manages the addresses of different contract types and their versions.
Expand Down
2 changes: 1 addition & 1 deletion contracts/RightsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import "contracts/interfaces/IRegistrableVerifiable.sol";
import "contracts/interfaces/IReferendumVerifiable.sol";
import "contracts/interfaces/IRepository.sol";
import "contracts/libraries/TreasuryHelper.sol";
import "contracts/libraries/constants/Types.sol";
import "contracts/libraries/Types.sol";

/// @title Rights Manager
/// @notice This contract manages digital rights, allowing content holders to set prices, rent content, etc.
Expand Down
2 changes: 1 addition & 1 deletion contracts/Syndication.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import "contracts/base/upgradeable/QuorumUpgradeable.sol";
import "contracts/base/upgradeable/TreasurerUpgradeable.sol";
import "contracts/base/upgradeable/TreasuryUpgradeable.sol";

import "contracts/libraries/constants/Types.sol";
import "contracts/libraries/Types.sol";
import "contracts/interfaces/IRepository.sol";
import "contracts/interfaces/IDistributor.sol";
import "contracts/interfaces/ISyndicatable.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol
import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import "contracts/interfaces/IRightsAccessController.sol";
import "contracts/interfaces/IAccessWitness.sol";
import "contracts/libraries/constants/Types.sol";
import "contracts/libraries/Types.sol";

/// @title Rights Manager Content Access Upgradeable
/// @notice This contract manages access control for content based on timeframes.
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IRepository.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// NatSpec format convention - https://docs.soliditylang.org/en/v0.5.10/natspec-format.html
pragma solidity ^0.8.24;
import "contracts/libraries/constants/Types.sol";
import "contracts/libraries/Types.sol";

/**
* @title Repository Interface
Expand Down
9 changes: 9 additions & 0 deletions contracts/libraries/Constants.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: MIT
// NatSpec format convention - https://docs.soliditylang.org/en/v0.5.10/natspec-format.html
pragma solidity ^0.8.24;

library THash {
bytes32 private constant REFERENDUM_SUBMIT_TYPEHASH =
keccak256("Submission(uint256 contentId, address initiator, uint256 nonce,uint256 deadline)");

}
43 changes: 43 additions & 0 deletions contracts/libraries/Types.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// SPDX-License-Identifier: MIT
// NatSpec format convention - https://docs.soliditylang.org/en/v0.5.10/natspec-format.html
pragma solidity ^0.8.24;

/// @title Type Definitions Library
/// @notice This library provides common type definitions for use in other contracts.
/// @dev This library defines types and structures that can be imported and used in other contracts.
library T {
enum ContractTypes {
__, // Undefined type
SYNDICATION, // Syndication contract
TREASURY, // Treasury contract
REFERENDUM, // Content referendum
DRM // Digital Rights Management contract
}

/// @notice Structure to store an access condition.
/// @dev The structure contains the address of a witness contract and the selector of the function to call.
/// @param witnessContractAddress The address of the witness contract that provides testimony of the condition.
/// @param functionSelector The selector of the function that verifies the access condition.
struct AccessCondition {
address witnessContractAddress;
bytes4 functionSelector;
}

/**
* @notice A struct containing the necessary information to reconstruct an EIP-712 typed data signature.
* @dev We could use this information to handle signature logic with delegated actions from the account owner.
* @param signer The address of the signer. Specially needed as a parameter to support EIP-1271.
* @param v The signature's recovery parameter.
* @param r The signature's r parameter.
* @param s The signature's s parameter.
* @param deadline The signature's deadline.
*/
struct EIP712Signature {
address signer;
uint8 v;
bytes32 r;
bytes32 s;
uint256 deadline;
}

}
4 changes: 2 additions & 2 deletions contracts/modules/RentModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import "contracts/interfaces/IRightsManager.sol";
import "contracts/libraries/TreasuryHelper.sol";
import "contracts/libraries/MathHelper.sol";
import "contracts/modules/libraries/Types.sol";
import "contracts/libraries/constants/Types.sol";
import "contracts/libraries/Types.sol";

/**
* @title RentModule
Expand Down Expand Up @@ -183,7 +183,7 @@ contract RentModule is
// Grant initial custody to the distributor
drm.grantCustodial(rent.distributor, rent.contentId);
contentRegistry[pubId] = rent.contentId;

// Store renting parameters
_setPublicationRentSetting(rent, pubId);
// TODO royalties NFT
Expand Down

0 comments on commit 1b994de

Please sign in to comment.