/
SafeERC20Wrapper.sol
43 lines (32 loc) · 1.06 KB
/
SafeERC20Wrapper.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
pragma solidity ^0.5.2;
import "../token/ERC20/IERC20.sol";
import "../token/ERC20/SafeERC20.sol";
import "./ERC20ReturnTrueMock.sol";
contract SafeERC20Wrapper {
using SafeERC20 for IERC20;
IERC20 private _token;
constructor (IERC20 token) public {
_token = token;
}
function transfer() public {
_token.safeTransfer(address(0), 0);
}
function transferFrom() public {
_token.safeTransferFrom(address(0), address(0), 0);
}
function approve(uint256 amount) public {
_token.safeApprove(address(0), amount);
}
function increaseAllowance(uint256 amount) public {
_token.safeIncreaseAllowance(address(0), amount);
}
function decreaseAllowance(uint256 amount) public {
_token.safeDecreaseAllowance(address(0), amount);
}
function setAllowance(uint256 allowance_) public {
ERC20ReturnTrueMock(address(_token)).setAllowance(allowance_);
}
function allowance() public view returns (uint256) {
return _token.allowance(address(0), address(0));
}
}