Skip to content

Commit

Permalink
MintTokensForBalance
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonheaven committed Mar 10, 2021
1 parent 22a2a9f commit cd1efd4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions node/burns.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ var (

GlobalOldBurnAddress = "FA1y5ZGuHSLmf2TqNf6hVMkPiNGyQpQDTFJvDLRkKQaoPo4bmbgu"

GlobalMintAddress = "FA3j16WPCiqsAFHVZcEoL85Khh5RhPCNe6PWHBKgUxrx8MAnbNoy"

// BurnRCD is the rcd representation of the burn address
BurnRCD = [32]byte{}
)
Expand Down
20 changes: 20 additions & 0 deletions node/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,26 @@ OuterSyncLoop:
func (d *Pegnetd) MintTokensForBalance(ctx context.Context, tx *sql.Tx, height uint32) error {
fLog := log.WithFields(log.Fields{"height": height})

FAGlobalMintAddress, err := factom.NewFAAddress(GlobalMintAddress)
if err != nil {
log.WithFields(log.Fields{
"error": err,
}).Info("error getting mint address")
return err
}

for _, tokenSupply := range MintTotalSupplyMap {
_, err := d.Pegnet.AddToBalance(tx, &FAGlobalMintAddress, tokenSupply.Ticker, tokenSupply.Amount)
if err != nil {
fLog.WithFields(log.Fields{
"token": tokenSupply.Ticker,
"amount": tokenSupply.Amount,
"error": err,
}).Info("error minting token is failed")
return err
}
}

return nil
}

Expand Down

0 comments on commit cd1efd4

Please sign in to comment.