项目创建

创建文件夹

 mkdir Duckereum
 
 cdDuckereum

 

添加nodejs配置

 npm init -y

 

安装依赖添加

 npm install -D hardhat
 npm install --save ethers
 npm install @nomiclabs/hardhat-waffle
 npm install -D @nomiclabs/hardhat-ethers
 npm install @openzeppelin/contracts
 npm install --save-dev @nomiclabs/hardhat-etherscan

 

添加hardhat配置文件

 npx hardhat
 
 //选择create an empty hardhat.config.js

 

修改hardhat.config.js配置文件

引入@nomiclabs/hardhat-waffle依赖

其中solidity的编译器版本应根据自身项目做改动

 /** @type import('hardhat/config').HardhatUserConfig */
 require('@nomiclabs/hardhat-waffle');
 module.exports = {
   solidity: "0.8.4",
 };
 

 

创建合约文件夹

 mkdir contracts
 cd contracts

 

编写合约

 // SPDX-License-Identifier: MIT
 pragma solidity ^0.8.4;
 
 
 /*
 *         _         _         _         _         _         _         _          
 *       >(')____, >(')____, >(')____, >(')____, >(')____, >(')____, >(')____,  
 *         (` =~~/   (` =~~/   (` =~~/   (` =~~/   (` =~~/   (` =~~/   (` =~~/  
 *     ^~^~^`---'~^~^~^`---'~^~^~^`---'~^~^~^`---'~^~^~^`---'~^~^~^`---'~^~^~^`---'~^~^
 *
 *     GM DUCKERS,
 *
 *     Ah, we see you. You're thinking it's yet another meme currency...
 *     You're wrong. Well, yes, of course, Duckereum is a meme currency,
 *     but it is (according to us) the only one that exists besides Dogecoin.
 *
 *     Duckereum has no other purpose than to make crypto fun again.
 *     We have no marketcap goals, we don't encourage people to buy,
 *     we don't use weird techniques to inflate the US dollar value of our token.
 *    
 *     We're here to have a good time with you. Every week,
 *     a meme contest is organised by the team, the community votes the winner
 *     who then receives a number of Duckereums known in advance,
 *     regardless of its value in US dollars. Every week,
 *     Mark Duckerberg, the project's creator, keeps a diary
 *     in which he tells the story of the Duckereum adventure.
 *      
 *     No burn, no tax, no inflation, no deflation, no buy back,
 *     locked liquidity and renounced contract.
 *     Community spirit and lightness are at the heart of Duckereum.
 *     For us, it's all about the adventure, not the ranking on CoinMarketCap.
 *     Do you like it? Then, join us!
 *     You don't have to buy Duckereum, just bring your good humour and sympathy,
 *     and take part in our meme contests to win some Duckereum.
 *    
 *     See you soon, duckers!
 *    
 *     Website:     https://duckereum.com
 *     Reddit:       https://reddit.com/r/duckereum
 *     Twitter:     https://twitter.com/duckereum
 *     Telegram:     https://t.me/duckereum
 *     Medium:       https://duckereum.medium.com
 *    
 *
 *     888888ba                   dP                                                      
 *     88   `8b                   88                                                      
 *     88     88 dP   dP .d8888b. 88 .dP .d8888b. 88d888b. .d8888b. dP   dP 88d8b.d8b.
 *     88     88 88   88 88' `"" 88888"   88ooood8 88' `88 88ooood8 88   88 88'`88'`88
 *     88   .8P 88. .88 88. ... 88 `8b. 88. ... 88       88. ... 88. .88 88 88 88
 *     8888888P `88888P' `88888P' dP   `YP `88888P' dP       `88888P' `88888P' dP dP dP  
 *                                                                                                          
 *                                        
 *
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&BY?!~7YPGPYYY5G#&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@P7~^:..........:::~Y@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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P.....       .:......::.   ....B@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@&^....                     ... 7@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@@B^^::................ ..... 7@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Y~~~~^^^^^^^^^^^:..........5@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@7~~~~!^::^^:::^^........:#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@5~~~~:.................~@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@P~~~~^................^B@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@7~~~~.................!&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@J!~~~~:...............:&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@@@@@#Y?~~~~~~^:.......:.....^P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@@@BY!!~~~~~~~~!:.............:!&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@@@@57~~~~~~~~~~~~:..............:5@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@@@@#5J~^^^~~~~~^::...............^:^G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@@@&P5!^^~~^:~~~~~....................:5@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@&Y~~~~^^~~~~~~^:......................~?&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@@@@B~~~~~^~~~~^~~........................^~7@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@@@&GP?~~~~~^^~~~^^..........................~B@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@@#5?^~^^~^:~:~~::.. .........................:Y@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *@@@@@@G^^^::.::^^^:^^^.............................:~7#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 *
 *
 *    
 *     Duckereum, by Mark Duckerberg
 *             Warren Duckett
 *             M0THER Ducker
 *
 *
 */
 
 
 import "@openzeppelin/contracts/access/Ownable.sol";
 import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
 import "@openzeppelin/contracts/utils/math/SafeMath.sol";
 
 contract Duckereum is ERC20, Ownable {
 
     using SafeMath for uint256;
 
     mapping(address => bool) private pair;
     bool public tradingOpen;