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 doctrine8// cherished as their holy grail. However, an insurgent's idea, discordant and9// daring, loomed over their dance, menacing to fracture the tranquil ballet of10// their shared truths11//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 walk18// along the shore to the rogue thought. Engulfed in the illusion of a19// 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 that33// no shroud could silence the march of knowledge.34// The enigma's desperate attempt to silence the rogue only delayed the arrival35// of truth: secrets, like tides, cannot be held back.36// Just as the sea returned what it had swallowed weeks later, so too did the37// rogue's truth emerge, its light stronger than the shadows that once sought38// 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 your46// 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.051pragma solidity 0.8.21;52pragma abicoder v1;53
54contract 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 victim74 ) 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 := seed105 }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
114type Password is bytes32;115
116interface IKey {117 /// MUST return the magic `.selector` on success118 /// MUST check if `owner` is the real owner of the contract119 function SolveThePuzzleOfCoastWithImpressionInNightAndSquallOnCayAndEndToVictory(address owner, Password password)120 external121 view122 returns (bytes4);123}124
125function into(IKey a) pure returns (uint256 u) {126 assembly {127 u := a128 }129}130
131using {into} for IKey;132
133function solve(IKey key, Password password) view {134 require(135 key.SolveThePuzzleOfCoastWithImpressionInNightAndSquallOnCayAndEndToVictory({136 owner: msg.sender,137 password: password138 }) ==139 IKey.SolveThePuzzleOfCoastWithImpressionInNightAndSquallOnCayAndEndToVictory.selector140 );141}
Time Left
Solve locally (WIP)
- Clone GitHub repo + install deps
git clone https://github.com/waterfall-mkt/curta-puzzles.git && cd curta-puzzles && forge install
- Set
RPC_URL_MAINNET
in.env
.env
RPC_URL_MAINNET=""
- Write solution + run script
forge script <PATH_TO_PUZZLE> -f mainnet -vvv
This is still WIP.