-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
459 additions
and
567 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
pragma solidity ^0.6.0; | ||
|
||
import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; | ||
import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; | ||
|
||
import './owner/Operator.sol'; | ||
import './interfaces/ISimpleERCFund.sol'; | ||
|
||
contract SimpleERCFund is ISimpleERCFund, Operator { | ||
using SafeERC20 for IERC20; | ||
|
||
function deposit( | ||
address token, | ||
uint256 amount, | ||
string memory reason | ||
) public override { | ||
IERC20(token).safeTransferFrom(msg.sender, address(this), amount); | ||
emit Deposit(msg.sender, now, reason); | ||
} | ||
|
||
function withdraw( | ||
address token, | ||
uint256 amount, | ||
address to, | ||
string memory reason | ||
) public override onlyOperator { | ||
IERC20(token).safeTransfer(to, amount); | ||
emit Withdrawal(msg.sender, to, now, reason); | ||
} | ||
|
||
event Deposit(address indexed from, uint256 indexed at, string reason); | ||
event Withdrawal( | ||
address indexed from, | ||
address indexed to, | ||
uint256 indexed at, | ||
string reason | ||
); | ||
} |
Oops, something went wrong.