jediswaplabs / JediSwap

JediSwap
MIT License
95 stars 63 forks source link

dev: FactoryC1::create_pair calls FactoryC1::get_pair on unordered tokens #48

Open enitrat opened 3 months ago

enitrat commented 3 months ago

https://github.com/jediswaplabs/JediSwap/blob/31-upgrade-to-cairo-10/src/FactoryC1.cairo#L160

get_pair expects (token0, token1) but receives unordered (tokenA, tokenB), and thus has to make two queries to retrieve the pair in case (tokenA, tokenB) doesnt yield a result.

It's confusing to use the notation token0 / token1 when the function actually receives (tokenA, tokenB): the parameters should be renamed