|
7 | 7 | SignerWithAddress, |
8 | 8 | toWei, |
9 | 9 | getContractFactory, |
| 10 | + randomAddress, |
10 | 11 | seedContract, |
11 | 12 | avmL1ToL2Alias, |
12 | 13 | } from "../../../../utils/utils"; |
@@ -73,7 +74,7 @@ describe("ZkSync Spoke Pool", function () { |
73 | 74 | await owner.sendTransaction({ to: crossDomainAliasAddress, value: toWei("1") }); |
74 | 75 |
|
75 | 76 | zkErc20Bridge = await smock.fake(abiData.erc20DefaultBridge.abi, { address: ERC20_BRIDGE }); |
76 | | - zkUSDCBridge = zkErc20Bridge; |
| 77 | + zkUSDCBridge = await smock.fake(abiData.erc20DefaultBridge.abi, { address: USDC_BRIDGE }); |
77 | 78 | l2Eth = await smock.fake(abiData.eth.abi, { address: abiData.eth.address }); |
78 | 79 | constructorArgs = [ |
79 | 80 | weth.address, |
@@ -123,9 +124,42 @@ describe("ZkSync Spoke Pool", function () { |
123 | 124 | }); |
124 | 125 | await expect(implementation).to.not.be.reverted; |
125 | 126 |
|
| 127 | + // Configure cctp |
| 128 | + _constructorArgs = [...constructorArgs]; |
| 129 | + _constructorArgs[2] = ZERO_ADDRESS; |
| 130 | + _constructorArgs[3] = randomAddress(); |
| 131 | + implementation = hre.upgrades.deployImplementation(await getContractFactory("ZkSync_SpokePool", owner), { |
| 132 | + kind: "uups", |
| 133 | + unsafeAllow: ["delegatecall"], |
| 134 | + constructorArgs: _constructorArgs, |
| 135 | + }); |
| 136 | + await expect(implementation).to.not.be.reverted; |
| 137 | + |
| 138 | + // Configure bridged USDC |
| 139 | + _constructorArgs = [...constructorArgs]; |
| 140 | + _constructorArgs[3] = ZERO_ADDRESS; |
| 141 | + implementation = hre.upgrades.deployImplementation(await getContractFactory("ZkSync_SpokePool", owner), { |
| 142 | + kind: "uups", |
| 143 | + unsafeAllow: ["delegatecall"], |
| 144 | + constructorArgs: _constructorArgs, |
| 145 | + }); |
| 146 | + await expect(implementation).to.not.be.reverted; |
| 147 | + |
| 148 | + // Configure none (misconfigured) |
| 149 | + _constructorArgs = [...constructorArgs]; |
126 | 150 | _constructorArgs[2] = ZERO_ADDRESS; |
127 | 151 | _constructorArgs[3] = ZERO_ADDRESS; |
| 152 | + implementation = hre.upgrades.deployImplementation(await getContractFactory("ZkSync_SpokePool", owner), { |
| 153 | + kind: "uups", |
| 154 | + unsafeAllow: ["delegatecall"], |
| 155 | + constructorArgs: _constructorArgs, |
| 156 | + }); |
| 157 | + await expect(implementation).to.be.reverted; |
128 | 158 |
|
| 159 | + // Configure both (misconfigured) |
| 160 | + _constructorArgs = [...constructorArgs]; |
| 161 | + _constructorArgs[2] = zkUSDCBridge.address; |
| 162 | + _constructorArgs[3] = randomAddress(); |
129 | 163 | implementation = hre.upgrades.deployImplementation(await getContractFactory("ZkSync_SpokePool", owner), { |
130 | 164 | kind: "uups", |
131 | 165 | unsafeAllow: ["delegatecall"], |
|
0 commit comments