logo
bg_imgbg_imgbg_imgbg_img
exclamation mark iconReport an issue

If you notice some outdated information please let us know!

close icon
Name
Email
Your message
arrow-left

StellaSwap

24%

Process Quality Review (0.8)

StellaSwap

Final score:24%
Date:15 Jun 2022
Audit Process:version 0.8
Author:Ryoma
PQR Score:24%

FAIL

Protocol Website:https://stellaswap.com/

Scoring Appendix

The final review score is indicated as a percentage. The percentage is calculated as Achieved Points due to MAX Possible Points. For each element the answer can be either Yes/No or a percentage. For a detailed breakdown of the individual weights of each question, please consult this document.

The blockchain used by this protocol
Parachain
#QuestionAnswer
44%
1.50%
2.100%
3.Yes
4.0%
5.0
14%
6.Yes
7.No
8.0%
9.0%
10%
10.0%
11.0%
12.No
13.0%
14.No
15.Yes
43%
16.50%
17.0%
17%
18.0%
19.0%
20.50%
21.0%
22.0%
23.0%
24.60%
25.75%
0%
26.0
27.No
28.No
Total:24%

Very simply, the audit looks for the following declarations from the developer's site. With these declarations, it is reasonable to trust the smart contracts.

  • Here is my smart contract on the blockchain
  • You can see it matches a software repository used to develop the code
  • Here is the documentation that explains what my smart contract does
  • Here are the tests I ran to verify my smart contract
  • Here are the audit(s) performed to review my code by third party experts

This report is for informational purposes only and does not constitute investment advice of any kind, nor does it constitute an offer to provide investment advisory or other services. Nothing in this report shall be considered a solicitation or offer to buy or sell any security, token, future, option or other financial instrument or to offer or provide any investment advice or service to any person in any jurisdiction. Nothing contained in this report constitutes investment advice or offers any opinion with respect to the suitability of any security, and the views expressed in this report should not be taken as advice to buy, sell or hold any security. The information in this report should not be relied upon for the purpose of investing. In preparing the information contained in this report, we have not taken into account the investment needs, objectives and financial circumstances of any particular investor. This information has no regard to the specific investment objectives, financial situation and particular needs of any specific recipient of this information and investments discussed may not be suitable for all investors.

Any views expressed in this report by us were prepared based upon the information available to us at the time such views were written. The views expressed within this report are limited to DeFiSafety and the author and do not reflect those of any additional or third party and are strictly based upon DeFiSafety, its authors, interpretations and evaluation of relevant data. Changed or additional information could cause such views to change. All information is subject to possible correction. Information may quickly become unreliable for various reasons, including changes in market conditions or economic circumstances.

This completed report is copyright (c) DeFiSafety 2023. Permission is given to copy in whole, retaining this copyright label.

Smart Contracts & Team

44%

This section looks at the code deployed on the relevant chain that gets reviewed and its corresponding software repository. The document explaining these questions is here.

1. Are the smart contract addresses easy to find? (%)

Answer: 50%

Three of StellaSwap's smart contract addresses can be found in its documentation. Other smart contract addresses can be found in the forked repos of OpenZeppelin and Uniswap within code. Because this takes a bit of looking and there isn't a clear set of smart contract addresses found in one place, the protocol received a 50. A screenshot of the smart contract addresses can be found in the appendix.

Percentage Score Guidance:
100%
Clearly labelled and on website, documents or repository, quick to find
70%
Clearly labelled and on website, docs or repo but takes a bit of looking
40%
Addresses in mainnet.json, in discord or sub graph, etc
20%
Address found but labeling not clear or easy to find
0%
Executing addresses could not be found

2. How active is the primary contract? (%)

Answer: 100%

The protocol's Router Smart Contract is active for well above 10 transactions a day. For that reason, the protocol earns a 100% score on this one. A screenshot of the Moonscan transaction list is available in the appendix.

Percentage Score Guidance:
100%
More than 10 transactions a day
70%
More than 10 transactions a week
40%
More than 10 transactions a month
10%
Less than 10 transactions a month
0%
No activity

