Bakery Swap

CertiKFiles named in the report

CertiK reviewed BakerySwap (Bakery Swap) on 17 Sep 2020: 32 findings, 0 critical; 20 marked fixed, 12 open.

No open critical findings
Open the reportOpen BakerySwap鈥檚 security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings32

Statuses are the security firm鈥檚 own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High000
Medium000
Low12020
LowFork LeftoversOpen

The linked segments contain the unicode icon 馃 as a leftover from Uniswap.

LowFunction PlotOpen

We have taken note of an extensive test suite located in the repository, however we advise that fuzz-based testing is introduced to ensure that the values retrieved from the reward calculation follow the plot you have set within the calculations.

LowInconsistent Transaction OrderingOpen

The linked mathematical statements are conducted in a different order than each other, with the former being a subtraction - multiplication - division and the latter being a subtraction - division (w/ subtraction rounding) - multiplication. In Solidity, the order of mathematical execution is important as there is no concept of a decimal number and divisions are rounded down.

LowInefficient CaseOpen

The linked case ensures that `fromBulkNumber` is greater-than (>) the literal 0 before multiplying it with a value in the ternary operator after being subtracted by 1. Since the value is subtracted by 1, in the case that `fromBlockNumber` is 1 the multiplication would again yield 0.

LowInefficient ConditionalOpen

The conditionals check whether the uint256 variables are less than the literal 1. This is only the case when the value is 0.

LowInefficient Greater-Than Comparison w/ ZeroOpen

The linked statements conduct a greater-than (>) comparison between an unsigned integer and the value literal 0.

LowInefficient Per-Member AssignmentOpen

Each instruction on the EVM costs gas to execute and in this case, each member of the struct is independently written to instead of conducting a single mass-write by instantiating a `PoolInfo` declaration in `memory` and subsequently assigning it to `poolInfoMap[_pair]`.

LowManual ZeroingOpen

The manual zeroing operations could instead be replaced by a delete operation on `poolUserInfoMap[_pair][msg.sender]` which is more readable and gas efficient.

LowRedundant `bool` VariableOpen

The newly added boolean variable is meant to represent whether an entry to the new poolInfoMap mapping exists to prevent duplicate calls to the add function. While this functions as intended, it is possible to utilize the already-existent non-zero variable `lastRewardBlock` for this particular purpose.

LowUtilization of `storage` Variable Instead of `memOpen

The linked newly introduced assignment should utilize the already existent `_feeToSetter` variable in `memory` rather than retrieving the newly stored `feeToSetter` variable from `storage`, optimizing the gas cost involved in deploying the contract.

Show 2 more
LowVariable Mutability SpecifierOpen

The linked variable declarations are only assigned to once during the constructor of the contract.

LowVariable to `constant`Open

The linked variable is only assigned to once during its instantiation at the contract level.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (29)

  • contracts/utils/EnumerableSet.sol
  • contracts/utils/FixedPoint.sol
  • contracts/libraries/BakerySwapLibrary.sol
  • contracts/utils/Address.sol
  • contracts/utils/PairNamer.sol
  • contracts/interfaces/IBakerySwapPair.sol
  • contracts/libraries/UQ112x112.sol
  • contracts/libraries/BakerySwapOracleLibrary.sol
  • contracts/token/BEP20/IBEP20.sol
  • contracts/BakeryToken.sol
  • contracts/utils/SafeBEP20Namer.sol
  • contracts/access/Ownable.sol
  • contracts/interfaces/IBakerySwapBEP20.sol
  • contracts/BakeryMaster.sol
  • contracts/BakerySwapFactory.sol
  • contracts/token/BEP20/BEP20.sol
  • contracts/interfaces/IBakerySwapRouter.sol
  • contracts/interfaces/IWBNB.sol
  • contracts/utils/Create2.sol
  • contracts/math/SafeMath.sol
  • contracts/interfaces/IBakerySwapFactory.sol
  • contracts/utils/TransferHelper.sol
  • contracts/GSN/Context.sol
  • contracts/BakerySwapRouter.sol
  • contracts/BakerySwapPair.sol
  • contracts/utils/AddressStringUtil.sol
  • contracts/token/BEP20/SafeBEP20.sol
  • contracts/BakerySwapBEP20.sol
  • contracts/access/Manageable.sol

Part of BakerySwap鈥檚 security record

BakerySwap
Audits1 audit by 1 firmLast audit Sep 2020, by CertiK.
Critical findingsNo open critical findingsIn 1 report.
Open BakerySwap鈥檚 security record

Security firm

CertiK

1,044 projects reviewed 路 1,375 reports 路 latest May 2025

See CertiK鈥檚 audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us