|
2 | 2 | // SPDX-License-Identifier: Apache-2.0 |
3 | 3 | pragma solidity ^0.8.24; |
4 | 4 |
|
5 | | -import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; |
6 | | -import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; |
| 5 | +import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; |
| 6 | +import {ERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; |
| 7 | +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; |
7 | 8 | import {RSA} from "@openzeppelin/contracts/utils/cryptography/RSA.sol"; |
8 | 9 | import {Base64} from "@openzeppelin/contracts/utils/Base64.sol"; |
9 | 10 | import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; |
10 | 11 | import {JsonClaim} from "./JsonClaim.sol"; |
11 | 12 |
|
12 | | -contract RIK is ERC721, Ownable { |
| 13 | +contract RIK is Initializable, ERC721Upgradeable, OwnableUpgradeable { |
13 | 14 | using RSA for bytes32; |
14 | 15 |
|
15 | 16 | struct RSAKey { |
@@ -45,7 +46,15 @@ contract RIK is ERC721, Ownable { |
45 | 46 | // NOTE: make it so contract owner can update this |
46 | 47 | string public constant EXPECTED_ISS = "https://token.actions.githubusercontent.com"; |
47 | 48 |
|
48 | | - constructor(address initialOwner) ERC721("Repository Identity Key", "RIK") Ownable(initialOwner) {} |
| 49 | + /// @custom:oz-upgrades-unsafe-allow constructor |
| 50 | + constructor() { |
| 51 | + _disableInitializers(); |
| 52 | + } |
| 53 | + |
| 54 | + function initialize(address initialOwner) public initializer { |
| 55 | + __ERC721_init("Repository Identity Key", "RIK"); |
| 56 | + __Ownable_init(initialOwner); |
| 57 | + } |
49 | 58 |
|
50 | 59 | function register( |
51 | 60 | bytes32 kid, |
|
0 commit comments