-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from ensdomains/feature/stateless-dnssec
Made DNSSEC oracle pure
- Loading branch information
Showing
22 changed files
with
766 additions
and
2,271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.4; | ||
|
||
import "../dnssec-oracle/DNSSEC.sol"; | ||
|
||
interface IDNSRegistrar { | ||
function proveAndClaim( | ||
bytes memory name, | ||
DNSSEC.RRSetWithSignature[] memory input | ||
) external; | ||
|
||
function proveAndClaimWithResolver( | ||
bytes memory name, | ||
DNSSEC.RRSetWithSignature[] memory input, | ||
address resolver, | ||
address addr | ||
) external; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.11; | ||
|
||
import "../dnssec-oracle/BytesUtils.sol"; | ||
|
||
library RecordParser { | ||
using BytesUtils for bytes; | ||
|
||
/** | ||
* @dev Parses a key-value record into a key and value. | ||
* @param input The input string | ||
* @param offset The offset to start reading at | ||
*/ | ||
function readKeyValue( | ||
bytes memory input, | ||
uint256 offset, | ||
uint256 len | ||
) | ||
internal | ||
pure | ||
returns ( | ||
bytes memory key, | ||
bytes memory value, | ||
uint256 nextOffset | ||
) | ||
{ | ||
uint256 separator = input.find(offset, len, "="); | ||
if (separator == type(uint256).max) { | ||
return ("", "", type(uint256).max); | ||
} | ||
|
||
uint256 terminator = input.find( | ||
separator, | ||
len + offset - separator, | ||
" " | ||
); | ||
if (terminator == type(uint256).max) { | ||
terminator = input.length; | ||
} | ||
|
||
key = input.substring(offset, separator - offset); | ||
value = input.substring(separator + 1, terminator - separator - 1); | ||
nextOffset = terminator + 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.