Gigaswap - Audit

CertiKFiles named in the report

CertiK reviewed GigaSwap (Gigaswap - Audit) on 7 Feb 2024: 30 findings, 1 critical; 25 marked fixed, 5 open.

1 critical finding, fixed
Open the reportOpen GigaSwap’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings30

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical001
High203
Medium008
Low3013
HighCentralization Related RisksOpen

In the contract `Farming` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority. ![](https://accelerator-tasks-prod.acc.corp.certik.com/85ac73def284490c90e3113507f4bfa4/diagrams/centralization_Farming-Farming-_owner.svg) In the contract `FeeSettings` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority. ![](https://accelerator-tasks-prod.acc.corp.certik.com/85ac73def284490c90e3113507f4bfa4/diagrams/centralization_FeeSettings-FeeSettings-_owner.svg) In the contract `FeeSettingsWriter` the role `_factory` has authority over the functions shown in the diagram below. Any compromise to the `_factory` account may allow the hacker to take advantage of this authority. ![](https://accelerator-tasks-prod.acc.corp.certik.com/85ac73def284490c90e3113507f4bfa4/diagrams/centralization_FeeSettingsWriter-FeeSettingsWriter-_factory.svg) In the contract `FeeSettingsWriter` the role `factory` has authority over the functions shown in the diagram below. Any compromise to the `factory` account may allow the hacker to take advantage of this authority. ![](https://accelerator-tasks-prod.acc.corp.certik.com/85ac73def284490c90e3113507f4bfa4/diagrams/centralization_FeeSettingsWriter-FeeSettingsWriter-factory.svg) In the contract `Erc20Sale` the role `antibot` has authority over the functions shown in the diagram below. Any compromise to the `antibot` account may allow the hacker to take advantage of this authority. ![](https://accelerator-tasks-prod.acc.corp.certik.com/85ac73def284490c90e3113507f4bfa4/diagrams/centralization_Erc20Sale-Erc20Sale-antibot.svg) In the contract `Erc20SaleWeth` the role `antibot` has authority over the functions shown in the diagram below. Any compromise to the `antibot` account may allow the hacker to take advantage of this authority. ![](https://accelerator-tasks-prod.acc.corp.certik.com/85ac73def284490c90e3113507f4bfa4/diagrams/centralization_Erc20SaleWeth-Erc20SaleWeth-antibot.svg) In the contract `Ownable` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority. ![](https://accelerator-tasks-prod.acc.corp.certik.com/85ac73def284490c90e3113507f4bfa4/diagrams/centralization_GigaSwapToken-Ownable-_owner.svg) In the contract `TradableErc20` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority. ![](https://accelerator-tasks-prod.acc.corp.certik.com/85ac73def284490c90e3113507f4bfa4/diagrams/centralization_GigaSwapToken-TradableErc20-_owner.svg) In the contract `TradableErc20` the role `_withdrawAddress` has authority over the functions shown in the diagram below. Any compromise to the `_withdrawAddress` account may allow the hacker to take advantage of this authority. ![](https://accelerator-tasks-prod.acc.corp.certik.com/85ac73def284490c90e3113507f4bfa4/diagrams/centralization_GigaSwapToken-TradableErc20-_withdrawAddress.svg) In the contract `TradableErc20` the role `_withdrawer` has authority over the functions shown in the diagram below. Any compromise to the `_withdrawer` account may allow the hacker to take advantage of this authority. ![](https://accelerator-tasks-prod.acc.corp.certik.com/85ac73def284490c90e3113507f4bfa4/diagrams/centralization_GigaSwapToken-TradableErc20-_withdrawer.svg) In the contract `Withdrawable` the role `_withdrawAddress` has authority over the functions shown in the diagram below. Any compromise to the `_withdrawAddress` account may allow the hacker to take advantage of this authority. ![](https://accelerator-tasks-prod.acc.corp.certik.com/85ac73def284490c90e3113507f4bfa4/diagrams/centralization_GigaSwapToken-Withdrawable-_withdrawAddress.svg) In the contract `Withdrawable` the role `_withdrawer` has authority over the functions shown in the diagram below. Any compromise to the `_withdrawer` account may allow the hacker to take advantage of this authority. ![](https://accelerator-tasks-prod.acc.corp.certik.com/85ac73def284490c90e3113507f4bfa4/diagrams/centralization_GigaSwapToken-Withdrawable-_withdrawer.svg) In the contract `Erc20ForFactory` the role `_factory` has authority over the functions shown in the diagram below. Any compromise to the `_factory` account may allow the hacker to take advantage of this authority. ![](https://accelerator-tasks-prod.acc.corp.certik.com/85ac73def284490c90e3113507f4bfa4/diagrams/centralization_Erc20ForFactory-Erc20ForFactory-_factory.svg) In the contract `Erc20ForFactory` the role `factory` has authority over the functions shown in the diagram below. Any compromise to the `factory` account may allow the hacker to take advantage

HighFunction `allowance` of Contract `gWETH` ReturnsOpen

It is expected that calls of the form `allowance(owner, spender)` return the allowance that address `spender` has over tokens held by address `owner`. However, the implementation of `allowance` in contract `gWETH` returns different values when the `_withoutAllowance[spender]` is `true`. The owner address has the privilege to assign as many addresses as possible to have a max allowance returned no matter what the owner address is.

LowDiscussion on `antibot` addressOpen

In the contracts `Erc20Sale` and `Erc20SaleWeth`, we noticed that there is an input address called `antibot` in the `buy()` functions. The `antibot` address is used to check if the `msg.sender` is equal to the `antibot` address. From the naming of `antibot` we guess the purpose is to not allow smart contracts to call the address? If so, the current implementation of `require(msg.sender == antibot, 'antibot')` will not help.

LowLack of DocumentationOpen

The Gigaswap contract lacks comments, natspec, or documentation explaining the specific use case of each function.

LowPotential Flashloan AttackOpen

Flash loans are a way to borrow large amounts of money for a certain fee. The requirement is that the loans need to be returned within the same transaction in a block. If not, the transaction will be reverted. The `feePercentFor()` and `feeEthFor()` function relies on the balance of gigaToken that are based on-chain, meaning they are susceptible to flash-loan attacks by borrowing money to increase the account amount.

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 (87)

  • contracts/fee/vote/FeeSettingsSetFeeAddressVote.sol
  • contracts/swapper/DealsController.sol
  • contracts/lib/erc20/IErc20ForFactory.sol
  • contracts/lib/erc20/Erc20ForFactory.sol
  • contracts/weth/gWETH.sol
  • contracts/fee/vote/FeeSettingsWriter.sol
  • contracts/fee/FeeSettings.sol
  • contracts/giga_swap_erc20_token/vote/executors/GigaSwapTokenRemoveExtraContractAddressVote.sol
  • contracts/fixed_price_sales/Erc20SaleWeth.sol
  • contracts/lib/erc20/Erc20Min.sol
  • contracts/swapper/DealPointsController.sol
  • contracts/swapper/DealPointData.sol
  • contracts/giga_swap_erc20_token/GigaSwapToken.sol
  • contracts/votes/IVote.sol
  • contracts/position_trading/algorithms/TradingPair/TradingPairData.sol
  • contracts/position_trading/PositionsFactory.sol
  • contracts/giga_swap_erc20_token/vote/executors/GigaSwapTokenSetExtraContractAddressVote.sol
  • contracts/votes/VoteExecutorBase.sol
  • contracts/fixed_price_sales/IErc20Sale.sol
  • contracts/swapper/DealPointRef.sol
  • contracts/position_trading/algorithms/TradingPair/ITradingPairFeeDistributer.sol
  • contracts/lib/erc20/IErc20ForFactoryFactory.sol
  • contracts/fee/FeeSettingsDecorator.sol
  • contracts/position_trading/AssetData.sol
  • contracts/swapper/GigaSwap.sol
  • contracts/swapper/IDealPointsController.sol
  • contracts/votes/IVoteExecutor.sol
  • contracts/swapper/DealsFactory.sol
  • contracts/position_trading/assets/AssetsControllerBase.sol
  • contracts/swapper/Deal.sol
  • contracts/position_trading/algorithms/PositionAlgorithm.sol
  • contracts/giga_swap_erc20_token/vote/GigaSwapTokenWriter.sol
  • contracts/position_trading/AssetCreationData.sol
  • contracts/giga_swap_erc20_token/vote/executors/GigaSwapTokenSetShareVote.sol
  • contracts/weth/IgWETH.sol
  • contracts/swapper/IDealsController.sol
  • contracts/fixed_price_sales/IErc20SaleCounterOffer.sol
  • contracts/position_trading/algorithms/TradingPair/TradingPairConstraints.sol
  • contracts/lib/ownable/IOwnable.sol
  • contracts/fee/IFeeSettingsSetters.sol
  • contracts/position_trading/algorithms/TradingPair/ITradingPairAlgorithm.sol
  • contracts/swapper/plugins/erc721/erc721item/Erc721ItemDealPointsController.sol
  • contracts/position_trading/ItemRefAsAssetLibrary.sol
  • contracts/swapper/plugins/erc20/IErc20DealPointsController.sol
  • contracts/lib/ownable/Ownable.sol
  • contracts/votes/VoteDataLib.sol
  • contracts/swapper/plugins/erc721/erc721count/IErc721CountDealPointsController.sol
  • contracts/position_trading/assets/Erc721ItemAssetsController.sol
  • contracts/swapper/plugins/erc721/erc721count/Erc721CountDealPointsController.sol
  • contracts/lib/factories/ContractData.sol
  • contracts/position_trading/AssetTransferData.sol
  • contracts/swapper/plugins/erc20/Erc20DealPointsController.sol
  • contracts/giga_swap_erc20_token/vote/executors/GigaSwapTokenSetBuyFeeVote.sol
  • contracts/fee/IFeeSettings.sol
  • contracts/position_trading/algorithms/TradingPair/FeeSettings.sol
  • contracts/lib/erc20/Erc20ForFactoryFactory.sol
  • contracts/giga_swap_erc20_token/vote/executors/GigaSwapTokenSetWithdrawAddressVote.sol
  • contracts/giga_swap_erc20_token/vote/executors/GigaSwapTokenSetSellFeeVote.sol
  • contracts/position_trading/algorithms/PositionLocker/PositionLockerAlgorithm.sol
  • contracts/swapper/plugins/erc721/erc721item/IErc721ItemDealPointsController.sol
  • contracts/position_trading/IPositionsController.sol
  • contracts/votes/VoteData.sol
  • contracts/position_trading/algorithms/TradingPair/TradingPairReader.sol
  • contracts/lib/factories/HasFactories.sol
  • contracts/position_trading/PositionsController.sol
  • contracts/fee/vote/FeeSettingsSetFeePercentVote.sol
  • contracts/giga_swap_erc20_token/vote/IGigaSwapTokenSetters.sol
  • contracts/votes/Vote.sol
  • contracts/fixed_price_sales/Erc20Sale.sol
  • contracts/farming/IFarming.sol
  • contracts/position_trading/ItemRef.sol
  • contracts/swapper/DealPointDataInternal.sol
  • contracts/position_trading/IAssetsController.sol
  • contracts/position_trading/assets/Erc20AssetsController.sol
  • contracts/lib/factories/IHasFactories.sol
  • contracts/fee/vote/FeeSettingsSetFeeEthVote.sol
  • contracts/position_trading/IAssetListener.sol
  • contracts/position_trading/algorithms/TradingPair/TradingPairFeeDistributer.sol
  • contracts/lib/ownable/OwnableSimple.sol
  • contracts/swapper/plugins/ether/IEtherDealPointsController.sol
  • contracts/position_trading/PositionSnapshot.sol
  • contracts/position_trading/algorithms/PositionLockerBase.sol
  • contracts/position_trading/assets/EthAssetsController.sol
  • contracts/swapper/plugins/ether/EtherDealPointsController.sol
  • contracts/position_trading/IPositionAlgorithm.sol
  • contracts/position_trading/algorithms/TradingPair/TradingPairAlgorithm.sol
  • contracts/farming/Farming.sol

Part of GigaSwap’s security record

GigaSwap
Audits1 audit by 1 firmLast audit Feb 2024, by CertiK.
Critical findingsNo open critical findingsIn that report, 1 critical finding was reported. It is marked fixed by the firm that reported it.
Open GigaSwap’s security record

Security firm

CertiK

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

See CertiK’s 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