Skip to content

Commit 06b54f8

Browse files
committed
docs: added extra comments to clarify the settlement process on referendum
1 parent e82d181 commit 06b54f8

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

contracts/custody/CustodianReferendum.sol

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ contract CustodianReferendum is
170170
//
171171
// The collected fees are used to support the protocol's operations, aligning
172172
// individual actions with the broader sustainability of the network.
173+
174+
// IMPORTANT:
175+
// The expected fees are locked in the agreement, based on the custodians fees defined by the tollgate.
176+
// If the fee amount is insufficient, the transaction will revert during agreement creation.
177+
// Only valid agreements can be settled; the validity is guaranteed by the proof.
173178
T.Agreement memory agreement = AGREEMENT_SETTLER.settleAgreement(proof, msg.sender);
174179
if (agreement.parties[0] != custodian) {
175180
revert CustodianAgreementMismatch(custodian);

contracts/financial/AgreementManager.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ contract AgreementManager is Initializable, UUPSUpgradeable, AccessControlledUpg
184184
/// @param currency The address of the currency for which the fee is being calculated.
185185
/// @return The calculated fee amount based on the applicable fee scheme.
186186
function _calcFees(uint256 total, address target, address currency) private view returns (uint256) {
187-
// !IMPORTANT if fees manager does not support the currency, will revert..
187+
// !IMPORTANT if fees manager does not support the currency or the target, will revert..
188188
(uint256 fees, T.Scheme scheme) = TOLLGATE.getFees(target, currency);
189189
if (scheme == T.Scheme.BPS) return total.perOf(fees); // bps calc
190190
if (scheme == T.Scheme.NOMINAL) return total.perOf(fees.calcBps()); // nominal to bps

test/rights/RightAssetCustodian.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ contract RightAssetCustodianTest is CustodianShared {
8787
IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian);
8888
IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian2);
8989
IRightsAssetCustodianRegistrable(rightAssetCustodian).grantCustody(custodian3);
90-
// 3 is reached, he validation is effective after this line
90+
// 3 is reached, the validation is effective after this line
9191

9292
// second expected failing attempt
9393
vm.expectRevert(abi.encodeWithSignature("MaxRedundancyAllowedReached()"));

0 commit comments

Comments
 (0)