Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
uniswap-v2-periphery
Discontinued 🎚 Peripheral smart contracts for interacting with Uniswap V2 [Moved to: https://github.com/Uniswap/v2-periphery]
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Any of those above functions that have require statements could have triggered it. I guess that is why you suggested the "hardhats console log". I am not familiar with that and will get right on trying to get that to work. Sorry for slow response, it seems since your message I have went all up and down the entire uniswap code database that includes the router, pair, libraries, transferhelper, WETH, etc.... So I just had the most extensive crash course I have ever had. hahahaha... Thanks for pointing me in that direction. I have learned A LOT. Though I still haven't figured out why the error is happening so I will now try using the hardhats console log to debug it.
Any of those above functions that have require statements could have triggered it. I guess that is why you suggested the "hardhats console log". I am not familiar with that and will get right on trying to get that to work. Sorry for slow response, it seems since your message I have went all up and down the entire uniswap code database that includes the router, pair, libraries, transferhelper, WETH, etc.... So I just had the most extensive crash course I have ever had. hahahaha... Thanks for pointing me in that direction. I have learned A LOT. Though I still haven't figured out why the error is happening so I will now try using the hardhats console log to debug it.
Any of those above functions that have require statements could have triggered it. I guess that is why you suggested the "hardhats console log". I am not familiar with that and will get right on trying to get that to work. Sorry for slow response, it seems since your message I have went all up and down the entire uniswap code database that includes the router, pair, libraries, transferhelper, WETH, etc.... So I just had the most extensive crash course I have ever had. hahahaha... Thanks for pointing me in that direction. I have learned A LOT. Though I still haven't figured out why the error is happening so I will now try using the hardhats console log to debug it.
Any of those above functions that have require statements could have triggered it. I guess that is why you suggested the "hardhats console log". I am not familiar with that and will get right on trying to get that to work. Sorry for slow response, it seems since your message I have went all up and down the entire uniswap code database that includes the router, pair, libraries, transferhelper, WETH, etc.... So I just had the most extensive crash course I have ever had. hahahaha... Thanks for pointing me in that direction. I have learned A LOT. Though I still haven't figured out why the error is happening so I will now try using the hardhats console log to debug it.
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/interfaces/IUniswapV2Router02.sol"; contract ERC20Basic { string public constant name = "ERC20Basic"; string public constant symbol = "BaSiC"; uint8 public constant decimals = 18; address internal constant UNISWAP_ROUTER_ADDRESS = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ; IUniswapV2Router02 public uniswapV2Router; event Approval(address indexed tokenOwner, address indexed spender, uint tokens); event Transfer(address indexed from, address indexed to, uint tokens); mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; // uint256 private _totalSupply = 1 * 10**6 * 10**18; // 10 uint256 private _totalSupply;// 10 constructor(uint256 mintAmount) { // totalSupply_ = total; // balances[msg.sender] = totalSupply_; // _balances[msg.sender] = _totalSupply; mint(address(this), mintAmount); uniswapV2Router = IUniswapV2Router02(UNISWAP_ROUTER_ADDRESS); } function mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } function addLiquidity(uint256 tokenAmount) public payable { // approve token transfer to cover all possible scenarios _approve(address(this), address(uniswapV2Router), tokenAmount); // add the liquidity uniswapV2Router.addLiquidityETH{value: msg.value}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable address(this), block.timestamp ); } function totalSupply() public view returns (uint256) { return _totalSupply; }