我有一个构造函数:
constructor (uint160 sqrtPriceX96_) {
_rOwned[_msgSender()] = _rTotal;
_ISwapRouter = ISwapRouter(0xE592427A0AEce92De3Edee1F18E0157C05861564);
_IUniswapV3Factory = IUniswapV3Factory(0x1F98431c8aD98523631AE4a59f267346ea31F984); //Uniswap-V3 for Uniswap arbitrum
_IPoolInitializer = IPoolInitializer(0xC36442b4a4522E871399CD717aBDD847Ab11FE88); //Uniswap-V3 for Uniswap arbitrum
WETH = 0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6; //WETH for Uniswap arbitrum
_INonfungiblepositionmanager = INonfungiblePositionManager(0xC36442b4a4522E871399CD717aBDD847Ab11FE88); //Uniswap-V3 for Uniswap arbitru
addressThis = address(this);
token0 = addressThis;
token1 = WETH; //WETH adress for Arbitrum
fee = 3000;
_sqrtPriceX96 = sqrtPriceX96_;
poolAddress = _IUniswapV3Factory.getPool(token0, token1, fee);
if (poolAddress == address(0)) {
if(token0 > token1){
address temp = token0;
token0 = token1;
token1 = temp;
}
_IPoolInitializer.createAndInitializePoolIfNecessary(token0, token1, fee, _sqrtPriceX96);
}
//exclude owner and this contract from fee
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[addressThis] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}这是进口品:
import "./utils/SafeMath.sol";
import "./utils/Context.sol";
import "./utils/Address.sol";
import "./utils/Ownable.sol";
import "./interfaces/IBEP20.sol";
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol";
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import "@uniswap/v3-periphery/contracts/interfaces/IPoolInitializer.sol";
import "@uniswap/v3-periphery/contracts/interfaces/INonfungiblePositionManager.sol";
import "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol";变量声明:
uint256 tokenId;
IUniswapV3Factory _IUniswapV3Factory;
ISwapRouter _ISwapRouter;
IPoolInitializer _IPoolInitializer;
INonfungiblePositionManager _INonfungiblepositionmanager;
bool hasPosition;我正面临这个错误:
error: SolidityError: Transaction reverted: function call to a non-contract account
goerli的地址是正确的。有人能给我个提示吗?
发布于 2023-03-13 04:19:14
我在错误的网络中部署。
发布于 2023-03-13 06:37:45
此错误通常发生在您试图通过错误的网络调用时。
可能的修正
https://ethereum.stackexchange.com/questions/147296
复制相似问题