Skip to content

refactor(contracts): Ensure deployments scripts are typechecked, fix compilation issues and refactor the code - #1236

Merged
PetarKirov merged 31 commits into
mainfrom
refactor/contracts/deployment-scripts
Jul 9, 2025
Merged

PetarKirov merged 31 commits into
mainfrom
refactor/contracts/deployment-scripts

Conversation

@PetarKirov

@PetarKirov PetarKirov commented Apr 17, 2025 •

Copy link
Copy Markdown
Member

Progress so far

How to test

1. Prepare your local repo for testing of this branch

git fetch
git checkout refactor/contracts/deployment-scripts
git reset --hard '@{u}'
just clean

# Backup .env
cp $GIT_ROOT/.env $GIT_ROOT/../.env

yarn
yarn build @blocksense/contracts
cd libs/ts/contracts

2. Start local Anvil instance and deploy against it

# Run in a separate terminal:
anvil --fork-url $RPC_URL_ETHEREUM_SEPOLIA --chain-id 99999999999

yarn hardhat deploy --networks local --network local

@PetarKirov
PetarKirov marked this pull request as draft April 17, 2025 01:21
@PetarKirov PetarKirov changed the title refactor(contracts): Ensure deployments scripts are typechecked, fixes compilation issues and refactor the code refactor(contracts): Ensure deployments scripts are typechecked, fix compilation issues and refactor the code Apr 17, 2025
@PetarKirov
PetarKirov force-pushed the refactor/contracts/deployment-scripts branch 2 times, most recently from 150ac7a to 8618c0c Compare April 17, 2025 17:29
@PetarKirov
PetarKirov force-pushed the refactor/contracts/deployment-scripts branch 7 times, most recently from 6e20e1c to 12625d6 Compare May 3, 2025 12:19
@PetarKirov
PetarKirov force-pushed the refactor/contracts/deployment-scripts branch 5 times, most recently from 70dd233 to c0b911f Compare May 11, 2025 21:47
@PetarKirov
PetarKirov force-pushed the refactor/contracts/deployment-scripts branch from fa6f570 to 59c562f Compare May 15, 2025 01:00
@PetarKirov PetarKirov added area:evm-smart-contacts Task related to smart contracts area:docs.ws Tasks related to Blocksense documentation website area:base-utils Tasks related to `@blocksense/base-utils` lib area:dependencies Pull requests that update a dependency file area:typescript Pull requests that update Javascript code labels May 15, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the contracts code to enhance type checking in deployment scripts and resolve compilation issues. The changes primarily update the type conversion pattern (switching from S.Schema.Type to typeof …Schema.Type), refactor array iteration utilities, and adjust key composition in ChainLink-related modules.

  • Uniform type conversions in multiple exchange-specific type files.
  • Replacement of array iteration functions and iterator access in Kraken and ChainLink feeds.
  • Minor dependency updates in package.json.

Reviewed Changes

Copilot reviewed 116 out of 116 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
apps/data-feeds-config-generator/src/data-services/fetchers/exchanges/*/types.ts Replaced S.Schema.Type with typeof …Schema.Type for improved type inference.
apps/data-feeds-config-generator/src/data-services/fetchers/exchanges/kraken/kraken.ts Replaced entries with entriesOf and updated the array conversion pattern.
apps/data-feeds-config-generator/src/data-feeds-config-generator/src/data-services/fetchers/chainlink/chainlink_feeds.ts Adjusted how the first feed data item is accessed using the iterator’s next() method.
apps/data-feeds-config-generator/src/chainlink-compatibility/index.ts Updated key composition by removing parseNetworkFilename from the key formation.
apps/data-feeds-config-generator/package.json Updated dependency versions for effect and vitest.
Comments suppressed due to low confidence (1)

apps/data-feeds-config-generator/src/chainlink-compatibility/index.ts:107

  • The removal of parseNetworkFilename from the key composition changes the expected key format, which may lead to mismatches if downstream logic expects the transformed filename. Ensure this change is intended and update related consumers if necessary.
[`${networkFile}/${contractAddress}`]: correspondingBlocksenseFeed ? correspondingBlocksenseFeed.id : null,

@PetarKirov
PetarKirov force-pushed the refactor/contracts/deployment-scripts branch from 59c562f to 67eb1f1 Compare May 15, 2025 01:07
@Xearty
Xearty force-pushed the refactor/contracts/deployment-scripts branch from 9ae79a5 to 41fdd0d Compare May 15, 2025 11:07
@PetarKirov
PetarKirov force-pushed the refactor/contracts/deployment-scripts branch 2 times, most recently from a1b68b7 to 569e1e5 Compare May 16, 2025 21:33
PetarKirov and others added 27 commits July 10, 2025 00:48
…stead of `description`

Because `full_name` is what is typically used for such contracts and
`description` is meant for the feed explorer website.
…vate-key-based `ethers.Wallet`

And various other improvements:
* Improve structure of `NetworkConfig` types
* Re-implement `init-chain` on top of `parseDeploymentEnvConfig`
* Improve logs
…ove `NetworkAccessCard`

Co-authored-by: Emil Ivanichkov <emil.ivanichkov@gmail.com>

5be1149
…sistent

Co-authored-by: Kristin Kirkov <kristin.kirkov@metacraft-labs.com>

@EmilIvanichkovv EmilIvanichkovv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The end of an era

@github-actions

github-actions Bot commented Jul 9, 2025

Copy link
Copy Markdown

🚀 Deployment Links of Blocksense Network websites:

Website Latest Update Commit
🌱 Documentation 10.07.2025 01:32:47 3031fbd
📖 Docs UI Components 10.07.2025 01:32:47 3031fbd
📝 UI Components 10.07.2025 01:32:47 3031fbd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:base-utils Tasks related to `@blocksense/base-utils` lib area:dependencies Pull requests that update a dependency file area:docs.ws Tasks related to Blocksense documentation website area:evm-smart-contacts Task related to smart contracts area:typescript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants