diff --git a/README.md b/README.md index 845a920..82fd54a 100644 --- a/README.md +++ b/README.md @@ -228,9 +228,9 @@ Hardhat is an Ethereum development environment and framework designed for full s // Burn the sent LP tokens from the user's wallet because they are already sent to // remove liquidity _burn(msg.sender, _amount); - // Transfer `ethAmount` of Eth from user's wallet to the contract + // Transfer `ethAmount` of Eth from the contract to the user's wallet payable(msg.sender).transfer(ethAmount); - // Transfer `cryptoDevTokenAmount` of Crypto Dev tokens from the user's wallet to the contract + // Transfer `cryptoDevTokenAmount` of Crypto Dev tokens from the contract to the user's wallet ERC20(cryptoDevTokenAddress).transfer(msg.sender, cryptoDevTokenAmount); return (ethAmount, cryptoDevTokenAmount); } @@ -1229,7 +1229,6 @@ export default function Home() { setCDBalance(_cdBalance); setLPBalance(_lpBalance); setReservedCD(_reservedCD); - setReservedCD(_reservedCD); setEtherBalanceContract(_ethBalanceContract); } catch (err) { console.error(err); diff --git a/hardhat-tutorial/contracts/Exchange.sol b/hardhat-tutorial/contracts/Exchange.sol index a0515da..1e1782f 100644 --- a/hardhat-tutorial/contracts/Exchange.sol +++ b/hardhat-tutorial/contracts/Exchange.sol @@ -99,7 +99,7 @@ contract Exchange is ERC20 { _burn(msg.sender, _amount); // Transfer `ethAmount` of Eth from the contract to the user payable(msg.sender).transfer(ethAmount); - // Transfer `cryptoDevTokenAmount` of `Crypto Dev` tokens from the user's wallet to the contract + // Transfer `cryptoDevTokenAmount` of `Crypto Dev` tokens from the contract to the user's wallet ERC20(cryptoDevTokenAddress).transfer(msg.sender, cryptoDevTokenAmount); return (ethAmount, cryptoDevTokenAmount); } diff --git a/hardhat-tutorial/scripts/deploy.js b/hardhat-tutorial/scripts/deploy.js index cac363b..edaceed 100644 --- a/hardhat-tutorial/scripts/deploy.js +++ b/hardhat-tutorial/scripts/deploy.js @@ -1,5 +1,5 @@ const { ethers } = require("hardhat"); -require("dotenv").config({ path: ".env" }); + const { CRYPTO_DEV_TOKEN_CONTRACT_ADDRESS } = require("../constants"); async function main() { diff --git a/my-app/pages/index.js b/my-app/pages/index.js index 05b3736..023075f 100644 --- a/my-app/pages/index.js +++ b/my-app/pages/index.js @@ -91,7 +91,6 @@ export default function Home() { setCDBalance(_cdBalance); setLPBalance(_lpBalance); setReservedCD(_reservedCD); - setReservedCD(_reservedCD); setEtherBalanceContract(_ethBalanceContract); } catch (err) { console.error(err);