Baseline Markets engaged Guardian to review the security of its YesArena game and afterburner updates. From June 12th to June 16th, a team of 2 auditors reviewed the source code in scope.
- Published
- Language
- Solidity
- Chains
- Blast
- Sector
- Token launches
- 0 Critical
- 2 High
- 4 Medium
- 9 Low
- 0 Informational
Scope
Overview
Baseline Markets engaged Guardian to review the security of its YesArena game and afterburner updates. From June 12th to June 16th, a team of 2 auditors reviewed the source code in scope.
Findings 15
-
H-01 High Invalid Portion Burned Logical Error Resolved
Description
In the reheat function the
reserveSizeis computed with a denominator of 100e18, however theminPortionandmaxPortionare assigned to as .05 ether and .15 ether respectively in the constructor.The comment on line 150 indicates that the portion ought to be 15% rather than 0.15%, therefore the portion is a factor of 100x smaller than it ought to be.
Recommendation
Use a denominator of 1e18 rather than 100e18.
Resolution
Baseline Team: Resolved.
-
H-02 High YesArena Block Stuffing Attack Block Stuffing Pending
Description
A malicious actor may significantly increase their odds of winning the YesArena at the end of the game time by using two addresses to ensure they control both the winner and hotPotato addresses and then submitting many transactions to stuff Blast blocks for the next 2 minutes.
For example:
- Bob calls deposit with address A, A is now the hot potato
- Bob calls deposit with address B, A is now the winner & B is the hot potato
- Bob submits many gas waster transactions to stuff the next 2 minutes of Blast blocks until he is
the winner
This can significantly reduce the chances that other actors have at getting a deposit call recorded before the 2 minutes is over.
Recommendation
Be aware of this risk, consider adding more time to the game for every deposit to make it more costly to block stuff the chain to improve winning odds.
Resolution
Baseline Team: Pending.
-
M-01 Medium claimed Value Not Assigned Logical Error Pending
Description
In the
claimfunction theclaimedboolean is not assigned totrue, therefore the system never indicates that the claim can occur.As a result arbitrary users can trigger multiple transfers to the winner and emit the
Claimevent several times.Recommendation
Assign the
claimedboolean to true in theclaimfunction.Resolution
Baseline Team: Pending.
-
M-02 Medium Reheat Sniping Sandwhich Attack Pending
Description
The reheat function will buy YES and loop it when the random roll hits. However the random value is based upon the the block.timestamp and block.prevrandao which are both deterministically available at the block in which the reheat transaction is recorded.
In environments where front-running is possible, a malicious actor may create a contract which buys YES and reverts if the block.timestamp and block.prevrandao would not fulfill the random requirements.
This way the attacker can detect owner transactions to reheat and frontrun them in the same block to buy YES right before the price increases as a result of the reheat. The attacker can then back run the reheat and sell their YES tokens if a reheat looping was performed for a risk free immediate profit.
Recommendation
This is not an immediate concern on the Blast L2 network, however be sure to consider this risk before deploying to a network with high MEV activity.
Resolution
Baseline Team: Pending.
-
M-03 Medium Blast Yields Are Not Configured For YesArena Configuration Pending
Description
In the YesArena contract there is no configuration for gas yields, however the YesArena contract is likely to accrue a nontrivial gas expenditure during the game.
Recommendation
Consider implementing appropriate configurations and functions to claim the gas yields that would accrue for the YesArena contract.
Resolution
Baseline Team: Pending.
-
M-04 Medium Lacking _buy Slippage Protection Sandwhich Attack Pending
Description
In the
_buyfunction there is no slippage protection configured in the swap call. This allows malicious actors to sandwich thereheattransaction’s swap and extract value from the system.Recommendation
The system is currently deployed on Blast which does not have a public mempool, so frontrunning sandwich vectors are not an immediate concern.
However upon deploying to new chains, carefully consider this risk and implement the necessary swap protections to mitigate the sandwich attack vector.
Resolution
Baseline Team: Pending.
-
L-01 Low Lack Of Upgradeability Controls Suggestion Pending
Description
The
mmandcfaddresses are declaredimmutablein theAfterBurnercontract, however In the event that theMarketMakingorCreditFacilitycontracts are upgraded, a newAfterBurnercontract would need to be deployed. This may become unwieldy and incur the team unnecessary deploy expenses over time.Recommendation
Consider implementing functions to update the cf and mm addresses, and be sure that the owner address is a multi-sig. Otherwise if trust of the owner is a concern, do not add these functions and be aware that the AfterBurner should be re-deployed with funds ported over in the event of a
MarketMakingorCreditFacilitycontract upgrade.Resolution
Baseline Team: Pending.
-
L-02 Low Lacking Rate Validations Validation Pending
Description
In the
YesArenacontract constructor there is no validation that theGROWTH_RATEis correctly assigned to a value greater than1e18. If theGROWTH_RATEvalue is assigned to less than1e18it will result in a smaller deposit price over time. Similarly, there is no validation requiring theFEE_RATEto be a reasonable proportion of1e18.Recommendation
Consider implementing validations such that the
GROWTH_RATEcannot be assigned to a value less than1e18and theFEE_RATEcannot be above a certain threshold.Resolution
Baseline Team: Pending.
-
L-03 Low YesArena References Old AfterBurner Configuration Pending
Description
In the
YesArenacontract theafterburneraddress is hardcoded as the existing afterburner contract, which does not include the latest updates.Recommendation
Consider making the
afterburneraddress configurable within the constructor. Otherwise be sure to update this address in theYesArenacontract before deployment.Resolution
Baseline Team: Pending.
-
L-04 Low Unlock Timestamp Within Game Time Unexpected Behavior Pending
Description
The
UNLOCK_TIMESTAMPmay occur within thegameTimeperiod if enough deposits are made, as a result the winner will be able to claim the jackpot immediately after winning.Recommendation
Consider if this is expected behavior, if it is not then consider altering the unlock time validation such that it validates that a certain amount of time has passed since the end of the game time period.
Resolution
Baseline Team: Pending.
-
L-05 Low Deposits May Receive The Same Random Unexpected Behavior Pending
Description
In the deposit function a pseudo random value is generated to be emitted with the Deposited event for the deposit. However this random value is generated based upon values that apply to the entire block, not just the particular transaction being executed.
As a result several deposits within the same block will have the same random value associated with them in the Deposited event.
Recommendation
Consider if this is the expected behavior, otherwise consider seeding the deposit with values that can distinguish each deposit within a single block from each other, such as the depositNumber.
Resolution
Baseline Team: Pending.
-
L-06 Low Invalid Deposit Amount Emitted Logical Error Pending
Description
In the deposit function the
Depositedevent emits thedepositPriceas the amount variable, however this is not the amount which the caller paid as thedepositPricewas subsequently increased by the growth rate.Recommendation
Consider caching the
depositPricevariable at the beginning of the deposit function and emitting this as the amount in theDepositedevent.Additionally, use this cached
depositPricestack variable to perform the deposit validation, transfers, and newdepositPricecalculation to save gas in thedepositfunction.Resolution
Baseline Team: Pending.
-
L-07 Low Weth Yields Automatically Get Heated Documentation Pending
Description
In the
Afterburnercontract any yield for thewethreserve assets held in theAfterburnerwill automatically be included in the reheat actions as they will automatically be applied to theAfterburnercontract balance.This may be expected, however it is worth pointing out as the protocol may wish to claim these yields instead of having them automatically attributed to each reheat.
Recommendation
Consider if the
wethyields should be applied to reheat actions, otherwise implement logic in the constructor such that the yield mode is claimable and a trusted address may withdraw these yields for the protocol.Resolution
Baseline Team: Pending.
-
L-08 Low Unnecessary Modulo Optimization Pending
Description
In the
reheatfunction the hit value is determined based onroll % probabilityDenominator == 69, however the roll value has already been modded by theprobabilityDenominatorand incremented by 1.Therefore modding by the
probabilityDenominatora second time only maps rolls of 100 to 0, and therefore will not affect the odds of a hit.Recommendation
Remove the second module which occurs on line 142 as it is unnecessary.
Resolution
Baseline Team: Pending.
-
L-09 Low Lacking Configuration Validations Validation Pending
Description
In the
Afterburnercontract there are several owner configuration functions which lack important validations. For example, in thesetSourcesfunction, the sources array should be validated to be within a reasonable length such that thereheatfunction cannot be accidentally or maliciously DoS’d due to an extremely longsourcesarray.In the
setPortionBoundsandsetDelayBoundsfunctions there is no validation that the configured min bound is less than the max bound. And thesetProbabilityDenominatordoes not validate that the denominator is nonzero.Recommendation
Consider implementing the suggested validations to protect against accidental assignments or owner compromises.
Resolution
Baseline Team: Pending.
No findings match.
More from Baseline Markets
All 12 reports-
Mercury, Round 3
109 findings4 critical · 9 high 109 findings: 4 critical, 9 high, 28 medium, 33 low, 35 informational -
AMM, Round 2
47 findings4 critical · 14 high 47 findings: 4 critical, 14 high, 8 medium, 13 low, 8 informational -
AMM
54 findings3 critical · 6 high 54 findings: 3 critical, 6 high, 13 medium, 11 low, 21 informational -
Fixed Supply
34 findings4 high 34 findings: 4 high, 10 medium, 20 low
Put your code through the same review.
This review started with a conversation about scope. Tell us what you are building and we will plan yours with you.
