Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xae465FD39B519602eE28F062037F7B9c41FDc8cF
Balance 0 ETH
Nonce 2
Code Size 9918 bytes
Last Active
Indexed Transactions 1 (24,292,84024,292,840)
Gas Used (indexed) 122,557
External Etherscan · Sourcify

Contract Bytecode

9918 bytes
0x608060405234801561001057600080fd5b50600436106102535760003560e01c80638f7bf4fd11610146578063bbb7d489116100c3578063db006a7511610087578063db006a751461057a578063dd5a612c14610597578063e6136ab61461059f578063e68fc0ee146105c5578063e9cbd822146105eb578063f8f9da28146105f357610253565b8063bbb7d4891461051b578063bd6d894d14610523578063cb7b42061461052b578063cd5c6f5714610533578063d40e8f4a1461053b57610253565b8063aa5af0fd1161010a578063aa5af0fd14610489578063ab292f9b14610491578063ae9d70b0146104c7578063b1be82f1146104cf578063b23f3594146104f557610253565b80638f7bf4fd146104185780638f840ddd1461043e57806394d359901461044657806399a5d74714610464578063a6afed951461048157610253565b80634cf3e784116101d45780635e318e07116101985780635e318e07146103bd5780636c540baf146103da57806370ba1113146103e257806373acee98146103ea5780637746efab146103f257610253565b80634cf3e784146103625780634ee8acc01461038857806357d32b7a14610390578063591cec86146103ad5780635cf57389146103b557610253565b80633662454d1161021b5780633662454d146102eb57806336820e4b146103085780633b1d21a21461032e57806347bd37181461033657806348dc0b6e1461033e57610253565b80630e75270214610258578063173b99041461027757806317bfdfbc146102915780631f2dc5ef146102b7578063232d46d2146102bf575b600080fd5b6102756004803603602081101561026e57600080fd5b50356105fb565b005b61027f6108eb565b60408051918252519081900360200190f35b61027f600480360360208110156102a757600080fd5b50356001600160a01b03166108f1565b61027f61090c565b610275600480360360408110156102d557600080fd5b50803590602001356001600160a01b0316610912565b6102756004803603602081101561030157600080fd5b5035610a54565b61027f6004803603602081101561031e57600080fd5b50356001600160a01b0316610aa6565b61027f610ab8565b61027f610ac8565b610346610ace565b604080516001600160a01b039092168252519081900360200190f35b6102756004803603602081101561037857600080fd5b50356001600160a01b0316610add565b610346610b5e565b610275600480360360208110156103a657600080fd5b5035610b6d565b610346610ca7565b610346610cb6565b610275600480360360208110156103d357600080fd5b5035610cc5565b61027f610d8c565b61027f610d92565b61027f610d98565b61027f6004803603602081101561040857600080fd5b50356001600160a01b0316610da9565b61027f6004803603602081101561042e57600080fd5b50356001600160a01b0316610e4c565b61027f610f01565b61044e610f07565b6040805160ff9092168252519081900360200190f35b61027f6004803603602081101561047a57600080fd5b5035610f7d565b610275610fae565b61027f611211565b610275600480360360608110156104a757600080fd5b506001600160a01b03813581169160208101359091169060400135611217565b61027f6112b9565b610275600480360360208110156104e557600080fd5b50356001600160a01b0316611327565b6102756004803603602081101561050b57600080fd5b50356001600160a01b0316611392565b610346611413565b61027f611422565b61027f611573565b61027f611579565b6105616004803603602081101561055157600080fd5b50356001600160a01b03166115be565b6040805192835260208301919091528051918290030190f35b6102756004803603602081101561059057600080fd5b50356115d7565b61027f611a20565b61027f600480360360208110156105b557600080fd5b50356001600160a01b0316611a6b565b61027f600480360360208110156105db57600080fd5b50356001600160a01b0316611ba5565b610346611bb7565b61027f611bc6565b600854421161060957600080fd5b610611612498565b61061a336108f1565b6060820181905282111561065f5760405162461bcd60e51b815260040180806020018281038252602c81526020018061258b602c913960400191505060405180910390fd5b81610673576060810151602082015261067b565b602081018290525b602080820151600a54604080516370a0823160e01b8152336004820152905192936001600160a01b03909216926370a0823192602480840193919291829003018186803b1580156106cb57600080fd5b505afa1580156106df573d6000803e3d6000fd5b505050506040513d60208110156106f557600080fd5b5051101561074a576040805162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820737461626c65636f696e20746f2072657061790000604482015290519081900360640190fd5b6020810151600a54610771916001600160a01b03909116903390309063ffffffff611c2a16565b61078381606001518260200151611c8a565b608083018190528282600381111561079757fe5b60038111156107a257fe5b90525060009050815160038111156107b657fe5b146107f25760405162461bcd60e51b81526004018080602001828103825260338152602001806125fb6033913960400191505060405180910390fd5b6108026004548260200151611c8a565b60a083018190528282600381111561081657fe5b600381111561082157fe5b905250600090508151600381111561083557fe5b146108715760405162461bcd60e51b815260040180806020018281038252603181526020018061262e6031913960400191505060405180910390fd5b60a0810151600455608080820151336000818152600e60209081526040918290208481556003546001909101819055825193845290830187905282820193909352606082019290925290517f0bc102cfc64751888477c44e529873a602bf746175b1e41c6b54e45f926f90f9929181900390910190a15050565b60015481565b60006108fb610fae565b61090482610da9565b90505b919050565b60075481565b600c546001600160a01b0316331461092957600080fd5b600854421161093757600080fd5b61093f6124e5565b82610948611a20565b1161099a576040805162461bcd60e51b815260206004820152601960248201527f4e6f7420656e6f75676820746f6b656e7320746f206c656e6400000000000000604482015290519081900360640190fd5b6109a382610da9565b602082018190526109b49084611cb0565b60408301819052828260038111156109c857fe5b60038111156109d357fe5b81525050506109e460045484611cb0565b60608301819052828260038111156109f857fe5b6003811115610a0357fe5b905250506040808201516001600160a01b038085166000908152600e602052929092209081556003546001909101556060820151600455600a54610a4f9116838563ffffffff611cd616565b505050565b6009546001600160a01b03163314610a6b57600080fd5b60018190556040805182815290517f1804cd3c6ff50c5878703b3136dbf22bce42299e390b6627af008fde9bc763ae9181900360200190a150565b60106020526000908152604090205481565b6000610ac2611a20565b90505b90565b60045481565b600d546001600160a01b031681565b600c546001600160a01b03163314610af457600080fd5b600c54604080516001600160a01b038085168252909216602083015280517ff31f198b56fc88f5180e2da8285f8fc0e39731c96e24af25bab67838a32c5d799281900390910190a1600c80546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b610b7561250e565b610b7d611422565b602080830191825260408051918201905290518152610b9d908390611d28565b6040830181905282826003811115610bb157fe5b6003811115610bbc57fe5b90525050600a54610bde906001600160a01b031633308563ffffffff611c2a16565b336000818152600f6020526040808220805486019055600b548482015182516340c10f1960e01b81526004810195909552602485015290516001600160a01b03909116926340c10f1992604480830193919282900301818387803b158015610c4557600080fd5b505af1158015610c59573d6000803e3d6000fd5b5050506040808301518151338152602081018690528083019190915290517fac45f50416433593e7c9a1f3e0d5f887c530c22d776e1057ecaacb750d24b94092509081900360600190a15050565b600a546001600160a01b031690565b6009546001600160a01b031681565b6009546001600160a01b03163314610cdc57600080fd5b806005541015610d1d5760405162461bcd60e51b81526004018080602001828103825260238152602001806125b76023913960400191505060405180910390fd5b600554610d30908263ffffffff611d7b16565b600555600954600a54610d56916001600160a01b0391821691168363ffffffff611cd616565b6040805182815290517f2b33eb7f7ae0d9bb1596ccbff4b5ed6460dd64eb6bef0c24870065aa469bbb749181900360200190a150565b60025481565b60065481565b6000610da2610fae565b5060045490565b6001600160a01b0381166000908152600e60205260408120805482918291829190610ddb576000945050505050610907565b610deb8160000154600354611dc6565b90945092506000846003811115610dfe57fe5b14610e10576000945050505050610907565b610e1e838260010154611e05565b90945091506000846003811115610e3157fe5b14610e43576000945050505050610907565b50949350505050565b600080610e57611579565b600b54604080516370a0823160e01b81526001600160a01b038781166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b158015610eaa57600080fd5b505afa158015610ebe573d6000803e3d6000fd5b505050506040513d6020811015610ed457600080fd5b505160408051602081019091528381529091506000908190610ef69084611e30565b979650505050505050565b60055481565b600a546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b158015610f4c57600080fd5b505afa158015610f60573d6000803e3d6000fd5b505050506040513d6020811015610f7657600080fd5b5051905090565b600080610fa7600754610f9b60065486611e4790919063ffffffff16565b9063ffffffff611ea016565b9392505050565b6000610fb8611ee2565b60025490915080821415611000576040805183815290517fe307fb74a265b8255fabc1154131917ce875f96118a807f88eda1e751722538d9181900360200190a1505061120f565b600061100a611a20565b60048054600554600354600d54604080516315f2405360e01b81529586018790526024860185905260448601849052519596509294919390926000926001600160a01b03909116916315f24053916064808301926020929190829003018186803b15801561107757600080fd5b505afa15801561108b573d6000803e3d6000fd5b505050506040513d60208110156110a157600080fd5b5051905065048c27395000811115611100576040805162461bcd60e51b815260206004820152601a60248201527f426f72726f772052617465206d616e7469737361206572726f72000000000000604482015290519081900360640190fd5b60008061110d8989611c8a565b91509150611119612539565b60008060008061113760405180602001604052808a81525087611ee6565b9097509450611146858c611e30565b9097509350611155848c611cb0565b60408051602081019091526001548152919850935061117590858c611f4e565b9097509150611185858a80611f4e565b80925081985050508d6002819055508060038190555082600481905550816005819055507fe3972ae250606e82c6683843383cb8a51755588d2f443af42e8cb5b1e085392d6002546003546004546005546040518085815260200184815260200183815260200182815260200194505050505060405180910390a150505050505050505050505050505b565b60035481565b600c546001600160a01b0316331461122e57600080fd5b600854421161123c57600080fd5b600a5461125a906001600160a01b031683308463ffffffff611c2a16565b600061126582610f7d565b60055490915061127b908263ffffffff611faa16565b6005556001600160a01b0384166000908152600e60205260408120818155600101556004546112b0908363ffffffff611d7b16565b60045550505050565b600d546000906001600160a01b031663b81688166112d5611a20565b6004546005546001546040518563ffffffff1660e01b81526004018085815260200184815260200183815260200182815260200194505050505060206040518083038186803b158015610f4c57600080fd5b600c546001600160a01b0316331461133e57600080fd5b600d80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f7d15df4d1352c1d406124f1da1c26fb576738b2a62fb49aad60d454485c6afb29181900360200190a150565b600c546001600160a01b031633146113a957600080fd5b600954604080516001600160a01b038085168252909216602083015280517fe1ad690b4e5d7c6172f2c241aa6998a8ebcb0392e02cdf10105a33b3955538b49281900390910190a1600980546001600160a01b0319166001600160a01b0392909216919091179055565b600c546001600160a01b031681565b600061142c610fae565b600b60009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561147a57600080fd5b505afa15801561148e573d6000803e3d6000fd5b505050506040513d60208110156114a457600080fd5b50516114b35750600054610ac5565b60006114bd611a20565b905060006114c9612539565b60006114da84600454600554612004565b809450819250505061156583600b60009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561153457600080fd5b505afa158015611548573d6000803e3d6000fd5b505050506040513d602081101561155e57600080fd5b5051612042565b519550610ac5945050505050565b60085481565b600b54604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561147a57600080fd5b600e602052600090815260409020805460019091015482565b6115df61254c565b600b54604080516370a0823160e01b815233600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561162a57600080fd5b505afa15801561163e573d6000803e3d6000fd5b505050506040513d602081101561165457600080fd5b50516060820152611663611422565b60208083019182526040805191820190529051815260608201516116879190611e30565b608083018190528282600381111561169b57fe5b60038111156116a657fe5b90525050816116be57608081015160c08201526116c6565b60c081018290525b6116e68160c0015160405180602001604052808460200151815250611d28565b60408301819052828260038111156116fa57fe5b600381111561170557fe5b9052505060c0810151600a54604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561175957600080fd5b505afa15801561176d573d6000803e3d6000fd5b505050506040513d602081101561178357600080fd5b505110156117d8576040805162461bcd60e51b815260206004820152601f60248201527f4e6f7420656e6f75676820737461626c65636f696e20696e207661756c742e00604482015290519081900360640190fd5b336000908152600f60205260408120546080830151111561181a57336000908152600f602052604090205460808301516118179163ffffffff611d7b16565b90505b60c082015161182f908263ffffffff611d7b16565b60a083015260c0820151811161190c573360009081526010602052604090205461185f908263ffffffff611faa16565b33600090815260106020908152604080832093909355600f9052205460a083015111156118d3576040805162461bcd60e51b815260206004820152601960248201527f4572726f722063616c63756c6174696e67207265776172642e00000000000000604482015290519081900360640190fd5b60a0820151336000908152600f60205260409020546118f79163ffffffff611d7b16565b336000908152600f6020526040902055611941565b60c0820151336000908152601060205260409020546119309163ffffffff611faa16565b336000908152601060205260409020555b600b546040808401518151632770a7eb60e21b8152336004820152602481019190915290516001600160a01b0390921691639dc29fac9160448082019260009290919082900301818387803b15801561199957600080fd5b505af11580156119ad573d6000803e3d6000fd5b50505060c0830151600a546119d492506001600160a01b031690339063ffffffff611cd616565b60c08201516040808401518151338152602081019390935282820152517f01fee552fc58f62ae566675c42acc86f4aeaf48d6a4e21385c0e23bd551ecd129181900360600190a1505050565b600a54604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610f4c57600080fd5b600080611a76611579565b600b54604080516370a0823160e01b81526001600160a01b038781166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b158015611ac957600080fd5b505afa158015611add573d6000803e3d6000fd5b505050506040513d6020811015611af357600080fd5b50516001600160a01b0385166000908152600f602052604090205490915081611b3857505050506001600160a01b038116600090815260106020526040902054610907565b600080611b5360405180602001604052808781525085611e30565b90925090506000611b6a828563ffffffff611d7b16565b6001600160a01b03891660009081526010602052604081205491925090611b9890839063ffffffff611faa16565b9998505050505050505050565b600f6020526000908152604090205481565b600a546001600160a01b031681565b600d546000906001600160a01b03166315f24053611be2611a20565b6004546005546040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060206040518083038186803b158015610f4c57600080fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611c849085906120f3565b50505050565b600080838311611ca1575060009050818303611ca9565b506003905060005b9250929050565b600080838301848110611cc857600092509050611ca9565b506002915060009050611ca9565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610a4f9084906120f3565b6000806000611d35612539565b611d3f86866121a4565b90925090506000826003811115611d5257fe5b14611d635750915060009050611ca9565b6000611d6e82612203565b9350935050509250929050565b6000611dbd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612212565b90505b92915050565b60008083611dd957506000905080611ca9565b83830283858281611de657fe5b0414611dfa57506002915060009050611ca9565b600092509050611ca9565b60008082611e195750600190506000611ca9565b6000838581611e2457fe5b04915091509250929050565b6000806000611e3d612539565b611d3f8686611ee6565b600082611e5657506000611dc0565b82820282848281611e6357fe5b0414611dbd5760405162461bcd60e51b81526004018080602001828103825260218152602001806125da6021913960400191505060405180910390fd5b6000611dbd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506122a9565b4390565b6000611ef0612539565b600080611f01866000015186611dc6565b90925090506000826003811115611f1457fe5b14611f3357506040805160208101909152600081529092509050611ca9565b60408051602081019091529081526000969095509350505050565b6000806000611f5b612539565b611f658787611ee6565b90925090506000826003811115611f7857fe5b14611f895750915060009050611fa2565b611f9b611f9582612203565b86611cb0565b9350935050505b935093915050565b600082820183811015611dbd576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000806000806120148787611cb0565b9092509050600082600381111561202757fe5b146120385750915060009050611fa2565b611f9b8186611c8a565b600061204c612539565b60008061206186670de0b6b3a7640000611dc6565b9092509050600082600381111561207457fe5b1461209357506040805160208101909152600081529092509050611ca9565b6000806120a08388611e05565b909250905060008260038111156120b357fe5b146120d65781604051806020016040528060008152509550955050505050611ca9565b604080516020810190915290815260009890975095505050505050565b6060612148826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661230e9092919063ffffffff16565b805190915015610a4f5780806020019051602081101561216757600080fd5b5051610a4f5760405162461bcd60e51b815260040180806020018281038252602a81526020018061265f602a913960400191505060405180910390fd5b60006121ae612539565b6000806121c3670de0b6b3a764000087611dc6565b909250905060008260038111156121d657fe5b146121f557506040805160208101909152600081529092509050611ca9565b611d6e818660000151612042565b51670de0b6b3a7640000900490565b600081848411156122a15760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561226657818101518382015260200161224e565b50505050905090810190601f1680156122935780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836122f85760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561226657818101518382015260200161224e565b50600083858161230457fe5b0495945050505050565b606061231d8484600085612325565b949350505050565b606061233085612492565b612381576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106123c05780518252601f1990920191602091820191016123a1565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612422576040519150601f19603f3d011682016040523d82523d6000602084013e612427565b606091505b5091509150811561243b57915061231d9050565b80511561244b5780518082602001fd5b60405162461bcd60e51b815260206004820181815286516024840152865187939192839260440191908501908083836000831561226657818101518382015260200161224e565b3b151590565b604080516101208101909152806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b604080516080810190915280600081526020016000815260200160008152602001600081525090565b6040805160808101909152806000815260200160008152602001600081526020016000151581525090565b6040518060200160405280600081525090565b6040805160e081019091528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152509056fe596f752061726520747279696e6720746f20706179206261636b206d6f7265207468616e20796f75206f7765596f752061726520747279696e6720746f20776974686472617720746f6f206d756368536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77526570617920626f72726f77206e6577206163636f756e742062616c616e63652063616c63756c6174696f6e206661696c6564526570617920626f72726f77206e657720746f74616c2062616c616e63652063616c63756c6174696f6e206661696c65645361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212207caea02b22e8269dd552a513187de2894fc8c3b2ee333f1831417352f7ef021564736f6c63430006060033

