-
Notifications
You must be signed in to change notification settings - Fork 75
fix: scripts to rebalance funds from hub to spoke #783
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
Conversation
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
| .getNoncePda({ | ||
| nonce: new BN(nonce.toString()), | ||
| sourceDomain: remoteDomain, | ||
| }) | ||
| .accounts({ | ||
| messageTransmitter: messageTransmitterState, | ||
| }) | ||
| .view()) as PublicKey; |
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.
is this optimally linted?
| remainingAccounts.push({ | ||
| isSigner: false, | ||
| isWritable: false, | ||
| pubkey: tokenMessengerAccount, | ||
| }); | ||
| remainingAccounts.push({ | ||
| isSigner: false, | ||
| isWritable: false, | ||
| pubkey: remoteTokenMessengerKey, | ||
| }); | ||
| remainingAccounts.push({ | ||
| isSigner: false, | ||
| isWritable: true, | ||
| pubkey: tokenMinterAccount, | ||
| }); | ||
| remainingAccounts.push({ | ||
| isSigner: false, | ||
| isWritable: true, | ||
| pubkey: localToken, | ||
| }); | ||
| remainingAccounts.push({ | ||
| isSigner: false, | ||
| isWritable: false, | ||
| pubkey: tokenPair, | ||
| }); | ||
| remainingAccounts.push({ | ||
| isSigner: false, | ||
| isWritable: true, | ||
| pubkey: vault, | ||
| }); | ||
| remainingAccounts.push({ | ||
| isSigner: false, | ||
| isWritable: true, | ||
| pubkey: custodyTokenAccount, | ||
| }); | ||
| remainingAccounts.push({ | ||
| isSigner: false, | ||
| isWritable: false, | ||
| pubkey: TOKEN_PROGRAM_ID, | ||
| }); | ||
| remainingAccounts.push({ | ||
| isSigner: false, | ||
| isWritable: false, | ||
| pubkey: tokenMessengerEventAuthority, | ||
| }); | ||
| remainingAccounts.push({ | ||
| isSigner: false, | ||
| isWritable: false, | ||
| pubkey: tokenMessengerMinterProgram.programId, | ||
| }); |
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.
same with this. I think it can be linted to be much shorter.
| @@ -0,0 +1,293 @@ | |||
| // This script executes root bundle on HubPool that rebalances tokens to Solana Spoke Pool. Required environment: | |||
| // - ETHERS_PROVIDER_URL: Ethereum RPC provider URL. | |||
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.
As part of the tech debt task we can update this env vars to be consistent across the scripts so this comment is just an observation
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.
Looks good.
There might be some changes to improve environment variable consistency with other scripts, move some hardcoded values to the constants file, and relocate some reused functions to a common library as well. However, that can be part of the tech debt task.
Adds scripts that allows to test pool rebalancing from HubPool to Solana SpokePool. Tested in these tx: