Commit f31598a
committed
PLT-676: replace fuzzy target resolution with curated-fungible-id + address
Symbol-based searchFungibles matching surfaced two failure modes during the
polygon dry-run: case-sensitivity smell on `USDC.E` vs `USDC.e`, and broad
ambiguity from symbol collisions. The new resolver in
cli/utils/trading/consolidate-targets.js accepts only:
1. a curated symbol — looked up in a flat SYMBOL→fungibleId map, with
the per-chain impl address fetched live from getFungible. Whatever
Zerion lists as USDC's impl on a given chain (bridged USDC.e on
some, Circle-native on others) is what the address-based target
exclusion catches.
2. a raw contract address — for any token outside the curated set, or
to override Zerion's choice.
Anything else throws target_token_not_found and names the curated list.1 parent 9593d44 commit f31598a
4 files changed
Lines changed: 604 additions & 32 deletions
File tree
- cli
- commands/trading
- tests/unit/cli/utils/trading
- utils/trading
- skills/zerion-consolidate
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
144 | 143 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
152 | 150 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
165 | 154 | | |
166 | 155 | | |
167 | 156 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
173 | 160 | | |
174 | 161 | | |
175 | 162 | | |
| |||
0 commit comments