We want to consolidate much of the repeated code in the UX and BE involved with launching on a new chain. This PR is to centralize a lot of the Uni contract addresses across chains in one place.
I've also restructured how these contracts are stored, so instead of a series of repeated strings such as SEPOLIA_V3_CORE_FACTORY_ADDRESSES without any programmatic method to enforce consistency, there is a new datatype ChainAddresses whose fields correspond to the related contract. There is a map CHAIN_TO_ADDRESSES_MAP which will return all the ChainAddresses for a given ChainId. This helps simplify a lot of the helper consts such as V3_CORE_FACTORY_ADDRESSES which is now simply a reduce function across all SUPPORTED_CHAINS.
Last change primarily affecting UX is I've swapped SupportedChainId for ChainId and now SUPPORTED_CHAINS is an array which is the subset of all available Chains where Uni addresses have been deployed. This is the format used by the BE and is more robust than the previous sole SupportedChainId. This will change will likely require some small refactoring on the UX but will have us closer aligned to the BE.
We want to consolidate much of the repeated code in the UX and BE involved with launching on a new chain. This PR is to centralize a lot of the Uni contract addresses across chains in one place.
I've also restructured how these contracts are stored, so instead of a series of repeated strings such as
SEPOLIA_V3_CORE_FACTORY_ADDRESSES
without any programmatic method to enforce consistency, there is a new datatypeChainAddresses
whose fields correspond to the related contract. There is a mapCHAIN_TO_ADDRESSES_MAP
which will return all theChainAddresses
for a givenChainId
. This helps simplify a lot of the helperconsts
such asV3_CORE_FACTORY_ADDRESSES
which is now simply a reduce function across allSUPPORTED_CHAINS
.Last change primarily affecting UX is I've swapped
SupportedChainId
forChainId
and nowSUPPORTED_CHAINS
is an array which is the subset of all availableChains
where Uni addresses have been deployed. This is the format used by the BE and is more robust than the previous soleSupportedChainId
. This will change will likely require some small refactoring on the UX but will have us closer aligned to the BE.