Skip to content

Commit

Permalink
Merge pull request #7 from unified-defi/main
Browse files Browse the repository at this point in the history
merge downstream fork
  • Loading branch information
ftm1337 authored Apr 6, 2024
2 parents cc1ad47 + 1417426 commit 801c22c
Show file tree
Hide file tree
Showing 561 changed files with 378 additions and 33 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
99 changes: 99 additions & 0 deletions .archived/assets/svg/equal.svg
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
9 changes: 9 additions & 0 deletions .github/actions/image-resizer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM alpine:latest

RUN apk add --no-cache imagemagick

COPY entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
19 changes: 19 additions & 0 deletions .github/actions/image-resizer/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Image Resizer"
description: "Resizes images to a specified size and stores them in a subfolder."
inputs:
path:
description: "The path to the directory containing images to resize."
required: true
size:
description: "The desired size of the images, e.g., 120x120."
required: true
subfolder_name:
description: "The name of the subfolder to store resized images in."
required: true
runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.path }}
- ${{ inputs.size }}
- ${{ inputs.subfolder_name }}
29 changes: 29 additions & 0 deletions .github/actions/image-resizer/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

set -e

# Directory where the original images are stored
SOURCE_DIR=$1
# Desired size of the images
SIZE=$2
# Subfolder name, based on the desired size
SUBFOLDER_NAME=$3

# Create the subfolder in each directory containing images
find "$SOURCE_DIR" -type d | while read -r dir; do
mkdir -p "${dir}/${SUBFOLDER_NAME}"
done

# Find and resize PNG images, then save them in the corresponding subfolder
find "$SOURCE_DIR" -maxdepth 1 -iname "*.png" | while read -r img; do
DIR=$(dirname "${img}")
BASENAME=$(basename "${img}")
TARGET="${DIR}/${SUBFOLDER_NAME}/${BASENAME}"

# Check if the resized image already exists
if [ ! -f "$TARGET" ]; then
convert "$img" -resize "$SIZE" "$TARGET"
else
echo "Resized image already exists: $TARGET"
fi
done
37 changes: 37 additions & 0 deletions .github/workflows/base-image-resize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Resize Images

on:
push:
paths:
- "base/tokens/*"

jobs:
resize-images:
runs-on: ubuntu-latest
# runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Resize images
uses: ./.github/actions/image-resizer
with:
path: "base/tokens/"
size: "128x128"
subfolder_name: "128x128"

- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "0xZod"
- name: Commit resized images
run: |
git add base/tokens/128x128/
git commit -m "Add resized images" || echo "No changes to commit"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
37 changes: 37 additions & 0 deletions .github/workflows/fantom-image-resize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Resize Images

on:
push:
paths:
- "fantom/tokens/*"

jobs:
resize-images:
runs-on: ubuntu-latest
# runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Resize images
uses: ./.github/actions/image-resizer
with:
path: "fantom/tokens/"
size: "128x128"
subfolder_name: "128x128"

- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "0xZod"
- name: Commit resized images
run: |
git add fantom/tokens/128x128/
git commit -m "Add resized images" || echo "No changes to commit"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
.vscode
82 changes: 49 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,73 @@
# `crypto-icons`
# `equalizer-tokens`

## 1) What?
A Unified repository containing optimized icons for equalizer cryptocurrency assets.

A Unified repository containing optimized icons for Cryptocurrency assets.
- Provides teams with ability to manage their token images
- Provides teams with ability to manage their token symbol and name

## 2) Current state
This is a raw copy right now.

### To be deleted soon

- Directories

```
./assets/logo
./assets/svg
```
- Files

All non-conforming files

## Structure


```
./assets
./assets/fantom
./assets/base
```
# Managing token images

## Allowed formats

### File formats

- PNG
- MUST be **400px x 400px** in size.
- MUST be less than **32 KB**

- MUST be a minimum of **400px x 400px** in size.
- MUST only be placed in a chain root folder `/<chain>/tokens/<your-token-address>.png`
- Should be Transparent.
- Should NOT fade on dark background #001337 (navy blue).
- Should have a circular or rounded edges (5px minimum) background if it is low contrast on dark background.

- SVG
- MUST be less than 32KB


- SVG are only allowed as a reference if you are having trouble creating a PNG and want the team to help you.

### File Name formats

- Must be the fully qualified **address** of the asset.
- Note: Native ETH (or BNB/MATIC/FTM etc) should be `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`.png or .svg
- Must be in **lowercase** if the blockchain is case-insenstive (Ethereum-like chains).
- Must be in exact Checksummed case if blockchain is case-sensitive (Bitcoin-like or Tron-like chains)
- Must be in **lowercase** if the blockchain is case-insensitive (Ethereum-like chains).
- Must be in exact Check-summed case if blockchain is case-sensitive (Bitcoin-like or Tron-like chains)

## Submitting logos

1. Fork this repository.
2. Add logos in appropriate blockchain's directory
3. Commit your changes and open a **Pull Request** on this repository.
4. Tag someone to review and approve your submission.

### Managing cache

When changing a token image, you will need to clear the auto resized images from our cache.

1. Delete `/<chain>/tokens/<size>/<your-token-address>.png`
2. Repeat for all sizes
3. Commit your changes and open a **Pull Request** on this repository.
4. Tag someone to review and approve your submission.

### Rejections
Your submission will be starightaway rejected if it doesnt conform to the [Allowed formats](#Allowed-formats).

Your submission will be straight away rejected if it does'nt conform to the [Allowed formats](#Allowed-formats).

# Managing Token symbol and name

DeFi changes rapidly and we provide a method for you to override the default token names and symbols stored on-chain.

1. Add your token to the `/<chain>/tokens.json` file
2. Use the check summed <address> as the key
3. Conform to this object format

```
{
"<your-token-address>": {
name: "<your-new-name>"
symbol: "<your-new-symbol>",
tags: []
}
}
```

## Token tags

We provide a default set of tags to categorise tokens, please only use tags in the default set which can be found at `/tokens-tag.json` and be honest, if you are launching a degen meme token, do not tag it as a blue-chip or your token submission will be rejected. If a team attempts to trick users then delisting and/or removal of gauges may occur.
Diff not rendered.
Diff not rendered.
File renamed without changes
File renamed without changes
Empty file added base/svg/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions base/tokens.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Empty file added base/tokens/128x128/.gitkeep
Empty file.
Binary file added base/tokens/128x128/eth.png
Binary file added base/tokens/128x128/scale.png
Binary file added base/tokens/eth.png
Binary file added base/tokens/scale.png
Empty file added fantom/svg/.gitkeep
Empty file.
Loading

0 comments on commit 801c22c

Please sign in to comment.