From 72f7454d170437ba008b29cc0d07d0ca233253bd Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Fri, 12 Apr 2024 22:58:12 -0700 Subject: [PATCH] Add ERC-4906 and support for hardcoded interface IDs --- index.html | 9 ++++++++- interfaces.json | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) 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)", -- 2.47.3