-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add max mint limit constraint #5492
base: ccip-warp-route
Are you sure you want to change the base?
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## ccip-warp-route #5492 +/- ##
================================================
Coverage 77.11% 77.11%
================================================
Files 109 109
Lines 2163 2163
Branches 193 193
================================================
Hits 1668 1668
Misses 474 474
Partials 21 21
|
destinationToken.standard === TokenStandard.EvmHypVSXERC20Lockbox | ||
) { | ||
const bufferCap = await adapter.getMintMaxLimit(); | ||
const max = bufferCap / 2n; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the limit has not replenished to the midpoint and is above it i.e we have recently burned more than minted, we would be allowed to mint more than half the buffer cap at this point.
We could instead check if destinationBalance
is greater than getMintLimit()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nambrot wants to avoid this situation where the mint limit is decreasing and the latency of message delivery can cause the transfer to appear mintable at dispatch time but not at process time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise we would not have made any changes to this adapter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense
destinationBalance = await adapter.getMintLimit(); | ||
|
||
if ( | ||
destinationToken.standard === TokenStandard.EvmHypVSXERC20 || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will this standard get set? Right now, it is not yeah? wouldn't we need a corresponding change in the warp core config artifact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, the config artifact is only in the UI afaik?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesnt need to be urgently merged as @Xaroz already made the change on the UI
this just protects against onchain limit changes
Description
Drive-by changes
Related issues
Backward compatibility
Testing