@@ -130,6 +130,12 @@ interface IAssetManager is
130130 * to prevent current block being too outdated, which gives too short time for
131131 * minting or redemption payment.
132132 * NOTE: anybody can call.
133+ * NOTE: the block/timestamp will only be updated if it is strictly higher than the current value.
134+ * For mintings and redemptions we also add the duration from the last update (on this chain) to compensate
135+ * for the time that passed since the last update. This mechanism can be abused by providing old block proof
136+ * as fresh, which will distort the compensation accounting. Due to monotonicity such an attack will only work
137+ * if there was no block update for some time. Therefore it is enough to have at least one honest
138+ * current block updater regularly providing updates to avoid this issue.
133139 * @param _proof proof that a block with given number and timestamp exists
134140 */
135141 function updateCurrentBlock (
@@ -280,17 +286,18 @@ interface IAssetManager is
280286 ) external returns (uint256 _withdrawalAllowedAt );
281287
282288 /**
283- * The agent is going to redeem `_valueWei` collateral pool tokens in the agent vault.
284- * This has to be announced and the agent must then wait `withdrawalWaitMinSeconds` time.
285- * After that time, the agent can call `redeemCollateralPoolTokens(_valueNATWei)` on the agent vault.
289+ * Agent is going to withdraw `_valuePoolTokenWei` of pool tokens from the agent vault
290+ * and redeem them for NAT from the collateral pool.
291+ * This has to be announced and the agent must then wait `withdrawalWaitMinSeconds`.
292+ * After that time, the agent can call redeemCollateralPoolTokens(_valuePoolTokenWei) on agent vault.
286293 * NOTE: may only be called by the agent vault owner.
287294 * @param _agentVault agent vault address
288- * @param _valueNATWei the amount to be withdrawn
295+ * @param _valuePoolTokenWei the amount to be withdrawn
289296 * @return _redemptionAllowedAt the timestamp when the redemption can be made
290297 */
291298 function announceAgentPoolTokenRedemption (
292299 address _agentVault ,
293- uint256 _valueNATWei
300+ uint256 _valuePoolTokenWei
294301 ) external returns (uint256 _redemptionAllowedAt );
295302
296303 ////////////////////////////////////////////////////////////////////////////////////
@@ -350,7 +357,7 @@ interface IAssetManager is
350357 // Agent information
351358
352359 /**
353- * Get (a part of) the list of all agents.
360+ * Get (a part of) the list of all active (not destroyed) agents.
354361 * The list must be retrieved in parts since retrieving the whole list can consume too much gas for one block.
355362 * @param _start first index to return from the available agent's list
356363 * @param _end end index (one above last) to return from the available agent's list
@@ -519,6 +526,9 @@ interface IAssetManager is
519526 * If the minter pays the underlying amount, minter obtains f-assets.
520527 * The collateral reservation fee is split between the agent and the collateral pool.
521528 * NOTE: the owner of the agent vault must be in the AgentOwnerRegistry.
529+ * NOTE: if the underlying block isn't updated regularly, it can happen that there is not enough time for
530+ * the underlying payment. Therefore minters have to verify the current underlying before minting and,
531+ * if needed, update it by calling `updateCurrentBlock`.
522532 * @param _agentVault agent vault address
523533 * @param _lots the number of lots for which to reserve collateral
524534 * @param _maxMintingFeeBIPS maximum minting fee (BIPS) that can be charged by the agent - best is just to
@@ -662,6 +672,9 @@ interface IAssetManager is
662672 * of remaining lots.
663673 * Agent receives redemption request id and instructions for underlying payment in
664674 * RedemptionRequested event and has to pay `value - fee` and use the provided payment reference.
675+ * NOTE: if the underlying block isn't updated regularly, it can happen that there is no time for underlying
676+ * payment. Since the agents cannot know when the next redemption will happen, they should regularly update the
677+ * underlying time by obtaining fresh proof of latest underlying block and calling `updateCurrentBlock`.
665678 * @param _lots number of lots to redeem
666679 * @param _redeemerUnderlyingAddressString the address to which the agent must transfer underlying amount
667680 * @param _executor the account that is allowed to execute redemption default (besides redeemer and agent)
@@ -831,7 +844,7 @@ interface IAssetManager is
831844 * among the first `maxRedeemedTickets` tickets.
832845 * To fix this, call this method. It converts small tickets to dust and when the dust exceeds one lot
833846 * adds it to the ticket.
834- * Since the method just cleans the redemption queue it can be called by anybody .
847+ * NOTE: this method can be called by the governance or its executor .
835848 * @param _firstTicketId if nonzero, the ticket id of starting ticket; if zero, the starting ticket will
836849 * be the redemption queue's first ticket id.
837850 * When the method finishes, it emits RedemptionTicketsConsolidated event with the nextTicketId
0 commit comments