Hi, 你好
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.9; | |
contract DeterministicDeployFactory { | |
event Deploy(address addr); | |
function deploy(bytes memory bytecode, uint _salt) external { | |
address addr; | |
assembly { | |
addr := create2(0, add(bytecode, 0x20), mload(bytecode), _salt) |
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity ^0.8.12; | |
/* solhint-disable avoid-low-level-calls */ | |
/* solhint-disable no-inline-assembly */ | |
/* solhint-disable reason-string */ | |
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; | |
import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; | |
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.7; | |
contract CountEmitLog { | |
event WantsToCount(address indexed msgSender); | |
constructor() {} | |
function emitCountLog() public { | |
emit WantsToCount(msg.sender); |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.20; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
/// @custom:security-contact mingderwang@me.com | |
contract My721Token is ERC721URIStorage, Ownable { | |
uint256 private _nextTokenId; |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.20; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
/// @custom:security-contact mingderwang@me.com | |
contract My721Token is ERC721URIStorage, Ownable { | |
uint256 private _nextTokenId; |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.20; | |
import "@openzeppelin/contracts@5.0.0/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts@5.0.0/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/contracts@5.0.0/access/Ownable.sol"; | |
contract MyToken721 is ERC721, ERC721URIStorage, Ownable { | |
uint256 private _nextTokenId; |
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
// your answer is to run following line first. | |
export NODE_OPTIONS=--openssl-legacy-provider |
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
$ node -v | |
v18.17.1 | |
$ git clone https://github.com/samar19/ming-erc20-token.git | |
Cloning into 'ming-erc20-token'... | |
remote: Enumerating objects: 52, done. | |
remote: Counting objects: 100% (52/52), done. | |
remote: Compressing objects: 100% (38/38), done. | |
remote: Total 52 (delta 18), reused 43 (delta 10), pack-reused 0 | |
Receiving objects: 100% (52/52), 214.26 KiB | 238.00 KiB/s, done. |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.9; | |
import "@openzeppelin/contracts-upgradeable@4.9.3/token/ERC20/ERC20Upgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable@4.9.3/token/ERC20/extensions/ERC20BurnableUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable@4.9.3/security/PausableUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable@4.9.3/access/AccessControlUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable@4.9.3/token/ERC20/extensions/ERC20PermitUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable@4.9.3/proxy/utils/Initializable.sol"; | |
import "@openzeppelin/contracts-upgradeable@4.9.3/proxy/utils/UUPSUpgradeable.sol"; |