@@ -154,6 +154,12 @@ interface IAssetManager is
154154 * to prevent current block being too outdated, which gives too short time for
155155 * minting or redemption payment.
156156 * NOTE: anybody can call.
157+ * NOTE: the block/timestamp will only be updated if it is strictly higher than the current value.
158+ * For mintings and redemptions we also add the duration from the last update (on this chain) to compensate
159+ * for the time that passed since the last update. This mechanism can be abused by providing old block proof
160+ * as fresh, which will distort the compensation accounting. Due to monotonicity such an attack will only work
161+ * if there was no block update for some time. Therefore it is enough to have at least one honest
162+ * current block updater regularly providing updates to avoid this issue.
157163 * @param _proof proof that a block with given number and timestamp exists
158164 */
159165 function updateCurrentBlock (
@@ -304,17 +310,18 @@ interface IAssetManager is
304310 returns (uint256 _withdrawalAllowedAt );
305311
306312 /**
307- * The agent is going to redeem `_valueWei` collateral pool tokens in the agent vault.
308- * This has to be announced and the agent must then wait `withdrawalWaitMinSeconds` time.
309- * After that time, the agent can call `redeemCollateralPoolTokens(_valueNATWei)` on the agent vault.
313+ * Agent is going to withdraw `_valuePoolTokenWei` of pool tokens from the agent vault
314+ * and redeem them for NAT from the collateral pool.
315+ * This has to be announced and the agent must then wait `withdrawalWaitMinSeconds`.
316+ * After that time, the agent can call redeemCollateralPoolTokens(_valuePoolTokenWei) on agent vault.
310317 * NOTE: may only be called by the agent vault owner.
311318 * @param _agentVault agent vault address
312- * @param _valueNATWei the amount to be withdrawn
319+ * @param _valuePoolTokenWei the amount to be withdrawn
313320 * @return _redemptionAllowedAt the timestamp when the redemption can be made
314321 */
315322 function announceAgentPoolTokenRedemption (
316323 address _agentVault ,
317- uint256 _valueNATWei
324+ uint256 _valuePoolTokenWei
318325 ) external
319326 returns (uint256 _redemptionAllowedAt );
320327
@@ -379,7 +386,7 @@ interface IAssetManager is
379386 // Agent information
380387
381388 /**
382- * Get (a part of) the list of all agents.
389+ * Get (a part of) the list of all active (not destroyed) agents.
383390 * The list must be retrieved in parts since retrieving the whole list can consume too much gas for one block.
384391 * @param _start first index to return from the available agent's list
385392 * @param _end end index (one above last) to return from the available agent's list
@@ -540,6 +547,9 @@ interface IAssetManager is
540547 * If the minter pays the underlying amount, minter obtains f-assets.
541548 * The collateral reservation fee is split between the agent and the collateral pool.
542549 * NOTE: the owner of the agent vault must be in the AgentOwnerRegistry.
550+ * NOTE: if the underlying block isn't updated regularly, it can happen that there is not enough time for
551+ * the underlying payment. Therefore minters have to verify the current underlying before minting and,
552+ * if needed, update it by calling `updateCurrentBlock`.
543553 * @param _agentVault agent vault address
544554 * @param _lots the number of lots for which to reserve collateral
545555 * @param _maxMintingFeeBIPS maximum minting fee (BIPS) that can be charged by the agent - best is just to
@@ -687,6 +697,9 @@ interface IAssetManager is
687697 * of remaining lots.
688698 * Agent receives redemption request id and instructions for underlying payment in
689699 * RedemptionRequested event and has to pay `value - fee` and use the provided payment reference.
700+ * NOTE: if the underlying block isn't updated regularly, it can happen that there is no time for underlying
701+ * payment. Since the agents cannot know when the next redemption will happen, they should regularly update the
702+ * underlying time by obtaining fresh proof of latest underlying block and calling `updateCurrentBlock`.
690703 * @param _lots number of lots to redeem
691704 * @param _redeemerUnderlyingAddressString the address to which the agent must transfer underlying amount
692705 * @param _executor the account that is allowed to execute redemption default (besides redeemer and agent)
@@ -850,7 +863,7 @@ interface IAssetManager is
850863 * among the first `maxRedeemedTickets` tickets.
851864 * To fix this, call this method. It converts small tickets to dust and when the dust exceeds one lot
852865 * adds it to the ticket.
853- * Since the method just cleans the redemption queue it can be called by anybody .
866+ * NOTE: this method can be called by the governance or its executor .
854867 * @param _firstTicketId if nonzero, the ticket id of starting ticket; if zero, the starting ticket will
855868 * be the redemption queue's first ticket id.
856869 * When the method finishes, it emits RedemptionTicketsConsolidated event with the nextTicketId
0 commit comments