File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 77
88from .main import Caravan
99from .packages import STABLE_VERSION , PackageType
10+ from .settings import FACTORY_DETERMINISTIC_ADDRESS , SINGLETON_DETERMINISTIC_ADDRESSES
1011
1112if TYPE_CHECKING :
1213 from ape .contracts import ContractInstance
@@ -18,8 +19,7 @@ def __init__(self, address: AddressType | None = None):
1819 self .address = address
1920
2021 elif len ((factory_type := PackageType .FACTORY ()).deployments ) == 0 :
21- # NOTE: This is the deterministic deployment address via CreateX
22- self .address = "0x04579FFC45fE10A7901B88EaEc8F4850b847D37c"
22+ self .address = FACTORY_DETERMINISTIC_ADDRESS
2323
2424 if not len (self .provider .get_code (self .address )) > 0 :
2525 raise RuntimeError ("No CaravanFactory deployment on this chain" )
@@ -31,10 +31,8 @@ def __init__(self, address: AddressType | None = None):
3131
3232 # NOTE: also lets us override for testing
3333 self ._cached_releases : dict [Version , "ContractInstance" ] = {
34- # NOTE: This is the deterministic deployment address for v1 via CreateX
35- Version ("1" ): PackageType .SINGLETON ("1" ).at (
36- "0xB810c65972596d213DCdf0A73b27fa7be59Ef3E2"
37- ),
34+ Version (version ): PackageType .SINGLETON (version ).at (address )
35+ for version , address in SINGLETON_DETERMINISTIC_ADDRESSES .items ()
3836 }
3937
4038 @cached_property
Original file line number Diff line number Diff line change 11import os
22from pathlib import Path
3+ from typing import TYPE_CHECKING
34
5+ if TYPE_CHECKING :
6+ from ape .types import AddressType
7+
8+ # NOTE: This is the deterministic deployment address via CreateX
9+ FACTORY_DETERMINISTIC_ADDRESS : "AddressType" = "0x04579FFC45fE10A7901B88EaEc8F4850b847D37c"
10+
11+ # NOTE: This is the deterministic deployment addresses for each version via CreateX
12+ SINGLETON_DETERMINISTIC_ADDRESSES : dict [str , "AddressType" ] = {
13+ "1" : "0xB810c65972596d213DCdf0A73b27fa7be59Ef3E2" ,
14+ }
415
516USER_CACHE_DIR : Path = (
617 path
You can’t perform that action at this time.
0 commit comments