Verified Source Code Partial Match

Compiler: v0.6.6+commit.6c089d02 EVM: istanbul Optimization: Yes (200 runs)
WarpVaultSC.sol 2311 lines
// File: node_modules\@openzeppelin\contracts\GSN\Context.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

// File: @openzeppelin\contracts\access\Ownable.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

// File: node_modules\@openzeppelin\contracts\token\ERC20\IERC20.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

// File: node_modules\@openzeppelin\contracts\math\SafeMath.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

// File: node_modules\@openzeppelin\contracts\utils\Address.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies in extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return _functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// File: @openzeppelin\contracts\token\ERC20\ERC20.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;





/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;
    using Address for address;

    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name, string memory symbol) public {
        _name = name;
        _symbol = symbol;
        _decimals = 18;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20};
     *
     * Requirements:
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

// File: @openzeppelin\contracts\token\ERC20\SafeERC20.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;




/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

// File: contracts\compound\CarefulMath.sol

pragma solidity ^0.6.0;

/**
  * @title Careful Math
  * @author Compound

/blob/master/contracts/math/SafeMath.sol
  */
contract CarefulMath {

    /**
     * @dev Possible error codes that we can return
     */
    enum MathError {
        NO_ERROR,
        DIVISION_BY_ZERO,
        INTEGER_OVERFLOW,
        INTEGER_UNDERFLOW
    }

    /**
    * @dev Multiplies two numbers, returns an error on overflow.
    */
    function mulUInt(uint a, uint b) internal pure returns (MathError, uint) {
        if (a == 0) {
            return (MathError.NO_ERROR, 0);
        }

        uint c = a * b;

        if (c / a != b) {
            return (MathError.INTEGER_OVERFLOW, 0);
        } else {
            return (MathError.NO_ERROR, c);
        }
    }

    /**
    * @dev Integer division of two numbers, truncating the quotient.
    */
    function divUInt(uint a, uint b) internal pure returns (MathError, uint) {
        if (b == 0) {
            return (MathError.DIVISION_BY_ZERO, 0);
        }

        return (MathError.NO_ERROR, a / b);
    }

    /**
    * @dev Subtracts two numbers, returns an error on overflow (i.e. if subtrahend is greater than minuend).
    */
    function subUInt(uint a, uint b) internal pure returns (MathError, uint) {
        if (b <= a) {
            return (MathError.NO_ERROR, a - b);
        } else {
            return (MathError.INTEGER_UNDERFLOW, 0);
        }
    }

    /**
    * @dev Adds two numbers, returns an error on overflow.
    */
    function addUInt(uint a, uint b) internal pure returns (MathError, uint) {
        uint c = a + b;

        if (c >= a) {
            return (MathError.NO_ERROR, c);
        } else {
            return (MathError.INTEGER_OVERFLOW, 0);
        }
    }

    /**
    * @dev add a and b and then subtract c
    */
    function addThenSubUInt(uint a, uint b, uint c) internal pure returns (MathError, uint) {
        (MathError err0, uint sum) = addUInt(a, b);

        if (err0 != MathError.NO_ERROR) {
            return (err0, 0);
        }

        return subUInt(sum, c);
    }
}

