-
Notifications
You must be signed in to change notification settings - Fork 47
/
PriceFeedsConstants.sol
54 lines (48 loc) · 1.72 KB
/
PriceFeedsConstants.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* Copyright 2017-2020, bZeroX, LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0.
*/
pragma solidity 0.5.17;
import "../interfaces/IWrbtcERC20.sol";
import "../openzeppelin/Address.sol";
/**
* @title The Price Feeds Constants contract.
*
* @notice 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 Constants {
IWrbtcERC20 public wrbtcToken;
IWrbtcERC20 public baseToken;
address internal protocolTokenAddress;
/**
* @notice Set wrBTC token address.
*
* @param _wrbtcTokenAddress The address of the wrapped wrBTC token.
* */
function _setWrbtcToken(address _wrbtcTokenAddress) internal {
require(Address.isContract(_wrbtcTokenAddress), "_wrbtcTokenAddress not a contract");
wrbtcToken = IWrbtcERC20(_wrbtcTokenAddress);
}
/**
* @notice Set protocol token address.
*
* @param _protocolTokenAddress The address of the protocol token.
* */
function _setProtocolTokenAddress(address _protocolTokenAddress) internal {
require(Address.isContract(_protocolTokenAddress), "_protocolTokenAddress not a contract");
protocolTokenAddress = _protocolTokenAddress;
}
/**
* @notice Set base token address.
*
* @param _baseTokenAddress The address of the base token.
* */
function _setBaseToken(address _baseTokenAddress) internal {
require(Address.isContract(_baseTokenAddress), "_baseTokenAddress not a contract");
baseToken = IWrbtcERC20(_baseTokenAddress);
}
}