|
//"SPDX-License-Identifier: UNLICENSED" |
|
pragma solidity ^0.8.0; |
|
// .................................................................................................... |
|
// .................................................................................................... |
|
// .................................................................................................... |
|
// ........................................;++*!!????????!!**+;;....................................... |
|
// .................................;+*?%$&&0101010101010101010&@$?*+;................................. |
|
// .............................;*?$&10101010101010101010101010101010&@?*;............................. |
|
// ..........................+!$&10101010101010101010101010101010101010101@?+;......................... |
|
// .......................+?@010101010101010101010101010101010101010101010101&%+....................... |
|
// ....................;*$0101010101010101010101&&&@@@@&&&0101010101010101010101@?;.................... |
|
// ..................;?&0101010101010101&@%?!*+;;.........;;+*?%@&0101010101010101&%+.................. |
|
// ................;?&01010101010101@%!+;.....*????????????!.....;+*%@010101010101010%+................ |
|
// ...............!&1010101010101$!+..........@0101010101010;.........;*%&1010101010101%;.............. |
|
// .............+@010101010101@!;.............$0101010101010;............;*$101010101010&!............. |
|
// ............?101010101010%+................$1010101010101;...............;?&01010101010$;........... |
|
// ..........;$10101010101%+..................$0101010101010;.................;!&1010101010&*.......... |
|
// .........+&1010101010$+....................$1010101010101;...................;?01010101010!......... |
|
// ........*&101010101&*......................$0101010101010;.....................+$1010101010?........ |
|
// .......*1010101010$;.......................$1010101010101;.......................?0101010101?....... |
|
// ......+&010101010?.........................$1010101010101;........................*&010101010!...... |
|
// .....;@101010101!..........................$0101010101010;.........................+&101010101*..... |
|
// .....%010101010!...........................$1010101010101;..........................+&01010101&;.... |
|
// ....*010101010%............................$1010101010101;...........................*010101010?.... |
|
// ....@10101010@;............................$1010101010101;............................%010101010+... |
|
// ...*101010101*.............................$0101010101010;............................;&10101010%... |
|
// ...$10101010$..............................$101010101010&;.............................!10101010&;.. |
|
// ..;&10101010*..+***************************@1010101010101!***************************..;&01010101*.. |
|
// ..+01010101&;..%01010101010101010101010101010101010101010101010101010101010101010101&...$01010101?.. |
|
// ..!01010101@...%01010101010101010101010101010101010101010101010101010101010101010101@...?01010101$.. |
|
// ..?01010101%...%01010101010101010101010101010101010101010101010101010101010101010101@...*01010101@.. |
|
// ..?01010101%...%01010101010101010101010101010101010101010101010101010101010101010101@...*01010101@.. |
|
// ..?01010101%...%01010101010101010101010101010101010101010101010101010101010101010101@...!01010101@.. |
|
// ..!01010101@...%01010101010101010101010101010101010101010101010101010101010101010101@...?01010101$.. |
|
// ..+01010101&;..%01010101010101010101010101010101010101010101010101010101010101010101@...$01010101?.. |
|
// ..;&01010101!..;+++++++++++++++++++++++++++@0101010101010*+++++++++++++++++++++++++++..;101010101*.. |
|
// ...%01010101@..............................$0101010101010;.............................?10101010&;.. |
|
// ...*101010101*.............................$0101010101010;............................;&10101010?... |
|
// ....$10101010&;............................$1010101010101;............................%01010101&;... |
|
// ....+010101010%............................$1010101010101;...........................!010101010?.... |
|
// .....?101010101?...........................$0101010101010;..........................*101010101@;.... |
|
// .....;@010101010?..........................$1010101010101;.........................*0101010101+..... |
|
// ......;&010101010%;........................$1010101010101;........................!0101010101*...... |
|
// .......+&010101010@+.......................$1010101010101;......................;%0101010101!....... |
|
// ........+&010101010&!......................$1010101010101;.....................*@0101010101!........ |
|
// .........+@0101010101@*....................$0101010101010;...................;%10101010101*......... |
|
// ..........;%01010101010$+..................$1010101010101;.................;?&0101010101@+.......... |
|
// ............!&01010101010$*;...............$1010101010101;...............+%&01010101010%;........... |
|
// .............+$101010101010&?+.............$1010101010101;............;!@010101010101@*............. |
|
// ...............*@0101010101010@?*;.........@1010101010101;........;+?$0101010101010&?;.............. |
|
// ................;!@10101010101010&$?*+;....+!*!!!!!!!!!**.....;*!$&10101010101010&?;................ |
|
// ..................;!@10101010101010101&$%?!*+;;;....;;;++*?%$@01010101010101010&?;.................. |
|
// .....................*%&10101010101010101010101&&&&&&010101010101010101010101$!;.................... |
|
// .......................;!$&01010101010101010101010101010101010101010101010@?+....................... |
|
// ..........................;*%@1010101010101010101010101010101010101010&$!+.......................... |
|
// ..............................+!%@&1010101010101010101010101010101@$!+;............................. |
|
// ..................................;+!?%@&&0101010101010101&&@$%!*;.................................. |
|
// .........................................;++**!!!!!!!!**++;;........................................ |
|
// .................................................................................................... |
|
// .................................................................................................... |
|
// .................................................................................................... |
|
|
|
|
|
contract ItsAllConnected { |
|
|
|
uint256 private correctNonce; |
|
bytes32 private PoHResult; |
|
bytes32 private PoAResult; |
|
|
|
address public PoWSolver; |
|
address public PoASolver; |
|
address public PoHSolver; |
|
address public SPoRASolver; |
|
uint256 public unlockBlock; |
|
|
|
constructor(uint256 _correctNonce, bytes32 _PoHResult, bytes32 _PoAResult, uint256 _blockOffset) { |
|
correctNonce = _correctNonce; |
|
PoHResult = _PoHResult; |
|
PoAResult = _PoAResult; |
|
unlockBlock = block.number + _blockOffset; |
|
} |
|
|
|
modifier isSolved(address solver){ |
|
require(solver == address(0), "ERROR: This puzzle has been solved."); |
|
_; |
|
} |
|
|
|
// *** Puzzle for PoW Piece *** |
|
function PoW(uint256 _nonceGuess) public isSolved(PoWSolver){ |
|
require(_nonceGuess == correctNonce, "ERROR: The guessed nonce is not correct."); |
|
PoWSolver = msg.sender; |
|
} |
|
|
|
// *** Puzzle for PoA Piece *** |
|
function PoA(address _yourAddress) public isSolved(PoASolver){ |
|
require(keccak256(abi.encodePacked(msg.sender)) == PoAResult, "ERROR: transaction is not from the correct sender"); |
|
PoASolver = _yourAddress; |
|
} |
|
|
|
// *** Puzzle for PoH Piece *** |
|
function PoH(uint256 _firstNumber, uint256 _secondNumber) public isSolved(PoHSolver){ |
|
require(keccak256(abi.encode(_secondNumber -_firstNumber)) == PoHResult, "ERROR: incorrect numbers"); |
|
PoHSolver = msg.sender; |
|
} |
|
|
|
// *** Puzzle for SPoRA Piece *** |
|
function SPoRA() public isSolved(SPoRASolver){ |
|
// hi...it's 1559 |
|
require(block.number > unlockBlock, "ERROR: the puzzle will unlock after the drop."); |
|
require(tx.gasprice/1e9 == 1559, "ERROR: incorrect puzzle solution."); |
|
SPoRASolver = msg.sender; |
|
} |
|
|
|
// View all puzzle solvers |
|
function solvers() public view returns (address, address, address, address){ |
|
return (PoWSolver, PoASolver, PoHSolver, SPoRASolver); |
|
} |
|
|
|
} |