Created
May 6, 2022 17:57
-
-
Save ilamanov/c44cacda5ebb4cb67fd7180ff9fd3075 to your computer and use it in GitHub Desktop.
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
contract MarketDownBad { | |
uint256 public supply = 1; | |
uint256 public lastSoldPrice; | |
function price() public view returns (uint256) { | |
return 1000 / supply; | |
} | |
function panicSell() public { | |
lastSoldPrice = price(); | |
supply += 13; | |
checkMarketTemperature(); | |
} | |
function checkMarketTemperature() public { | |
if (price() < lastSoldPrice) { | |
panicSell(); | |
} | |
} | |
function crashTheMarket() public { | |
panicSell(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment