-
Notifications
You must be signed in to change notification settings - Fork 260
feat: use latest initiad & initia.js #1783
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: main
Are you sure you want to change the base?
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
PR SummaryUpdates Initia support and OFT adapter initialization across contracts, SDK, CLI, and examples.
Written by Cursor Bugbot for commit 19754b9. This will update automatically on new commits. Configure here. |
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.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
| types: ['address', 'u8'], | ||
| multiSigArgs: [tokenMetadataAddress, sharedDecimals], | ||
| types: ['address', 'u8', 'u8'], | ||
| multiSigArgs: [tokenMetadataAddress, sharedDecimals, localDecimals || 0], |
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.
Multi-sig args incorrectly handle undefined localDecimals as zero
Medium Severity
The multiSigArgs for initializeAdapterFAPayload uses localDecimals || 0, which converts undefined to 0. This loses the semantic distinction between "not specified" (should be Option::None, meaning use default decimals from metadata) and "explicitly 0 decimals" (should be Option::Some(0)). When multi-sig users export and reconstruct transactions, this causes incorrect behavior where the contract uses 0 decimals instead of the token's metadata decimals.
| functionArguments: [tokenMetadataAddress, sharedDecimals], | ||
| types: ['address', 'u8'], | ||
| functionArguments: [tokenMetadataAddress, sharedDecimals, localDecimals || 0], | ||
| types: ['address', 'u8', 'u8'], |
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.
Aptos SDK passes three arguments to two-parameter contract function
High Severity
The initializeAdapterFAPayload function in aptosOFT.ts and oft.ts now passes three arguments (tokenMetadataAddress, sharedDecimals, localDecimals || 0) to the contract's oft_adapter_fa::initialize function. However, the Aptos contract at examples/oft-adapter-aptos-move only accepts two parameters (token_metadata_address: address, shared_decimals: u8). This parameter count mismatch will cause all Aptos OFT adapter initialization transactions to fail at runtime.
Summary of Changes