Commit 7987f523 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

contracts-bedrock: delete dead code (#9741)

* contracts-bedrock: delete dead code

There was some legacy code in the deploy script leftover from
the removal of hardhat deploy artifacts. This deletes that code
as its no longer needed.

* contracts-bedrock: cleanup comments
parent e21d1432
...@@ -18,6 +18,8 @@ struct Deployment { ...@@ -18,6 +18,8 @@ struct Deployment {
/// @title Artifacts /// @title Artifacts
/// @notice Useful for accessing deployment artifacts from within scripts. /// @notice Useful for accessing deployment artifacts from within scripts.
/// When a contract is deployed, call the `save` function to write its name and
/// contract address to disk. Inspired by `forge-deploy`.
abstract contract Artifacts { abstract contract Artifacts {
/// @notice Foundry cheatcode VM. /// @notice Foundry cheatcode VM.
Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));
......
...@@ -48,13 +48,6 @@ library Config { ...@@ -48,13 +48,6 @@ library Config {
); );
} }
/// @notice Returns the name of the script used for deployment. This was useful for parsing the
/// foundry deploy artifacts to turn them into hardhat deploy style artifacts. It is now
/// DEPRECATED and will be removed in the future.
function deployScript(string memory _name) internal view returns (string memory _env) {
_env = vm.envOr("DEPLOY_SCRIPT", _name);
}
/// @notice Returns the sig of the entrypoint to the deploy script. By default, it is `run`. /// @notice Returns the sig of the entrypoint to the deploy script. By default, it is `run`.
/// This was useful for creating hardhat deploy style artifacts and will be removed in a future release. /// This was useful for creating hardhat deploy style artifacts and will be removed in a future release.
function sig() internal view returns (string memory _env) { function sig() internal view returns (string memory _env) {
......
...@@ -270,7 +270,6 @@ contract Deploy is Deployer { ...@@ -270,7 +270,6 @@ contract Deploy is Deployer {
vm.store(address(cfg), USE_FAULT_PROOFS_SLOT, useFaultProofsOverride); vm.store(address(cfg), USE_FAULT_PROOFS_SLOT, useFaultProofsOverride);
} }
console.log("Deploying from %s", deployScript);
console.log("Deployment context: %s", deploymentContext); console.log("Deployment context: %s", deploymentContext);
} }
......
...@@ -35,7 +35,6 @@ contract DeployPeriphery is Deployer { ...@@ -35,7 +35,6 @@ contract DeployPeriphery is Deployer {
string memory path = string.concat(vm.projectRoot(), "/periphery-deploy-config/", deploymentContext, ".json"); string memory path = string.concat(vm.projectRoot(), "/periphery-deploy-config/", deploymentContext, ".json");
cfg = new PeripheryDeployConfig(path); cfg = new PeripheryDeployConfig(path);
console.log("Deploying from %s", deployScript);
console.log("Deployment context: %s", deploymentContext); console.log("Deployment context: %s", deploymentContext);
} }
......
...@@ -25,34 +25,10 @@ struct StorageSlot { ...@@ -25,34 +25,10 @@ struct StorageSlot {
/// @title Deployer /// @title Deployer
/// @author tynes /// @author tynes
/// @notice A contract that can make deploying and interacting with deployments easy. /// @notice A contract that can make deploying and interacting with deployments easy.
/// When a contract is deployed, call the `save` function to write its name and
/// contract address to disk. Inspired by `forge-deploy`.
abstract contract Deployer is Script, Artifacts { abstract contract Deployer is Script, Artifacts {
/// @notice Path to the deploy artifact generated by foundry /// @notice Sets up the artifacts contract.
string internal deployPath;
/// @notice The name of the deploy script that sends the transactions.
/// Can be modified with the env var DEPLOY_SCRIPT
string internal deployScript;
/// @notice Create the global variables and set up the filesystem.
/// Forge script will create a file where the prefix is the
/// name of the function that runs with the suffix `-latest.json`.
/// By default, `run()` is called. Allow the user to use the SIG
/// env var to specify what function signature was called so that
/// the `sync()` method can be used to create hardhat deploy style
/// artifacts.
function setUp() public virtual override { function setUp() public virtual override {
Artifacts.setUp(); Artifacts.setUp();
deployScript = Config.deployScript(name());
string memory sig = Config.sig();
string memory deployFile = Config.deployFile(sig);
uint256 chainId = Config.chainID();
deployPath = string.concat(
vm.projectRoot(), "/broadcast/", deployScript, ".s.sol/", vm.toString(chainId), "/", deployFile
);
} }
/// @notice Returns the name of the deployment script. Children contracts /// @notice Returns the name of the deployment script. Children contracts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment