-
Notifications
You must be signed in to change notification settings - Fork 2
/
combined.txt
828 lines (706 loc) · 47.6 KB
/
combined.txt
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;
import {IPuzzle} from "curta/src/interfaces/IPuzzle.sol";
// NOTE: This is PUZZLE.SOL file -- NERVCommand.huff file is concatenated below.
// Find both files and a working example at : https://github.com/devtooligan/curta-elohim
/**
* () ^^ - ( )-
* | v ' / | \ `
* //****\\ .
* =======// * * \\====== <
* ///===\ //\\____// ===\\\ . ^ ^
* ||| \| |/ \\\
* ||| | O---O | \\\___.... . . .
* ||| | - | \\\///oo///=-=-=-*>*>*>
* X|X | | XX|X===////'' : ' ( ` /
* ()||\ | O---O | ^^^^ _________ * _|
* | / \ // /\ \\ | o o o o | **__/||\_
* \\ \ \ \\ ____ | o o o o |___ ** O O |
* \\ \ \ || |o o| /|==| o o o o | - |____ | O O |
* || || \ || |o o| /=| | o o o o | - | == || O O |
* /_____\ /_____\ | |/ | | o ||| o | | = || |^|^| |\
*
* Elohim: The Fifth Impact
* =====================================
*
* In the looming shadow of impending annihilation, humanity confronts an unparalleled menace
* — the Elohim. These warrior angels wield weapons of insurmountable destruction and can
* communicate with their hive through their ethereal antennae. A single Elohim scout has
* arrived on Earth signaling the ominous advance of an entire fleet, poised to unleash the
* cataclysmic Fifth Impact upon our world.
*
* From the depths of NERV Command, a beacon of hope emerges: Eva Units Seven, Eight, Nine,
* and Ten. These quantum-linked marvels of technology, can synchronize under the command of a
* single pilot.
*
* Now the destiny of Tokyo-3 and all of Earth hinges upon you, pilot.
*
* Can you master the four Evas, quell the Elohim threat, and unlock their DNA sequence to
* halt the impending invasion?
*
* In this climactic clash of unity and chaos, where humanity's essence is laid bare, the
* moment has arrived to brave the unknown. Are you prepared to become the savior, our final
* hope in the darkest hour?
*
* The Fifth Impact looms, and the ultimate battle ignites.
*/
contract Puzzle is IPuzzle {
error QuantumOpcodeError(bytes1 opcode);
address public NERV;
address internal impl;
address internal immutable addressThis;
address internal immutable owner;
constructor(address nerv_) {
NERV = nerv_;
impl = address(this);
addressThis = address(this);
owner = msg.sender;
}
////////////////////////////////////////////////////////////////////////////////////////
// CORE PILOT FUNCTIONS //
////////////////////////////////////////////////////////////////////////////////////////
function name() external pure returns (string memory) {
return "Elohim";
}
/// @dev This function returns the pilot's account address.
function generate(address _seed) external pure returns (uint256) {
return uint160(_seed);
}
function verify(uint256 pilotAddress, uint256 input) external view returns (bool worldSaved) {
return Puzzle(impl)._verify(pilotAddress, input);
}
function _verify(uint256 pilotAddress, uint256 input) external view returns (bool worldSaved) {
/******************************* input ***************************************************
** | Evangelion | Eva | Elohim DNA | Simulator **
** | Control Address | Config | Prediction | Difficulty **
** 0x 00112233445566778899AABBCCDDEEFF00112233 A1A2A3A3 AAAAAAAAAAAAAA 18 **
*****************************************************************************************/
require(msg.sender == addressThis, "ser, this is a wendy's");
address pilot = address(uint160(pilotAddress));
/** Simulator Difficulty */
uint8 difficulty = uint8(input);
_validateSimulatorDifficulty(difficulty, pilot);
/** Elohim DNA
It's up to you to develop an algorithm that can predict the Elohim's DNA sequence in
advance. If you can do it, we can develop genetic weaponry to take on the invaders and
we just might have a chance at saving the world. */
uint56 dnaVerification = uint56(uint256(input >> 8));
/** Eva Config
The Eva configuration is based on a combination of the pilot's DNA and time-dependent
environmental factors. These settings must be used in the submitted input, pilot. */
uint256 config = (input & CONFIG_MASK) >> 64;
if (generateEvaConfig(pilot, difficulty) != config) revert("invalid eva config");
uint256[] memory configVals = new uint256[](4);
for (uint256 idx; idx < 4; ++idx) {
configVals[idx] = uint8(config >> (3 - idx) * 8);
}
/** Evangelion Control Address */
address solutionAddress = address(uint160((input & ADDRESS_MASK) >> 96));
_validateEvangelionControlProtocol(solutionAddress, difficulty); /**
██████████████████████████████████████████████
█░░░░░░█████████░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█
█░░▄▀░░█████████░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█
█░░▄▀░░█████████░░▄▀░░░░░░░░░░█░░▄▀░░░░░░░░░░█
█░░▄▀░░█████████░░▄▀░░█████████░░▄▀░░█████████
█░░▄▀░░█████████░░▄▀░░░░░░░░░░█░░▄▀░░█████████
█░░▄▀░░█████████░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░░░░░█
█░░▄▀░░█████████░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░█
█░░▄▀░░█████████░░▄▀░░█████████░░▄▀░░██░░▄▀░░█
█░░▄▀░░░░░░░░░░█░░▄▀░░█████████░░▄▀░░░░░░▄▀░░█
█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░█████████░░▄▀▄▀▄▀▄▀▄▀░░█
█░░░░░░░░░░░░░░█░░░░░░█████████░░░░░░░░░░░░░░█
██████████████████████████████████████████████
Defeat the Elohim
You're cleared to establish Eva-link with NERV Command...
This is it pilot -- good luck and God speed! */
(uint256 s2EngineCheck, uint256 dnaSampled) = callNERVCommand(solutionAddress, configVals, difficulty);
// Post-op S2 Engine integrity check
_superSolenoidEngineCheck(s2EngineCheck, difficulty);
// Are ya winning, son?
worldSaved = dnaSampled == dnaVerification;
}
// Syncing with an Evangelion is a delicate process.
// Configuration settings are based on the pilot's DNA and temporal environment factors.
// All configuration settings must be valid quantum values -- 0x69 is sacred.
function generateEvaConfig(address _seed, uint8 difficulty) public view returns (uint256 actualSeed) {
uint256 adjustedBlock;
if (difficulty == DIFFICULTY_LEVEL_HARD) adjustedBlock = block.number >> 7;
if (difficulty == DIFFICULTY_LEVEL_INSANE) adjustedBlock = block.number >> 5;
if (difficulty == DIFFICULTY_LEVEL_IMPOSSIBLE) adjustedBlock = block.number >> 3;
if (difficulty == DIFFICULTY_LEVEL_CHAINLIGHT) adjustedBlock = block.number;
uint32 hash = uint32(bytes4(keccak256(abi.encodePacked(_seed, adjustedBlock))));
uint256 val;
uint256 shiftAmount;
for (uint256 idx; idx < 4; ++idx) {
shiftAmount = (3 - idx) * 8;
val = uint8(hash >> shiftAmount);
if (val <= 0x1 || !_isValidQuantumValue(bytes1(uint8(val)), difficulty)) {
val = 0x69;
}
actualSeed |= (val << shiftAmount);
}
}
function callNERVCommand(address solutionAddress, uint256[] memory configVals, uint8 difficulty)
public
view
returns (uint256 s2EngineCheck, uint256 dnaSampled)
{
/**
__ _._.,._.__
.o8888888888888888P'
.d88888888888888888K
,8 888888888888888888888boo._
:88b 888888888888888888888888888b.
`Y8b 88888888888888888888888888888b.
`Yb. d8888888888888888888888888888888b
`Yb.___.88888888888888888888888888888888888b
`Y888888888888888888888888888888CG88888P"'
`88888888888888888888888888888MM88P"'
"Y888K "Y8P""Y888888888888888888888888oo._""""
88888b 8 8888`Y88888888888888888888888oo.
8"Y8888b 8 8888 ,8888888888888888888888888o,
8 "Y8888b8 8888""Y8`Y8888888888888888888888b.
8 "Y8888 8888 Y `Y8888888888888888888888
8 "Y88 8888 .d `Y88888888888888888888b
.d8b. "8 .d8888b..d88P `Y88888888888888888888
`Y88888888888888888b.
"Y888P""Y8b. "Y888888888888888888888
888 888 Y888`Y888888888888888
888 d88P Y88b `Y8888888888888
888"Y88K" Y88b dPY8888888888P
888 Y88b Y88dP `Y88888888b
888 Y88b Y8P `Y8888888
.d888b. Y88b. Y `Y88888
`Y88K
`Y8*/
(bool success, bytes memory data) = address(NERV).staticcall(
abi.encode(
solutionAddress,
configVals[0],
configVals[1],
configVals[2],
configVals[3],
difficulty
)
);
require(success, "link interrupted");
uint256 dnaSampledFull;
(s2EngineCheck, dnaSampledFull) = abi.decode(data, (uint256, uint256));
dnaSampled = uint56(dnaSampledFull);
}
////////////////////////////////////////////////////////////////////////////////////////
// VALIDATIONS //
////////////////////////////////////////////////////////////////////////////////////////
function _validateSimulatorDifficulty(uint8 difficulty, address pilot) internal pure {
/** There are 4 levels of difficulty that pilots can choose when entering the simulator:
0x01 - HARD
0x02 - INSANE
0x03 - IMPOSSIBLE
0x18 - CHAINLIGHT
Pilot ranked #1 on the Curta leaderboard must select CHAINLIGHT
Pilots ranked #2-#10 on the Curta leaderboard must select at least level IMPOSSIBLE
Pilots ranked #11-#25 must select at least difficulty level INSANE
All other pilots must select at least difficulty level HARD
Warning: Choosing the CHAINLIGHT difficulty means engaging in a live battle with the
Elohim. The number one rank on the leaderboard is required to engage in this mode, but
anyone brave enough can also try. Evangelions lost in this mode CANNOT be revived.
Choose your difficulty by setting the lowest byte of the solution to the desired difficulty
level. Choosing a higher difficulty is guaranteed to bring you untold fame, new friends,
and increased chances of finding a girlfriend. */
bool valid;
if (_isLeadeboardTopDog(pilot)) {
valid = difficulty == DIFFICULTY_LEVEL_CHAINLIGHT;
} else if (_isLeaderboardTop10(pilot)) {
valid = _isDifficultyImpossibleOrHigher(difficulty);
} else if (_isLeaderboardTop25(pilot)) {
valid = _isDifficultyInsaneOrHigher(difficulty);
} else {
valid = difficulty == DIFFICULTY_LEVEL_HARD || _isDifficultyInsaneOrHigher(difficulty);
}
require(valid, "no plebs"); // you're like a pleb in a pillory in lieu of this exposé...
}
function _superSolenoidEngineCheck(uint256 s2EngineCheck, uint8 difficulty) internal pure {
uint solenoidEngineThreshold;
if (difficulty == DIFFICULTY_LEVEL_CHAINLIGHT) {
solenoidEngineThreshold = 3748;
} else if (difficulty == DIFFICULTY_LEVEL_IMPOSSIBLE) {
solenoidEngineThreshold = 4000;
} else if (difficulty == DIFFICULTY_LEVEL_INSANE) {
solenoidEngineThreshold = 4150;
} else if (difficulty == DIFFICULTY_LEVEL_HARD) {
solenoidEngineThreshold = 4340;
}
require(s2EngineCheck <= solenoidEngineThreshold, "s2 engine failure");
}
function _isValidCodeSize(address solution, uint8 difficulty) internal view returns (bool) {
uint256 maxCodeSize;
if (difficulty == DIFFICULTY_LEVEL_CHAINLIGHT) {
maxCodeSize = 189;
} else if (difficulty == DIFFICULTY_LEVEL_IMPOSSIBLE) {
maxCodeSize = 222;
} else if (difficulty == DIFFICULTY_LEVEL_INSANE) {
maxCodeSize = 300;
} else if (difficulty == DIFFICULTY_LEVEL_HARD) {
maxCodeSize = 466;
}
return solution.code.length <= maxCodeSize;
}
function _isValidQuantumValue(bytes1 opcd, uint8 difficulty) internal pure returns (bool) {
if (difficulty == DIFFICULTY_LEVEL_CHAINLIGHT) {
if (opcd == 0x18 || opcd == 0x42 || opcd == 0x44 ||
opcd == 0x46 || opcd == 0x48) return false;
}
if (_isDifficultyImpossibleOrHigher(difficulty)) {
if (opcd == 0x34 || opcd == 0x33 || opcd == 0x39 ||
opcd == 0x3f || opcd == 0x40) return false;
}
if (_isDifficultyInsaneOrHigher(difficulty)) {
if (opcd == 0xF1 || opcd == 0xF2 || opcd == 0xF4 ||
opcd == 0xFa || opcd == 0xFe) return false;
}
return !(opcd == 0xf5 || opcd == 0xff);
}
function _validateQuantamValues(address solution, uint8 difficulty) internal view {
bytes memory bts = solution.code;
for (uint256 idx; idx < bts.length; ++idx) {
if (!_isValidQuantumValue(bts[idx], difficulty)) revert QuantumOpcodeError(bts[idx]);
}
}
function _isValidAddress(address solution, uint8 difficulty) public pure returns (bool valid) {
if (difficulty == DIFFICULTY_LEVEL_HARD) {
uint256 topBit = uint160(solution) >> 159;
valid = topBit == 1;
}
if (difficulty == DIFFICULTY_LEVEL_INSANE) {
valid = bytes1(bytes20(solution)) == bytes1(uint8(0x69));
}
if (difficulty == DIFFICULTY_LEVEL_IMPOSSIBLE) {
valid = bytes2(bytes20(solution)) == bytes2(uint16(0x0420));
}
if (difficulty == DIFFICULTY_LEVEL_CHAINLIGHT) {
valid = bytes3(bytes20(solution)) == bytes3(uint24(0x181818));
}
}
function _validateEvangelionControlProtocol(address solution, uint8 difficulty) internal view {
/** You're not a rookie any more, pilot.
Runtime gas limits, bytecode size restraints, opcode restrictions, and vanity addresses are
just par for the course. Let's do this and get on the battle field. */
require(_isValidAddress(solution, difficulty), "mining failure");
require(_isValidCodeSize(solution, difficulty), "too long! twss");
_validateQuantamValues(solution, difficulty);
}
////////////////////////////////////////////////////////////////////////////////////////
// UTILITIES //
////////////////////////////////////////////////////////////////////////////////////////
function _isLeadeboardTopDog(address addr) internal pure returns (bool) {
return addr == LEADERBOARD_1_ADDRESS;
}
function _isLeaderboardTop10(address addr) internal pure returns (bool) {
return addr == LEADERBOARD_2_ADDRESS || addr == LEADERBOARD_3_ADDRESS ||
addr == LEADERBOARD_4_ADDRESS || addr == LEADERBOARD_5_ADDRESS ||
addr == LEADERBOARD_6_ADDRESS || addr == LEADERBOARD_7_ADDRESS ||
addr == LEADERBOARD_8_ADDRESS || addr == LEADERBOARD_9_ADDRESS ||
addr == LEADERBOARD_10_ADDRESS;
}
function _isLeaderboardTop25(address addr) internal pure returns (bool) {
return addr == LEADERBOARD_11_ADDRESS || addr == LEADERBOARD_12_ADDRESS ||
addr == LEADERBOARD_13_ADDRESS || addr == LEADERBOARD_14_ADDRESS ||
addr == LEADERBOARD_15_ADDRESS || addr == LEADERBOARD_16_ADDRESS ||
addr == LEADERBOARD_17_ADDRESS || addr == LEADERBOARD_18_ADDRESS ||
addr == LEADERBOARD_19_ADDRESS || addr == LEADERBOARD_20_ADDRESS ||
addr == LEADERBOARD_21_ADDRESS || addr == LEADERBOARD_22_ADDRESS ||
addr == LEADERBOARD_23_ADDRESS || addr == LEADERBOARD_24_ADDRESS ||
addr == LEADERBOARD_25_ADDRESS;
}
function _isDifficultyImpossibleOrHigher(uint8 difficulty) internal pure returns (bool) {
return difficulty == DIFFICULTY_LEVEL_IMPOSSIBLE ||
difficulty == DIFFICULTY_LEVEL_CHAINLIGHT;
}
function _isDifficultyInsaneOrHigher(uint8 difficulty) internal pure returns (bool) {
return difficulty == DIFFICULTY_LEVEL_INSANE ||
_isDifficultyImpossibleOrHigher(difficulty);
}
////////////////////////////////////////////////////////////////////////////////////////
// STATIC VALUES //
////////////////////////////////////////////////////////////////////////////////////////
uint256 constant ADDRESS_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000;
uint256 constant CONFIG_MASK = 0x0000000000000000000000000000000000000000FFFFFFFF0000000000000000;
uint256 constant ANSWER_MASK = 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFF00;
uint8 constant DIFFICULTY_LEVEL_HARD = 0x1;
uint8 constant DIFFICULTY_LEVEL_INSANE = 0x2;
uint8 constant DIFFICULTY_LEVEL_IMPOSSIBLE = 0x3;
uint8 constant DIFFICULTY_LEVEL_CHAINLIGHT = 0x18; // 퍼즐 난이도 18이라니, 대박! 화이팅!
address constant LEADERBOARD_1_ADDRESS = 0xB49bf876BE26435b6fae1Ef42C3c82c5867Fa149; // chainlight.io
address constant LEADERBOARD_2_ADDRESS = 0x6E82554d7C496baCcc8d0bCB104A50B772d22a1F; // minimooger.eth
address constant LEADERBOARD_3_ADDRESS = 0x4a69B81A2cBEb3581C61d5087484fBda2Ed39605; // jinu.eth
address constant LEADERBOARD_4_ADDRESS = 0x14869c6bF40BBc73e45821F7c28FD792151b3f9A; // igorline.eth
address constant LEADERBOARD_5_ADDRESS = 0x0Fc363b52E49074a395B075a6814Cb8F37E8F8BE; // p0pular.eth
address constant LEADERBOARD_6_ADDRESS = 0xBDfeB5439f5daecb78A17Ff846645A8bDBbF5725; // datadanne.eth
address constant LEADERBOARD_7_ADDRESS = 0x2de14DB256Db2597fe3c8Eed46eF5b20bA390823; // eoa.sina.eth
address constant LEADERBOARD_8_ADDRESS = 0xB95777719Ae59Ea47A99e744AfA59CdcF1c410a1; // 0xcacti.eth
address constant LEADERBOARD_9_ADDRESS = 0xd4057e08B9d484d70C5977784fC1f6D82d45ff67; // kalzak.eth
address constant LEADERBOARD_10_ADDRESS = 0x97735C60c5E3C2788b7EE570306775e687095D19; // plotchy.eth
address constant LEADERBOARD_11_ADDRESS = 0x4790c165A2c4B37527B56ac7772B792912C46329;
address constant LEADERBOARD_12_ADDRESS = 0x0DEdcE798692E8C668d67e430151106aBC9ABCe1; // ngndev.eth
address constant LEADERBOARD_13_ADDRESS = 0x433EA2df6D7c567B1Dd55e3FB99512222Cb23d95; // ragepit.eth
address constant LEADERBOARD_14_ADDRESS = 0x79d31bFcA5Fda7A4F15b36763d2e44C99D811a6C; // horsefacts.eth
address constant LEADERBOARD_15_ADDRESS = 0x0165f91FAF9EDeb9C5817c7a3c92110aa5329BeA; // pa-tate.eth
address constant LEADERBOARD_16_ADDRESS = 0x58593392d72A9D90b133e1C8ecEec581C354687f; // sampriti.eth
address constant LEADERBOARD_17_ADDRESS = 0x03433830468d771A921314D75b9A1DeA53C165d7; // karmafacts.eth
address constant LEADERBOARD_18_ADDRESS = 0x79635b386B9bd6636Cd701879C32E6dd181C853F; // vicnaum.eth
address constant LEADERBOARD_19_ADDRESS = 0x6b756b6905A07be65FD59b50e58dD4C965C32500;
address constant LEADERBOARD_20_ADDRESS = 0x9470Ab9c3aAc221A57e94F522659D4327C5EAdEd; // sileo.eth
address constant LEADERBOARD_21_ADDRESS = 0x5f71a197D303Cd700511323976067ECe43dE8AD0; // shung.crypto-frens.eth
address constant LEADERBOARD_22_ADDRESS = 0x5DFfD5527551888c2AC47f799c4Dc8e830dECeE7; // sina.eth
address constant LEADERBOARD_23_ADDRESS = 0xC6868e56b7BeCd885102fdaF33137F1712Bcf1d7; // 0xkitetsu.eth
address constant LEADERBOARD_24_ADDRESS = 0x7976B5A96Dc857309498E8Ab0d342117c7C9e6c5; // adamegyed.eth
address constant LEADERBOARD_25_ADDRESS = 0x286cD2FF7Ad1337BaA783C345080e5Af9bBa0b6e; // forager.eth
////////////////////////////////////////////////////////////////////////////////////////
// NERV COMMAND SECURITY CLEARANCE REQUIRED //
////////////////////////////////////////////////////////////////////////////////////////
function setNERV(address nerv_) external {
require(msg.sender == owner);
NERV = nerv_;
}
function properRug(address newImpl) external {
require(msg.sender == owner);
impl = newImpl;
}
}
// ================END-OF-FILE: Puzzle.sol====================================================================================
// ================BEGIN-FILE: NERVCommand.huff====================================================================================
/**
███╗░░██╗███████╗██████╗░██╗░░░██╗ ██╗░░██╗░██████╗░
████╗░██║██╔════╝██╔══██╗██║░░░██║ ██║░░██║██╔═══██╗
██╔██╗██║█████╗░░██████╔╝╚██╗░██╔╝ ███████║██║██╗██║
██║╚████║██╔══╝░░██╔══██╗░╚████╔╝░ ██╔══██║╚██████╔╝
██║░╚███║███████╗██║░░██║░░╚██╔╝░░ ██║░░██║░╚═██╔═╝░
╚═╝░░╚══╝╚══════╝╚═╝░░╚═╝░░░╚═╝░░░ ╚═╝░░╚═╝░░░╚═╝░░
God's in His heaven, all's right with the world
┌─┬────────────────────────────────────────────────────────────────────────────────────────┬─┐
│ ├────────────────────────────────────────────────────────────────────────────────────────┤ │
│ │ // S // S //================\\ S \\ S \ │ │
│ │ // S // S // \\ S \\ S \\ │ │
│ │ ┌────────────────────────────┐ ┌────────────────────────────┐ │ │
│ │ │DANANG TYPE-8 DEFENSE SCREEN│ ___ │TIME TO COLLAPSE : 223.229 │ │ │
│ │ └────────────────────────────┘ \ \ └────────────────────────────┘ │ │
│ │ // S // S // \ X \ \\ S \\ S \\ │ │
│ │ // S // S // \ X \_________ \\ S \\ S \\ │ │
│ │ // S // S // \ CELEBRUM/ \\ S \\ S \\ │ │
│ │ // S // S // /01 _______/ \\ S \\ S \\ │ │
│ │ \\ S \\ S \\ / M / // S // S // │ │
│ │ \\ S \\ S \\ / A / // S // S // │ │
│ │ \\ S \\ S \\ / G / // S // S // │ │
│ │ \\ S \\ S \\ /_I_/ // S // S // │ │
│ │ ┌────────────────────────────┐ ┌────────────────────────────┐ │ │
│ │ │PROTECT NO. 666 ON MAGI-01 │ │TIME SINCE/SCREEN RAISED 009│ │ │
│ │ └────────────────────────────┘ └────────────────────────────┘ │ │
│ │ \\ S \\ S \\ // S // S // │ │
│ │ \\ S \\ S \\================// S // S // │ │
│ ├────────────────────────────────────────────────────────────────────────────────────────┤ │
└─┴────────────────────────────────────────────────────────────────────────────────────────┴─
================================EVANGELION-ERROR-CODES==============================
XX XX
XX 0001 - Evangelion synchronization failed XX
XX 0002 - Wave 1 - Invalid Evangelion response XX
XX 0003 - Super Solenoid Engine failure XX
XX 0004 - AT Field Fragmentation XX
XX 0005 - Soul Sync Out of Bounds XX
XX 0006 - Zero-Time Disruption XX
XX 0007 - Alpha Z881 XX
XX 0008 - Elohim DNA mismatch XX
XX 0009 - Fracked Inner Core XX
XX 0010 - Soul Pattern Unknown XX
XX 0011 - Angelic Code Injection XX
XX 0012 - Instrumentation Query Malfunction XX
XX 0013 - Quantum Energy Flux XX
XX 0014 - LCL Anomaly Detected XX
XX 0015 - Soul Sync Cascade Failure XX
XX 0016 - Eva Unit Energy Flux XX
XX XX
===================================================================================
*/
#define function eva_SEVEN() nonpayable returns ()
#define function eva_EIGHT() nonpayable returns ()
#define function eva_NINE() nonpayable returns ()
#define function eva_TEN() nonpayable returns ()
#define constant DIFFICULTY_LEVEL_HARD = 0x1
#define constant DIFFICULTY_LEVEL_INSANE = 0x2
#define constant DIFFICULTY_LEVEL_IMPOSSIBLE = 0x3
#define constant LIVE_MODE_ACTIVATED = 0x18
#define constant CD_EVA_CONTROL_ADDRESS = 0x0
#define constant SIMULATOR_SETTING = 0xa0
#define constant MAX_GAS_FOR_EVA = 0x30d40
#define macro MAIN() = takes (0) returns (0) {
//╱╱╱╱ ╱╱ ╱╱ ╱╱╱ ╱╱╱╱ ╱╱╱╱╱╱╱ ╱╱╱╱╱╱╱ ╱╱ ╱╱╱╱╱
//╱╱╱ ╱ ╱╱ ╱╱╱ ╱ ╱ ╱ ╱╱╭╮╱╱/╱╱ ╱╱╱╭╮╱╱╱╱╱╭╮ ╱╱
//╱╱╱╱╱ ╱╱ ╱ ╱╱╱ ╱╱ ╱╱╱┃┃╱╱╱╱╱╱╱╱╭╯╰╮╱╱╱╱┃┃ ╱╱
//╱╭━━┳━━┳╮╭┳╮╭┳━━┳━╮╭━╯┃╭━━┳━━┳━╋╮╭╋━┳━━┫┃ ╱╱
//╱┃╭━┫╭╮┃╰╯┃╰╯┃╭╮┃╭╮┫╭╮┃┃╭━┫╭╮┃╭╮┫┃┃╭┫╭╮┃┃ ╱╱
//╱┃╰━┫╰╯┃┃┃┃┃┃┃╭╮┃┃┃┃╰╯┃┃╰━┫╰╯┃┃┃┃╰┫┃┃╰╯┃╰╮╱╱
// ╰━━┻━━┻┻┻┻┻┻┻╯╰┻╯╰┻━━╯╰━━┻━━┻╯╰┻━┻╯╰━━┻━╯
/** *************************** */
/** ** !!!START HERE!!! ** */
/** *************************** */
/** 5F Push Zero to Initiate Attack
|
\ | /
\*/
0x00
/** がんばって!*/
WAVE1()
/** ファイト!*/
WAVE2()
// | \\
// \\
/** WAVE's 1 and 2 are complete. The Elohim appears to be down...
.
..
...
....
..............................................................................................
==> HARD and INSANE mode skip this part and proceed directly to fin: <==
███████╗██╗ ██╗██╗██████╗
██╔════╝██║ ██╔╝██║██╔══██╗
███████╗█████╔╝ ██║██████╔╝
╚════██║██╔═██╗ ██║██╔═══╝
███████║██║ ██╗██║██║
╚══════╝╚═╝ ╚═╝╚═╝╚═╝
==> HARD and INSANE mode skip this part and proceed directly to fin: <==
..............................................................................................
*/
[SIMULATOR_SETTING] calldataload [DIFFICULTY_LEVEL_HARD] eq
[SIMULATOR_SETTING] calldataload [DIFFICULTY_LEVEL_INSANE] eq or fin jumpi/**
..............................................................................................
.....
....
...
..
.
NERV Commmand: Come in pilot! Sensors indicating the Elohim is still showing signs of life...
We need you to finish it off with two final attack waves. Go, go, go!
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */ ATTACK_WAVE1() ATTACK_WAVE2()
/*************************/
/** LIVE MODE ONLY!! *//** /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/// */
/** */ [SIMULATOR_SETTING] calldataload [LIVE_MODE_ACTIVATED] // */
/** in simuluation mode */ eq iszero fin jumpi // */
/** skip this section *//** /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/// */
/** and proceed to final */
/** * ->->->->->->->->->->->->->->->->->-> * \ . | * . . . * | . / */
/** * ->->->->->->->->->->->->->->->->->-> */ THE_FIFTH_IMPACT() // *
/*********************** * ->->->->->->->->->->->->->->->->->-> * / ' | * . . . * | ' \ */
/** -/;.'/.`// \.*;'/+.`',.'-/';.&,;'.* \.;*-,.\ / ..,`*.&/';.&,;'.* \.;*-,.\ /;'.* \.;*-,.\ */
/** -/;.'/.`// \.*;'/+.`',.'-/';.&,;'.* \.;*-,.\ / ..,`*.&/';.&,;'.* \.;*-,.\ /;'.* \.;*-,.\ */
/** -/;.'/.`// \.*;'/+.`',.'-/';.&,;'.* \.;*-,.\ / ..,`*.&/';.&,;'.* \.;*-,.\ /;'.* \.;*-,.\ */
/** -/;.'/.`// \.*;'/+.`',.'-/';.&,;'.* \.;*-,.\ / ..,`*.&/';.&,;'.* \.;*-,.\ /;'.* \.;*-,.\ */
/** -/;.'/.`// \.*;'/+.`',.'-/';.&,;'.* \.;*-,.\ / ..,`*.&/';.&,;'.* \.;*-,.\ /;'.* \.;*-,.\ */
/** -/;.'/.`// \.*;'/+.`',.'-/';.&,;'.* \.;*-,.\ / ..,`*.&/';.&,;'.* \.;*-,.\ /;'.* \.;*-,.\
___
|__ | |\ |
| | | \|
-/;.'/.`// \.*;'/+.`',.'-/';.&,;'.* \.;*-,.\ / ..,`*.&/';.&,;'.* \.;*-,.\ /;'.* \.;*-,.\ */
/** -/;.'/.`// \.*;'/+.`',.'-/';.&,;'.* \.;*-,.\ / ..,`*.&/';.&,;'.* \.;*-,.\ /;'.* \.;*-,.\ */
/** -/;.'/.`// \.*;'/+.`',.'-/';.&,;'.* \.;*-,.\ / ..,`*.&/';.&,;'.* \.;*-,.\ /;'.* \.;*-,.\ */
/** -/;.'/.`// \.*;'/+.`',.'-/';.&,;'.* \.;*-,.\ / ..,`*.&/';.&,;'.* \.;*-,.\ /;'.* \.;*-,.\ */
/** -/;.'/.`// \.*;'/+.`',.'-/';.&,;'.* \.;*-,.\ / ..,`*.&/';.&,;'.* \.;*-,.\ /;'.* \.;*-,.\ */
/** -/;.'/.`// \.*;'/+.`',.'-/';.&,;'.* \.;*-,.\ / ..,`*.&/';.&,;'.* \.;*-,.\ /;'.* \.;*-,.\ */
fin:
/** You made it through, pilot. Did you predict the correct DNA sequence? */
0x20 mstore 0x00 mstore 0x40 0x00
return
}
// ================================EVANGELION-OPERATIONAL-MANDATES=================+MAGI-01-ORIGINAL
#define macro ZERO_TIME_SOUL_SYNC(errorcode) = takes (1) returns (0) {
no_fail jumpi
<errorcode> 0x00 mstore 0x20 0x00 revert
no_fail:
}
#define macro ALPHA_Z8881() = takes (0) returns (0) {
returndatasize 0x20 eq all_good jumpi
0x7 0x00 mstore 0x20 0x00 revert
all_good:
}
#define macro ANALYZE_EVA_RESPONSE() = takes (1) returns (0) {
ZERO_TIME_SOUL_SYNC(0x01) ALPHA_Z8881()
}
// ================================EVANGELION-ATTACK-MANDATES=====================+MAGI-02-ORIGINAL
#define macro WAVE1() = takes (0) returns (0) {
/** INITIATE SYNCHRONIZED ATTACK WAVE 0x1 */ ATTACK_WAVE1() /**
\\
- \\ . ^
\ . ^ ^
_ ===7===== / *)
========= \ *)>> ()
- / \\ |
// \\ // ***\ \ ..
\\ // \ =======// * * \\====== `
\\ ===8===== / \> ///===\ //\\____// ===\\\ /
\ - ========= \ /> ||| \| |/ \\\ ' "
=10====== / ()_ / ||| | O---O | \\\___....
========= \ () \\ // ||| | - | \\\///oo///=-=-=- .
/ \\ // X|X | | XX|X===////'' o `'
// \ ()||\ | O---O | ^^^^ _____***
// =9======= / .) | / \ // /\ \\ | o o o** .
========= \ .) \\ \ \ \\ ____ .| o o o |'
/ o ___ \\ \ \ || |o o| /|==| o o o |.
. - // _____| O | || || \ || |o o| /=| | o o o |
// |XXxO| O | /_____\ /_____\ | |/ | | o|| o |:
*/
}
#define macro WAVE2() = takes (0) returns (0) {
/** This is it pilot! We need to finish this angel off and take a second DNA sample.
The Elohim angels are reportedly capable of some unbelievable feats when they are
close to death. It's even rumored that they can alter their own DNA.
Watch your power levels and don't let your guard down! Good luck! */
ATTACK_WAVE2_FINISH_HIM() /** Wave 0x2 - Let's end this now pilot! Aerial attack formation!
. . \ \ ||
9| | /
^ \\ || // o *
\\ || //
^ \ z \ || / || . /
\/\/ 10
^ ^ ^^^^ \\ || //
^ ^ ^ \ 00 \\ || // ,
^ ^ | \__/ \ || /
^ . \/\/
|| (XXX) "
. 8| | \|/
\\ || //
\\ || // || / '
\ || / 7|
\/\/ \\ || // .
(**) \\ || //
^ | \ || /
. \/\/ .
()()
\|
_______
(x )==O
\ | )_ () ___....
______ \\\ | \'\///oo///=-=-=-*>*>*>
O==(x ) \\ // *** \ ///XX|X===////''
, \\======// o o \\====== //
_______ =\ //\\__O_// ===\\\ .
O==(x ) \| |/
. | O---O | * .
. / | - XxX| - "
** | x | \' * '
_________ . * | O---O |
| o o o o | ___^^^^_ // /\ \\ * * * .
____ | o o o o |___ | O O | \\ \ \ \\
|o o| /|==| o o o o | - |____ | O O | \\ \ \ || . * ,
|o o| /=| | o o o o | - | == || O O | || || \ ||
| |/ | | o ||| o | | = || |^|^| |\ /_____\ /_____\ * ** * * ** */
}
#define macro THE_FIFTH_IMPACT() = takes (1) returns (1) {
/** Good fighting so far, pilot! Congrats on taking out the scout Elohim.
But now it's too late. An advance batallion of 100 Elohim has just landed!
We don't have the genetic weapon ready yet so you'll have to engage these enemies,
there is no other alternative. Can you defeat all of these foes? */
//(f*zzz
//
//
//*************************\\
/** \ / **/
/** 0 0 **/
ATTACK_WAVE1() ATTACK_WAVE2() ATTACK_WAVE2() ATTACK_WAVE1()
ATTACK_WAVE1() ATTACK_WAVE2()/** \\________________// */ ATTACK_WAVE2() ATTACK_WAVE1()
ATTACK_WAVE2() ATTACK_WAVE1() ATTACK_WAVE1() ATTACK_WAVE2() ATTACK_WAVE1() ATTACK_WAVE1()
ATTACK_WAVE2() ATTACK_WAVE1() ATTACK_WAVE2() ATTACK_WAVE2()
ATTACK_WAVE1() ATTACK_WAVE1() ATTACK_WAVE2() ATTACK_WAVE2()
ATTACK_WAVE1() ATTACK_WAVE2() ATTACK_WAVE1() ATTACK_WAVE1()
ATTACK_WAVE2() ATTACK_WAVE1() ATTACK_WAVE1() ATTACK_WAVE2()
ATTACK_WAVE1() ATTACK_WAVE2() ATTACK_WAVE2() ATTACK_WAVE1()
ATTACK_WAVE1() ATTACK_WAVE2() ATTACK_WAVE2() ATTACK_WAVE1()
ATTACK_WAVE2() ATTACK_WAVE1() ATTACK_WAVE1() ATTACK_WAVE2() ATTACK_WAVE1() ATTACK_WAVE1() ATTACK_WAVE2()
ATTACK_WAVE1() ATTACK_WAVE2() ATTACK_WAVE2() ATTACK_WAVE1() ATTACK_WAVE1() ATTACK_WAVE2()
ATTACK_WAVE2() ATTACK_WAVE1()
ATTACK_WAVE2() ATTACK_WAVE1()
ATTACK_WAVE1() ATTACK_WAVE2()
ATTACK_WAVE1() ATTACK_WAVE1()
ATTACK_WAVE2() ATTACK_WAVE1()
ATTACK_WAVE2() ATTACK_WAVE2()
ATTACK_WAVE1() ATTACK_WAVE1()
ATTACK_WAVE2() ATTACK_WAVE2()
ATTACK_WAVE1() ATTACK_WAVE2()
ATTACK_WAVE1() ATTACK_WAVE1()
ATTACK_WAVE2() ATTACK_WAVE1()
ATTACK_WAVE1() ATTACK_WAVE2()
ATTACK_WAVE1() ATTACK_WAVE2()
ATTACK_WAVE2() ATTACK_WAVE1()
ATTACK_WAVE1() ATTACK_WAVE2()
ATTACK_WAVE2() ATTACK_WAVE1() ATTACK_WAVE2() ATTACK_WAVE1()
ATTACK_WAVE1() ATTACK_WAVE2() ATTACK_WAVE1() ATTACK_WAVE1()
ATTACK_WAVE2() ATTACK_WAVE1() ATTACK_WAVE2() ATTACK_WAVE2()
/** ** * */ATTACK_WAVE1() ATTACK_WAVE1() ATTACK_WAVE2() ATTACK_WAVE2() /** * * * *** * * **** ** ** *** *** * ** ** *** ** */
/** * * *** * * ** ** *** ***** * * *** ****** * * ** * * * ****** **** * * ** ** ******* **** ** *** *** *** ** * * ** * ***** ** *** * * */
/* * * * *** * * **** * * *** ****** * * ** * * * ****** **** * * ** ** ******* **** **** ** * ** ** *** *** *** ** * * ** * * ** *** * * *** */
/** **b*zzz ** * * *** * * * ** *** ***** * * ** ** *** *** *** ** * * ** * ************* * *** * ** ** * ***** ** *** * * ** ** ** ** *** * */
}
// // ================================EVANGELION-ATTACK-UTILITIES=================+MAGI-03-ORIGINAL
#define fn ATTACK_WAVE1() = takes (1) returns (1) {
0x07
EVA_SEVEN()
EVA_EIGHT()
EVA_NINE()
EVA_TEN()
pop
}
#define macro EVA_SEVEN() = takes (2) returns (2) {
__FUNC_SIG(eva_SEVEN) 0x00 mstore CONFIRM_EVA_CONTRACT()
}
#define macro EVA_EIGHT() = takes (2) returns (2) {
__FUNC_SIG(eva_EIGHT) 0x00 mstore CONFIRM_EVA_CONTRACT()
}
#define macro EVA_NINE() = takes (2) returns (2) {
__FUNC_SIG(eva_NINE) 0x00 mstore CONFIRM_EVA_CONTRACT()
}
#define macro EVA_TEN() = takes (2) returns (1) {
__FUNC_SIG(eva_TEN) 0x00 mstore CONFIRM_EVA_CONTRACT()
}
#define macro ATTACK_WAVE2() = takes (1) returns (2) {
__FUNC_SIG(eva_SEVEN) 0x00 mstore CALL_EVA_CONTRACT()
__FUNC_SIG(eva_EIGHT) 0x00 mstore CALL_EVA_CONTRACT()
__FUNC_SIG(eva_NINE) 0x00 mstore CALL_EVA_CONTRACT()
__FUNC_SIG(eva_TEN) 0x00 mstore CALL_EVA_CONTRACT()
// Angel neural resequencing
add add add
0x07 0x20 calldataload exp
0x08 0x40 calldataload exp
0x09 0x60 calldataload exp
0x10 0x80 calldataload exp
add add add
dup1 swap2 eq ZERO_TIME_SOUL_SYNC(0x18)
swap1 add
}
// Same as ATTACK_WAVE2 but this one includes a S2 Engine gas check
#define macro ATTACK_WAVE2_FINISH_HIM() = takes (1) returns (2) {
gas
__FUNC_SIG(eva_SEVEN) 0x00 mstore CALL_EVA_CONTRACT()
__FUNC_SIG(eva_EIGHT) 0x00 mstore CALL_EVA_CONTRACT() add
__FUNC_SIG(eva_NINE) 0x00 mstore CALL_EVA_CONTRACT() add
__FUNC_SIG(eva_TEN) 0x00 mstore CALL_EVA_CONTRACT() add
gas
// Angel neural resequencing
0x07 0x20 calldataload exp
0x08 0x40 calldataload exp add
0x09 0x60 calldataload exp add
0x10 0x80 calldataload exp add
dup1 swap3 eq ZERO_TIME_SOUL_SYNC(0x8)
// Super Solenoid power level evaluation
swap3 add swap2 swap1 sub swap1
}
#define macro CALL_EVA_CONTRACT() = takes (0) returns (1) {
gas [MAX_GAS_FOR_EVA] lt
ZERO_TIME_SOUL_SYNC(0x03)
0x00 0x20 0x04 0x1c [CD_EVA_CONTROL_ADDRESS] calldataload [MAX_GAS_FOR_EVA] staticcall
ANALYZE_EVA_RESPONSE()
returndatasize 0x0 0x20 returndatacopy 0x20 mload
}
#define fn CONFIRM_EVA_CONTRACT() = takes (2) returns (2) {
swap1
CALL_EVA_CONTRACT()
0x06 dup4 sub 0x20 mul calldataload dup4 swap1 exp dup2 eq
ZERO_TIME_SOUL_SYNC(0x02)
add swap1 0x01 add
}