-
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!: external erc20 support #1234
Conversation
1761990
to
82902ec
Compare
fa8a3fa
to
ec3a450
Compare
if !s.nexus.IsAssetRegistered(ctx, originChain, req.Asset.Name) { | ||
return nil, fmt.Errorf("asset %s is not registered on the origin chain %s", originChain.NativeAsset, originChain.Name) | ||
} |
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.
why dont' we need to check if the asset is registered for external tokens?
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.
Cuz when deploying an external token, this is the process of having it registered.
return &CreateDeployTokenRequest{ | ||
Sender: sender, | ||
Chain: utils.NormalizeString(chain), | ||
Asset: asset, | ||
TokenDetails: tokenDetails, | ||
MinAmount: minAmount, | ||
Address: 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.
Dont' we need to update Validate
with a check for this new field?
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.
Address is of type byte[20]
and therefore there's nothing to be validated.
a00aedd
to
8a182a6
Compare
24976a7
to
0f5082c
Compare
550fe1d
to
06ecce4
Compare
@@ -0,0 +1,163 @@ | |||
package legacy |
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.
this is basically a copy of params.go before adding the new field, right?
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.
correct!
GetTokenByteCodes(ctx sdk.Context) ([]byte, bool) | ||
GetGatewayByteCode(ctx sdk.Context) ([]byte, bool) | ||
GetBurnerByteCode(ctx sdk.Context) ([]byte, bool) | ||
GetTokenByteCode(ctx sdk.Context) ([]byte, bool) |
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.
why not have one for the absorver too?
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 did it like
axelar-core/x/evm/keeper/chainKeeper.go
Line 273 in c10d473
bytecode := k.GetParams(ctx).Absorber |
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.
LGTM, but better wait for Chis and/or Haiyi to also check this out
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.
the external erc20 deployment is still under the controller keys control, right
@@ -156,6 +156,7 @@ func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { | |||
// module-specific GRPC queries. | |||
func (am AppModule) RegisterServices(cfg module.Configurator) { | |||
types.RegisterQueryServiceServer(cfg.QueryServer(), am.keeper) | |||
cfg.RegisterMigration(types.ModuleName, 1, keeper.GetMigrationHandler(am.keeper, am.nexus)) |
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.
why is this registered 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.
That's where cosmos-hub did it so I just assumed that this is the best place for it.
@cgorenflo Yes since it's the same type of tx |
06ecce4
to
05d53ca
Compare
Description
Mint and Burn worked at
https://ropsten.etherscan.io/tx/0xb7a66f34db2101f130db03b24058fa076039242512fbd4c5af64099cb076c1c2
https://ropsten.etherscan.io/tx/0x50a06b02579c363c9562bf233484530a359b697128e96e37f3ea49c2c90f9d6f
contracts' bytecode matches axelarnetwork/axelar-cgp-solidity#50
Todos
Steps to Test
Expected Behaviour
Other Notes