File tree Expand file tree Collapse file tree 3 files changed +40
-4
lines changed Expand file tree Collapse file tree 3 files changed +40
-4
lines changed Original file line number Diff line number Diff line change 1
1
// SPDX-License-Identifier: MPL-2.0
2
2
pragma solidity = 0.8.9 ;
3
3
4
- import {Ownable } from "@openzeppelin/contracts/access/Ownable .sol " ;
4
+ import {OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable /access/OwnableUpgradeable .sol " ;
5
5
6
6
import {SBT} from "./SBT.sol " ;
7
7
import {SBTProxy} from "./SBTProxy.sol " ;
8
+ import {ISBTFactory} from "./interfaces/ISBTFactory.sol " ;
8
9
9
- contract SBTFactory is Ownable {
10
+ contract SBTFactory is ISBTFactory , OwnableUpgradeable {
10
11
mapping (bytes => address ) public sbtProxyMapping;
11
12
12
13
event SBTProxyCreated (bytes indexed identifier , address sbtProxyAddress );
@@ -15,15 +16,17 @@ contract SBTFactory is Ownable {
15
16
address sbtProxyAddress
16
17
);
17
18
18
- constructor () {}
19
+ function initialize () external initializer {
20
+ __Ownable_init ();
21
+ }
19
22
20
23
function makeNewSBT (
21
24
address proxyAdmin ,
22
25
bytes memory proxyCallData ,
23
26
address minterUpdater ,
24
27
address [] calldata minters ,
25
28
bytes calldata identifier
26
- ) external onlyOwner returns (address ) {
29
+ ) external override onlyOwner returns (address ) {
27
30
// Create the implementation.
28
31
address implementation = address (
29
32
new SBT {salt: keccak256 (identifier)}()
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: MPL-2.0
2
+ pragma solidity = 0.8.9 ;
3
+
4
+ import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol " ;
5
+
6
+ contract SBTFactoryProxy is TransparentUpgradeableProxy {
7
+ constructor (
8
+ address _logic ,
9
+ address admin_ ,
10
+ bytes memory _data
11
+ ) TransparentUpgradeableProxy (_logic, admin_, _data) {}
12
+ }
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: MPL-2.0
2
+ pragma solidity = 0.8.9 ;
3
+
4
+ interface ISBTFactory {
5
+ /*
6
+ * @dev makes new SBT contract which is upgradeable.
7
+ * @param proxyAdmin owner of the proxy contract which will be deployed.
8
+ * @param proxyCallData the data which denotes function calls, etc when deploying new proxy contract.
9
+ * @param minterUpdater the address which can add/remove minter access eoa.
10
+ * @param minters the array of minters which have rights to mint new sbts.
11
+ * @param identifier unique bytes to identify a deployed sbt proxy.
12
+ * @return uint256[] token id list
13
+ */
14
+ function makeNewSBT (
15
+ address proxyAdmin ,
16
+ bytes memory proxyCallData ,
17
+ address minterUpdater ,
18
+ address [] calldata minters ,
19
+ bytes calldata identifier
20
+ ) external returns (address );
21
+ }
You can’t perform that action at this time.
0 commit comments