Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

light-fury
Copy link

No description provided.

address operatorAddress_,
uint256 minBetAmount_
) {
if (oracle_ == address(0)) revert("ZERO_ADDRESS()");
Copy link
Contributor

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 {
Copy link
Contributor

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(
Copy link
Contributor

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(
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants