@@ -70,7 +70,7 @@ func (p *reserveService) Start(serviceCtx context.Context, interval time.Duratio
7070 }
7171}
7272
73- // todo: Don't hardcode Jeffy
73+ // todo: Don't hardcode Jeffy and other Flipcash currencies
7474func (p * reserveService ) UpdateAllLaunchpadCurrencyReserves (ctx context.Context ) error {
7575 err1 := func () error {
7676 jeffyMintAccount , _ := common .NewAccountFromPublicKeyString ("52MNGpgvydSwCtC2H4qeiZXZ1TxEuRVCRGa8LAfk2kSj" )
@@ -128,12 +128,43 @@ func (p *reserveService) UpdateAllLaunchpadCurrencyReserves(ctx context.Context)
128128 })
129129 }()
130130
131+ err3 := func () error {
132+ farmerCoinMintAccount , _ := common .NewAccountFromPublicKeyString ("2o4PFbDZ73BihFraknfVTQeUtELKAeVUL4oa6bkrYU3A" )
133+ farmerCoinVaultAccount , _ := common .NewAccountFromPublicKeyString ("29LVpSKGQ9PmdWnXmrTD6RmNqNTW9umCjfJzdFPXNKAR" )
134+ coreMintVaultAccount , _ := common .NewAccountFromPublicKeyString ("7hdq6ipigk9Jb5LwpK8M4688Fch4a8Q9HLsjQp8R2VLw" )
135+
136+ var tokenAccount token.Account
137+ ai , err := p .data .GetBlockchainAccountInfo (ctx , farmerCoinVaultAccount .PublicKey ().ToBase58 (), solana .CommitmentFinalized )
138+ if err != nil {
139+ return err
140+ }
141+ tokenAccount .Unmarshal (ai .Data )
142+ farmerCoinVaultBalance := tokenAccount .Amount
143+
144+ ai , err = p .data .GetBlockchainAccountInfo (ctx , coreMintVaultAccount .PublicKey ().ToBase58 (), solana .CommitmentFinalized )
145+ if err != nil {
146+ return err
147+ }
148+ tokenAccount .Unmarshal (ai .Data )
149+ coreMintVaultBalance := tokenAccount .Amount
150+
151+ return p .data .PutCurrencyReserve (ctx , & currency.ReserveRecord {
152+ Mint : farmerCoinMintAccount .PublicKey ().ToBase58 (),
153+ SupplyFromBonding : currencycreator .DefaultMintMaxQuarkSupply - farmerCoinVaultBalance ,
154+ CoreMintLocked : coreMintVaultBalance ,
155+ Time : time .Now (),
156+ })
157+ }()
158+
131159 if err1 != nil {
132160 return err1
133161 }
134162 if err2 != nil {
135163 return err2
136164 }
165+ if err3 != nil {
166+ return err3
167+ }
137168
138169 return nil
139170}
0 commit comments