Created
April 26, 2021 14:57
-
-
Save blakewest/de41650498dd63e9b7370ac81da841d4 to your computer and use it in GitHub Desktop.
Solidity Blogpost #1: Config Contract, snippet 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "./GoldfinchConfig.sol"; | |
import "../../interfaces/ICreditLineFactory.sol"; | |
library ConfigHelper { | |
function getCreditLineFactory(GoldfinchConfig config) internal view returns(ICreditLineFactory) { | |
return ICreditLineFactory(creditLineFactoryAddress(config)); | |
} | |
function creditLineFactoryAddress(GoldfinchConfig config) internal view returns (address) { | |
return config.addresses(0); | |
} | |
function protocolOwner(GoldfinchConfig config) internal view returns (address) { | |
return config.addresses(1); | |
} | |
function maxCreditLineAmount(GoldfinchConfig config) internal view returns (address) { | |
return config.numbers(0)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment