-
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.
refactor: rename OwnableDocumentStore to TransferableDocumentStore
(cherry picked from commit 893541d5fbfe85afa57d740867f79fd92a6d0318)
- Loading branch information
Showing
19 changed files
with
157 additions
and
146 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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity >=0.8.23 <0.9.0; | ||
|
||
import { console2 } from "forge-std/console2.sol"; | ||
|
||
import { TransferableDocumentStoreDeployScript } from "./DeployBase.s.sol"; | ||
import "../src/TransferableDocumentStore.sol"; | ||
|
||
contract TransferableDocumentStoreScript is TransferableDocumentStoreDeployScript { | ||
function run(string memory name, string memory symbol, address admin) public returns (TransferableDocumentStore ds) { | ||
_requireParams(name, symbol, admin); | ||
|
||
console2.log("TransferableDocumentStore Name: ", name); | ||
console2.log("TransferableDocumentStore Symbol: ", symbol); | ||
console2.log("TransferableDocumentStore Admin: ", admin); | ||
|
||
if (tdsImplExists()) { | ||
bytes memory initData = abi.encodeWithSignature("initialize(string,string,address)", name, symbol, admin); | ||
|
||
vm.broadcast(); | ||
address dsAddr = clone(TDS_IMPL, initData); | ||
|
||
ds = TransferableDocumentStore(dsAddr); | ||
} else { | ||
vm.broadcast(); | ||
ds = new TransferableDocumentStore(name, symbol, admin); | ||
} | ||
} | ||
} |
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,23 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity >=0.8.23 <0.9.0; | ||
|
||
import { TransferableDocumentStoreDeployScript } from "./DeployBase.s.sol"; | ||
import "../src/initializables/TransferableDocumentStoreInitializable.sol"; | ||
|
||
contract TransferableDocumentStoreInitializableScript is TransferableDocumentStoreDeployScript { | ||
function run() public returns (TransferableDocumentStoreInitializable documentStore) { | ||
require(!dsImplExists(), "TransferableDocumentStoreInitializable already exists"); | ||
|
||
bytes memory initCode = abi.encodePacked(type(TransferableDocumentStoreInitializable).creationCode); | ||
|
||
bytes32 dsSalt = getTransferableDocumentStoreSalt(); | ||
|
||
address computedAddr = computeAddr(dsSalt); | ||
require(computedAddr == TDS_IMPL, "Bad deployment address"); | ||
|
||
vm.broadcast(); | ||
address dsAddr = deploy(dsSalt, initCode); | ||
|
||
documentStore = TransferableDocumentStoreInitializable(dsAddr); | ||
} | ||
} |
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,26 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity >=0.8.23 <0.9.0; | ||
|
||
import { console2 } from "forge-std/console2.sol"; | ||
|
||
import { TransferableDocumentStoreDeployScript } from "./DeployBase.s.sol"; | ||
import { DeployUtils } from "../src/libraries/DeployUtils.sol"; | ||
import "../src/upgradeables/TransferableDocumentStoreUpgradeable.sol"; | ||
|
||
contract TransferableDocumentStoreUpgradeableScript is TransferableDocumentStoreDeployScript { | ||
function run( | ||
string memory name, | ||
string memory symbol, | ||
address admin | ||
) public returns (TransferableDocumentStoreUpgradeable ds) { | ||
_requireParams(name, symbol, admin); | ||
|
||
console2.log("TransferableDocumentStore Name: ", name); | ||
console2.log("TransferableDocumentStore Symbol: ", symbol); | ||
console2.log("TransferableDocumentStore Admin: ", admin); | ||
|
||
vm.broadcast(); | ||
(address pAddr, ) = DeployUtils.deployTransferableDocumentStoreUpgradeable(name, symbol, admin); | ||
ds = TransferableDocumentStoreUpgradeable(pAddr); | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...nterfaces/IOwnableDocumentStoreErrors.sol → ...aces/ITransferableDocumentStoreErrors.sol
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
Oops, something went wrong.