Generates a set of known contracts indexed by chain. Contracts are stored in the /contracts/{chainId}
folder. The script uses two different data sources to gather contract addresses along with their identification. Data sources are:
revoke.cash
dapps-contracts listethereum-list
contracts list and their project identification
For getting websites images, we use the blockwallet/assets
repository.
The script executes several steps to get the work done:
The process starts by checking whether it exists a file with custom dapps information. Is important to note that all the information collected will be joined with this file. In case of having the same dapp, it will join the information, prioritizing this file data.
To avoid re-processing files and execute multiple HTTP request, the script makes the best effort to generate a consistent cache from previous executions. There are two ways of generating caches:
- Using the
generated-dapps.json
file with all the contracts generated in a previous execution [NOT_RECOMMENDED]. - Using the
contracts
folder.
Is important to understand that every contract that is cached will not be re-processed. If you want to re-process it, either remove it from the contracts
folder or from the generated-dapps.json
file.
We use two different data-sources that gathers the contracts along with their owner information. As you may have seen at the beginig of this guide, we suggest to download the data-sources repositories so that we can attempt fetching the contracts from a local folder and avoid executing too many HTTP requests.
This data-source provides an small set of contracts with their owner name. There is no way to identify the owner website or logo.
This data-source provides an big set of contracts with their project name. Once collected these contracts, we try to fetch more information about the project using the projects
folder in the ethereum-lists
repository. This extended information may have the dapp website and name.
Once the contracts are collected and grouped by dapp name, the process try to infer the dapp logo (if empty) from its website. By using the block-wallet/assets/dapps
repository folder, it tries to match the websiteURL with the asset name to infer the logo.
Based on the configuration (config.ts
file at the project root), this process will generate different outputs:
generated-dapps.json
file.contracts
folder and subfolders indexed by chainId.
This project needs to use node version 18.13.0
or above.
- Execute the following script:
./setup.sh
nvm use
to use correct node versionyarn
to install dependencies- [Optional]:
git clone git@github.com:ethereum-lists/contracts.git ethereum-lists
to clone ethereum-list repostitory and avoid doing too many request. - [Optional]:
git clone git@github.com:RevokeCash/revoke.cash.git revoke-cash
to clone revoke-cash repostitory and avoid doing too many request.
The output of this script can be specified in the config.ts
file at the root of this project.
Execute yarn run generate
to run this process.