diff --git a/go/internal/substreams/ethereum/handlers/p2e.go b/go/internal/substreams/ethereum/handlers/p2e.go index 506ced64d1..9239db0a32 100644 --- a/go/internal/substreams/ethereum/handlers/p2e.go +++ b/go/internal/substreams/ethereum/handlers/p2e.go @@ -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") diff --git a/go/pkg/p2e/seasons.go b/go/pkg/p2e/seasons.go index 3e2ed1ec02..3edd9f76db 100644 --- a/go/pkg/p2e/seasons.go +++ b/go/pkg/p2e/seasons.go @@ -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, }, } diff --git a/go/pkg/p2e/service.go b/go/pkg/p2e/service.go index 574adabefe..8b27369d21 100644 --- a/go/pkg/p2e/service.go +++ b/go/pkg/p2e/service.go @@ -212,7 +212,7 @@ func (s *P2eService) MerkleData(ctx context.Context, req *p2epb.MerkleDataReques NetworkID: networkID, } - if err := s.conf.IndexerDB.First(¤tReward).Error; err != nil { + if err := s.conf.IndexerDB.Order("day_id desc").First(¤tReward).Error; err != nil { return nil, errors.Wrap(err, "failed to get current daily reward") }