View Source: contracts/core/State.sol
↗ Extends: Objects, ReentrancyGuard, SharedReentrancyGuard, Ownable ↘ Derived Contracts: Affiliates, FeesHelper, ISovryn, LiquidationHelper, LoanSettings, ModuleCommonFunctionalities, ProtocolSettings, ProtocolTokenUser, RewardHelper, sovrynProtocol, SwapsImplLocal, SwapsImplSovrynSwap, SwapsUser, VaultController
This contract code comes from bZx. bZx is a protocol for tokenized margin trading and lending https://bzx.network similar to the dYdX protocol.
- This contract contains the storage values of the Protocol.
Constants & Variables
//public members
address public priceFeeds;
address public swapsImpl;
address public sovrynSwapContractRegistryAddress;
mapping(bytes4 => address) public logicTargets;
mapping(bytes32 => struct LoanStruct.Loan) public loans;
mapping(bytes32 => struct LoanParamsStruct.LoanParams) public loanParams;
mapping(address => mapping(bytes32 => struct OrderStruct.Order)) public lenderOrders;
mapping(address => mapping(bytes32 => struct OrderStruct.Order)) public borrowerOrders;
mapping(bytes32 => mapping(address => bool)) public delegatedManagers;
mapping(address => mapping(address => struct LenderInterestStruct.LenderInterest)) public lenderInterest;
mapping(bytes32 => struct LoanInterestStruct.LoanInterest) public loanInterest;
address public feesController;
uint256 public lendingFeePercent;
mapping(address => uint256) public lendingFeeTokensHeld;
mapping(address => uint256) public lendingFeeTokensPaid;
uint256 public tradingFeePercent;
mapping(address => uint256) public tradingFeeTokensHeld;
mapping(address => uint256) public tradingFeeTokensPaid;
uint256 public borrowingFeePercent;
mapping(address => uint256) public borrowingFeeTokensHeld;
mapping(address => uint256) public borrowingFeeTokensPaid;
uint256 public protocolTokenHeld;
uint256 public protocolTokenPaid;
uint256 public affiliateFeePercent;
uint256 public liquidationIncentivePercent;
mapping(address => address) public loanPoolToUnderlying;
mapping(address => address) public underlyingToLoanPool;
mapping(address => bool) public supportedTokens;
uint256 public maxDisagreement;
uint256 public sourceBuffer;
uint256 public maxSwapSize;
mapping(address => uint256) public borrowerNonce;
uint256 public rolloverBaseReward;
uint256 public rolloverFlexFeePercent;
contract IWrbtcERC20 public wrbtcToken;
address public protocolTokenAddress;
uint256 public feeRebatePercent;
address public admin;
address public protocolAddress;
mapping(address => bool) public userNotFirstTradeFlag;
mapping(address => address) public affiliatesUserReferrer;
uint256 public minReferralsToPayout;
mapping(address => uint256) public affiliateRewardsHeld;
address public sovTokenAddress;
address public lockedSOVAddress;
uint256 public affiliateTradingTokenFeePercent;
mapping(address => mapping(address => uint256)) public affiliatesReferrerBalances;
mapping(address => mapping(address => uint256)) public specialRebates;
bool public pause;
//internal members
struct EnumerableBytes32Set.Bytes32Set internal logicTargetsSet;
struct EnumerableBytes32Set.Bytes32Set internal activeLoansSet;
mapping(address => struct EnumerableBytes32Set.Bytes32Set) internal lenderLoanSets;
mapping(address => struct EnumerableBytes32Set.Bytes32Set) internal borrowerLoanSets;
mapping(address => struct EnumerableBytes32Set.Bytes32Set) internal userLoanParamSets;
struct EnumerableBytes32Set.Bytes32Set internal loanPoolsSet;
mapping(address => struct EnumerableAddressSet.AddressSet) internal referralsList;
mapping(address => struct EnumerableAddressSet.AddressSet) internal affiliatesReferrerTokensList;
uint256 internal swapExtrernalFeePercent;
uint256 internal tradingRebateRewardsBasisPoint;
mapping(address => mapping(address => contract IERC20[])) internal defaultPathConversion;
Add signature and target to storage.
function _setTarget(bytes4 sig, address target) internal nonpayable
Arguments
Name | Type | Description |
---|---|---|
sig | bytes4 | |
target | address |
Source Code
function _setTarget(bytes4 sig, address target) internal {
logicTargets[sig] = target;
if (target != address(0)) {
logicTargetsSet.addBytes32(bytes32(sig));
} else {
logicTargetsSet.removeBytes32(bytes32(sig));
}
}
- 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