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
{ | |
"adjuster_model_params": {}, | |
"best_algorithm_params": { | |
"": [ | |
{ | |
"classifier": "BaggedLogisticRegression", | |
"training_duration_in_days": "3650", | |
"feature_selector": { | |
"group": "all", | |
"list": "manual", |
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
[ | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "contract UpgradeableBeacon", | |
"name": "beacon", | |
"type": "address" | |
}, |
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
[ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "uint256", | |
"name": "timestamp", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", |
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 "./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 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 "./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 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); |
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 "./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 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
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 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 "./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 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 "./ICreditLineFactory.sol"; | |
contract CreditDesk { | |
address public creditLineFactoryAddress; | |
function createCreditLine(CreditLineParams params) public { | |
require(validParams(params), "invalid params!"); | |
ICreditLineFactory(creditLineFactoryAddress).createCreditLine(params); | |
} |
NewerOlder