View Source: contracts/mockup/previousLoanToken/PreviousLoanTokenSettingsLowerAdmin.sol
↗ Extends: AdvancedTokenStorage
Constants & Variables
//public members
address public sovrynContractAddress;
address public wrbtcTokenAddress;
//internal members
address internal target_;
Events
event SetTransactionLimits(address[] addresses, uint256[] limits);
modifier onlyAdmin() internal
- init(address _loanTokenAddress, string _name, string _symbol)
- constructor()
- setupLoanParams(struct LoanParamsStruct.LoanParams[] loanParamsList, bool areTorqueLoans)
- disableLoanParams(address[] collateralTokens, bool[] isTorqueLoans)
- setDemandCurve(uint256 _baseRate, uint256 _rateMultiplier, uint256 _lowUtilBaseRate, uint256 _lowUtilRateMultiplier, uint256 _targetLevel, uint256 _kinkLevel, uint256 _maxScaleRate)
- toggleFunctionPause(string funcId, bool isPaused)
- setTransactionLimits(address[] addresses, uint256[] limits)
function init(address _loanTokenAddress, string _name, string _symbol) public nonpayable onlyOwner
Arguments
Name | Type | Description |
---|---|---|
_loanTokenAddress | address | |
_name | string | |
_symbol | string |
Source Code
function init(
address _loanTokenAddress,
string memory _name,
string memory _symbol
) public onlyOwner {
loanTokenAddress = _loanTokenAddress;
name = _name;
symbol = _symbol;
decimals = IERC20(loanTokenAddress).decimals();
initialPrice = 10**18; // starting price of 1
}
function () external nonpayable
Source Code
function() external {
revert("LoanTokenSettingsLowerAdmin - fallback not allowed");
}
function setupLoanParams(struct LoanParamsStruct.LoanParams[] loanParamsList, bool areTorqueLoans) public nonpayable onlyAdmin
Arguments
Name | Type | Description |
---|---|---|
loanParamsList | struct LoanParamsStruct.LoanParams[] | |
areTorqueLoans | bool |
Source Code
function setupLoanParams(
LoanParamsStruct.LoanParams[] memory loanParamsList,
bool areTorqueLoans
) public onlyAdmin {
bytes32[] memory loanParamsIdList;
address _loanTokenAddress = loanTokenAddress;
for (uint256 i = 0; i < loanParamsList.length; i++) {
loanParamsList[i].loanToken = _loanTokenAddress;
loanParamsList[i].maxLoanTerm = areTorqueLoans ? 0 : 28 days;
}
loanParamsIdList = ProtocolSettingsLike(sovrynContractAddress).setupLoanParams(
loanParamsList
);
for (uint256 i = 0; i < loanParamsIdList.length; i++) {
loanParamsIds[
uint256(
keccak256(
abi.encodePacked(
loanParamsList[i].collateralToken,
areTorqueLoans // isTorqueLoan
)
)
)
] = loanParamsIdList[i];
}
}
function disableLoanParams(address[] collateralTokens, bool[] isTorqueLoans) external nonpayable onlyAdmin
Arguments
Name | Type | Description |
---|---|---|
collateralTokens | address[] | |
isTorqueLoans | bool[] |
Source Code
function disableLoanParams(address[] calldata collateralTokens, bool[] calldata isTorqueLoans)
external
onlyAdmin
{
require(collateralTokens.length == isTorqueLoans.length, "count mismatch");
bytes32[] memory loanParamsIdList = new bytes32[](collateralTokens.length);
for (uint256 i = 0; i < collateralTokens.length; i++) {
uint256 id =
uint256(keccak256(abi.encodePacked(collateralTokens[i], isTorqueLoans[i])));
loanParamsIdList[i] = loanParamsIds[id];
delete loanParamsIds[id];
}
ProtocolSettingsLike(sovrynContractAddress).disableLoanParams(loanParamsIdList);
}
function setDemandCurve(uint256 _baseRate, uint256 _rateMultiplier, uint256 _lowUtilBaseRate, uint256 _lowUtilRateMultiplier, uint256 _targetLevel, uint256 _kinkLevel, uint256 _maxScaleRate) public nonpayable onlyAdmin
Arguments
Name | Type | Description |
---|---|---|
_baseRate | uint256 | |
_rateMultiplier | uint256 | |
_lowUtilBaseRate | uint256 | |
_lowUtilRateMultiplier | uint256 | |
_targetLevel | uint256 | |
_kinkLevel | uint256 | |
_maxScaleRate | uint256 |
Source Code
function setDemandCurve(
uint256 _baseRate,
uint256 _rateMultiplier,
uint256 _lowUtilBaseRate,
uint256 _lowUtilRateMultiplier,
uint256 _targetLevel,
uint256 _kinkLevel,
uint256 _maxScaleRate
) public onlyAdmin {
require(_rateMultiplier.add(_baseRate) <= WEI_PERCENT_PRECISION, "curve params too high");
require(
_lowUtilRateMultiplier.add(_lowUtilBaseRate) <= WEI_PERCENT_PRECISION,
"curve params too high"
);
require(
_targetLevel <= WEI_PERCENT_PRECISION && _kinkLevel <= WEI_PERCENT_PRECISION,
"levels too high"
);
baseRate = _baseRate;
rateMultiplier = _rateMultiplier;
lowUtilBaseRate = _lowUtilBaseRate;
lowUtilRateMultiplier = _lowUtilRateMultiplier;
targetLevel = _targetLevel; // 80 ether
kinkLevel = _kinkLevel; // 90 ether
maxScaleRate = _maxScaleRate; // 100 ether
}
function toggleFunctionPause(string funcId, bool isPaused) public nonpayable onlyAdmin
Arguments
Name | Type | Description |
---|---|---|
funcId | string | |
isPaused | bool |
Source Code
function toggleFunctionPause(
string memory funcId, // example: "mint(uint256,uint256)"
bool isPaused
) public onlyAdmin {
// keccak256("iToken_FunctionPause")
bytes32 slot =
keccak256(
abi.encodePacked(
bytes4(keccak256(abi.encodePacked(funcId))),
uint256(0xd46a704bc285dbd6ff5ad3863506260b1df02812f4f857c8cc852317a6ac64f2)
)
);
assembly {
sstore(slot, isPaused)
}
}
function setTransactionLimits(address[] addresses, uint256[] limits) public nonpayable onlyOwner
Arguments
Name | Type | Description |
---|---|---|
addresses | address[] | the token addresses |
limits | uint256[] | the limit denominated in the currency of the token address |
Source Code
function setTransactionLimits(address[] memory addresses, uint256[] memory limits)
public
onlyOwner
{
require(addresses.length == limits.length, "mismatched array lengths");
for (uint256 i = 0; i < addresses.length; i++) {
transactionLimit[addresses[i]] = limits[i];
}
emit SetTransactionLimits(addresses, limits);
}
- Address
- Administered
- AdminRole
- AdvancedToken
- AdvancedTokenStorage
- Affiliates
- AffiliatesEvents
- ApprovalReceiver
- BProPriceFeed
- CheckpointsShared
- Constants
- Context
- DevelopmentFund
- DummyContract
- EnumerableAddressSet
- EnumerableBytes32Set
- EnumerableBytes4Set
- ERC20
- ERC20Detailed
- ErrorDecoder
- Escrow
- EscrowReward
- FeedsLike
- FeesEvents
- FeeSharingCollector
- FeeSharingCollectorProxy
- FeeSharingCollectorStorage
- FeesHelper
- FourYearVesting
- FourYearVestingFactory
- FourYearVestingLogic
- FourYearVestingStorage
- GenericTokenSender
- GovernorAlpha
- GovernorVault
- IApproveAndCall
- IChai
- IContractRegistry
- IConverterAMM
- IERC1820Registry
- IERC20_
- IERC20
- IERC777
- IERC777Recipient
- IERC777Sender
- IFeeSharingCollector
- IFourYearVesting
- IFourYearVestingFactory
- IFunctionsList
- ILiquidityMining
- ILiquidityPoolV1Converter
- ILoanPool
- ILoanToken
- ILoanTokenLogicBeacon
- ILoanTokenLogicModules
- ILoanTokenLogicProxy
- ILoanTokenModules
- ILoanTokenWRBTC
- ILockedSOV
- IMoCState
- IModulesProxyRegistry
- Initializable
- InterestUser
- IPot
- IPriceFeeds
- IPriceFeedsExt
- IProtocol
- IRSKOracle
- ISovryn
- ISovrynSwapNetwork
- IStaking
- ISwapsImpl
- ITeamVesting
- ITimelock
- IV1PoolOracle
- IVesting
- IVestingFactory
- IVestingRegistry
- IWrbtc
- IWrbtcERC20
- LenderInterestStruct
- LiquidationHelper
- LiquidityMining
- LiquidityMiningConfigToken
- LiquidityMiningProxy
- LiquidityMiningStorage
- LoanClosingsEvents
- LoanClosingsLiquidation
- LoanClosingsRollover
- LoanClosingsShared
- LoanClosingsWith
- LoanClosingsWithoutInvariantCheck
- LoanInterestStruct
- LoanMaintenance
- LoanMaintenanceEvents
- LoanOpenings
- LoanOpeningsEvents
- LoanParamsStruct
- LoanSettings
- LoanSettingsEvents
- LoanStruct
- LoanToken
- LoanTokenBase
- LoanTokenLogicBeacon
- LoanTokenLogicLM
- LoanTokenLogicProxy
- LoanTokenLogicStandard
- LoanTokenLogicStorage
- LoanTokenLogicWrbtc
- LoanTokenSettingsLowerAdmin
- LockedSOV
- MarginTradeStructHelpers
- Medianizer
- ModuleCommonFunctionalities
- ModulesCommonEvents
- ModulesProxy
- ModulesProxyRegistry
- MultiSigKeyHolders
- MultiSigWallet
- Mutex
- Objects
- OrderStruct
- OrigingVestingCreator
- OriginInvestorsClaim
- Ownable
- Pausable
- PausableOz
- PreviousLoanToken
- PreviousLoanTokenSettingsLowerAdmin
- PriceFeedRSKOracle
- PriceFeeds
- PriceFeedsLocal
- PriceFeedsMoC
- PriceFeedV1PoolOracle
- ProtocolAffiliatesInterface
- ProtocolLike
- ProtocolSettings
- ProtocolSettingsEvents
- ProtocolSettingsLike
- ProtocolSwapExternalInterface
- ProtocolTokenUser
- Proxy
- ProxyOwnable
- ReentrancyGuard
- RewardHelper
- RSKAddrValidator
- SafeERC20
- SafeMath
- SafeMath96
- setGet
- SharedReentrancyGuard
- SignedSafeMath
- SOV
- sovrynProtocol
- StakingAdminModule
- StakingGovernanceModule
- StakingInterface
- StakingProxy
- StakingRewards
- StakingRewardsProxy
- StakingRewardsStorage
- StakingShared
- StakingStakeModule
- StakingStorageModule
- StakingStorageShared
- StakingVestingModule
- StakingWithdrawModule
- State
- SwapsEvents
- SwapsExternal
- SwapsImplLocal
- SwapsImplSovrynSwap
- SwapsUser
- TeamVesting
- Timelock
- TimelockHarness
- TimelockInterface
- TokenSender
- UpgradableProxy
- USDTPriceFeed
- Utils
- VaultController
- Vesting
- VestingCreator
- VestingFactory
- VestingLogic
- VestingRegistry
- VestingRegistry2
- VestingRegistry3
- VestingRegistryLogic
- VestingRegistryProxy
- VestingRegistryStorage
- VestingStorage
- WeightedStakingModule
- WRBTC