Commit 6676e7e
fix(dex): reject same-token (base==quote) pools on create and remove
addInternal used Java reference equality (!=) on freshly-deserialized
score.Address params, so the base!=quote guard was a silent no-op and
base==quote pools could be created. Switch to value equality (.equals).
Add the same guard to _remove so any pre-existing same-token pool cannot
be drained via the DictDB key-collision double-credit. Bump DEX to v1.1.9.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 10ab2f4 commit 6676e7e
2 files changed
Lines changed: 3 additions & 2 deletions
File tree
- core-contracts/Dex/src/main/java/network/balanced/score/core/dex
- score-lib/src/main/java/network/balanced/score/lib/utils
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
292 | 293 | | |
293 | 294 | | |
294 | 295 | | |
| |||
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
353 | | - | |
| 354 | + | |
354 | 355 | | |
355 | 356 | | |
356 | 357 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
0 commit comments