警告!合约执行期间遇到错误[执行恢复]
Warning! Error encountered during contract execution [execution reverted]
我刚开始学习 solidity,我得到了这段代码,当我部署它时出现了这个错误,你能帮我解决一下吗?
不知道哪里出错了
我正在使用 BSC 测试网
constructor () {
_rOwned[_msgSender()] = _rTotal; // assigning the max reflection token to owner's address
ISummitSwapRouter01 _summitSwapRouter = ISummitSwapRouter01(0x10ED43C718714eb63d5aA57B78B54704E256024E);
// Create a summitswap pair for this new token
summitSwapPair = ISummitSwapFactory(_summitSwapRouter.factory())
.createPair(address(this), _summitSwapRouter.WETH());
//exclude owner and this contract from fee
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_CodradoLiquidityProviderAddress] = true;
//Exclude dead address from reflection
_isExcludedFromReflection[address(0)] = true;
_isExcludedFromReflection[0x000000000000000000000000000000000000dEaD] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
BSC 测试网上的 0x10ED...
地址上有 no contract。
当您的代码调用 .factory()
函数时,它需要响应。但是非合约地址没有响应,导致revert
我刚开始学习 solidity,我得到了这段代码,当我部署它时出现了这个错误,你能帮我解决一下吗?
不知道哪里出错了
我正在使用 BSC 测试网
constructor () {
_rOwned[_msgSender()] = _rTotal; // assigning the max reflection token to owner's address
ISummitSwapRouter01 _summitSwapRouter = ISummitSwapRouter01(0x10ED43C718714eb63d5aA57B78B54704E256024E);
// Create a summitswap pair for this new token
summitSwapPair = ISummitSwapFactory(_summitSwapRouter.factory())
.createPair(address(this), _summitSwapRouter.WETH());
//exclude owner and this contract from fee
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_CodradoLiquidityProviderAddress] = true;
//Exclude dead address from reflection
_isExcludedFromReflection[address(0)] = true;
_isExcludedFromReflection[0x000000000000000000000000000000000000dEaD] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
BSC 测试网上的 0x10ED...
地址上有 no contract。
当您的代码调用 .factory()
函数时,它需要响应。但是非合约地址没有响应,导致revert