- Update dbis_core, cross-chain-pmm-lps, explorer-monorepo, metamask-integration, pr-workspace/chains - Omit embedded publish git dirs and empty placeholders from index Made-with: Cursor
34 lines
1.1 KiB
Solidity
34 lines
1.1 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.11;
|
|
|
|
import "forge-std/Script.sol";
|
|
import "forge-std/console2.sol";
|
|
|
|
import { Create2Factory } from "../src/Create2Factory.sol";
|
|
import { Create2Probe } from "../src/Create2Probe.sol";
|
|
|
|
/// @notice Deploy Create2Factory then CREATE2-deploy Create2Probe; assert predicted == deployed.
|
|
contract Create2DeployTest is Script {
|
|
bytes32 constant SALT = keccak256("vmid-2103-create2-probe-v1");
|
|
|
|
function run() external {
|
|
vm.startBroadcast();
|
|
|
|
Create2Factory factory = new Create2Factory();
|
|
console2.log("Create2Factory", address(factory));
|
|
|
|
address predicted = factory.predictProbe(SALT);
|
|
console2.log("predicted probe", predicted);
|
|
|
|
address deployed = factory.deployProbe(SALT);
|
|
require(deployed == predicted, "CREATE2 address mismatch");
|
|
console2.log("deployed probe", deployed);
|
|
|
|
Create2Probe probe = Create2Probe(deployed);
|
|
require(probe.VMID_TAG() == 2103, "probe tag");
|
|
console2.log("VMID_TAG", probe.VMID_TAG());
|
|
|
|
vm.stopBroadcast();
|
|
}
|
|
}
|