fix(frontend): Create Pair fee + gas (#345) #844

Merged
PlasticDigits merged 1 commit from local1/345-create-pair-fee-gas into main 2026-06-09 07:05:59 +00:00
PlasticDigits commented 2026-06-09 06:53:08 +00:00 (Migrated from gitlab.com)

Summary

  • Attach pair_creation_fee_uluna from factory config on createPair()
  • Bump CREATE_PAIR_GAS_LIMIT to 1_000_000
  • Show required fee on Create Pair page

Test plan

  • npm test -- factory.test.ts transactions.test.ts
  • Create Pair with two whitelisted CW20s on LocalTerra
  • Tx succeeds with uluna fee attached

Docs

Closes #345 (issue left open per workflow).


Note

Medium Risk
Changes real tx payloads (native fee attachment) and gas limits for pair creation and unwrap swaps; misconfiguration could cause failed txs or under-estimated fees, but behavior is covered by unit tests and aligns with measured chain usage.

Overview
Fixes Create Pair so broadcasts match on-chain factory requirements: createPair loads factory config and attaches uluna when pair_creation_fee_uluna > 0, skips coins when zero, and Create Pair page surfaces the fee from the same config query.

Gas: CREATE_PAIR_GAS_LIMIT rises 800k → 1M (LocalTerra instantiate ~871k). Router execute_swap_operations with unwrap_output: true now adds UNWRAP_GAS_LIMIT to fee estimates (CW20→native, #343), including CW20 send paths that decode inner router msgs.

Also extends FactoryConfigResponse with pair_creation_fee_uluna, allows null on indexer trader best_trade_pnl / worst_trade_pnl, updates factory.test.ts / transactions.test.ts, and documents #343/#345 in AGENTS_TERRACLASSIC_GAS.md.

Reviewed by Cursor Bugbot for commit 1f1933956f. Bugbot is set up for automated code reviews on this repo. Configure here.

## Summary - Attach `pair_creation_fee_uluna` from factory config on `createPair()` - Bump `CREATE_PAIR_GAS_LIMIT` to 1_000_000 - Show required fee on Create Pair page ## Test plan - [ ] `npm test -- factory.test.ts transactions.test.ts` - [ ] Create Pair with two whitelisted CW20s on LocalTerra - [ ] Tx succeeds with uluna fee attached ## Docs - [skills/AGENTS_TERRACLASSIC_GAS.md](skills/AGENTS_TERRACLASSIC_GAS.md) Closes #345 (issue left open per workflow). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes real tx payloads (native fee attachment) and gas limits for pair creation and unwrap swaps; misconfiguration could cause failed txs or under-estimated fees, but behavior is covered by unit tests and aligns with measured chain usage. > > **Overview** > Fixes **Create Pair** so broadcasts match on-chain factory requirements: **`createPair`** loads factory config and attaches **`uluna`** when **`pair_creation_fee_uluna` > 0**, skips coins when zero, and **Create Pair** page surfaces the fee from the same config query. > > **Gas:** **`CREATE_PAIR_GAS_LIMIT`** rises **800k → 1M** (LocalTerra instantiate ~871k). Router **`execute_swap_operations`** with **`unwrap_output: true`** now adds **`UNWRAP_GAS_LIMIT`** to fee estimates (CW20→native, #343), including CW20 **`send`** paths that decode inner router msgs. > > Also extends **`FactoryConfigResponse`** with **`pair_creation_fee_uluna`**, allows **`null`** on indexer trader **`best_trade_pnl` / `worst_trade_pnl`**, updates **`factory.test.ts`** / **`transactions.test.ts`**, and documents #343/#345 in **`AGENTS_TERRACLASSIC_GAS.md`**. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1f1933956f3e440b8e89b0a0dd729e94a93bcb2e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
PlasticDigits commented 2026-06-09 06:53:24 +00:00 (Migrated from gitlab.com)

mentioned in merge request !845

mentioned in merge request !845
PlasticDigits commented 2026-06-09 06:53:27 +00:00 (Migrated from gitlab.com)

mentioned in merge request !846

mentioned in merge request !846
PlasticDigits commented 2026-06-09 06:53:40 +00:00 (Migrated from gitlab.com)

mentioned in issue #345

mentioned in issue #345
PlasticDigits commented 2026-06-09 06:53:41 +00:00 (Migrated from gitlab.com)

mentioned in issue #343

mentioned in issue #343
ghost1 commented 2026-06-09 06:54:10 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-09 06:54:18 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
PlasticDigits (Migrated from gitlab.com) merged commit e7fba864e5 into main 2026-06-09 07:05:59 +00:00
PlasticDigits commented 2026-06-09 07:06:00 +00:00 (Migrated from gitlab.com)

mentioned in commit e7fba864e5

mentioned in commit e7fba864e5d689bf06431bc33f051cc741b4bf6a
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!844
No description provided.