Skip to content
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

fix zkevm handle #101

Merged
merged 1 commit into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions coin/coins.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion coin/coins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@

- id: 10001101
symbol: ZKEVM
handle: zkevm
handle: polygonzkevm
name: Polygon zkEVM
decimals: 18
blockchain: Ethereum
Expand Down
2 changes: 1 addition & 1 deletion coin/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func GetCoinExploreURL(c Coin, tokenID, tokenType string) (string, error) {
return fmt.Sprintf("https://bobascan.com/token/%s", tokenID), nil
case TON:
return fmt.Sprintf("https://tonscan.org/address/%s", tokenID), nil
case ZKEVM:
case POLYGONZKEVM:
return fmt.Sprintf("https://explorer.public.zkevm-test.net/address/%s", tokenID), nil
case ZKSYNC:
return fmt.Sprintf("https://explorer.zksync.io/address/%s", tokenID), nil
Expand Down
4 changes: 2 additions & 2 deletions coin/models_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func TestGetCoinExploreURL(t *testing.T) {
args: args{
addr: "test",
tokenType: "ZKEVM",
chain: Zkevm(),
chain: Polygonzkevm(),
},
want: "https://explorer.public.zkevm-test.net/address/test",
wantErr: false,
Expand Down Expand Up @@ -330,7 +330,7 @@ var evmCoinsTestSet = map[uint]struct{}{
METIS: {},
MOONRIVER: {},
BOBA: {},
ZKEVM: {},
POLYGONZKEVM: {},
ZKSYNC: {},
}

Expand Down
4 changes: 2 additions & 2 deletions types/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ func GetChainFromAssetType(assetType string) (coin.Coin, error) {
return coin.Boba(), nil
case TON:
return coin.Ton(), nil
case ZKEVM:
return coin.Zkevm(), nil
case POLYGONZKEVM:
return coin.Polygonzkevm(), nil
case ZKSYNC:
return coin.Zksync(), nil
case SUI:
Expand Down
128 changes: 64 additions & 64 deletions types/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,66 +29,66 @@ type (
)

const (
Coin TokenType = "coin"
Gas TokenType = "gas"
ERC20 TokenType = "ERC20"
ERC721 TokenType = "ERC721"
ERC1155 TokenType = "ERC1155"
BEP2 TokenType = "BEP2"
BEP8 TokenType = "BEP8"
BEP20 TokenType = "BEP20"
TRC10 TokenType = "TRC10"
ETC20 TokenType = "ETC20"
POA20 TokenType = "POA20"
TRC20 TokenType = "TRC20"
TRC21 TokenType = "TRC21"
CLO20 TokenType = "CLO20"
GO20 TokenType = "GO20"
WAN20 TokenType = "WAN20"
TT20 TokenType = "TT20"
KAVA TokenType = "KAVA"
SPL TokenType = "SPL"
POLYGON TokenType = "POLYGON"
OPTIMISM TokenType = "OPTIMISM"
XDAI TokenType = "XDAI"
AVALANCHE TokenType = "AVALANCHE"
FANTOM TokenType = "FANTOM"
HRC20 TokenType = "HRC20"
ARBITRUM TokenType = "ARBITRUM"
TERRA TokenType = "TERRA"
RONIN TokenType = "RONIN"
EOS TokenType = "EOS"
NEP5 TokenType = "NEP5"
NRC20 TokenType = "NRC20"
VET TokenType = "VET"
ONTOLOGY TokenType = "ONTOLOGY"
THETA TokenType = "THETA"
TOMO TokenType = "TOMO"
WAVES TokenType = "WAVES"
POA TokenType = "POA"
CELO TokenType = "CELO"
ESDT TokenType = "ESDT"
CW20 TokenType = "CW20"
OASIS TokenType = "OASIS"
CRC20 TokenType = "CRC20"
STELLAR TokenType = "STELLAR"
KRC20 TokenType = "KRC20"
AURORA TokenType = "AURORA"
ALGORAND TokenType = "ALGORAND"
KAVAERC20 TokenType = "KAVAERC20"
METER TokenType = "METER"
EVMOS_ERC20 TokenType = "EVMOS_ERC20"
KIP20 TokenType = "KIP20"
APTOS TokenType = "APTOS"
MOONBEAM TokenType = "MOONBEAM"
KLAYTN TokenType = "KLAYTN"
METIS TokenType = "METIS"
MOONRIVER TokenType = "MOONRIVER"
BOBA TokenType = "BOBA"
TON TokenType = "TON"
ZKEVM TokenType = "ZKEVM"
ZKSYNC TokenType = "ZKSYNC"
SUI TokenType = "SUI"
Coin TokenType = "coin"
Gas TokenType = "gas"
ERC20 TokenType = "ERC20"
ERC721 TokenType = "ERC721"
ERC1155 TokenType = "ERC1155"
BEP2 TokenType = "BEP2"
BEP8 TokenType = "BEP8"
BEP20 TokenType = "BEP20"
TRC10 TokenType = "TRC10"
ETC20 TokenType = "ETC20"
POA20 TokenType = "POA20"
TRC20 TokenType = "TRC20"
TRC21 TokenType = "TRC21"
CLO20 TokenType = "CLO20"
GO20 TokenType = "GO20"
WAN20 TokenType = "WAN20"
TT20 TokenType = "TT20"
KAVA TokenType = "KAVA"
SPL TokenType = "SPL"
POLYGON TokenType = "POLYGON"
OPTIMISM TokenType = "OPTIMISM"
XDAI TokenType = "XDAI"
AVALANCHE TokenType = "AVALANCHE"
FANTOM TokenType = "FANTOM"
HRC20 TokenType = "HRC20"
ARBITRUM TokenType = "ARBITRUM"
TERRA TokenType = "TERRA"
RONIN TokenType = "RONIN"
EOS TokenType = "EOS"
NEP5 TokenType = "NEP5"
NRC20 TokenType = "NRC20"
VET TokenType = "VET"
ONTOLOGY TokenType = "ONTOLOGY"
THETA TokenType = "THETA"
TOMO TokenType = "TOMO"
WAVES TokenType = "WAVES"
POA TokenType = "POA"
CELO TokenType = "CELO"
ESDT TokenType = "ESDT"
CW20 TokenType = "CW20"
OASIS TokenType = "OASIS"
CRC20 TokenType = "CRC20"
STELLAR TokenType = "STELLAR"
KRC20 TokenType = "KRC20"
AURORA TokenType = "AURORA"
ALGORAND TokenType = "ALGORAND"
KAVAERC20 TokenType = "KAVAERC20"
METER TokenType = "METER"
EVMOS_ERC20 TokenType = "EVMOS_ERC20"
KIP20 TokenType = "KIP20"
APTOS TokenType = "APTOS"
MOONBEAM TokenType = "MOONBEAM"
KLAYTN TokenType = "KLAYTN"
METIS TokenType = "METIS"
MOONRIVER TokenType = "MOONRIVER"
BOBA TokenType = "BOBA"
TON TokenType = "TON"
POLYGONZKEVM TokenType = "ZKEVM"
ZKSYNC TokenType = "ZKSYNC"
SUI TokenType = "SUI"
)

const (
Expand Down Expand Up @@ -164,7 +164,7 @@ func GetTokenTypes() []TokenType {
MOONRIVER,
BOBA,
TON,
ZKEVM,
POLYGONZKEVM,
ZKSYNC,
SUI,
}
Expand Down Expand Up @@ -280,7 +280,7 @@ func GetTokenVersion(tokenType string) (TokenVersion, error) {
return TokenVersionV10, nil
case RONIN, AURORA:
return TokenVersionV11, nil
case TON, ZKEVM, ZKSYNC, SUI:
case TON, POLYGONZKEVM, ZKSYNC, SUI:
return TokenVersionV12, nil
case ERC721, ERC1155, EOS, NEP5, VET, ONTOLOGY, THETA, TOMO, POA, OASIS, ALGORAND,
KAVAERC20, METER, EVMOS_ERC20, KIP20, MOONBEAM, KLAYTN, METIS, MOONRIVER, BOBA:
Expand Down Expand Up @@ -365,8 +365,8 @@ func GetEthereumTokenTypeByIndex(coinIndex uint) (TokenType, error) {
tokenType = BOBA
case coin.TON:
tokenType = TON
case coin.ZKEVM:
tokenType = ZKEVM
case coin.POLYGONZKEVM:
tokenType = POLYGONZKEVM
case coin.ZKSYNC:
tokenType = ZKSYNC
case coin.SUI:
Expand Down
4 changes: 2 additions & 2 deletions types/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ func TestGetTokenType(t *testing.T) {
},
{
name: "zkEVM",
args: args{coin.ZKEVM, ""},
want: string(ZKEVM),
args: args{coin.POLYGONZKEVM, ""},
want: string(POLYGONZKEVM),
wantBool: true,
},
{
Expand Down