diff --git a/.github/workflows/cov-badge.svg b/.github/workflows/cov-badge.svg index a4ee1e2..7555191 100644 --- a/.github/workflows/cov-badge.svg +++ b/.github/workflows/cov-badge.svg @@ -1 +1 @@ -coveragecoverage37.31%37.31% \ No newline at end of file +coveragecoverage45.42%45.42% \ No newline at end of file diff --git a/README.md b/README.md index 05736c2..1b56a36 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,22 @@ By replacing discretionary decisions with deterministic smart contract execution ## System Overview +<<<<<<< HEAD +The protocol is composed of three hierarchical layers, each with a clear domain of responsibility, from foundational governance to operational logic and enforcement: +======= The architecture is composed of three modular layers, each with distinct responsibilities: +>>>>>>> origin/main ![image](https://github.com/user-attachments/assets/a1b2ead5-c1ff-48df-b48b-ff5d46762ac1) ### Level 3 — Rights Management Executes deterministic policy enforcement in real time, ensuring strict compliance with approved access and usage conditions. +<<<<<<< HEAD +- **Rights**: A module that manages policies authorization, defines usage conditions, and validates content custody. It ensures that only authorized entities can access or manage content, while enforcing predefined rules for usage and custody validation. +======= - **Rights:** Enforces access and custody conditions at runtime by resolving permissions and validating compliance against approved policies. +>>>>>>> origin/main ### Level 2 — Operational Layer: Assets, Policies, Custody & Finance Coordinates asset lifecycle, programmable policies, decentralized custody, and financial execution under governance-defined logic. diff --git a/contracts/core/interfaces/rights/IRightsAssetCustodianVerifiable.sol b/contracts/core/interfaces/rights/IRightsAssetCustodianVerifiable.sol index d949c3e..531114c 100644 --- a/contracts/core/interfaces/rights/IRightsAssetCustodianVerifiable.sol +++ b/contracts/core/interfaces/rights/IRightsAssetCustodianVerifiable.sol @@ -8,10 +8,10 @@ pragma solidity 0.8.26; interface IRightsAssetCustodianVerifiable { /// @notice Checks whether a custodian is currently assigned to a holder. /// @dev Returns true only if the custodian is active and listed for the specified holder. - /// @param holder The address of the asset rights holder. /// @param custodian The address of the custodian to verify. + /// @param holder The address of the asset rights holder. /// @return True if `custodian` is valid and assigned to `holder`, false otherwise. - function isCustodian(address holder, address custodian) external view returns (bool); + function isCustodian(address custodian, address holder) external view returns (bool); /// @notice Returns a custodian selected by a probabilistic balancing algorithm. /// @dev The selection is based on priority, demand and economic weight (balance). @@ -28,9 +28,9 @@ interface IRightsAssetCustodianVerifiable { /// @notice Calculates the weighted score of a custodian for a specific holder and currency. /// @dev Used to externally query the score that influences custodian selection. - /// @param holder The address of the rights holder. /// @param custodian The address of the custodian. + /// @param holder The address of the rights holder. /// @param currency The token used to evaluate economic backing. /// @return The computed weight used in the balancing algorithm. - function calcWeight(address holder, address custodian, address currency) external view returns (uint256); + function calcWeight(address custodian, address holder, address currency) external view returns (uint256); } diff --git a/contracts/economics/MMC.sol b/contracts/economics/MMC.sol index 6d16cf0..ed7584f 100644 --- a/contracts/economics/MMC.sol +++ b/contracts/economics/MMC.sol @@ -10,6 +10,7 @@ import { ERC20Votes } from "@openzeppelin/contracts/token/ERC20/extensions/ERC20 // https://eips.ethereum.org/EIPS/eip-2612 - permit // https://eips.ethereum.org/EIPS/eip-1363 - payable +// TODO upgradeable feature + DAO /// @title Multimedia Coin (MMC) /// @notice ERC20 token with governance and permit functionality. @@ -22,7 +23,9 @@ contract MMC is ERC20, ERC20Permit, ERC20Votes { _mint(initialHolder, totalSupply * (10 ** 18)); } - // TODO allowed restricted burn by treasury + function burn(uint256 amount) public virtual { + _burn(msg.sender, amount); + } /// @inheritdoc IERC20Permit function nonces(address owner) public view override(ERC20Permit, Nonces) returns (uint256) { diff --git a/contracts/economics/Tollgate.sol b/contracts/economics/Tollgate.sol index 782c232..6aa6387 100644 --- a/contracts/economics/Tollgate.sol +++ b/contracts/economics/Tollgate.sol @@ -41,9 +41,9 @@ contract Tollgate is Initializable, UUPSUpgradeable, AccessControlledUpgradeable /// @param currency The address of the unsupported currency. error UnsupportedCurrency(address target, address currency); - /// @notice Error for invalid target contexts. + /// @notice Error for invalid target scheme. /// @param target The address of the invalid target context. - error InvalidTargetContext(address target); + error InvalidTargetScheme(address target); /// @notice Error for invalid basis point fees. /// @param bps The provided basis point value. @@ -64,19 +64,24 @@ contract Tollgate is Initializable, UUPSUpgradeable, AccessControlledUpgradeable /// @notice Allows execution if the scheme is accepted or if support cannot be determined. /// @dev This modifier checks whether the `target` contract explicitly supports the scheme. - /// If `isFeeSchemeSupported` exists and returns `false`, the call is reverted with InvalidTargetContext. + /// If `isFeeSchemeSupported` exists and returns `false`, the call is reverted with InvalidTargetScheme. /// If the call to `v` fails (e.g., target does not implement the function or reverts) allowed by default. /// This enables compatibility with contracts that do not implement scheme validation. /// @param scheme The scheme to validate. /// @param target The address of the contract expected to support the scheme. modifier onlySupportedScheme(T.Scheme scheme, address target) { + // if target is zero address, revert with InvalidTargetScheme error + if (target == address(0) || target.code.length == 0) { + revert InvalidTargetScheme(target); + } + bytes memory callData = abi.encodeCall(IFeeSchemeValidator.isFeeSchemeSupported, (scheme)); (bool success, bytes memory result) = target.call(callData); // if the call was successful, the target implements the method and returned a result. // decode the result and validate the scheme acceptance. if (success) { bool ok = abi.decode(result, (bool)); - if (!ok) revert InvalidTargetContext(target); + if (!ok) revert InvalidTargetScheme(target); } // if call fails → by default all schemes are allowed @@ -144,7 +149,7 @@ contract Tollgate is Initializable, UUPSUpgradeable, AccessControlledUpgradeable // Example: If the target is the policy manager contract, the currency is MMC (ERC20 token), // and the scheme is NOMINAL, setting a fee of 10% means: // "In the policy manager contract, for MMC, using a nominal scheme, the fee is 10%." - if (target == address(0)) revert InvalidTargetContext(target); + if (target == address(0)) revert InvalidTargetScheme(target); bytes32 composedKey = _computeComposedKey(target, currency, scheme); _targetScheme[target] = scheme; // eg: rights manager => FLAT diff --git a/contracts/lifecycle/HookRegistry.sol b/contracts/lifecycle/HookRegistry.sol index 880bda0..bbe9f44 100644 --- a/contracts/lifecycle/HookRegistry.sol +++ b/contracts/lifecycle/HookRegistry.sol @@ -84,7 +84,7 @@ contract HookRegistry is Initializable, UUPSUpgradeable, AccessControlledUpgrade /// @notice Approves a registered hook contract. /// @param hook The address of the hook to be approved. /// Emits a HookApproved event upon success. - function approve(address hook) external onlyValidHook(hook) restricted { + function approve(address hook) external restricted { _approve(uint160(hook)); emit HookApproved(hook, msg.sender); } @@ -92,7 +92,7 @@ contract HookRegistry is Initializable, UUPSUpgradeable, AccessControlledUpgrade /// @notice Revokes a previously approved hook contract. /// @param hook The address of the hook to revoke. /// Emits a HookRevoked event upon success. - function reject(address hook) external onlyValidHook(hook) restricted { + function reject(address hook) external restricted { _revoke(uint160(hook)); emit HookRevoked(hook, msg.sender); } diff --git a/contracts/policies/PolicyAudit.sol b/contracts/policies/PolicyAudit.sol index 332f481..a26f250 100644 --- a/contracts/policies/PolicyAudit.sol +++ b/contracts/policies/PolicyAudit.sol @@ -75,7 +75,7 @@ contract PolicyAudit is Initializable, UUPSUpgradeable, AccessControlledUpgradea /// @notice Approves the audit of a given policy by a specified auditor. /// @param policy The address of the policy to be audited. /// @dev This function emits the PolicyApproved event upon successful audit approval. - function approve(address policy) external onlyValidPolicy(policy) restricted { + function approve(address policy) external restricted { _approve(uint160(policy)); emit PolicyApproved(policy, msg.sender); } @@ -83,7 +83,7 @@ contract PolicyAudit is Initializable, UUPSUpgradeable, AccessControlledUpgradea /// @notice Revokes the audit of a given policy by a specified auditor. /// @param policy The address of the policy whose audit is to be revoked. /// @dev This function emits the PolicyRevoked event upon successful audit revocation. - function reject(address policy) external onlyValidPolicy(policy) restricted { + function reject(address policy) external restricted { _revoke(uint160(policy)); emit PolicyRevoked(policy, msg.sender); } diff --git a/contracts/rights/RightsAssetCustodian.sol b/contracts/rights/RightsAssetCustodian.sol index 1bda7a9..55c2477 100644 --- a/contracts/rights/RightsAssetCustodian.sol +++ b/contracts/rights/RightsAssetCustodian.sol @@ -48,6 +48,12 @@ contract RightsAssetCustodian is Initializable, UUPSUpgradeable, AccessControlle /// @param demand The total number of holders currently assigned to the custodian (under custody). event CustodialRevoked(address indexed revokedCustody, address indexed rightsHolder, uint256 demand); + /// @notice Emitted when a priority is set or updated for a custodian by a rights holder. + /// @param holder The address of the rights holder. + /// @param custodian The address of the custodian whose priority was updated. + /// @param priority The new priority value set by the holder. + event PrioritySet(address indexed holder, address indexed custodian, uint256 priority); + /// @dev Error that is thrown when a content hash is already registered. error InvalidInactiveCustodian(); @@ -60,6 +66,10 @@ contract RightsAssetCustodian is Initializable, UUPSUpgradeable, AccessControlle /// @dev Error when failing to revoke custody from a custodian. error RevokeCustodyFailed(address custodian, address holder); + /// @dev Error thrown when an invalid priority value is provided. + /// @param priority The invalid priority value provided. + error InvalidPriority(uint256 priority); + /// @dev Modifier to check if the custodian is active and not blocked. /// @param custodian The custodian address to check. modifier onlyActiveCustodian(address custodian) { @@ -158,7 +168,7 @@ contract RightsAssetCustodian is Initializable, UUPSUpgradeable, AccessControlle /// @notice Checks if the given custodian is a custodian for the specified content holder /// @param holder The address of the asset holder. /// @param custodian The address of the custodian to check. - function isCustodian(address holder, address custodian) external view returns (bool) { + function isCustodian(address custodian, address holder) external view returns (bool) { return _custodians[holder].contains(custodian) && _isValidActiveCustodian(custodian); } @@ -288,8 +298,9 @@ contract RightsAssetCustodian is Initializable, UUPSUpgradeable, AccessControlle /// @param holder The address of the rights holder. /// @param priority The priority value (minimum 1). function _setPriority(address custodian, address holder, uint256 priority) private { - bytes32 relation = _computeComposedKey(holder, custodian); - _priority[relation] = priority > 0 ? priority : 1; // default 1 + if (priority == 0) revert InvalidPriority(priority); + _priority[_computeComposedKey(holder, custodian)] = priority; + emit PrioritySet(msg.sender, custodian, priority); } /// @dev Computes the weight of a custodian using the formula: diff --git a/lcov.info b/lcov.info index 24ffd5b..55d704a 100644 --- a/lcov.info +++ b/lcov.info @@ -1,24 +1,25 @@ TN: SF:contracts/access/AccessManager.sol -DA:17,57 +DA:17,65 FN:17,AccessManager.initialize -FNDA:57,AccessManager.initialize +FNDA:65,AccessManager.initialize DA:18,0 -DA:19,57 -DA:34,57 -DA:35,57 -DA:36,57 -DA:43,0 -FN:43,AccessManager._authorizeUpgrade +DA:19,65 +DA:68,65 +DA:69,65 +DA:70,65 +DA:71,65 +DA:78,0 +FN:78,AccessManager._authorizeUpgrade FNDA:0,AccessManager._authorizeUpgrade -DA:44,0 -DA:46,0 -BRDA:46,0,0,- -BRDA:46,0,1,- +DA:79,0 +DA:81,0 +BRDA:81,0,0,- +BRDA:81,0,1,- FNF:2 FNH:1 -LF:9 -LH:5 +LF:10 +LH:6 BRF:2 BRH:0 end_of_record @@ -53,50 +54,50 @@ DA:108,0 FN:108,AssetOwnership.supportsInterface FNDA:0,AssetOwnership.supportsInterface DA:111,0 -DA:127,5 -FN:127,AssetOwnership.register -FNDA:5,AssetOwnership.register DA:128,5 +FN:128,AssetOwnership.register +FNDA:5,AssetOwnership.register DA:129,5 DA:130,5 -DA:136,0 -FN:136,AssetOwnership.revoke -FNDA:0,AssetOwnership.revoke +DA:131,5 DA:137,0 +FN:137,AssetOwnership.revoke +FNDA:0,AssetOwnership.revoke DA:138,0 DA:139,0 -DA:145,0 -FN:145,AssetOwnership.transfer -FNDA:0,AssetOwnership.transfer +DA:140,0 DA:146,0 +FN:146,AssetOwnership.transfer +FNDA:0,AssetOwnership.transfer DA:147,0 -DA:154,0 -FN:154,AssetOwnership.switchState -FNDA:0,AssetOwnership.switchState +DA:148,0 DA:155,0 -DA:157,0 -DA:159,0 -DA:163,5 -FN:163,AssetOwnership._update +FN:155,AssetOwnership.switchState +FNDA:0,AssetOwnership.switchState +DA:156,0 +DA:158,0 +DA:160,0 +DA:164,5 +FN:164,AssetOwnership._update FNDA:5,AssetOwnership._update -DA:168,5 -DA:172,0 -FN:172,AssetOwnership._increaseBalance +DA:169,5 +DA:173,0 +FN:173,AssetOwnership._increaseBalance FNDA:0,AssetOwnership._increaseBalance -DA:176,0 -DA:181,0 -FN:181,AssetOwnership._authorizeUpgrade +DA:177,0 +DA:182,0 +FN:182,AssetOwnership._authorizeUpgrade FNDA:0,AssetOwnership._authorizeUpgrade -DA:184,5 -FN:184,AssetOwnership._enableAsset -FNDA:5,AssetOwnership._enableAsset DA:185,5 +FN:185,AssetOwnership._enableAsset +FNDA:5,AssetOwnership._enableAsset DA:186,5 -DA:190,0 -FN:190,AssetOwnership._disableAsset -FNDA:0,AssetOwnership._disableAsset +DA:187,5 DA:191,0 +FN:191,AssetOwnership._disableAsset +FNDA:0,AssetOwnership._disableAsset DA:192,0 +DA:193,0 FNF:14 FNH:6 LF:43 @@ -106,58 +107,57 @@ BRH:0 end_of_record TN: SF:contracts/assets/AssetReferendum.sol -DA:61,13 -FN:61,AssetReferendum.constructor +DA:58,13 +FN:58,AssetReferendum.constructor FNDA:13,AssetReferendum.constructor -DA:62,0 -DA:66,13 -FN:66,AssetReferendum.initialize +DA:59,0 +DA:63,13 +FN:63,AssetReferendum.initialize FNDA:13,AssetReferendum.initialize -DA:67,0 -DA:68,0 -DA:69,13 -DA:70,13 -DA:76,13 -FN:76,AssetReferendum.submit +DA:64,0 +DA:65,0 +DA:66,13 +DA:72,13 +FN:72,AssetReferendum.submit FNDA:13,AssetReferendum.submit -DA:78,13 -DA:79,13 -BRDA:79,0,0,- -DA:80,13 -DA:81,13 -DA:103,2 -FN:103,AssetReferendum.revoke +DA:74,13 +DA:75,13 +BRDA:75,0,0,- +DA:76,13 +DA:77,13 +DA:99,2 +FN:99,AssetReferendum.revoke FNDA:2,AssetReferendum.revoke -DA:104,2 -DA:105,2 -DA:110,2 -FN:110,AssetReferendum.reject +DA:100,2 +DA:101,2 +DA:106,2 +FN:106,AssetReferendum.reject FNDA:2,AssetReferendum.reject -DA:111,2 -DA:112,2 -DA:117,9 -FN:117,AssetReferendum.approve +DA:107,2 +DA:108,2 +DA:113,9 +FN:113,AssetReferendum.approve FNDA:9,AssetReferendum.approve -DA:118,9 -DA:119,9 -DA:125,9 -FN:125,AssetReferendum.isApproved +DA:114,9 +DA:115,9 +DA:121,9 +FN:121,AssetReferendum.isApproved FNDA:9,AssetReferendum.isApproved +DA:122,9 +DA:123,9 +DA:124,9 DA:126,9 -DA:127,9 -DA:128,9 -DA:130,9 -DA:135,13 -FN:135,AssetReferendum.isActive +DA:131,13 +FN:131,AssetReferendum.isActive FNDA:13,AssetReferendum.isActive -DA:136,13 -DA:142,0 -FN:142,AssetReferendum._authorizeUpgrade +DA:132,13 +DA:138,0 +FN:138,AssetReferendum._authorizeUpgrade FNDA:0,AssetReferendum._authorizeUpgrade FNF:9 FNH:8 -LF:29 -LH:25 +LF:28 +LH:24 BRF:1 BRH:0 end_of_record @@ -237,14 +237,14 @@ DA:21,2 DA:27,0 FN:27,FeesOps.perOf FNDA:0,FeesOps.perOf -DA:30,0 -BRDA:30,0,0,- -BRDA:30,0,1,- DA:31,0 -DA:36,0 -FN:36,FeesOps.calcBps -FNDA:0,FeesOps.calcBps +BRDA:31,0,0,- +BRDA:31,0,1,- +DA:32,0 DA:37,0 +FN:37,FeesOps.calcBps +FNDA:0,FeesOps.calcBps +DA:38,0 FNF:4 FNH:2 LF:9 @@ -260,22 +260,22 @@ FNDA:0,FinancialOps._nativeTransfer DA:25,0 DA:26,0 BRDA:26,0,0,- -DA:33,16 +DA:33,23 FN:33,FinancialOps._erc20Transfer -FNDA:16,FinancialOps._erc20Transfer -DA:34,16 +FNDA:23,FinancialOps._erc20Transfer +DA:34,23 DA:41,0 FN:41,FinancialOps._nativeDeposit FNDA:0,FinancialOps._nativeDeposit DA:42,0 BRDA:42,1,0,- DA:44,0 -DA:53,19 +DA:53,26 FN:53,FinancialOps._erc20Deposit -FNDA:19,FinancialOps._erc20Deposit -DA:54,19 +FNDA:26,FinancialOps._erc20Deposit +DA:54,26 BRDA:54,2,0,1 -DA:58,18 +DA:58,25 DA:59,0 DA:68,0 FN:68,FinancialOps.increaseAllowance @@ -283,32 +283,32 @@ FNDA:0,FinancialOps.increaseAllowance DA:69,0 BRDA:69,3,0,- DA:70,0 -DA:79,19 +DA:79,26 FN:79,FinancialOps.allowance -FNDA:19,FinancialOps.allowance -DA:80,19 -DA:81,19 -DA:90,19 +FNDA:26,FinancialOps.allowance +DA:80,26 +DA:81,26 +DA:90,26 FN:90,FinancialOps.safeDeposit -FNDA:19,FinancialOps.safeDeposit -DA:91,19 +FNDA:26,FinancialOps.safeDeposit +DA:91,26 BRDA:91,5,0,- -DA:92,19 -DA:93,19 -DA:99,23 +DA:92,26 +DA:93,26 +DA:99,30 FN:99,FinancialOps.balanceOf -FNDA:23,FinancialOps.balanceOf -DA:100,23 -DA:101,23 -DA:109,16 +FNDA:30,FinancialOps.balanceOf +DA:100,30 +DA:101,30 +DA:109,23 FN:109,FinancialOps.transfer -FNDA:16,FinancialOps.transfer -DA:110,16 +FNDA:23,FinancialOps.transfer +DA:110,23 BRDA:110,8,0,- -DA:111,16 +DA:111,23 BRDA:111,9,0,- -DA:112,16 -DA:113,16 +DA:112,23 +DA:113,23 FNF:9 FNH:6 LF:30 @@ -440,19 +440,19 @@ FNDA:0,AccessControlledUpgradeable.onlyAdmin DA:33,0 BRDA:33,0,0,- DA:34,0 -DA:44,118 +DA:44,209 FN:44,AccessControlledUpgradeable.__AccessControlled_init -FNDA:118,AccessControlledUpgradeable.__AccessControlled_init -DA:45,118 -DA:46,118 -DA:52,118 +FNDA:209,AccessControlledUpgradeable.__AccessControlled_init +DA:45,209 +DA:46,209 +DA:52,209 FN:52,AccessControlledUpgradeable.__AccessControlled_init_unchained -FNDA:118,AccessControlledUpgradeable.__AccessControlled_init_unchained -DA:53,118 +FNDA:209,AccessControlledUpgradeable.__AccessControlled_init_unchained +DA:53,209 BRDA:53,1,0,- DA:54,0 -DA:57,118 -DA:58,118 +DA:57,209 +DA:58,209 DA:65,9 FN:65,AccessControlledUpgradeable._hasRole FNDA:9,AccessControlledUpgradeable._hasRole @@ -460,9 +460,9 @@ DA:66,9 DA:67,9 DA:68,9 DA:69,9 -DA:73,127 +DA:73,218 FN:73,AccessControlledUpgradeable._getAccessControlStorage -FNDA:127,AccessControlledUpgradeable._getAccessControlStorage +FNDA:218,AccessControlledUpgradeable._getAccessControlStorage DA:75,0 FNF:5 FNH:4 @@ -473,9 +473,9 @@ BRH:0 end_of_record TN: SF:contracts/core/primitives/upgradeable/AllowanceOperatorUpgradeable.sol -DA:32,57 +DA:32,30 FN:32,AllowanceOperatorUpgradeable.__AllowanceOperator_init -FNDA:57,AllowanceOperatorUpgradeable.__AllowanceOperator_init +FNDA:30,AllowanceOperatorUpgradeable.__AllowanceOperator_init DA:33,0 DA:39,0 FN:39,AllowanceOperatorUpgradeable.__AllowanceOperator_init_unchained @@ -543,9 +543,9 @@ BRH:0 end_of_record TN: SF:contracts/core/primitives/upgradeable/BalanceOperatorUpgradeable.sol -DA:37,57 +DA:37,60 FN:37,BalanceOperatorUpgradeable.__BalanceOperator_init -FNDA:57,BalanceOperatorUpgradeable.__BalanceOperator_init +FNDA:60,BalanceOperatorUpgradeable.__BalanceOperator_init DA:38,0 DA:39,0 DA:44,0 @@ -555,21 +555,21 @@ DA:49,3 FN:49,BalanceOperatorUpgradeable.getBalance FNDA:3,BalanceOperatorUpgradeable.getBalance DA:50,3 -DA:57,19 +DA:57,26 FN:57,BalanceOperatorUpgradeable.deposit -FNDA:19,BalanceOperatorUpgradeable.deposit -DA:62,19 -DA:63,18 -DA:64,19 +FNDA:26,BalanceOperatorUpgradeable.deposit +DA:62,26 +DA:63,25 +DA:64,26 DA:65,0 -DA:72,15 +DA:72,22 FN:72,BalanceOperatorUpgradeable.withdraw -FNDA:15,BalanceOperatorUpgradeable.withdraw -DA:77,15 +FNDA:22,BalanceOperatorUpgradeable.withdraw +DA:77,22 BRDA:77,0,0,1 -DA:78,14 -DA:79,14 -DA:80,14 +DA:78,21 +DA:79,21 +DA:80,21 DA:81,0 DA:88,4 FN:88,BalanceOperatorUpgradeable.transfer @@ -649,24 +649,24 @@ FN:63,FeesCollectorUpgradeable.getTreasuryAddress FNDA:0,FeesCollectorUpgradeable.getTreasuryAddress DA:64,0 DA:65,0 -DA:72,16 +DA:72,30 FN:72,FeesCollectorUpgradeable.__FeesCollector_init -FNDA:16,FeesCollectorUpgradeable.__FeesCollector_init -DA:73,16 -DA:80,16 +FNDA:30,FeesCollectorUpgradeable.__FeesCollector_init +DA:73,30 +DA:80,30 FN:80,FeesCollectorUpgradeable.__FeesCollector_init_unchained -FNDA:16,FeesCollectorUpgradeable.__FeesCollector_init_unchained -DA:81,16 -DA:87,16 +FNDA:30,FeesCollectorUpgradeable.__FeesCollector_init_unchained +DA:81,30 +DA:87,30 FN:87,FeesCollectorUpgradeable._setTreasuryAddress -FNDA:16,FeesCollectorUpgradeable._setTreasuryAddress -DA:88,16 +FNDA:30,FeesCollectorUpgradeable._setTreasuryAddress +DA:88,30 BRDA:88,2,0,- -DA:89,16 -DA:90,16 -DA:96,16 +DA:89,30 +DA:90,30 +DA:96,30 FN:96,FeesCollectorUpgradeable._getFeesCollectorStorage -FNDA:16,FeesCollectorUpgradeable._getFeesCollectorStorage +FNDA:30,FeesCollectorUpgradeable._getFeesCollectorStorage DA:98,0 FNF:7 FNH:4 @@ -682,14 +682,14 @@ FN:28,LedgerUpgradeable.onlyValidOperation FNDA:5,LedgerUpgradeable.onlyValidOperation DA:29,5 BRDA:29,0,0,2 -DA:36,38 +DA:36,51 FN:36,LedgerUpgradeable.getLedgerBalance -FNDA:38,LedgerUpgradeable.getLedgerBalance -DA:37,38 -DA:38,38 -DA:45,114 +FNDA:51,LedgerUpgradeable.getLedgerBalance +DA:37,51 +DA:38,51 +DA:45,90 FN:45,LedgerUpgradeable.__Ledger_init -FNDA:114,LedgerUpgradeable.__Ledger_init +FNDA:90,LedgerUpgradeable.__Ledger_init DA:50,0 FN:50,LedgerUpgradeable.__Ledger_init_unchained FNDA:0,LedgerUpgradeable.__Ledger_init_unchained @@ -698,19 +698,19 @@ FN:57,LedgerUpgradeable._setLedgerEntry FNDA:1,LedgerUpgradeable._setLedgerEntry DA:58,1 DA:59,1 -DA:67,36 +DA:67,50 FN:67,LedgerUpgradeable._sumLedgerEntry -FNDA:36,LedgerUpgradeable._sumLedgerEntry -DA:68,36 -DA:69,36 -DA:77,30 +FNDA:50,LedgerUpgradeable._sumLedgerEntry +DA:68,50 +DA:69,50 +DA:77,44 FN:77,LedgerUpgradeable._subLedgerEntry -FNDA:30,LedgerUpgradeable._subLedgerEntry -DA:78,30 -DA:79,30 -DA:84,105 +FNDA:44,LedgerUpgradeable._subLedgerEntry +DA:78,44 +DA:79,44 +DA:84,146 FN:84,LedgerUpgradeable._getLedgerStorage -FNDA:105,LedgerUpgradeable._getLedgerStorage +FNDA:146,LedgerUpgradeable._getLedgerStorage DA:86,0 FNF:8 FNH:7 @@ -721,56 +721,56 @@ BRH:1 end_of_record TN: SF:contracts/core/primitives/upgradeable/QuorumUpgradeable.sol -DA:55,29 -FN:55,QuorumUpgradeable.__Quorum_init -FNDA:29,QuorumUpgradeable.__Quorum_init -DA:60,0 -FN:60,QuorumUpgradeable.__Quorum_init_unchained +DA:48,43 +FN:48,QuorumUpgradeable.__Quorum_init +FNDA:43,QuorumUpgradeable.__Quorum_init +DA:53,0 +FN:53,QuorumUpgradeable.__Quorum_init_unchained FNDA:0,QuorumUpgradeable.__Quorum_init_unchained -DA:64,91 -FN:64,QuorumUpgradeable._status -FNDA:91,QuorumUpgradeable._status -DA:65,91 -DA:66,91 -DA:72,7 -FN:72,QuorumUpgradeable._revoke +DA:57,115 +FN:57,QuorumUpgradeable._status +FNDA:115,QuorumUpgradeable._status +DA:58,115 +DA:59,115 +DA:65,7 +FN:65,QuorumUpgradeable._revoke FNDA:7,QuorumUpgradeable._revoke -DA:73,7 -DA:74,7 -BRDA:74,0,0,1 -DA:75,6 -DA:81,4 -FN:81,QuorumUpgradeable._block +DA:66,7 +DA:67,7 +BRDA:67,0,0,1 +DA:68,6 +DA:74,4 +FN:74,QuorumUpgradeable._block FNDA:4,QuorumUpgradeable._block -DA:82,4 -DA:83,4 -BRDA:83,1,0,- -DA:84,4 -DA:89,20 -FN:89,QuorumUpgradeable._approve -FNDA:20,QuorumUpgradeable._approve -DA:90,20 -DA:91,20 -BRDA:91,2,0,1 -DA:92,19 -DA:97,3 -FN:97,QuorumUpgradeable._quit +DA:75,4 +DA:76,4 +BRDA:76,1,0,- +DA:77,4 +DA:82,28 +FN:82,QuorumUpgradeable._approve +FNDA:28,QuorumUpgradeable._approve +DA:83,28 +DA:84,28 +BRDA:84,2,0,1 +DA:85,27 +DA:90,3 +FN:90,QuorumUpgradeable._quit FNDA:3,QuorumUpgradeable._quit -DA:98,3 -DA:99,3 -BRDA:99,3,0,2 -DA:100,1 -DA:105,34 -FN:105,QuorumUpgradeable._register -FNDA:34,QuorumUpgradeable._register -DA:106,34 -DA:107,34 -BRDA:107,4,0,1 -DA:108,33 -DA:112,159 -FN:112,QuorumUpgradeable._getRegistryStorage -FNDA:159,QuorumUpgradeable._getRegistryStorage -DA:114,0 +DA:91,3 +DA:92,3 +BRDA:92,3,0,2 +DA:93,1 +DA:98,41 +FN:98,QuorumUpgradeable._register +FNDA:41,QuorumUpgradeable._register +DA:99,41 +DA:100,41 +BRDA:100,4,0,1 +DA:101,40 +DA:105,198 +FN:105,QuorumUpgradeable._getRegistryStorage +FNDA:198,QuorumUpgradeable._getRegistryStorage +DA:107,0 FNF:9 FNH:8 LF:27 @@ -780,84 +780,88 @@ BRH:4 end_of_record TN: SF:contracts/custody/CustodianFactory.sol -DA:49,0 -FN:49,CustodianFactory.getCreator -FNDA:0,CustodianFactory.getCreator DA:50,0 -DA:60,28 -FN:60,CustodianFactory.create -FNDA:28,CustodianFactory.create -DA:63,28 -DA:64,28 -DA:65,28 -DA:67,28 -DA:68,0 -DA:74,28 -FN:74,CustodianFactory._registerEndpoint -FNDA:28,CustodianFactory._registerEndpoint -DA:75,28 -DA:76,28 -BRDA:76,0,0,- -DA:77,28 -DA:78,0 -DA:84,28 -FN:84,CustodianFactory._deployCustodian -FNDA:28,CustodianFactory._deployCustodian -DA:85,28 -DA:86,28 -DA:92,28 -FN:92,CustodianFactory._registerManager -FNDA:28,CustodianFactory._registerManager -DA:93,28 -FNF:5 -FNH:4 -LF:18 -LH:14 +FN:50,CustodianFactory.getCreator +FNDA:0,CustodianFactory.getCreator +DA:51,0 +DA:58,21 +FN:58,CustodianFactory.isRegistered +FNDA:21,CustodianFactory.isRegistered +DA:59,21 +DA:66,32 +FN:66,CustodianFactory.create +FNDA:32,CustodianFactory.create +DA:67,32 +DA:68,32 +DA:69,32 +DA:71,32 +DA:72,0 +DA:78,32 +FN:78,CustodianFactory._registerEndpoint +FNDA:32,CustodianFactory._registerEndpoint +DA:79,32 +DA:80,32 +BRDA:80,0,0,- +DA:81,32 +DA:82,0 +DA:88,32 +FN:88,CustodianFactory._deployCustodian +FNDA:32,CustodianFactory._deployCustodian +DA:89,32 +DA:90,32 +DA:96,32 +FN:96,CustodianFactory._registerManager +FNDA:32,CustodianFactory._registerManager +DA:97,32 +FNF:6 +FNH:5 +LF:20 +LH:16 BRF:1 BRH:0 end_of_record TN: SF:contracts/custody/CustodianImpl.sol -DA:41,28 -FN:41,CustodianImpl.initialize -FNDA:28,CustodianImpl.initialize -DA:42,28 -BRDA:42,0,0,- -DA:43,0 -DA:44,28 -DA:45,28 -DA:50,82 -FN:50,CustodianImpl.supportsInterface -FNDA:82,CustodianImpl.supportsInterface -DA:51,82 -DA:55,1 -FN:55,CustodianImpl.getManager +DA:49,32 +FN:49,CustodianImpl.initialize +FNDA:32,CustodianImpl.initialize +DA:50,32 +BRDA:50,0,0,- +DA:51,0 +DA:52,32 +DA:53,32 +DA:58,1 +FN:58,CustodianImpl.supportsInterface +FNDA:1,CustodianImpl.supportsInterface +DA:59,1 +DA:63,1 +FN:63,CustodianImpl.getManager FNDA:1,CustodianImpl.getManager -DA:56,1 -DA:60,2 -FN:60,CustodianImpl.getEndpoint +DA:64,1 +DA:68,2 +FN:68,CustodianImpl.getEndpoint FNDA:2,CustodianImpl.getEndpoint -DA:61,2 -DA:67,1 -FN:67,CustodianImpl.setEndpoint +DA:69,2 +DA:75,1 +FN:75,CustodianImpl.setEndpoint FNDA:1,CustodianImpl.setEndpoint -DA:68,1 -BRDA:68,1,0,- -DA:69,1 -DA:70,1 -DA:71,1 -DA:80,3 -FN:80,CustodianImpl.withdraw +DA:76,1 +BRDA:76,1,0,- +DA:77,1 +DA:78,1 +DA:79,1 +DA:88,3 +FN:88,CustodianImpl.withdraw FNDA:3,CustodianImpl.withdraw -DA:81,3 -BRDA:81,2,0,1 -DA:82,2 -DA:83,2 -DA:84,0 -DA:90,4 -FN:90,CustodianImpl.getBalance +DA:89,3 +BRDA:89,2,0,1 +DA:90,2 +DA:91,2 +DA:92,0 +DA:100,4 +FN:100,CustodianImpl.getBalance FNDA:4,CustodianImpl.getBalance -DA:91,4 +DA:101,4 FNF:7 FNH:7 LF:23 @@ -867,367 +871,384 @@ BRH:1 end_of_record TN: SF:contracts/custody/CustodianReferendum.sol -DA:85,3 -FN:85,CustodianReferendum.onlyValidCustodian -FNDA:3,CustodianReferendum.onlyValidCustodian -DA:86,3 -BRDA:86,0,0,- -DA:87,0 -DA:93,16 -FN:93,CustodianReferendum.constructor -FNDA:16,CustodianReferendum.constructor -DA:96,0 -DA:97,16 -DA:98,16 -DA:99,16 -DA:103,16 -FN:103,CustodianReferendum.initialize -FNDA:16,CustodianReferendum.initialize -DA:104,0 -DA:105,0 -DA:106,0 -DA:107,16 -DA:108,16 -DA:110,16 -DA:114,3 -FN:114,CustodianReferendum.getExpirationPeriod +DA:71,21 +FN:71,CustodianReferendum.onlyValidCustodian +FNDA:21,CustodianReferendum.onlyValidCustodian +DA:73,21 +BRDA:73,0,0,1 +DA:74,1 +DA:80,30 +FN:80,CustodianReferendum.constructor +FNDA:30,CustodianReferendum.constructor +DA:83,0 +DA:84,30 +DA:85,30 +DA:89,30 +FN:89,CustodianReferendum.initialize +FNDA:30,CustodianReferendum.initialize +DA:90,0 +DA:91,0 +DA:92,30 +DA:94,30 +DA:100,22 +FN:100,CustodianReferendum.isFeeSchemeSupported +FNDA:22,CustodianReferendum.isFeeSchemeSupported +DA:102,22 +DA:106,3 +FN:106,CustodianReferendum.getExpirationPeriod FNDA:3,CustodianReferendum.getExpirationPeriod -DA:115,3 -DA:120,1 -FN:120,CustodianReferendum.getEnrollmentDeadline +DA:107,3 +DA:112,1 +FN:112,CustodianReferendum.getEnrollmentDeadline FNDA:1,CustodianReferendum.getEnrollmentDeadline -DA:121,1 -DA:125,2 -FN:125,CustodianReferendum.getEnrollmentCount +DA:113,1 +DA:117,2 +FN:117,CustodianReferendum.getEnrollmentCount FNDA:2,CustodianReferendum.getEnrollmentCount -DA:126,2 -DA:132,1 -FN:132,CustodianReferendum.isActive -FNDA:1,CustodianReferendum.isActive -DA:147,1 -DA:148,1 -DA:154,1 -FN:154,CustodianReferendum.isWaiting +DA:118,2 +DA:124,10 +FN:124,CustodianReferendum.isActive +FNDA:10,CustodianReferendum.isActive +DA:139,10 +DA:140,10 +DA:146,1 +FN:146,CustodianReferendum.isWaiting FNDA:1,CustodianReferendum.isWaiting -DA:155,1 -DA:161,1 -FN:161,CustodianReferendum.isBlocked +DA:147,1 +DA:153,1 +FN:153,CustodianReferendum.isBlocked FNDA:1,CustodianReferendum.isBlocked -DA:162,1 -DA:168,13 -FN:168,CustodianReferendum.register -FNDA:13,CustodianReferendum.register -DA:181,13 -DA:182,13 -BRDA:182,1,0,- -DA:186,13 -DA:187,12 -DA:188,12 -DA:190,12 -DA:193,12 -DA:194,12 -DA:199,8 -FN:199,CustodianReferendum.approve -FNDA:8,CustodianReferendum.approve -DA:200,8 -DA:201,8 -DA:202,8 -DA:207,3 -FN:207,CustodianReferendum.revoke +DA:154,1 +DA:160,20 +FN:160,CustodianReferendum.register +FNDA:20,CustodianReferendum.register +DA:174,20 +DA:175,19 +BRDA:175,1,0,- +DA:176,0 +DA:180,19 +DA:183,19 +DA:184,19 +DA:189,16 +FN:189,CustodianReferendum.approve +FNDA:16,CustodianReferendum.approve +DA:190,16 +DA:191,16 +DA:192,16 +DA:197,3 +FN:197,CustodianReferendum.revoke FNDA:3,CustodianReferendum.revoke -DA:208,3 -DA:209,3 -DA:210,3 -DA:215,2 -FN:215,CustodianReferendum.setExpirationPeriod +DA:198,3 +DA:199,3 +DA:200,3 +DA:205,2 +FN:205,CustodianReferendum.setExpirationPeriod FNDA:2,CustodianReferendum.setExpirationPeriod -DA:216,2 -DA:217,2 -DA:223,0 -FN:223,CustodianReferendum._authorizeUpgrade +DA:206,2 +DA:207,2 +DA:213,0 +FN:213,CustodianReferendum._authorizeUpgrade FNDA:0,CustodianReferendum._authorizeUpgrade -FNF:14 -FNH:13 -LF:49 -LH:43 +FNF:15 +FNH:14 +LF:46 +LH:41 BRF:2 -BRH:0 +BRH:1 end_of_record TN: SF:contracts/economics/MMC.sol -DA:18,44 -FN:18,MMC.constructor -FNDA:44,MMC.constructor -DA:22,44 -DA:28,0 -FN:28,MMC.nonces +DA:19,52 +FN:19,MMC.constructor +FNDA:52,MMC.constructor +DA:23,52 +DA:26,0 +FN:26,MMC.burn +FNDA:0,MMC.burn +DA:27,0 +DA:31,0 +FN:31,MMC.nonces FNDA:0,MMC.nonces -DA:29,0 -DA:33,81 -FN:33,MMC._update -FNDA:81,MMC._update -DA:34,81 -FNF:3 +DA:32,0 +DA:36,103 +FN:36,MMC._update +FNDA:103,MMC._update +DA:37,103 +FNF:4 FNH:2 -LF:6 +LF:8 LH:4 BRF:0 BRH:0 end_of_record TN: SF:contracts/economics/Tollgate.sol -DA:58,21 -FN:58,Tollgate.onlyValidFeeRepresentation -FNDA:21,Tollgate.onlyValidFeeRepresentation -DA:59,21 -BRDA:59,0,0,1 -DA:60,20 -BRDA:60,1,0,1 -DA:65,22 -FN:65,Tollgate.constructor -FNDA:22,Tollgate.constructor -DA:66,0 -DA:71,22 -FN:71,Tollgate.initialize -FNDA:22,Tollgate.initialize -DA:72,0 -DA:73,22 -DA:80,0 -FN:80,Tollgate.isSupportedCurrency -FNDA:0,Tollgate.isSupportedCurrency -DA:81,0 -DA:87,0 -FN:87,Tollgate.supportedCurrencies -FNDA:0,Tollgate.supportedCurrencies -DA:88,0 -DA:95,18 -FN:95,Tollgate.getFees -FNDA:18,Tollgate.getFees -DA:97,18 -BRDA:97,2,0,- -DA:98,0 -DA:101,18 -DA:102,18 -DA:103,18 -DA:104,18 -DA:112,19 -FN:112,Tollgate.setFees -FNDA:19,Tollgate.setFees -DA:125,19 -BRDA:125,3,0,- -DA:126,19 -DA:128,19 -DA:129,19 -DA:130,19 -DA:131,19 -DA:136,0 -FN:136,Tollgate._authorizeUpgrade +DA:59,30 +FN:59,Tollgate.onlyValidFeeRepresentation +FNDA:30,Tollgate.onlyValidFeeRepresentation +DA:60,30 +BRDA:60,0,0,1 +DA:61,29 +BRDA:61,1,0,1 +DA:72,31 +FN:72,Tollgate.onlySupportedScheme +FNDA:31,Tollgate.onlySupportedScheme +DA:74,31 +BRDA:74,2,0,- +DA:75,0 +DA:78,31 +DA:79,31 +DA:82,23 +BRDA:82,3,0,23 +DA:83,23 +DA:84,23 +BRDA:84,4,0,1 +DA:92,30 +FN:92,Tollgate.constructor +FNDA:30,Tollgate.constructor +DA:93,0 +DA:98,30 +FN:98,Tollgate.initialize +FNDA:30,Tollgate.initialize +DA:99,0 +DA:100,30 +DA:107,38 +FN:107,Tollgate.isSupportedCurrency +FNDA:38,Tollgate.isSupportedCurrency +DA:108,38 +DA:114,1 +FN:114,Tollgate.supportedCurrencies +FNDA:1,Tollgate.supportedCurrencies +DA:115,1 +DA:122,25 +FN:122,Tollgate.getFees +FNDA:25,Tollgate.getFees +DA:124,25 +BRDA:124,5,0,1 +DA:125,1 +DA:128,24 +DA:129,24 +DA:130,24 +DA:131,24 +DA:139,28 +FN:139,Tollgate.setFees +FNDA:28,Tollgate.setFees +DA:152,28 +BRDA:152,6,0,- +DA:153,28 +DA:155,28 +DA:156,28 +DA:157,28 +DA:158,28 +DA:163,0 +FN:163,Tollgate._authorizeUpgrade FNDA:0,Tollgate._authorizeUpgrade -DA:142,18 -FN:142,Tollgate._isSchemeSupported -FNDA:18,Tollgate._isSchemeSupported -DA:143,18 -DA:144,18 -DA:145,18 -DA:153,55 -FN:153,Tollgate._computeComposedKey -FNDA:55,Tollgate._computeComposedKey -DA:154,55 -FNF:10 -FNH:7 -LF:33 -LH:25 -BRF:4 -BRH:2 +DA:169,63 +FN:169,Tollgate._isSchemeSupported +FNDA:63,Tollgate._isSchemeSupported +DA:170,63 +DA:171,63 +DA:172,63 +DA:180,115 +FN:180,Tollgate._computeComposedKey +FNDA:115,Tollgate._computeComposedKey +DA:181,115 +FNF:11 +FNH:10 +LF:41 +LH:37 +BRF:7 +BRH:5 end_of_record TN: SF:contracts/economics/Treasury.sol -DA:36,0 -FN:36,Treasury.constructor -FNDA:0,Treasury.constructor -DA:39,0 +DA:35,30 +FN:35,Treasury.constructor +FNDA:30,Treasury.constructor +DA:38,0 +DA:41,30 +FN:41,Treasury.initialize +FNDA:30,Treasury.initialize DA:42,0 -FN:42,Treasury.initialize -FNDA:0,Treasury.initialize DA:43,0 -DA:44,0 -DA:45,0 -DA:60,0 -FN:60,Treasury.deposit +DA:44,30 +DA:59,0 +FN:59,Treasury.deposit FNDA:0,Treasury.deposit -DA:67,0 -DA:76,0 -FN:76,Treasury.collectFees +DA:66,0 +DA:75,0 +FN:75,Treasury.collectFees FNDA:0,Treasury.collectFees +DA:76,0 DA:77,0 DA:78,0 DA:79,0 -DA:80,0 -DA:86,0 -FN:86,Treasury._authorizeUpgrade +DA:85,0 +FN:85,Treasury._authorizeUpgrade FNDA:0,Treasury._authorizeUpgrade FNF:5 -FNH:0 +FNH:2 LF:14 -LH:0 +LH:3 BRF:0 BRH:0 end_of_record TN: SF:contracts/financial/AgreementManager.sol -DA:67,0 +DA:67,19 FN:67,AgreementManager.onlySupportedCurrency -FNDA:0,AgreementManager.onlySupportedCurrency -DA:68,0 -DA:69,0 +FNDA:19,AgreementManager.onlySupportedCurrency +DA:68,19 +DA:69,19 BRDA:69,0,0,- -DA:74,0 +DA:74,30 FN:74,AgreementManager.constructor -FNDA:0,AgreementManager.constructor +FNDA:30,AgreementManager.constructor DA:77,0 -DA:79,0 -DA:80,0 -DA:84,0 +DA:79,30 +DA:80,30 +DA:84,30 FN:84,AgreementManager.initialize -FNDA:0,AgreementManager.initialize +FNDA:30,AgreementManager.initialize DA:85,0 -DA:86,0 -DA:95,0 +DA:86,30 +DA:95,19 FN:95,AgreementManager.createAgreement -FNDA:0,AgreementManager.createAgreement -DA:103,0 -DA:104,0 -DA:107,0 -DA:108,0 +FNDA:19,AgreementManager.createAgreement +DA:103,19 +DA:104,19 +DA:107,19 +DA:108,19 DA:109,0 -DA:114,0 +DA:114,20 FN:114,AgreementManager.getAgreement -FNDA:0,AgreementManager.getAgreement -DA:115,0 -DA:124,0 +FNDA:20,AgreementManager.getAgreement +DA:115,20 +DA:124,19 FN:124,AgreementManager.previewAgreement -FNDA:0,AgreementManager.previewAgreement -DA:131,0 +FNDA:19,AgreementManager.previewAgreement +DA:131,19 BRDA:131,1,0,- DA:132,0 -DA:150,0 -DA:153,0 -DA:168,0 -FN:168,AgreementManager._authorizeUpgrade +DA:151,19 +DA:154,19 +DA:169,0 +FN:169,AgreementManager._authorizeUpgrade FNDA:0,AgreementManager._authorizeUpgrade -DA:171,0 -FN:171,AgreementManager._createAndStoreProof -FNDA:0,AgreementManager._createAndStoreProof -DA:173,0 -DA:174,0 -DA:175,0 -DA:176,0 -DA:185,0 -FN:185,AgreementManager._calcFees -FNDA:0,AgreementManager._calcFees -DA:187,0 -DA:188,0 -DA:189,0 -DA:190,0 -BRDA:190,4,0,- -DA:191,0 +DA:172,19 +FN:172,AgreementManager._createAndStoreProof +FNDA:19,AgreementManager._createAndStoreProof +DA:174,19 +DA:175,19 +DA:176,19 +DA:177,0 +DA:186,19 +FN:186,AgreementManager._calcFees +FNDA:19,AgreementManager._calcFees +DA:188,19 +DA:189,19 +DA:190,19 +DA:191,19 +BRDA:191,4,0,- +DA:192,19 FNF:9 -FNH:0 +FNH:8 LF:35 -LH:0 +LH:29 BRF:3 BRH:0 end_of_record TN: SF:contracts/financial/AgreementSettler.sol -DA:82,0 -FN:82,AgreementSettler.onlyValidAgreement +DA:85,0 +FN:85,AgreementSettler.onlyValidAgreement FNDA:0,AgreementSettler.onlyValidAgreement -DA:83,0 -BRDA:83,0,0,- -DA:84,0 -DA:90,0 -FN:90,AgreementSettler.constructor -FNDA:0,AgreementSettler.constructor -DA:93,0 -DA:94,0 -DA:95,0 +DA:86,0 +BRDA:86,0,0,- +DA:87,0 +DA:93,30 +FN:93,AgreementSettler.constructor +FNDA:30,AgreementSettler.constructor DA:96,0 -DA:100,0 -FN:100,AgreementSettler.initialize -FNDA:0,AgreementSettler.initialize -DA:101,0 -DA:102,0 -DA:103,0 +DA:97,30 +DA:98,30 +DA:99,30 +DA:103,30 +FN:103,AgreementSettler.initialize +FNDA:30,AgreementSettler.initialize DA:104,0 -DA:121,0 -FN:121,AgreementSettler.quitAgreement -FNDA:0,AgreementSettler.quitAgreement -DA:122,0 +DA:105,30 +DA:106,30 DA:123,0 -BRDA:123,1,0,- -DA:138,0 +FN:123,AgreementSettler.quitAgreement +FNDA:0,AgreementSettler.quitAgreement +DA:124,0 +DA:125,0 +BRDA:125,1,0,- DA:139,0 DA:140,0 DA:141,0 -DA:143,0 -DA:146,0 +DA:142,0 +DA:144,0 DA:147,0 DA:148,0 DA:150,0 -DA:151,0 -DA:157,0 -FN:157,AgreementSettler.settleAgreement -FNDA:0,AgreementSettler.settleAgreement -DA:162,0 -DA:163,0 -BRDA:163,2,0,- -DA:165,0 -DA:166,0 -DA:167,0 -DA:168,0 -DA:169,0 -DA:173,0 -DA:177,0 -DA:178,0 -DA:179,0 -DA:182,0 -DA:183,0 -DA:189,0 -FN:189,AgreementSettler._authorizeUpgrade +BRDA:150,2,0,- +DA:152,0 +DA:153,0 +DA:159,20 +FN:159,AgreementSettler.settleAgreement +FNDA:20,AgreementSettler.settleAgreement +DA:164,20 +DA:165,20 +BRDA:165,3,0,1 +DA:167,19 +DA:168,19 +DA:169,19 +DA:170,19 +DA:171,19 +DA:176,19 +DA:179,19 +DA:180,19 +DA:182,19 +BRDA:182,4,0,- +DA:183,19 +DA:184,0 +DA:190,0 +FN:190,AgreementSettler._authorizeUpgrade FNDA:0,AgreementSettler._authorizeUpgrade -DA:193,0 -FN:193,AgreementSettler._setProofAsSettled -FNDA:0,AgreementSettler._setProofAsSettled -DA:194,0 +DA:194,19 +FN:194,AgreementSettler._setProofAsSettled +FNDA:19,AgreementSettler._setProofAsSettled +DA:195,19 FNF:7 -FNH:0 -LF:43 -LH:0 -BRF:3 -BRH:0 +FNH:4 +LF:42 +LH:22 +BRF:5 +BRH:1 end_of_record TN: SF:contracts/financial/LedgerVault.sol -DA:65,57 +DA:65,30 FN:65,LedgerVault.constructor -FNDA:57,LedgerVault.constructor +FNDA:30,LedgerVault.constructor DA:68,0 -DA:71,57 +DA:71,30 FN:71,LedgerVault.initialize -FNDA:57,LedgerVault.initialize +FNDA:30,LedgerVault.initialize DA:72,0 DA:73,0 DA:74,0 -DA:75,57 -DA:85,13 +DA:75,30 +DA:85,19 FN:85,LedgerVault.lock -FNDA:13,LedgerVault.lock -DA:90,13 -BRDA:90,0,0,1 -DA:91,12 -DA:92,12 -DA:93,12 +FNDA:19,LedgerVault.lock +DA:90,19 +BRDA:90,0,0,- +DA:91,19 +DA:92,19 +DA:93,19 DA:94,0 DA:101,0 FN:101,LedgerVault.release @@ -1238,27 +1259,27 @@ DA:107,0 DA:108,0 DA:109,0 DA:110,0 -DA:119,12 +DA:119,19 FN:119,LedgerVault.claim -FNDA:12,LedgerVault.claim -DA:124,12 +FNDA:19,LedgerVault.claim +DA:124,19 BRDA:124,2,0,- -DA:125,12 -DA:126,12 -DA:127,12 +DA:125,19 +DA:126,19 +DA:127,19 DA:128,0 -DA:136,12 +DA:136,19 FN:136,LedgerVault._subLockedAmount -FNDA:12,LedgerVault._subLockedAmount -DA:137,12 -DA:145,12 +FNDA:19,LedgerVault._subLockedAmount +DA:137,19 +DA:145,19 FN:145,LedgerVault._sumLockedAmount -FNDA:12,LedgerVault._sumLockedAmount -DA:146,12 -DA:154,12 +FNDA:19,LedgerVault._sumLockedAmount +DA:146,19 +DA:154,19 FN:154,LedgerVault._getLockedAmount -FNDA:12,LedgerVault._getLockedAmount -DA:155,12 +FNDA:19,LedgerVault._getLockedAmount +DA:155,19 DA:161,0 FN:161,LedgerVault._authorizeUpgrade FNDA:0,LedgerVault._authorizeUpgrade @@ -1267,7 +1288,7 @@ FNH:7 LF:32 LH:19 BRF:3 -BRH:1 +BRH:0 end_of_record TN: SF:contracts/governance/Governance.sol @@ -1307,44 +1328,116 @@ BRF:0 BRH:0 end_of_record TN: +SF:contracts/lifecycle/HookBase.sol +DA:14,0 +FN:14,HookBase.validate +FNDA:0,HookBase.validate +DA:19,0 +FN:19,HookBase.execute +FNDA:0,HookBase.execute +DA:23,0 +FN:23,HookBase.verify +FNDA:0,HookBase.verify +FNF:3 +FNH:0 +LF:3 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:contracts/lifecycle/HookRegistry.sol +DA:51,0 +FN:51,HookRegistry.onlyValidHook +FNDA:0,HookRegistry.onlyValidHook +DA:52,0 +BRDA:52,0,0,- +DA:53,0 +DA:60,0 +FN:60,HookRegistry.constructor +FNDA:0,HookRegistry.constructor +DA:62,0 +DA:67,0 +FN:67,HookRegistry.initialize +FNDA:0,HookRegistry.initialize +DA:68,0 +DA:69,0 +DA:70,0 +DA:78,0 +FN:78,HookRegistry.submit +FNDA:0,HookRegistry.submit +DA:79,0 +DA:80,0 +DA:81,0 +DA:87,0 +FN:87,HookRegistry.approve +FNDA:0,HookRegistry.approve +DA:88,0 +DA:89,0 +DA:95,0 +FN:95,HookRegistry.reject +FNDA:0,HookRegistry.reject +DA:96,0 +DA:97,0 +DA:103,0 +FN:103,HookRegistry.lookup +FNDA:0,HookRegistry.lookup +DA:104,0 +DA:110,0 +FN:110,HookRegistry.isActive +FNDA:0,HookRegistry.isActive +DA:111,0 +DA:112,0 +DA:113,0 +DA:119,0 +FN:119,HookRegistry._authorizeUpgrade +FNDA:0,HookRegistry._authorizeUpgrade +FNF:9 +FNH:0 +LF:26 +LH:0 +BRF:1 +BRH:0 +end_of_record +TN: SF:contracts/policies/PolicyAudit.sol -DA:43,0 -FN:43,PolicyAudit.onlyValidPolicy -FNDA:0,PolicyAudit.onlyValidPolicy DA:44,0 -BRDA:44,0,0,- +FN:44,PolicyAudit.onlyValidPolicy +FNDA:0,PolicyAudit.onlyValidPolicy DA:45,0 -DA:52,0 -FN:52,PolicyAudit.constructor -FNDA:0,PolicyAudit.constructor +BRDA:45,0,0,- +DA:46,0 DA:53,0 -DA:58,0 -FN:58,PolicyAudit.initialize -FNDA:0,PolicyAudit.initialize +FN:53,PolicyAudit.constructor +FNDA:0,PolicyAudit.constructor +DA:54,0 DA:59,0 +FN:59,PolicyAudit.initialize +FNDA:0,PolicyAudit.initialize DA:60,0 DA:61,0 -DA:69,0 -FN:69,PolicyAudit.submit -FNDA:0,PolicyAudit.submit +DA:62,0 DA:70,0 +FN:70,PolicyAudit.submit +FNDA:0,PolicyAudit.submit DA:71,0 -DA:77,0 -FN:77,PolicyAudit.approve -FNDA:0,PolicyAudit.approve +DA:72,0 DA:78,0 +FN:78,PolicyAudit.approve +FNDA:0,PolicyAudit.approve DA:79,0 -DA:85,0 -FN:85,PolicyAudit.reject -FNDA:0,PolicyAudit.reject +DA:80,0 DA:86,0 +FN:86,PolicyAudit.reject +FNDA:0,PolicyAudit.reject DA:87,0 -DA:92,0 -FN:92,PolicyAudit.isAudited -FNDA:0,PolicyAudit.isAudited +DA:88,0 DA:93,0 -DA:99,0 -FN:99,PolicyAudit._authorizeUpgrade +FN:93,PolicyAudit.isAudited +FNDA:0,PolicyAudit.isAudited +DA:94,0 +DA:100,0 +FN:100,PolicyAudit._authorizeUpgrade FNDA:0,PolicyAudit._authorizeUpgrade FNF:8 FNH:0 @@ -1355,351 +1448,383 @@ BRH:0 end_of_record TN: SF:contracts/policies/PolicyBase.sol -DA:74,0 -FN:74,PolicyBase.onlyPolicyManager +DA:72,0 +FN:72,PolicyBase.onlyPolicyManager FNDA:0,PolicyBase.onlyPolicyManager -DA:75,0 -BRDA:75,0,0,- -DA:76,0 -DA:82,0 -FN:82,PolicyBase.onlyPolicyAuthorizer +DA:73,0 +BRDA:73,0,0,- +DA:74,0 +DA:80,0 +FN:80,PolicyBase.onlyPolicyAuthorizer FNDA:0,PolicyBase.onlyPolicyAuthorizer -DA:83,0 -BRDA:83,1,0,- -DA:84,0 +DA:81,0 +BRDA:81,1,0,- +DA:82,0 +DA:87,0 +FN:87,PolicyBase.constructor +FNDA:0,PolicyBase.constructor +DA:93,0 DA:94,0 -FN:94,PolicyBase.activate -FNDA:0,PolicyBase.activate DA:95,0 -DA:97,0 -DA:105,0 -FN:105,PolicyBase.active -FNDA:0,PolicyBase.active -DA:106,0 -BRDA:106,2,0,- -DA:107,0 -DA:112,0 -FN:112,PolicyBase.constructor -FNDA:0,PolicyBase.constructor +DA:96,0 +DA:101,0 +FN:101,PolicyBase.getAttestationProvider +FNDA:0,PolicyBase.getAttestationProvider +DA:102,0 +DA:108,0 +FN:108,PolicyBase.supportsInterface +FNDA:0,PolicyBase.supportsInterface +DA:109,0 +DA:116,0 +FN:116,PolicyBase.getLicense +FNDA:0,PolicyBase.getLicense DA:118,0 DA:119,0 -DA:120,0 -DA:121,0 +DA:124,0 +FN:124,PolicyBase._getHolder +FNDA:0,PolicyBase._getHolder DA:125,0 -FN:125,PolicyBase.isActive -FNDA:0,PolicyBase.isActive -DA:126,0 -DA:131,0 -FN:131,PolicyBase.getAttestationProvider -FNDA:0,PolicyBase.getAttestationProvider DA:132,0 +FN:132,PolicyBase._commit +FNDA:0,PolicyBase._commit +DA:137,0 DA:138,0 -FN:138,PolicyBase.supportsInterface -FNDA:0,PolicyBase.supportsInterface DA:139,0 -DA:146,0 -FN:146,PolicyBase.getLicense -FNDA:0,PolicyBase.getLicense +DA:140,0 DA:148,0 -DA:149,0 -DA:154,0 -FN:154,PolicyBase._getHolder -FNDA:0,PolicyBase._getHolder -DA:155,0 -DA:162,0 -FN:162,PolicyBase._commit -FNDA:0,PolicyBase._commit -DA:167,0 -DA:168,0 -DA:170,0 -DA:171,0 -DA:179,0 -FN:179,PolicyBase._setAttestation +FN:148,PolicyBase._setAttestation FNDA:0,PolicyBase._setAttestation -DA:181,0 -DA:182,0 -DA:183,0 -DA:191,0 -FN:191,PolicyBase._computeComposedKey +DA:150,0 +DA:151,0 +DA:152,0 +DA:160,0 +FN:160,PolicyBase._computeComposedKey FNDA:0,PolicyBase._computeComposedKey -DA:198,0 -FNF:13 +DA:167,0 +FNF:10 FNH:0 -LF:39 +LF:31 LH:0 -BRF:3 +BRF:2 BRH:0 end_of_record TN: SF:contracts/rights/RightsAssetCustodian.sol -DA:58,0 -FN:58,RightsAssetCustodian.onlyActiveCustodian -FNDA:0,RightsAssetCustodian.onlyActiveCustodian -DA:59,0 -BRDA:59,0,0,- -DA:60,0 -DA:66,0 -FN:66,RightsAssetCustodian.onlyAvailableRedundancy -FNDA:0,RightsAssetCustodian.onlyAvailableRedundancy -DA:67,0 -DA:68,0 -BRDA:68,1,0,- -DA:69,0 -DA:75,0 -FN:75,RightsAssetCustodian.constructor -FNDA:0,RightsAssetCustodian.constructor -DA:78,0 -DA:80,0 -DA:84,0 -FN:84,RightsAssetCustodian.initialize -FNDA:0,RightsAssetCustodian.initialize -DA:85,0 -DA:86,0 -DA:91,0 -DA:98,0 -FN:98,RightsAssetCustodian.setMaxAllowedRedundancy +DA:75,8 +FN:75,RightsAssetCustodian.onlyActiveCustodian +FNDA:8,RightsAssetCustodian.onlyActiveCustodian +DA:76,8 +BRDA:76,0,0,1 +DA:77,1 +DA:83,9 +FN:83,RightsAssetCustodian.onlyAvailableRedundancy +FNDA:9,RightsAssetCustodian.onlyAvailableRedundancy +DA:85,9 +DA:86,9 +BRDA:86,1,0,1 +DA:87,1 +DA:93,6 +FN:93,RightsAssetCustodian.constructor +FNDA:6,RightsAssetCustodian.constructor +DA:96,0 +DA:98,6 +DA:102,6 +FN:102,RightsAssetCustodian.initialize +FNDA:6,RightsAssetCustodian.initialize +DA:103,0 +DA:104,6 +DA:109,6 +DA:116,0 +FN:116,RightsAssetCustodian.setMaxAllowedRedundancy FNDA:0,RightsAssetCustodian.setMaxAllowedRedundancy -DA:99,0 -DA:104,0 -FN:104,RightsAssetCustodian.revokeCustody -FNDA:0,RightsAssetCustodian.revokeCustody -DA:106,0 -DA:107,0 -BRDA:107,2,0,- -DA:108,0 -DA:109,0 -DA:114,0 -FN:114,RightsAssetCustodian.grantCustody -FNDA:0,RightsAssetCustodian.grantCustody -DA:120,0 -DA:121,0 -BRDA:121,3,0,- +DA:117,0 DA:122,0 -DA:123,0 +FN:122,RightsAssetCustodian.revokeCustody +FNDA:0,RightsAssetCustodian.revokeCustody +DA:124,0 +DA:125,0 +BRDA:125,2,0,- +DA:127,0 +DA:128,0 DA:129,0 -FN:129,RightsAssetCustodian.isCustodian -FNDA:0,RightsAssetCustodian.isCustodian -DA:130,0 -DA:135,0 -FN:135,RightsAssetCustodian.getCustodyCount -FNDA:0,RightsAssetCustodian.getCustodyCount -DA:136,0 -DA:145,0 -FN:145,RightsAssetCustodian.getBalancedCustodian -FNDA:0,RightsAssetCustodian.getBalancedCustodian -DA:146,0 -DA:147,0 -DA:148,0 -DA:163,0 +DA:136,7 +FN:136,RightsAssetCustodian.grantCustody +FNDA:7,RightsAssetCustodian.grantCustody +DA:142,7 +DA:143,7 +BRDA:143,3,0,1 +DA:146,6 +DA:147,6 +DA:148,6 +DA:157,0 +FN:157,RightsAssetCustodian.calcWeight +FNDA:0,RightsAssetCustodian.calcWeight +DA:158,0 DA:164,0 -DA:168,0 -DA:182,0 -DA:184,0 +FN:164,RightsAssetCustodian.setPriority +FNDA:0,RightsAssetCustodian.setPriority +DA:165,0 +DA:171,1 +FN:171,RightsAssetCustodian.isCustodian +FNDA:1,RightsAssetCustodian.isCustodian +DA:172,1 +DA:177,2 +FN:177,RightsAssetCustodian.getCustodyCount +FNDA:2,RightsAssetCustodian.getCustodyCount +DA:178,2 +DA:187,0 +FN:187,RightsAssetCustodian.getBalancedCustodian +FNDA:0,RightsAssetCustodian.getBalancedCustodian +DA:188,0 +DA:189,0 +DA:194,0 +DA:195,0 +DA:201,0 +DA:202,0 +DA:203,0 DA:205,0 DA:206,0 -DA:207,0 -BRDA:207,4,0,- -DA:208,0 -DA:213,0 +DA:214,0 DA:221,0 -FN:221,RightsAssetCustodian.getCustodians -FNDA:0,RightsAssetCustodian.getCustodians DA:222,0 -DA:228,0 -FN:228,RightsAssetCustodian._authorizeUpgrade -FNDA:0,RightsAssetCustodian._authorizeUpgrade -DA:233,0 -FN:233,RightsAssetCustodian._isValidActiveCustodian -FNDA:0,RightsAssetCustodian._isValidActiveCustodian -DA:234,0 -DA:239,0 -FN:239,RightsAssetCustodian._incrementCustody -FNDA:0,RightsAssetCustodian._incrementCustody +BRDA:222,5,0,- +DA:223,0 +DA:224,0 +DA:229,0 DA:240,0 -DA:245,0 -FN:245,RightsAssetCustodian._decrementCustody -FNDA:0,RightsAssetCustodian._decrementCustody +FN:240,RightsAssetCustodian._getCustodians +FNDA:0,RightsAssetCustodian._getCustodians +DA:241,0 +DA:242,0 +DA:243,0 +DA:244,0 DA:246,0 -BRDA:246,5,0,- DA:247,0 -FNF:15 -FNH:0 -LF:54 -LH:0 -BRF:6 -BRH:0 +DA:248,0 +DA:252,0 +DA:265,0 +DA:268,0 +DA:274,0 +FN:274,RightsAssetCustodian._authorizeUpgrade +FNDA:0,RightsAssetCustodian._authorizeUpgrade +DA:279,6 +FN:279,RightsAssetCustodian._incrementCustody +FNDA:6,RightsAssetCustodian._incrementCustody +DA:280,6 +DA:281,6 +DA:287,0 +FN:287,RightsAssetCustodian._decrementCustody +FNDA:0,RightsAssetCustodian._decrementCustody +DA:288,0 +BRDA:288,7,0,- +DA:289,0 +DA:292,0 +DA:300,6 +FN:300,RightsAssetCustodian._setPriority +FNDA:6,RightsAssetCustodian._setPriority +DA:301,6 +BRDA:301,8,0,- +DA:302,6 +DA:303,6 +DA:316,0 +FN:316,RightsAssetCustodian._calcWeight +FNDA:0,RightsAssetCustodian._calcWeight +DA:317,0 +DA:318,0 +DA:319,0 +DA:321,0 +DA:331,0 +FN:331,RightsAssetCustodian._calcWeights +FNDA:0,RightsAssetCustodian._calcWeights +DA:337,0 +DA:339,0 +DA:340,0 +DA:343,0 +DA:344,0 +DA:352,9 +FN:352,RightsAssetCustodian._isValidActiveCustodian +FNDA:9,RightsAssetCustodian._isValidActiveCustodian +DA:353,9 +DA:360,6 +FN:360,RightsAssetCustodian._computeComposedKey +FNDA:6,RightsAssetCustodian._computeComposedKey +DA:361,6 +FNF:21 +FNH:11 +LF:90 +LH:33 +BRF:7 +BRH:3 end_of_record TN: SF:contracts/rights/RightsPolicyAuthorizer.sol -DA:68,0 -FN:68,RightsPolicyAuthorizer.onlyAuditedPolicies +DA:71,0 +FN:71,RightsPolicyAuthorizer.onlyAuditedPolicies FNDA:0,RightsPolicyAuthorizer.onlyAuditedPolicies -DA:70,0 -BRDA:70,0,0,- -DA:75,0 -FN:75,RightsPolicyAuthorizer.constructor -FNDA:0,RightsPolicyAuthorizer.constructor +DA:73,0 +BRDA:73,0,0,- DA:78,0 -DA:80,0 -DA:84,0 -FN:84,RightsPolicyAuthorizer.initialize +FN:78,RightsPolicyAuthorizer.constructor +FNDA:0,RightsPolicyAuthorizer.constructor +DA:81,0 +DA:83,0 +DA:87,0 +FN:87,RightsPolicyAuthorizer.initialize FNDA:0,RightsPolicyAuthorizer.initialize -DA:85,0 -DA:86,0 -DA:92,0 -FN:92,RightsPolicyAuthorizer.authorizePolicy +DA:88,0 +DA:89,0 +DA:90,0 +DA:96,0 +FN:96,RightsPolicyAuthorizer.authorizePolicy FNDA:0,RightsPolicyAuthorizer.authorizePolicy -DA:93,0 -DA:94,0 -DA:95,0 +DA:98,0 +DA:99,0 +BRDA:99,1,0,- DA:100,0 -FN:100,RightsPolicyAuthorizer.revokePolicy +DA:101,0 +DA:106,0 +FN:106,RightsPolicyAuthorizer.revokePolicy FNDA:0,RightsPolicyAuthorizer.revokePolicy -DA:102,0 -DA:103,0 -BRDA:103,1,0,- -DA:104,0 +DA:108,0 +DA:109,0 +BRDA:109,2,0,- DA:110,0 -FN:110,RightsPolicyAuthorizer.isPolicyAuthorized +DA:116,0 +FN:116,RightsPolicyAuthorizer.isPolicyAuthorized FNDA:0,RightsPolicyAuthorizer.isPolicyAuthorized -DA:111,0 -DA:118,0 -FN:118,RightsPolicyAuthorizer.getAuthorizedPolicies +DA:117,0 +DA:124,0 +FN:124,RightsPolicyAuthorizer.getAuthorizedPolicies FNDA:0,RightsPolicyAuthorizer.getAuthorizedPolicies -DA:125,0 -DA:126,0 -DA:127,0 -DA:128,0 -DA:130,0 DA:131,0 DA:132,0 +DA:133,0 +DA:134,0 DA:136,0 -DA:149,0 -DA:151,0 +DA:137,0 +DA:138,0 +DA:142,0 +DA:155,0 DA:157,0 -FN:157,RightsPolicyAuthorizer._authorizeUpgrade -FNDA:0,RightsPolicyAuthorizer._authorizeUpgrade DA:163,0 -FN:163,RightsPolicyAuthorizer._isValidPolicy +FN:163,RightsPolicyAuthorizer._authorizeUpgrade +FNDA:0,RightsPolicyAuthorizer._authorizeUpgrade +DA:169,0 +FN:169,RightsPolicyAuthorizer._isValidPolicy FNDA:0,RightsPolicyAuthorizer._isValidPolicy -DA:164,0 DA:170,0 -FN:170,RightsPolicyAuthorizer._initializePolicy -FNDA:0,RightsPolicyAuthorizer._initializePolicy -DA:172,0 -DA:173,0 -BRDA:173,3,0,- -FNF:10 +FNF:9 FNH:0 -LF:35 +LF:34 LH:0 BRF:3 BRH:0 end_of_record TN: SF:contracts/rights/RightsPolicyManager.sol -DA:68,0 -FN:68,RightsPolicyManager.onlyAuthorizedPolicy +DA:77,0 +FN:77,RightsPolicyManager.onlyAuthorizedPolicy FNDA:0,RightsPolicyManager.onlyAuthorizedPolicy -DA:69,0 -DA:70,0 -BRDA:70,0,0,- -DA:75,0 -FN:75,RightsPolicyManager.constructor -FNDA:0,RightsPolicyManager.constructor DA:78,0 DA:79,0 -DA:80,0 +BRDA:79,0,0,- DA:84,0 -FN:84,RightsPolicyManager.initialize +FN:84,RightsPolicyManager.constructor +FNDA:0,RightsPolicyManager.constructor +DA:87,0 +DA:88,0 +DA:89,0 +DA:93,0 +FN:93,RightsPolicyManager.initialize FNDA:0,RightsPolicyManager.initialize -DA:85,0 -DA:86,0 DA:94,0 -FN:94,RightsPolicyManager.registerPolicy +DA:95,0 +DA:96,0 +DA:104,0 +FN:104,RightsPolicyManager.registerPolicy FNDA:0,RightsPolicyManager.registerPolicy -DA:100,0 -DA:101,0 -DA:106,0 -DA:107,0 -BRDA:107,1,0,- -DA:109,0 DA:110,0 DA:111,0 +DA:116,0 DA:117,0 -FN:117,RightsPolicyManager.getActivePolicy -FNDA:0,RightsPolicyManager.getActivePolicy -DA:118,0 +BRDA:117,1,0,- DA:119,0 -DA:122,0 -DA:124,0 -BRDA:124,2,0,- -DA:125,0 +DA:120,0 +DA:121,0 +DA:127,0 +FN:127,RightsPolicyManager.getActivePolicy +FNDA:0,RightsPolicyManager.getActivePolicy +DA:128,0 DA:129,0 -DA:138,0 -FN:138,RightsPolicyManager.getActivePolicies -FNDA:0,RightsPolicyManager.getActivePolicies +DA:132,0 +DA:134,0 +BRDA:134,2,0,- +DA:135,0 DA:139,0 -DA:140,0 -DA:141,0 -DA:142,0 -DA:145,0 -DA:146,0 -DA:147,0 +DA:148,0 +FN:148,RightsPolicyManager.getActivePolicies +FNDA:0,RightsPolicyManager.getActivePolicies +DA:149,0 +DA:150,0 DA:151,0 -DA:164,0 -DA:166,0 -DA:171,0 -FN:171,RightsPolicyManager.getPolicies +DA:152,0 +DA:155,0 +DA:156,0 +DA:157,0 +DA:161,0 +DA:174,0 +DA:176,0 +DA:181,0 +FN:181,RightsPolicyManager.getPolicies FNDA:0,RightsPolicyManager.getPolicies -DA:178,0 -DA:185,0 -FN:185,RightsPolicyManager.isActivePolicy +DA:188,0 +DA:195,0 +FN:195,RightsPolicyManager.isActivePolicy FNDA:0,RightsPolicyManager.isActivePolicy -DA:186,0 -DA:187,0 -DA:194,0 -FN:194,RightsPolicyManager.isRegisteredPolicy +DA:196,0 +DA:197,0 +DA:204,0 +FN:204,RightsPolicyManager.isRegisteredPolicy FNDA:0,RightsPolicyManager.isRegisteredPolicy -DA:195,0 -DA:201,0 -FN:201,RightsPolicyManager._authorizeUpgrade +DA:205,0 +DA:211,0 +FN:211,RightsPolicyManager._authorizeUpgrade FNDA:0,RightsPolicyManager._authorizeUpgrade -DA:208,0 -FN:208,RightsPolicyManager._verifyPolicyAccess +DA:218,0 +FN:218,RightsPolicyManager._verifyPolicyAccess FNDA:0,RightsPolicyManager._verifyPolicyAccess -DA:209,0 -DA:210,0 -DA:211,0 -DA:212,0 +DA:219,0 +DA:220,0 +DA:221,0 DA:222,0 -FN:222,RightsPolicyManager._registerBatchPolicies -FNDA:0,RightsPolicyManager._registerBatchPolicies -DA:228,0 -DA:230,0 -DA:231,0 DA:232,0 +FN:232,RightsPolicyManager._registerBatchPolicies +FNDA:0,RightsPolicyManager._registerBatchPolicies +DA:238,0 +DA:240,0 DA:241,0 -FN:241,RightsPolicyManager._registerPolicy -FNDA:0,RightsPolicyManager._registerPolicy DA:242,0 +DA:251,0 +FN:251,RightsPolicyManager._registerPolicy +FNDA:0,RightsPolicyManager._registerPolicy +DA:252,0 FNF:13 FNH:0 -LF:56 +LF:57 LH:0 BRF:3 BRH:0 end_of_record TN: SF:script/create3/CREATE3Factory.sol -DA:10,245 +DA:10,366 FN:10,CREATE3Factory.deploy -FNDA:245,CREATE3Factory.deploy -DA:12,245 -DA:16,421 +FNDA:366,CREATE3Factory.deploy +DA:12,366 +DA:16,801 FN:16,CREATE3Factory.getDeployed -FNDA:421,CREATE3Factory.getDeployed -DA:18,421 +FNDA:801,CREATE3Factory.getDeployed +DA:18,801 FNF:2 FNH:2 LF:4 @@ -1709,49 +1834,49 @@ BRH:0 end_of_record TN: SF:script/deployment/00_Deploy_Base.s.sol -DA:14,666 +DA:14,1167 FN:14,DeployBase.getCreate3FactoryAddress -FNDA:666,DeployBase.getCreate3FactoryAddress -DA:15,666 -DA:18,346 +FNDA:1167,DeployBase.getCreate3FactoryAddress +DA:15,1167 +DA:18,431 FN:18,DeployBase.getAdminPK -FNDA:346,DeployBase.getAdminPK -DA:19,346 -DA:23,723 +FNDA:431,DeployBase.getAdminPK +DA:19,431 +DA:23,1232 FN:23,DeployBase.getSalt -FNDA:723,DeployBase.getSalt -DA:24,723 -DA:27,421 +FNDA:1232,DeployBase.getSalt +DA:24,1232 +DA:27,801 FN:27,DeployBase.computeCreate3Address -FNDA:421,DeployBase.computeCreate3Address -DA:32,421 -DA:43,421 -DA:46,70 +FNDA:801,DeployBase.computeCreate3Address +DA:32,801 +DA:43,801 +DA:46,92 FN:46,DeployBase.deploy -FNDA:70,DeployBase.deploy -DA:48,70 -DA:49,70 -DA:52,175 +FNDA:92,DeployBase.deploy +DA:48,92 +DA:49,92 +DA:52,274 FN:52,DeployBase.deployUUPS -FNDA:175,DeployBase.deployUUPS -DA:58,175 -DA:62,175 -DA:63,175 -DA:65,175 -DA:85,175 -DA:89,245 +FNDA:274,DeployBase.deployUUPS +DA:58,274 +DA:62,274 +DA:63,274 +DA:65,274 +DA:85,274 +DA:89,366 FN:89,DeployBase._checkExpectedAddress -FNDA:245,DeployBase._checkExpectedAddress -DA:90,245 -DA:91,245 +FNDA:366,DeployBase._checkExpectedAddress +DA:90,366 +DA:91,366 BRDA:91,0,0,- BRDA:91,0,1,- -DA:94,302 +DA:94,431 FN:94,DeployBase._logAddress -FNDA:302,DeployBase._logAddress -DA:95,302 -DA:96,302 -DA:97,302 +FNDA:431,DeployBase._logAddress +DA:95,431 +DA:96,431 +DA:97,431 FNF:8 FNH:8 LF:25 @@ -1761,18 +1886,18 @@ BRH:0 end_of_record TN: SF:script/deployment/01_Deploy_Base_Create3.s.sol -DA:8,57 +DA:8,65 FN:8,DeployCreate3Factory.run -FNDA:57,DeployCreate3Factory.run -DA:10,57 -DA:11,57 -DA:12,57 +FNDA:65,DeployCreate3Factory.run +DA:10,65 +DA:11,65 +DA:12,65 DA:15,0 DA:16,0 BRDA:16,0,0,- DA:17,0 -DA:21,57 -DA:22,57 +DA:21,65 +DA:22,65 DA:23,0 FNF:1 FNH:1 @@ -1783,18 +1908,18 @@ BRH:0 end_of_record TN: SF:script/deployment/02_Deploy_Access_AccessManager.s.sol -DA:9,57 +DA:9,65 FN:9,DeployAccessManager.run -FNDA:57,DeployAccessManager.run -DA:10,57 -DA:11,57 -DA:13,57 -DA:14,57 -DA:15,57 -DA:16,57 -DA:17,57 -DA:19,57 -DA:20,57 +FNDA:65,DeployAccessManager.run +DA:10,65 +DA:11,65 +DA:13,65 +DA:14,65 +DA:15,65 +DA:16,65 +DA:17,65 +DA:19,65 +DA:20,65 DA:21,0 FNF:1 FNH:1 @@ -1805,18 +1930,18 @@ BRH:0 end_of_record TN: SF:script/deployment/03_Deploy_Economics_Token.s.sol -DA:8,44 +DA:8,52 FN:8,DeployToken.run -FNDA:44,DeployToken.run -DA:9,44 -DA:10,44 -DA:12,44 -DA:13,44 -DA:15,44 -DA:16,44 -DA:17,44 -DA:19,44 -DA:20,44 +FNDA:52,DeployToken.run +DA:9,52 +DA:10,52 +DA:12,52 +DA:13,52 +DA:15,52 +DA:16,52 +DA:17,52 +DA:19,52 +DA:20,52 DA:21,0 FNF:1 FNH:1 @@ -1827,17 +1952,17 @@ BRH:0 end_of_record TN: SF:script/deployment/04_Deploy_Economics_Tollgate.s.sol -DA:10,22 +DA:10,30 FN:10,DeployTollgate.run -FNDA:22,DeployTollgate.run -DA:11,22 -DA:12,22 -DA:13,22 -DA:14,22 -DA:15,22 -DA:16,22 -DA:18,22 -DA:19,22 +FNDA:30,DeployTollgate.run +DA:11,30 +DA:12,30 +DA:13,30 +DA:14,30 +DA:15,30 +DA:16,30 +DA:18,30 +DA:19,30 DA:20,0 FNF:1 FNH:1 @@ -1848,38 +1973,38 @@ BRH:0 end_of_record TN: SF:script/deployment/05_Deploy_Economics_Treasury.s.sol -DA:10,0 +DA:10,30 FN:10,DeployTreasury.run -FNDA:0,DeployTreasury.run -DA:11,0 -DA:12,0 -DA:13,0 -DA:14,0 -DA:15,0 -DA:16,0 -DA:18,0 -DA:19,0 +FNDA:30,DeployTreasury.run +DA:11,30 +DA:12,30 +DA:13,30 +DA:14,30 +DA:15,30 +DA:16,30 +DA:18,30 +DA:19,30 DA:20,0 FNF:1 -FNH:0 +FNH:1 LF:10 -LH:0 +LH:9 BRF:0 BRH:0 end_of_record TN: SF:script/deployment/06_Deploy_Financial_LedgerVault.s.sol -DA:8,57 +DA:8,30 FN:8,DeployLedgerVault.run -FNDA:57,DeployLedgerVault.run -DA:10,57 -DA:11,57 -DA:12,57 -DA:13,57 -DA:14,57 -DA:15,57 -DA:17,57 -DA:18,57 +FNDA:30,DeployLedgerVault.run +DA:10,30 +DA:11,30 +DA:12,30 +DA:13,30 +DA:14,30 +DA:15,30 +DA:17,30 +DA:18,30 DA:19,0 FNF:1 FNH:1 @@ -1890,64 +2015,64 @@ BRH:0 end_of_record TN: SF:script/deployment/07_Deploy_Financial_AgreementManager.s.sol -DA:8,0 +DA:8,30 FN:8,DeployAgreementManager.run -FNDA:0,DeployAgreementManager.run -DA:9,0 -DA:10,0 -DA:11,0 -DA:12,0 -DA:13,0 -DA:14,0 -DA:15,0 -DA:16,0 -DA:18,0 -DA:19,0 +FNDA:30,DeployAgreementManager.run +DA:9,30 +DA:10,30 +DA:11,30 +DA:12,30 +DA:13,30 +DA:14,30 +DA:15,30 +DA:16,30 +DA:18,30 +DA:19,30 DA:20,0 FNF:1 -FNH:0 +FNH:1 LF:12 -LH:0 +LH:11 BRF:0 BRH:0 end_of_record TN: SF:script/deployment/08_Deploy_Financial_AgreementSettler.s.sol -DA:8,0 +DA:8,30 FN:8,DeployAgreementSettler.run -FNDA:0,DeployAgreementSettler.run -DA:10,0 -DA:11,0 -DA:12,0 -DA:13,0 -DA:14,0 -DA:15,0 -DA:16,0 -DA:17,0 -DA:18,0 -DA:20,0 -DA:21,0 +FNDA:30,DeployAgreementSettler.run +DA:10,30 +DA:11,30 +DA:12,30 +DA:13,30 +DA:14,30 +DA:15,30 +DA:16,30 +DA:17,30 +DA:18,30 +DA:20,30 +DA:21,30 DA:22,0 FNF:1 -FNH:0 +FNH:1 LF:13 -LH:0 +LH:12 BRF:0 BRH:0 end_of_record TN: SF:script/deployment/09_Deploy_Custody_CustodianFactory.s.sol -DA:9,26 +DA:9,40 FN:9,DeployCustodianFactory.run -FNDA:26,DeployCustodianFactory.run -DA:11,26 -DA:12,26 -DA:13,26 -DA:14,26 -DA:15,26 -DA:16,26 -DA:18,26 -DA:19,26 +FNDA:40,DeployCustodianFactory.run +DA:11,40 +DA:12,40 +DA:13,40 +DA:14,40 +DA:15,40 +DA:16,40 +DA:18,40 +DA:19,40 DA:20,0 FNF:1 FNH:1 @@ -1958,25 +2083,24 @@ BRH:0 end_of_record TN: SF:script/deployment/10_Deploy_Custody_CustodianReferendum.s.sol -DA:9,16 +DA:9,30 FN:9,DeployCustodianReferendum.run -FNDA:16,DeployCustodianReferendum.run -DA:10,16 -DA:11,16 -DA:12,16 -DA:13,16 -DA:14,16 -DA:15,16 -DA:16,16 -DA:17,16 -DA:18,16 -DA:20,16 -DA:21,16 -DA:22,0 +FNDA:30,DeployCustodianReferendum.run +DA:10,30 +DA:11,30 +DA:12,30 +DA:13,30 +DA:14,30 +DA:15,30 +DA:16,30 +DA:17,30 +DA:19,30 +DA:20,30 +DA:21,0 FNF:1 FNH:1 -LF:13 -LH:12 +LF:12 +LH:11 BRF:0 BRH:0 end_of_record @@ -2068,23 +2192,23 @@ BRH:0 end_of_record TN: SF:script/deployment/15_Deploy_RightsManager_AssetCustodian.s.sol -DA:8,0 +DA:8,6 FN:8,DeployRightsAssetCustodian.run -FNDA:0,DeployRightsAssetCustodian.run -DA:10,0 -DA:11,0 -DA:12,0 -DA:13,0 -DA:14,0 -DA:15,0 -DA:16,0 -DA:18,0 -DA:19,0 +FNDA:6,DeployRightsAssetCustodian.run +DA:10,6 +DA:11,6 +DA:12,6 +DA:13,6 +DA:14,6 +DA:15,6 +DA:16,6 +DA:18,6 +DA:19,6 DA:20,0 FNF:1 -FNH:0 +FNH:1 LF:11 -LH:0 +LH:10 BRF:0 BRH:0 end_of_record @@ -2135,10 +2259,9 @@ BRH:0 end_of_record TN: SF:script/orchestration/01_Orchestrate_ProtocolHydration.s.sol -DA:18,0 -FN:18,OrchestrateProtocolHydration.run -FNDA:0,OrchestrateProtocolHydration.run DA:19,0 +FN:19,OrchestrateProtocolHydration.run +FNDA:0,OrchestrateProtocolHydration.run DA:20,0 DA:21,0 DA:22,0 @@ -2149,79 +2272,85 @@ DA:26,0 DA:27,0 DA:28,0 DA:29,0 -DA:31,0 -DA:35,0 +DA:30,0 +DA:32,0 DA:36,0 -DA:39,0 -DA:42,0 +DA:37,0 +DA:40,0 DA:43,0 DA:44,0 DA:45,0 -DA:47,0 +DA:46,0 DA:48,0 DA:49,0 DA:50,0 -DA:53,0 +DA:51,0 DA:54,0 -DA:55,0 -DA:58,0 -DA:59,0 -DA:60,0 +DA:56,0 +DA:57,0 DA:61,0 DA:62,0 -DA:65,0 -DA:66,0 +DA:63,0 +DA:64,0 DA:67,0 +DA:68,0 DA:69,0 DA:71,0 -DA:72,0 +DA:73,0 DA:74,0 -DA:75,0 +DA:76,0 DA:77,0 -BRDA:77,0,0,- -BRDA:77,0,1,- -DA:78,0 -BRDA:78,1,0,- -BRDA:78,1,1,- +DA:79,0 +BRDA:79,0,0,- +BRDA:79,0,1,- DA:80,0 +BRDA:80,1,0,- +BRDA:80,1,1,- +DA:82,0 FNF:1 FNH:0 -LF:43 +LF:42 LH:0 BRF:4 BRH:0 end_of_record TN: SF:script/orchestration/02_Orchestrate_ProtocolCustodianNetwork.s.sol -DA:12,0 -FN:12,OrchestrateProtocolCustodianNetwork.run -FNDA:0,OrchestrateProtocolCustodianNetwork.run DA:13,0 +FN:13,OrchestrateProtocolCustodianNetwork.run +FNDA:0,OrchestrateProtocolCustodianNetwork.run DA:14,0 DA:15,0 DA:16,0 DA:17,0 DA:18,0 +DA:19,0 DA:20,0 DA:22,0 -DA:23,0 +DA:24,0 DA:25,0 -DA:26,0 +DA:27,0 DA:28,0 -BRDA:28,0,0,- -BRDA:28,0,1,- -DA:29,0 -BRDA:29,1,0,- -BRDA:29,1,1,- -DA:32,0 -DA:33,0 +DA:30,0 +BRDA:30,0,0,- +BRDA:30,0,1,- +DA:31,0 +BRDA:31,1,0,- +BRDA:31,1,1,- +DA:34,0 DA:35,0 DA:36,0 -DA:37,0 +DA:38,0 DA:39,0 +DA:40,0 +DA:42,0 +DA:50,0 +DA:51,0 +DA:52,0 +DA:54,0 FNF:1 FNH:0 -LF:20 +LF:26 LH:0 BRF:4 BRH:0 @@ -2362,13 +2491,12 @@ DA:11,0 DA:12,0 DA:13,0 DA:14,0 -DA:15,0 +DA:18,0 DA:19,0 DA:20,0 -DA:21,0 FNF:1 FNH:0 -LF:10 +LF:9 LH:0 BRF:0 BRH:0 @@ -2469,116 +2597,149 @@ BRH:0 end_of_record TN: SF:test/BaseTest.t.sol -DA:36,57 -FN:36,BaseTest.initialize -FNDA:57,BaseTest.initialize -DA:38,57 -DA:39,57 -DA:40,57 -DA:41,0 -DA:42,0 -DA:43,57 -DA:48,57 -FN:48,BaseTest.deployCreate3Factory -FNDA:57,BaseTest.deployCreate3Factory -DA:50,57 -DA:51,57 -DA:53,57 -DA:54,57 -DA:58,57 -FN:58,BaseTest.deployAccessManager -FNDA:57,BaseTest.deployAccessManager -DA:60,57 -DA:61,57 -DA:63,57 -DA:65,57 -DA:66,57 -DA:70,22 -FN:70,BaseTest.deployTollgate -FNDA:22,BaseTest.deployTollgate -DA:72,22 -DA:73,22 -DA:74,22 -DA:76,22 -DA:77,0 -DA:81,57 -FN:81,BaseTest.deployLedgerVault -FNDA:57,BaseTest.deployLedgerVault -DA:83,57 -DA:84,57 -DA:85,57 -DA:87,57 -DA:89,57 -DA:90,57 -DA:91,57 -DA:95,44 -FN:95,BaseTest.deployToken -FNDA:44,BaseTest.deployToken -DA:97,44 -DA:98,44 -DA:99,44 +DA:58,65 +FN:58,BaseTest.initialize +FNDA:65,BaseTest.initialize +DA:60,65 +DA:61,65 +DA:62,65 +DA:64,0 +DA:65,0 +DA:71,65 +FN:71,BaseTest.deployCreate3Factory +FNDA:65,BaseTest.deployCreate3Factory +DA:73,65 +DA:74,65 +DA:76,65 +DA:77,65 +DA:78,65 +DA:82,67 +FN:82,BaseTest.deployToken +FNDA:67,BaseTest.deployToken +DA:84,67 +DA:85,67 +DA:89,65 +FN:89,BaseTest.deployAccessManager +FNDA:65,BaseTest.deployAccessManager +DA:91,65 +DA:92,65 +DA:94,65 +DA:96,65 +DA:97,65 +DA:101,45 +FN:101,BaseTest.deployTollgate +FNDA:45,BaseTest.deployTollgate DA:103,0 -FN:103,BaseTest.deployTreasury -FNDA:0,BaseTest.deployTreasury -DA:105,0 -DA:106,0 -DA:107,0 -DA:108,0 -DA:109,0 -DA:113,13 -FN:113,BaseTest.deployAssetReferendum +DA:105,45 +DA:106,45 +DA:107,45 +DA:109,30 +DA:113,72 +FN:113,BaseTest.deployLedgerVault +FNDA:72,BaseTest.deployLedgerVault +DA:115,72 +DA:116,72 +DA:117,72 +DA:119,72 +DA:121,72 +DA:122,72 +DA:123,72 +DA:127,36 +FN:127,BaseTest.deployTreasury +FNDA:36,BaseTest.deployTreasury +DA:129,36 +DA:130,36 +DA:131,36 +DA:132,30 +DA:135,36 +FN:135,BaseTest.deployAgreementManager +FNDA:36,BaseTest.deployAgreementManager +DA:136,0 +DA:137,36 +DA:139,36 +DA:140,36 +DA:142,36 +DA:145,36 +FN:145,BaseTest.deployAgreementSettler +FNDA:36,BaseTest.deployAgreementSettler +DA:146,0 +DA:147,36 +DA:148,0 +DA:150,36 +DA:151,36 +DA:153,36 +DA:157,13 +FN:157,BaseTest.deployAssetReferendum FNDA:13,BaseTest.deployAssetReferendum -DA:115,13 -DA:116,13 -DA:117,13 -DA:118,13 -DA:119,0 -DA:122,5 -FN:122,BaseTest.deployAssetOwnership +DA:159,13 +DA:160,13 +DA:161,13 +DA:162,13 +DA:165,5 +FN:165,BaseTest.deployAssetOwnership FNDA:5,BaseTest.deployAssetOwnership -DA:124,5 -DA:125,5 -DA:126,5 -DA:129,5 -FN:129,BaseTest.deployAssetSafe +DA:166,0 +DA:168,5 +DA:169,5 +DA:172,5 +FN:172,BaseTest.deployAssetSafe FNDA:5,BaseTest.deployAssetSafe -DA:131,5 -DA:132,5 -DA:133,5 -DA:134,5 -DA:135,0 -DA:140,26 -FN:140,BaseTest.deployCustodianFactory -FNDA:26,BaseTest.deployCustodianFactory -DA:141,26 -DA:142,26 -DA:146,16 -FN:146,BaseTest.deployCustodianReferendum -FNDA:16,BaseTest.deployCustodianReferendum -DA:148,16 -DA:149,16 -DA:150,16 -DA:152,16 -DA:154,16 -DA:155,0 -DA:158,56 -FN:158,BaseTest._setGovPermissions -FNDA:56,BaseTest._setGovPermissions -DA:159,56 -DA:160,56 -DA:162,56 -DA:163,56 -DA:166,16 -FN:166,BaseTest._assignOpRole -FNDA:16,BaseTest._assignOpRole -DA:167,16 -DA:168,16 -DA:169,16 -DA:170,16 -FNF:14 -FNH:13 -LF:78 -LH:66 +DA:173,0 +DA:175,5 +DA:176,5 +DA:177,5 +DA:178,5 +DA:182,67 +FN:182,BaseTest.deployCustodianFactory +FNDA:67,BaseTest.deployCustodianFactory +DA:183,67 +DA:184,67 +DA:187,36 +FN:187,BaseTest.deployCustodianReferendum +FNDA:36,BaseTest.deployCustodianReferendum +DA:188,0 +DA:189,0 +DA:192,36 +DA:193,36 +DA:194,36 +DA:196,30 +DA:200,6 +FN:200,BaseTest.deployRightsAssetCustodian +FNDA:6,BaseTest.deployRightsAssetCustodian +DA:201,0 +DA:203,6 +DA:204,6 +DA:207,135 +FN:207,BaseTest._setGovPermissions +FNDA:135,BaseTest._setGovPermissions +DA:208,135 +DA:209,135 +DA:211,135 +DA:212,135 +DA:215,72 +FN:215,BaseTest._assignOpRole +FNDA:72,BaseTest._assignOpRole +DA:216,72 +DA:217,72 +DA:218,72 +DA:219,72 +FNF:17 +FNH:17 +LF:92 +LH:81 +BRF:0 +BRH:0 +end_of_record +TN: +SF:test/economics/Tollgate.t.sol +DA:19,1 +FN:19,TargetD.isFeeSchemeSupported +FNDA:1,TargetD.isFeeSchemeSupported +DA:21,1 +FNF:1 +FNH:1 +LF:2 +LH:2 BRF:0 BRH:0 end_of_record @@ -2620,18 +2781,14 @@ BRF:0 BRH:0 end_of_record TN: -SF:test/primitives/Quorum.t..sol -DA:8,7 -FN:8,QuorumWrapper.status +SF:test/primitives/Quorum.t.sol +DA:12,7 +FN:12,QuorumWrapper.status FNDA:7,QuorumWrapper.status -DA:9,7 -DA:12,2 -FN:12,QuorumWrapper.revoke -FNDA:2,QuorumWrapper.revoke -DA:13,2 +DA:13,7 DA:16,2 -FN:16,QuorumWrapper.blocked -FNDA:2,QuorumWrapper.blocked +FN:16,QuorumWrapper.revoke +FNDA:2,QuorumWrapper.revoke DA:17,2 DA:20,3 FN:20,QuorumWrapper.approve @@ -2645,6 +2802,10 @@ DA:28,9 FN:28,QuorumWrapper.register FNDA:9,QuorumWrapper.register DA:29,9 +DA:32,2 +FN:32,QuorumWrapper.reject +FNDA:2,QuorumWrapper.reject +DA:33,2 FNF:6 FNH:6 LF:12 @@ -2652,3 +2813,52 @@ LH:12 BRF:0 BRH:0 end_of_record +TN: +SF:test/shared/CustodianShared.t.sol +DA:14,21 +FN:14,CustodianShared.setUp +FNDA:21,CustodianShared.setUp +DA:15,0 +DA:16,0 +DA:19,22 +FN:19,CustodianShared.deployCustodian +FNDA:22,CustodianShared.deployCustodian +DA:20,22 +DA:21,22 +DA:22,22 +DA:25,20 +FN:25,CustodianShared._setFeesAsGovernor +FNDA:20,CustodianShared._setFeesAsGovernor +DA:26,20 +DA:27,20 +DA:28,20 +DA:31,18 +FN:31,CustodianShared._registerCustodianWithApproval +FNDA:18,CustodianShared._registerCustodianWithApproval +DA:34,18 +DA:36,18 +DA:37,18 +DA:39,18 +DA:41,18 +DA:42,18 +DA:45,19 +FN:45,CustodianShared._createAgreement +FNDA:19,CustodianShared._createAgreement +DA:46,19 +DA:47,19 +DA:49,19 +DA:57,19 +DA:60,15 +FN:60,CustodianShared._registerAndApproveCustodian +FNDA:15,CustodianShared._registerAndApproveCustodian +DA:62,15 +DA:64,15 +DA:65,15 +DA:67,15 +FNF:6 +FNH:6 +LF:28 +LH:26 +BRF:0 +BRH:0 +end_of_record diff --git a/test/BaseTest.t.sol b/test/BaseTest.t.sol index fef8f70..a6ffe61 100644 --- a/test/BaseTest.t.sol +++ b/test/BaseTest.t.sol @@ -16,6 +16,7 @@ import { DeployCustodianFactory } from "script/deployment/09_Deploy_Custody_Cust import { DeployCustodianReferendum } from "script/deployment/10_Deploy_Custody_CustodianReferendum.s.sol"; import { DeployAgreementManager } from "script/deployment/07_Deploy_Financial_AgreementManager.s.sol"; import { DeployAgreementSettler } from "script/deployment/08_Deploy_Financial_AgreementSettler.s.sol"; +import { DeployRightsAssetCustodian } from "script/deployment/15_Deploy_RightsManager_AssetCustodian.s.sol"; import { getGovPermissions as TollgateGovPermissions } from "script/permissions/Permissions_Tollgate.sol"; import { getGovPermissions as TreasuryGovPermissions } from "script/permissions/Permissions_Treasury.sol"; @@ -47,6 +48,8 @@ abstract contract BaseTest is Test { address custodianReferendum; address custodianFactory; + address rightAssetCustodian; + address tollgate; address treasury; address ledger; @@ -146,7 +149,7 @@ abstract contract BaseTest is Test { DeployAgreementSettler agreementSettlerDeployer = new DeployAgreementSettler(); agreementSettler = agreementSettler == address(0) ? agreementSettlerDeployer.run() : agreementSettler; - // OP role granted to custodian referendum to operate on ledger + // OP role granted to custodian referendum to operate on ledger _assignOpRole(agreementSettler); } @@ -181,7 +184,6 @@ abstract contract BaseTest is Test { custodianFactory = custodianFactory == address(0) ? distDeployer.run() : custodianFactory; } - // 09_DeployCustodianReferendum function deployCustodianReferendum() public { deployCustodianFactory(); deployAgreementSettler(); @@ -194,6 +196,14 @@ abstract contract BaseTest is Test { _setGovPermissions(custodianReferendum, custodianReferendumAllowed); } + + function deployRightsAssetCustodian() public { + deployCustodianReferendum(); + // set default admin as deployer.. + DeployRightsAssetCustodian rightAssetCustodianDeployer = new DeployRightsAssetCustodian(); + rightAssetCustodian = rightAssetCustodian == address(0) ? rightAssetCustodianDeployer.run() : rightAssetCustodian; + } + function _setGovPermissions(address target, bytes4[] memory allowed) public { vm.startPrank(admin); IAccessManager authority = IAccessManager(accessManager); diff --git a/test/assets/AssetReferendum.t.sol b/test/assets/AssetReferendum.t.sol index 54114e0..d3f43fd 100644 --- a/test/assets/AssetReferendum.t.sol +++ b/test/assets/AssetReferendum.t.sol @@ -28,8 +28,8 @@ contract AssetReferendumTest is BaseTest { function test_Submit_SubmittedValidStates() public { _submitContentAsUser(1); - assertFalse(IAssetVerifiable(assetReferendum).isActive(1)); - assertFalse(IAssetVerifiable(assetReferendum).isApproved(user, 1)); + assertFalse(IAssetVerifiable(assetReferendum).isActive(1), "Asset should not be active yet"); + assertFalse(IAssetVerifiable(assetReferendum).isApproved(user, 1), "Asset should not be approved yet"); } function test_Approve_ApprovedEventEmitted() public { @@ -49,8 +49,8 @@ contract AssetReferendumTest is BaseTest { vm.prank(governor); // approve by governance.. IAssetRegistrable(assetReferendum).approve(assetId); - assertTrue(IAssetVerifiable(assetReferendum).isActive(assetId)); - assertTrue(IAssetVerifiable(assetReferendum).isApproved(user, assetId)); + assertTrue(IAssetVerifiable(assetReferendum).isActive(assetId), "Asset should be active"); + assertTrue(IAssetVerifiable(assetReferendum).isApproved(user, assetId), "Asset should be approved"); } function test_Reject_RejectedEventEmitted() public { @@ -69,8 +69,8 @@ contract AssetReferendumTest is BaseTest { vm.prank(governor); // approve by governance.. IAssetRevokable(assetReferendum).reject(assetId); - assertFalse(IAssetVerifiable(assetReferendum).isActive(assetId)); - assertFalse(IAssetVerifiable(assetReferendum).isApproved(user, assetId)); + assertFalse(IAssetVerifiable(assetReferendum).isActive(assetId), "Asset should not be active"); + assertFalse(IAssetVerifiable(assetReferendum).isApproved(user, assetId), "Asset should not be approved"); } function test_Revoked_RevokedEventEmitted() public { @@ -93,8 +93,8 @@ contract AssetReferendumTest is BaseTest { _submitAndApproveContent(assetId); vm.prank(governor); // approve by governance.. IAssetRevokable(assetReferendum).revoke(assetId); - assertFalse(IAssetVerifiable(assetReferendum).isActive(assetId)); - assertFalse(IAssetVerifiable(assetReferendum).isApproved(user, assetId)); + assertFalse(IAssetVerifiable(assetReferendum).isActive(assetId), "Asset should not be active"); + assertFalse(IAssetVerifiable(assetReferendum).isApproved(user, assetId), "Asset should not be approved"); } function _submitAndApproveContent(uint256 assetId) internal { diff --git a/test/assets/AssetSafe.t.sol b/test/assets/AssetSafe.t.sol index 1fc9051..f94cb2a 100644 --- a/test/assets/AssetSafe.t.sol +++ b/test/assets/AssetSafe.t.sol @@ -30,7 +30,7 @@ contract AssetSafeTest is BaseTest { vm.prank(user); IAssetSafe assetSafe = IAssetSafe(assetSafe); assetSafe.setContent(assetId, T.Cipher.LIT, ""); - assertEq(assetSafe.getContent(assetId, T.Cipher.LIT), ""); + assertEq(assetSafe.getContent(assetId, T.Cipher.LIT), "", "Content should be set to empty string"); } function test_SetContent_RevertIf_InvalidOwner() public { @@ -65,7 +65,7 @@ contract AssetSafeTest is BaseTest { assetSafe.setContent(assetId, T.Cipher.LIT, ""); T.Cipher safeType = assetSafe.getType(assetId); - assertEq(uint256(safeType), uint256(T.Cipher.LIT)); + assertEq(uint256(safeType), uint256(T.Cipher.LIT), "Safe type should be LIT"); } function test_GetContent_ValidStoredData() public { @@ -91,7 +91,7 @@ contract AssetSafeTest is BaseTest { vm.prank(admin); bytes memory got = assetSafe.getContent(assetId, T.Cipher.LIT); string memory expected = abi.decode(got, (string)); - assertEq(keccak256(abi.encodePacked(expected)), keccak256(abi.encodePacked(b64))); + assertEq(keccak256(abi.encodePacked(expected)), keccak256(abi.encodePacked(b64)), "Content should match the expected data"); } function _registerAndApproveAsset(address to, uint256 assetId) private { diff --git a/test/custody/CustodianImpl.t.sol b/test/custody/CustodianImpl.t.sol index e41060e..eef3595 100644 --- a/test/custody/CustodianImpl.t.sol +++ b/test/custody/CustodianImpl.t.sol @@ -11,13 +11,12 @@ import { ICustodianFactory } from "contracts/core/interfaces/custody/ICustodianF import { BaseTest } from "test/BaseTest.t.sol"; contract CustodianImplTest is BaseTest { - function setUp() public initialize { deployToken(); deployCustodianFactory(); } - function deployCustodian(string memory endpoint) public returns(address) { + function deployCustodian(string memory endpoint) public returns (address) { vm.prank(admin); ICustodianFactory factory = ICustodianFactory(custodianFactory); return factory.create(endpoint); @@ -25,17 +24,18 @@ contract CustodianImplTest is BaseTest { function test_Create_ValidCustodian() public { address custodian = deployCustodian("test.com"); - assertEq(IERC165(custodian).supportsInterface(type(ICustodian).interfaceId), true); + bool supportedInterface = IERC165(custodian).supportsInterface(type(ICustodian).interfaceId); + assertEq(supportedInterface, true, "Custodian should support ICustodian interface"); } function test_GetOwner_ExpectedDeployer() public { address custodian = deployCustodian("test2.com"); - assertEq(ICustodian(custodian).getManager(), admin); + assertEq(ICustodian(custodian).getManager(), admin, "Expected owner should be the deployer"); } function test_GetEndpoint_ExpectedEndpoint() public { address custodian = deployCustodian("test3.com"); - assertEq(ICustodian(custodian).getEndpoint(), "test3.com"); + assertEq(ICustodian(custodian).getEndpoint(), "test3.com", "Expected endpoint should match"); } function test_SetEndpoint_ValidEndpoint() public { @@ -44,7 +44,8 @@ contract CustodianImplTest is BaseTest { // changed to a dns domain vm.prank(admin); // only owner can do this ICustodian(custodian).setEndpoint("mynew.com"); - assertEq(ICustodian(custodian).getEndpoint(), "mynew.com"); + string memory endpoint = ICustodian(custodian).getEndpoint(); + assertEq(endpoint, "mynew.com", "Expected endpoint should be updated"); } function test_SetEndpoint_RevertWhen_InvalidOwner() public { @@ -63,7 +64,8 @@ contract CustodianImplTest is BaseTest { // here the expected is that rewards system do it. vm.startPrank(admin); // only owner can get balance by default deployer IERC20(token).transfer(custodian, expected); - assertEq(IBalanceVerifiable(custodian).getBalance(token), expected); + uint256 currentBalance = IBalanceVerifiable(custodian).getBalance(token); + assertEq(currentBalance, expected, "Expected balance should match"); vm.stopPrank(); } @@ -77,8 +79,9 @@ contract CustodianImplTest is BaseTest { // only owner can withdraw funds by default deployer IBalanceWithdrawable(custodian).withdraw(user, expected, token); vm.stopPrank(); - - assertEq(IERC20(token).balanceOf(user), expected); + + uint256 userBalance = IERC20(token).balanceOf(user); + assertEq(userBalance, expected, "User should receive the withdrawn funds"); } function test_Withdraw_EmitFundsWithdrawn() public { diff --git a/test/custody/CustodianReferendum.t.sol b/test/custody/CustodianReferendum.t.sol index 6a08d92..3509297 100644 --- a/test/custody/CustodianReferendum.t.sol +++ b/test/custody/CustodianReferendum.t.sol @@ -2,11 +2,8 @@ pragma solidity 0.8.26; import "forge-std/Test.sol"; -import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol"; -import { ITreasury } from "contracts/core/interfaces/economics/ITreasury.sol"; -import { ITollgate } from "contracts/core/interfaces/economics/ITollgate.sol"; -import { ILedgerVault } from "contracts/core/interfaces/financial/ILedgerVault.sol"; -import { IAgreementManager } from "contracts/core/interfaces/financial/IAgreementManager.sol"; + + import { ICustodianVerifiable } from "contracts/core/interfaces/custody/ICustodianVerifiable.sol"; import { ICustodianExpirable } from "contracts/core/interfaces/custody/ICustodianExpirable.sol"; import { ICustodianRegistrable } from "contracts/core/interfaces/custody/ICustodianRegistrable.sol"; @@ -14,37 +11,27 @@ import { ICustodianInspectable } from "contracts/core/interfaces/custody/ICustod import { ICustodianRevokable } from "contracts/core/interfaces/custody/ICustodianRevokable.sol"; import { ICustodianFactory } from "contracts/core/interfaces/custody/ICustodianFactory.sol"; -import { BaseTest } from "test/BaseTest.t.sol"; +import { CustodianShared } from "test/shared/CustodianShared.t.sol"; import { CustodianReferendum } from "contracts/custody/CustodianReferendum.sol"; import { CustodianImpl } from "contracts/custody/CustodianImpl.sol"; -import { T } from "contracts/core/primitives/Types.sol"; -contract CustodianReferendumTest is BaseTest { - function setUp() public initialize { - deployCustodianReferendum(); - deployCustodianFactory(); - } - - function deployCustodian(string memory endpoint) public returns (address) { - vm.prank(admin); - ICustodianFactory custodianFactory = ICustodianFactory(custodianFactory); - return custodianFactory.create(endpoint); - } +contract CustodianReferendumTest is CustodianShared { /// ---------------------------------------------------------------- function test_Init_ExpirationPeriod() public view { // test initialized treasury address uint256 expected = 180 days; uint256 period = ICustodianExpirable(custodianReferendum).getExpirationPeriod(); - assertEq(period, expected); + assertEq(period, expected, "Expected expiration period should be 180 days"); } function test_SetExpirationPeriod_ValidExpiration() public { uint256 expireIn = 3600; // seconds vm.prank(governor); ICustodianExpirable(custodianReferendum).setExpirationPeriod(expireIn); - assertEq(ICustodianExpirable(custodianReferendum).getExpirationPeriod(), expireIn); + uint256 currentExpiration = ICustodianExpirable(custodianReferendum).getExpirationPeriod(); + assertEq(currentExpiration, expireIn, "Expected expiration period should match"); } function test_SetExpirationPeriod_EmitPeriodSet() public { @@ -102,7 +89,7 @@ contract CustodianReferendumTest is BaseTest { _registerCustodianWithApproval(custodian, 1 * 1e18); uint256 expected = currentTime + expectedExpiration; uint256 got = inspectable.getEnrollmentDeadline(custodian); - assertEq(got, expected); + assertEq(got, expected, "Expected enrollment deadline should match"); } function test_Register_SetWaitingState() public { @@ -110,7 +97,8 @@ contract CustodianReferendumTest is BaseTest { address custodian = deployCustodian("contentrider.com"); // register the custodian expecting the right status. _registerCustodianWithApproval(custodian, 1 * 1e18); - assertTrue(ICustodianVerifiable(custodianReferendum).isWaiting(custodian)); + bool isWaiting = ICustodianVerifiable(custodianReferendum).isWaiting(custodian); + assertTrue(isWaiting, "Custodian should be in waiting state"); } function test_Register_RevertIf_InvalidCustodian() public { @@ -138,7 +126,8 @@ contract CustodianReferendumTest is BaseTest { function test_Approve_SetActiveState() public { address custodian = deployCustodian("contentrider.com"); _registerAndApproveCustodian(custodian); - assertTrue(ICustodianVerifiable(custodianReferendum).isActive(custodian)); + bool isActive = ICustodianVerifiable(custodianReferendum).isActive(custodian); + assertTrue(isActive, "Custodian should be active after approval"); } function test_Approve_IncrementEnrollmentCount() public { @@ -151,7 +140,8 @@ contract CustodianReferendumTest is BaseTest { _registerAndApproveCustodian(custodian3); // still governor prank // valid approvals, increments the total of enrollments - assertEq(ICustodianInspectable(custodianReferendum).getEnrollmentCount(), 3); + uint256 enrollment = ICustodianInspectable(custodianReferendum).getEnrollmentCount(); + assertEq(enrollment, 3, "Enrollment count should be 3"); } function test_Revoke_RevokedEventEmitted() public { @@ -171,7 +161,8 @@ contract CustodianReferendumTest is BaseTest { // valid approvals, increments the total of enrollments vm.prank(governor); ICustodianRevokable(custodianReferendum).revoke(custodian); - assertEq(ICustodianInspectable(custodianReferendum).getEnrollmentCount(), 0); + uint256 enrollment = ICustodianInspectable(custodianReferendum).getEnrollmentCount(); + assertEq(enrollment, 0, "Enrollment count should be 0 after revocation"); } function test_Revoke_SetBlockedState() public { @@ -180,58 +171,9 @@ contract CustodianReferendumTest is BaseTest { // custodian get revoked by governance.. vm.prank(governor); ICustodianRevokable(custodianReferendum).revoke(custodian); - assertTrue(ICustodianVerifiable(custodianReferendum).isBlocked(custodian)); - } - - function _setFeesAsGovernor(uint256 fees) internal { - vm.startPrank(governor); - ITollgate(tollgate).setFees(T.Scheme.FLAT, custodianReferendum, fees, token); - vm.stopPrank(); - } - - function _registerCustodianWithApproval(address d9r, uint256 approval) internal { - // manager = contract deployer - // only manager can pay enrollment.. - vm.startPrank(admin); - // approve approval to ledger to deposit funds - address[] memory parties = new address[](1); - parties[0] = d9r; - - uint256 proof = _createAgreement(approval, parties); - // operate over msg.sender ledger registered funds - ICustodianRegistrable(custodianReferendum).register(proof, d9r); - vm.stopPrank(); + bool isBlocked = ICustodianVerifiable(custodianReferendum).isBlocked(custodian); + assertTrue(isBlocked, "Custodian should be blocked after revocation"); } - function _createAgreement(uint256 amount, address[] memory parties) private returns (uint256) { - IERC20(token).approve(ledger, amount); - ILedgerVault(ledger).deposit(admin, amount, token); - - uint256 proof = IAgreementManager(agreementManager).createAgreement( - amount, - token, - address(custodianReferendum), - parties, - "" - ); - - return proof; - } - - function _registerCustodianWithGovernorAndApproval() private { - uint256 expectedFees = 100 * 1e18; - address custodian = deployCustodian("contentrider.com"); - _setFeesAsGovernor(expectedFees); - _registerCustodianWithApproval(custodian, expectedFees); - } - - function _registerAndApproveCustodian(address d9r) private { - // intially the balance = 0 - _setFeesAsGovernor(1 * 1e18); - // register the custodian with fees = 100 MMC - _registerCustodianWithApproval(d9r, 1 * 1e18); - vm.prank(governor); // as governor. - // distribuitor approved only by governor.. - ICustodianRegistrable(custodianReferendum).approve(d9r); - } + } diff --git a/test/economics/Tollgate.t.sol b/test/economics/Tollgate.t.sol index 5a6ba7e..cccc29d 100644 --- a/test/economics/Tollgate.t.sol +++ b/test/economics/Tollgate.t.sol @@ -9,6 +9,7 @@ import { T } from "contracts/core/primitives/Types.sol"; contract TargetA {} contract TargetB {} + contract TargetC {} contract TargetD { @@ -24,6 +25,7 @@ contract TargetD { contract TollgateTest is BaseTest { function setUp() public initialize { deployTollgate(); + deployCustodianReferendum(); } function test_SetFees_ValidFlatFees() public { @@ -33,8 +35,8 @@ contract TollgateTest is BaseTest { ITollgate(tollgate).setFees(T.Scheme.FLAT, target, expected, token); (uint256 fee, T.Scheme scheme) = ITollgate(tollgate).getFees(target, token); - assertEq(uint256(scheme), 1); - assertEq(fee, expected); + assertEq(uint256(scheme), 1, "Expected scheme should be FLAT"); + assertEq(fee, expected, "Expected fee should match"); } function test_SetFees_ValidBasePointAgreementFees() public { @@ -44,8 +46,8 @@ contract TollgateTest is BaseTest { ITollgate(tollgate).setFees(T.Scheme.BPS, target, expected, token); (uint256 fee, T.Scheme scheme) = ITollgate(tollgate).getFees(target, token); - assertEq(uint256(scheme), 3); - assertEq(fee, expected); + assertEq(uint256(scheme), 3, "Expected scheme should be BPS"); + assertEq(fee, expected, "Expected fee should match"); } function test_SetFees_FeesSetEventEmitted() public { @@ -77,7 +79,7 @@ contract TollgateTest is BaseTest { vm.startPrank(governor); // expected revert if not valid allowance address notSupportedNominal = address(new TargetD()); - vm.expectRevert(abi.encodeWithSignature("InvalidTargetContext(address)", notSupportedNominal)); + vm.expectRevert(abi.encodeWithSignature("InvalidTargetScheme(address)", notSupportedNominal)); ITollgate(tollgate).setFees(T.Scheme.NOMINAL, notSupportedNominal, 1, token); vm.stopPrank(); } @@ -100,35 +102,34 @@ contract TollgateTest is BaseTest { (uint256 feeB, T.Scheme b) = ITollgate(tollgate).getFees(targetB, token); (uint256 feeC, T.Scheme c) = ITollgate(tollgate).getFees(targetC, token); - assertEq(feeA, expectedFlat); - assertEq(uint256(a), 1); - assertEq(feeB, expectedNominal); - assertEq(uint256(b), 2); - assertEq(feeC, expectedBps); - assertEq(uint256(c), 3); + assertEq(feeA, expectedFlat, "Expected flat fee should match"); + assertEq(uint256(a), 1, "Expected scheme should be FLAT"); + assertEq(feeB, expectedNominal, "Expected nominal fee should match"); + assertEq(uint256(b), 2, "Expected scheme should be NOMINAL"); + assertEq(feeC, expectedBps, "Expected bps fee should match"); + assertEq(uint256(c), 3, "Expected scheme should be BPS"); + } + + function test_GetFees_RevertWhen_NotSupportedScheme() public { + address invalidTokenAddress = vm.addr(3); + address target = vm.addr(8); + vm.expectRevert(abi.encodeWithSignature("UnsupportedCurrency(address,address)", target, invalidTokenAddress)); + ITollgate(tollgate).getFees(target, invalidTokenAddress); } - // function test_GetFees_RevertWhen_NotSupportedCurrency() public { - // address invalidTokenAddress = vm.addr(3); - // address target = vm.addr(8); - // vm.expectRevert(abi.encodeWithSignature("InvalidUnsupportedCurrency(address)", invalidTokenAddress)); - // ITollgate(tollgate).getFees(T.Scheme.FLAT, target, invalidTokenAddress); - // } - - // function test_SupportedCurrencies_ReturnExpectedCurrencies() public { - // address target = vm.addr(8); - // vm.startPrank(governor); // as governor set fees - // // duplicate the registration to check if the token is duplicated - // ITollgate(tollgate).setFees(T.Scheme.FLAT, target, 1, token); - // ITollgate(tollgate).setFees(T.Scheme.FLAT, target, 1, token); - // vm.stopPrank(); - - // vm.prank(user); // user querying fees.. - // address[] memory got = ITollgate(tollgate).supportedCurrencies(target); - // address[] memory expected = new address[](1); - // expected[0] = token; - - // // only one expected since the set avoid dupes.. - // assertEq(got, expected); - // } + function test_SupportedCurrencies_ReturnExpectedCurrencies() public { + address target = custodianReferendum; + vm.startPrank(governor); // as governor set fees + // duplicate the registration to check if the token is duplicated + ITollgate(tollgate).setFees(T.Scheme.FLAT, target, 1, token); + ITollgate(tollgate).setFees(T.Scheme.FLAT, target, 1, token); + vm.stopPrank(); + + address[] memory got = ITollgate(tollgate).supportedCurrencies(target); + address[] memory expected = new address[](1); + expected[0] = token; + + // only one expected since the set avoid dupes.. + assertEq(got, expected, "Expected supported currencies should match"); + } } diff --git a/test/libraries/RollingOps.t.sol b/test/libraries/RollingOps.t.sol index 201d8f7..9fd776a 100644 --- a/test/libraries/RollingOps.t.sol +++ b/test/libraries/RollingOps.t.sol @@ -64,18 +64,18 @@ contract RollingOpsTest is Test { } function test_Window_ReturnDefaultWindowSize() public view { - assertEq(rolling.getWindow(), 3); + assertEq(rolling.getWindow(), 3, "Default window size should be 3"); } function test_Configure_SetValidWindowSize() public { rolling.configureWindow(5); - assertEq(rolling.getWindow(), 5); + assertEq(rolling.getWindow(), 5, "Expected window size should be 5"); } function test_Configure_MaximumWindowSize() public { uint256 maxWindow = type(uint256).max; rolling.configureWindow(maxWindow); - assertEq(rolling.getWindow(), maxWindow); + assertEq(rolling.getWindow(), maxWindow, "Expected window size should be max uint256"); } function test_RevertIf_SetZeroWindowSize() public { @@ -98,7 +98,7 @@ contract RollingOpsTest is Test { expected[1] = addr2; expected[2] = addr3; - assertEq(got, expected); + assertEq(got, expected, "Expected addresses should match"); } function test_Add_RollingOldestElement() public { @@ -122,7 +122,7 @@ contract RollingOpsTest is Test { expected[1] = addr3; expected[2] = addr4; - assertEq(got, expected); + assertEq(got, expected, "Expected addresses should match after rolling"); } function test_Add_SizeOne() public { @@ -131,10 +131,10 @@ contract RollingOpsTest is Test { address addr2 = vm.addr(2); rolling.add(addr1); - assertEq(rolling.getAt(0), addr1); + assertEq(rolling.getAt(0), addr1, "First address should be addr1"); rolling.add(addr2); - assertEq(rolling.getAt(0), addr2); + assertEq(rolling.getAt(0), addr2, "Last address should be addr2 after rolling"); } function test_Add_MultipleRollovers() public { @@ -165,7 +165,7 @@ contract RollingOpsTest is Test { expected[3] = addr6; expected[4] = addr7; - assertEq(got, expected); + assertEq(got, expected, "Expected addresses should match after multiple rollovers"); } function test_Exists_ReturnTrueIfExists() public { @@ -185,12 +185,12 @@ contract RollingOpsTest is Test { rolling.add(addr6); // rolled out should return false - assertFalse(rolling.exists(addr1)); - assertFalse(rolling.exists(addr2)); - assertFalse(rolling.exists(addr3)); - assertTrue(rolling.exists(addr4)); - assertTrue(rolling.exists(addr5)); - assertTrue(rolling.exists(addr6)); + assertFalse(rolling.exists(addr1), "Address should not exist after rolling out"); + assertFalse(rolling.exists(addr2), "Address should not exist after rolling out"); + assertFalse(rolling.exists(addr3), "Address should not exist after rolling out"); + assertTrue(rolling.exists(addr4), "Address should not exist after rolling out"); + assertTrue(rolling.exists(addr5), "Address should not exist after rolling out"); + assertTrue(rolling.exists(addr6), "Address should not exist after rolling out"); } function test_Length_ReturnValidLen() public { @@ -199,7 +199,7 @@ contract RollingOpsTest is Test { rolling.add(addr1); rolling.add(addr2); - assertEq(rolling.getLength(), 2); + assertEq(rolling.getLength(), 2, "Expected length should be 2"); address addr3 = vm.addr(3); address addr4 = vm.addr(4); @@ -209,7 +209,7 @@ contract RollingOpsTest is Test { rolling.add(addr5); // do not grow; default window is 3 // must keep the same window size - assertEq(rolling.getLength(), 3); + assertEq(rolling.getLength(), 3, "Expected length should be 3 after rolling"); } function test_At_ReturnCorrespondingValue() public { @@ -219,8 +219,8 @@ contract RollingOpsTest is Test { rolling.add(addr1); rolling.add(addr2); - assertEq(rolling.getAt(0), addr1); - assertEq(rolling.getAt(1), addr2); + assertEq(rolling.getAt(0), addr1, "First address should be addr1"); + assertEq(rolling.getAt(1), addr2, "Second address should be addr2"); } function test_At_ReturnLastElement() public { @@ -232,7 +232,7 @@ contract RollingOpsTest is Test { rolling.add(addr2); rolling.add(addr3); - assertEq(rolling.getAt(2), addr3); + assertEq(rolling.getAt(2), addr3, "Last address should be addr3"); } function test_At_RevertIf_InvalidIndex() public { diff --git a/test/primitives/BalanceOperator.t.sol b/test/primitives/BalanceOperator.t.sol index 57db0d0..ab8c9b4 100644 --- a/test/primitives/BalanceOperator.t.sol +++ b/test/primitives/BalanceOperator.t.sol @@ -33,9 +33,9 @@ contract BalanceOperatorTest is BaseTest { uint256 contractBalance = IBalanceVerifiable(op).getBalance(token); vm.stopPrank(); - assertEq(confirmed, balance); - assertEq(contractBalance, confirmed); - assertEq(afterBalance, prevBalance - confirmed); + assertEq(confirmed, balance, "Confirmed amount should match ledger balance"); + assertEq(contractBalance, confirmed, "Contract balance should match confirmed amount"); + assertEq(afterBalance, prevBalance - confirmed, "Admin balance should decrease by confirmed amount"); } function test_Deposit_FundsDepositedEventEmitted() public { @@ -70,7 +70,7 @@ contract BalanceOperatorTest is BaseTest { uint256 amount = 100 * 1e18; vm.startPrank(admin); uint256 prevBalance = IERC20(token).balanceOf(admin); - uint256 deposited =_validDeposit(admin, amount); + uint256 deposited = _validDeposit(admin, amount); uint256 afterBalance = IERC20(token).balanceOf(admin); uint256 confirmed = IBalanceWithdrawable(op).withdraw(admin, deposited, token); @@ -78,10 +78,10 @@ contract BalanceOperatorTest is BaseTest { uint256 contractBalance = IBalanceVerifiable(op).getBalance(token); vm.stopPrank(); - assertEq(confirmed, deposited); - assertEq(prevBalance, afterBalance + confirmed); - assertEq(contractBalance, 0); - assertEq(balance, 0); + assertEq(confirmed, deposited, "Confirmed amount should match deposited amount"); + assertEq(prevBalance, afterBalance + confirmed, "Admin balance should increase by confirmed amount"); + assertEq(contractBalance, 0, "Contract balance should be zero after withdrawal"); + assertEq(balance, 0, "Ledger balance should be zero after withdrawal"); } function test_Withdraw_FundsWithdrawnEventEmitted() public { @@ -129,9 +129,9 @@ contract BalanceOperatorTest is BaseTest { uint256 balanceAdmin = verifier.getLedgerBalance(admin, token); uint256 balanceUser = verifier.getLedgerBalance(user, token); - assertEq(contractBalance, amount); // the contract still holds the tokens - assertEq(balanceAdmin, expectedAfter); // expected 50 MMC - assertEq(balanceUser, confirmed); + assertEq(contractBalance, amount, "Contract balance should match initial deposit"); + assertEq(balanceAdmin, expectedAfter, "Admin balance should be half after transfer"); + assertEq(balanceUser, confirmed, "User balance should match transferred amount"); } function test_Transfer_FundsTransferredEventEmitted() public { diff --git a/test/primitives/Ledger.t.sol b/test/primitives/Ledger.t.sol index 41f7ad0..eebd84d 100644 --- a/test/primitives/Ledger.t.sol +++ b/test/primitives/Ledger.t.sol @@ -8,14 +8,14 @@ contract LedgerTest is Test, LedgerUpgradeable { function test_SetLedgerEntry() public { address account = vm.addr(1); // example address _setLedgerEntry(account, 1e18, address(0)); - assertEq(getLedgerBalance(account, address(0)), 1e18); + assertEq(getLedgerBalance(account, address(0)), 1e18, "Expected balance should be 1e18 after setting entry"); } function test_SumLedgerEntry() public { address account = vm.addr(1); // example address _sumLedgerEntry(account, 1e18, address(0)); _sumLedgerEntry(account, 1e18, address(0)); - assertEq(getLedgerBalance(account, address(0)), 2e18); + assertEq(getLedgerBalance(account, address(0)), 2e18, "Expected balance should be 2e18 after summation"); } function test_SubLenderEntry() public { @@ -24,6 +24,6 @@ contract LedgerTest is Test, LedgerUpgradeable { _sumLedgerEntry(account, 1e18, address(0)); _subLedgerEntry(account, 1e18, address(0)); _subLedgerEntry(account, 1e18, address(0)); - assertEq(getLedgerBalance(account, address(0)), 0); + assertEq(getLedgerBalance(account, address(0)), 0, "Expected balance should be zero after subtraction"); } } diff --git a/test/primitives/Quorum.t.sol b/test/primitives/Quorum.t.sol index 44a8ab3..f7527ba 100644 --- a/test/primitives/Quorum.t.sol +++ b/test/primitives/Quorum.t.sol @@ -43,19 +43,19 @@ contract QuorumTest is Test { function test_DefaultStatus() public view { T.Status status = IQuorumInspectable(quorum).status(1234536789); - assertTrue(status == T.Status.Pending); + assertTrue(status == T.Status.Pending, "Default status should be Pending"); } function test_RegisterStatusFlow() public { uint256 entry = 1234567189; // initial pending status T.Status prevStatus = IQuorumInspectable(quorum).status(entry); - assertTrue(prevStatus == T.Status.Pending); + assertTrue(prevStatus == T.Status.Pending, "Initial status should be Pending"); // register status IQuorumRegistrable(quorum).register(entry); T.Status newStatus = IQuorumInspectable(quorum).status(entry); - assertTrue(newStatus == T.Status.Waiting); + assertTrue(newStatus == T.Status.Waiting, "Expected Waiting status after registration"); } function test_ActiveStatusFlow() public { @@ -64,7 +64,7 @@ contract QuorumTest is Test { IQuorumRegistrable(quorum).register(entry); IQuorumRegistrable(quorum).approve(entry); T.Status newStatus = IQuorumInspectable(quorum).status(entry); - assertTrue(newStatus == T.Status.Active); + assertTrue(newStatus == T.Status.Active, "Expected Active status after approval"); } function test_QuitStatusFlow() public { @@ -73,7 +73,7 @@ contract QuorumTest is Test { IQuorumRegistrable(quorum).register(entry); IQuorumRegistrable(quorum).quit(entry); T.Status newStatus = IQuorumInspectable(quorum).status(entry); - assertTrue(newStatus == T.Status.Pending); + assertTrue(newStatus == T.Status.Pending, "Expected Pending status after quitting"); } function test_BlockedStatusFlow() public { @@ -83,7 +83,7 @@ contract QuorumTest is Test { // blocked status happens before active IQuorumRegistrable(quorum).reject(entry); T.Status newStatus = IQuorumInspectable(quorum).status(entry); - assertTrue(newStatus == T.Status.Blocked); + assertTrue(newStatus == T.Status.Blocked, "Expected Blocked status after rejection"); } function test_RevokeStatusFlow() public { @@ -94,7 +94,7 @@ contract QuorumTest is Test { // revoked status happens after approved IQuorumRevokable(quorum).revoke(entry); T.Status newStatus = IQuorumInspectable(quorum).status(entry); - assertTrue(newStatus == T.Status.Blocked); + assertTrue(newStatus == T.Status.Blocked, "Expected Blocked status after revocation"); } function test_Approve_RevertWhen_ApproveNotRegistered() public { diff --git a/test/rights/RightAssetCustodian.t.sol b/test/rights/RightAssetCustodian.t.sol index 6b8af1b..b9a0bc0 100644 --- a/test/rights/RightAssetCustodian.t.sol +++ b/test/rights/RightAssetCustodian.t.sol @@ -1,3 +1,107 @@ // calc weight based on expected balance, demand and priority // get balanced custodian with a expected proba -// \ No newline at end of file +// + +// SPDX-License-Identifier: MIT +pragma solidity 0.8.26; + +import { IRightsAssetCustodianVerifiable } from "contracts/core/interfaces/rights/IRightsAssetCustodianVerifiable.sol"; +import { IRightsAssetCustodianRegistrable } from "contracts/core/interfaces/rights/IRightsAssetCustodianRegistrable.sol"; +import { ICustodianVerifiable } from "contracts/core/interfaces/custody/ICustodianVerifiable.sol"; +import { IBalanceVerifiable } from "contracts/core/interfaces/base/IBalanceVerifiable.sol"; +import { RightsAssetCustodian } from "contracts/rights/RightsAssetCustodian.sol"; +import { CustodianShared } from "test/shared/CustodianShared.t.sol"; + +contract RightAssetCustodianTest is CustodianShared { + // TODO evaluar gas report para analizar los fees en los tests + + address custodian; + + function setUp() public override { + super.setUp(); + custodian = deployCustodian("weare.com"); + _registerAndApproveCustodian(custodian); + deployRightsAssetCustodian(); + } + + function test_GrantCustody_ValidCustodian() public { + vm.prank(user); + IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian); + bool isCustodian = IRightsAssetCustodianVerifiable(rightAssetCustodian).isCustodian(custodian, user); + assertTrue(isCustodian, "Custodian should be registered"); + + // Verify the demand count + uint256 demand = IRightsAssetCustodianVerifiable(rightAssetCustodian).getCustodyCount(custodian); + assertEq(demand, 1, "Demand count should be incremented"); + } + + function test_GrantCustody_EmitCustodialGranted() public { + vm.prank(user); + + vm.expectEmit(true, true, true, false, address(rightAssetCustodian)); + emit RightsAssetCustodian.CustodialGranted(custodian, user, 1); + IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian); + } + + function test_GrantCustody_RevertIf_GrantDuplication() public { + vm.startPrank(user); + // registered first time + IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian); + uint256 demand = IRightsAssetCustodianVerifiable(rightAssetCustodian).getCustodyCount(custodian); + assertEq(demand, 1); + + // second expected failing attempt + vm.expectRevert(abi.encodeWithSignature("GrantCustodyFailed(address,address)", custodian, user)); + IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian); + vm.stopPrank(); + } + + function test_GrantCustody_RevertIf_ExceedAvailableRedundancy() public { + // MAX default = 3 + address custodian2 = deployCustodian("weare1.com"); + address custodian3 = deployCustodian("weare2.com"); + address custodian4 = deployCustodian("weare3.com"); + _registerAndApproveCustodian(custodian2); + _registerAndApproveCustodian(custodian3); + + vm.startPrank(user); + // registered first time + IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian); + IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian2); + IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian3); + // 3 is reached, he validation is effective after this line + + // second expected failing attempt + vm.expectRevert(abi.encodeWithSignature("MaxRedundancyAllowedReached()")); + IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian4); + vm.stopPrank(); + } + + function test_GrantCustody_RevertIf_InactiveNorRegisteredCustodian() public { + // MAX default = 3 + address custodian2 = deployCustodian("weare1.com"); + // second expected failing attempt + vm.prank(user); + vm.expectRevert(abi.encodeWithSignature("InvalidInactiveCustodian()")); + IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian2); + } + + function test_GetBalancedCustodian_ValidCustodian() public { + // // MAX default = 3 + // address custodian2 = deployCustodian("weare1.com"); + // address custodian3 = deployCustodian("weare2.com"); + // _registerAndApproveCustodian(custodian2); + // _registerAndApproveCustodian(custodian3); + + // vm.startPrank(user); + // // registered first time + // IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian); + // IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian2); + // IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian3); + // vm.stopPrank(); + + // IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian); + } + + // TODO revoke +} diff --git a/test/shared/CustodianShared.t.sol b/test/shared/CustodianShared.t.sol new file mode 100644 index 0000000..b9a7cb9 --- /dev/null +++ b/test/shared/CustodianShared.t.sol @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.26; + +import { BaseTest } from "test/BaseTest.t.sol"; +import { ICustodianFactory } from "contracts/core/interfaces/custody/ICustodianFactory.sol"; +import { ICustodianRegistrable } from "contracts/core/interfaces/custody/ICustodianRegistrable.sol"; +import { IAgreementManager } from "contracts/core/interfaces/financial/IAgreementManager.sol"; +import { ITollgate } from "contracts/core/interfaces/economics/ITollgate.sol"; +import { ILedgerVault } from "contracts/core/interfaces/financial/ILedgerVault.sol"; +import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol"; +import { T } from "contracts/core/primitives/Types.sol"; + +contract CustodianShared is BaseTest { + function setUp() public virtual initialize { + deployCustodianReferendum(); + deployCustodianFactory(); + } + + function deployCustodian(string memory endpoint) public returns (address) { + vm.prank(admin); + ICustodianFactory custodianFactory = ICustodianFactory(custodianFactory); + return custodianFactory.create(endpoint); + } + + function _setFeesAsGovernor(uint256 fees) internal { + vm.startPrank(governor); + ITollgate(tollgate).setFees(T.Scheme.FLAT, custodianReferendum, fees, token); + vm.stopPrank(); + } + + function _registerCustodianWithApproval(address d9r, uint256 approval) internal { + // manager = contract deployer + // only manager can pay enrollment.. + vm.startPrank(admin); + // approve approval to ledger to deposit funds + address[] memory parties = new address[](1); + parties[0] = d9r; + + uint256 proof = _createAgreement(approval, parties); + // operate over msg.sender ledger registered funds + ICustodianRegistrable(custodianReferendum).register(proof, d9r); + vm.stopPrank(); + } + + function _createAgreement(uint256 amount, address[] memory parties) internal returns (uint256) { + IERC20(token).approve(ledger, amount); + ILedgerVault(ledger).deposit(admin, amount, token); + + uint256 proof = IAgreementManager(agreementManager).createAgreement( + amount, + token, + address(custodianReferendum), + parties, + "" + ); + + return proof; + } + + function _registerAndApproveCustodian(address d9r) internal { + // intially the balance = 0 + _setFeesAsGovernor(1 * 1e18); + // register the custodian with fees = 100 MMC + _registerCustodianWithApproval(d9r, 1 * 1e18); + vm.prank(governor); // as governor. + // distribuitor approved only by governor.. + ICustodianRegistrable(custodianReferendum).approve(d9r); + } +}