@@ -7,16 +7,15 @@ import {
7
7
ProxyFactory__factory ,
8
8
} from '../../../typechain' ;
9
9
import { ProxyCreatedEvent } from '../../../typechain/src/utils/deployment/ProxyFactory' ;
10
- import {
11
- ADDRESS ,
12
- findEvent ,
13
- PROXY_FACTORY_EVENTS ,
14
- } from '@aragon/osx-commons-sdk' ;
10
+ import { findEvent } from '@aragon/osx-commons-sdk' ;
15
11
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers' ;
16
12
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' ;
17
13
import { expect } from 'chai' ;
18
14
import { ethers } from 'hardhat' ;
19
15
16
+ const ADDRESS_ZERO = `0x${ '0' . repeat ( 40 ) } ` ;
17
+ const ADDRESS_LAST = `0x${ 'f' . repeat ( 40 ) } ` ;
18
+
20
19
describe ( 'ProxyFactory' , function ( ) {
21
20
describe ( 'deployUUPSProxy' , function ( ) {
22
21
it ( 'deploys an initialized proxy if initialization data is provided' , async ( ) => {
@@ -32,9 +31,9 @@ describe('ProxyFactory', function () {
32
31
const tx = await proxyFactory . deployUUPSProxy ( initCalldata ) ;
33
32
34
33
// Get the proxy address from the event
35
- const event = await findEvent < ProxyCreatedEvent > (
36
- tx ,
37
- PROXY_FACTORY_EVENTS . ProxyCreated
34
+ const event = findEvent < ProxyCreatedEvent > (
35
+ await tx . wait ( ) ,
36
+ ' ProxyCreated'
38
37
) ;
39
38
const proxy = PluginUUPSUpgradeableMockBuild1__factory . connect (
40
39
event . args . proxy ,
@@ -61,8 +60,8 @@ describe('ProxyFactory', function () {
61
60
62
61
// Get the proxy address from the event
63
62
const event = await findEvent < ProxyCreatedEvent > (
64
- tx ,
65
- PROXY_FACTORY_EVENTS . ProxyCreated
63
+ await tx . wait ( ) ,
64
+ ' ProxyCreated'
66
65
) ;
67
66
const proxy = PluginUUPSUpgradeableMockBuild1__factory . connect (
68
67
event . args . proxy ,
@@ -75,7 +74,7 @@ describe('ProxyFactory', function () {
75
74
. to . equal ( implementation . address ) ;
76
75
77
76
// Check that the proxy is not initialized
78
- expect ( await proxy . dao ( ) ) . to . equal ( ADDRESS . ZERO ) ;
77
+ expect ( await proxy . dao ( ) ) . to . equal ( ADDRESS_ZERO ) ;
79
78
expect ( await proxy . state1 ( ) ) . to . equal ( 0 ) ;
80
79
} ) ;
81
80
} ) ;
@@ -89,9 +88,9 @@ describe('ProxyFactory', function () {
89
88
const tx = await proxyFactory . deployMinimalProxy ( initCalldata ) ;
90
89
91
90
// Get the proxy address from the event
92
- const event = await findEvent < ProxyCreatedEvent > (
93
- tx ,
94
- PROXY_FACTORY_EVENTS . ProxyCreated
91
+ const event = findEvent < ProxyCreatedEvent > (
92
+ await tx . wait ( ) ,
93
+ ' ProxyCreated'
95
94
) ;
96
95
const proxy = PluginCloneableMockBuild1__factory . connect (
97
96
event . args . proxy ,
@@ -111,16 +110,16 @@ describe('ProxyFactory', function () {
111
110
112
111
// Get the proxy address from the event
113
112
const event = await findEvent < ProxyCreatedEvent > (
114
- tx ,
115
- PROXY_FACTORY_EVENTS . ProxyCreated
113
+ await tx . wait ( ) ,
114
+ ' ProxyCreated'
116
115
) ;
117
116
const proxy = PluginCloneableMockBuild1__factory . connect (
118
117
event . args . proxy ,
119
118
deployer
120
119
) ;
121
120
122
121
// Check that the proxy is not initialized
123
- expect ( await proxy . dao ( ) ) . to . equal ( ADDRESS . ZERO ) ;
122
+ expect ( await proxy . dao ( ) ) . to . equal ( ADDRESS_ZERO ) ;
124
123
expect ( await proxy . state1 ( ) ) . to . equal ( 0 ) ;
125
124
} ) ;
126
125
} ) ;
@@ -146,7 +145,7 @@ async function uupsProxyFixture(): Promise<FixtureResult> {
146
145
) ;
147
146
148
147
// Create a mock address with a valid checksum
149
- const daoMockAddr = ethers . utils . getAddress ( ADDRESS . LAST ) ;
148
+ const daoMockAddr = ethers . utils . getAddress ( ADDRESS_LAST ) ;
150
149
151
150
const initCalldata = implementation . interface . encodeFunctionData (
152
151
'initialize' ,
@@ -168,7 +167,7 @@ async function minimalProxyFixture(): Promise<FixtureResult> {
168
167
) ;
169
168
170
169
// Create a mock address with a valid checksum
171
- const daoMockAddr = ethers . utils . getAddress ( ADDRESS . LAST ) ;
170
+ const daoMockAddr = ethers . utils . getAddress ( ADDRESS_LAST ) ;
172
171
173
172
const initCalldata = implementation . interface . encodeFunctionData (
174
173
'initialize' ,
0 commit comments