Closed gangov closed 8 months ago
At the end of the function provide_liquidity the code publish some events:
provide_liquidity
Events published in the provide_liquidity function. env.events() .publish(("provide_liquidity", "sender"), sender); env.events() .publish(("provide_liquidity", "token_a"), &config.token_a); env.events() .publish(("provide_liquidity", "token_a-amount"), amounts.0); env.events() .publish(("provide_liquidity", "token_a"), &config.token_b); env.events() .publish(("provide_liquidity", "token_b-amount"), amounts.1);
Events published in the provide_liquidity function.
env.events() .publish(("provide_liquidity", "sender"), sender); env.events() .publish(("provide_liquidity", "token_a"), &config.token_a); env.events() .publish(("provide_liquidity", "token_a-amount"), amounts.0); env.events() .publish(("provide_liquidity", "token_a"), &config.token_b); env.events() .publish(("provide_liquidity", "token_b-amount"), amounts.1);
The 4th event’s topic is wrong, it should be token_b instead of token_a.
token_b
token_a
Event will be published with the wrong topic
Change token_a to token_b.
At the end of the function
provide_liquidity
the code publish some events:The 4th event’s topic is wrong, it should be
token_b
instead oftoken_a
.Impact
Event will be published with the wrong topic
Recommendation
Change
token_a
totoken_b
.