Skip to content
Verified contractExactMIT

SvzchfChaletWeb3

Address0x4ddcc96dadfca5b52bbebda59dc81c2915fa329e
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.24

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.24+commit.e11b9ed9
Language
solidity
Optimization
No
EVM version
cancun
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,775,500
Creation transaction
0x86d69236c5…b2dabb7ad2

contracts/SvzchfChaletWeb3.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

interface IHtmlRoot {
    function html() external view returns (string memory);
}

/// @title SvzchfChaletWeb3 — ERC-5219 resource-request adapter for the svZCHF
/// Chalet onchain dapp.
/// @notice gwei.domains and other ERC-6860 resource-request gateways don't do
/// "auto mode" (calling html() directly); they call request(). This immutable
/// adapter serves the existing root contract's html() over ERC-5219. No owner,
/// no upgrade path — the underlying root is immutable too.
contract SvzchfChaletWeb3 {
    struct KeyValue {
        string key;
        string value;
    }

    IHtmlRoot public immutable ROOT;

    constructor(address root) {
        ROOT = IHtmlRoot(root);
    }

    /// @dev ERC-6860 resolve-mode announcement: ERC-5219 resource request.
    function resolveMode() external pure returns (bytes32) {
        return "5219";
    }

    /// @dev ERC-5219: every path serves the single-file dapp.
    function request(
        string[] memory, /* resource */
        KeyValue[] memory /* params */
    )
        external
        view
        returns (uint statusCode, string memory body, KeyValue[] memory headers)
    {
        headers = new KeyValue[](1);
        headers[0] = KeyValue("Content-Type", "text/html; charset=utf-8");
        return (200, ROOT.html(), headers);
    }

    /// @dev ERC-165, including the ERC-5219 interface id (single-function
    /// interface: the request() selector).
    function supportsInterface(bytes4 interfaceId) external pure returns (bool) {
        return interfaceId == 0x01ffc9a7 || interfaceId == 0x1374c460;
    }
}
Compiler settingsShow
{
  "viaIR": false,
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "evmVersion": "cancun"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.