Skip to content

Commit

Permalink
fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidityDrone committed Oct 31, 2024
1 parent d1ffd3e commit a14288e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
14 changes: 9 additions & 5 deletions src/MultiOutcomePredictionMarket.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ contract MultiOutcomePredictionMarket is IMultiOutcomePredictionMarket {
newMarket.options.push(Option(0, initialPrices[i], initialPrices[i], optionNames[i]));
}

emit MarketCreated(marketId, optionsNames);
emit MarketCreated(marketCount, optionNames);
}

/**
Expand All @@ -101,7 +101,11 @@ contract MultiOutcomePredictionMarket is IMultiOutcomePredictionMarket {
market.winningOptionIndex = winningOptionIndex;
market.resolved = true;

emit MarketResolved(marketId, winningOptionIndex, getMarketWinner(marketId));
emit MarketResolved(
marketId,
winningOptionIndex,
markets[marketId].options[winningOptionIndex].optionName
);
}

/**
Expand Down Expand Up @@ -153,7 +157,7 @@ contract MultiOutcomePredictionMarket is IMultiOutcomePredictionMarket {

_updateMarketPrices(marketId);

emit(BoughtShares(msg.sender, marketId, optionId, quantity, cost));
emit BoughtShares(msg.sender, marketId, optionId, quantity, cost);
}

/**
Expand Down Expand Up @@ -184,7 +188,7 @@ contract MultiOutcomePredictionMarket is IMultiOutcomePredictionMarket {

_updateMarketPrices(marketId);

emit SoldShares(user, marketId, optionId, quantity, sellReturn);
emit SoldShares(msg.sender, marketId, optionId, quantity, sellReturn);
}

/**
Expand Down Expand Up @@ -451,6 +455,6 @@ contract MultiOutcomePredictionMarket is IMultiOutcomePredictionMarket {

IERC20(USDC_BASE_SEPOLIA).transfer(msg.sender, userRewards);

emit Withdrawal(msg.sender, marketId, userWinningShares, reward);
emit Withdrawal(msg.sender, marketId, userWinningShares, userRewards);
}
}
16 changes: 10 additions & 6 deletions src/flattened/MutiOutcomePredictionMarket.flattened.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ interface IERC20 {

interface IMultiOutcomePredictionMarket {

event MarketCreated(uint indexed marketId, string[] optionsNames);
event MarketCreated(uint indexed marketId, string[] optionNames);
event MarketResolved(uint indexed marketId, uint winningOptionIndex, string winningOptionName);
event BoughtShares(address indexed user, uint indexed marketId, uint optionId, uint amount, uint totalCost);
event SoldShares(address indexed user, uint indexed marketId, uint optionId, uint amount, uint totalReturn);
Expand Down Expand Up @@ -197,7 +197,7 @@ contract MultiOutcomePredictionMarket is IMultiOutcomePredictionMarket {
newMarket.options.push(Option(0, initialPrices[i], initialPrices[i], optionNames[i]));
}

emit MarketCreated(marketId, optionsNames);
emit MarketCreated(marketCount, optionNames);
}

/**
Expand All @@ -222,7 +222,11 @@ contract MultiOutcomePredictionMarket is IMultiOutcomePredictionMarket {
market.winningOptionIndex = winningOptionIndex;
market.resolved = true;

emit MarketResolved(marketId, winningOptionIndex, getMarketWinner(marketId));
emit MarketResolved(
marketId,
winningOptionIndex,
markets[marketId].options[winningOptionIndex].optionName
);
}

/**
Expand Down Expand Up @@ -274,7 +278,7 @@ contract MultiOutcomePredictionMarket is IMultiOutcomePredictionMarket {

_updateMarketPrices(marketId);

emit(BoughtShares(msg.sender, marketId, optionId, quantity, cost));
emit BoughtShares(msg.sender, marketId, optionId, quantity, cost);
}

/**
Expand Down Expand Up @@ -305,7 +309,7 @@ contract MultiOutcomePredictionMarket is IMultiOutcomePredictionMarket {

_updateMarketPrices(marketId);

emit SoldShares(user, marketId, optionId, quantity, sellReturn);
emit SoldShares(msg.sender, marketId, optionId, quantity, sellReturn);
}

/**
Expand Down Expand Up @@ -572,6 +576,6 @@ contract MultiOutcomePredictionMarket is IMultiOutcomePredictionMarket {

IERC20(USDC_BASE_SEPOLIA).transfer(msg.sender, userRewards);

emit Withdrawal(msg.sender, marketId, userWinningShares, reward);
emit Withdrawal(msg.sender, marketId, userWinningShares, userRewards);
}
}
2 changes: 1 addition & 1 deletion src/interface/IMultiOutcomePredictionMarket.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.0;

interface IMultiOutcomePredictionMarket {

event MarketCreated(uint indexed marketId, string[] optionsNames);
event MarketCreated(uint indexed marketId, string[] optionNames);
event MarketResolved(uint indexed marketId, uint winningOptionIndex, string winningOptionName);
event BoughtShares(address indexed user, uint indexed marketId, uint optionId, uint amount, uint totalCost);
event SoldShares(address indexed user, uint indexed marketId, uint optionId, uint amount, uint totalReturn);
Expand Down

0 comments on commit a14288e

Please sign in to comment.