Address Contract Partially Verified
Address
0xF7dAf52958690F1dc89CD377d638e9Fc94E76ACF
Balance
0 ETH
Nonce
1
Code Size
12866 bytes
Creator
0x794addD0...9C76 at tx 0xdc05f39f...ede1f7
Indexed Transactions
0
Contract Bytecode
12866 bytes
0x608060405234801561000f575f5ffd5b50600436106101db575f3560e01c80637d28a2f211610109578063b3ab15fb1161009e578063e3a68ac31161006e578063e3a68ac314610489578063f2fde38b146104b0578063f6ed2017146104c3578063f7fd2891146104d6575f5ffd5b8063b3ab15fb14610418578063d2c744ae1461042b578063d53f99401461043e578063dd62ed3e14610451575f5ffd5b80639498bd71116100d95780639498bd71146103d757806395d89b41146103ea578063a41ba44f146103f2578063a9059cbb14610405575f5ffd5b80637d28a2f21461037957806383602b031461038c5780638da5cb5b1461039f57806391dbf142146103b0575f5ffd5b806323b872dd1161017f57806360fbd0c51161014f57806360fbd0c51461032d5780636112fe2e1461033657806370a0823114610349578063715018a614610371575f5ffd5b806323b872dd146102c457806327f9387f146102d75780632e1a7d4d146102fe578063313ce56714610313575f5ffd5b806313e7c9d8116101ba57806313e7c9d81461024057806318160ddd146102805780631aed6440146102925780631e83409a146102b1575f5ffd5b80626258dc146101df57806306fdde0314610208578063095ea7b31461021d575b5f5ffd5b6101f26101ed3660046128c4565b6104e9565b6040516101ff91906128df565b60405180910390f35b610210610629565b6040516101ff919061294f565b61023061022b366004612961565b610754565b60405190151581526020016101ff565b61026861024e3660046128c4565b60096020525f90815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016101ff565b6002545b6040519081526020016101ff565b6102846102a03660046128c4565b60086020525f908152604090205481565b6102846102bf3660046128c4565b61076d565b6102306102d236600461298b565b6107c5565b6102687f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa81565b61031161030c3660046129c9565b61087f565b005b61031b610957565b60405160ff90911681526020016101ff565b61028460065481565b6103116103443660046129c9565b6109dd565b6102846103573660046128c4565b6001600160a01b03165f9081526020819052604090205490565b6103116109f0565b6103116103873660046129e0565b610a03565b61031161039a3660046129e0565b610acc565b6005546001600160a01b0316610268565b6102687f000000000000000000000000d533a949740bb3306d119cc777fa900ba034cd5281565b6103116103e53660046129c9565b610c8d565b610210610d52565b6101f26104003660046128c4565b610e31565b610230610413366004612961565b610efd565b6103116104263660046128c4565b610f51565b61031161043936600461298b565b610fa7565b6101f261044c366004612a0e565b6111c7565b61028461045f366004612a8f565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b6102687f000000000000000000000000bbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb81565b6103116104be3660046128c4565b61124f565b6102846104d13660046128c4565b61128e565b6102846104e4366004612a8f565b6112ae565b60605f7f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa6001600160a01b031663c4f59f9b6040518163ffffffff1660e01b81526004015f60405180830381865afa158015610547573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261056e9190810190612b49565b6001600160a01b0384165f9081526007602052604090208151919250906001600160401b038111156105a2576105a2612abb565b6040519080825280602002602001820160405280156105cb578160200160208202803683370190505b5092505f5b8251811015610621576105fc828483815181106105ef576105ef612be7565b60200260200101516112ff565b84828151811061060e5761060e612be7565b60209081029190910101526001016105d0565b505050919050565b60065460609061064c57604051632fc3d42f60e11b815260040160405180910390fd5b600a7f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa6001600160a01b03166338d52e0f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106aa573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106ce9190612bfb565b6001600160a01b03166306fdde036040518163ffffffff1660e01b81526004015f60405180830381865afa158015610708573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261072f9190810190612c16565b604051602001610740929190612cbf565b604051602081830303815290604052905090565b5f33610761818585611434565b60019150505b92915050565b5f610776611441565b6001600160a01b038216610788573391505b610791826114ae565b6107ad576040516282b42960e81b815260040160405180910390fd5b6107b6826115be565b90506107c0611962565b919050565b5f336001600160a01b037f000000000000000000000000bbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb161461080f576040516308b8bf8960e11b815260040160405180910390fd5b7f000000000000000000000000bbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb6001600160a01b0316836001600160a01b03160361086a5760ff5f5c1661086a5760405163c71e1ce760e01b815260040160405180910390fd5b61087584848461198c565b90505b9392505050565b610887611441565b5f81116108a757604051631f2a200560e01b815260040160405180910390fd5b6108b0336119af565b335f9081526007602052604081208054909183918391906108d2908490612d7a565b909155506108e290503383611a44565b6109166001600160a01b037f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa163384611a78565b60405182815233907f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d59060200160405180910390a250610954611962565b50565b5f7f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109b4573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109d89190612d8d565b905090565b6109e73382611ad7565b6109548161087f565b6109f8611bbd565b610a015f611bea565b565b610a0b611441565b600654610a2b57604051632fc3d42f60e11b815260040160405180910390fd5b5f8211610a4b57604051631f2a200560e01b815260040160405180910390fd5b6001600160a01b038116610a5c5750335b610a65816114ae565b610a81576040516282b42960e81b815260040160405180910390fd5b610ab66001600160a01b037f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa16333085611c3b565b610ac08183611c7a565b610ac8611962565b5050565b610ad4611441565b600654610af457604051632fc3d42f60e11b815260040160405180910390fd5b5f8211610b1457604051631f2a200560e01b815260040160405180910390fd5b6001600160a01b038116610b255750335b610b2e816114ae565b610b4a576040516282b42960e81b815260040160405180910390fd5b610be13330847f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa6001600160a01b03166338d52e0f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bac573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bd09190612bfb565b6001600160a01b0316929190611c3b565b604051630b8b4a6160e21b815260048101839052306024820181905260448201525f907f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa6001600160a01b031690632e2d2984906064016020604051808303815f875af1158015610c54573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c789190612dad565b9050610c848282611c7a565b50610ac8611962565b610c95611bbd565b610c9e81611cff565b604051632c3c915760e01b81526004810182905230906001600160a01b037f000000000000000000000000bbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb1690632c3c91579060240160a060405180830381865afa158015610d03573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d279190612dc4565b602001516001600160a01b03161461095457604051639db8d5b160e01b815260040160405180910390fd5b600654606090610d7557604051632fc3d42f60e11b815260040160405180910390fd5b600b7f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa6001600160a01b03166338d52e0f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dd3573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610df79190612bfb565b6001600160a01b03166395d89b416040518163ffffffff1660e01b81526004015f60405180830381865afa158015610708573d5f5f3e3d5ffd5b6060610e3b611441565b6001600160a01b038216610e4d573391505b610e56826114ae565b610e72576040516282b42960e81b815260040160405180910390fd5b6107b67f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa6001600160a01b031663c4f59f9b6040518163ffffffff1660e01b81526004015f60405180830381865afa158015610ed0573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610ef79190810190612b49565b83611d81565b5f336001600160a01b037f000000000000000000000000bbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb1614610f47576040516308b8bf8960e11b815260040160405180910390fd5b6108788383611f83565b335f8181526009602052604080822080546001600160a01b0319166001600160a01b03861690811790915590519092917ffd489696792cc4c5d5b226c46f008e459c8ec9b746c49191d74bb92c19fd186791a350565b610faf611441565b6001600160a01b03831615801590610fcf57506001600160a01b03821615155b610fec5760405163d92e233d60e01b815260040160405180910390fd5b5f811161100c57604051631f2a200560e01b815260040160405180910390fd5b6001600160a01b0383165f9081526007602052604090205461102f908290612e54565b6001600160a01b0384165f90815260208190526040902054101561106657604051638591487360e01b815260040160405180910390fd5b6001600160a01b0382165f908152600760205260409020548181101561109f57604051638591487360e01b815260040160405180910390fd5b5f6110a984611f90565b6001600160a01b0385165f908152602081905260409020546110cb9190612e54565b9050826110d88284612d7a565b10156110f757604051638591487360e01b815260040160405180910390fd5b611100846119af565b6001600160a01b0384165f9081526007602052604081208054859290611127908490612d7a565b9091555061113790508584611a44565b61116b6001600160a01b037f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa168685611a78565b836001600160a01b0316856001600160a01b03167fde0aa27286f5cb3a4ed853dc4823ead62d63e92cdf13de09d6aece56970721a4856040516111b091815260200190565b60405180910390a350506111c2611962565b505050565b60606111d1611441565b6001600160a01b0384166111e3573393505b6111ec846114ae565b611208576040516282b42960e81b815260040160405180910390fd5b6112458383808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250889250611d81915050565b9050610878611962565b611257611bbd565b6001600160a01b03811661128557604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61095481611bea565b6001600160a01b0381165f90815260076020526040812061087881612045565b5f6001600160a01b0382166112d65760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0383165f9081526007602052604090206112f781846112ff565b949350505050565b5f5f61130a60025490565b9050805f0361131c575f915050610767565b6001600160a01b038381165f8181526008602052604080822054905163211dc32d60e01b815230600482015260248101939093529290917f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa9091169063211dc32d90604401602060405180830381865afa15801561139c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113c09190612e7d565b6001600160801b0316905080156113f1576113e481670de0b6b3a764000085612073565b6113ee9083612e54565b91505b6001600160a01b0385165f90815260018701602052604090205486546114299061141b8386612d7a565b670de0b6b3a7640000612073565b979650505050505050565b6111c28383836001612129565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005c1561148157604051633ee5aeb560e01b815260040160405180910390fd5b610a0160017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005b906121fb565b5f6001600160a01b03821633036114c757506001919050565b6001600160a01b038281165f90815260096020526040902054339116036114f057506001919050565b6040516217798b60e61b81526001600160a01b037f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa8116600483015233602483015263027f859160e41b60448301527f0000000000000000000000002d8bce1fae00a959354acd9ebf9174337a64d4fb16906305de62c090606401602060405180830381865afa158015611586573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115aa9190612e96565b156115b757506001919050565b505f919050565b5f6001600160a01b0382166115e65760405163d92e233d60e01b815260040160405180910390fd5b60405163ad74b77560e01b81526001600160a01b037f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa811660048301523060248301525f917f00000000000000000000000093b4b9bd266ffa8af68e39edfa8cfe2a62011ce09091169063ad74b77590604401606060405180830381865afa158015611674573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116989190612eb5565b90505f6116a3612202565b90505f6116af60025490565b90505f6116f5828560200151856116c69190612d7a565b7f0000000000000000000000000000000000000000033b2e3c9fd0803ce80000006001600160801b0316612073565b84604001516117049190612e54565b9050801561181f576040805160018082528183019092525f91602080830190803683370190505090507f00000000000000000000000022804b0f6be741a9fa1bbaecdd6c8d4116e96944815f8151811061176057611760612be7565b6001600160a01b0392831660209182029290920101527f00000000000000000000000093b4b9bd266ffa8af68e39edfa8cfe2a62011ce01663ef933df0825f6040519080825280602002602001820160405280156117d257816020015b60608152602001906001900390816117bd5790505b506040518363ffffffff1660e01b81526004016117f0929190612f3a565b5f604051808303815f87803b158015611807575f5ffd5b505af1158015611819573d5f5f3e3d5ffd5b50505050505b6001600160a01b0386165f90815260076020526040902061183f81612045565b95508515611958575f808052600182016020526040908190208590555163a9059cbb60e01b81526001600160a01b038881166004830152602482018890527f000000000000000000000000d533a949740bb3306d119cc777fa900ba034cd52169063a9059cbb906044016020604051808303815f875af11580156118c5573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118e99190612e96565b50866001600160a01b03167f000000000000000000000000d533a949740bb3306d119cc777fa900ba034cd526001600160a01b03167ff7a40077ff7a04c7e61f6f26fb13774259ddf1b6bce9ecf26a8276cdd39926838860405161194f91815260200190565b60405180910390a35b5050505050919050565b610a015f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f006114a8565b5f336119998582856122b4565b6119a485858561232a565b506001949350505050565b6119b8816115be565b50610ac87f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa6001600160a01b031663c4f59f9b6040518163ffffffff1660e01b81526004015f60405180830381865afa158015611a17573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611a3e9190810190612b49565b82611d81565b6001600160a01b038216611a6d57604051634b637e8f60e11b81525f600482015260240161127c565b610ac8825f83612383565b6040516001600160a01b038381166024830152604482018390526111c291859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506124a9565b600654604051632c3c915760e01b815260048101919091527f000000000000000000000000bbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb6001600160a01b031690638720316d908290632c3c91579060240160a060405180830381865afa158015611b46573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b6a9190612dc4565b8385866040518563ffffffff1660e01b8152600401611b8c9493929190612fee565b5f604051808303815f87803b158015611ba3575f5ffd5b505af1158015611bb5573d5f5f3e3d5ffd5b505050505050565b6005546001600160a01b03163314610a015760405163118cdaa760e01b815233600482015260240161127c565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6040516001600160a01b038481166024830152838116604483015260648201839052611c749186918216906323b872dd90608401611aa5565b50505050565b611c848282612515565b611c8f5f3083612383565b60015f805c60ff19168217905d50611ca782826126a5565b5f60ff19815c16815d506006546040805183815260208101929092526001600160a01b0384169133917f1055e7df6c05c7671de02b516b795815b736cd021b7c38291b6e68d91da91a2c910160405180910390a35050565b611d07611bbd565b60065415611d28576040516306ddda6b60e01b815260040160405180910390fd5b80611d4657604051639db8d5b160e01b815260040160405180910390fd5b60068190556040518181527f5f1660a6d2d09b7816925ee3bd223865d8b0d3f599d445e115586ec278fe31669060200160405180910390a150565b60605f835111611da4576040516333910aef60e11b815260040160405180910390fd5b6001600160a01b038216611dcb5760405163d92e233d60e01b815260040160405180910390fd5b611dd483612758565b82516001600160401b03811115611ded57611ded612abb565b604051908082528060200260200182016040528015611e16578160200160208202803683370190505b506001600160a01b0383165f9081526007602052604081209192505b8451811015611f7b575f858281518110611e4e57611e4e612be7565b602002602001015190505f611e6384836112ff565b90508015611f71576001600160a01b0382165f90815260086020908152604080832054600188019092529091205584518190869085908110611ea757611ea7612be7565b602090810291909101015260405163a9059cbb60e01b81526001600160a01b0387811660048301526024820183905283169063a9059cbb906044016020604051808303815f875af1158015611efe573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f229190612e96565b50856001600160a01b0316826001600160a01b03167ff7a40077ff7a04c7e61f6f26fb13774259ddf1b6bce9ecf26a8276cdd399268383604051611f6891815260200190565b60405180910390a35b5050600101611e32565b505092915050565b5f3361076181858561232a565b6006546040516349e2903160e11b81525f916001600160a01b037f000000000000000000000000bbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb16916393c5206291611ff39186906004019182526001600160a01b0316602082015260400190565b606060405180830381865afa15801561200e573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120329190613022565b604001516001600160801b031692915050565b5f5f61204f612202565b5f8080526001850160205260409020548454919250906112f7906116c68385612d7a565b5f838302815f1985870982811083820303915050805f036120a75783828161209d5761209d613069565b0492505050610878565b8084116120be576120be600385150260111861289f565b5f848688095f868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b6001600160a01b0384166121525760405163e602df0560e01b81525f600482015260240161127c565b6001600160a01b03831661217b57604051634a1406b160e11b81525f600482015260240161127c565b6001600160a01b038085165f9081526001602090815260408083209387168352929052208290558015611c7457826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516121ed91815260200190565b60405180910390a350505050565b80825d5050565b604051632988bb9f60e21b81526001600160a01b037f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa811660048301525f917f00000000000000000000000093b4b9bd266ffa8af68e39edfa8cfe2a62011ce09091169063a622ee7c9060240160e060405180830381865afa15801561228a573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122ae919061307d565b51919050565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f19811015611c74578181101561231c57604051637dc7a0d960e11b81526001600160a01b0384166004820152602481018290526044810183905260640161127c565b611c7484848484035f612129565b6001600160a01b03831661235357604051634b637e8f60e11b81525f600482015260240161127c565b6001600160a01b03821661237c5760405163ec442f0560e01b81525f600482015260240161127c565b6111c28383835b6001600160a01b0383166123ad578060025f8282546123a29190612e54565b9091555061241d9050565b6001600160a01b0383165f90815260208190526040902054818110156123ff5760405163391434e360e21b81526001600160a01b0385166004820152602481018290526044810183905260640161127c565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b03821661243957600280548290039055612457565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161249c91815260200190565b60405180910390a3505050565b5f5f60205f8451602086015f885af1806124c8576040513d5f823e3d81fd5b50505f513d915081156124df5780600114156124ec565b6001600160a01b0384163b155b15611c7457604051635274afe760e01b81526001600160a01b038516600482015260240161127c565b6001600160a01b0382165f90815260076020526040902080541580159061253f5761253f846119af565b82825f015f8282546125519190612e54565b90915550819050611c7457612564612202565b826001015f5f6001600160a01b03166001600160a01b031681526020019081526020015f20819055505f7f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa6001600160a01b031663c4f59f9b6040518163ffffffff1660e01b81526004015f60405180830381865afa1580156125e9573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526126109190810190612b49565b905061261b81612758565b5f5b8151811015611bb55760085f83838151811061263b5761263b612be7565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f2054846001015f84848151811061267a5761267a612be7565b6020908102919091018101516001600160a01b031682528101919091526040015f205560010161261d565b600654604051632c3c915760e01b815260048101919091527f000000000000000000000000bbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb6001600160a01b03169063238d6579908290632c3c91579060240160a060405180830381865afa158015612714573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127389190612dc4565b83856040518463ffffffff1660e01b8152600401611b8c93929190613125565b5f61276260025490565b9050805f0361276f575050565b60405163025181bb60e41b81525f906001600160a01b037f000000000000000000000000ca137e3853eab95541290b372223e7f2ee4c0cfa16906325181bb0906127bf908690309060040161315d565b5f604051808303815f875af11580156127da573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526128019190810190613186565b90505f5b8351811015611c74575f82828151811061282157612821612be7565b602002602001015190505f8111156128965761284681670de0b6b3a764000086612073565b60085f87858151811061285b5761285b612be7565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f8282546128909190612e54565b90915550505b50600101612805565b634e487b715f52806020526024601cfd5b6001600160a01b0381168114610954575f5ffd5b5f602082840312156128d4575f5ffd5b8135610878816128b0565b602080825282518282018190525f918401906040840190835b818110156129165783518352602093840193909201916001016128f8565b509095945050505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f6108786020830184612921565b5f5f60408385031215612972575f5ffd5b823561297d816128b0565b946020939093013593505050565b5f5f5f6060848603121561299d575f5ffd5b83356129a8816128b0565b925060208401356129b8816128b0565b929592945050506040919091013590565b5f602082840312156129d9575f5ffd5b5035919050565b5f5f604083850312156129f1575f5ffd5b823591506020830135612a03816128b0565b809150509250929050565b5f5f5f60408486031215612a20575f5ffd5b8335612a2b816128b0565b925060208401356001600160401b03811115612a45575f5ffd5b8401601f81018613612a55575f5ffd5b80356001600160401b03811115612a6a575f5ffd5b8660208260051b8401011115612a7e575f5ffd5b939660209190910195509293505050565b5f5f60408385031215612aa0575f5ffd5b8235612aab816128b0565b91506020830135612a03816128b0565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b0381118282101715612af157612af1612abb565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612b1f57612b1f612abb565b604052919050565b5f6001600160401b03821115612b3f57612b3f612abb565b5060051b60200190565b5f60208284031215612b59575f5ffd5b81516001600160401b03811115612b6e575f5ffd5b8201601f81018413612b7e575f5ffd5b8051612b91612b8c82612b27565b612af7565b8082825260208201915060208360051b850101925086831115612bb2575f5ffd5b6020840193505b82841015612bdd578351612bcc816128b0565b825260209384019390910190612bb9565b9695505050505050565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215612c0b575f5ffd5b8151610878816128b0565b5f60208284031215612c26575f5ffd5b81516001600160401b03811115612c3b575f5ffd5b8201601f81018413612c4b575f5ffd5b80516001600160401b03811115612c6457612c64612abb565b612c77601f8201601f1916602001612af7565b818152856020838501011115612c8b575f5ffd5b8160208401602083015e5f91810160200191909152949350505050565b5f81518060208401855e5f93019283525090919050565b5f5f84545f8160011c90506001821680612cda57607f821691505b602082108103612cf857634e487b7160e01b5f52602260045260245ffd5b808015612d0c5760018114612d2157612d4f565b60ff1984168752821515830287019450612d4f565b5f898152602090205f5b84811015612d4757815489820152600190910190602001612d2b565b505082870194505b50505050612d5d8185612ca8565b95945050505050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561076757610767612d66565b5f60208284031215612d9d575f5ffd5b815160ff81168114610878575f5ffd5b5f60208284031215612dbd575f5ffd5b5051919050565b5f60a0828403128015612dd5575f5ffd5b5060405160a081016001600160401b0381118282101715612df857612df8612abb565b6040528251612e06816128b0565b81526020830151612e16816128b0565b60208201526040830151612e29816128b0565b60408201526060830151612e3c816128b0565b60608201526080928301519281019290925250919050565b8082018082111561076757610767612d66565b80516001600160801b03811681146107c0575f5ffd5b5f60208284031215612e8d575f5ffd5b61087882612e67565b5f60208284031215612ea6575f5ffd5b81518015158114610878575f5ffd5b5f6060828403128015612ec6575f5ffd5b50612ecf612acf565b612ed883612e67565b8152602083810151908201526040928301519281019290925250919050565b5f8151808452602084019350602083015f5b82811015612f305781516001600160a01b0316865260209586019590910190600101612f09565b5093949350505050565b604081525f612f4c6040830185612ef7565b828103602084015280845180835260208301915060208160051b840101602087015f5b83811015612fa157601f19868403018552612f8b838351612921565b6020958601959093509190910190600101612f6f565b509098975050505050505050565b80516001600160a01b03908116835260208083015182169084015260408083015182169084015260608083015190911690830152608090810151910152565b6101008101612ffd8287612faf565b60a08201949094526001600160a01b0392831660c0820152911660e090910152919050565b5f6060828403128015613033575f5ffd5b5061303c612acf565b8251815261304c60208401612e67565b602082015261305d60408401612e67565b60408201529392505050565b634e487b7160e01b5f52601260045260245ffd5b5f60e082840312801561308e575f5ffd5b5060405160e081016001600160401b03811182821017156130b1576130b1612abb565b604052825181526130c460208401612e67565b60208201526130d560408401612e67565b60408201526130e660608401612e67565b60608201526130f760808401612e67565b608082015261310860a08401612e67565b60a082015261311960c08401612e67565b60c08201529392505050565b61312f8185612faf565b60a08101929092526001600160a01b031660c082015261010060e082018190525f9082015261012001919050565b604081525f61316f6040830185612ef7565b905060018060a01b03831660208301529392505050565b5f60208284031215613196575f5ffd5b81516001600160401b038111156131ab575f5ffd5b8201601f810184136131bb575f5ffd5b80516131c9612b8c82612b27565b8082825260208201915060208360051b8501019250868311156131ea575f5ffd5b6020840193505b82841015612bdd5783518252602093840193909101906131f156fea2646970667358221220554e67be83d02c0691728be52ce75ffdce849a4dfc899069ffe41a00c7a3610a64736f6c634300081c0033
Verified Source Code Partial Match
Compiler: v0.8.28+commit.7893614a
EVM: cancun
Optimization: Yes (200 runs)
MorphoStrategyWrapper.sol 4698 lines
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.28 >=0.8.0 ^0.8.20 ^0.8.24 ^0.8.7;
// node_modules/@openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
/**
* @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 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) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
// node_modules/@stake-dao/strategies/src/interfaces/IAllocator.sol
interface IAllocator {
struct Allocation {
address asset;
address gauge;
address[] targets;
uint256[] amounts;
}
function getDepositAllocation(address asset, address gauge, uint256 amount)
external
view
returns (Allocation memory);
function getWithdrawalAllocation(address asset, address gauge, uint256 amount)
external
view
returns (Allocation memory);
function getRebalancedAllocation(address asset, address gauge, uint256 amount)
external
view
returns (Allocation memory);
function getAllocationTargets(address gauge) external view returns (address[] memory);
}
// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @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);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
// node_modules/@stake-dao/shared/src/interfaces/IMorpho.sol
type Id is bytes32;
struct MarketParams {
address loanToken;
address collateralToken;
address oracle;
address irm;
uint256 lltv;
}
/// @dev Warning: For `feeRecipient`, `supplyShares` does not contain the accrued shares since the last interest
/// accrual.
struct Position {
uint256 supplyShares;
uint128 borrowShares;
uint128 collateral;
}
/// @dev Warning: `totalSupplyAssets` does not contain the accrued interest since the last interest accrual.
/// @dev Warning: `totalBorrowAssets` does not contain the accrued interest since the last interest accrual.
/// @dev Warning: `totalSupplyShares` does not contain the additional shares accrued by `feeRecipient` since the last
/// interest accrual.
struct Market {
uint128 totalSupplyAssets;
uint128 totalSupplyShares;
uint128 totalBorrowAssets;
uint128 totalBorrowShares;
uint128 lastUpdate;
uint128 fee;
}
struct Authorization {
address authorizer;
address authorized;
bool isAuthorized;
uint256 nonce;
uint256 deadline;
}
struct Signature {
uint8 v;
bytes32 r;
bytes32 s;
}
/// @dev This interface is used for factorizing IMorphoStaticTyping and IMorpho.
/// @dev Consider using the IMorpho interface instead of this one.
interface IMorphoBase {
/// @notice The EIP-712 domain separator.
/// @dev Warning: Every EIP-712 signed message based on this domain separator can be reused on chains sharing the
/// same chain id and on forks because the domain separator would be the same.
function DOMAIN_SEPARATOR() external view returns (bytes32);
/// @notice The owner of the contract.
/// @dev It has the power to change the owner.
/// @dev It has the power to set fees on markets and set the fee recipient.
/// @dev It has the power to enable but not disable IRMs and LLTVs.
function owner() external view returns (address);
/// @notice The fee recipient of all markets.
/// @dev The recipient receives the fees of a given market through a supply position on that market.
function feeRecipient() external view returns (address);
/// @notice Whether the `irm` is enabled.
function isIrmEnabled(address irm) external view returns (bool);
/// @notice Whether the `lltv` is enabled.
function isLltvEnabled(uint256 lltv) external view returns (bool);
/// @notice Whether `authorized` is authorized to modify `authorizer`'s position on all markets.
/// @dev Anyone is authorized to modify their own positions, regardless of this variable.
function isAuthorized(address authorizer, address authorized) external view returns (bool);
/// @notice The `authorizer`'s current nonce. Used to prevent replay attacks with EIP-712 signatures.
function nonce(address authorizer) external view returns (uint256);
/// @notice Sets `newOwner` as `owner` of the contract.
/// @dev Warning: No two-step transfer ownership.
/// @dev Warning: The owner can be set to the zero address.
function setOwner(address newOwner) external;
/// @notice Enables `irm` as a possible IRM for market creation.
/// @dev Warning: It is not possible to disable an IRM.
function enableIrm(address irm) external;
/// @notice Enables `lltv` as a possible LLTV for market creation.
/// @dev Warning: It is not possible to disable a LLTV.
function enableLltv(uint256 lltv) external;
/// @notice Sets the `newFee` for the given market `marketParams`.
/// @param newFee The new fee, scaled by WAD.
/// @dev Warning: The recipient can be the zero address.
function setFee(MarketParams memory marketParams, uint256 newFee) external;
/// @notice Sets `newFeeRecipient` as `feeRecipient` of the fee.
/// @dev Warning: If the fee recipient is set to the zero address, fees will accrue there and will be lost.
/// @dev Modifying the fee recipient will allow the new recipient to claim any pending fees not yet accrued. To
/// ensure that the current recipient receives all due fees, accrue interest manually prior to making any changes.
function setFeeRecipient(address newFeeRecipient) external;
/// @notice Creates the market `marketParams`.
/// @dev Here is the list of assumptions on the market's dependencies (tokens, IRM and oracle) that guarantees
/// Morpho behaves as expected:
/// - The token should be ERC-20 compliant, except that it can omit return values on `transfer` and `transferFrom`.
/// - The token balance of Morpho should only decrease on `transfer` and `transferFrom`. In particular, tokens with
/// burn functions are not supported.
/// - The token should not re-enter Morpho on `transfer` nor `transferFrom`.
/// - The token balance of the sender (resp. receiver) should decrease (resp. increase) by exactly the given amount
/// on `transfer` and `transferFrom`. In particular, tokens with fees on transfer are not supported.
/// - The IRM should not re-enter Morpho.
/// - The oracle should return a price with the correct scaling.
/// - The oracle price should not be able to change instantly such that the new price is less than the old price
/// multiplied by LLTV*LIF. In particular, if the loan asset is a vault that can receive donations, the oracle
/// should not price its shares using the AUM.
/// @dev Here is a list of assumptions on the market's dependencies which, if broken, could break Morpho's liveness
/// properties (funds could get stuck):
/// - The token should not revert on `transfer` and `transferFrom` if balances and approvals are right.
/// - The amount of assets supplied and borrowed should not be too high (max ~1e32), otherwise the number of shares
/// might not fit within 128 bits.
/// - The IRM should not revert on `borrowRate`.
/// - The IRM should not return a very high borrow rate (otherwise the computation of `interest` in
/// `_accrueInterest` can overflow).
/// - The oracle should not revert `price`.
/// - The oracle should not return a very high price (otherwise the computation of `maxBorrow` in `_isHealthy` or of
/// `assetsRepaid` in `liquidate` can overflow).
/// @dev The borrow share price of a market with less than 1e4 assets borrowed can be decreased by manipulations, to
/// the point where `totalBorrowShares` is very large and borrowing overflows.
function createMarket(MarketParams memory marketParams) external;
/// @notice Supplies `assets` or `shares` on behalf of `onBehalf`, optionally calling back the caller's
/// `onMorphoSupply` function with the given `data`.
/// @dev Either `assets` or `shares` should be zero. Most use cases should rely on `assets` as an input so the
/// caller is guaranteed to have `assets` tokens pulled from their balance, but the possibility to mint a specific
/// amount of shares is given for full compatibility and precision.
/// @dev Supplying a large amount can revert for overflow.
/// @dev Supplying an amount of shares may lead to supply more or fewer assets than expected due to slippage.
/// Consider using the `assets` parameter to avoid this.
/// @param marketParams The market to supply assets to.
/// @param assets The amount of assets to supply.
/// @param shares The amount of shares to mint.
/// @param onBehalf The address that will own the increased supply position.
/// @param data Arbitrary data to pass to the `onMorphoSupply` callback. Pass empty data if not needed.
/// @return assetsSupplied The amount of assets supplied.
/// @return sharesSupplied The amount of shares minted.
function supply(
MarketParams memory marketParams,
uint256 assets,
uint256 shares,
address onBehalf,
bytes memory data
) external returns (uint256 assetsSupplied, uint256 sharesSupplied);
/// @notice Withdraws `assets` or `shares` on behalf of `onBehalf` and sends the assets to `receiver`.
/// @dev Either `assets` or `shares` should be zero. To withdraw max, pass the `shares`'s balance of `onBehalf`.
/// @dev `msg.sender` must be authorized to manage `onBehalf`'s positions.
/// @dev Withdrawing an amount corresponding to more shares than supplied will revert for underflow.
/// @dev It is advised to use the `shares` input when withdrawing the full position to avoid reverts due to
/// conversion roundings between shares and assets.
/// @param marketParams The market to withdraw assets from.
/// @param assets The amount of assets to withdraw.
/// @param shares The amount of shares to burn.
/// @param onBehalf The address of the owner of the supply position.
/// @param receiver The address that will receive the withdrawn assets.
/// @return assetsWithdrawn The amount of assets withdrawn.
/// @return sharesWithdrawn The amount of shares burned.
function withdraw(
MarketParams memory marketParams,
uint256 assets,
uint256 shares,
address onBehalf,
address receiver
) external returns (uint256 assetsWithdrawn, uint256 sharesWithdrawn);
/// @notice Borrows `assets` or `shares` on behalf of `onBehalf` and sends the assets to `receiver`.
/// @dev Either `assets` or `shares` should be zero. Most use cases should rely on `assets` as an input so the
/// caller is guaranteed to borrow `assets` of tokens, but the possibility to mint a specific amount of shares is
/// given for full compatibility and precision.
/// @dev `msg.sender` must be authorized to manage `onBehalf`'s positions.
/// @dev Borrowing a large amount can revert for overflow.
/// @dev Borrowing an amount of shares may lead to borrow fewer assets than expected due to slippage.
/// Consider using the `assets` parameter to avoid this.
/// @param marketParams The market to borrow assets from.
/// @param assets The amount of assets to borrow.
/// @param shares The amount of shares to mint.
/// @param onBehalf The address that will own the increased borrow position.
/// @param receiver The address that will receive the borrowed assets.
/// @return assetsBorrowed The amount of assets borrowed.
/// @return sharesBorrowed The amount of shares minted.
function borrow(
MarketParams memory marketParams,
uint256 assets,
uint256 shares,
address onBehalf,
address receiver
) external returns (uint256 assetsBorrowed, uint256 sharesBorrowed);
/// @notice Repays `assets` or `shares` on behalf of `onBehalf`, optionally calling back the caller's
/// `onMorphoRepay` function with the given `data`.
/// @dev Either `assets` or `shares` should be zero. To repay max, pass the `shares`'s balance of `onBehalf`.
/// @dev Repaying an amount corresponding to more shares than borrowed will revert for underflow.
/// @dev It is advised to use the `shares` input when repaying the full position to avoid reverts due to conversion
/// roundings between shares and assets.
/// @dev An attacker can front-run a repay with a small repay making the transaction revert for underflow.
/// @param marketParams The market to repay assets to.
/// @param assets The amount of assets to repay.
/// @param shares The amount of shares to burn.
/// @param onBehalf The address of the owner of the debt position.
/// @param data Arbitrary data to pass to the `onMorphoRepay` callback. Pass empty data if not needed.
/// @return assetsRepaid The amount of assets repaid.
/// @return sharesRepaid The amount of shares burned.
function repay(
MarketParams memory marketParams,
uint256 assets,
uint256 shares,
address onBehalf,
bytes memory data
) external returns (uint256 assetsRepaid, uint256 sharesRepaid);
/// @notice Supplies `assets` of collateral on behalf of `onBehalf`, optionally calling back the caller's
/// `onMorphoSupplyCollateral` function with the given `data`.
/// @dev Interest are not accrued since it's not required and it saves gas.
/// @dev Supplying a large amount can revert for overflow.
/// @param marketParams The market to supply collateral to.
/// @param assets The amount of collateral to supply.
/// @param onBehalf The address that will own the increased collateral position.
/// @param data Arbitrary data to pass to the `onMorphoSupplyCollateral` callback. Pass empty data if not needed.
function supplyCollateral(MarketParams memory marketParams, uint256 assets, address onBehalf, bytes memory data)
external;
/// @notice Withdraws `assets` of collateral on behalf of `onBehalf` and sends the assets to `receiver`.
/// @dev `msg.sender` must be authorized to manage `onBehalf`'s positions.
/// @dev Withdrawing an amount corresponding to more collateral than supplied will revert for underflow.
/// @param marketParams The market to withdraw collateral from.
/// @param assets The amount of collateral to withdraw.
/// @param onBehalf The address of the owner of the collateral position.
/// @param receiver The address that will receive the collateral assets.
function withdrawCollateral(MarketParams memory marketParams, uint256 assets, address onBehalf, address receiver)
external;
/// @notice Liquidates the given `repaidShares` of debt asset or seize the given `seizedAssets` of collateral on the
/// given market `marketParams` of the given `borrower`'s position, optionally calling back the caller's
/// `onMorphoLiquidate` function with the given `data`.
/// @dev Either `seizedAssets` or `repaidShares` should be zero.
/// @dev Seizing more than the collateral balance will underflow and revert without any error message.
/// @dev Repaying more than the borrow balance will underflow and revert without any error message.
/// @dev An attacker can front-run a liquidation with a small repay making the transaction revert for underflow.
/// @param marketParams The market of the position.
/// @param borrower The owner of the position.
/// @param seizedAssets The amount of collateral to seize.
/// @param repaidShares The amount of shares to repay.
/// @param data Arbitrary data to pass to the `onMorphoLiquidate` callback. Pass empty data if not needed.
/// @return The amount of assets seized.
/// @return The amount of assets repaid.
function liquidate(
MarketParams memory marketParams,
address borrower,
uint256 seizedAssets,
uint256 repaidShares,
bytes memory data
) external returns (uint256, uint256);
/// @notice Executes a flash loan.
/// @dev Flash loans have access to the whole balance of the contract (the liquidity and deposited collateral of all
/// markets combined, plus donations).
/// @dev Warning: Not ERC-3156 compliant but compatibility is easily reached:
/// - `flashFee` is zero.
/// - `maxFlashLoan` is the token's balance of this contract.
/// - The receiver of `assets` is the caller.
/// @param token The token to flash loan.
/// @param assets The amount of assets to flash loan.
/// @param data Arbitrary data to pass to the `onMorphoFlashLoan` callback.
function flashLoan(address token, uint256 assets, bytes calldata data) external;
/// @notice Sets the authorization for `authorized` to manage `msg.sender`'s positions.
/// @param authorized The authorized address.
/// @param newIsAuthorized The new authorization status.
function setAuthorization(address authorized, bool newIsAuthorized) external;
/// @notice Sets the authorization for `authorization.authorized` to manage `authorization.authorizer`'s positions.
/// @dev Warning: Reverts if the signature has already been submitted.
/// @dev The signature is malleable, but it has no impact on the security here.
/// @dev The nonce is passed as argument to be able to revert with a different error message.
/// @param authorization The `Authorization` struct.
/// @param signature The signature.
function setAuthorizationWithSig(Authorization calldata authorization, Signature calldata signature) external;
/// @notice Accrues interest for the given market `marketParams`.
function accrueInterest(MarketParams memory marketParams) external;
/// @notice Returns the data stored on the different `slots`.
function extSloads(bytes32[] memory slots) external view returns (bytes32[] memory);
}
/// @dev This interface is inherited by Morpho so that function signatures are checked by the compiler.
/// @dev Consider using the IMorpho interface instead of this one.
interface IMorphoStaticTyping is IMorphoBase {
/// @notice The state of the position of `user` on the market corresponding to `id`.
/// @dev Warning: For `feeRecipient`, `supplyShares` does not contain the accrued shares since the last interest
/// accrual.
function position(Id id, address user)
external
view
returns (uint256 supplyShares, uint128 borrowShares, uint128 collateral);
/// @notice The state of the market corresponding to `id`.
/// @dev Warning: `totalSupplyAssets` does not contain the accrued interest since the last interest accrual.
/// @dev Warning: `totalBorrowAssets` does not contain the accrued interest since the last interest accrual.
/// @dev Warning: `totalSupplyShares` does not contain the accrued shares by `feeRecipient` since the last interest
/// accrual.
function market(Id id)
external
view
returns (
uint128 totalSupplyAssets,
uint128 totalSupplyShares,
uint128 totalBorrowAssets,
uint128 totalBorrowShares,
uint128 lastUpdate,
uint128 fee
);
/// @notice The market params corresponding to `id`.
/// @dev This mapping is not used in Morpho. It is there to enable reducing the cost associated to calldata on layer
/// 2s by creating a wrapper contract with functions that take `id` as input instead of `marketParams`.
function idToMarketParams(Id id)
external
view
returns (address loanToken, address collateralToken, address oracle, address irm, uint256 lltv);
}
/// @title IMorpho
/// @author Morpho Labs
/// @custom:contact [email protected]
/// @dev Use this interface for Morpho to have access to all the functions with the appropriate function signatures.
interface IMorpho is IMorphoBase {
/// @notice The state of the position of `user` on the market corresponding to `id`.
/// @dev Warning: For `feeRecipient`, `p.supplyShares` does not contain the accrued shares since the last interest
/// accrual.
function position(Id id, address user) external view returns (Position memory p);
/// @notice The state of the market corresponding to `id`.
/// @dev Warning: `m.totalSupplyAssets` does not contain the accrued interest since the last interest accrual.
/// @dev Warning: `m.totalBorrowAssets` does not contain the accrued interest since the last interest accrual.
/// @dev Warning: `m.totalSupplyShares` does not contain the accrued shares by `feeRecipient` since the last
/// interest accrual.
function market(Id id) external view returns (Market memory m);
/// @notice The market params corresponding to `id`.
/// @dev This mapping is not used in Morpho. It is there to enable reducing the cost associated to calldata on layer
/// 2s by creating a wrapper contract with functions that take `id` as input instead of `marketParams`.
function idToMarketParams(Id id) external view returns (MarketParams memory);
}
/// @title MarketParamsLib
/// @author Morpho Labs
/// @custom:contact [email protected]
/// @notice Library to convert a market to its id.
library MarketParamsLib {
/// @notice The length of the data used to compute the id of a market.
/// @dev The length is 5 * 32 because `MarketParams` has 5 variables of 32 bytes each.
uint256 internal constant MARKET_PARAMS_BYTES_LENGTH = 5 * 32;
/// @notice Returns the id of the market `marketParams`.
function id(MarketParams memory marketParams) internal pure returns (Id marketParamsId) {
assembly ("memory-safe") {
marketParamsId := keccak256(marketParams, MARKET_PARAMS_BYTES_LENGTH)
}
}
}
// node_modules/@stake-dao/strategies/src/interfaces/IProtocolController.sol
interface IProtocolController {
function vault(address) external view returns (address);
function asset(address) external view returns (address);
function rewardReceiver(address) external view returns (address);
function allowed(address, address, bytes4 selector) external view returns (bool);
function permissionSetters(address) external view returns (bool);
function isRegistrar(address) external view returns (bool);
function locker(bytes4 protocolId) external view returns (address);
function gateway(bytes4 protocolId) external view returns (address);
function strategy(bytes4 protocolId) external view returns (address);
function allocator(bytes4 protocolId) external view returns (address);
function accountant(bytes4 protocolId) external view returns (address);
function feeReceiver(bytes4 protocolId) external view returns (address);
function factory(bytes4 protocolId) external view returns (address);
function isPaused(bytes4) external view returns (bool);
function isShutdown(address) external view returns (bool);
function registerVault(address _gauge, address _vault, address _asset, address _rewardReceiver, bytes4 _protocolId)
external;
function setValidAllocationTarget(address _gauge, address _target) external;
function removeValidAllocationTarget(address _gauge, address _target) external;
function isValidAllocationTarget(address _gauge, address _target) external view returns (bool);
function pause(bytes4 protocolId) external;
function unpause(bytes4 protocolId) external;
function shutdown(address _gauge) external;
function unshutdown(address _gauge) external;
function setPermissionSetter(address _setter, bool _allowed) external;
function setPermission(address _contract, address _caller, bytes4 _selector, bool _allowed) external;
}
// node_modules/@openzeppelin/contracts/utils/Panic.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)
/**
* @dev Helper library for emitting standardized panic codes.
*
* ```solidity
* contract Example {
* using Panic for uint256;
*
* // Use any of the declared internal constants
* function foo() { Panic.GENERIC.panic(); }
*
* // Alternatively
* function foo() { Panic.panic(Panic.GENERIC); }
* }
* ```
*
* Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].
*
* _Available since v5.1._
*/
// slither-disable-next-line unused-state
library Panic {
/// @dev generic / unspecified error
uint256 internal constant GENERIC = 0x00;
/// @dev used by the assert() builtin
uint256 internal constant ASSERT = 0x01;
/// @dev arithmetic underflow or overflow
uint256 internal constant UNDER_OVERFLOW = 0x11;
/// @dev division or modulo by zero
uint256 internal constant DIVISION_BY_ZERO = 0x12;
/// @dev enum conversion error
uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;
/// @dev invalid encoding in storage
uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;
/// @dev empty array pop
uint256 internal constant EMPTY_ARRAY_POP = 0x31;
/// @dev array out of bounds access
uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;
/// @dev resource error (too large allocation or too large array)
uint256 internal constant RESOURCE_ERROR = 0x41;
/// @dev calling invalid internal function
uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;
/// @dev Reverts with a panic code. Recommended to use with
/// the internal constants with predefined codes.
function panic(uint256 code) internal pure {
assembly ("memory-safe") {
mstore(0x00, 0x4e487b71)
mstore(0x20, code)
revert(0x1c, 0x24)
}
}
}
// node_modules/@openzeppelin/contracts/utils/math/SafeCast.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.
/**
* @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow
* checks.
*
* Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such 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 SafeCast {
/**
* @dev Value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);
/**
* @dev An int value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedIntToUint(int256 value);
/**
* @dev Value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);
/**
* @dev An uint value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedUintToInt(uint256 value);
/**
* @dev Returns the downcasted uint248 from uint256, reverting on
* overflow (when the input is greater than largest uint248).
*
* Counterpart to Solidity's `uint248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toUint248(uint256 value) internal pure returns (uint248) {
if (value > type(uint248).max) {
revert SafeCastOverflowedUintDowncast(248, value);
}
return uint248(value);
}
/**
* @dev Returns the downcasted uint240 from uint256, reverting on
* overflow (when the input is greater than largest uint240).
*
* Counterpart to Solidity's `uint240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toUint240(uint256 value) internal pure returns (uint240) {
if (value > type(uint240).max) {
revert SafeCastOverflowedUintDowncast(240, value);
}
return uint240(value);
}
/**
* @dev Returns the downcasted uint232 from uint256, reverting on
* overflow (when the input is greater than largest uint232).
*
* Counterpart to Solidity's `uint232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toUint232(uint256 value) internal pure returns (uint232) {
if (value > type(uint232).max) {
revert SafeCastOverflowedUintDowncast(232, value);
}
return uint232(value);
}
/**
* @dev Returns the downcasted uint224 from uint256, reverting on
* overflow (when the input is greater than largest uint224).
*
* Counterpart to Solidity's `uint224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toUint224(uint256 value) internal pure returns (uint224) {
if (value > type(uint224).max) {
revert SafeCastOverflowedUintDowncast(224, value);
}
return uint224(value);
}
/**
* @dev Returns the downcasted uint216 from uint256, reverting on
* overflow (when the input is greater than largest uint216).
*
* Counterpart to Solidity's `uint216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toUint216(uint256 value) internal pure returns (uint216) {
if (value > type(uint216).max) {
revert SafeCastOverflowedUintDowncast(216, value);
}
return uint216(value);
}
/**
* @dev Returns the downcasted uint208 from uint256, reverting on
* overflow (when the input is greater than largest uint208).
*
* Counterpart to Solidity's `uint208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toUint208(uint256 value) internal pure returns (uint208) {
if (value > type(uint208).max) {
revert SafeCastOverflowedUintDowncast(208, value);
}
return uint208(value);
}
/**
* @dev Returns the downcasted uint200 from uint256, reverting on
* overflow (when the input is greater than largest uint200).
*
* Counterpart to Solidity's `uint200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toUint200(uint256 value) internal pure returns (uint200) {
if (value > type(uint200).max) {
revert SafeCastOverflowedUintDowncast(200, value);
}
return uint200(value);
}
/**
* @dev Returns the downcasted uint192 from uint256, reverting on
* overflow (when the input is greater than largest uint192).
*
* Counterpart to Solidity's `uint192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toUint192(uint256 value) internal pure returns (uint192) {
if (value > type(uint192).max) {
revert SafeCastOverflowedUintDowncast(192, value);
}
return uint192(value);
}
/**
* @dev Returns the downcasted uint184 from uint256, reverting on
* overflow (when the input is greater than largest uint184).
*
* Counterpart to Solidity's `uint184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toUint184(uint256 value) internal pure returns (uint184) {
if (value > type(uint184).max) {
revert SafeCastOverflowedUintDowncast(184, value);
}
return uint184(value);
}
/**
* @dev Returns the downcasted uint176 from uint256, reverting on
* overflow (when the input is greater than largest uint176).
*
* Counterpart to Solidity's `uint176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toUint176(uint256 value) internal pure returns (uint176) {
if (value > type(uint176).max) {
revert SafeCastOverflowedUintDowncast(176, value);
}
return uint176(value);
}
/**
* @dev Returns the downcasted uint168 from uint256, reverting on
* overflow (when the input is greater than largest uint168).
*
* Counterpart to Solidity's `uint168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toUint168(uint256 value) internal pure returns (uint168) {
if (value > type(uint168).max) {
revert SafeCastOverflowedUintDowncast(168, value);
}
return uint168(value);
}
/**
* @dev Returns the downcasted uint160 from uint256, reverting on
* overflow (when the input is greater than largest uint160).
*
* Counterpart to Solidity's `uint160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toUint160(uint256 value) internal pure returns (uint160) {
if (value > type(uint160).max) {
revert SafeCastOverflowedUintDowncast(160, value);
}
return uint160(value);
}
/**
* @dev Returns the downcasted uint152 from uint256, reverting on
* overflow (when the input is greater than largest uint152).
*
* Counterpart to Solidity's `uint152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toUint152(uint256 value) internal pure returns (uint152) {
if (value > type(uint152).max) {
revert SafeCastOverflowedUintDowncast(152, value);
}
return uint152(value);
}
/**
* @dev Returns the downcasted uint144 from uint256, reverting on
* overflow (when the input is greater than largest uint144).
*
* Counterpart to Solidity's `uint144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toUint144(uint256 value) internal pure returns (uint144) {
if (value > type(uint144).max) {
revert SafeCastOverflowedUintDowncast(144, value);
}
return uint144(value);
}
/**
* @dev Returns the downcasted uint136 from uint256, reverting on
* overflow (when the input is greater than largest uint136).
*
* Counterpart to Solidity's `uint136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toUint136(uint256 value) internal pure returns (uint136) {
if (value > type(uint136).max) {
revert SafeCastOverflowedUintDowncast(136, value);
}
return uint136(value);
}
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toUint128(uint256 value) internal pure returns (uint128) {
if (value > type(uint128).max) {
revert SafeCastOverflowedUintDowncast(128, value);
}
return uint128(value);
}
/**
* @dev Returns the downcasted uint120 from uint256, reverting on
* overflow (when the input is greater than largest uint120).
*
* Counterpart to Solidity's `uint120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toUint120(uint256 value) internal pure returns (uint120) {
if (value > type(uint120).max) {
revert SafeCastOverflowedUintDowncast(120, value);
}
return uint120(value);
}
/**
* @dev Returns the downcasted uint112 from uint256, reverting on
* overflow (when the input is greater than largest uint112).
*
* Counterpart to Solidity's `uint112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toUint112(uint256 value) internal pure returns (uint112) {
if (value > type(uint112).max) {
revert SafeCastOverflowedUintDowncast(112, value);
}
return uint112(value);
}
/**
* @dev Returns the downcasted uint104 from uint256, reverting on
* overflow (when the input is greater than largest uint104).
*
* Counterpart to Solidity's `uint104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toUint104(uint256 value) internal pure returns (uint104) {
if (value > type(uint104).max) {
revert SafeCastOverflowedUintDowncast(104, value);
}
return uint104(value);
}
/**
* @dev Returns the downcasted uint96 from uint256, reverting on
* overflow (when the input is greater than largest uint96).
*
* Counterpart to Solidity's `uint96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toUint96(uint256 value) internal pure returns (uint96) {
if (value > type(uint96).max) {
revert SafeCastOverflowedUintDowncast(96, value);
}
return uint96(value);
}
/**
* @dev Returns the downcasted uint88 from uint256, reverting on
* overflow (when the input is greater than largest uint88).
*
* Counterpart to Solidity's `uint88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toUint88(uint256 value) internal pure returns (uint88) {
if (value > type(uint88).max) {
revert SafeCastOverflowedUintDowncast(88, value);
}
return uint88(value);
}
/**
* @dev Returns the downcasted uint80 from uint256, reverting on
* overflow (when the input is greater than largest uint80).
*
* Counterpart to Solidity's `uint80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toUint80(uint256 value) internal pure returns (uint80) {
if (value > type(uint80).max) {
revert SafeCastOverflowedUintDowncast(80, value);
}
return uint80(value);
}
/**
* @dev Returns the downcasted uint72 from uint256, reverting on
* overflow (when the input is greater than largest uint72).
*
* Counterpart to Solidity's `uint72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toUint72(uint256 value) internal pure returns (uint72) {
if (value > type(uint72).max) {
revert SafeCastOverflowedUintDowncast(72, value);
}
return uint72(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toUint64(uint256 value) internal pure returns (uint64) {
if (value > type(uint64).max) {
revert SafeCastOverflowedUintDowncast(64, value);
}
return uint64(value);
}
/**
* @dev Returns the downcasted uint56 from uint256, reverting on
* overflow (when the input is greater than largest uint56).
*
* Counterpart to Solidity's `uint56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toUint56(uint256 value) internal pure returns (uint56) {
if (value > type(uint56).max) {
revert SafeCastOverflowedUintDowncast(56, value);
}
return uint56(value);
}
/**
* @dev Returns the downcasted uint48 from uint256, reverting on
* overflow (when the input is greater than largest uint48).
*
* Counterpart to Solidity's `uint48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toUint48(uint256 value) internal pure returns (uint48) {
if (value > type(uint48).max) {
revert SafeCastOverflowedUintDowncast(48, value);
}
return uint48(value);
}
/**
* @dev Returns the downcasted uint40 from uint256, reverting on
* overflow (when the input is greater than largest uint40).
*
* Counterpart to Solidity's `uint40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toUint40(uint256 value) internal pure returns (uint40) {
if (value > type(uint40).max) {
revert SafeCastOverflowedUintDowncast(40, value);
}
return uint40(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toUint32(uint256 value) internal pure returns (uint32) {
if (value > type(uint32).max) {
revert SafeCastOverflowedUintDowncast(32, value);
}
return uint32(value);
}
/**
* @dev Returns the downcasted uint24 from uint256, reverting on
* overflow (when the input is greater than largest uint24).
*
* Counterpart to Solidity's `uint24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toUint24(uint256 value) internal pure returns (uint24) {
if (value > type(uint24).max) {
revert SafeCastOverflowedUintDowncast(24, value);
}
return uint24(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toUint16(uint256 value) internal pure returns (uint16) {
if (value > type(uint16).max) {
revert SafeCastOverflowedUintDowncast(16, value);
}
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toUint8(uint256 value) internal pure returns (uint8) {
if (value > type(uint8).max) {
revert SafeCastOverflowedUintDowncast(8, value);
}
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*/
function toUint256(int256 value) internal pure returns (uint256) {
if (value < 0) {
revert SafeCastOverflowedIntToUint(value);
}
return uint256(value);
}
/**
* @dev Returns the downcasted int248 from int256, reverting on
* overflow (when the input is less than smallest int248 or
* greater than largest int248).
*
* Counterpart to Solidity's `int248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toInt248(int256 value) internal pure returns (int248 downcasted) {
downcasted = int248(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(248, value);
}
}
/**
* @dev Returns the downcasted int240 from int256, reverting on
* overflow (when the input is less than smallest int240 or
* greater than largest int240).
*
* Counterpart to Solidity's `int240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toInt240(int256 value) internal pure returns (int240 downcasted) {
downcasted = int240(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(240, value);
}
}
/**
* @dev Returns the downcasted int232 from int256, reverting on
* overflow (when the input is less than smallest int232 or
* greater than largest int232).
*
* Counterpart to Solidity's `int232` operator.
*
* Requirements:
*
* - input must fit into 23...
// [truncated — 195218 bytes total]
Read Contract
LENDING_PROTOCOL 0xe3a68ac3 → address
MAIN_REWARD_TOKEN 0x91dbf142 → address
REWARD_VAULT 0x27f9387f → address
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
extraRewardPerToken 0x1aed6440 → uint256
getPendingExtraRewards 0x006258dc → uint256[]
getPendingExtraRewards 0xf7fd2891 → uint256
getPendingRewards 0xf6ed2017 → uint256
lendingMarketId 0x60fbd0c5 → bytes32
name 0x06fdde03 → string
operators 0x13e7c9d8 → address
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 15 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 value
returns: bool
claim 0x1e83409a
address receiver
returns: uint256
claimExtraRewards 0xa41ba44f
address receiver
returns: uint256[]
claimExtraRewards 0xd53f9940
address receiver
address[] tokens
returns: uint256[]
claimLiquidation 0xd2c744ae
address liquidator
address victim
uint256 liquidatedAmount
depositAssets 0x83602b03
uint256 amount
address receiver
depositShares 0x7d28a2f2
uint256 amount
address receiver
initialize 0x9498bd71
bytes32 marketId
renounceOwnership 0x715018a6
No parameters
setOperator 0xb3ab15fb
address operator
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x2e1a7d4d
uint256 amount
withdrawCollateral 0x6112fe2e
uint256 amount
Recent Transactions
No transactions found for this address