Skip to content

Commit

Permalink
add gas check
Browse files Browse the repository at this point in the history
  • Loading branch information
stevennevins committed Sep 16, 2023
1 parent 2cd8816 commit 93517e5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/Create2.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {Test} from "forge-std/Test.sol";
import Test} from "forge-std/Test.sol";

contract Emitter {
event Ping();
Expand Down Expand Up @@ -41,4 +41,17 @@ contract Create2Test is Test {

Emitter(predictedTo).ping();
}

function testGas_Create2MinimalProxy() public {
vm.pauseGasMetering();
address implementation;
bytes memory creationCode = bytes.concat(
hex"3d602d80600a3d3981f3363d3d373d3d3d363d73", bytes20(implementation), hex"5af43d82803e903d91602b57fd5bf3"
);
bytes32 salt;
bytes memory initCode = bytes.concat(creationCode, abi.encode());

vm.resumeGasMetering();
(bool success,) = CREATE2_FACTORY.call(bytes.concat(salt, initCode));
}
}

0 comments on commit 93517e5

Please sign in to comment.