diff --git a/README.md b/README.md index 5f76ac0..a58a10b 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,4 @@ -# Shardeum Dapp Boilerplate - -![Homepage](/homepage.png) - -Welcome to the Shardeum Dapp Boilerplate repository! This is a comprehensive starting point for rapid prototyping your ideas on Shardeum. - -This boilerplate is great for: - -✅ Learning Blockchain fundmentals - -✅ Hackathon participants - -✅ Experiencing Shardeum +# myDapp ## 🚀 Getting Started @@ -29,9 +17,9 @@ Your boilerplate is now ready and running on your local machine! Alternatively, you can manually set up the boilerplate by cloning the repository and installing the necessary dependencies: ``` -git clone https://github.com/Shardeum/shardeum-dapp-boilerplate +git clone https://github.com/etherbiln/myDapp -cd shardeum-dapp-boilerplate +cd myDapp npm install diff --git a/contracts/SwapToken.sol b/contracts/SwapToken.sol index 496e8a5..53cd491 100644 --- a/contracts/SwapToken.sol +++ b/contracts/SwapToken.sol @@ -47,10 +47,16 @@ contract SwapToken { return amounts[2]; } + + event SwapSHMForTST(address indexed user, uint amountIn, uint amountOut); + function swapSHMForTST( uint amountOutDesired, uint amountInMax ) external returns (uint amountOut) { + require(amountOutDesired > 0, "Invalid amountOutDesired"); + require(amountInMax > 0, "Invalid amountInMax"); + shm.transferFrom(msg.sender, address(this), amountInMax); shm.approve(address(uniswapRouter), amountInMax); @@ -72,7 +78,7 @@ contract SwapToken { if (amounts[0] < amountInMax) { shm.transfer(msg.sender, amountInMax - amounts[0]); } - + emit SwapSHMForTST(msg.sender, amounts[0], amounts[2]); return amounts[2]; } } diff --git a/homepage.png b/homepage.png deleted file mode 100644 index 7cb5370..0000000 Binary files a/homepage.png and /dev/null differ diff --git a/package-lock.json b/package-lock.json index ba1428d..6e8a5db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "shardeum-dapp-boilerplate", + "name": "myDapp", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "shardeum-dapp-boilerplate", + "name": "myDapp", "version": "0.1.0", "dependencies": { "@ant-design/icons": "^5.2.6", @@ -10254,7 +10254,6 @@ "version": "5.3.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", - "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index 1960d50..c953d7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "shardeum-dapp-boilerplate", - "version": "0.1.0", + "name": "myDapp", + "version": "0.1.1", "private": true, "scripts": { "dev": "next dev", @@ -45,6 +45,6 @@ "typescript": "^5.3.3" }, "bin": { - "shardeum-dapp-boilerplate": "./src/pages/index.js" + "myDapp": "./src/pages/index.js" } } diff --git a/public/logo.png b/public/logo.png index f7cc6f0..4572819 100644 Binary files a/public/logo.png and b/public/logo.png differ diff --git a/src/components/Header.js b/src/components/Header.js index e8a67ea..ecb815a 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -68,7 +68,7 @@ const WalletHeader = () => { return (
- Logo + Logo