-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binary Market for Price Game #33
base: main
Are you sure you want to change the base?
Conversation
address operatorAddress_, | ||
uint256 minBetAmount_ | ||
) { | ||
if (oracle_ == address(0)) revert("ZERO_ADDRESS()"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think thats an issue and if & revert is better than require, but in revert statement, you used string as a paramter. That will not save gas fee. @Top-Kraken @light-fury
* @dev set minBetAmount | ||
* callable by admin | ||
*/ | ||
function setMinBetAmount(uint256 _minBetAmount) external onlyAdmin { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Severity: Low
Confidence: High
BinaryMarket.setMinBetAmount(uint256) should emit an event for:
- minBetAmount = _minBetAmount
Recommendation: Add event for minimum bet amount changes.
_; | ||
} | ||
|
||
constructor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Severity: Low
Confidence: High
BinaryMarket.constructor(address,address,string,IBinaryMarket.TimeFrame[],address,address,uint256).adminAddress_ lacks a zero-check on :
- adminAddress = adminAddress_
- operatorAddress = operatorAddress_
Recommendation: Add zero address check.
* @param timeframeId id of 1m/5m/10m | ||
* @param position bull/bear | ||
*/ | ||
function openPosition( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Severity: Low
Confidence: Medium
Reentrancy in BinaryMarket.openPosition(uint256,uint8,IBinaryMarket.Position):
External calls:
- underlyingToken.safeTransferFrom(msg.sender,address(vault),amount)
State variables written after the call(s):
- betInfo.position = position
- betInfo.amount = amount
- round.totalAmount = round.totalAmount + amount
- round.bearAmount = round.bearAmount + amount
- round.bullAmount = round.bullAmount + amount
- userRounds[timeframeId][msg.sender].push(currentEpoch)
Recommendation: Change lines order or add re-entrancy guard.
No description provided.