import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
pragma solidity >=0.6.0;
contract uu is Ownable, ERC20 {
using SafeMath for uint256;
using SafeERC20 for IERC20;
constructor() public ERC20("uu", "uu") {
_mint(address(this), 10000000e18);
}
function stake(uint _amount) external {
transfer(msg.sender, _amount);
}
}
合约就是上面这样的,出现合约里mint了币,但是调用stake(1),转出1个就提示额度不够