-
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?
Changes from all commits
da7393c
5bb46d9
5a5163d
3055c78
c0a0a08
a248edd
2cfdd27
a17d5c1
14eb9bd
227d389
374a08e
d26ef77
733f484
19754b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,3 +30,4 @@ shell-scripts | |
|
|
||
| transactions/* | ||
| !transactions/.gitkeep | ||
| deployments | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,3 +31,4 @@ shell-scripts | |
|
|
||
| transactions/* | ||
| !transactions/.gitkeep | ||
| deployments | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,12 +67,13 @@ export class aptosOFT implements IOFT { | |
|
|
||
| initializeAdapterFAPayload( | ||
| tokenMetadataAddress: string, | ||
| sharedDecimals: number | ||
| sharedDecimals: number, | ||
| localDecimals?: number | ||
| ): TypedInputGenerateTransactionPayloadData { | ||
| return { | ||
| function: `${this.oft_address}::oft_adapter_fa::initialize`, | ||
| 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 commentThe reason will be displayed to describe this comment to others. Learn more. Aptos SDK passes three arguments to two-parameter contract functionHigh Severity The Additional Locations (1) |
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -583,19 +583,24 @@ export class InitiaOFT implements IOFT { | |
|
|
||
| initializeAdapterFAPayload( | ||
| tokenMetadataAddress: string, | ||
| sharedDecimals: number | ||
| sharedDecimals: number, | ||
| localDecimals?: number | ||
| ): TypedInputGenerateTransactionPayloadData { | ||
| const msg = new MsgExecute( | ||
| this.accountAddress, | ||
| this.oft_address, | ||
| 'oft_adapter_fa', | ||
| 'initialize', | ||
| [], | ||
| [bcs.address().serialize(tokenMetadataAddress).toBase64(), bcs.u8().serialize(sharedDecimals).toBase64()] | ||
| [ | ||
| bcs.address().serialize(tokenMetadataAddress).toBase64(), | ||
| bcs.u8().serialize(sharedDecimals).toBase64(), | ||
| bcs.option(bcs.u8()).serialize(localDecimals).toBase64(), | ||
| ] | ||
| ) | ||
| return Object.assign(msg, { | ||
| 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 commentThe reason will be displayed to describe this comment to others. Learn more. Multi-sig args incorrectly handle undefined localDecimals as zeroMedium Severity The |
||
| }) | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.