Skip to content

Instantly share code, notes, and snippets.

@ilamanov
Created May 6, 2022 17:57
Show Gist options
  • Save ilamanov/c44cacda5ebb4cb67fd7180ff9fd3075 to your computer and use it in GitHub Desktop.
Save ilamanov/c44cacda5ebb4cb67fd7180ff9fd3075 to your computer and use it in GitHub Desktop.
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