money-on-chain / main-RBTC-contract

DoC - Dollar on Chain - Stablecoin contract collateralized in RBTC.
Other
23 stars 16 forks source link

Removing an unnecessary transfer when paying commissions in MoC token #56

Closed uchami closed 3 years ago

uchami commented 3 years ago

When the commission is going to be payed in MoC token there were 3 transfers, one to MoC.sol, then one from MoC.sol to the vendor address, and lastly one from MoC.sol to the commissionAddress (MoCFlow) This has been changed to the last two only. Removing the first transaction to MoC.sol.

The difference in gas that we perceived (with eth-gas-reporter) was: Before the fix: 724172 minimum gas, 849474 maximum gas, 806720 average gas. After the fix: 708495 minimum gas, 841206 maximum gas, 799447 average gas. Between 8-16k gas reduction.

pmprete commented 3 years ago

This is now included with all the other optimizations https://github.com/money-on-chain/main-RBTC-contract/pull/57