Skip to content

Latest commit

 

History

History
314 lines (278 loc) · 10.5 KB

Constants.md

File metadata and controls

314 lines (278 loc) · 10.5 KB

The Price Feeds Constants contract.

  • (Constants.sol)

View Source: contracts/feeds/PriceFeedsConstants.sol

↘ Derived Contracts: IPriceFeedsExt, PriceFeeds

Constants contract

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 keep the addresses of token instances for wrBTC, base token and protocol token.

Contract Members

Constants & Variables

//public members
contract IWrbtcERC20 public wrbtcToken;
contract IWrbtcERC20 public baseToken;

//internal members
address internal protocolTokenAddress;

Functions


_setWrbtcToken

Set wrBTC token address. *

function _setWrbtcToken(address _wrbtcTokenAddress) internal nonpayable

Arguments

Name Type Description
_wrbtcTokenAddress address The address of the wrapped wrBTC token.
Source Code
function _setWrbtcToken(address _wrbtcTokenAddress) internal {
        require(Address.isContract(_wrbtcTokenAddress), "_wrbtcTokenAddress not a contract");
        wrbtcToken = IWrbtcERC20(_wrbtcTokenAddress);
    }

_setProtocolTokenAddress

Set protocol token address. *

function _setProtocolTokenAddress(address _protocolTokenAddress) internal nonpayable

Arguments

Name Type Description
_protocolTokenAddress address The address of the protocol token.
Source Code
function _setProtocolTokenAddress(address _protocolTokenAddress) internal {
        require(Address.isContract(_protocolTokenAddress), "_protocolTokenAddress not a contract");
        protocolTokenAddress = _protocolTokenAddress;
    }

_setBaseToken

Set base token address. *

function _setBaseToken(address _baseTokenAddress) internal nonpayable

Arguments

Name Type Description
_baseTokenAddress address The address of the base token.
Source Code
function _setBaseToken(address _baseTokenAddress) internal {
        require(Address.isContract(_baseTokenAddress), "_baseTokenAddress not a contract");
        baseToken = IWrbtcERC20(_baseTokenAddress);
    }

Contracts