mirror of
https://github.com/Instadapp/yield-contract.git
synced 2024-07-29 21:47:29 +00:00
Fixed bug in flusher contract
This commit is contained in:
parent
e39705a1de
commit
0c0bb39cbf
|
@ -41,7 +41,7 @@ contract Flusher {
|
|||
event LogWithdraw(address indexed token, address indexed tokenPool,uint amount);
|
||||
event LogWithdrawToOwner(address indexed token, address indexed owner, uint amount);
|
||||
|
||||
function deposit(address token) public payable isSigner {
|
||||
function _deposit(address token) internal {
|
||||
require(address(token) != address(0), "invalid-token");
|
||||
|
||||
address poolToken = registry.poolToken(token);
|
||||
|
@ -64,6 +64,10 @@ contract Flusher {
|
|||
emit LogDeposit(token, address(poolContract), amt);
|
||||
}
|
||||
|
||||
function deposit(address token) external payable isSigner {
|
||||
_deposit(token);
|
||||
}
|
||||
|
||||
function withdraw(address token, uint amount) external isSigner returns (uint _amount) {
|
||||
require(address(token) != address(0), "invalid-token");
|
||||
address poolToken = registry.poolToken(token);
|
||||
|
@ -96,7 +100,7 @@ contract Flusher {
|
|||
require(newOwner != address(0), "not-vaild-owner-address");
|
||||
require(token != address(0), "not-vaild-token-address");
|
||||
owner = payable(newOwner);
|
||||
deposit(token);
|
||||
_deposit(token);
|
||||
emit LogInit(newOwner);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user