mirror of
https://github.com/Instadapp/yield-contract.git
synced 2024-07-29 21:47:29 +00:00
edited comments
This commit is contained in:
parent
53838909ec
commit
c2855db0f5
|
@ -75,7 +75,7 @@ contract PoolETH is ReentrancyGuard, ERC20Pausable, DSMath {
|
||||||
function deploy(address _dsa, address token, uint amount) external isChief {
|
function deploy(address _dsa, address token, uint amount) external isChief {
|
||||||
require(registry.isDsa(address(this), _dsa), "not-autheticated-dsa");
|
require(registry.isDsa(address(this), _dsa), "not-autheticated-dsa");
|
||||||
require(AccountInterface(_dsa).isAuth(address(this)), "token-pool-not-auth");
|
require(AccountInterface(_dsa).isAuth(address(this)), "token-pool-not-auth");
|
||||||
if (token == address(0)) { // pool base ETH
|
if (token == address(0)) { // pool ETH
|
||||||
payable(_dsa).transfer(amount);
|
payable(_dsa).transfer(amount);
|
||||||
} else { // non-pool other tokens
|
} else { // non-pool other tokens
|
||||||
IERC20(token).safeTransfer(_dsa, amount);
|
IERC20(token).safeTransfer(_dsa, amount);
|
||||||
|
@ -100,9 +100,9 @@ contract PoolETH is ReentrancyGuard, ERC20Pausable, DSMath {
|
||||||
_totalToken = sub(_totalToken, feeAmt);
|
_totalToken = sub(_totalToken, feeAmt);
|
||||||
uint _currentRate = getCurrentRate(_totalToken);
|
uint _currentRate = getCurrentRate(_totalToken);
|
||||||
require(_currentRate != 0, "current-rate-is-zero");
|
require(_currentRate != 0, "current-rate-is-zero");
|
||||||
if (_currentRate > _previousRate) { // loss => deduct partially/fully from insurance amount
|
if (_currentRate > _previousRate) {
|
||||||
_currentRate = _previousRate;
|
_currentRate = _previousRate;
|
||||||
} else { // profit => add to insurance amount
|
} else {
|
||||||
uint _newFee = wmul(sub(_totalToken, tokenBalance), registry.fee(address(this)));
|
uint _newFee = wmul(sub(_totalToken, tokenBalance), registry.fee(address(this)));
|
||||||
feeAmt = add(feeAmt, _newFee);
|
feeAmt = add(feeAmt, _newFee);
|
||||||
tokenBalance = sub(_totalToken, _newFee);
|
tokenBalance = sub(_totalToken, _newFee);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user