-
Notifications
You must be signed in to change notification settings - Fork 105
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
feat: whitelist spl [in progress] #2984
base: develop
Are you sure you want to change the base?
Conversation
@@ -76,8 +76,8 @@ policy_accounts: | |||
private_key: "0595CB0CD9BF5264A85A603EC8E43C30ADBB5FD2D9E2EF84C374EA4A65BB616C" | |||
observer_relayer_accounts: | |||
relayer_accounts: | |||
- solana_address: "2qBVcNBZCubcnSR3NyCnFjCfkCVUB3G7ECPoaW5rxVjx" | |||
solana_private_key: "3EMjCcCJg53fMEGVj13UPQpo6py9AKKyLE2qroR4yL1SvAN2tUznBvDKRYjntw7m6Jof1R2CSqjTddL27rEb6sFQ" | |||
- solana_address: "37yGiHAnLvWZUNVwu9esp74YQFqxU1qHCbABkDvRddUQ" |
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.
@ws4charlie solana relayer and deployer used in e2e tests are different, and with recent introduction of using deployer as authority for whitelist (and other messages), is it ok to use same account here, or maybe we can add new key for zetaclient?
require.NoError(r, err) | ||
|
||
tokenAccount := solana.NewWallet() | ||
createAccountInstruction := system.NewCreateAccountInstruction( |
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.
using create account and initialize mint instructions in same transaction to create new mint account
@@ -8,7 +8,7 @@ import ( | |||
|
|||
const ( | |||
// SolanaGatewayProgramID is the program ID of the Solana gateway program | |||
SolanaGatewayProgramID = "94U5AHQMKkV5txNJ17QPXWoh474PheGou6cNP2FEuL1d" | |||
SolanaGatewayProgramID = "BaDmykPHVwPQNY9SXQnJU8JPXdN89z3ib7qEfhNfkWRg" |
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.
@ws4charlie i used anchor build
locally to get latest program changes, and this is program id generated based on keypair generated, but it is out of sync with current program id used in that repo, i assume we need to use same gateway key pair file to build it, but we dont have correct one anywhere
) | ||
} | ||
} | ||
// erc20Addr := ethcommon.HexToAddress(msg.Erc20Address) |
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.
since this msg is not just erc20 anymore, these checks can be removed
below check if already exists is redundant since we have it below in DeployZRC20Contract but can be reverted
Q: should we rename erc20 everywhere in this msg and params to asset
?
if ethcommon.HexToAddress(msg.Erc20Address) == (ethcommon.Address{}) { | ||
return cosmoserrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid ERC20 contract address (%s)", msg.Erc20Address) | ||
} | ||
// if ethcommon.HexToAddress(msg.Erc20Address) == (ethcommon.Address{}) { |
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.
similarly, not needed anymore since erc20 is not only asset used with this msg
@@ -352,6 +359,10 @@ func ParseGatewayInstruction( | |||
switch coinType { | |||
case coin.CoinType_Gas: | |||
return contracts.ParseInstructionWithdraw(instruction) | |||
// for these currently parsing is not needed since instructions are empty, and these instructions dont implement OutboundInstruction interface | |||
// can be revisited as more are added | |||
case coin.CoinType_Cmd: |
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 this part can be cleaner, but currently interface for instruction seems tightly coupled with withdraw, and it is not applied at all to whitelist, so i thought to just dont parse these since parsed result is not needed to further process them
@lumtis @ws4charlie could you please do initial review for this draft? i left some questions and open points, thanks |
Description
in progress
How Has This Been Tested?