diff --git a/.github/workflows/token-validation.yml b/.github/workflows/token-validation.yml new file mode 100644 index 0000000..82e318e --- /dev/null +++ b/.github/workflows/token-validation.yml @@ -0,0 +1,16 @@ +name: Token validation +on: [pull_request] + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + - name: Validate Spectra Tokens + uses: docker://orrosenblatt/validate-json-action:latest + env: + INPUT_SCHEMA: src/schema/spectra-tokens.schema.json + INPUT_JSONS: src/tokens/spectra-tokens.json, src/tokens/erc4626Wrappers.json \ No newline at end of file diff --git a/src/schema/spectra-tokens.schema.json b/src/schema/spectra-tokens.schema.json new file mode 100644 index 0000000..63774f5 --- /dev/null +++ b/src/schema/spectra-tokens.schema.json @@ -0,0 +1,36 @@ +{ + "type": "array", + "uniqueItems": true, + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "chainId", + "address", + "name", + "symbol", + "decimals", + "logoURI" + ], + "properties": { + "chainId": { + "type": "integer" + }, + "address": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "name": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "decimals": { + "type": "integer", + "minimum": 1, + "maximum": 18 + } + } + } +} \ No newline at end of file