// File: contracts\compound\Exponential.sol

pragma solidity ^0.6.0;


/**
 * @title Exponential module for storing fixed-precision decimals
 * @author Compound
 * @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
 *         Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
 *         `Exp({mantissa: 5100000000000000000})`.
 */
contract Exponential is CarefulMath {
    uint constant expScale = 1e18;
    uint constant doubleScale = 1e36;
    uint constant halfExpScale = expScale/2;
    uint constant mantissaOne = expScale;

    struct Exp {
        uint mantissa;
    }

    struct Double {
        uint mantissa;
    }

    /**
     * @dev Creates an exponential from numerator and denominator values.
     *      Note: Returns an error if (`num` * 10e18) > MAX_INT,
     *            or if `denom` is zero.
     */
    function getExp(uint num, uint denom) pure internal returns (MathError, Exp memory) {
        (MathError err0, uint scaledNumerator) = mulUInt(num, expScale);
        if (err0 != MathError.NO_ERROR) {
            return (err0, Exp({mantissa: 0}));
        }

        (MathError err1, uint rational) = divUInt(scaledNumerator, denom);
        if (err1 != MathError.NO_ERROR) {
            return (err1, Exp({mantissa: 0}));
        }

        return (MathError.NO_ERROR, Exp({mantissa: rational}));
    }

    /**
     * @dev Adds two exponentials, returning a new exponential.
     */
    function addExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {
        (MathError error, uint result) = addUInt(a.mantissa, b.mantissa);

        return (error, Exp({mantissa: result}));
    }

    /**
     * @dev Subtracts two exponentials, returning a new exponential.
     */
    function subExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {
        (MathError error, uint result) = subUInt(a.mantissa, b.mantissa);

        return (error, Exp({mantissa: result}));
    }

    /**
     * @dev Multiply an Exp by a scalar, returning a new Exp.
     */
    function mulScalar(Exp memory a, uint scalar) pure internal returns (MathError, Exp memory) {
        (MathError err0, uint scaledMantissa) = mulUInt(a.mantissa, scalar);
        if (err0 != MathError.NO_ERROR) {
            return (err0, Exp({mantissa: 0}));
        }

        return (MathError.NO_ERROR, Exp({mantissa: scaledMantissa}));
    }

    /**
     * @dev Multiply an Exp by a scalar, then truncate to return an unsigned integer.
     */
    function mulScalarTruncate(Exp memory a, uint scalar) pure internal returns (MathError, uint) {
        (MathError err, Exp memory product) = mulScalar(a, scalar);
        if (err != MathError.NO_ERROR) {
            return (err, 0);
        }

        return (MathError.NO_ERROR, truncate(product));
    }

    /**
     * @dev Multiply an Exp by a scalar, truncate, then add an to an unsigned integer, returning an unsigned integer.
     */
    function mulScalarTruncateAddUInt(Exp memory a, uint scalar, uint addend) pure internal returns (MathError, uint) {
        (MathError err, Exp memory product) = mulScalar(a, scalar);
        if (err != MathError.NO_ERROR) {
            return (err, 0);
        }

        return addUInt(truncate(product), addend);
    }

    /**
     * @dev Divide an Exp by a scalar, returning a new Exp.
     */
    function divScalar(Exp memory a, uint scalar) pure internal returns (MathError, Exp memory) {
        (MathError err0, uint descaledMantissa) = divUInt(a.mantissa, scalar);
        if (err0 != MathError.NO_ERROR) {
            return (err0, Exp({mantissa: 0}));
        }

        return (MathError.NO_ERROR, Exp({mantissa: descaledMantissa}));
    }

    /**
     * @dev Divide a scalar by an Exp, returning a new Exp.
     */
    function divScalarByExp(uint scalar, Exp memory divisor) pure internal returns (MathError, Exp memory) {
        /*
          We are doing this as:
          getExp(mulUInt(expScale, scalar), divisor.mantissa)

          How it works:
          Exp = a / b;
          Scalar = s;
          `s / (a / b)` = `b * s / a` and since for an Exp `a = mantissa, b = expScale`
        */
        (MathError err0, uint numerator) = mulUInt(expScale, scalar);
        if (err0 != MathError.NO_ERROR) {
            return (err0, Exp({mantissa: 0}));
        }
        return getExp(numerator, divisor.mantissa);
    }

    /**
     * @dev Divide a scalar by an Exp, then truncate to return an unsigned integer.
     */
    function divScalarByExpTruncate(uint scalar, Exp memory divisor) pure internal returns (MathError, uint) {
        (MathError err, Exp memory fraction) = divScalarByExp(scalar, divisor);
        if (err != MathError.NO_ERROR) {
            return (err, 0);
        }

        return (MathError.NO_ERROR, truncate(fraction));
    }

    /**
     * @dev Multiplies two exponentials, returning a new exponential.
     */
    function mulExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {

        (MathError err0, uint doubleScaledProduct) = mulUInt(a.mantissa, b.mantissa);
        if (err0 != MathError.NO_ERROR) {
            return (err0, Exp({mantissa: 0}));
        }

        // We add half the scale before dividing so that we get rounding instead of truncation.
        //  See "Listing 6" and text above it at https://accu.org/index.php/journals/1717
        // Without this change, a result like 6.6...e-19 will be truncated to 0 instead of being rounded to 1e-18.
        (MathError err1, uint doubleScaledProductWithHalfScale) = addUInt(halfExpScale, doubleScaledProduct);
        if (err1 != MathError.NO_ERROR) {
            return (err1, Exp({mantissa: 0}));
        }

        (MathError err2, uint product) = divUInt(doubleScaledProductWithHalfScale, expScale);
        // The only error `div` can return is MathError.DIVISION_BY_ZERO but we control `expScale` and it is not zero.
        assert(err2 == MathError.NO_ERROR);

        return (MathError.NO_ERROR, Exp({mantissa: product}));
    }

    /**
     * @dev Multiplies two exponentials given their mantissas, returning a new exponential.
     */
    function mulExp(uint a, uint b) pure internal returns (MathError, Exp memory) {
        return mulExp(Exp({mantissa: a}), Exp({mantissa: b}));
    }

    /**
     * @dev Multiplies three exponentials, returning a new exponential.
     */
    function mulExp3(Exp memory a, Exp memory b, Exp memory c) pure internal returns (MathError, Exp memory) {
        (MathError err, Exp memory ab) = mulExp(a, b);
        if (err != MathError.NO_ERROR) {
            return (err, ab);
        }
        return mulExp(ab, c);
    }

    /**
     * @dev Divides two exponentials, returning a new exponential.
     *     (a/scale) / (b/scale) = (a/scale) * (scale/b) = a/b,
     *  which we can scale as an Exp by calling getExp(a.mantissa, b.mantissa)
     */
    function divExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {
        return getExp(a.mantissa, b.mantissa);
    }

    /**
     * @dev Truncates the given exp to a whole number value.
     *      For example, truncate(Exp{mantissa: 15 * expScale}) = 15
     */
    function truncate(Exp memory exp) pure internal returns (uint) {
        // Note: We are not using careful math here as we're performing a division that cannot fail
        return exp.mantissa / expScale;
    }

    /**
     * @dev Checks if first Exp is less than second Exp.
     */
    function lessThanExp(Exp memory left, Exp memory right) pure internal returns (bool) {
        return left.mantissa < right.mantissa;
    }

    /**
     * @dev Checks if left Exp <= right Exp.
     */
    function lessThanOrEqualExp(Exp memory left, Exp memory right) pure internal returns (bool) {
        return left.mantissa <= right.mantissa;
    }

    /**
     * @dev Checks if left Exp > right Exp.
     */
    function greaterThanExp(Exp memory left, Exp memory right) pure internal returns (bool) {
        return left.mantissa > right.mantissa;
    }

    /**
     * @dev returns true if Exp is exactly zero
     */
    function isZeroExp(Exp memory value) pure internal returns (bool) {
        return value.mantissa == 0;
    }

    function safe224(uint n, string memory errorMessage) pure internal returns (uint224) {
        require(n < 2**224, errorMessage);
        return uint224(n);
    }

    function safe32(uint n, string memory errorMessage) pure internal returns (uint32) {
        require(n < 2**32, errorMessage);
        return uint32(n);
    }

    function add_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        return Exp({mantissa: add_(a.mantissa, b.mantissa)});
    }

    function add_(Double memory a, Double memory b) pure internal returns (Double memory) {
        return Double({mantissa: add_(a.mantissa, b.mantissa)});
    }

    function add_(uint a, uint b) pure internal returns (uint) {
        return add_(a, b, "addition overflow");
    }

    function add_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {
        uint c = a + b;
        require(c >= a, errorMessage);
        return c;
    }

    function sub_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        return Exp({mantissa: sub_(a.mantissa, b.mantissa)});
    }

    function sub_(Double memory a, Double memory b) pure internal returns (Double memory) {
        return Double({mantissa: sub_(a.mantissa, b.mantissa)});
    }

    function sub_(uint a, uint b) pure internal returns (uint) {
        return sub_(a, b, "subtraction underflow");
    }

    function sub_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {
        require(b <= a, errorMessage);
        return a - b;
    }

    function mul_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        return Exp({mantissa: mul_(a.mantissa, b.mantissa) / expScale});
    }

    function mul_(Exp memory a, uint b) pure internal returns (Exp memory) {
        return Exp({mantissa: mul_(a.mantissa, b)});
    }

    function mul_(uint a, Exp memory b) pure internal returns (uint) {
        return mul_(a, b.mantissa) / expScale;
    }

    function mul_(Double memory a, Double memory b) pure internal returns (Double memory) {
        return Double({mantissa: mul_(a.mantissa, b.mantissa) / doubleScale});
    }

    function mul_(Double memory a, uint b) pure internal returns (Double memory) {
        return Double({mantissa: mul_(a.mantissa, b)});
    }

    function mul_(uint a, Double memory b) pure internal returns (uint) {
        return mul_(a, b.mantissa) / doubleScale;
    }

    function mul_(uint a, uint b) pure internal returns (uint) {
        return mul_(a, b, "multiplication overflow");
    }

    function mul_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {
        if (a == 0 || b == 0) {
            return 0;
        }
        uint c = a * b;
        require(c / a == b, errorMessage);
        return c;
    }

    function div_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        return Exp({mantissa: div_(mul_(a.mantissa, expScale), b.mantissa)});
    }

    function div_(Exp memory a, uint b) pure internal returns (Exp memory) {
        return Exp({mantissa: div_(a.mantissa, b)});
    }

    function div_(uint a, Exp memory b) pure internal returns (uint) {
        return div_(mul_(a, expScale), b.mantissa);
    }

    function div_(Double memory a, Double memory b) pure internal returns (Double memory) {
        return Double({mantissa: div_(mul_(a.mantissa, doubleScale), b.mantissa)});
    }

    function div_(Double memory a, uint b) pure internal returns (Double memory) {
        return Double({mantissa: div_(a.mantissa, b)});
    }

    function div_(uint a, Double memory b) pure internal returns (uint) {
        return div_(mul_(a, doubleScale), b.mantissa);
    }

    function div_(uint a, uint b) pure internal returns (uint) {
        return div_(a, b, "divide by zero");
    }

    function div_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {
        require(b > 0, errorMessage);
        return a / b;
    }

    function fraction(uint a, uint b) pure internal returns (Double memory) {
        return Double({mantissa: div_(mul_(a, doubleScale), b)});
    }
}

