Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signature format & json path #3

Merged
merged 3 commits into from
Apr 17, 2023
Merged

signature format & json path #3

merged 3 commits into from
Apr 17, 2023

Conversation

0xc0de4c0ffee
Copy link
Contributor

@0xc0de4c0ffee 0xc0de4c0ffee commented Apr 13, 2023

json path gateway.tld/ipns/f<hash>/.well-known/eth/domain/...

    if (bytes(funcToFile[func]).length > 0) {
        _pathJSON = funcToFile[func];
    } else if (func == iResolver.text.selector) {
        _pathJSON = abi.decode(data[36:], (string));
    } else if (func == iResolver.addr.selector) {
        _pathJSON = string("_address/60");
    } else if (func == iOverloadResolver.addr.selector) {
        _pathJSON = string.concat("_address/", uintToNumString(abi.decode(data[36:], (uint256))));
    } else if (func == iResolver.interfaceImplementer.selector) {
        _pathJSON =
            string.concat("_interface/", bytes2HexString(abi.encodePacked(abi.decode(data[36:], (bytes4))), 0));
    } else if (func == iResolver.ABI.selector) {
        // recheck this
        _pathJSON = string.concat("_abi/", uintToNumString(abi.decode(data[36:], (uint256))));
    } else if (func == iResolver.dnsRecord.selector) {
        (bytes32 _name, uint16 resource) = abi.decode(data[36:], (bytes32, uint16));
        _pathJSON =
            string.concat("_dns/", bytes2HexString(abi.encodePacked(_name), 0), "/", uintToNumString(resource));
    } else {
        revert NotImplemented(func);
    }

@0xc0de4c0ffee 0xc0de4c0ffee requested a review from sshmatrix April 13, 2023 08:13
@0xc0de4c0ffee 0xc0de4c0ffee merged commit 6460c09 into namesys-eth:main Apr 17, 2023
@0xc0de4c0ffee 0xc0de4c0ffee deleted the sigpath branch April 17, 2023 08:49
sshmatrix pushed a commit that referenced this pull request May 27, 2023
* path fix

* sig format review

* update sig format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant