Skip to content

Instantly share code, notes, and snippets.

@edmundmiller
Created October 7, 2018 17:44
Show Gist options
  • Save edmundmiller/074777bb20fd896ef7eeb8aa3e93e2b6 to your computer and use it in GitHub Desktop.
Save edmundmiller/074777bb20fd896ef7eeb8aa3e93e2b6 to your computer and use it in GitHub Desktop.
{
"contractName": "MakeRebalance",
"abi": [
{
"constant": false,
"inputs": [
{
"name": "_coin",
"type": "string"
},
{
"name": "_market",
"type": "string"
}
],
"name": "requestCoinMarketCapPrice",
"outputs": [
{
"name": "requestId",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "id",
"type": "bytes32"
}
],
"name": "ChainlinkRequested",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "id",
"type": "bytes32"
}
],
"name": "ChainlinkFulfilled",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "id",
"type": "bytes32"
}
],
"name": "ChainlinkCancelled",
"type": "event"
},
{
"constant": false,
"inputs": [],
"name": "calculateValues",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "requestId",
"type": "bytes32"
},
{
"name": "coinPrice",
"type": "uint256"
}
],
"name": "checkRequest",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "returnDaiValue",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "returnClValues",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x608060405260016002557f39366236613766636137353934383837613363336333633066393337396534656006906000191690556040805190810160405280600381526020017f44414900000000000000000000000000000000000000000000000000000000008152506007908051906020019062000080929190620001b8565b506040805190810160405280600481526020017f4c494e4b0000000000000000000000000000000000000000000000000000000081525060089080519060200190620000ce929190620001b8565b50620000fd7320fe562d797a42dcb3399062ae9546cd06f6328062000131640100000000026401000000009004565b6200012b73f0cef41e87a1218a775b5997b2bd76d8ad4104f162000174640100000000026401000000009004565b62000267565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620001fb57805160ff19168380011785556200022c565b828001600101855582156200022c579182015b828111156200022b5782518255916020019190600101906200020e565b5b5090506200023b91906200023f565b5090565b6200026491905b808211156200026057600081600090555060010162000246565b5090565b90565b61155580620002776000396000f30060806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313a13db3146100725780632b554a92146100ad57806389058807146101785780638b5556ad146101a3578063e2f1907a146101ba575b600080fd5b34801561007e57600080fd5b506100ab6004803603810190808035600019169060200190929190803590602001909291905050506101e5565b005b3480156100b957600080fd5b5061015a600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610392565b60405180826000191660001916815260200191505060405180910390f35b34801561018457600080fd5b5061018d610690565b6040518082815260200191505060405180910390f35b3480156101af57600080fd5b506101b861069a565b005b3480156101c657600080fd5b506101cf610862565b6040518082815260200191505060405180910390f35b8160036000826000191660001916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156102ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f736f75726365206d75737420626520746865206f7261636c65206f662074686581526020017f207265717565737400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600b5460001916836000191614156103085781600981905550610310565b81600a819055505b60036000826000191660001916815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690557f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a8160405180826000191660001916815260200191505060405180910390a1505050565b600061039c611484565b60606103e0600654306040805190810160405280601d81526020017f636865636b5265717565737428627974657333322c75696e743235362900000081525061086c565b915061042c6040805190810160405280600381526020017f73796d0000000000000000000000000000000000000000000000000000000000815250868461089d9092919063ffffffff16565b6104766040805190810160405280600781526020017f636f6e7665727400000000000000000000000000000000000000000000000000815250858461089d9092919063ffffffff16565b60056040519080825280602002602001820160405280156104ab57816020015b60608152602001906001900390816104965790505b5090506040805190810160405280600481526020017f64617461000000000000000000000000000000000000000000000000000000008152508160008151811015156104f357fe5b906020019060200201819052508481600181518110151561051057fe5b906020019060200201819052506040805190810160405280600581526020017f71756f746500000000000000000000000000000000000000000000000000000081525081600281518110151561056257fe5b906020019060200201819052508381600381518110151561057f57fe5b906020019060200201819052506040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152508160048151811015156105d157fe5b906020019060200201819052506106286040805190810160405280600881526020017f636f70795061746800000000000000000000000000000000000000000000000081525082846108d09092919063ffffffff16565b6106736040805190810160405280600581526020017f74696d65730000000000000000000000000000000000000000000000000000008152506064846109529092919063ffffffff16565b610686826106816001610985565b6109a9565b9250505092915050565b6000600954905090565b61077360078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107335780601f1061070857610100808354040283529160200191610733565b820191906000526020600020905b81548152906001019060200180831161071657829003601f168201915b50505050506040805190810160405280600381526020017f5553440000000000000000000000000000000000000000000000000000000000815250610392565b600b816000191690555061085660088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b50505050506040805190810160405280600381526020017f5553440000000000000000000000000000000000000000000000000000000000815250610392565b600c8160001916905550565b6000600a54905090565b610874611484565b61087c611484565b61089385858584610ce9909392919063ffffffff16565b9150509392505050565b6108b4828460800151610e1090919063ffffffff16565b6108cb818460800151610e1090919063ffffffff16565b505050565b60006108e9838560800151610e1090919063ffffffff16565b6108f68460800151610e35565b600090505b815181101561093f57610932828281518110151561091557fe5b906020019060200201518560800151610e1090919063ffffffff16565b80806001019150506108fb565b61094c8460800151610e43565b50505050565b610969828460800151610e1090919063ffffffff16565b610980818460800151610e5190919063ffffffff16565b505050565b60006109a2670de0b6b3a764000083610e9f90919063ffffffff16565b9050919050565b60006002546001028360600190600019169081600019168152505060016002600082825401925050819055506109de83610ed7565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166003600085606001516000191660001916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fb5e6e01e79f91267dc17b4e6314d5d4d03593d2ceee0fbb452b750bd70ea5af9836060015160405180826000191660001916815260200191505060405180910390a16000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634000aea0600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610b16600188610ee790919063ffffffff16565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610bb9578082015181840152602081019050610b9e565b50505050905090810190601f168015610be65780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b158015610c0757600080fd5b505af1158015610c1b573d6000803e3d6000fd5b505050506040513d6020811015610c3157600080fd5b81019080805190602001909291905050501515610cdc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f756e61626c6520746f207472616e73666572416e6443616c6c20746f206f726181526020017f636c65000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8260600151905092915050565b610cf1611484565b610d0085608001516080611117565b838560000190600019169081600019168152505082856020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050816040518082805190602001908083835b602083101515610d825780518252602082019150602081019050602083039250610d5d565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902085604001907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681525050610e058560800151611167565b849050949350505050565b610e1d8260038351611175565b610e3081836112ce90919063ffffffff16565b505050565b610e4081600461137a565b50565b610e4e81600761137a565b50565b600081121515610e6c57610e6782600083611175565b610e9b565b610e9a826001837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03611175565b5b5050565b600080831415610eb25760009050610ed1565b8183029050818382811515610ec357fe5b04141515610ecd57fe5b8090505b92915050565b610ee48160800151610e43565b50565b606060405180807f726571756573744461746128616464726573732c75696e743235362c75696e7481526020017f3235362c627974657333322c616464726573732c6279746573342c627974657381526020017f33322c6279746573290000000000000000000000000000000000000000000000815250604901905060405180910390206000808486600001518760200151886040015189606001518a6080015160000151604051602401808960ff1681526020018860ff16815260200187815260200186600019166000191681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001847bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152602001836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561107957808201518184015260208101905061105e565b50505050905090810190601f1680156110a65780820380516001836020036101000a031916815260200191505b509950505050505050505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905092915050565b6000819050600060208281151561112a57fe5b061415156111475760208181151561113e57fe5b06602003810190505b808360200181815250506040518084526000815281810160405250505050565b61117281600561137a565b50565b6017811115156111a6576111a18160058460ff169060020a0260ff16178461139e90919063ffffffff16565b6112c9565b60ff811115156111ec576111d0601860058460ff169060020a02178461139e90919063ffffffff16565b6111e6816001856113de9092919063ffffffff16565b506112c8565b61ffff8111151561123357611217601960058460ff169060020a02178461139e90919063ffffffff16565b61122d816002856113de9092919063ffffffff16565b506112c7565b63ffffffff8111151561127c57611260601a60058460ff169060020a02178461139e90919063ffffffff16565b611276816004856113de9092919063ffffffff16565b506112c6565b67ffffffffffffffff811115156112c5576112ad601b60058460ff169060020a02178461139e90919063ffffffff16565b6112c3816008856113de9092919063ffffffff16565b505b5b5b5b5b505050565b6112d66114f5565b6000806000808660200151876000015151875101111561130c5761130b8760026113058a602001518a51611445565b02611461565b5b8551915086518051602081830101955087518101825260208801945050505b602082101515611350578251845260208401935060208301925060208203915061132b565b6001826020036101000a039050801983511681855116818117865250508694505050505092915050565b61139a601f60058360ff169060020a02178361139e90919063ffffffff16565b5050565b816020015160018360000151510111156113c4576113c3826002846020015102611461565b5b815180516020818301018381536001820183525050505050565b6113e66114f5565b60008460200151856000015151840111156114165761141585600261140f886020015187611445565b02611461565b5b6001836101000a0390508451805184818301018684198251161781528582018352505050849150509392505050565b6000818311156114575782905061145b565b8190505b92915050565b6060826000015190506114748383611117565b61147e83826112ce565b50505050565b60c06040519081016040528060008019168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152602001600080191681526020016114ef61150f565b81525090565b604080519081016040528060608152602001600081525090565b6040805190810160405280606081526020016000815250905600a165627a7a723058200a930e3ddb6376aa9eac9f817ab1b2ac00e326cd1fabe05e92cb8b6ffc5a2b300029",
"deployedBytecode": "0x60806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313a13db3146100725780632b554a92146100ad57806389058807146101785780638b5556ad146101a3578063e2f1907a146101ba575b600080fd5b34801561007e57600080fd5b506100ab6004803603810190808035600019169060200190929190803590602001909291905050506101e5565b005b3480156100b957600080fd5b5061015a600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610392565b60405180826000191660001916815260200191505060405180910390f35b34801561018457600080fd5b5061018d610690565b6040518082815260200191505060405180910390f35b3480156101af57600080fd5b506101b861069a565b005b3480156101c657600080fd5b506101cf610862565b6040518082815260200191505060405180910390f35b8160036000826000191660001916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156102ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f736f75726365206d75737420626520746865206f7261636c65206f662074686581526020017f207265717565737400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600b5460001916836000191614156103085781600981905550610310565b81600a819055505b60036000826000191660001916815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690557f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a8160405180826000191660001916815260200191505060405180910390a1505050565b600061039c611484565b60606103e0600654306040805190810160405280601d81526020017f636865636b5265717565737428627974657333322c75696e743235362900000081525061086c565b915061042c6040805190810160405280600381526020017f73796d0000000000000000000000000000000000000000000000000000000000815250868461089d9092919063ffffffff16565b6104766040805190810160405280600781526020017f636f6e7665727400000000000000000000000000000000000000000000000000815250858461089d9092919063ffffffff16565b60056040519080825280602002602001820160405280156104ab57816020015b60608152602001906001900390816104965790505b5090506040805190810160405280600481526020017f64617461000000000000000000000000000000000000000000000000000000008152508160008151811015156104f357fe5b906020019060200201819052508481600181518110151561051057fe5b906020019060200201819052506040805190810160405280600581526020017f71756f746500000000000000000000000000000000000000000000000000000081525081600281518110151561056257fe5b906020019060200201819052508381600381518110151561057f57fe5b906020019060200201819052506040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152508160048151811015156105d157fe5b906020019060200201819052506106286040805190810160405280600881526020017f636f70795061746800000000000000000000000000000000000000000000000081525082846108d09092919063ffffffff16565b6106736040805190810160405280600581526020017f74696d65730000000000000000000000000000000000000000000000000000008152506064846109529092919063ffffffff16565b610686826106816001610985565b6109a9565b9250505092915050565b6000600954905090565b61077360078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107335780601f1061070857610100808354040283529160200191610733565b820191906000526020600020905b81548152906001019060200180831161071657829003601f168201915b50505050506040805190810160405280600381526020017f5553440000000000000000000000000000000000000000000000000000000000815250610392565b600b816000191690555061085660088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b50505050506040805190810160405280600381526020017f5553440000000000000000000000000000000000000000000000000000000000815250610392565b600c8160001916905550565b6000600a54905090565b610874611484565b61087c611484565b61089385858584610ce9909392919063ffffffff16565b9150509392505050565b6108b4828460800151610e1090919063ffffffff16565b6108cb818460800151610e1090919063ffffffff16565b505050565b60006108e9838560800151610e1090919063ffffffff16565b6108f68460800151610e35565b600090505b815181101561093f57610932828281518110151561091557fe5b906020019060200201518560800151610e1090919063ffffffff16565b80806001019150506108fb565b61094c8460800151610e43565b50505050565b610969828460800151610e1090919063ffffffff16565b610980818460800151610e5190919063ffffffff16565b505050565b60006109a2670de0b6b3a764000083610e9f90919063ffffffff16565b9050919050565b60006002546001028360600190600019169081600019168152505060016002600082825401925050819055506109de83610ed7565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166003600085606001516000191660001916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fb5e6e01e79f91267dc17b4e6314d5d4d03593d2ceee0fbb452b750bd70ea5af9836060015160405180826000191660001916815260200191505060405180910390a16000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634000aea0600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610b16600188610ee790919063ffffffff16565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610bb9578082015181840152602081019050610b9e565b50505050905090810190601f168015610be65780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b158015610c0757600080fd5b505af1158015610c1b573d6000803e3d6000fd5b505050506040513d6020811015610c3157600080fd5b81019080805190602001909291905050501515610cdc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f756e61626c6520746f207472616e73666572416e6443616c6c20746f206f726181526020017f636c65000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8260600151905092915050565b610cf1611484565b610d0085608001516080611117565b838560000190600019169081600019168152505082856020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050816040518082805190602001908083835b602083101515610d825780518252602082019150602081019050602083039250610d5d565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902085604001907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681525050610e058560800151611167565b849050949350505050565b610e1d8260038351611175565b610e3081836112ce90919063ffffffff16565b505050565b610e4081600461137a565b50565b610e4e81600761137a565b50565b600081121515610e6c57610e6782600083611175565b610e9b565b610e9a826001837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03611175565b5b5050565b600080831415610eb25760009050610ed1565b8183029050818382811515610ec357fe5b04141515610ecd57fe5b8090505b92915050565b610ee48160800151610e43565b50565b606060405180807f726571756573744461746128616464726573732c75696e743235362c75696e7481526020017f3235362c627974657333322c616464726573732c6279746573342c627974657381526020017f33322c6279746573290000000000000000000000000000000000000000000000815250604901905060405180910390206000808486600001518760200151886040015189606001518a6080015160000151604051602401808960ff1681526020018860ff16815260200187815260200186600019166000191681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001847bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152602001836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561107957808201518184015260208101905061105e565b50505050905090810190601f1680156110a65780820380516001836020036101000a031916815260200191505b509950505050505050505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905092915050565b6000819050600060208281151561112a57fe5b061415156111475760208181151561113e57fe5b06602003810190505b808360200181815250506040518084526000815281810160405250505050565b61117281600561137a565b50565b6017811115156111a6576111a18160058460ff169060020a0260ff16178461139e90919063ffffffff16565b6112c9565b60ff811115156111ec576111d0601860058460ff169060020a02178461139e90919063ffffffff16565b6111e6816001856113de9092919063ffffffff16565b506112c8565b61ffff8111151561123357611217601960058460ff169060020a02178461139e90919063ffffffff16565b61122d816002856113de9092919063ffffffff16565b506112c7565b63ffffffff8111151561127c57611260601a60058460ff169060020a02178461139e90919063ffffffff16565b611276816004856113de9092919063ffffffff16565b506112c6565b67ffffffffffffffff811115156112c5576112ad601b60058460ff169060020a02178461139e90919063ffffffff16565b6112c3816008856113de9092919063ffffffff16565b505b5b5b5b5b505050565b6112d66114f5565b6000806000808660200151876000015151875101111561130c5761130b8760026113058a602001518a51611445565b02611461565b5b8551915086518051602081830101955087518101825260208801945050505b602082101515611350578251845260208401935060208301925060208203915061132b565b6001826020036101000a039050801983511681855116818117865250508694505050505092915050565b61139a601f60058360ff169060020a02178361139e90919063ffffffff16565b5050565b816020015160018360000151510111156113c4576113c3826002846020015102611461565b5b815180516020818301018381536001820183525050505050565b6113e66114f5565b60008460200151856000015151840111156114165761141585600261140f886020015187611445565b02611461565b5b6001836101000a0390508451805184818301018684198251161781528582018352505050849150509392505050565b6000818311156114575782905061145b565b8190505b92915050565b6060826000015190506114748383611117565b61147e83826112ce565b50505050565b60c06040519081016040528060008019168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152602001600080191681526020016114ef61150f565b81525090565b604080519081016040528060608152602001600081525090565b6040805190810160405280606081526020016000815250905600a165627a7a723058200a930e3ddb6376aa9eac9f817ab1b2ac00e326cd1fabe05e92cb8b6ffc5a2b300029",
"sourceMap": "66:868:1:-;;;474:1:4;447:28;;384:43:0;366:61;;;;;;;122:25:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;153:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;234:56:0;247:42;234:12;;;:56;;;:::i;:::-;300:53;310:42;300:9;;;:53;;;:::i;:::-;66:868:1;;1957:80:4;2026:5;2009:4;;:23;;;;;;;;;;;;;;;;;;1957:80;:::o;1873:::-;1940:7;1924:6;;:24;;;;;;;;;;;;;;;;;;1873:80;:::o;66:868:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;",
"deployedSourceMap": "66:868:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;477:263;;8:9:-1;5:2;;;30:1;27;20:12;5:2;477:263:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;483:622:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;483:622:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;746:87:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;746:87:1;;;;;;;;;;;;;;;;;;;;;;;291:180;;8:9:-1;5:2;;;30:1;27;20:12;5:2;291:180:1;;;;;;839:93;;8:9:-1;5:2;;;30:1;27;20:12;5:2;839:93:1;;;;;;;;;;;;;;;;;;;;;;;477:263;578:9;2906:19:4;:31;2926:10;2906:31;;;;;;;;;;;;;;;;;;;;;;;;;;;2892:45;;:10;:45;;;2884:98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;620:10:1;;607:23;;;:9;:23;;;;603:131;;;657:9;646:8;:20;;;;603:131;;;714:9;697:14;:26;;;;603:131;3002:19:4;:31;3022:10;3002:31;;;;;;;;;;;;;;;;;;2995:38;;;;;;;;;;;3044:30;3063:10;3044:30;;;;;;;;;;;;;;;;;;;;;;;;477:263:1;;;:::o;483:622:0:-;601:17;634:27;;:::i;:::-;796:20;664:54;671:7;;680:4;664:54;;;;;;;;;;;;;;;;;;:6;:54::i;:::-;634:84;;728:21;;;;;;;;;;;;;;;;;;;743:5;728:3;:7;;:21;;;;;:::i;:::-;759:27;;;;;;;;;;;;;;;;;;;778:7;759:3;:7;;:27;;;;;:::i;:::-;832:1;819:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;796:38;;844:16;;;;;;;;;;;;;;;;;;:4;849:1;844:7;;;;;;;;;;;;;;;;;:16;;;;880:5;870:4;875:1;870:7;;;;;;;;;;;;;;;;;:15;;;;895:17;;;;;;;;;;;;;;;;;;:4;900:1;895:7;;;;;;;;;;;;;;;;;:17;;;;932:7;922:4;927:1;922:7;;;;;;;;;;;;;;;;;:17;;;;949;;;;;;;;;;;;;;;;;;:4;954:1;949:7;;;;;;;;;;;;;;;;;:17;;;;976:36;;;;;;;;;;;;;;;;;;;1007:4;976:3;:18;;:36;;;;;:::i;:::-;1022:24;;;;;;;;;;;;;;;;;;;1042:3;1022;:10;;:24;;;;;:::i;:::-;1068:30;1085:3;1090:7;1095:1;1090:4;:7::i;:::-;1068:16;:30::i;:::-;1056:42;;483:622;;;;;;:::o;746:87:1:-;792:7;818:8;;811:15;;746:87;:::o;291:180::-;348:44;374:10;348:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:25;:44::i;:::-;335:10;:57;;;;;;;414:50;440:16;414:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:25;:50::i;:::-;402:9;:62;;;;;;;291:180::o;839:93::-;885:7;911:14;;904:21;;839:93;:::o;838:278:4:-;971:16;;:::i;:::-;1002:27;;:::i;:::-;1042:69;1057:7;1066:16;1084:26;1042:3;:14;;:69;;;;;;:::i;:::-;1035:76;;838:278;;;;;;:::o;1262:151:3:-;1346:27;1368:4;1346;:8;;;:21;;:27;;;;:::i;:::-;1379:29;1401:6;1379:4;:8;;;:21;;:29;;;;:::i;:::-;1262:151;;;:::o;1888:290::-;2058:9;1993:27;2015:4;1993;:8;;;:21;;:27;;;;:::i;:::-;2026:21;:4;:8;;;:19;:21::i;:::-;2070:1;2058:13;;2053:93;2077:7;:14;2073:1;:18;2053:93;;;2106:33;2128:7;2136:1;2128:10;;;;;;;;;;;;;;;;;;2106:4;:8;;;:21;;:33;;;;:::i;:::-;2093:3;;;;;;;2053:93;;;2151:22;:4;:8;;;:20;:22::i;:::-;1888:290;;;;:::o;1575:151::-;1662:27;1684:4;1662;:8;;;:21;;:27;;;;:::i;:::-;1695:26;1714:6;1695:4;:8;;;:18;;:26;;;;:::i;:::-;1575:151;;;:::o;1759:110:4:-;1813:7;1835:29;385:6;1835:7;:11;;:29;;;;:::i;:::-;1828:36;;1759:110;;;:::o;1120:443::-;1219:7;1261:8;;1253:17;;1236:4;:14;;:34;;;;;;;;;;;;;1288:1;1276:8;;:13;;;;;;;;;;;1295:12;:4;:10;:12::i;:::-;1351:6;;;;;;;;;;;1313:19;:35;1333:4;:14;;;1313:35;;;;;;;;;;;;;;;;;;:44;;;;;;;;;;;;;;;;;;1368:34;1387:4;:14;;;1368:34;;;;;;;;;;;;;;;;;;;;;;;;1416:4;;;;;;;;;;;:20;;;1437:6;;;;;;;;;;;1445:7;1454:35;336:1;1454:4;:20;;:35;;;;:::i;:::-;1416:74;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;1416:74:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1416:74:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1416:74:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1416:74:4;;;;;;;;;;;;;;;;1408:122;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1544:4;:14;;;1537:21;;1120:443;;;;:::o;426:418:3:-;584:16;;:::i;:::-;615:26;627:4;:8;;;637:3;615:11;:26::i;:::-;661:7;647:4;:11;;:21;;;;;;;;;;;;;697:16;674:4;:20;;:39;;;;;;;;;;;768:26;752:44;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;752:44:3;;;;;;;;;;;;;;;;719:4;:23;;:78;;;;;;;;;;;;;803:19;:4;:8;;;:17;:19::i;:::-;835:4;828:11;;426:418;;;;;;:::o;1873:182:20:-;1959:55;1970:3;301:1;2000:5;1994:19;1959:10;:55::i;:::-;2024:24;2041:5;2024:3;:10;;:24;;;;:::i;:::-;;1873:182;;:::o;2061:126::-;2131:49;2158:3;350:1;2131:26;:49::i;:::-;2061:126;:::o;2321:134::-;2392:56;2419:3;453:1;2392:26;:56::i;:::-;2321:134;:::o;1437:259::-;1529:1;1520:5;:10;;1517:173;;;1546:44;1557:3;146:1;1583:5;1546:10;:44::i;:::-;1517:173;;;1621:58;1632:3;202:1;1672:5;1667:2;:10;1621;:58::i;:::-;1517:173;1437:259;;:::o;203:380:17:-;263:9;495:1;489:2;:7;485:36;;;513:1;506:8;;;;485:36;536:2;531;:7;527:11;;561:2;555;551:1;:6;;;;;;;;:12;544:20;;;;;;577:1;570:8;;203:380;;;;;:::o;2182:79:3:-;2234:22;:4;:8;;;:20;:22::i;:::-;2182:79;:::o;848:410::-;949:5;155:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1034:1;1076;1118:14;1140:4;:11;;;1159:4;:20;;;1187:4;:23;;;1218:4;:14;;;1240:4;:8;;;:12;;;976:277;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;976:277:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;976:277:3;;;;;;;38:4:-1;29:7;25:18;67:10;61:17;96:58;199:8;192:4;186;182:15;179:29;167:10;160:49;0:215;;;976:277:3;969:284;;848:410;;;;:::o;116:414:19:-;189:13;205:9;189:25;;244:1;238:2;227:8;:13;;;;;;;;:18;;224:55;;;276:2;265:8;:13;;;;;;;;259:2;:20;247:32;;;;224:55;350:8;335:3;:12;;:23;;;;;408:4;402:11;438:3;433;426:16;467:1;462:3;455:14;504:8;499:3;495:18;489:4;482:32;377:147;;;;:::o;2193:122:20:-;2261:47;2288:3;397:1;2261:26;:47::i;:::-;2193:122;:::o;461:690::-;567:2;558:5;:11;;555:590;;;585:39;617:5;612:1;603:5;:10;;;;;;602:20;;;585:3;:10;;:39;;;;:::i;:::-;555:590;;;653:4;644:5;:13;;641:504;;;673:36;705:2;700:1;691:5;:10;;;;;;690:17;673:3;:10;;:36;;;;:::i;:::-;723:23;737:5;744:1;723:3;:13;;:23;;;;;:::i;:::-;;641:504;;;775:6;766:5;:15;;763:382;;;797:36;829:2;824:1;815:5;:10;;;;;;814:17;797:3;:10;;:36;;;;:::i;:::-;847:23;861:5;868:1;847:3;:13;;:23;;;;;:::i;:::-;;763:382;;;899:10;890:5;:19;;887:258;;;925:36;957:2;952:1;943:5;:10;;;;;;942:17;925:3;:10;;:36;;;;:::i;:::-;975:23;989:5;996:1;975:3;:13;;:23;;;;;:::i;:::-;;887:258;;;1027:18;1018:5;:27;;1015:130;;;1061:36;1093:2;1088:1;1079:5;:10;;;;;;1078:17;1061:3;:10;;:36;;;;:::i;:::-;1111:23;1125:5;1132:1;1111:3;:13;;:23;;;;;:::i;:::-;;1015:130;887:258;763:382;641:504;555:590;461:690;;;:::o;1109:1251:19:-;1178:6;;:::i;:::-;1333:9;1352:8;1370;2117:9;1237:3;:12;;;1220:3;:7;;;:14;1206:4;:11;:28;:43;1203:120;;;1265:47;1272:3;1310:1;1277:30;1281:3;:12;;;1295:4;:11;1277:3;:30::i;:::-;:34;1265:6;:47::i;:::-;1203:120;1381:4;:11;1370:22;;1494:3;1488:10;1577:6;1571:13;1716:2;1707:6;1699;1695:19;1691:28;1683:36;;1801:4;1795:11;1787:6;1783:24;1775:6;1768:40;1838:2;1832:4;1828:13;1821:20;;1411:440;;1911:164;1924:2;1917:3;:9;;1911:164;;;1999:3;1993:10;1987:4;1980:24;2039:2;2031:10;;;;2062:2;2055:9;;;;1935:2;1928:9;;;;1911:164;;;2149:1;2142:3;2137:2;:8;2129:3;:17;:21;2117:33;;2218:4;2214:9;2208:3;2202:10;2198:26;2270:4;2263;2257:11;2253:22;2314:7;2304:8;2301:21;2295:4;2288:35;2169:164;;2350:3;2343:10;;1109:1251;;;;;;;;:::o;1157:141:20:-;1255:36;1287:2;1282:1;1273:5;:10;;;;;;1272:17;1255:3;:10;;:36;;;;:::i;:::-;1157:141;;:::o;2621:615:19:-;2716:3;:12;;;2712:1;2695:3;:7;;;:14;:18;:33;2692:92;;;2744:29;2751:3;2771:1;2756:3;:12;;;:16;2744:6;:29::i;:::-;2692:92;2886:3;2880:10;2969:6;2963:13;3106:2;3097:6;3089;3085:19;3081:28;3136:4;3130;3122:19;3217:1;3209:6;3205:14;3197:6;3190:30;2803:427;;;;;:::o;3497:759::-;3578:6;;:::i;:::-;3717:9;3629:3;:12;;;3612:3;:7;;;:14;3606:3;:20;:35;3603:104;;;3657:39;3664:3;3694:1;3669:22;3673:3;:12;;;3687:3;3669;:22::i;:::-;:26;3657:6;:39::i;:::-;3603:104;3742:1;3736:3;3729;:10;:14;3717:26;;3845:3;3839:10;3928:6;3922:13;4071:3;4062:6;4054;4050:19;4046:29;4133:4;4125;4121:9;4114:4;4108:11;4104:27;4101:37;4095:4;4088:51;4215:3;4207:6;4203:16;4195:6;4188:32;3762:468;;;4246:3;4239:10;;3497:759;;;;;;:::o;709:133::-;759:4;782:1;778;:5;775:43;;;806:1;799:8;;;;775:43;834:1;827:8;;709:133;;;;;:::o;536:167::-;609:19;631:3;:7;;;609:29;;648:19;653:3;658:8;648:4;:19::i;:::-;677;684:3;689:6;677;:19::i;:::-;;536:167;;;:::o;66:868:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o",
"source": "pragma solidity ^0.4.22;\n\nimport \"./CoinMarketCapChainlink.sol\";\n\ncontract MakeRebalance is CoinMarketCapChainlink {\n\n string daiAPICode = \"DAI\";\n string chainlinkAPICode = \"LINK\";\n\n uint256 daiPrice;\n uint256 chainlinkPrice;\n\n bytes32 daiRequest;\n bytes32 clRequest;\n\n function calculateValues() public {\n daiRequest = requestCoinMarketCapPrice(daiAPICode, \"USD\");\n clRequest = requestCoinMarketCapPrice(chainlinkAPICode, \"USD\");\n }\n\n function checkRequest(bytes32 requestId, uint256 coinPrice) public\n checkChainlinkFulfillment(requestId)\n {\n if (requestId == daiRequest) {\n daiPrice = coinPrice;\n } else {\n chainlinkPrice = coinPrice;\n }\n }\n\n function returnDaiValue() public view returns(uint256) {\n return daiPrice;\n }\n\n function returnClValues() public view returns(uint256) {\n return chainlinkPrice;\n }\n}\n",
"sourcePath": "/home/emiller/src/ETH-SF/project/contracts/MakeRebalance.sol",
"ast": {
"absolutePath": "/home/emiller/src/ETH-SF/project/contracts/MakeRebalance.sol",
"exportedSymbols": {
"MakeRebalance": [
198
]
},
"id": 199,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 121,
"literals": [
"solidity",
"^",
"0.4",
".22"
],
"nodeType": "PragmaDirective",
"src": "0:24:1"
},
{
"absolutePath": "/home/emiller/src/ETH-SF/project/contracts/CoinMarketCapChainlink.sol",
"file": "./CoinMarketCapChainlink.sol",
"id": 122,
"nodeType": "ImportDirective",
"scope": 199,
"sourceUnit": 120,
"src": "26:38:1",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 123,
"name": "CoinMarketCapChainlink",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 119,
"src": "92:22:1",
"typeDescriptions": {
"typeIdentifier": "t_contract$_CoinMarketCapChainlink_$119",
"typeString": "contract CoinMarketCapChainlink"
}
},
"id": 124,
"nodeType": "InheritanceSpecifier",
"src": "92:22:1"
}
],
"contractDependencies": [
119,
3596
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 198,
"linearizedBaseContracts": [
198,
119,
3596
],
"name": "MakeRebalance",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 127,
"name": "daiAPICode",
"nodeType": "VariableDeclaration",
"scope": 198,
"src": "122:25:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 125,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "122:6:1",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": {
"argumentTypes": null,
"hexValue": "444149",
"id": 126,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "142:5:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_a5e92f3efb6826155f1f728e162af9d7cda33a574a1153b58f03ea01cc37e568",
"typeString": "literal_string \"DAI\""
},
"value": "DAI"
},
"visibility": "internal"
},
{
"constant": false,
"id": 130,
"name": "chainlinkAPICode",
"nodeType": "VariableDeclaration",
"scope": 198,
"src": "153:32:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 128,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "153:6:1",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": {
"argumentTypes": null,
"hexValue": "4c494e4b",
"id": 129,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "179:6:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_921a3539bcb764c889432630877414523e7fbca00c211bc787aeae69e2e3a779",
"typeString": "literal_string \"LINK\""
},
"value": "LINK"
},
"visibility": "internal"
},
{
"constant": false,
"id": 132,
"name": "daiPrice",
"nodeType": "VariableDeclaration",
"scope": 198,
"src": "192:16:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 131,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "192:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 134,
"name": "chainlinkPrice",
"nodeType": "VariableDeclaration",
"scope": 198,
"src": "214:22:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 133,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "214:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 136,
"name": "daiRequest",
"nodeType": "VariableDeclaration",
"scope": 198,
"src": "243:18:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 135,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "243:7:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 138,
"name": "clRequest",
"nodeType": "VariableDeclaration",
"scope": 198,
"src": "267:17:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 137,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "267:7:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"body": {
"id": 155,
"nodeType": "Block",
"src": "325:146:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 146,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 141,
"name": "daiRequest",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 136,
"src": "335:10:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 143,
"name": "daiAPICode",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 127,
"src": "374:10:1",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
{
"argumentTypes": null,
"hexValue": "555344",
"id": 144,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "386:5:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c4ae21aac0c6549d71dd96035b7e0bdb6c79ebdba8891b666115bc976d16a29e",
"typeString": "literal_string \"USD\""
},
"value": "USD"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
},
{
"typeIdentifier": "t_stringliteral_c4ae21aac0c6549d71dd96035b7e0bdb6c79ebdba8891b666115bc976d16a29e",
"typeString": "literal_string \"USD\""
}
],
"id": 142,
"name": "requestCoinMarketCapPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 118,
"src": "348:25:1",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_string_memory_ptr_$_t_string_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (string memory,string memory) returns (bytes32)"
}
},
"id": 145,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "348:44:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "335:57:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 147,
"nodeType": "ExpressionStatement",
"src": "335:57:1"
},
{
"expression": {
"argumentTypes": null,
"id": 153,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 148,
"name": "clRequest",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 138,
"src": "402:9:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 150,
"name": "chainlinkAPICode",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 130,
"src": "440:16:1",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
{
"argumentTypes": null,
"hexValue": "555344",
"id": 151,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "458:5:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c4ae21aac0c6549d71dd96035b7e0bdb6c79ebdba8891b666115bc976d16a29e",
"typeString": "literal_string \"USD\""
},
"value": "USD"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
},
{
"typeIdentifier": "t_stringliteral_c4ae21aac0c6549d71dd96035b7e0bdb6c79ebdba8891b666115bc976d16a29e",
"typeString": "literal_string \"USD\""
}
],
"id": 149,
"name": "requestCoinMarketCapPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 118,
"src": "414:25:1",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_string_memory_ptr_$_t_string_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (string memory,string memory) returns (bytes32)"
}
},
"id": 152,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "414:50:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "402:62:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 154,
"nodeType": "ExpressionStatement",
"src": "402:62:1"
}
]
},
"documentation": null,
"id": 156,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "calculateValues",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 139,
"nodeType": "ParameterList",
"parameters": [],
"src": "315:2:1"
},
"payable": false,
"returnParameters": {
"id": 140,
"nodeType": "ParameterList",
"parameters": [],
"src": "325:0:1"
},
"scope": 198,
"src": "291:180:1",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 180,
"nodeType": "Block",
"src": "593:147:1",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"id": 168,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 166,
"name": "requestId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 158,
"src": "607:9:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 167,
"name": "daiRequest",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 136,
"src": "620:10:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "607:23:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 178,
"nodeType": "Block",
"src": "683:51:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 176,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 174,
"name": "chainlinkPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 134,
"src": "697:14:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 175,
"name": "coinPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 160,
"src": "714:9:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "697:26:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 177,
"nodeType": "ExpressionStatement",
"src": "697:26:1"
}
]
},
"id": 179,
"nodeType": "IfStatement",
"src": "603:131:1",
"trueBody": {
"id": 173,
"nodeType": "Block",
"src": "632:45:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 171,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 169,
"name": "daiPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 132,
"src": "646:8:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 170,
"name": "coinPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 160,
"src": "657:9:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "646:20:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 172,
"nodeType": "ExpressionStatement",
"src": "646:20:1"
}
]
}
}
]
},
"documentation": null,
"id": 181,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 163,
"name": "requestId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 158,
"src": "578:9:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"id": 164,
"modifierName": {
"argumentTypes": null,
"id": 162,
"name": "checkChainlinkFulfillment",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3595,
"src": "552:25:1",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_bytes32_$",
"typeString": "modifier (bytes32)"
}
},
"nodeType": "ModifierInvocation",
"src": "552:36:1"
}
],
"name": "checkRequest",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 161,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 158,
"name": "requestId",
"nodeType": "VariableDeclaration",
"scope": 181,
"src": "499:17:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 157,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "499:7:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 160,
"name": "coinPrice",
"nodeType": "VariableDeclaration",
"scope": 181,
"src": "518:17:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 159,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "518:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "498:38:1"
},
"payable": false,
"returnParameters": {
"id": 165,
"nodeType": "ParameterList",
"parameters": [],
"src": "593:0:1"
},
"scope": 198,
"src": "477:263:1",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 188,
"nodeType": "Block",
"src": "801:32:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 186,
"name": "daiPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 132,
"src": "818:8:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 185,
"id": 187,
"nodeType": "Return",
"src": "811:15:1"
}
]
},
"documentation": null,
"id": 189,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "returnDaiValue",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 182,
"nodeType": "ParameterList",
"parameters": [],
"src": "769:2:1"
},
"payable": false,
"returnParameters": {
"id": 185,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 184,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 189,
"src": "792:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 183,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "792:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "791:9:1"
},
"scope": 198,
"src": "746:87:1",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 196,
"nodeType": "Block",
"src": "894:38:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 194,
"name": "chainlinkPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 134,
"src": "911:14:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 193,
"id": 195,
"nodeType": "Return",
"src": "904:21:1"
}
]
},
"documentation": null,
"id": 197,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "returnClValues",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 190,
"nodeType": "ParameterList",
"parameters": [],
"src": "862:2:1"
},
"payable": false,
"returnParameters": {
"id": 193,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 192,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 197,
"src": "885:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 191,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "885:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "884:9:1"
},
"scope": 198,
"src": "839:93:1",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
}
],
"scope": 199,
"src": "66:868:1"
}
],
"src": "0:935:1"
},
"legacyAST": {
"absolutePath": "/home/emiller/src/ETH-SF/project/contracts/MakeRebalance.sol",
"exportedSymbols": {
"MakeRebalance": [
198
]
},
"id": 199,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 121,
"literals": [
"solidity",
"^",
"0.4",
".22"
],
"nodeType": "PragmaDirective",
"src": "0:24:1"
},
{
"absolutePath": "/home/emiller/src/ETH-SF/project/contracts/CoinMarketCapChainlink.sol",
"file": "./CoinMarketCapChainlink.sol",
"id": 122,
"nodeType": "ImportDirective",
"scope": 199,
"sourceUnit": 120,
"src": "26:38:1",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 123,
"name": "CoinMarketCapChainlink",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 119,
"src": "92:22:1",
"typeDescriptions": {
"typeIdentifier": "t_contract$_CoinMarketCapChainlink_$119",
"typeString": "contract CoinMarketCapChainlink"
}
},
"id": 124,
"nodeType": "InheritanceSpecifier",
"src": "92:22:1"
}
],
"contractDependencies": [
119,
3596
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 198,
"linearizedBaseContracts": [
198,
119,
3596
],
"name": "MakeRebalance",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 127,
"name": "daiAPICode",
"nodeType": "VariableDeclaration",
"scope": 198,
"src": "122:25:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 125,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "122:6:1",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": {
"argumentTypes": null,
"hexValue": "444149",
"id": 126,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "142:5:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_a5e92f3efb6826155f1f728e162af9d7cda33a574a1153b58f03ea01cc37e568",
"typeString": "literal_string \"DAI\""
},
"value": "DAI"
},
"visibility": "internal"
},
{
"constant": false,
"id": 130,
"name": "chainlinkAPICode",
"nodeType": "VariableDeclaration",
"scope": 198,
"src": "153:32:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 128,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "153:6:1",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": {
"argumentTypes": null,
"hexValue": "4c494e4b",
"id": 129,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "179:6:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_921a3539bcb764c889432630877414523e7fbca00c211bc787aeae69e2e3a779",
"typeString": "literal_string \"LINK\""
},
"value": "LINK"
},
"visibility": "internal"
},
{
"constant": false,
"id": 132,
"name": "daiPrice",
"nodeType": "VariableDeclaration",
"scope": 198,
"src": "192:16:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 131,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "192:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 134,
"name": "chainlinkPrice",
"nodeType": "VariableDeclaration",
"scope": 198,
"src": "214:22:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 133,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "214:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 136,
"name": "daiRequest",
"nodeType": "VariableDeclaration",
"scope": 198,
"src": "243:18:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 135,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "243:7:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 138,
"name": "clRequest",
"nodeType": "VariableDeclaration",
"scope": 198,
"src": "267:17:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 137,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "267:7:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"body": {
"id": 155,
"nodeType": "Block",
"src": "325:146:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 146,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 141,
"name": "daiRequest",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 136,
"src": "335:10:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 143,
"name": "daiAPICode",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 127,
"src": "374:10:1",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
{
"argumentTypes": null,
"hexValue": "555344",
"id": 144,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "386:5:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c4ae21aac0c6549d71dd96035b7e0bdb6c79ebdba8891b666115bc976d16a29e",
"typeString": "literal_string \"USD\""
},
"value": "USD"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
},
{
"typeIdentifier": "t_stringliteral_c4ae21aac0c6549d71dd96035b7e0bdb6c79ebdba8891b666115bc976d16a29e",
"typeString": "literal_string \"USD\""
}
],
"id": 142,
"name": "requestCoinMarketCapPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 118,
"src": "348:25:1",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_string_memory_ptr_$_t_string_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (string memory,string memory) returns (bytes32)"
}
},
"id": 145,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "348:44:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "335:57:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 147,
"nodeType": "ExpressionStatement",
"src": "335:57:1"
},
{
"expression": {
"argumentTypes": null,
"id": 153,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 148,
"name": "clRequest",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 138,
"src": "402:9:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 150,
"name": "chainlinkAPICode",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 130,
"src": "440:16:1",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
{
"argumentTypes": null,
"hexValue": "555344",
"id": 151,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "458:5:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c4ae21aac0c6549d71dd96035b7e0bdb6c79ebdba8891b666115bc976d16a29e",
"typeString": "literal_string \"USD\""
},
"value": "USD"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
},
{
"typeIdentifier": "t_stringliteral_c4ae21aac0c6549d71dd96035b7e0bdb6c79ebdba8891b666115bc976d16a29e",
"typeString": "literal_string \"USD\""
}
],
"id": 149,
"name": "requestCoinMarketCapPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 118,
"src": "414:25:1",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_string_memory_ptr_$_t_string_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (string memory,string memory) returns (bytes32)"
}
},
"id": 152,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "414:50:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "402:62:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 154,
"nodeType": "ExpressionStatement",
"src": "402:62:1"
}
]
},
"documentation": null,
"id": 156,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "calculateValues",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 139,
"nodeType": "ParameterList",
"parameters": [],
"src": "315:2:1"
},
"payable": false,
"returnParameters": {
"id": 140,
"nodeType": "ParameterList",
"parameters": [],
"src": "325:0:1"
},
"scope": 198,
"src": "291:180:1",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 180,
"nodeType": "Block",
"src": "593:147:1",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"id": 168,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 166,
"name": "requestId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 158,
"src": "607:9:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 167,
"name": "daiRequest",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 136,
"src": "620:10:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "607:23:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 178,
"nodeType": "Block",
"src": "683:51:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 176,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 174,
"name": "chainlinkPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 134,
"src": "697:14:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 175,
"name": "coinPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 160,
"src": "714:9:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "697:26:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 177,
"nodeType": "ExpressionStatement",
"src": "697:26:1"
}
]
},
"id": 179,
"nodeType": "IfStatement",
"src": "603:131:1",
"trueBody": {
"id": 173,
"nodeType": "Block",
"src": "632:45:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 171,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 169,
"name": "daiPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 132,
"src": "646:8:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 170,
"name": "coinPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 160,
"src": "657:9:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "646:20:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 172,
"nodeType": "ExpressionStatement",
"src": "646:20:1"
}
]
}
}
]
},
"documentation": null,
"id": 181,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 163,
"name": "requestId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 158,
"src": "578:9:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"id": 164,
"modifierName": {
"argumentTypes": null,
"id": 162,
"name": "checkChainlinkFulfillment",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3595,
"src": "552:25:1",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_bytes32_$",
"typeString": "modifier (bytes32)"
}
},
"nodeType": "ModifierInvocation",
"src": "552:36:1"
}
],
"name": "checkRequest",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 161,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 158,
"name": "requestId",
"nodeType": "VariableDeclaration",
"scope": 181,
"src": "499:17:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 157,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "499:7:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 160,
"name": "coinPrice",
"nodeType": "VariableDeclaration",
"scope": 181,
"src": "518:17:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 159,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "518:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "498:38:1"
},
"payable": false,
"returnParameters": {
"id": 165,
"nodeType": "ParameterList",
"parameters": [],
"src": "593:0:1"
},
"scope": 198,
"src": "477:263:1",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 188,
"nodeType": "Block",
"src": "801:32:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 186,
"name": "daiPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 132,
"src": "818:8:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 185,
"id": 187,
"nodeType": "Return",
"src": "811:15:1"
}
]
},
"documentation": null,
"id": 189,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "returnDaiValue",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 182,
"nodeType": "ParameterList",
"parameters": [],
"src": "769:2:1"
},
"payable": false,
"returnParameters": {
"id": 185,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 184,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 189,
"src": "792:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 183,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "792:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "791:9:1"
},
"scope": 198,
"src": "746:87:1",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 196,
"nodeType": "Block",
"src": "894:38:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 194,
"name": "chainlinkPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 134,
"src": "911:14:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 193,
"id": 195,
"nodeType": "Return",
"src": "904:21:1"
}
]
},
"documentation": null,
"id": 197,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "returnClValues",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 190,
"nodeType": "ParameterList",
"parameters": [],
"src": "862:2:1"
},
"payable": false,
"returnParameters": {
"id": 193,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 192,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 197,
"src": "885:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 191,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "885:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "884:9:1"
},
"scope": 198,
"src": "839:93:1",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
}
],
"scope": 199,
"src": "66:868:1"
}
],
"src": "0:935:1"
},
"compiler": {
"name": "solc",
"version": "0.4.24+commit.e67f0147.Emscripten.clang"
},
"networks": {},
"schemaVersion": "2.0.1",
"updatedAt": "2018-10-07T17:03:39.344Z"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment