-
Notifications
You must be signed in to change notification settings - Fork 0
/
Calyptus461.sol
28 lines (22 loc) · 1.04 KB
/
Calyptus461.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
// https://x.com/calyptus_web3/status/1854792033338102041
/* Our smart contract is tracking snacks in the “highly secure” Corporate Snack Vault.
Here, employees (obviously innocent) “reserve” snacks that mysteriously disappear within minutes.
When management finds out, they try to delete all records of snack activity to avoid accountability.
Will they be able to do this?
*/
contract SnackScandal {
struct SnackVault {
uint256 snackLevel; // the number of snacks currently in the vault (supposedly)
mapping (uint256 => address) snackHistory; // who took which snack, according to vault logs
}
SnackVault public vaultData;
function snackTime() external {
vaultData.snackLevel = 5; // freshly stocked vault, 5 delicious snacks ready
vaultData.snackHistory[1] = msg.sender; // employee #1 "claims" a snack
}
function eraseTheEvidence() external {
delete vaultData; // attempt to clear the snack records to avoid HR
}
}