Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
huangzhen1997 committed Feb 26, 2025
1 parent 5c759d8 commit 6431aa2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/capabilities/ccip/ccipevm/addresscodec.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ import (
"encoding/hex"
"fmt"
"strings"

"github.com/ethereum/go-ethereum/common"
)

type AddressCodec struct{}

func (a AddressCodec) AddressBytesToString(addr []byte) (string, error) {
// TODO support EIP-55 checksum, https://smartcontract-it.atlassian.net/browse/CCIP-5340
if len(addr) != common.AddressLength {
return "", fmt.Errorf("invalid EVM address length, expected %v, got %d", common.AddressLength, len(addr))
}

return "0x" + hex.EncodeToString(addr), nil
}

Expand Down

0 comments on commit 6431aa2

Please sign in to comment.