Skip to content

Commit 8c1bccb

Browse files
committed
chore: update test, add salts and expected addr
1 parent 400b9ab commit 8c1bccb

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

script/Deploy.s.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ contract DeployScript is Script {
1111
address public proxyLoaderOwner = 0xDdF32240B4ca3184De7EC8f0D5Aba27dEc8B7A5C;
1212
address public expectedDeployAddress = 0x658ce9D45885BCE9682e5c07c9E7982610c7aB37;
1313

14-
bytes32 public proxySalt = 0; // TODO
15-
address public proxyAddress = address(0); // TODO
14+
bytes32 public proxySalt = 0x0000000000000000000000000000000000000000d0cdac1fc979ce15f752cd13;
15+
address public proxyAddress = 0x0000000000Fe335F59B373055a9865eE4c2cFb3e;
1616

1717
function run() public {
1818
address proxyLoader = address(new AlchemyProxyLoader{salt: 0}(proxyLoaderOwner));

test/AlchemyProxyLoader.t.sol

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,24 @@ contract AlchemyProxyLoaderTest is Test {
6464
assertEq(predicted, 0x39A37979BB4a14e3Cdd1D7Ba8475f588f5b13E5F);
6565
}
6666

67-
function test_getDeployedProxyInitcode() public pure {
67+
function test_getDeployedProxyInitcode() public {
68+
vm.startPrank(CREATE2_FACTORY);
69+
6870
bytes32 bytecodeHash = keccak256(
6971
abi.encodePacked(
70-
type(ERC1967Proxy).creationCode, abi.encode(address(0xea8ea085589afBA8C5DA2808F150AC14fA10BA78), "")
72+
type(ERC1967Proxy).creationCode, abi.encode(address(0x39A37979BB4a14e3Cdd1D7Ba8475f588f5b13E5F), "")
73+
)
74+
);
75+
assertEq(bytecodeHash, 0x6baa9034371dd10a8709f2482eb766c1feb485e65df35a46ecc2b43539ca54ec);
76+
address proxyLoader =
77+
address(new AlchemyProxyLoader{salt: 0}(address(0xDdF32240B4ca3184De7EC8f0D5Aba27dEc8B7A5C)));
78+
console.logAddress(proxyLoader);
79+
80+
address proxy = address(
81+
new ERC1967Proxy{salt: 0x0000000000000000000000000000000000000000d0cdac1fc979ce15f752cd13}(
82+
address(0x39A37979BB4a14e3Cdd1D7Ba8475f588f5b13E5F), ""
7183
)
7284
);
73-
assertEq(bytecodeHash, 0xfffaf8b8e37203f5fe0847c9dd2263b193696d77f7dd48fd0cc06ba44478620b);
85+
assertEq(proxy, 0x0000000000Fe335F59B373055a9865eE4c2cFb3e);
7486
}
7587
}

0 commit comments

Comments
 (0)