Open lianjiexin opened 3 years ago
I run solidity test plug-in for the code below, the browser remix can report compilation error, but the desktop version of remix just stuck there. My version is Version 1.3.1 (1.3.1.527)
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";
//UBT is the token that's used by payment, contract UBT is ERC20PresetMinterPauser {
address public owner; address public reserveAddress; modifier onlyOwner { require(_msgSender() == owner); _;
}
function setReserveAddress(address _reserveAddress) public onlyOwner { require(_reserveAddress != address(0)); reserveAddress = _reserveAddress;
constructor () ERC20PresetMinterPauser("Universal Block token", "UBT"){ owner = msgSender(); } function issueTokens(address _receiver, uint256 _amount) public onlyOwner { require(_receiver != address(0),'Address cannot be zero'); require(_amount > 0, 'Amount should be bigger than 0'); _mint(owner, _amount); transfer(_receiver, _amount);
function burnTokens(address _receiver, uint256 _amount) public { require(_receiver != address(0)); require(_amount > 0); _burn(_receiver, _amount);
In the constructor , I have owner = msgSender(); missing the _ in _msgSender();
When I run unit test in solidity plug-in, it just stuck there, without reporting any compilation error.
I run solidity test plug-in for the code below, the browser remix can report compilation error, but the desktop version of remix just stuck there. My version is Version 1.3.1 (1.3.1.527)
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";
//UBT is the token that's used by payment, contract UBT is ERC20PresetMinterPauser {
}
}
}
}
}
In the constructor , I have owner = msgSender(); missing the _ in _msgSender();
When I run unit test in solidity plug-in, it just stuck there, without reporting any compilation error.