mirror of
https://github.com/Instadapp/dsa-polygon-migration.git
synced 2024-07-29 22:27:58 +00:00
added isDepositEnabled variable
This commit is contained in:
parent
edd5f97466
commit
e3ef78e689
|
@ -26,4 +26,6 @@ contract Events {
|
||||||
|
|
||||||
event LogAddTokensSupport(address[] _tokens);
|
event LogAddTokensSupport(address[] _tokens);
|
||||||
|
|
||||||
|
event variablesUpdate(uint _safeRatioGap, uint _fee, bool _depositEnable);
|
||||||
|
|
||||||
}
|
}
|
|
@ -11,13 +11,12 @@ import { Events } from "./events.sol";
|
||||||
contract LiquidityResolver is Helpers, Events {
|
contract LiquidityResolver is Helpers, Events {
|
||||||
using SafeERC20 for IERC20;
|
using SafeERC20 for IERC20;
|
||||||
|
|
||||||
event variablesUpdate(uint _safeRatioGap, uint _fee);
|
function updateVariables(uint _safeRatioGap, uint _fee, bool _depositEnable) public {
|
||||||
|
|
||||||
function updateVariables(uint _safeRatioGap, uint _fee) public {
|
|
||||||
require(msg.sender == instaIndex.master(), "not-master");
|
require(msg.sender == instaIndex.master(), "not-master");
|
||||||
safeRatioGap = _safeRatioGap;
|
safeRatioGap = _safeRatioGap;
|
||||||
fee = _fee;
|
fee = _fee;
|
||||||
emit variablesUpdate(safeRatioGap, fee);
|
isDepositsEnabled = _depositEnable;
|
||||||
|
emit variablesUpdate(safeRatioGap, fee, isDepositsEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addTokenSupport(address[] memory _tokens) public {
|
function addTokenSupport(address[] memory _tokens) public {
|
||||||
|
@ -46,6 +45,7 @@ contract LiquidityResolver is Helpers, Events {
|
||||||
}
|
}
|
||||||
|
|
||||||
function deposit(address[] calldata tokens, uint[] calldata amts) external payable {
|
function deposit(address[] calldata tokens, uint[] calldata amts) external payable {
|
||||||
|
require(isDepositsEnabled, "deposit-not-enable");
|
||||||
uint _length = tokens.length;
|
uint _length = tokens.length;
|
||||||
require(_length == amts.length, "invalid-length");
|
require(_length == amts.length, "invalid-length");
|
||||||
|
|
||||||
|
@ -80,6 +80,7 @@ contract LiquidityResolver is Helpers, Events {
|
||||||
}
|
}
|
||||||
|
|
||||||
function withdraw(address[] calldata tokens, uint[] calldata amts) external {
|
function withdraw(address[] calldata tokens, uint[] calldata amts) external {
|
||||||
|
require(isDepositsEnabled, "withdraw-not-enable");
|
||||||
uint _length = tokens.length;
|
uint _length = tokens.length;
|
||||||
require(_length == amts.length, "invalid-length");
|
require(_length == amts.length, "invalid-length");
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@ contract Variables {
|
||||||
StateSenderInterface constant internal stateSender = StateSenderInterface(0x28e4F3a7f651294B9564800b2D01f35189A5bFbE);
|
StateSenderInterface constant internal stateSender = StateSenderInterface(0x28e4F3a7f651294B9564800b2D01f35189A5bFbE);
|
||||||
|
|
||||||
mapping(address => mapping(address => uint)) public deposits;
|
mapping(address => mapping(address => uint)) public deposits;
|
||||||
|
bool public isDepositsEnabled;
|
||||||
|
|
||||||
// InstaIndex Address.
|
// InstaIndex Address.
|
||||||
IndexInterface public constant instaIndex = IndexInterface(0x2971AdFa57b20E5a416aE5a708A8655A9c74f723);
|
IndexInterface public constant instaIndex = IndexInterface(0x2971AdFa57b20E5a416aE5a708A8655A9c74f723);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user