Skip to content

fix trip value change calc for boosted trips + add typecheck on PR#261

Merged
manegame merged 9 commits into
Moving-Castles:mainfrom
parkan:main
Jan 22, 2026
Merged

fix trip value change calc for boosted trips + add typecheck on PR#261
manegame merged 9 commits into
Moving-Castles:mainfrom
parkan:main

Conversation

@parkan

@parkan parkan commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

the trip lab UI uses incorrect chamber value basis if the trip was boosted before any rats have gone in:

image

in this case both trips drained the pool but the first one shows a positive pool contribution because the basis is chamber creation value, not its actual value at that time

this fixes the logic to coalesce to oldTripValue (accounts for boosts) first before creation cost, which corrects the display error

still coalesces to creation cost in any cases where oldTripvalue is not defined so should be safe to apply, also we use nullish instead of truthy check in case there's a corner case where the chamber was at 0 due to race condition or hypothetical spooky actions (probably overly defensive as this should never happen but good practice)

@parkan parkan force-pushed the main branch 7 times, most recently from f795984 to 2556fbd Compare January 17, 2026 10:58
@parkan

parkan commented Jan 17, 2026

Copy link
Copy Markdown
Contributor Author

ok I also took the liberty of adding a typescheck to PR workflow since otherwise you don't see typescript errors until merging/testing locally, it's catching some issues, adding a commit to work around those but you should probably fix it

@parkan

parkan commented Jan 17, 2026

Copy link
Copy Markdown
Contributor Author

ok build is green now, subsequent runs should be much faster since pnpm cache will be used after first green

you need to delete the claim-frontend and auction-frontend sub-packages or clean them up in some way, up to you (e.g. replace with static pages that say "SORRY IT'S OVER")

for example:

  <!-- +page.svelte -->
  <div class="ended">
    <h1>Airdrop Claim Period Ended</h1>
    <p>SORRY IT'S OVER</p>
    <a href="/">Return to rat.fun</a>
  </div>

and delete the merkle tree package etc

you should also use solc that is less than 2 years old and listen to the warnings, most of these are auto-fixable, your build will break once 0.9.0 is out and you're not seeing the deprecation warnings because your solc is too old

@parkan parkan changed the title fix trip value change calc for boosted trips fix trip value change calc for boosted trips + add typecheck on PR Jan 17, 2026
@parkan

parkan commented Jan 17, 2026

Copy link
Copy Markdown
Contributor Author

ok did more cleanup, you can put static routes on the claims if you'd like, removed unused sub-packages and exclude filters so the typecheck config is clean

PR review is fast now with cache

@manegame manegame merged commit 739c622 into Moving-Castles:main Jan 22, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants