Open aress31 opened 3 years ago
Please share details about your environment. In particular, what node are you running against?
I hope this helps:
npx truffle version
Truffle v5.3.2 (core: 5.3.2)
Solidity - 0.8.4 (solc-js)
Node v14.16.0
Web3.js v1.3.5
How are you running your tests, is it just truffle test
? What network are you running against? This is a weird error that I haven't seen before so as much data as you can provide to reproduce it, would help.
Yeah, just using npx truffle test --network development
and in local I run npx ganache-cli --fork https://ropsten.infura.io/v3/10cc02d0eec842c99af1653c011badc9
.
This is my constructor:
constructor(
string memory name_,
string memory symbol_,
uint8 decimals_,
uint256 totalSupply_,
address router_,
--- SNIP ---
) ERC20(name_, symbol_) {
_decimals = decimals_;
_totalSupply = totalSupply_ * (10**decimals_);
--- SNIP ---
// Set DEX platform up
_uniswapV2Router = IUniswapV2Router02(address(router_));
address pair =
IUniswapV2Factory(_uniswapV2Router.factory()).getPair(
_uniswapV2Router.WETH(),
address(this)
);
// Pair not yet created
if (pair == address(0)) {
_uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(_uniswapV2Router.WETH(), address(this));
} else {
_uniswapV2Pair = pair;
}
--- SNIP ---
emit Transfer(address(0), _msgSender(), _totalSupply);
}
I am working on unit tests and the following one is failing:
Here is the associated
stack trace
:Anyone who can please make sense of this issue?