|Author||Jackson Chan, Clinton Ennis|
Optimize the calls to issueSynths by ~35% & burnSynths by ~45%
After the removal of XDRs in SIP-33 the ability to reduce the gas heavy operation of totalIssuedSynths() from 2 to 1 call became possible saving gas on;
- Synthetix.issueSynths (& issueMaxSynths)
By reducing the calls to totalIssuedSynths() from 2 to 1 call takes out redundant processing of the systems value in both sUSD and XDR’s. totalIssuedSynth() is so heavy as it iterates though every Synth in Synthetix and makes a cross contract call for its totalSupply() to be able to calculate the total debt of the system.
KOVAN test transactions
issueSynths - https://kovan.etherscan.io/tx/0x0ea4016a010618a1942ac82e04630a9b62b1685acc137d7cd5e8f4d1664255f8 burnSynths - https://kovan.etherscan.io/tx/0xc4ec1af424681b3aa83d1ad624b6008853c7e3b7722da015ef8155871e994f6d
Copyright and related rights waived via CC0.