3. Does the protocol have a public software repository? (Y/N)

Answer: Yes

You can find the protocol's public software repository here.

Score Guidance:
Yes
There is a public software repository with the code at a minimum, but also normally test and scripts. Even if the repository was created just to hold the files and has just 1 transaction.
No
For teams with private repositories.

4. Is there a development history visible? (%)

Answer: 0%

StellaSwap's contract repository has just 6 commits.

Percentage Score Guidance:
100%
Any one of 100+ commits, 10+branches
70%
Any one of 70+ commits, 7+branches
50%
Any one of 50+ commits, 5+branches
30%
Any one of 30+ commits, 3+branches
0%
Less than 2 branches or less than 30 commits

5. Is the team public (not anonymous)?

Answer: 0

While the StellaSwap team mentions itself being KYC-ed by Moonbeam's leadership team, as none of the members are public and found to be working on the protocol, the protocol cannot earn points for this one.

Score Guidance:
100%
At least two names can be easily found in the protocol's website, documentation or medium. These are then confirmed by the personal websites of the individuals / their linkedin / twitter.
50%
At least one public name can be found to be working on the protocol.
0%
No public team members could be found.

Documentation

14%

This section looks at the software documentation. The document explaining these questions is here.

6. Is there a whitepaper? (Y/N)

Answer: Yes

7. Is the protocol's software architecture documented? (Y/N)

Answer: No

The protocol's software architecture is not documented; there are no mentions of how smart contracts interact, nor how the architecture is built. Only written descriptions of strapiucts are available, which do not count as software architecture documentation.    The CertiK audit covers some of the architecture through diagrams and arrows.

Score Guidance:
Yes
The documents identify software architecture and contract interaction through any of the following: diagrams, arrows, specific reference to software functions or a written explanation on how smart contracts interact.
No
Protocols receive a "no" if none of these are included.

8. Does the software documentation fully cover the deployed contracts' source code? (%)

Answer: 0%

There are no smart contract documentation from the software aspect of things.

Percentage Score Guidance:
100%
All contracts and functions documented
80%
Only the major functions documented
79 - 1%
Estimate of the level of software documentation
0%
No software documentation

9. Is it possible to trace the documented software to its implementation in the protocol's source code? (%)

Answer: 0%

There are no software documentation available for StellaSwap.

Percentage Score Guidance:
100%
Clear explicit traceability between code and documentation at a requirement level for all code
60%
Clear association between code and documents via non explicit traceability
40%
Documentation lists all the functions and describes their functions
0%
No connection between documentation and code

Testing

10%

10. Has the protocol tested their deployed code? (%)

Answer: 0%

There are no evidence of testing in the StellaSwap contract repository.      

Percentage Score Guidance:
100%
TtC > 120% Both unit and system test visible
80%
TtC > 80% Both unit and system test visible
40%
TtC < 80% Some tests visible
0%
No tests obvious

11. How covered is the protocol's code? (%)

Answer: 0%

There are no documented code coverage in the protocol nor the audits.

Percentage Score Guidance:
100%
Documented full coverage
99 - 51%
Value of test coverage from documented results
50%
No indication of code coverage but clearly there is a complete set of tests
30%
Some tests evident but not complete
0%
No test for coverage seen

12. Does the protocol provide scripts and instructions to run their tests? (Y/N)

Answer: No

There are no scripts or instructions available to run tests for StellaSwap.

Score Guidance:
Yes
Scripts and/or instructions to run tests are available in the testing suite
No
Scripts and/or instructions to run tests are not available in the testing suite

13. Is there a detailed report of the protocol's test results?(%)

Answer: 0%

There are no detailed reports on the protocol's test results.

Percentage Score Guidance:
100%
Detailed test report as described below
70%
GitHub code coverage report visible
0%
No test report evident

14. Has the protocol undergone Formal Verification? (Y/N)

Answer: No

StellaSwap has not undergone formal verification.

