Skip to content

Commit

Permalink
feat: Remove redundant documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
maurelian committed Sep 13, 2024
1 parent 133a8e6 commit 9a3fa1a
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions packages/contracts-bedrock/scripts/DeployAuthSystem.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,7 @@ contract DeployAuthSystemOutput is CommonBase {
}
}

// For all broadcasts in this script we explicitly specify the deployer as `msg.sender` because for
// testing we deploy this script from a test contract. If we provide no argument, the foundry
// default sender would be the broadcaster during test, but the broadcaster needs to be the deployer
// since they are set to the initial proxy admin owner.
contract DeployAuthSystem is Script {
// -------- Core Deployment Methods --------

// This entrypoint is for end-users to deploy from an input file and write to an output file.
// In this usage, we don't need the input and output contract functionality, so we deploy them
// here and abstract that architectural detail away from the end user.
function run(string memory _infile, string memory _outfile) public {
// End-user without file IO, so etch the IO helper contracts.
(DeployAuthSystemInput dasi, DeployAuthSystemOutput daso) = etchIOContracts();
Expand All @@ -102,17 +93,13 @@ contract DeployAuthSystem is Script {
daso.writeOutputFile(_outfile);
}

// This entrypoint is useful for testing purposes, as it doesn't use any file I/O.
function run(DeployAuthSystemInput _dasi, DeployAuthSystemOutput _daso) public {
deploySafe(_dasi, _daso);
}

function deploySafe(DeployAuthSystemInput _dasi, DeployAuthSystemOutput _daso) public {
address[] memory owners = _dasi.owners();
uint256 threshold = _dasi.threshold();
// Silence unused variable warnings
owners;
threshold;

// TODO: replace with a real deployment. The safe deployment logic is fairly complex, so for the purposes of
// this scaffolding PR we'll just etch the code.
Expand All @@ -126,10 +113,6 @@ contract DeployAuthSystem is Script {
_daso.set(_daso.safe.selector, safe);
}

// This etches the IO contracts into memory so that we can use them in tests. When using file IO
// we don't need to call this directly, as the `DeployAuthSystem.run(file, file)` entrypoint
// handles it. But when interacting with the script programmatically (e.g. in a Solidity test),
// this must be called.
function etchIOContracts() public returns (DeployAuthSystemInput dasi_, DeployAuthSystemOutput daso_) {
(dasi_, daso_) = getIOContracts();
vm.etch(address(dasi_), type(DeployAuthSystemInput).runtimeCode);
Expand All @@ -138,7 +121,6 @@ contract DeployAuthSystem is Script {
vm.allowCheatcodes(address(daso_));
}

// This returns the addresses of the IO contracts for this script.
function getIOContracts() public view returns (DeployAuthSystemInput dasi_, DeployAuthSystemOutput daso_) {
dasi_ = DeployAuthSystemInput(DeployUtils.toIOAddress(msg.sender, "optimism.DeployAuthSystemInput"));
daso_ = DeployAuthSystemOutput(DeployUtils.toIOAddress(msg.sender, "optimism.DeployAuthSystemOutput"));
Expand Down

0 comments on commit 9a3fa1a

Please sign in to comment.