@@ -35,7 +35,7 @@ const (
3535 solChange = 0 // External chain
3636
3737 // Number of addresses to derive; change this to derive more or fewer addresses.
38- addressCount = 2
38+ addressCount = uint32 ( 2 )
3939)
4040
4141type DerivedAddress struct {
@@ -157,10 +157,9 @@ func main() {
157157 logger .Fatal ("chain_code not found in config" , fmt .Errorf ("required for HD derivation" ))
158158 }
159159
160- addresses := make ([]* DerivedAddress , addressCount )
161- for i := 0 ; i < addressCount ; i ++ {
162- childIndex := uint32 (i )
163- path := []uint32 {solPurpose , solCoinType , childIndex , solChange }
160+ addresses := make ([]* DerivedAddress , int (addressCount ))
161+ for i := uint32 (0 ); i < addressCount ; i ++ {
162+ path := []uint32 {solPurpose , solCoinType , i , solChange }
164163
165164 // Derive child public key from master (NO MPC!)
166165 childPubKey , err := deriveChildPublicKeyEd25519 (masterPubKey , chainCodeHex , path )
@@ -179,8 +178,8 @@ func main() {
179178
180179 address := deriveSolanaAddress (childPubKey )
181180
182- addresses [i ] = & DerivedAddress {
183- Index : childIndex ,
181+ addresses [int ( i ) ] = & DerivedAddress {
182+ Index : i ,
184183 DerivationPath : path ,
185184 PublicKey : childPubKey ,
186185 Address : address ,
0 commit comments