Score Guidance:
Yes
Formal Verification was performed and the report is readily available
No
Formal Verification was not performed and/or the report is not readily available.

15. Were the smart contracts deployed to a testnet? (Y/N)

Answer: Yes

While there are smart contract addresses attached to StellaSwap within the Moonbase testnet explorer, the protocol does not provide testnet addresses in their documentation. Nonetheless, since we found evidence of this deployment, we'll award points here.

Score Guidance:
Yes
Protocol has proved their tesnet usage by providing the addresses
No
Protocol has not proved their testnet usage by providing the addresses

Security

43%

This section looks at the 3rd party software audits done. It is explained in this document.

16. Is the protocol sufficiently audited? (%)

Answer: 50%

StellaSwap has gone through 2 audits post-launch and changes are needed but there are no visible documentation on changes made as a result of the audits. 4 major vulnerabilities were identified by CertiK that were not fixed, though 2 were mitigated. Score: 50%

Percentage Score Guidance:
100%
Multiple Audits performed before deployment and the audit findings are public and implemented or not required
90%
Single audit performed before deployment and audit findings are public and implemented or not required
70%
Audit(s) performed after deployment and no changes required. The Audit report is public.
65%
Code is forked from an already audited protocol and a changelog is provided explaining why forked code was used and what changes were made. This changelog must justify why the changes made do not affect the audit.
50%
Audit(s) performed after deployment and changes are needed but not implemented.
30%
Audit(s) performed are low-quality and do not indicate proper due diligence.
20%
No audit performed
0%
Audit Performed after deployment, existence is public, report is not public OR smart contract address' not found.
Deduct 25% if the audited code is not available for comparison.

17. Is the bounty value acceptably high (%)

Answer: 0%

There are no bug bounties available for StellaSwap.

Percentage Score Guidance:
100%
Bounty is 10% TVL or at least $1M AND active program (see below)
90%
Bounty is 5% TVL or at least 500k AND active program
80%
Bounty is 5% TVL or at least 500k
70%
Bounty is 100k or over AND active program
60%
Bounty is 100k or over
50%
Bounty is 50k or over AND active program
40%
Bounty is 50k or over
20%
Bug bounty program bounty is less than 50k
0%
No bug bounty program offered / the bug bounty program is dead
An active program means that a third party (such as Immunefi) is actively driving hackers to the site. An inactive program would be static mentions on the docs.

Admin Controls

17%

This section covers the documentation of special access controls for a DeFi protocol. The admin access controls are the contracts that allow updating contracts or coefficients in the protocol. Since these contracts can allow the protocol admins to "change the rules", complete disclosure of capabilities is vital for user's transparency. It is explained in this document.

18. Is the protocol's admin control information easy to find?

Answer: 0%

There are no admin control information readily available for users on StellaSwap's website. There is a mention of a governance portal launch in february 2022 but that portal is nowhere to be found.

Percentage Score Guidance:
100%
Admin Controls are clearly labelled and on website, docs or repo, quick to find
70%
Admin Controls are clearly labelled and on website, docs or repo but takes a bit of looking
40%
Admin Control docs are in multiple places and not well labelled
20%
Admin Control docs are in multiple places and not labelled
0%
Admin Control information could not be found

19. Are relevant contracts clearly labelled as upgradeable or immutable? (%)

Answer: 0%

There are no mentions of upgradeability or immutability in the protocol's documentation nor code.

Percentage Score Guidance:
100%
Both the contract documentation and the smart contract code state that the code is not upgradeable or immutable.
80%
All Contracts are clearly labelled as upgradeable (or not)
50%
Code is immutable but not mentioned anywhere in the documentation
0%
Admin control information could not be found

20. Is the type of smart contract ownership clearly indicated? (%)

Answer: 50%

StellaSwap does not indicate ownership of its smart contracts. Many of the protocol's contracts do mention in their code the OnlyOwner function but a mention of contract ownership in the documentation would greatly help users better understand the capacities and limitations of smart contract changes.

