-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from dephy-io/feat/factory-upgradeable
feat: factory upgradeable, device simulator
- Loading branch information
Showing
76 changed files
with
5,430 additions
and
1,940 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"BaseSepolia": { | ||
"ProductFactory": "0x51FF9b79616973da54b68771099C7942519bC0BC", | ||
"ProductFactory": "0xC487C07f0e31d63a840157cBcC316FBcBbFc6088", | ||
"ProductImpl": "0x647d77324E241709BaF63D7f96F0C19ecA06E2e0" | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
packages: | ||
- "." | ||
- "tool" | ||
- "tool/demo" | ||
- "tool/**" | ||
- "templates" |
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 |
---|---|---|
@@ -1,15 +1,23 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.24; | ||
|
||
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; | ||
import {ProductFactory} from "../contracts/ProductFactory.sol"; | ||
import "forge-std/Script.sol"; | ||
|
||
contract DeployProductFactory is Script { | ||
function run() public returns (address) { | ||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
ProductFactory factory = new ProductFactory(vm.addr(deployerPrivateKey)); | ||
ProductFactory factoryImpl = new ProductFactory(); | ||
ERC1967Proxy factoryProxy = new ERC1967Proxy( | ||
address(factoryImpl), | ||
abi.encodeWithSelector( | ||
ProductFactory.initialize.selector, | ||
vm.addr(deployerPrivateKey) | ||
) | ||
); | ||
vm.stopBroadcast(); | ||
return address(factory); | ||
return address(factoryProxy); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.24; | ||
|
||
import {ProductFactory} from "../../contracts/ProductFactory.sol"; | ||
|
||
contract ProductFactoryV2 is ProductFactory { | ||
function initialize(address initialOwner) public override reinitializer(2) { | ||
__Ownable_init(initialOwner); | ||
__EIP712_init("ProductFactory", "2"); | ||
__ReentrancyGuard_init(); | ||
__Pausable_init(); | ||
__UUPSUpgradeable_init(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.