// File: contracts\compound\InterestRateModel.sol

pragma solidity ^0.6.0;

/**
  * @title Compound's InterestRateModel Interface
  * @author Compound
  */
abstract contract InterestRateModel {
    /// @notice Indicator that this is an InterestRateModel contract (for inspection)
    bool public constant isInterestRateModel = true;

    /**
      * @notice Calculates the current borrow interest rate per block
      * @param cash The total amount of cash the market has
      * @param borrows The total amount of borrows the market has outstanding
      * @param reserves The total amount of reserves the market has
      * @return The borrow rate per block (as a percentage, and scaled by 1e18)
      */
    function getBorrowRate(uint cash, uint borrows, uint reserves) external virtual view returns (uint);

    /**
      * @notice Calculates the current supply interest rate per block
      * @param cash The total amount of cash the market has
      * @param borrows The total amount of borrows the market has outstanding
      * @param reserves The total amount of reserves the market has
      * @param reserveFactorMantissa The current reserve factor the market has
      * @return The supply rate per block (as a percentage, and scaled by 1e18)
      */
    function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) external virtual view returns (uint);

}

// File: contracts\interfaces\UniswapLPOracleFactoryI.sol

pragma solidity ^0.6.0;

////////////////////////////////////////////////////////////////////////////////////////////
/// @title UniswapLPOracleFactoryI
/// @author Christopher Dixon
////////////////////////////////////////////////////////////////////////////////////////////
/**
The UniswapLPOracleFactoryI contract an abstract contract the Warp platform uses to interface
    With the UniswapOracleFactory to retrieve token prices.
**/