Percentage Score Guidance:
100%
The type of ownership is clearly indicated in their documentation. (OnlyOwner / MultiSig / etc)
50%
The type of ownership is indicated, but only in the code. (OnlyOwner / MultiSig / etc)
0%
Admin Control information could not be found

21. Are the protocol's smart contract change capabilities described? (%)

Answer: 0%

StellaSwap's documentation does not cover the capabilities for change of its smart contracts.

Percentage Score Guidance:
100%
The documentation covers the capabilities for change for all smart contracts
50%
The documentation covers the capabilities for change in some, but not all contracts
0%
The documentation does not cover the capabilities for change in any contract

22. Is the protocol's admin control information easy to understand? (%)

Answer: 0%

There is no admin control information available in the protocol's website.

Percentage Score Guidance:
100%
All the contracts are immutable
90%
Description relates to investments safety in clear non-software language
30%
Description all in software-specific language
0%
No admin control information could be found

23. Is there sufficient Pause Control documentation? (%)

Answer: 0%

StellaSwap does not provide Pause Control documentation.

Percentage Score Guidance:
100%
If immutable and no changes possible
100%
If admin control is fully via governance
80%
Robust transaction signing process (7 or more elements)
70%
Adequate transaction signing process (5 or more elements)
60%
Weak transaction signing process (3 or more elements)
0%
No transaction signing process evident
Evidence of audits of signers following the process add 20%

24. Is there sufficient Timelock documentation? (%)

Answer: 60%

StellaSwap's timelock function can be found in their Timelock.sol contract. The duration is specified within the contract.    However, because there is no documentation clearly describing the timelock's purpose (there is a brief - yet irrelevant to smart contracts - mention of a timelock in "Staking & Locking" but this is not considered substantial) and which contracts it explicitly applies to, the protocol earns a 60%.

Percentage Score Guidance:
100%
Documentation identifies and explains why the protocol does not need a Timelock OR Timelock documentation identifies its duration, which contracts it applies to and justifies this time period.
60%
A Timelock is identified and its duration is specified
30%
A Timelock is identified
0%
No Timelock information was documented

25. Is the Timelock of an adequate length? (Y/N)

Answer: 75%

StellaSwap's timelock has a minimum delay of 6 hours and a maximum delay of 30 days. Because the timelock can go beyond 48 hours but there is no explanation as to why there are variable delays, the protocol earns a 75%.

Percentage Score Guidance:
100%
Timelock is between 48 hours to 1 week OR justification as to why no Timelock is needed / is outside this length.
50%
Timelock is less than 48 hours or greater than 1 week.
0%
No Timelock information was documented OR no timelock length was identified.

Oracles

0%

This section goes over the documentation that a protocol may or may not supply about their Oracle usage. Oracles are a fundamental part of DeFi as they are responsible for relaying tons of price data information to thousands of protocols using blockchain technology. Not only are they important for price feeds, but they are also an essential component of transaction verification and security. These questions are explained in this document.

26. Is the protocol's Oracle sufficiently documented? (%)

Answer: 0

There is no documentation on StellaSwap's oracle(s). As a fork of Uni-V2, it is unlikely that they use them (though it is possible). Decentralised exchanges should identify this. As such, we will not be awarding points here.

Score Guidance:
100%
If it uses one, the Oracle is specified. The contracts dependent on the oracle are identified. Basic software functions are identified (if the protocol provides its own price feed data). Timeframe of price feeds are identified. OR The reason as to why the protocol does not use an Oracle is identified and explained.
75%
The Oracle documentation identifies both source and timeframe, but does not provide additional context regarding smart contracts.
50%
Only the Oracle source is identified.
0%
No oracle is named / no oracle information is documented.

27. Is front running mitigated by this protocol? (Y/N)

Answer: No

The protocol does not describe any front running mitigation techniques.

Score Guidance:
Yes
The protocol cannot be front run and there is an explanation as to why OR documented front running countermeasures are implemented.
No
The Oracle documentation identifies both source and timeframe, but does not provide additional context regarding smart contracts.

