Address Contract Partially Verified
Address
0x28E5da548183F3B15be9f4AdBCba50fc96d7f3e5
Balance
0 ETH
Nonce
1
Code Size
21149 bytes
Creator
0xc573100a...A67F at tx 0x98618154...429efa
Indexed Transactions
0
Contract Bytecode
21149 bytes
0x608060405234801561000f575f80fd5b506004361061046f575f3560e01c80638ed832711161024d578063cc0e3f2c11610140578063e2eb36b9116100bf578063f2fde38b11610084578063f2fde38b14610a10578063f3cbf47c14610a23578063fa20e0fe14610a36578063fe575a8714610a3f578063ff3c63c014610a61575f80fd5b8063e2eb36b9146109d9578063e6228680146109ec578063e976d431146109f5578063e9f2838e146109fe578063ef8b30f714610894575f80fd5b8063d5abeb0111610105578063d5abeb011461092b578063d905777e146106e5578063d961b58c14610933578063dc68a93a1461093c578063dd62ed3e146109a1575f80fd5b8063cc0e3f2c146108d7578063cc4cd1d3146108ea578063ce96cb77146108fd578063d2c35ce814610910578063d3a8d71814610923575f80fd5b8063b3d7f6b9116101cc578063be1f921411610191578063be1f92141461086c578063c63d75b61461087f578063c6e6f59214610894578063c8796572146108a7578063ca55a557146108af575f80fd5b8063b3d7f6b914610811578063b460af9414610824578063ba08765214610824578063baaa19fb14610837578063bb2707091461084a575f80fd5b8063a08d3aae11610212578063a08d3aae146107bb578063a9059cbb146107ce578063ac7475ed146107e1578063b3c65015146107f4578063b3c9e83d146107fe575f80fd5b80638ed832711461077b57806394bf804d1461078457806395d89b41146107975780639cb43f811461079f5780639cf160f6146107a8575f80fd5b80634cdad506116103655780636e553f65116102e4578063790739a2116102a9578063790739a2146107285780637d41c86e1461073b5780638bc7e8c41461074e5780638c0190e3146107575780638da5cb5b1461076a575f80fd5b80636e553f65146106d257806370a08231146106e557806372332aa61461070d57806373f351c814610716578063785c31271461071f575f80fd5b806359afd7621161032a57806359afd7621461066457806360da3e83146106775780636382d9ad1461068457806368e7d11d146106975780636c46407b146106aa575f80fd5b80634cdad50614610610578063520cd03614610623578063537df3b61461062b578063569b8e2c1461063e578063570ca73514610651575f80fd5b806323b872dd116103f157806336b7ea15116103b657806336b7ea15146105a357806338d52e0f146105ac578063402d267d146105d757806342fe0980146105ea57806344337ea1146105fd575f80fd5b806323b872dd1461054257806324e86d671461055557806328f856801461055e578063313ce56714610571578063339eeb6814610590575f80fd5b80630a28a477116104375780630a28a477146104ee5780631080f02d1461050157806318160ddd14610514578063184466c91461051c5780631f4f519c1461052f575f80fd5b806301e1d11414610473578063030d624a1461048e57806306fdde03146104a357806307a2d13a146104b8578063095ea7b3146104cb575b5f80fd5b61047b610aba565b6040519081526020015b60405180910390f35b6104a161049c366004614aef565b610ac8565b005b6104ab610c2b565b6040516104859190614b34565b61047b6104c6366004614aef565b610cb7565b6104de6104d9366004614b5a565b610cc8565b6040519015158152602001610485565b61047b6104fc366004614aef565b610ce9565b6104a161050f366004614b84565b610cf5565b60055461047b565b6104a161052a366004614aef565b610e44565b6104a161053d366004614aef565b610ef2565b6104de610550366004614bf5565b610f9f565b61047b600f5481565b61047b61056c366004614aef565b61101b565b60025461057e9060ff1681565b60405160ff9091168152602001610485565b6104a161059e366004614c33565b61108e565b61047b601d5481565b600a546201000090046001600160a01b03165b6040516001600160a01b039091168152602001610485565b61047b6105e5366004614c33565b611139565b6104a16105f8366004614ced565b611162565b6104a161060b366004614c33565b6112e8565b61047b61061e366004614aef565b6113a4565b61047b6113ae565b6104a1610639366004614c33565b6113d8565b6104a161064c366004614aef565b611462565b6022546105bf906001600160a01b031681565b6104a1610672366004614d7b565b6114d2565b600a546104de9060ff1681565b6104a1610692366004614da9565b61163c565b6104a16106a5366004614b84565b6117c7565b6106bd6106b8366004614dd5565b6118f2565b60408051928352602083019190915201610485565b61047b6106e0366004614d7b565b61194d565b61047b6106f3366004614c33565b6001600160a01b03165f9081526007602052604090205490565b61047b60205481565b61047b601c5481565b61047b601b5481565b6104a1610736366004614aef565b611ab7565b6106bd610749366004614dfe565b611b65565b61047b600e5481565b6104a1610765366004614e4a565b611c86565b601a546001600160a01b03166105bf565b61047b600c5481565b61047b610792366004614d7b565b611cfb565b6104ab611e68565b61047b60105481565b600b546105bf906001600160a01b031681565b6104a16107c9366004614e76565b611e75565b6104de6107dc366004614b5a565b61208f565b6104a16107ef366004614c33565b6120ae565b5f5460ff1661057e565b6106bd61080c366004614f0a565b612192565b61047b61081f366004614aef565b612268565b61047b610832366004614dfe565b612274565b6104a1610845366004614dd5565b61228e565b6104de610858366004614c33565b60236020525f908152604090205460ff1681565b61047b61087a366004614f0a565b612309565b61047b61088d366004614c33565b5060065490565b61047b6108a2366004614aef565b612362565b6104a161236d565b6108b76123db565b604080519485526020850193909352918301526060820152608001610485565b6012546105bf906001600160a01b031681565b6104a16108f8366004614d7b565b61241f565b61047b61090b366004614c33565b612592565b6104a161091e366004614c33565b6125b4565b6104a161268b565b60065461047b565b61047b60115481565b61047b61094a366004614f0a565b604080516020808201969096528082019490945260608085019390935280518085039093018352608090930183528151918401919091205f908152601684528281206001600160a01b039092168152925290205490565b61047b6109af366004614da9565b6001600160a01b039182165f90815260086020908152604080832093909416825291909152205490565b6021546105bf906001600160a01b031681565b61047b601f5481565b61047b600d5481565b600a546104de90610100900460ff1681565b6104a1610a1e366004614c33565b61276c565b6104a1610a31366004614f48565b612903565b61047b601e5481565b6104de610a4d366004614c33565b60096020525f908152604090205460ff1681565b6106bd610a6f366004614dd5565b604080516020808201959095528082019390935260608084019290925280518084039092018252608090920182528051908301205f9081526013909252902080546001909101549091565b5f610ac3612f1e565b905090565b610ad0612f9b565b600a546201000090046001600160a01b0316610aff57604051636b271baf60e11b815260040160405180910390fd5b601a546001600160a01b03163314610b2a57604051630b2db9b760e31b815260040160405180910390fd5b601c8190556040518181527f2147e2bc8c39e67f74b1a9e08896ea1485442096765942206af1f4bc8bcde9179060200160405180910390a15f81604051602401610b7691815260200190565b60408051601f19818403018152918152602080830180516001600160e01b0316630186b12560e11b1790529051610bae929101614b34565b60408051808303601f1901815290829052805160209091012060215463af6f8c1b60e01b8352600483018290529092506001600160a01b03169063af6f8c1b906024015f604051808303815f87803b158015610c08575f80fd5b505af1158015610c1a573d5f803e3d5ffd5b5050505050610c2860018055565b50565b60048054610c3890614f77565b80601f0160208091040260200160405190810160405280929190818152602001828054610c6490614f77565b8015610caf5780601f10610c8657610100808354040283529160200191610caf565b820191905f5260205f20905b815481529060010190602001808311610c9257829003601f168201915b505050505081565b5f610cc2825f612fc5565b92915050565b5f610cd1612f9b565b610cdc338484612fec565b5060015b610cc260018055565b5f610cc2826001613086565b610cfd612f9b565b600a546201000090046001600160a01b0316610d2c57604051636b271baf60e11b815260040160405180910390fd5b601a546001600160a01b03163314610d5757604051630b2db9b760e31b815260040160405180910390fd5b5f5b81811015610e1e5760235f848484818110610d7657610d76614faf565b9050602002016020810190610d8b9190614c33565b6001600160a01b0316815260208101919091526040015f205460ff16610dc45760405163e6c4247b60e01b815260040160405180910390fd5b5f60235f858585818110610dda57610dda614faf565b9050602002016020810190610def9190614c33565b6001600160a01b0316815260208101919091526040015f20805460ff1916911515919091179055600101610d59565b508181905060205f828254610e339190614fd7565b9091555050600180555050565b5050565b610e4c612f9b565b600a546201000090046001600160a01b0316610e7b57604051636b271baf60e11b815260040160405180910390fd5b601a546001600160a01b03163314610ea657604051630b2db9b760e31b815260040160405180910390fd5b600f819055604051602481018290525f9060440160408051601f19818403018152918152602080830180516001600160e01b031663184466c960e01b1790529051610bae929101614b34565b610efa612f9b565b6022546001600160a01b03163314610f245760405162572f1f60e91b815260040160405180910390fd5b4261012c601e54610f359190614fea565b10610f535760405163b7d0949760e01b815260040160405180910390fd5b5f610f5d8261101b565b90505f610f686113ae565b905080821115610f8b57604051631373d6db60e01b815260040160405180910390fd5b5050601b81905542601e55610c2860018055565b5f610fa8612f9b565b6001600160a01b0384165f90815260086020908152604080832033845290915290205482811015610fec576040516303814af160e61b815260040160405180910390fd5b610ff78585856130af565b5061100c85336110078685614fd7565b612fec565b505060018080555b9392505050565b5f8082158061102a5750601b54155b1561103657505f610cc2565b601b54831161106a57606483601b5460646110519190614ffd565b61105b9190615028565b6110659190614fd7565b611014565b601b5460649061107a8583614ffd565b6110849190615028565b6110149190614fd7565b611096612f9b565b600a546201000090046001600160a01b03166110c557604051636b271baf60e11b815260040160405180910390fd5b601a546001600160a01b031633146110f057604051630b2db9b760e31b815260040160405180910390fd5b6001600160a01b0381166111175760405163e6c4247b60e01b815260040160405180910390fd5b601280546001600160a01b0319166001600160a01b0383161790556001805550565b5f6005545f148061115057505f61114e612f1e565b115b61115a575f610cc2565b5050600c5490565b5f54610100900460ff161580801561118057505f54600160ff909116105b806111995750303b15801561119957505f5460ff166001145b6112015760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b5f805460ff191660011790558015611222575f805461ff0019166101001790555b6001600160a01b03851661124957604051638b50645160e01b815260040160405180910390fd5b6002805460ff191660ff86161790556003611264848261507f565b506004611271838261507f565b50600a805461ffff1916610101179055601a80546001600160a01b0319166001600160a01b03871617905580156112e1575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6112f0612f9b565b600a546201000090046001600160a01b031661131f57604051636b271baf60e11b815260040160405180910390fd5b601a546001600160a01b0316331461134a57604051630b2db9b760e31b815260040160405180910390fd5b601a546001600160a01b0390811690821603611379576040516339b9e47160e21b815260040160405180910390fd5b6001600160a01b0381165f908152600960205260409020805460ff19166001179055610c2860018055565b5f611014826131f9565b5f62015180601e54426113c19190614fd7565b601f546113ce9190614ffd565b610ac39190615028565b6113e0612f9b565b600a546201000090046001600160a01b031661140f57604051636b271baf60e11b815260040160405180910390fd5b601a546001600160a01b0316331461143a57604051630b2db9b760e31b815260040160405180910390fd5b6001600160a01b0381165f908152600960205260409020805460ff19169055610c2860018055565b61146a612f9b565b600a546201000090046001600160a01b031661149957604051636b271baf60e11b815260040160405180910390fd5b601a546001600160a01b031633146114c457604051630b2db9b760e31b815260040160405180910390fd5b600e819055610c2860018055565b6114da612f9b565b600a546201000090046001600160a01b031661150957604051636b271baf60e11b815260040160405180910390fd5b6022546001600160a01b031633146115335760405162572f1f60e91b815260040160405180910390fd5b6001821015611555576040516360b9116960e11b815260040160405180910390fd5b6001600160a01b0381165f9081526023602052604090205460ff1661158d5760405163014cc88960e21b815260040160405180910390fd5b601b548211156115b05760405163200f4ff760e01b815260040160405180910390fd5b81601b5f8282546115c19190614fd7565b9091555050600a54604051631a4ca37b60e21b8152620100009091046001600160a01b039081166004830152602482018490523060448301528216906369328dec906064015f604051808303815f87803b15801561161d575f80fd5b505af115801561162f573d5f803e3d5ffd5b50505050610e4060018055565b611644612f9b565b600a546201000090046001600160a01b031661167357604051636b271baf60e11b815260040160405180910390fd5b601a546001600160a01b0316331461169e57604051630b2db9b760e31b815260040160405180910390fd5b6001600160a01b0381165f9081526009602052604090205460ff16156116d757604051631f7b776b60e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201525f906001600160a01b038416906370a0823190602401602060405180830381865afa15801561171b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061173f919061513a565b600a549091506001600160a01b036201000090910481169084160361176957611769600180613245565b6117748383836132b2565b604080518281526001600160a01b03858116602083015284168183015290517f853009bb99110572d2d914b6a40e1d763158ebac968d169d09e41bf6c15fc97a9181900360600190a150610e4060018055565b6117cf612f9b565b600a546201000090046001600160a01b03166117fe57604051636b271baf60e11b815260040160405180910390fd5b601a546001600160a01b0316331461182957604051630b2db9b760e31b815260040160405180910390fd5b5f5b818110156118dd575f83838381811061184657611846614faf565b905060200201602081019061185b9190614c33565b6001600160a01b0316036118825760405163e6c4247b60e01b815260040160405180910390fd5b600160235f85858581811061189957611899614faf565b90506020020160208101906118ae9190614c33565b6001600160a01b0316815260208101919091526040015f20805460ff191691151591909117905560010161182b565b508181905060205f828254610e339190614fea565b604080516020808201869052818301859052606080830185905283518084039091018152608090920183528151918101919091205f81815260149092529181205491611942868686858080613315565b915050935093915050565b5f611956612f9b565b600a546201000090046001600160a01b031661198557604051636b271baf60e11b815260040160405180910390fd5b600a5460ff16156119a95760405163deeb694360e01b815260040160405180910390fd5b6001600160a01b03821615806119c757506001600160a01b03821630145b156119e557604051631e4ec46b60e01b815260040160405180910390fd5b335f9081526009602052604090205460ff1680611a1957506001600160a01b0382165f9081526009602052604090205460ff165b15611a3757604051631f7b776b60e01b815260040160405180910390fd5b825f03611a5757604051637edcaddf60e01b815260040160405180910390fd5b611a6082611139565b831115611a8057604051632484557960e01b815260040160405180910390fd5b611a8983612362565b9050805f03611aab576040516334d1b1a560e11b815260040160405180910390fd5b610ce033838584613370565b611abf612f9b565b600a546201000090046001600160a01b0316611aee57604051636b271baf60e11b815260040160405180910390fd5b601a546001600160a01b03163314611b1957604051630b2db9b760e31b815260040160405180910390fd5b601f819055604051602481018290525f9060440160408051601f19818403018152918152602080830180516001600160e01b0316633c839cd160e11b1790529051610bae929101614b34565b5f80611b6f612f9b565b600a546201000090046001600160a01b0316611b9e57604051636b271baf60e11b815260040160405180910390fd5b600a54610100900460ff1615611bc757604051636022a9e760e01b815260040160405180910390fd5b335f9081526009602052604090205460ff1680611bfb57506001600160a01b0384165f9081526009602052604090205460ff165b80611c1d57506001600160a01b0383165f9081526009602052604090205460ff165b15611c3b57604051631f7b776b60e01b815260040160405180910390fd5b5f805f611c4a88878933613500565b600f54909950939750919550935091505f03611c7257429350611c6f8383838a613911565b50505b505050611c7e60018055565b935093915050565b611c8e612f9b565b600a546201000090046001600160a01b0316611cbd57604051636b271baf60e11b815260040160405180910390fd5b601a546001600160a01b03163314611ce857604051630b2db9b760e31b815260040160405180910390fd5b611cf28282613245565b610e4060018055565b5f611d04612f9b565b600a546201000090046001600160a01b0316611d3357604051636b271baf60e11b815260040160405180910390fd5b600a5460ff1615611d575760405163deeb694360e01b815260040160405180910390fd5b6001600160a01b0382161580611d7557506001600160a01b03821630145b15611d9357604051631e4ec46b60e01b815260040160405180910390fd5b335f9081526009602052604090205460ff1680611dc757506001600160a01b0382165f9081526009602052604090205460ff165b15611de557604051631f7b776b60e01b815260040160405180910390fd5b825f03611e05576040516334d1b1a560e11b815260040160405180910390fd5b600654831115611e285760405163fc3fc71f60e01b815260040160405180910390fd5b611e3183612268565b9050611e3c82611139565b811115611e5c57604051632484557960e01b815260040160405180910390fd5b610ce033838386613370565b60038054610c3890614f77565b611e7d612f9b565b600a546201000090046001600160a01b031615611ead576040516346a4055d60e01b815260040160405180910390fd5b601a546001600160a01b03163314611ed857604051630b2db9b760e31b815260040160405180910390fd5b6001600160a01b038316611eff57604051632e947acb60e01b815260040160405180910390fd5b6001600160a01b038116611f265760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b038216611f4d5760405163e6c4247b60e01b815260040160405180910390fd5b845f03611f6d57604051631f3b85d360e01b815260040160405180910390fd5b600a805462010000600160b01b031916620100006001600160a01b03871602179055611f9a898989613c8a565b600b80546001600160a01b038581166001600160a01b031992831617909255600f8c9055600a805461ffff1916905542601d819055601e55602180548584169083168117909155601c899055601f88905560228054858516931692909217909155601a54604051636e998e1760e11b8152921660048301526201518060248301529063dd331c2e906044015f604051808303815f87803b15801561203c575f80fd5b505af115801561204e573d5f803e3d5ffd5b50506040517feeed950c9a7f978b5ee7b6074d3eb49384d6fe1430750621fb637faa5c47046d92505f9150a161208360018055565b50505050505050505050565b5f612098612f9b565b6120a33384846130af565b9050610cc260018055565b6120b6612f9b565b600a546201000090046001600160a01b03166120e557604051636b271baf60e11b815260040160405180910390fd5b601a546001600160a01b0316331461211057604051630b2db9b760e31b815260040160405180910390fd5b6001600160a01b0381166121375760405163e6c4247b60e01b815260040160405180910390fd5b602280546001600160a01b0319166001600160a01b0383169081179091556040519081527fb3b3f5f64ab192e4b5fefde1f51ce9733bbdcf831951543b325aebd49cc27ec4906020015b60405180910390a1610c2860018055565b5f8061219c612f9b565b600a546201000090046001600160a01b03166121cb57604051636b271baf60e11b815260040160405180910390fd5b600a54610100900460ff16156121f457604051636022a9e760e01b815260040160405180910390fd5b335f9081526009602052604090205460ff168061222857506001600160a01b0383165f9081526009602052604090205460ff165b1561224657604051631f7b776b60e01b815260040160405180910390fd5b61225286868686613911565b9150915061225f60018055565b94509492505050565b5f610cc2826001612fc5565b5f604051633af6971f60e11b815260040160405180910390fd5b612296612f9b565b600a546201000090046001600160a01b03166122c557604051636b271baf60e11b815260040160405180910390fd5b601a546001600160a01b031633146122f057604051630b2db9b760e31b815260040160405180910390fd5b6122fb838383613c8a565b61230460018055565b505050565b604080516020808201879052818301869052606080830186905283518084039091018152608090920183528151918101919091205f908152601782528281206001600160a01b038516825290915220545b949350505050565b5f610cc2825f613086565b612375612f9b565b600a546201000090046001600160a01b03166123a457604051636b271baf60e11b815260040160405180910390fd5b601180545f909155600a54600b546123cf916001600160a01b036201000090910481169116836132b2565b506123d960018055565b565b5f805f80612402600f5461012c426123f39190614fea565b6123fd9190614fea565b613cdf565b919550935091506124178484845f8080613315565b905090919293565b612427612f9b565b600a546201000090046001600160a01b031661245657604051636b271baf60e11b815260040160405180910390fd5b6022546001600160a01b031633146124805760405162572f1f60e91b815260040160405180910390fd5b60018210156124a2576040516360b9116960e11b815260040160405180910390fd5b6001600160a01b0381165f9081526023602052604090205460ff166124da5760405163014cc88960e21b815260040160405180910390fd5b81601b5f8282546124eb9190614fea565b9091555050600a5461250d906201000090046001600160a01b03168284613d04565b600a546040516311f9fbc960e21b8152620100009091046001600160a01b039081166004830152602482018490528216906347e7ef24906044015f604051808303815f87803b15801561255e575f80fd5b505af1158015612570573d5f803e3d5ffd5b5050600a54611cf292506201000090046001600160a01b03169050825f613d04565b6001600160a01b0381165f90815260076020526040812054610cc29082612fc5565b6125bc612f9b565b600a546201000090046001600160a01b03166125eb57604051636b271baf60e11b815260040160405180910390fd5b601a546001600160a01b0316331461261657604051630b2db9b760e31b815260040160405180910390fd5b6001600160a01b03811661263d57604051632e947acb60e01b815260040160405180910390fd5b600b80546001600160a01b0319166001600160a01b0383169081179091556040519081527fe5693914d19c789bdee50a362998c0bc8d035a835f9871da5d51152f0582c34f90602001612181565b612693612f9b565b600a546201000090046001600160a01b03166126c257604051636b271baf60e11b815260040160405180910390fd5b5f6126cb612f1e565b90505f6127106301e13380601d54426126e49190614fd7565b601c546126f19086614ffd565b6126fb9190614ffd565b6127059190615028565b61270f9190615028565b905042601d819055508060115f8282546127299190614fea565b90915550506040518181527f2d46e156a9ac545bd5f27832a0e6293d21c92faf9237534c6b18c51e9cca59df9060200160405180910390a150506123d960018055565b612774612f9b565b601a546001600160a01b0316331461279f57604051630b2db9b760e31b815260040160405180910390fd5b6001600160a01b03811615806127bd57506001600160a01b03811630145b156127db576040516349e27cff60e01b815260040160405180910390fd5b6001600160a01b0381165f9081526009602052604090205460ff161561281457604051631f7b776b60e01b815260040160405180910390fd5b601a546001600160a01b031661282982613e17565b6040516001600160a01b03831660248201525f9060440160408051601f19818403018152918152602080830180516001600160e01b031663f2fde38b60e01b1790529051612878929101614b34565b60408051808303601f19018152908290528051602090910120602154631f229a2f60e31b8352600483018290526001600160a01b0385811660248501528681166044850152919350169063f914d178906064015f604051808303815f87803b1580156128e2575f80fd5b505af11580156128f4573d5f803e3d5ffd5b505050505050610c2860018055565b61290b612f9b565b600a546201000090046001600160a01b031661293a57604051636b271baf60e11b815260040160405180910390fd5b600a54610100900460ff161561296357604051636022a9e760e01b815260040160405180910390fd5b805f03612983576040516334e33ddb60e01b815260040160405180910390fd5b335f9081526009602052604090205460ff16156129b357604051631f7b776b60e01b815260040160405180910390fd5b6012546001600160a01b03166129dc57604051631c202a9560e01b815260040160405180910390fd5b6040805160208101869052908101849052606081018390525f9060800160405160208183030381529060405280519060200120905060135f8281526020019081526020015f20600101545f03612a4557604051630683f18b60e41b815260040160405180910390fd5b612a538585855f8080613315565b612a5f61012c42614fea565b1015612a7e5760405163085de62560e01b815260040160405180910390fd5b5f818152601460205260408120548310612aa5575f82815260146020526040902054612aa7565b825b5f838152601460205260408120549192508267ffffffffffffffff811115612ad157612ad1614c4e565b604051908082528060200260200182016040528015612afa578160200160208202803683370190505b5090505f8367ffffffffffffffff811115612b1757612b17614c4e565b604051908082528060200260200182016040528015612b40578160200160208202803683370190505b5090505f80808681875b612b548a8a614fd7565b811115612d4f575f8b8152601460205260409020612b73600183614fd7565b81548110612b8357612b83614faf565b5f918252602090912001546001600160a01b0316915082612ba381615151565b93505081888481518110612bb957612bb9614faf565b6001600160a01b039283166020918202929092018101919091525f8d815260168252604080822093861682529290915220548751889085908110612bff57612bff614faf565b602002602001018181525050868381518110612c1d57612c1d614faf565b602002602001015184612c309190614fea565b5f8c81526017602090815260408083206001600160a01b0387168452909152902054909450612c5f9086614fea565b5f8c81526018602090815260408083206001600160a01b0387168452909152902054909550612c8e9087614fea565b5f8c81526016602090815260408083206001600160a01b0387168085529083528184208490558f84526017835281842081855283528184208490558f84526018835281842090845282528083208390558e83526014909152902080549197509080612cfb57612cfb615166565b5f828152602080822083015f1990810180546001600160a01b03191690559092019092558c82526015815260408083206001600160a01b038616845290915281205580612d4781615151565b915050612b4a565b508360105f828254612d619190614fd7565b925050819055508460115f828254612d799190614fea565b90915550505f8a81526013602052604081206001018054859290612d9e908490614fd7565b90915550505f8a81526013602052604081208054869290612dc0908490614fd7565b9091555050600a546040516370a0823160e01b81523060048201525f916201000090046001600160a01b0316906370a0823190602401602060405180830381865afa158015612e11573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612e35919061513a565b905083811015612e5857604051631e9acf1760e31b815260040160405180910390fd5b612e623086613e68565b612e6d8b8989613f49565b612e778482614fd7565b600a546040516370a0823160e01b8152306004820152620100009091046001600160a01b0316906370a0823190602401602060405180830381865afa158015612ec2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612ee6919061513a565b14612f0457604051630a85404160e11b815260040160405180910390fd5b5050505050505050505050612f1860018055565b50505050565b600a546040516370a0823160e01b81523060048201525f916201000090046001600160a01b0316906370a0823190602401602060405180830381865afa158015612f6a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612f8e919061513a565b601b54610ac39190614fea565b600260015403612fbe576040516306fda65d60e31b815260040160405180910390fd5b6002600155565b5f6005545f14612fe657611065612fda612f1e565b6005548591908561410f565b82611014565b6001600160a01b038216158061300957506001600160a01b038316155b156130265760405162b265b960e61b815260040160405180910390fd5b6001600160a01b038381165f8181526008602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b5f8215806130945750600554155b612fe6576110656005546130a6612f1e565b8591908561410f565b5f6001600160a01b03831615806130cd57506001600160a01b038416155b156130ea5760405162b265b960e61b815260040160405180910390fd5b815f0361310a576040516360b9116960e11b815260040160405180910390fd5b6001600160a01b0384165f90815260076020526040902054821115613142576040516312c58db360e01b815260040160405180910390fd5b6001600160a01b0384165f90815260076020526040902054613165908390614fd7565b6001600160a01b038086165f908152600760205260408082209390935590851681522054613194908390614fea565b6001600160a01b038085165f8181526007602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906131e79086815260200190565b60405180910390a35060019392505050565b5f80613205835f612fc5565b91508190505f80600e54111561323f5761271083600e546132269190614ffd565b6132309190615028565b905061323c8184614fd7565b91505b50915091565b600a805461ffff191683151561ff00191617610100831515810291909117918290556040805160ff8085161515825292909304909116151560208301527f559628b27717ff2f5863f3a218839e17c6bc1b900e9de0dc2b3dc365068841d791015b60405180910390a15050565b6040516001600160a01b03831660248201526044810182905261230490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261416a565b5f81613322603c85614ffd565b61332e610e1087614ffd565b6201518061333d8b8b8b61423b565b6133479190614ffd565b6133519190614fea565b61335b9190614fea565b6133659190614fea565b979650505050505050565b600a546040516370a0823160e01b81523060048201525f916201000090046001600160a01b0316906370a0823190602401602060405180830381865afa1580156133bc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906133e0919061513a565b6133ea9084614fea565b600a5490915061340b906201000090046001600160a01b03168630866143a1565b600a546040516370a0823160e01b815230600482015282916201000090046001600160a01b0316906370a0823190602401602060405180830381865afa158015613457573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061347b919061513a565b1461349957604051630a85404160e11b815260040160405180910390fd5b6134a384836143d9565b836001600160a01b0316856001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d785856040516134f1929190918252602082015260400190565b60405180910390a35050505050565b5f80808080306001600160a01b0389160361352e57604051634971ba2d60e01b815260040160405180910390fd5b885f0361354e576040516334d1b1a560e11b815260040160405180910390fd5b6001600160a01b0388165f9081526007602052604090205489111561358657604051633999656760e01b815260040160405180910390fd5b5f806135918b6131f9565b9150915061359e8a612592565b8211156135be57604051631b6132ab60e31b815260040160405180910390fd5b805f036135de57604051631fbaba3560e01b815260040160405180910390fd5b5f6135e98284614fd7565b9050819350613602600f5461012c426123f39190614fea565b6040805160208082018690528183018590526060808301859052835180840390910181526080909201909252805191012092995090975095506136498888885f8080613315565b98508b6001600160a01b03168a6001600160a01b03161461366f5761366f8c8b8f61449e565b61367a8c308f6130af565b505f818152601360205260408120600101805486929061369b908490614fea565b90915550505f81815260136020526040812080548f92906136bd908490614fea565b925050819055508c60105f8282546136d59190614fea565b90915550505f8181526016602090815260408083206001600160a01b038f16845290915281205490036137a35760145f8281526020019081526020015f208b908060018154018082558091505060019003905f5260205f20015f9091909190916101000a8154816001600160a01b0302191690836001600160a01b0316021790555060145f8281526020019081526020015f208054905060155f8381526020019081526020015f205f8d6001600160a01b03166001600160a01b031681526020019081526020015f20819055505b5f8181526016602090815260408083206001600160a01b038f168452909152812080548592906137d4908490614fea565b90915550505f8181526017602090815260408083206001600160a01b038f168452909152812080548f929061380a908490614fea565b90915550505f8181526018602090815260408083206001600160a01b038f16845290915281208054849290613840908490614fea565b925050819055504260195f8381526020019081526020015f205f8d6001600160a01b03166001600160a01b031681526020019081526020015f20819055507ff60d67b14614c8984f880fd3b3bc7ddc3c2913656340f454bf0c7431152bbda68c8c8f87868d8d8d6040516138fa9897969594939291906001600160a01b03988916815296909716602087015260408601949094526060850192909252608084015260a083015260c082015260e08101919091526101000190565b60405180910390a150505050945094509450945094565b604080516020808201879052818301869052606080830186905283518084039091018152608090920183528151918101919091205f818152601783528381206001600160a01b03861682529092529181205490918291808303613987576040516339c556cd60e11b815260040160405180910390fd5b5f8281526016602090815260408083206001600160a01b0389168085529083528184205486855260188452828520918552925290912054600f54156139ff576139d48a8a8a5f8080613315565b6139e061012c42614fea565b10156139ff5760405163085de62560e01b815260040160405180910390fd5b5f8481526016602090815260408083206001600160a01b038b16808552908352818420849055878452601783528184208185528352818420849055878452601883528184209084528252808320839055868352601390915281208054859290613a69908490614fd7565b90915550613a7990508183614fea565b5f8581526013602052604081206001018054909190613a99908490614fd7565b925050819055508260105f828254613ab19190614fd7565b925050819055508060115f828254613ac99190614fea565b90915550613ad9905084886144fb565b613ae33084613e68565b5f8481526019602090815260408083206001600160a01b038b16808552908352818420548251878152429481019490945291830152606082015260808101919091527fa6f30f7bcb55dd97fe6efdedd57aa5ee608cf66171304f643b791c6f37f495899060a00160405180910390a1600a546040516370a0823160e01b81523060048201525f916201000090046001600160a01b0316906370a0823190602401602060405180830381865afa158015613b9e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613bc2919061513a565b600a54909150613be2906201000090046001600160a01b031689856132b2565b600a546040516370a0823160e01b8152306004820152620100009091046001600160a01b0316906370a0823190602401602060405180830381865afa158015613c2d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613c51919061513a565b613c5b8483614fd7565b1015613c7a57604051630a85404160e11b815260040160405180910390fd5b5091999098509650505050505050565b825f03613caa57604051637fb1277b60e01b815260040160405180910390fd5b815f03613cca5760405163e8498be360e01b815260040160405180910390fd5b613cd3816146e0565b50600c91909155600d55565b5f8080613cf7613cf26201518086615028565b61474b565b9196909550909350915050565b801580613d7c5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015613d56573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613d7a919061513a565b155b613de75760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016111f8565b6040516001600160a01b03831660248201526044810182905261230490849063095ea7b360e01b906064016132de565b601a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b805f03613e88576040516360b9116960e11b815260040160405180910390fd5b6001600160a01b0382165f90815260076020526040902054811115613ec057604051630bba337f60e11b815260040160405180910390fd5b6001600160a01b0382165f9081526007602052604081208054839290613ee7908490614fd7565b925050819055508060055f828254613eff9190614fd7565b90915550506040518181525f906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050565b5f805b83518110156112e15760095f858381518110613f6a57613f6a614faf565b6020908102919091018101516001600160a01b031682528101919091526040015f205460ff16613fb357838181518110613fa657613fa6614faf565b6020026020010151613fc0565b6012546001600160a01b03165b91507fa6f30f7bcb55dd97fe6efdedd57aa5ee608cf66171304f643b791c6f37f49589838281518110613ff557613ff5614faf565b60200260200101514286848151811061401057614010614faf565b602002602001015160195f8a81526020019081526020015f205f89878151811061403c5761403c614faf565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205460095f8a888151811061407957614079614faf565b6020908102919091018101516001600160a01b0390811683528282019390935260409182015f2054825197885290870195909552921684830152606084015260ff90911615156080830152519081900360a00190a1614107600a60029054906101000a90046001600160a01b0316838584815181106140fa576140fa614faf565b60200260200101516132b2565b600101613f4c565b5f8061411c8686866148ba565b905060018360028111156141325761413261517a565b14801561414e57505f848061414957614149615014565b868809115b156141615761415e600182614fea565b90505b95945050505050565b5f6141be826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166149639092919063ffffffff16565b80519091501561230457808060200190518101906141dc919061518e565b6123045760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016111f8565b5f6107b28410156142765760405162461bcd60e51b815260206004820152600560248201526422b93937b960d91b60448201526064016111f8565b8383835f62253d8c60046064600c61428f600e886151a9565b61429991906151cf565b6142a5886113246151fb565b6142af91906151fb565b6142b991906151cf565b6142c4906003615222565b6142ce91906151cf565b600c806142dc600e886151a9565b6142e691906151cf565b6142f190600c615222565b6142fc6002886151a9565b61430691906151a9565b6143129061016f615222565b61431c91906151cf565b6004600c61432b600e896151a9565b61433591906151cf565b614341896112c06151fb565b61434b91906151fb565b614357906105b5615222565b61436191906151cf565b61436d617d4b876151a9565b61437791906151fb565b61438191906151fb565b61438b91906151a9565b61439591906151a9565b98975050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052612f189085906323b872dd60e01b906084016132de565b805f036143f9576040516360b9116960e11b815260040160405180910390fd5b61440281614971565b61441f57604051633569b4df60e01b815260040160405180910390fd5b8060055f8282546144309190614fea565b90915550506001600160a01b0382165f908152600760205260408120805483929061445c908490614fea565b90915550506040518181526001600160a01b038316905f907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001613f3d565b6001600160a01b038084165f908152600860209081526040808320938616835292905220545f198114612f1857818110156144ec576040516313be252b60e01b815260040160405180910390fd5b612f1884846110078585614fd7565b5f8281526015602090815260408083206001600160a01b038516845290915281205461452990600190614fd7565b5f8481526014602052604081208054929350614546600184614fd7565b8154811061455657614556614faf565b5f918252602090912001546001600160a01b0390811691508416811461467a575f85815260146020526040902080548490811061459557614595614faf565b5f918252602080832090910154878352601490915260409091206001600160a01b03909116906145c6600185614fd7565b815481106145d6576145d6614faf565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508060145f8781526020019081526020015f20848154811061462457614624614faf565b5f91825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055614657836001614fea565b5f8681526015602090815260408083206001600160a01b03861684529091529020555b5f85815260146020526040902080548061469657614696615166565b5f828152602080822083015f1990810180546001600160a01b03191690559092019092559581526015865260408082206001600160a01b0396909616825294909552505050812055565b8015806146ef57506005548111155b1561470d5760405163066f305360e21b815260040160405180910390fd5b600680549082905560408051828152602081018490527fe4fd3e707c42fe7e4405214e86e4f796ecfa58dfe4d17def31221e34e2e4b2b591016132a6565b5f8080838162253d8c6147618362010bd96151fb565b61476b91906151fb565b90505f62023ab161477d836004615222565b61478791906151cf565b905060046147988262023ab1615222565b6147a39060036151fb565b6147ad91906151cf565b6147b790836151a9565b91505f62164b096147c98460016151fb565b6147d590610fa0615222565b6147df91906151cf565b905060046147ef826105b5615222565b6147f991906151cf565b61480390846151a9565b61480e90601f6151fb565b92505f61098f61481f856050615222565b61482991906151cf565b90505f605061483a8361098f615222565b61484491906151cf565b61484e90866151a9565b905061485b600b836151cf565b945061486885600c615222565b6148738360026151fb565b61487d91906151a9565b9150848361488c6031876151a9565b614897906064615222565b6148a191906151fb565b6148ab91906151fb565b9a919950975095505050505050565b5f80805f19858709858702925082811083820303915050805f036148f1578382816148e7576148e7615014565b0492505050611014565b8084116148fc575f80fd5b5f8486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091025f889003889004909101858311909403939093029303949094049190911702949350505050565b606061235a84845f8561498b565b5f816005546006546149839190614fd7565b101592915050565b6060824710156149ec5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016111f8565b5f80866001600160a01b03168587604051614a079190615251565b5f6040518083038185875af1925050503d805f8114614a41576040519150601f19603f3d011682016040523d82523d5f602084013e614a46565b606091505b50915091506133658783838760608315614ac05782515f03614ab9576001600160a01b0385163b614ab95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016111f8565b508161235a565b61235a8383815115614ad55781518083602001fd5b8060405162461bcd60e51b81526004016111f89190614b34565b5f60208284031215614aff575f80fd5b5035919050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f6110146020830184614b06565b6001600160a01b0381168114610c28575f80fd5b5f8060408385031215614b6b575f80fd5b8235614b7681614b46565b946020939093013593505050565b5f8060208385031215614b95575f80fd5b823567ffffffffffffffff811115614bab575f80fd5b8301601f81018513614bbb575f80fd5b803567ffffffffffffffff811115614bd1575f80fd5b8560208260051b8401011115614be5575f80fd5b6020919091019590945092505050565b5f805f60608486031215614c07575f80fd5b8335614c1281614b46565b92506020840135614c2281614b46565b929592945050506040919091013590565b5f60208284031215614c43575f80fd5b813561101481614b46565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112614c71575f80fd5b813567ffffffffffffffff811115614c8b57614c8b614c4e565b604051601f8201601f19908116603f0116810167ffffffffffffffff81118282101715614cba57614cba614c4e565b604052818152838201602001851015614cd1575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f8060808587031215614d00575f80fd5b8435614d0b81614b46565b9350602085013560ff81168114614d20575f80fd5b9250604085013567ffffffffffffffff811115614d3b575f80fd5b614d4787828801614c62565b925050606085013567ffffffffffffffff811115614d63575f80fd5b614d6f87828801614c62565b91505092959194509250565b5f8060408385031215614d8c575f80fd5b823591506020830135614d9e81614b46565b809150509250929050565b5f8060408385031215614dba575f80fd5b8235614dc581614b46565b91506020830135614d9e81614b46565b5f805f60608486031215614de7575f80fd5b505081359360208301359350604090920135919050565b5f805f60608486031215614e10575f80fd5b833592506020840135614e2281614b46565b91506040840135614e3281614b46565b809150509250925092565b8015158114610c28575f80fd5b5f8060408385031215614e5b575f80fd5b8235614e6681614e3d565b91506020830135614d9e81614e3d565b5f805f805f805f805f806101408b8d031215614e90575f80fd5b8a35995060208b0135985060408b0135975060608b0135965060808b0135955060a08b0135945060c08b0135614ec581614b46565b935060e08b0135614ed581614b46565b92506101008b0135614ee681614b46565b91506101208b0135614ef781614b46565b809150509295989b9194979a5092959850565b5f805f8060808587031215614f1d575f80fd5b8435935060208501359250604085013591506060850135614f3d81614b46565b939692955090935050565b5f805f8060808587031215614f5b575f80fd5b5050823594602084013594506040840135936060013592509050565b600181811c90821680614f8b57607f821691505b602082108103614fa957634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b81810381811115610cc257610cc2614fc3565b80820180821115610cc257610cc2614fc3565b8082028115828204841417610cc257610cc2614fc3565b634e487b7160e01b5f52601260045260245ffd5b5f8261503657615036615014565b500490565b601f82111561230457805f5260205f20601f840160051c810160208510156150605750805b601f840160051c820191505b818110156112e1575f815560010161506c565b815167ffffffffffffffff81111561509957615099614c4e565b6150ad816150a78454614f77565b8461503b565b6020601f8211600181146150df575f83156150c85750848201515b5f19600385901b1c1916600184901b1784556112e1565b5f84815260208120601f198516915b8281101561510e57878501518255602094850194600190920191016150ee565b508482101561512b57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f6020828403121561514a575f80fd5b5051919050565b5f8161515f5761515f614fc3565b505f190190565b634e487b7160e01b5f52603160045260245ffd5b634e487b7160e01b5f52602160045260245ffd5b5f6020828403121561519e575f80fd5b815161101481614e3d565b8181035f8312801583831316838312821617156151c8576151c8614fc3565b5092915050565b5f826151dd576151dd615014565b600160ff1b82145f19841416156151f6576151f6614fc3565b500590565b8082018281125f83128015821682158216171561521a5761521a614fc3565b505092915050565b8082025f8212600160ff1b8414161561523d5761523d614fc3565b8181058314821517610cc257610cc2614fc3565b5f82518060208501845e5f92019182525091905056fea26469706673582212206e7218c6048847961d1bc47c069ce6f7f36ab1e4b15bdf1338d1dae6fd3ba21e64736f6c634300081a0033
Verified Source Code Partial Match
Compiler: v0.8.26+commit.8a97fa7a
EVM: cancun
Optimization: Yes (200 runs)
TokenizedAccount.sol 2947 lines
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.19;
interface ITimelockedCall {
function initScheduler(address addr, uint256 newTimeLockDuration) external;
function enableScheduler(address addr) external;
function disableScheduler(address addr) external;
function schedule(bytes32 h, address consumerAddr) external;
function consume(bytes32 h) external;
function consumeOwnership(bytes32 h, address prevOwnerAddr, address newOwnerAddr) external;
}
interface IAllocable {
function deposit(address tokenAddr, uint256 amount) external;
function withdraw(address tokenAddr, uint256 amount, address payable receivingAddr) external;
}
abstract contract BaseOwnable {
error OwnerOnly();
address internal _owner;
/**
* @notice Triggers when contract ownership changes.
* @param previousOwner The previous owner of the contract.
* @param newOwner The new owner of the contract.
*/
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
if (msg.sender != _owner) revert OwnerOnly();
_;
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
library DateUtils {
// The number of seconds per day
uint256 internal constant SECONDS_PER_DAY = 24 * 60 * 60;
// The number of seconds per hour
uint256 internal constant SECONDS_PER_HOUR = 60 * 60;
// The number of seconds per minute
uint256 internal constant SECONDS_PER_MINUTE = 60;
// The offset from 01/01/1970
int256 internal constant OFFSET19700101 = 2440588;
function timestampToDate(uint256 ts) internal pure returns (uint256 year, uint256 month, uint256 day) {
(year, month, day) = _daysToDate(ts / SECONDS_PER_DAY);
}
function timestampToDateTime(uint256 timestamp) internal pure returns (uint256 year, uint256 month, uint256 day, uint256 hour, uint256 minute, uint256 second) {
(year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
uint256 secs = timestamp % SECONDS_PER_DAY;
hour = secs / SECONDS_PER_HOUR;
secs = secs % SECONDS_PER_HOUR;
minute = secs / SECONDS_PER_MINUTE;
second = secs % SECONDS_PER_MINUTE;
}
function timestampFromDateTime(uint256 year, uint256 month, uint256 day, uint256 hour, uint256 minute, uint256 second) internal pure returns (uint256 timestamp) {
timestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + hour * SECONDS_PER_HOUR + minute * SECONDS_PER_MINUTE + second;
}
/**
* @notice Calculate year/month/day from the number of days since 1970/01/01 using the date conversion algorithm from http://aa.usno.navy.mil/faq/docs/JD_Formula.php and adding the offset 2440588 so that 1970/01/01 is day 0
* @dev Taken from https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary/blob/master/contracts/BokkyPooBahsDateTimeLibrary.sol
* @param _days The year
* @return year The year
* @return month The month
* @return day The day
*/
function _daysToDate (uint256 _days) internal pure returns (uint256 year, uint256 month, uint256 day) {
int256 __days = int256(_days);
int256 x = __days + 68569 + OFFSET19700101;
int256 n = 4 * x / 146097;
x = x - (146097 * n + 3) / 4;
int256 _year = 4000 * (x + 1) / 1461001;
x = x - 1461 * _year / 4 + 31;
int256 _month = 80 * x / 2447;
int256 _day = x - 2447 * _month / 80;
x = _month / 11;
_month = _month + 2 - 12 * x;
_year = 100 * (n - 49) + _year + x;
year = uint256(_year);
month = uint256(_month);
day = uint256(_day);
}
/**
* @notice Calculates the number of days from 1970/01/01 to year/month/day using the date conversion algorithm from http://aa.usno.navy.mil/faq/docs/JD_Formula.php and subtracting the offset 2440588 so that 1970/01/01 is day 0
* @dev Taken from https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary/blob/master/contracts/BokkyPooBahsDateTimeLibrary.sol
* @param year The year
* @param month The month
* @param day The day
* @return _days Returns the number of days
*/
function _daysFromDate (uint256 year, uint256 month, uint256 day) internal pure returns (uint256 _days) {
require(year >= 1970, "Error");
int256 _year = int256(year);
int256 _month = int256(month);
int256 _day = int256(day);
int256 __days = _day
- 32075
+ 1461 * (_year + 4800 + (_month - 14) / 12) / 4
+ 367 * (_month - 2 - (_month - 14) / 12 * 12) / 12
- 3 * ((_year + 4900 + (_month - 14) / 12) / 100) / 4
- OFFSET19700101;
_days = uint256(__days);
}
}
error WithdrawalRequestRequired();
error AddressBlacklisted();
error SettlementAccountNotSet();
error LimitRequired();
error NothingToProcess();
error TooEarly();
error InsufficientBalance();
error BalanceCheckFailed();
error InvalidHolder();
error SharesAmountRequired();
error InsufficientShares();
error WithdrawalLimitReached();
error AmountTooLow();
error NoSharesForReceiver();
error PoolNotConfigured();
error PoolAlreadyConfigured();
error DepositsPaused();
error WithdrawalsPaused();
error InvalidReceiver();
error AssetsAmountRequired();
error DepositLimitReached();
error MaxMintReached();
error InvalidDepositLimit();
error InvalidWithdrawalLimit();
error LoansOperatorOnly();
error UnknownLoan();
error InvalidDeploymentAddress();
error InvalidLoanState();
error FundingCheckFailed();
error AllowanceCheckFailed();
error PoolOwnerRequired();
error OperatorRequired();
error DeployerRequired();
error CollectorRequired();
error InvalidProcessingHour();
error InvalidOwner();
error OwnerCannotBeOperator();
error OwnerCannotBeDeployer();
error FeeTooHigh();
error CannotBlacklistOwner();
error InvalidAddress();
error ValueNotSet();
error ManagementFeeIsZero();
error InvalidUpgrade();
error InvalidPercentage();
// OpenZeppelin Contracts (last updated v4.7.0) (utils/math/Math.sol)
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library MathUpgradeable {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
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 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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Permit.sol)
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
/**
* @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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 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://consensys.net/diligence/blog/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");
(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 functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
/**
* @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 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'
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) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @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
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
/**
* @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in
* https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].
*
* _Available since v4.7._
*/
interface IERC4626 {
/// @notice Triggers when an account deposits funds in the contract
event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);
event Withdraw(
address indexed sender,
address indexed receiver,
address indexed owner,
uint256 assets,
uint256 shares
);
/**
* @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.
*
* - MUST be an ERC-20 token contract.
* - MUST NOT revert.
*/
function asset() external view returns (address assetTokenAddress);
/**
* @dev Returns the total amount of the underlying asset that is “managed” by Vault.
*
* - SHOULD include any compounding that occurs from yield.
* - MUST be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT revert.
*/
function totalAssets() external view returns (uint256 totalManagedAssets);
/**
* @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal
* scenario where all the conditions are met.
*
* - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT show any variations depending on the caller.
* - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
* - MUST NOT revert.
*
* NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
* “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
* from.
*/
function convertToShares(uint256 assets) external view returns (uint256 shares);
/**
* @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal
* scenario where all the conditions are met.
*
* - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT show any variations depending on the caller.
* - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
* - MUST NOT revert.
*
* NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
* “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
* from.
*/
function convertToAssets(uint256 shares) external view returns (uint256 assets);
/**
* @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,
* through a deposit call.
*
* - MUST return a limited value if receiver is subject to some deposit limit.
* - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.
* - MUST NOT revert.
*/
function maxDeposit(address receiver) external view returns (uint256 maxAssets);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given
* current on-chain conditions.
*
* - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit
* call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called
* in the same transaction.
* - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the
* deposit would be accepted, regardless if the user has enough tokens approved, etc.
* - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by depositing.
*/
function previewDeposit(uint256 assets) external view returns (uint256 shares);
/**
* @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.
*
* - MUST emit the Deposit event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
* deposit execution, and are accounted for during deposit.
* - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not
* approving enough underlying tokens to the Vault contract, etc).
*
* NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
*/
function deposit(uint256 assets, address receiver) external returns (uint256 shares);
/**
* @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.
* - MUST return a limited value if receiver is subject to some mint limit.
* - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.
* - MUST NOT revert.
*/
function maxMint(address receiver) external view returns (uint256 maxShares);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given
* current on-chain conditions.
*
* - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call
* in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the
* same transaction.
* - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint
* would be accepted, regardless if the user has enough tokens approved, etc.
* - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by minting.
*/
function previewMint(uint256 shares) external view returns (uint256 assets);
/**
* @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.
*
* - MUST emit the Deposit event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint
* execution, and are accounted for during mint.
* - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not
* approving enough underlying tokens to the Vault contract, etc).
*
* NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
*/
function mint(uint256 shares, address receiver) external returns (uint256 assets);
/**
* @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the
* Vault, through a withdraw call.
*
* - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
* - MUST NOT revert.
*/
function maxWithdraw(address owner) external view returns (uint256 maxAssets);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,
* given current on-chain conditions.
*
* - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw
* call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if
* called
* in the same transaction.
* - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though
* the withdrawal would be accepted, regardless if the user has enough shares, etc.
* - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by depositing.
*/
function previewWithdraw(uint256 assets) external view returns (uint256 shares);
/**
* @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.
*
* - MUST emit the Withdraw event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
* withdraw execution, and are accounted for during withdraw.
* - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner
* not having enough shares, etc).
*
* Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
* Those methods should be performed separately.
*/
function withdraw(
uint256 assets,
address receiver,
address owner
) external returns (uint256 shares);
/**
* @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,
* through a redeem call.
*
* - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
* - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.
* - MUST NOT revert.
*/
function maxRedeem(address owner) external view returns (uint256 maxShares);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,
* given current on-chain conditions.
*
* - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call
* in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the
* same transaction.
* - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the
* redemption would be accepted, regardless if the user has enough shares, etc.
* - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by redeeming.
*/
function previewRedeem(uint256 shares) external view returns (uint256 assets);
/**
* @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.
*
* - MUST emit the Withdraw event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
* r...
// [truncated — 124143 bytes total]
Read Contract
allowance 0xdd62ed3e → uint256
asset 0x38d52e0f → address
assetsUpdatedOn 0xfa20e0fe → uint256
balanceOf 0x70a08231 → uint256
convertToAssets 0x07a2d13a → uint256
convertToShares 0xc6e6f592 → uint256
decimals 0x313ce567 → uint8
depositsPaused 0x60da3e83 → bool
externalAssets 0x785c3127 → uint256
feesCollector 0x9cf160f6 → address
feesTimestamp 0x36b7ea15 → uint256
getBurnableAmountByReceiver 0xbe1f9214 → uint256
getChangePercentage 0x28f85680 → uint256
getClaimableAmountByReceiver 0xdc68a93a → uint256
getInitializedVersion 0xb3c65015 → uint8
getMaxAllowedChange 0x520cd036 → uint256
getRequirementByDate 0xff3c63c0 → uint256, uint256
getScheduledTransactionsByDate 0x6c46407b → uint256, uint256
getWithdrawalEpoch 0xca55a557 → uint256, uint256, uint256, uint256
globalLiabilityShares 0x9cb43f81 → uint256
isBlacklisted 0xfe575a87 → bool
lagDuration 0x24e86d67 → uint256
managementFeePercent 0x73f351c8 → uint256
maxChangePercent 0xe6228680 → uint256
maxDeposit 0x402d267d → uint256
maxDepositAmount 0x8ed83271 → uint256
maxMint 0xc63d75b6 → uint256
maxRedeem 0xd905777e → uint256
maxSupply 0xd5abeb01 → uint256
maxWithdraw 0xce96cb77 → uint256
maxWithdrawalAmount 0xe976d431 → uint256
name 0x06fdde03 → string
operator 0x570ca735 → address
owner 0x8da5cb5b → address
previewDeposit 0xef8b30f7 → uint256
previewMint 0xb3d7f6b9 → uint256
previewRedeem 0x4cdad506 → uint256
previewWithdraw 0x0a28a477 → uint256
redeem 0xba087652 → uint256
scheduledCallerAddress 0xe2eb36b9 → address
settlementAccount 0xcc0e3f2c → address
symbol 0x95d89b41 → string
totalAssets 0x01e1d114 → uint256
totalCollectableFees 0xd961b58c → uint256
totalSupply 0x18160ddd → uint256
totalWhitelistedSubAccounts 0x72332aa6 → uint256
whitelistedSubAccounts 0xbb270709 → bool
withdraw 0xb460af94 → uint256
withdrawalFee 0x8bc7e8c4 → uint256
withdrawalsPaused 0xe9f2838e → bool
Write Contract 30 functions
These functions modify contract state and require a wallet transaction to execute.
addToBlacklist 0x44337ea1
address addr
addWhitelistedSubaccount 0x68e7d11d
address[] arr
approve 0x095ea7b3
address spender
uint256 value
returns: bool
chargeManagementFee 0xd3a8d718
No parameters
claim 0xb3c9e83d
uint256 year
uint256 month
uint256 day
address receiverAddr
returns: uint256, uint256
collectFees 0xc8796572
No parameters
configure 0xa08d3aae
uint256 newLagDuration
uint256 newMaxDepositAmount
uint256 newMaxWithdrawalAmount
uint256 newMaxTokenSupply
uint256 newManagementFeePercent
uint256 newMaxChangePercent
address newUnderlyingAsset
address newFeesCollectorAddr
address newScheduledCallerAddress
address newOperatorAddress
deposit 0x6e553f65
uint256 assets
address receiver
returns: uint256
depositToSubaccount 0xcc4cd1d3
uint256 amount
address subAccountAddr
emergencyWithdraw 0x6382d9ad
address token
address destinationAddr
initialize 0x42fe0980
address newOwner
uint8 erc20Decimals
string erc20Symbol
string erc20Name
mint 0x94bf804d
uint256 shares
address receiver
returns: uint256
pauseDepositsAndWithdrawals 0x8c0190e3
bool bPauseDeposits
bool bPauseWithdrawals
processAllClaimsByDate 0xf3cbf47c
uint256 year
uint256 month
uint256 day
uint256 maxLimit
removeFromBlacklist 0x537df3b6
address addr
removeWhitelistedSubaccount 0x1080f02d
address[] arr
requestRedeem 0x7d41c86e
uint256 shares
address receiverAddr
address holderAddr
returns: uint256, uint256
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateFeeCollector 0xd2c35ce8
address newFeeCollectorAddr
updateIssuanceLimits 0xbaaa19fb
uint256 newMaxDepositAmount
uint256 newMaxWithdrawalAmount
uint256 newMaxTokenSupply
updateManagementFee 0x030d624a
uint256 newManagementFeePercent
updateMaxChangePercent 0x790739a2
uint256 newValue
updateOperator 0xac7475ed
address addr
updateSettlementAccount 0x339eeb68
address addr
updateTimelockDuration 0x184466c9
uint256 newDuration
updateTotalAssets 0x1f4f519c
uint256 externalAssetsAmount
updateWithdrawalFee 0x569b8e2c
uint256 newWithdrawalFee
withdrawFromSubaccount 0x59afd762
uint256 amount
address subAccountAddr
Recent Transactions
No transactions found for this address