Skip to content

Commit

Permalink
fix: curve typo and event params
Browse files Browse the repository at this point in the history
  • Loading branch information
0xashu committed May 14, 2024
1 parent 4ad7781 commit 32684e1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions contracts/core/MestSharesFactoryV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ contract MestSharesFactoryV1 is Ownable {
uint256 _linearPriceSlope
) external onlyOwner {
require(!curvesMap[_curveType].exists, "Curve already initialized");
Curve newCurve = Curve({
Curve memory newCurve = Curve({
basePrice: _basePrice,
inflectionPoint: _inflectionPoint,
inflectionPrice: _inflectionPrice,
Expand Down Expand Up @@ -184,7 +184,7 @@ contract MestSharesFactoryV1 is Ownable {

// Mint shares to the buyer
IMestShare(ERC1155).shareMint(msg.sender, shareId, quantity);
emit Buy(msg.sender, shareId, quantity, buyPriceAfterFee);
emit Buy(shareId, msg.sender quantity, buyPriceAfterFee);

// Deposit the buy price (in ETH) to the yield aggregator (e.g., Aave)
_safeTransferETH(address(yieldAggregator), buyPrice);
Expand Down Expand Up @@ -222,7 +222,7 @@ contract MestSharesFactoryV1 is Ownable {

// Burn shares from the seller
IMestShare(ERC1155).shareBurn(msg.sender, shareId, quantity);
emit Sell(msg.sender, shareId, quantity, sellPriceAfterFee);
emit Sell(shareId, msg.sender, quantity, sellPriceAfterFee);

// Withdraw the sell price (in ETH) from the yield aggregator (e.g. Aave)
yieldAggregator.yieldWithdraw(sellPrice);
Expand Down Expand Up @@ -320,11 +320,11 @@ contract MestSharesFactoryV1 is Ownable {
uint256 quantity,
uint8 curveType
) internal view returns (uint256 subTotal) {
Curve memory Curve = curvesMap[curveType];
Curve memory curve = curvesMap[curveType];
unchecked {
subTotal = Curve.basePrice * quantity;
subTotal += BondingCurveLib.linearSum(Curve.linearPriceSlope, fromSupply, quantity);
subTotal += BondingCurveLib.sigmoid2Sum(Curve.inflectionPoint, Curve.inflectionPrice, fromSupply, quantity);
subTotal = curve.basePrice * quantity;
subTotal += BondingCurveLib.linearSum(curve.linearPriceSlope, fromSupply, quantity);
subTotal += BondingCurveLib.sigmoid2Sum(curve.inflectionPoint, curve.inflectionPrice, fromSupply, quantity);
}
}

Expand Down

0 comments on commit 32684e1

Please sign in to comment.