-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
carbon pol eth conversion - minor fix
- Loading branch information
1 parent
a2bc3a4
commit 7640d90
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,7 +191,9 @@ contract CarbonPOL is ICarbonPOL, Upgradeable, ReentrancyGuardUpgradeable, Utils | |
function enableTradingETH(Price memory price) external onlyAdmin validPrice(price) { | ||
_tradingStartTimes[NATIVE_TOKEN] = uint32(block.timestamp); | ||
_initialPrice[NATIVE_TOKEN] = price; | ||
_ethSaleAmount.current = _ethSaleAmount.initial; | ||
_ethSaleAmount.current = address(this).balance > _ethSaleAmount.initial | ||
This comment has been minimized.
Sorry, something went wrong. |
||
? _ethSaleAmount.initial | ||
: uint128(address(this).balance); | ||
emit TradingEnabled(NATIVE_TOKEN, price); | ||
} | ||
|
||
|
@@ -410,7 +412,9 @@ contract CarbonPOL is ICarbonPOL, Upgradeable, ReentrancyGuardUpgradeable, Utils | |
|
||
// check if the new sale amount is below the current available eth sale amount | ||
if (newEthSaleAmount < _ethSaleAmount.current) { | ||
This comment has been minimized.
Sorry, something went wrong.
lbeder
Collaborator
|
||
_ethSaleAmount.current = newEthSaleAmount; | ||
_ethSaleAmount.current = address(this).balance > newEthSaleAmount | ||
? newEthSaleAmount | ||
: uint128(address(this).balance); | ||
} | ||
|
||
emit EthSaleAmountUpdated(prevEthSaleAmount, newEthSaleAmount); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Super nitpick: you can use
Math.min
in all these references