Skip to content

Commit

Permalink
Merge branch 'TERITORI:main' into gno-launchpad-erc20
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelVallenet authored Sep 2, 2024
2 parents 12c00cc + eac80bf commit 9cfe469
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
12 changes: 1 addition & 11 deletions go/internal/substreams/ethereum/handlers/p2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,7 @@ func (h *Handler) handleClaim(contractABI *abi.ABI, tx *pb.Tx, args map[string]i
return errors.Wrap(err, "failed to get total claimed")
}

var amount *big.Int
if totalClaimed.Amount == "" {
amount = big.NewInt(0)
} else {
amount = new(big.Int)
if _, ok := amount.SetString(totalClaimed.Amount, 10); !ok {
return errors.New("failed to get current claimed amount")
}
}

totalClaimed.Amount = amount.Add(amount, input.Allocation).String()
totalClaimed.Amount = input.Allocation.String()

if err := h.dbTransaction.Save(&totalClaimed).Error; err != nil {
return errors.New("failed to update claimed amount")
Expand Down
26 changes: 25 additions & 1 deletion go/pkg/p2e/seasons.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,31 @@ var THE_RIOT_ETHEREUM_SEASONS = []Season{
BossName: `== $*=|'¤?")à-£_%`,
BossImage: "https://bafybeiacz7z2kqoskbtixovgzzdwiuhpfc7z4tac37qpxhjxyyljbp7v6i.ipfs.cf-ipfs.com/",
StartsAt: "2024-07-15T00:00:00",
EndsAt: "2025-01-01T00:00:00",
EndsAt: "2024-08-27T00:00:00",
IsPre: true,
},
// ------------------------------
// The R!ot EVM - Mainnet Season 1
{
ID: "ETH Season 1",
GameID: THE_RIOT_GAME_ID,
Denom: "tori",
Decimals: 6,
TotalPrize: 1_200_000,
BossName: "Alexander Aldrin",
BossImage: "https://gateway.pinata.cloud/ipfs/Qmd98tXCe7bxULC2X8wAhSN7KgJ2M5UESqRzhFT9VrBTpn",
TopN: 500,
StartsAt: "2024-08-27T00:00:00",
EndsAt: "2024-09-24T00:00:00",
},
// After PepeTest2
{
ID: "Season After ETH Season 1",
GameID: THE_RIOT_GAME_ID,
BossName: `== $*=|'¤?")à-£_%`,
BossImage: "https://bafybeiacz7z2kqoskbtixovgzzdwiuhpfc7z4tac37qpxhjxyyljbp7v6i.ipfs.cf-ipfs.com/",
StartsAt: "2024-09-24T00:00:00",
EndsAt: "2030-01-01T00:00:00",
IsPre: true,
},
}
2 changes: 1 addition & 1 deletion go/pkg/p2e/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (s *P2eService) MerkleData(ctx context.Context, req *p2epb.MerkleDataReques
NetworkID: networkID,
}

if err := s.conf.IndexerDB.First(&currentReward).Error; err != nil {
if err := s.conf.IndexerDB.Order("day_id desc").First(&currentReward).Error; err != nil {
return nil, errors.Wrap(err, "failed to get current daily reward")
}

Expand Down

0 comments on commit 9cfe469

Please sign in to comment.