Skip to content

Instantly share code, notes, and snippets.

@blakewest
Created April 26, 2021 14:57
Show Gist options
  • Save blakewest/de41650498dd63e9b7370ac81da841d4 to your computer and use it in GitHub Desktop.
Save blakewest/de41650498dd63e9b7370ac81da841d4 to your computer and use it in GitHub Desktop.
Solidity Blogpost #1: Config Contract, snippet 5
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