abstract contract UniswapLPOracleFactoryI {
    function createNewOracles(
        address _tokenA,
        address _tokenB,
        address _lpToken
    ) public virtual;

    function OneUSDC() public virtual view returns (uint256);

    function getUnderlyingPrice(address _MMI) public virtual returns (uint256);

    function viewUnderlyingPrice(address _MMI)
        public
        virtual
        view
        returns (uint256);

    function getPriceOfToken(address _token, uint256 _amount)
        public
        virtual
        returns (uint256);
...

// [truncated — 83682 bytes total]

Read Contract

InterestRate 0x48dc0b6e → address
accountBorrows 0xd40e8f4a → uint256, uint256
accrualBlockNumber 0x6c540baf → uint256
borrowBalancePrior 0x7746efab → uint256
borrowIndex 0xaa5af0fd → uint256
borrowRatePerBlock 0xf8f9da28 → uint256
calculateFee 0x99a5d747 → uint256
divisor 0x1f2dc5ef → uint256
exchangeRatePrior 0xcd5c6f57 → uint256
getCash 0x3b1d21a2 → uint256
getCashPrior 0xdd5a612c → uint256
getSCAddress 0x591cec86 → address
getSCDecimals 0x94d35990 → uint8
historicalReward 0x36820e4b → uint256
percent 0x70ba1113 → uint256
principalBalance 0xe68fc0ee → uint256
reserveFactorMantissa 0x173b9904 → uint256
stablecoin 0xe9cbd822 → address
supplyRatePerBlock 0xae9d70b0 → uint256
timeWizard 0xcb7b4206 → uint256
totalBorrows 0x47bd3718 → uint256
totalReserves 0x8f840ddd → uint256
viewAccountBalance 0x8f7bf4fd → uint256
viewHistoricalReward 0xe6136ab6 → uint256
wStableCoin 0x4ee8acc0 → address
warpControl 0xbbb7d489 → address
warpTeam 0x5cf57389 → address

Write Contract 14 functions

These functions modify contract state and require a wallet transaction to execute.

_borrow 0x232d46d2
uint256 _borrowAmount
address _borrower
_repayLiquidatedLoan 0xab292f9b
address _borrower
address _liquidator
uint256 _amount
accrueInterest 0xa6afed95
No parameters
borrowBalanceCurrent 0x17bfdfbc
address account
returns: uint256
exchangeRateCurrent 0xbd6d894d
No parameters
returns: uint256
lendToWarpVault 0x57d32b7a
uint256 _amount
redeem 0xdb006a75
uint256 _amount
repayBorrow 0x0e752702
uint256 _repayAmount
setNewInterestModel 0xb1be82f1
address _newModel
totalBorrowsCurrent 0x73acee98
No parameters
returns: uint256
updateReserve 0x3662454d
uint256 _newReserveMantissa
updateTeam 0xb23f3594
address _team
updateWarpControl 0x4cf3e784
address _warpControl
withdrawFees 0x5e318e07
uint256 _amount

Top Interactions

AddressTxnsSentReceived
0x477Bf09D...D901 1 1

Recent Transactions

CSV
|
Hash Method Block Age From/To Value Txn Fee Type
0xd9b3194d...e43eda redeem 24,292,840 IN 0x477Bf09D...D901 0 ETH 0.000251270081 ETH EIP-1559