Closed 0xneves closed 8 months ago
Hey @0xneves can I take this? Once you merge #165 I'll get onto this.
This is probably the last smart-contract-related Swaplace task before a release. I marked the iteration as past week to follow schedule, you must rush this asap @blackbeard002
Roger that. I'm on it
Refactor Request
Describe the Refactor Request
A couple of validations in the createSwap function can be removed to prioritize gas optimization.
Describe Preferred Solution
By removing the
parseData
from createSwap and leaving only theswapId
in the event emission we can slightly reduce gas consumption for the final user. Bothif
checks can be done on the front-end while the event should only rely on theswapId
which should be used by a front-end or back-end to fetch the other information about the swap, which is needed anyways.Related Code
Additional Context
This is an optimization vs legibility/usability issue. We decided to prioritize the optimization after checking the issue #104 .