From: Ardis Lu Date: Sat, 13 Apr 2024 05:58:12 +0000 (-0700) Subject: Add ERC-4906 and support for hardcoded interface IDs X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=72f7454d170437ba008b29cc0d07d0ca233253bd;p=erc-165-calculator Add ERC-4906 and support for hardcoded interface IDs --- diff --git a/index.html b/index.html index e78ee63..1240db1 100644 --- a/index.html +++ b/index.html @@ -137,6 +137,7 @@ + @@ -160,6 +161,7 @@ document.querySelector('select').addEventListener('change', e => { const selection = e.target.value; const textarea = document.querySelector('textarea'); + const output = document.querySelector('output'); if (lastSelection === 'Custom') { customFunctions = textarea.value; @@ -170,11 +172,16 @@ if (selection === 'Custom') { textarea.value = customFunctions; textarea.readOnly = false; + document.querySelector('form').requestSubmit(); + } + else if (typeof interfaces[selection] === 'string') { + textarea.value = 'No functions: the interface ID for this ERC is hardcoded.'; + output.textContent = interfaces[selection]; } else { textarea.value = interfaces[selection].join('\n'); + document.querySelector('form').requestSubmit(); } - document.querySelector('form').requestSubmit(); }); document.querySelector('form').addEventListener('submit', e => { diff --git a/interfaces.json b/interfaces.json index 1af29d9..5d0c281 100644 --- a/interfaces.json +++ b/interfaces.json @@ -57,6 +57,7 @@ "ERC-1363-Spender": [ "onApprovalReceived(address owner, uint256 value, bytes memory data)" ], + "ERC-4906": "0x49064906", "ERC-5805": [ "getVotes(address account)", "getPastVotes(address account, uint256 timepoint)",