From 078480c22093663687e3ae1ad09dcd6ad53d3d22 Mon Sep 17 00:00:00 2001 From: Julien Martin Date: Wed, 2 Feb 2022 16:42:58 -0500 Subject: [PATCH 1/2] =?UTF-8?q?feat:=C2=A0export=20as=20Solidity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/index.html b/index.html index d55515c..3957940 100644 --- a/index.html +++ b/index.html @@ -257,6 +257,34 @@ } }); formatsDiv.append(bash); + const solidity = document.createElement("button"); + solidity.setAttribute("class", "copy"); + solidity.setAttribute("name", "Solidity"); + solidity.innerHTML = "Solidity"; + solidity.style.marginLeft = "5px"; + solidity.addEventListener("click", () => { + solidity.innerHTML = "loading…"; + solidity.setAttribute("disabled", true); + const header = "contract Addresses {\n\n mapping (bytes32 => address) public addr;\n\n constructor() public {\n"; + const footer = " }\n}"; + let text = ""; + for (let i = 0; i < data.length; i += 64) { + const keyHex = data.substring(i, i + 64); + getAddress(keyHex, address => { + const key = hex2a(keyHex); + const space = " ".repeat(40 - key.length); + const statement = ` addr["${key}"]${space}= ${address};\n`; + text += statement; + if (text.match(/addr/g).length === data.length / 64) { + navigator.clipboard.writeText(header + text + footer); + uncopy(); + solidity.innerHTML = "copied"; + solidity.removeAttribute("disabled"); + } + }); + } + }); + formatsDiv.append(solidity); canvas.append(formatsDiv); const table = document.createElement("table"); const header = document.createElement("tr"); From 54d5ec96f6fe19472c4f33dc470fbd9aa97412c4 Mon Sep 17 00:00:00 2001 From: Nick Kou Date: Tue, 7 Mar 2023 15:32:25 +1300 Subject: [PATCH 2/2] update action version --- .github/workflows/aws-prod.yaml | 4 ++-- .github/workflows/tests.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/aws-prod.yaml b/.github/workflows/aws-prod.yaml index 5ea3719..b33c772 100644 --- a/.github/workflows/aws-prod.yaml +++ b/.github/workflows/aws-prod.yaml @@ -16,10 +16,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v1-node16 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 28670e4..9dea42d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Start and test chainlog containers id: start-containers