Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

add/change solc compiler options | natspec #59

Merged
merged 31 commits into from
Feb 14, 2021
Merged

add/change solc compiler options | natspec #59

merged 31 commits into from
Feb 14, 2021

Conversation

pinkiebell
Copy link
Contributor

@pinkiebell pinkiebell commented Feb 9, 2021

add/change solc compiler options

This explicitly sets optimizer options and removes optional metadata from contract code.
This PR also fixes the non-working yarn test:gas, it always showed an empty table before this change.

Here is the delta (---old, +++new)

     1---·---------------------------------------------------------|---------------------------|-------------|----------------------------·
     1+++·---------------------------------------------------------|---------------------------|-------------|-----------------------------·
     2---|                  Solc version: 0.6.12                   ·  Optimizer enabled: true  ·  Runs: 100  ·  Block limit: 9500000 gas  │
     2+++|                  Solc version: 0.6.12                   ·  Optimizer enabled: true  ·  Runs: 256  ·  Block limit: 10000000 gas  │
     3---··························································|···························|·············|·····························
     3+++··························································|···························|·············|······························
     4---|  Methods                                                                                                                       │
     4+++|  Methods                                                                                                                        │
     5---··························|·······························|·············|·············|·············|··············|··············
     5+++··························|·······························|·············|·············|·············|···············|··············
     6---|  Contract               ·  Method                       ·  Min        ·  Max        ·  Avg        ·  # calls     ·  usd (avg)  │
     6+++|  Contract               ·  Method                       ·  Min        ·  Max        ·  Avg        ·  # calls      ·  usd (avg)  │
     7---··························|·······························|·············|·············|·············|··············|··············
     7+++··························|·······························|·············|·············|·············|···············|··············
     8---|  BaseBoringBatchable    ·  batch                        ·      22678  ·      79954  ·      68499  ·           5  ·          -  │
     8+++|  BaseBoringBatchable    ·  batch                        ·      22701  ·      79934  ·      68487  ·            5  ·          -  │
     9---··························|·······························|·············|·············|·············|··············|··············
     9+++··························|·······························|·············|·············|·············|···············|··············
    10---|  BentoBox               ·  batchFlashLoan               ·          -  ·          -  ·      71790  ·           1  ·          -  │
    10+++|  BentoBox               ·  batchFlashLoan               ·          -  ·          -  ·      71715  ·            1  ·          -  │
    11---··························|·······························|·············|·············|·············|··············|··············
    11+++··························|·······························|·············|·············|·············|···············|··············
    12---|  BentoBox               ·  deposit                      ·      25000  ·     112646  ·     106756  ·         766  ·          -  │
    12+++|  BentoBox               ·  deposit                      ·      25023  ·     112669  ·     106846  ·          772  ·          -  │
    13---··························|·······························|·············|·············|·············|··············|··············
    13+++··························|·······························|·············|·············|·············|···············|··············
    14---|  BentoBox               ·  flashLoan                    ·      67337  ·      67349  ·      67343  ·           2  ·          -  │
    14+++|  BentoBox               ·  flashLoan                    ·      67261  ·      67273  ·      67267  ·            2  ·          -  │
    15---··························|·······························|·············|·············|·············|··············|··············
    15+++··························|·······························|·············|·············|·············|···············|··············
    16---|  BentoBox               ·  harvest                      ·      37215  ·     151815  ·      80733  ·          71  ·          -  │
    16+++|  BentoBox               ·  harvest                      ·      37149  ·     151115  ·      80600  ·           71  ·          -  │
    17---··························|·······························|·············|·············|·············|··············|··············
    17+++··························|·······························|·············|·············|·············|···············|··············
    18---|  BentoBox               ·  setMasterContractApproval    ·      47971  ·      73113  ·      72898  ·         124  ·          -  │
    18+++|  BentoBox               ·  setMasterContractApproval    ·      47905  ·      73047  ·      72836  ·          126  ·          -  │
    19---··························|·······························|·············|·············|·············|··············|··············
    19+++··························|·······························|·············|·············|·············|···············|··············
    20---|  BentoBox               ·  setStrategy                  ·      30846  ·      83903  ·      50396  ·         118  ·          -  │
    20+++|  BentoBox               ·  setStrategy                  ·      30780  ·      83453  ·      50322  ·          118  ·          -  │
    21---··························|·······························|·············|·············|·············|··············|··············
    21+++··························|·······························|·············|·············|·············|···············|··············
    22---|  BentoBox               ·  setStrategyTargetPercentage  ·      30283  ·      45295  ·      45017  ·          54  ·          -  │
    22+++|  BentoBox               ·  setStrategyTargetPercentage  ·      30306  ·      45318  ·      45040  ·           54  ·          -  │
    23---··························|·······························|·············|·············|·············|··············|··············
    23+++··························|·······························|·············|·············|·············|···············|··············
    24---|  BentoBox               ·  transfer                     ·      37652  ·      52724  ·      50908  ·          17  ·          -  │
    24+++|  BentoBox               ·  transfer                     ·      37586  ·      52658  ·      50842  ·           17  ·          -  │
    25---··························|·······························|·············|·············|·············|··············|··············
    25+++··························|·······························|·············|·············|·············|···············|··············
    26---|  BentoBox               ·  transferMultiple             ·          -  ·          -  ·      79093  ·           1  ·          -  │
    26+++|  BentoBox               ·  transferMultiple             ·          -  ·          -  ·      79116  ·            1  ·          -  │
    27---··························|·······························|·············|·············|·············|··············|··············
    27+++··························|·······························|·············|·············|·············|···············|··············
    28---|  BentoBox               ·  whitelistMasterContract      ·          -  ·          -  ·      45407  ·           1  ·          -  │
    28+++|  BentoBox               ·  whitelistMasterContract      ·          -  ·          -  ·      45341  ·            1  ·          -  │
    29---··························|·······························|·············|·············|·············|··············|··············
    29+++··························|·······························|·············|·············|·············|···············|··············
    30---|  BentoBox               ·  withdraw                     ·      42816  ·      65411  ·      52746  ·          10  ·          -  │
    30+++|  BentoBox               ·  withdraw                     ·      42750  ·      65345  ·      52667  ·           10  ·          -  │
    31---··························|·······························|·············|·············|·············|··············|··············
    31+++··························|·······························|·············|·············|·············|···············|··············
    32---|  BoringFactory          ·  deploy                       ·      90007  ·     289688  ·     282744  ·         130  ·          -  │
    32+++|  BoringFactory          ·  deploy                       ·      89963  ·     290381  ·     283496  ·          132  ·          -  │
    33---··························|·······························|·············|·············|·············|··············|··············
    33+++··························|·······························|·············|·············|·············|···············|··············
    34---|  BoringOwnable          ·  claimOwnership               ·          -  ·          -  ·      21086  ·           4  ·          -  │
    34+++|  BoringOwnable          ·  claimOwnership               ·          -  ·          -  ·      21086  ·            4  ·          -  │
    35---··························|·······························|·············|·············|·············|··············|··············
    35+++··························|·······························|·············|·············|·············|···············|··············
    36---|  BoringOwnable          ·  transferOwnership            ·      17471  ·      43633  ·      33908  ·          11  ·          -  │
    36+++|  BoringOwnable          ·  transferOwnership            ·      17471  ·      43633  ·      33908  ·           11  ·          -  │
    37---··························|·······························|·············|·············|·············|··············|··············
    37+++··························|·······························|·············|·············|·············|···············|··············
    38---|  CompositeOracle        ·  get                          ·      71777  ·     127173  ·      90242  ·           6  ·          -  │
    38+++|  CompositeOracle        ·  get                          ·      71511  ·     126953  ·      89992  ·            6  ·          -  │
    39---··························|·······························|·············|·············|·············|··············|··············
    39+++··························|·······························|·············|·············|·············|···············|··············
    40---|  ERC20                  ·  approve                      ·      14424  ·      44232  ·      43838  ·         416  ·          -  │
    40+++|  ERC20                  ·  approve                      ·      14419  ·      44222  ·      43849  ·          418  ·          -  │
    41---··························|·······························|·············|·············|·············|··············|··············
    41+++··························|·······························|·············|·············|·············|···············|··············
    42---|  ERC20                  ·  permit                       ·          -  ·          -  ·      71704  ·           3  ·          -  │
    42+++|  ERC20                  ·  permit                       ·      71593  ·      71605  ·      71597  ·            3  ·          -  │
    43---··························|·······························|·············|·············|·············|··············|··············
    43+++··························|·······························|·············|·············|·············|···············|··············
    44---|  ERC20                  ·  transfer                     ·      29016  ·      52481  ·      52234  ·        1151  ·          -  │
    44+++|  ERC20                  ·  transfer                     ·      28950  ·      52449  ·      52197  ·         1159  ·          -  │
    45---··························|·······························|·············|·············|·············|··············|··············
    45+++··························|·······························|·············|·············|·············|···············|··············
    46---|  ERC20                  ·  transferFrom                 ·      46737  ·      61737  ·      58067  ·           6  ·          -  │
    46+++|  ERC20                  ·  transferFrom                 ·      46727  ·      61727  ·      58063  ·            6  ·          -  │
    47---··························|·······························|·············|·············|·············|··············|··············
    47+++··························|·······························|·············|·············|·············|···············|··············
    48---|  HelloWorld             ·  deposit                      ·          -  ·          -  ·     136928  ·           1  ·          -  │
    48+++|  HelloWorld             ·  deposit                      ·          -  ·          -  ·     136951  ·            1  ·          -  │
    49---··························|·······························|·············|·············|·············|··············|··············
    49+++··························|·······························|·············|·············|·············|···············|··············
    50---|  HelloWorld             ·  withdraw                     ·          -  ·          -  ·      30366  ·           1  ·          -  │
    50+++|  HelloWorld             ·  withdraw                     ·          -  ·          -  ·      30333  ·            1  ·          -  │
    51---··························|·······························|·············|·············|·············|··············|··············
    51+++··························|·······························|·············|·············|·············|···············|··············
    52---|  LendingPair            ·  accrue                       ·      33300  ·      46563  ·      45565  ·          36  ·          -  │
    52+++|  LendingPair            ·  accrue                       ·      32218  ·      46396  ·      45373  ·           36  ·          -  │
    53---··························|·······························|·············|·············|·············|··············|··············
    53+++··························|·······························|·············|·············|·············|···············|··············
    54---|  LendingPair            ·  addAsset                     ·          -  ·          -  ·      88083  ·           1  ·          -  │
    54+++|  LendingPair            ·  addAsset                     ·          -  ·          -  ·      87035  ·            1  ·          -  │
    55---··························|·······························|·············|·············|·············|··············|··············
    55+++··························|·······························|·············|·············|·············|···············|··············
    56---|  LendingPair            ·  addCollateral                ·          -  ·          -  ·      86678  ·           1  ·          -  │
    56+++|  LendingPair            ·  addCollateral                ·          -  ·          -  ·      86589  ·            1  ·          -  │
    57---··························|·······························|·············|·············|·············|··············|··············
    57+++··························|·······························|·············|·············|·············|···············|··············
    58---|  LendingPair            ·  borrow                       ·     125900  ·     140928  ·     140019  ·          17  ·          -  │
    58+++|  LendingPair            ·  borrow                       ·     125723  ·     140751  ·     139842  ·           17  ·          -  │
    59---··························|·······························|·············|·············|·············|··············|··············
    59+++··························|·······························|·············|·············|·············|···············|··············
    60---|  LendingPair            ·  cook                         ·      36124  ·     330308  ·     154201  ·         193  ·          -  │
    60+++|  LendingPair            ·  cook                         ·      35075  ·     329793  ·     153637  ·          193  ·          -  │
    61---··························|·······························|·············|·············|·············|··············|··············
    61+++··························|·······························|·············|·············|·············|···············|··············
    62---|  LendingPair            ·  liquidate                    ·     144097  ·     283903  ·     253810  ·           5  ·          -  │
    62+++|  LendingPair            ·  liquidate                    ·     152715  ·     292163  ·     262194  ·            5  ·          -  │
    63---··························|·······························|·············|·············|·············|··············|··············
    63+++··························|·······························|·············|·············|·············|···············|··············
    64---|  LendingPair            ·  removeAsset                  ·          -  ·          -  ·      86570  ·           1  ·          -  │
    64+++|  LendingPair            ·  removeAsset                  ·          -  ·          -  ·      86404  ·            1  ·          -  │
    65---··························|·······························|·············|·············|·············|··············|··············
    65+++··························|·······························|·············|·············|·············|···············|··············
    66---|  LendingPair            ·  removeCollateral             ·          -  ·          -  ·      79697  ·           1  ·          -  │
    66+++|  LendingPair            ·  removeCollateral             ·          -  ·          -  ·      78608  ·            1  ·          -  │
    67---··························|·······························|·············|·············|·············|··············|··············
    67+++··························|·······························|·············|·············|·············|···············|··············
    68---|  LendingPair            ·  repay                        ·          -  ·          -  ·      91232  ·           1  ·          -  │
    68+++|  LendingPair            ·  repay                        ·          -  ·          -  ·      91065  ·            1  ·          -  │
    69---··························|·······························|·············|·············|·············|··············|··············
    69+++··························|·······························|·············|·············|·············|···············|··············
    70---|  LendingPair            ·  setSwapper                   ·          -  ·          -  ·      43863  ·           1  ·          -  │
    70+++|  LendingPair            ·  setSwapper                   ·          -  ·          -  ·      43863  ·            1  ·          -  │
    71---··························|·······························|·············|·············|·············|··············|··············
    71+++··························|·······························|·············|·············|·············|···············|··············
    72---|  LendingPair            ·  updateExchangeRate           ·      31733  ·      35933  ·      32606  ·          77  ·          -  │
    72+++|  LendingPair            ·  updateExchangeRate           ·      32533  ·      36733  ·      33395  ·           78  ·          -  │
    73---··························|·······························|·············|·············|·············|··············|··············
    73+++··························|·······························|·············|·············|·············|···············|··············
    74---|  LendingPair            ·  withdrawFees                 ·      47674  ·      59352  ·      53185  ·           5  ·          -  │
    74+++|  LendingPair            ·  withdrawFees                 ·      47574  ·      59252  ·      53085  ·            5  ·          -  │
    75---··························|·······························|·············|·············|·············|··············|··············
    75+++··························|·······························|·············|·············|·············|···············|··············
    76---|  MasterContractManager  ·  setMasterContractApproval    ·      17523  ·      72669  ·      46564  ·           5  ·          -  │
    76+++|  MasterContractManager  ·  setMasterContractApproval    ·      17523  ·      72669  ·      46564  ·            5  ·          -  │
    77---··························|·······························|·············|·············|·············|··············|··············
    77+++··························|·······························|·············|·············|·············|···············|··············
    78---|  MasterContractManager  ·  whitelistMasterContract      ·          -  ·          -  ·      45138  ·           4  ·          -  │
    78+++|  MasterContractManager  ·  whitelistMasterContract      ·          -  ·          -  ·      45138  ·            4  ·          -  │
    79---··························|·······························|·············|·············|·············|··············|··············
    79+++··························|·······························|·············|·············|·············|···············|··············
    80---|  SimpleSLPTWAP0Oracle   ·  get                          ·      25353  ·      70971  ·      43501  ·           7  ·          -  │
    80+++|  SimpleSLPTWAP0Oracle   ·  get                          ·      25269  ·      70849  ·      43390  ·            7  ·          -  │
    81---··························|·······························|·············|·············|·············|··············|··············
    81+++··························|·······························|·············|·············|·············|···············|··············
    82---|  SimpleSLPTWAP1Oracle   ·  get                          ·      25353  ·      70993  ·      46213  ·          10  ·          -  │
    82+++|  SimpleSLPTWAP1Oracle   ·  get                          ·      25269  ·      70871  ·      46096  ·           10  ·          -  │
    83---··························|·······························|·············|·············|·············|··············|··············
    83+++··························|·······························|·············|·············|·············|···············|··············
    84---|  SushiStrategy          ·  transferOwnership            ·          -  ·          -  ·      32682  ·           2  ·          -  │
    84+++|  SushiStrategy          ·  transferOwnership            ·          -  ·          -  ·      32705  ·            2  ·          -  │
    85---··························|·······························|·············|·············|·············|··············|··············
    85+++··························|·······························|·············|·············|·············|···············|··············
    86---|  SushiStrategy          ·  withdraw                     ·          -  ·          -  ·      65414  ·           1  ·          -  │
    86+++|  SushiStrategy          ·  withdraw                     ·          -  ·          -  ·      65009  ·            1  ·          -  │
    87---··························|·······························|·············|·············|·············|··············|··············
    87+++··························|·······························|·············|·············|·············|···············|··············
    88---|  SushiSwapSwapper       ·  swap                         ·     214972  ·     215140  ·     215071  ·          28  ·          -  │
    88+++|  SushiSwapSwapper       ·  swap                         ·     214767  ·     214892  ·     214845  ·           28  ·          -  │
    89---··························|·······························|·············|·············|·············|··············|··············
    89+++··························|·······························|·············|·············|·············|···············|··············
    90---|  SushiSwapSwapper       ·  swapExact                    ·     219659  ·     248373  ·     234973  ·          30  ·          -  │
    90+++|  SushiSwapSwapper       ·  swapExact                    ·     219388  ·     247993  ·     234646  ·           30  ·          -  │
    91---··························|·······························|·············|·············|·············|··············|··············
    91+++··························|·······························|·············|·············|·············|···············|··············
    92---|  UniswapV2Factory       ·  createPair                   ·    2036633  ·    2051655  ·    2050667  ·         184  ·          -  │
    92+++|  UniswapV2Factory       ·  createPair                   ·    2050025  ·    2065047  ·    2064069  ·          186  ·          -  │
    93---··························|·······························|·············|·············|·············|··············|··············
    93+++··························|·······························|·············|·············|·············|···············|··············
    94---|  UniswapV2Factory       ·  setFeeTo                     ·          -  ·          -  ·      29708  ·           3  ·          -  │
    94+++|  UniswapV2Factory       ·  setFeeTo                     ·          -  ·          -  ·      29664  ·            3  ·          -  │
    95---··························|·······························|·············|·············|·············|··············|··············
    95+++··························|·······························|·············|·············|·············|···············|··············
    96---|  UniswapV2Pair          ·  mint                         ·     141816  ·     142709  ·     142335  ·          92  ·          -  │
    96+++|  UniswapV2Pair          ·  mint                         ·     141683  ·     142642  ·     142208  ·           93  ·          -  │
    97---··························|·······························|·············|·············|·············|··············|··············
    97+++··························|·······························|·············|·············|·············|···············|··············
    98---|  UniswapV2Pair          ·  sync                         ·      82290  ·      82378  ·      82349  ·           3  ·          -  │
    98+++|  UniswapV2Pair          ·  sync                         ·      82222  ·      82244  ·      82237  ·            3  ·          -  │
    99---··························|·······························|·············|·············|·············|··············|··············
    99+++··························|·······························|·············|·············|·············|···············|··············
   100---|  Deployments                                            ·                                         ·  % of limit  ·             │
   100+++|  Deployments                                            ·                                         ·  % of limit   ·             │
   101---··························································|·············|·············|·············|··············|··············
   101+++··························································|·············|·············|·············|···············|··············
   102---|  BoringOwnable                                          ·          -  ·          -  ·     248426  ·       2.6 %  ·          -  │
   102+++|  BoringOwnable                                          ·          -  ·          -  ·     239564  ·        2.4 %  ·          -  │
   103---··························································|·············|·············|·············|··············|··············
   103+++··························································|·············|·············|·············|···············|··············
   104---|  ChainlinkOracle                                        ·          -  ·          -  ·     355090  ·       3.7 %  ·          -  │
   104+++|  ChainlinkOracle                                        ·          -  ·          -  ·     348244  ·        3.5 %  ·          -  │
   105---··························································|·············|·············|·············|··············|··············
   105+++··························································|·············|·············|·············|···············|··············
   106---|  CompositeOracle                                        ·          -  ·          -  ·    1182551  ·      12.4 %  ·          -  │
   106+++|  CompositeOracle                                        ·          -  ·          -  ·    1174672  ·       11.7 %  ·          -  │
   107---··························································|·············|·············|·············|··············|··············
   107+++··························································|·············|·············|·············|···············|··············
   108---|  CompoundOracle                                         ·          -  ·          -  ·     802464  ·       8.4 %  ·          -  │
   108+++|  CompoundOracle                                         ·          -  ·          -  ·     796109  ·          8 %  ·          -  │
   109---··························································|·············|·············|·············|··············|··············
   109+++··························································|·············|·············|·············|···············|··············
   110---|  HelloWorld                                             ·          -  ·          -  ·     305568  ·       3.2 %  ·          -  │
   110+++|  HelloWorld                                             ·          -  ·          -  ·     296640  ·          3 %  ·          -  │
   111---··························································|·············|·············|·············|··············|··············
   111+++··························································|·············|·············|·············|···············|··············
   112---|  MasterContractManager                                  ·          -  ·          -  ·     935785  ·       9.9 %  ·          -  │
   112+++|  MasterContractManager                                  ·          -  ·          -  ·     927696  ·        9.3 %  ·          -  │
   113---··························································|·············|·············|·············|··············|··············
   113+++··························································|·············|·············|·············|···············|··············
   114---|  PeggedOracle                                           ·          -  ·          -  ·     221942  ·       2.3 %  ·          -  │
   114+++|  PeggedOracle                                           ·          -  ·          -  ·     214088  ·        2.1 %  ·          -  │
   115---··························································|·············|·············|·············|··············|··············
   115+++··························································|·············|·············|·············|···············|··············
   116---|  SimpleSLPTWAP0Oracle                                   ·          -  ·          -  ·     727669  ·       7.7 %  ·          -  │
   116+++|  SimpleSLPTWAP0Oracle                                   ·          -  ·          -  ·     725893  ·        7.3 %  ·          -  │
   117---··························································|·············|·············|·············|··············|··············
   117+++··························································|·············|·············|·············|···············|··············
   118---|  SimpleSLPTWAP1Oracle                                   ·          -  ·          -  ·     727669  ·       7.7 %  ·          -  │
   118+++|  SimpleSLPTWAP1Oracle                                   ·          -  ·          -  ·     725893  ·        7.3 %  ·          -  │
   119---··························································|·············|·············|·············|··············|··············
   119+++··························································|·············|·············|·············|···············|··············
   120---|  SushiStrategy                                          ·          -  ·          -  ·    1012731  ·      10.7 %  ·          -  │
   120+++|  SushiStrategy                                          ·          -  ·          -  ·    1016991  ·       10.2 %  ·          -  │
   121---··························································|·············|·············|·············|··············|··············
   121+++··························································|·············|·············|·············|···············|··············
   122---|  SushiSwapSwapper                                       ·          -  ·          -  ·     930146  ·       9.8 %  ·          -  │
   122+++|  SushiSwapSwapper                                       ·          -  ·          -  ·     923252  ·        9.2 %  ·          -  │
   123---··························································|·············|·············|·············|··············|··············
   123+++··························································|·············|·············|·············|···············|··············
   124---|  UniswapV2Factory                                       ·          -  ·          -  ·    2487967  ·      26.2 %  ·          -  │
   124+++|  UniswapV2Factory                                       ·          -  ·          -  ·    2496014  ·         25 %  ·          -  │
   125---·---------------------------------------------------------|-------------|-------------|-------------|--------------|-------------·
   125+++·---------------------------------------------------------|-------------|-------------|-------------|---------------|-------------·

@pinkiebell pinkiebell changed the title add/change solc compiler options add/change solc compiler options | natspec Feb 10, 2021
@pinkiebell
Copy link
Contributor Author

3 failed tests are the oracle tests w/o forking. Everything else succeeds.

Copy link
Contributor

@boringcrypto boringcrypto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, little issue with the updateExchangeRate, I'll fix

@boringcrypto boringcrypto merged commit 1e30956 into sushiswap:master Feb 14, 2021
@pinkiebell pinkiebell deleted the pinkie/solc-gas branch February 14, 2021 14:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants