|
|
@ -5,7 +5,39 @@ import init from '../helpers/init' |
|
|
|
import examples from '../examples/example-contracts' |
|
|
|
import examples from '../examples/example-contracts' |
|
|
|
|
|
|
|
|
|
|
|
const sources = [ |
|
|
|
const sources = [ |
|
|
|
{ 'Untitled.sol': { content: examples.ballot.content } } |
|
|
|
{ 'Untitled.sol': { content: examples.ballot.content } }, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
'myTokenV1.sol': { |
|
|
|
|
|
|
|
content: ` |
|
|
|
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
pragma solidity ^0.8.4; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; |
|
|
|
|
|
|
|
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; |
|
|
|
|
|
|
|
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; |
|
|
|
|
|
|
|
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contract MyToken is Initializable, ERC721Upgradeable, OwnableUpgradeable, UUPSUpgradeable { |
|
|
|
|
|
|
|
/// @custom:oz-upgrades-unsafe-allow constructor
|
|
|
|
|
|
|
|
constructor() { |
|
|
|
|
|
|
|
_disableInitializers(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function initialize() initializer public { |
|
|
|
|
|
|
|
__ERC721_init("MyToken", "MTK"); |
|
|
|
|
|
|
|
__Ownable_init(); |
|
|
|
|
|
|
|
__UUPSUpgradeable_init(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function _authorizeUpgrade(address newImplementation) |
|
|
|
|
|
|
|
internal |
|
|
|
|
|
|
|
onlyOwner |
|
|
|
|
|
|
|
override |
|
|
|
|
|
|
|
{} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
module.exports = { |
|
|
|
module.exports = { |
|
|
|