-
Notifications
You must be signed in to change notification settings - Fork 254
fix(portfolio-contract)!: limit outbound CCTP to >= 1USDC #12184
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <[email protected]>
frazarshad
left a comment
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.
IIRC. this limit also exists for CCTP from evm -> cosmos. should we also add a check there?
No; latest from Noble (Oct 29) is "for inbound transfers to Noble that minimum should not apply." |
| const { chainId, remoteAddress } = dest; | ||
| traceTransfer('transfer', denomAmount, 'to', remoteAddress); | ||
| amount.value >= CCTP_OUTBOUND_THRESHOLD || | ||
| Fail`too small to relay: ${amount} below ${CCTP_OUTBOUND_THRESHOLD}`; |
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.
Should it be amount.value?
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.
Any particular reason?
Oh... I guess it should be q(amount)
| * | ||
| * XXX could be configurable for test networks | ||
| */ | ||
| const CCTP_OUTBOUND_THRESHOLD = 1_000_000n; |
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.
I think we should add a test for threshold enforcement.
A test that uses values less than 1 USDC.
|
|
||
| test('claim rewards on Aave position', async t => { | ||
| const amount = AmountMath.make(USDC, 300n); | ||
| const amount = AmountMath.make(USDC, 2_000_000n); |
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.
consider using withAmountUtils in this test to make it easier to work with units. this could be
| const amount = AmountMath.make(USDC, 2_000_000n); | |
| const amount = usdc.units(2.0); |
Even better you could inline the amount since the name isn't helping
refs:
Description
Refuse to ask CCTP relayers to handle amounts below their threshold.
Security Considerations
Relies on the premise that funds in
@nobleare under the portfolio owner's control; i.e. they can withdraw them... which see https://github.com/Agoric/agoric-private/issues/492Scaling Considerations
n/a
Documentation Considerations
Primary documentation is in the UI. The diagnostic here is Just In Case.
Testing Considerations
existing tests needed updating
Upgrade Considerations
behavior only. no exo state changes. compatible with
ymaxControl.upgrade(...).