28. Can flashloan attacks be applied to the protocol, and if so, are those flashloan attack risks mitigated? (Y/N)

Answer: No

There are no mentions of flashloan attacks being applicable or not on the protocol/ flashloan attack mitigation techniques are not described.

Score Guidance:
Yes
The protocol's documentation includes information on how they mitigate the possibilities and extents of flash loan attacks.
No
The protocol's documentation does not include any information regarding the mitigation of flash loan attacks.

Appendices

null
1// SPDX-License-Identifier: GPL-3.0
2
3pragma solidity =0.6.12;
4
5import './StellaSwapV2ERC20.sol';
6import './libraries/Math.sol';
7import './libraries/UQ112x112.sol';
8import './interfaces/IERC20.sol';
9import './interfaces/IStellaSwapV2Factory.sol';
10import './interfaces/IStellaSwapV2Callee.sol';
11
12interface IMigrator {
13    // Return the desired amount of liquidity token that the migrator wants.
14    function desiredLiquidity() external view returns (uint256);
15}
16
17contract StellaSwapV2Pair is StellaSwapV2ERC20 {
18    using SafeMathStellaSwap  for uint;
19    using UQ112x112 for uint224;
20
21    uint public constant MINIMUM_LIQUIDITY = 10**3;
22    bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
23
24    address public factory;
25    address public token0;
26    address public token1;
27
28    uint112 private reserve0;           // uses single storage slot, accessible via getReserves
29    uint112 private reserve1;           // uses single storage slot, accessible via getReserves
30    uint32  private blockTimestampLast; // uses single storage slot, accessible via getReserves
31
32    uint public price0CumulativeLast;
33    uint public price1CumulativeLast;
34    uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
35
36    uint32 public swapFee = 25; // uses 0.25% default
37    uint32 public devFee = 5; // uses 0.05% default from swap fee
38
39    uint private unlocked = 1;
40    modifier lock() {
41        require(unlocked == 1, 'StellaSwapV2: LOCKED');
42        unlocked = 0;
43        _;
44        unlocked = 1;
45    }
46
47    function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
48        _reserve0 = reserve0;
49        _reserve1 = reserve1;
50        _blockTimestampLast = blockTimestampLast;
51    }
52
53    function _safeTransfer(address token, address to, uint value) private {
54        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
55        require(success && (data.length == 0 || abi.decode(data, (bool))), 'StellaSwapV2: TRANSFER_FAILED');
56    }
57
58    event Mint(address indexed sender, uint amount0, uint amount1);
59    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
60    event Swap(
61        address indexed sender,
62        uint amount0In,
63        uint amount1In,
64        uint amount0Out,
65        uint amount1Out,
66        address indexed to
67    );
68    event Sync(uint112 reserve0, uint112 reserve1);
69
70    constructor() public {
71        factory = msg.sender;
72    }
73
74    // called once by the factory at time of deployment
75    function initialize(address _token0, address _token1) external {
76        require(msg.sender == factory, 'StellaSwapV2: FORBIDDEN'); // sufficient check
77        token0 = _token0;
78        token1 = _token1;
79    }
80
81    function setSwapFee(uint32 _swapFee) external {
82        require(_swapFee > 0, "StellaSwapV2: lower then 0");
83        require(msg.sender == factory, 'StellaSwapV2: FORBIDDEN');
84        require(_swapFee <= 1000, 'StellaSwapV2: FORBIDDEN_FEE');
85        swapFee = _swapFee;
86    }
87    
88    function setDevFee(uint32 _devFee) external {
89        require(_devFee > 0, "StellaSwapV2: lower then 0");
90        require(msg.sender == factory, 'StellaSwapV2: FORBIDDEN');
91        require(_devFee <= 500, 'StellaSwapV2: FORBIDDEN_FEE');
92        devFee = _devFee;
93    }
94
95    // update reserves and, on the first call per block, price accumulators
96    function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
97        require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'StellaSwapV2: OVERFLOW');
98        uint32 blockTimestamp = uint32(block.timestamp % 2**32);
99        uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
100        if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
101            // * never overflows, and + overflow is desired
102            price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
103            price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
104        }
105        reserve0 = uint112(balance0);
106        reserve1 = uint112(balance1);
107        blockTimestampLast = blockTimestamp;
108        emit Sync(reserve0, reserve1);
109    }
110
111    // if fee is on, mint liquidity equivalent to 1/5th of the growth in sqrt(k)
112    function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
113        address feeTo = IStellaSwapV2Factory(factory).feeTo();
114        feeOn = feeTo != address(0);
115        uint _kLast = kLast; // gas savings
116        if (feeOn) {
117            if (_kLast != 0) {
118                uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
119                uint rootKLast = Math.sqrt(_kLast);
120                if (rootK > rootKLast) {
121                    uint numerator = totalSupply.mul(rootK.sub(rootKLast));
122                    uint denominator = rootK.mul(devFee).add(rootKLast);
123                    uint liquidity = numerator / denominator;
124                    if (liquidity > 0) _mint(feeTo, liquidity);
125                }
126            }
127        } else if (_kLast != 0) {
128            kLast = 0;
129        }
130    }
131
132    // this low-level function should be called from a contract which performs important safety checks
133    function mint(address to) external lock returns (uint liquidity) {
134        (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
135        uint balance0 = IERC20StellaSwap(token0).balanceOf(address(this));
136        uint balance1 = IERC20StellaSwap(token1).balanceOf(address(this));
137        uint amount0 = balance0.sub(_reserve0);
138        uint amount1 = balance1.sub(_reserve1);
139
140        bool feeOn = _mintFee(_reserve0, _reserve1);
141        uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
142        if (_totalSupply == 0) {
143            address migrator = IStellaSwapV2Factory(factory).migrator();
144            if (msg.sender == migrator) {
145                liquidity = IMigrator(migrator).desiredLiquidity();
146                require(liquidity > 0 && liquidity != uint256(-1), "Bad desired liquidity");
147            } else {
148                require(migrator == address(0), "Must not have migrator");
149                liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
150                _mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
151            }
152        } else {
153            liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
154        }
155        require(liquidity > 0, 'StellaSwapV2: INSUFFICIENT_LIQUIDITY_MINTED');
156        _mint(to, liquidity);
157
158        _update(balance0, balance1, _reserve0, _reserve1);
159        if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
160        emit Mint(msg.sender, amount0, amount1);
161    }
162
163    // this low-level function should be called from a contract which performs important safety checks
164    function burn(address to) external lock returns (uint amount0, uint amount1) {
165        (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
166        address _token0 = token0;                                // gas savings
167        address _token1 = token1;                                // gas savings
168        uint balance0 = IERC20StellaSwap(_token0).balanceOf(address(this));
169        uint balance1 = IERC20StellaSwap(_token1).balanceOf(address(this));
170        uint liquidity = balanceOf[address(this)];
171
172        bool feeOn = _mintFee(_reserve0, _reserve1);
173        uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
174        amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
175        amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
176        require(amount0 > 0 && amount1 > 0, 'StellaSwapV2: INSUFFICIENT_LIQUIDITY_BURNED');
177        _burn(address(this), liquidity);
178        _safeTransfer(_token0, to, amount0);
179        _safeTransfer(_token1, to, amount1);
180        balance0 = IERC20StellaSwap(_token0).balanceOf(address(this));
181        balance1 = IERC20StellaSwap(_token1).balanceOf(address(this));
182
183        _update(balance0, balance1, _reserve0, _reserve1);
184        if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
185        emit Burn(msg.sender, amount0, amount1, to);
186    }
187
188    // this low-level function should be called from a contract which performs important safety checks
189    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
190        require(amount0Out > 0 || amount1Out > 0, 'StellaSwapV2: INSUFFICIENT_OUTPUT_AMOUNT');
191        (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
N/A