artemii235 / etomic-swap

Etomic Swap Smart Contract allowing ETH and ERC20 atomic swaps on AtomicDex platform.
https://atomicdex.io/
37 stars 19 forks source link

Find a way to optimize gasUsage when deals are being initialized. #4

Closed artemii235 closed 6 years ago

artemii235 commented 6 years ago

https://github.com/ethereum/solidity/issues/2908 - Struct storage in mapping causes multiple SSTORE calls which are the most costly. This results to 140k gas usage which is over 3$ with low gas price = 20 gwei (~1200$ per ETH currently). The idea is to pack everything to bytes array manually and then parse when needed.