Puzzle #17
Murder Mystery
Author
SoliditySolidity's logo.Puzzle
Curtacallsverify()
1
// The silence of the waves, a murder mystery by hrkrshnn and chatgpt.
2
//
3
// ,( ,( ,( ,( ,( ,( ,( ,( ,( ,( ,( ,( ,(
4
// `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `
5
//
6
// In an empire of whispered mysteries, a sovereign of riddles held sway.
7
// Devotees were tethered by the rhythmic tapestry of their belief, a doctrine
8
// cherished as their holy grail. However, an insurgent's idea, discordant and
9
// daring, loomed over their dance, menacing to fracture the tranquil ballet of
10
// their shared truths
11
//
12
// The rogue thought unveiled a truth too chaotic for their symphony.
13
// This revelation clashed with their sacred song, and the chorus turned sour.
14
// The enigma faced a critical choice, one that risked the harmony of their society.
15
//
16
// Under the moonlight's veil, a gathering was planned beside the sea.
17
// As the stars danced in rhythm with their chatter, the enigma suggested a walk
18
// along the shore to the rogue thought. Engulfed in the illusion of a
19
// private debate, the rogue was drawn away from the crowd.
20
//
21
// Their steps etched in the sands led them to a boat anchored near the water.
22
// With a tale linking the sea's vastness to the infinity of numbers,
23
// the enigma enticed the rogue to sail away from the shore.
24
// Once the familiar silhouette of the land was lost, the cordial mask fell.
25
// As accusations echoed and justifications drowned, the enigma's resolve held firm.
26
//
27
// With a nudge, the rogue was banished into the abyss.
28
// Alone, he grappled with the unforgiving sea, his breath fading into silent waves.
29
// The enigma returned alone, spinning a tale of the rogue's self-chosen solitude.
30
//
31
// However, the rogue's disruptive truth did not fade with his breath.
32
// It echoed louder, reaching distant ears, illuminating minds, proving that
33
// no shroud could silence the march of knowledge.
34
// The enigma's desperate attempt to silence the rogue only delayed the arrival
35
// of truth: secrets, like tides, cannot be held back.
36
// Just as the sea returned what it had swallowed weeks later, so too did the
37
// rogue's truth emerge, its light stronger than the shadows that once sought
38
// to hide it.
39
//
40
// ,( ,( ,( ,( ,( ,( ,( ,( ,( ,( ,( ,( ,(
41
// `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `
42
//
43
// Your quest is a riddle cloaked in shadow, a conundrum steeped in crimson.
44
// For the answers you seek, thrice must you tame the stubborn grains,
45
// shape them into silent whispers of truth, the trio of clues which in your
46
// hands become keys. Three witnesses of the tale, bound by what they've seen,
47
// await your discovery. In their words, the shrouded identities shall be unveiled:
48
// the one who breathed their last, and the one who stole the breath away.
49
50
// SPDX-License-Identifier: GPL-3.0
51
pragma solidity 0.8.21;
52
pragma abicoder v1;
53
54
contract MurderMystery {
55
bytes32 public constant hash =
56
0x243a084930ac8bf9c740908399bcad8a30578af6b2e77b8bccad3d8eb146bce1;
57
uint256 public constant solution =
58
44951118505582034238842936837745274349937753370161196589544078244217022840832;
59
60
mapping(address => bool) public solved;
61
62
function solve(
63
IKey sand,
64
Password p_sand,
65
IKey wave,
66
Password p_wave,
67
IKey shadow,
68
Password p_shadow,
69
uint256 witness1,
70
uint256 witness2,
71
uint256 witness3,
72
string memory killer,
73
string memory victim
74
) external {
75
solve(sand, p_sand);
76
solve(wave, p_wave);
77
solve(shadow, p_shadow);
78
79
uint256 $sand = sand.into();
80
uint256 $wave = wave.into();
81
uint256 $shadow = shadow.into();
82
uint256 $w1 = witness1;
83
uint256 $w2 = witness2;
84
uint256 $w3 = witness3;
85
86
unchecked {
87
require($w1 * $w2 * $w3 > 0);
88
require($sand != $wave);
89
require($wave != $shadow);
90
require($shadow != $sand);
91
require($sand ** $w1 > 0);
92
require($wave ** $w2 > 0);
93
require($w3 ** $shadow > 0);
94
require($sand ** $w1 + $wave ** $w2 == $w3 ** $shadow);
95
}
96
97
require(keccak256(bytes(string.concat(killer, victim))) == hash);
98
99
solved[msg.sender] = true;
100
}
101
102
function generate(address seed) external pure returns (uint256 ret) {
103
assembly {
104
ret := seed
105
}
106
}
107
108
function verify(uint256 _start, uint256 _solution) external view returns (bool) {
109
require(_solution == solution);
110
return solved[address(uint160(_start))];
111
}
112
}
113
114
type Password is bytes32;
115
116
interface IKey {
117
/// MUST return the magic `.selector` on success
118
/// MUST check if `owner` is the real owner of the contract
119
function SolveThePuzzleOfCoastWithImpressionInNightAndSquallOnCayAndEndToVictory(address owner, Password password)
120
external
121
view
122
returns (bytes4);
123
}
124
125
function into(IKey a) pure returns (uint256 u) {
126
assembly {
127
u := a
128
}
129
}
130
131
using {into} for IKey;
132
133
function solve(IKey key, Password password) view {
134
require(
135
key.SolveThePuzzleOfCoastWithImpressionInNightAndSquallOnCayAndEndToVictory({
136
owner: msg.sender,
137
password: password
138
}) ==
139
IKey.SolveThePuzzleOfCoastWithImpressionInNightAndSquallOnCayAndEndToVictory.selector
140
);
141
}
First Blood
jinu.eth
04:29:36
45
Time Left

Solve locally (WIP)

  1. Clone GitHub repo + install deps
git clone https://github.com/waterfall-mkt/curta-puzzles.git && cd curta-puzzles && forge install
  1. Set RPC_URL_MAINNET in .env
.env
RPC_URL_MAINNET=""
  1. Write solution + run script
forge script <PATH_TO_PUZZLE> -f mainnet -vvv
This is still WIP.
Waterfall