Fixed bug in flusher contract

This commit is contained in:
Thrilok Kumar 2020-08-28 22:00:38 +05:30
parent e39705a1de
commit 0c0bb39cbf

View File

@ -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);
}