This file contains 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 "./ConfigHelper.sol"; | |
contract CreditDesk { | |
GoldfinchConfig public config; | |
using ConfigHelper for config; | |
function drawdown(CreditLine creditLine, uint256 amount) public { | |
require(validCreditLine(creditLine), "invalid creditline!"); | |
require(msg.sender == creditLine.owner()) |
This file contains 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 "./ConfigHelper.sol"; | |
contract CreditDesk { | |
GoldfinchConfig public config; | |
// This line is what "adds" the library methods to the config. If you aren't | |
// familiar with this syntax, you can just Google how libraries work in Solidity | |
using ConfigHelper for config; | |
function createCreditLine(CreditLineParams params) public { |
This file contains 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); |
This file contains 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 "./ICreditLineFactory.sol"; | |
contract CreditDesk { | |
GoldfinchConfig public config; | |
function createCreditLine(CreditLineParams params) public { | |
require(validParams(params), "invalid params!"); | |
uint256 maxCreditLineAmount = config.numbers(0); | |
require(params.amount <= maxCreditLineAmount, "Amount is above maximum"); |
This file contains 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
contract GoldfinchConfig is Ownable { | |
// Note: Solidity creates automatic getter methods for these mappings | |
// So we don't need to explicitly add them ourselves. | |
mapping(uint256 => address) public addresses; | |
mapping(uint256 => uint256) public numbers; | |
event AddressUpdated(address owner, uint256 index, address oldValue, address newValue); | |
event NumberUpdated(address owner, uint256 index, uint256 oldValue, uint256 newValue); | |
function setAddress(uint256 addressIndex, address newAddress) public onlyAdmin { |
This file contains 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 "./ICreditLineFactory.sol"; | |
contract CreditDesk { | |
address public creditLineFactoryAddress; | |
uint256 public maxCreditLineAmount; | |
address public protocolOwner; | |
function createCreditLine(CreditLineParams params) public onlyOwner { | |
require(validParams(params), "invalid params!"); | |
require(params.amount <= maxCreditLineAmount, "Amount is above maximum"); |
This file contains 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 "./ICreditLineFactory.sol"; | |
contract CreditDesk { | |
address public creditLineFactoryAddress; | |
function createCreditLine(CreditLineParams params) public { | |
require(validParams(params), "invalid params!"); | |
ICreditLineFactory(creditLineFactoryAddress).createCreditLine(params); | |
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 pandas as pd | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.metrics import confusion_matrix | |
from sklearn.model_selection import train_test_split | |
def load_data(path): | |
# Load the data into a Pandas dataframe. | |
raw_data = pd.read_csv(path, header=0) | |
print('Loaded data from', path) | |
return raw_data |
This file contains 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
FROM quay.io/aptible/java:oracle-java8 | |
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle | |
RUN apt-get update && apt-get -y install libc6-dev unzip curl | |
RUN groupadd looker && useradd -m -g looker -s /bin/bash looker | |
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.5/supercronic-linux-amd64 \ | |
SUPERCRONIC=supercronic-linux-amd64 \ | |
SUPERCRONIC_SHA1SUM=9aeb41e00cc7b71d30d33c57a2333f2c2581a201 |
NewerOlder