Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 21 additions & 29 deletions .github/workflows/dependency-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:
- "docker/oldUI.Dockerfile"
- "docker-compose/envs/common-blockscout-mainnet.env"
- "docker-compose/envs/common-blockscout-testnet.env"
- "docker-compose/token-lists/**"
- ".github/workflows/dependency-build.yml"
workflow_dispatch:

Expand All @@ -33,47 +32,40 @@ env:

jobs:
token-lists:
name: Validate DOS Chain token lists
name: Validate DOS Chain token list reference
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Validate schema, networks, assets, and environment URLs
- name: Validate hosted list, WDOS metadata, asset, and environment URL
run: |
set -euo pipefail

schema_url="https://raw.githubusercontent.com/Uniswap/token-lists/01705f94a307270b6c0fe5f55c7e66f7b92373cc/src/tokenlist.schema.json"
curl --fail --silent --show-error "${schema_url}" > "$RUNNER_TEMP/tokenlist.schema.json"
npx --yes ajv-cli@5.0.0 validate \
--spec=draft7 \
--strict=false \
-s "$RUNNER_TEMP/tokenlist.schema.json" \
-d docker-compose/token-lists/mainnet.json

token_list_url="https://raw.githubusercontent.com/DOS/DOScan-Frontend-Configs/main/configs/token-lists/mainnet.json"
expected_icon_url="https://raw.githubusercontent.com/DOS/DOScan-Frontend-Configs/main/configs/token-icons/WDOS.svg"
curl --fail --silent --show-error --location \
"${token_list_url}" --output "${RUNNER_TEMP}/dos-mainnet-token-list.json"
jq --exit-status \
--arg icon "${expected_icon_url}" \
'
(.timestamp | fromdateiso8601 > 0) and
(.tokens | length > 0) and
(.tokens | all(
any(.tokens[];
(.chainId == 7979) and
(.logoURI | test("^https://raw\\.githubusercontent\\.com/DOS/DOScan/main/docker-compose/token-lists/assets/[a-z0-9._-]+\\.(svg|png)$"))
)) and
(([.tokens[].address | ascii_downcase] | unique | length) == (.tokens | length))
' \
docker-compose/token-lists/mainnet.json >/dev/null

while IFS= read -r logo_url; do
asset_path="${logo_url#https://raw.githubusercontent.com/DOS/DOScan/main/}"
test -s "${asset_path}"
if grep -Eqi '<script|onload=|href=' "${asset_path}"; then
echo "::error::Token logo contains executable or external content: ${asset_path}"
exit 1
fi
done < <(jq --raw-output '.tokens[].logoURI' docker-compose/token-lists/mainnet.json)
((.address | ascii_downcase) == "0x1111111111111111111111111111111111111111") and
(.name == "Wrapped DOS") and
(.symbol == "WDOS") and
(.decimals == 18) and
(.logoURI == $icon)
)
' "${RUNNER_TEMP}/dos-mainnet-token-list.json" >/dev/null
icon_type="$(
curl --fail --silent --show-error --location --output /dev/null \
--write-out "%{content_type}" "${expected_icon_url}"
)"
[ "${icon_type%%;*}" = "image/svg+xml" ]

grep -Fxq \
'TOKEN_LIST_URL=https://raw.githubusercontent.com/DOS/DOScan/main/docker-compose/token-lists/mainnet.json' \
"TOKEN_LIST_URL=${token_list_url}" \
docker-compose/envs/common-blockscout-mainnet.env

- name: Validate Mainnet and Testnet environment parity
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ jobs:

curl --fail --silent --show-error --retry 6 --retry-delay 5 https://doscan.io/api/v2/stats >/dev/null
curl --fail --silent --show-error --retry 6 --retry-delay 5 https://doscan.io/public-metrics >/dev/null
expected_token_icon="https://raw.githubusercontent.com/DOS/DOScan/main/docker-compose/token-lists/assets/wdos.svg"
expected_token_icon="https://raw.githubusercontent.com/DOS/DOScan-Frontend-Configs/main/configs/token-icons/WDOS.svg"
token_icon_type="$(
curl --fail --silent --show-error --output /dev/null --write-out "%{content_type}" \
--retry 6 --retry-delay 5 \
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/envs/common-blockscout-mainnet.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ETHEREUM_JSONRPC_PENDING_TRANSACTIONS_TYPE=geth
BLOCKSCOUT_HOST=doscan.io
CHAIN_ID=7979
SUBNETWORK=Mainnet
TOKEN_LIST_URL=https://raw.githubusercontent.com/DOS/DOScan/main/docker-compose/token-lists/mainnet.json
TOKEN_LIST_URL=https://raw.githubusercontent.com/DOS/DOScan-Frontend-Configs/main/configs/token-lists/mainnet.json

INDEXER_DISABLE_INTERNAL_TRANSACTIONS_FETCHER=false
INDEXER_INTERNAL_TRANSACTIONS_TRACER_TYPE=call_tracer
Expand Down
36 changes: 0 additions & 36 deletions docker-compose/token-lists/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions docker-compose/token-lists/assets/wdos.svg

This file was deleted.

19 changes: 0 additions & 19 deletions docker-compose/token-lists/mainnet.json

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/validate-blockscout-env-parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ def main() -> int:
)

expected_mainnet_token_list_url = (
"https://raw.githubusercontent.com/DOS/DOScan/main/"
"docker-compose/token-lists/mainnet.json"
"https://raw.githubusercontent.com/DOS/DOScan-Frontend-Configs/main/"
"configs/token-lists/mainnet.json"
)
actual_mainnet_token_list_url = mainnet_override.get("TOKEN_LIST_URL")
if actual_mainnet_token_list_url != expected_mainnet_token_list_url:
Expand Down
Loading