@@ -20,54 +20,57 @@ import { getContract } from "../../contract/contract.js";
2020import { deployContract } from "../../contract/deployment/deploy-with-abi.js" ;
2121import { resolveImplementation } from "./resolveImplementation.js" ;
2222
23- describe ( "Resolve implementation" , async ( ) => {
24- it ( "should extract implementation address for minimal proxy contract" , async ( ) => {
25- const resolved = resolveImplementation ( NFT_DROP_CONTRACT ) ;
26- expect ( ( await resolved ) . address ) . to . equal ( NFT_DROP_IMPLEMENTATION ) ;
27- } ) ;
28-
29- it ( "should extract implementation address for matic proxy contract" , async ( ) => {
30- const resolved = resolveImplementation ( POLYGON_USDT_PROXY_CONTRACT ) ;
31- expect ( ( await resolved ) . address ) . to . equal (
32- POLYGON_USDT_IMPLEMENTATION . toLowerCase ( ) ,
33- ) ;
34- } ) ;
35-
36- it ( "should extract implementation address for base USDC proxy contract" , async ( ) => {
37- const resolved = resolveImplementation ( BASE_USDC_PROXY_CONTRACT ) ;
38- expect ( ( await resolved ) . address ) . to . equal (
39- BASE_USDC_IMPLEMENTATION . toLowerCase ( ) ,
40- ) ;
41- } ) ;
42-
43- it ( "should extract implementation address for ERC1967 proxy contract" , async ( ) => {
44- const implementationAddress = await deployContract ( {
45- client : TEST_CLIENT ,
46- chain : ANVIL_CHAIN ,
47- account : TEST_ACCOUNT_A ,
48- bytecode : DUMMY_BYTECODE ,
49- abi : [ ] ,
23+ describe . runIf ( process . env . TW_SECRET_KEY ) (
24+ "Resolve implementation" ,
25+ async ( ) => {
26+ it ( "should extract implementation address for minimal proxy contract" , async ( ) => {
27+ const resolved = resolveImplementation ( NFT_DROP_CONTRACT ) ;
28+ expect ( ( await resolved ) . address ) . to . equal ( NFT_DROP_IMPLEMENTATION ) ;
5029 } ) ;
5130
52- const proxyAddress = await deployContract ( {
53- client : TEST_CLIENT ,
54- chain : ANVIL_CHAIN ,
55- account : TEST_ACCOUNT_A ,
56- bytecode : ERC1967_PROXY_BYTECODE ,
57- abi : ERC1967_PROXY_CONSTRUCTOR_ABI as Abi ,
58- constructorParams : {
59- logic : implementationAddress ,
60- data : "0x" ,
61- } ,
31+ it ( "should extract implementation address for matic proxy contract" , async ( ) => {
32+ const resolved = resolveImplementation ( POLYGON_USDT_PROXY_CONTRACT ) ;
33+ expect ( ( await resolved ) . address ) . to . equal (
34+ POLYGON_USDT_IMPLEMENTATION . toLowerCase ( ) ,
35+ ) ;
6236 } ) ;
6337
64- const proxy = getContract ( {
65- chain : ANVIL_CHAIN ,
66- address : proxyAddress ,
67- client : TEST_CLIENT ,
38+ it ( "should extract implementation address for base USDC proxy contract" , async ( ) => {
39+ const resolved = resolveImplementation ( BASE_USDC_PROXY_CONTRACT ) ;
40+ expect ( ( await resolved ) . address ) . to . equal (
41+ BASE_USDC_IMPLEMENTATION . toLowerCase ( ) ,
42+ ) ;
6843 } ) ;
6944
70- const resolved = await resolveImplementation ( proxy ) ;
71- expect ( resolved . address ) . to . equal ( implementationAddress ) ;
72- } ) ;
73- } ) ;
45+ it ( "should extract implementation address for ERC1967 proxy contract" , async ( ) => {
46+ const implementationAddress = await deployContract ( {
47+ client : TEST_CLIENT ,
48+ chain : ANVIL_CHAIN ,
49+ account : TEST_ACCOUNT_A ,
50+ bytecode : DUMMY_BYTECODE ,
51+ abi : [ ] ,
52+ } ) ;
53+
54+ const proxyAddress = await deployContract ( {
55+ client : TEST_CLIENT ,
56+ chain : ANVIL_CHAIN ,
57+ account : TEST_ACCOUNT_A ,
58+ bytecode : ERC1967_PROXY_BYTECODE ,
59+ abi : ERC1967_PROXY_CONSTRUCTOR_ABI as Abi ,
60+ constructorParams : {
61+ logic : implementationAddress ,
62+ data : "0x" ,
63+ } ,
64+ } ) ;
65+
66+ const proxy = getContract ( {
67+ chain : ANVIL_CHAIN ,
68+ address : proxyAddress ,
69+ client : TEST_CLIENT ,
70+ } ) ;
71+
72+ const resolved = await resolveImplementation ( proxy ) ;
73+ expect ( resolved . address ) . to . equal ( implementationAddress ) ;
74+ } ) ;
75+ } ,
76+ ) ;
0 commit comments