-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
67 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity >=0.8.23 <0.9.0; | ||
|
||
import "./DeployBase.s.sol"; | ||
import "../src/upgradeables/DocumentStoreUpgradeable.sol"; | ||
import {DeployUtils} from "../src/libraries/DeployUtils.sol"; | ||
|
||
contract DocumentStoreUpgradeableScript is DeployBaseScript { | ||
function run(string memory name, address admin) public returns (DocumentStoreUpgradeable ds) { | ||
_requireParams(name, admin); | ||
|
||
console2.log("DocumentStore Name: ", name); | ||
console2.log("DocumentStore Admin: ", admin); | ||
|
||
vm.broadcast(); | ||
(address pAddr, ) = DeployUtils.deployDocumentStoreUpgradeable(name, admin); | ||
ds = DocumentStoreUpgradeable(pAddr); | ||
} | ||
|
||
function _requireParams(string memory name, address admin) private pure { | ||
require(bytes(name).length > 0, "Name is required"); | ||
require(admin != address(0), "Admin address is required"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity >=0.8.23 <0.9.0; | ||
|
||
import "./DeployBase.s.sol"; | ||
import "../src/upgradeables/OwnableDocumentStoreUpgradeable.sol"; | ||
import {DeployUtils} from "../src/libraries/DeployUtils.sol"; | ||
|
||
contract OwnableDocumentStoreUpgradeableScript is DeployBaseScript { | ||
function run( | ||
string memory name, | ||
string memory symbol, | ||
address admin | ||
) public returns (OwnableDocumentStoreUpgradeable ds) { | ||
_requireParams(name, symbol, admin); | ||
|
||
console2.log("OwnableDocumentStore Name: ", name); | ||
console2.log("OwnableDocumentStore Symbol: ", symbol); | ||
console2.log("OwnableDocumentStore Admin: ", admin); | ||
|
||
vm.broadcast(); | ||
(address pAddr, ) = DeployUtils.deployOwnableDocumentStoreUpgradeable(name, symbol, admin); | ||
ds = OwnableDocumentStoreUpgradeable(pAddr); | ||
} | ||
|
||
function _requireParams(string memory name, string memory symbol, address admin) private pure { | ||
require(bytes(name).length > 0, "Name is required"); | ||
require(bytes(symbol).length > 0, "Symbol is required"); | ||
require(admin != address(0), "Admin address is required"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters