Address Contract Partially Verified
Address
0x8A370C951F34e295B2655B47bB0985dD08d8f718
Balance
0 ETH
Nonce
1
Code Size
10239 bytes
Creator
0x2B0F0f97...7c2a at tx 0xa11ffa1c...7f4f2d
Indexed Transactions
0
Contract Bytecode
10239 bytes
0x608060405234801561000f575f80fd5b5060043610610281575f3560e01c8063715018a611610156578063a9059cbb116100ca578063d547741f11610084578063d547741f1461058f578063d5abeb01146105a2578063dd62ed3e146105ab578063f2fde38b146105be578063fb235f34146105d1578063fb75b2c7146105e4575f80fd5b8063a9059cbb14610514578063b33712c514610527578063c816841b1461052f578063cc1776d314610542578063d505accf14610555578063d539139314610568575f80fd5b806384b0196e1161011b57806384b0196e146104b35780638da5cb5b146104ce57806391d14854146104df57806395d89b41146104f257806396804ba6146104fa578063a217fddf1461050d575f80fd5b8063715018a61461045e578063735de9f71461046657806379cc6790146104795780637ecebe001461048c5780638124f7ac1461049f575f80fd5b8063378dc3dc116101f857806349df728c116101b257806349df728c146103df5780634f7041a5146103f25780635958621e146104045780635c975abb146104175780636f9fb98a1461042257806370a0823114610436575f80fd5b8063378dc3dc146103745780633b6238651461037d57806340c10f191461038657806342966c6814610399578063439766ce146103ac57806344478425146103b4575f80fd5b806323b872dd1161024957806323b872dd146102fc578063248a9ca31461030f5780632f2ff15d14610331578063313ce567146103445780633644e5151461035957806336568abe14610361575f80fd5b806301ffc9a71461028557806306fdde03146102ad578063095ea7b3146102c25780630d2cf31f146102d557806318160ddd146102ea575b5f80fd5b610298610293366004612142565b6105f7565b60405190151581526020015b60405180910390f35b6102b561062d565b6040516102a491906121ac565b6102986102d03660046121d2565b6106bd565b6102e86102e3366004612211565b6106d4565b005b6002545b6040519081526020016102a4565b61029861030a366004612251565b610745565b6102ee61031d36600461228f565b5f9081526009602052604090206001015490565b6102e861033f3660046122a6565b61083e565b60125b60405160ff90911681526020016102a4565b6102ee610868565b6102e861036f3660046122a6565b610876565b6102ee600b5481565b6102ee60105481565b6102e86103943660046121d2565b6108ae565b6102e86103a736600461228f565b6109d4565b6102986109e1565b600e546103c7906001600160a01b031681565b6040516001600160a01b0390911681526020016102a4565b6102e86103ed3660046122d4565b610a1e565b600a5461034790610100900460ff1681565b6102e86104123660046122d4565b610b6a565b600a5460ff16610298565b305f908152602081905260409020546102ee565b6102ee6104443660046122d4565b6001600160a01b03165f9081526020819052604090205490565b6102e8610bd8565b6011546103c7906001600160a01b031681565b6102e86104873660046121d2565b610beb565b6102ee61049a3660046122d4565b610c00565b600a54610347906301000000900460ff1681565b6104bb610c1d565b6040516102a497969594939291906122ef565b6005546001600160a01b03166103c7565b6102986104ed3660046122a6565b610c5f565b6102b5610c89565b6102e861050836600461228f565b610c98565b6102ee5f81565b6102986105223660046121d2565b610cc3565b610298610d23565b600f546103c7906001600160a01b031681565b600a546103479062010000900460ff1681565b6102e8610563366004612386565b610d5a565b6102ee7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6102e861059d3660046122a6565b610e90565b6102ee600c5481565b6102ee6105b93660046123ef565b610eb4565b6102e86105cc3660046122d4565b610ede565b6102e86105df3660046122d4565b610f18565b600d546103c7906001600160a01b031681565b5f6001600160e01b03198216637965db0b60e01b148061062757506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606003805461063c9061241b565b80601f01602080910402602001604051908101604052809291908181526020018280546106689061241b565b80156106b35780601f1061068a576101008083540402835291602001916106b3565b820191905f5260205f20905b81548152906001019060200180831161069657829003601f168201915b5050505050905090565b5f336106ca818585610f86565b5060019392505050565b6106de5f33610c5f565b6107035760405162461bcd60e51b81526004016106fa90612453565b60405180910390fd5b600a805462ffff00191661010060ff9586160262ff000019161762010000938516939093029290921763ff000000191663010000009190931602919091179055565b5f61074e610f93565b6001600160a01b0384166107745760405162461bcd60e51b81526004016106fa90612483565b6001600160a01b03831661079a5760405162461bcd60e51b81526004016106fa90612483565b5f6107a58533610eb4565b9050828110156108085760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084016106fa565b5f83116108275760405162461bcd60e51b81526004016106fa906124ac565b610832858585610fd9565b50600195945050505050565b5f8281526009602052604090206001015461085881611248565b6108628383611252565b50505050565b5f6108716112e3565b905090565b6001600160a01b038116331461089f5760405163334bd91960e11b815260040160405180910390fd5b6108a9828261140c565b505050565b6108b6610f93565b6108e07f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633610c5f565b6109255760405162461bcd60e51b815260206004820152601660248201527521b0b63632b91034b9903737ba10309036b4b73a32b960511b60448201526064016106fa565b6001600160a01b03821661094b5760405162461bcd60e51b81526004016106fa906124ef565b6109576012600a612613565b600c546109649190612621565b8161096e60025490565b6109789190612638565b11156109c65760405162461bcd60e51b815260206004820152601a60248201527f45524332303a206d617820737570706c7920657863656564656400000000000060448201526064016106fa565b6109d08282611477565b5050565b6109de33826114ab565b50565b5f6109ea610f93565b6109f45f33610c5f565b610a105760405162461bcd60e51b81526004016106fa90612453565b610a186114df565b50600190565b610a26610f93565b610a305f33610c5f565b610a4c5760405162461bcd60e51b81526004016106fa90612453565b6040516370a0823160e01b815230600482015281905f906001600160a01b038316906370a0823190602401602060405180830381865afa158015610a92573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ab6919061264b565b600e5460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810183905291925083169063a9059cbb906044016020604051808303815f875af1158015610b08573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b2c9190612662565b6108a95760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016106fa565b610b745f33610c5f565b610b905760405162461bcd60e51b81526004016106fa90612453565b6001600160a01b038116610bb65760405162461bcd60e51b81526004016106fa906124ef565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b610be0611539565b610be95f611566565b565b610bf68233836115b7565b6109d082826114ab565b6001600160a01b0381165f90815260086020526040812054610627565b5f6060805f805f6060610c2e611614565b610c36611641565b604080515f80825260208201909252600f60f81b9b939a50919850469750309650945092509050565b5f9182526009602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606004805461063c9061241b565b610ca25f33610c5f565b610cbe5760405162461bcd60e51b81526004016106fa90612453565b601055565b5f610ccc610f93565b6001600160a01b038316610cf25760405162461bcd60e51b81526004016106fa90612483565b5f8211610d115760405162461bcd60e51b81526004016106fa906124ac565b610d1c338484610fd9565b9392505050565b5f610d2c61166e565b610d365f33610c5f565b610d525760405162461bcd60e51b81526004016106fa90612453565b610a186116b7565b83421115610d7e5760405163313c898160e11b8152600481018590526024016106fa565b5f7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610dc98c6001600160a01b03165f90815260086020526040902080546001810190915590565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090505f610e23826116f0565b90505f610e328287878761171c565b9050896001600160a01b0316816001600160a01b031614610e79576040516325c0072360e11b81526001600160a01b0380831660048301528b1660248201526044016106fa565b610e848a8a8a610f86565b50505050505050505050565b5f82815260096020526040902060010154610eaa81611248565b610862838361140c565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b610ee6611539565b6001600160a01b038116610f0f57604051631e4fbdf760e01b81525f60048201526024016106fa565b6109de81611566565b610f225f33610c5f565b610f3e5760405162461bcd60e51b81526004016106fa90612453565b6001600160a01b038116610f645760405162461bcd60e51b81526004016106fa906124ef565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6108a98383836001611748565b600a5460ff1615610be95760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106fa565b5f610fe2610f93565b6001600160a01b0384166110085760405162461bcd60e51b81526004016106fa90612483565b6001600160a01b03831661102e5760405162461bcd60e51b81526004016106fa90612483565b5f82116110995760405162461bcd60e51b815260206004820152603360248201527f416d6f756e742073686f756c642062652067726561746572207468616e207a656044820152723937903337b9103a3930b739b0b1ba34b7b71760691b60648201526084016106fa565b600a54600f545f9160ff6301000000909104169084906001600160a01b0388811691161480156110d757506011546001600160a01b03878116911614155b156110ee57600a54610100900460ff169150611127565b600f546001600160a01b039081169087160361111757600a5462010000900460ff169150611127565b600a546301000000900460ff1691505b611131858361181a565b925061113d8382612681565b90505f61114b600285612694565b90505f611159600286612694565b9050611166893083611834565b600d5461117e908a906001600160a01b031684611834565b611189898985611834565b305f90815260208190526040812054906111a56012600a612613565b6010546111b29190612621565b8211156111e0576111dd6111c86012600a612613565b6010546111d59190612621565b6103e8611891565b90505b67016345785d8a00006111f56012600a612613565b6010546112029190612621565b8311801561120f57508082115b15611236576112366112236012600a612613565b6010546112309190612621565b83611b9d565b5060019b9a5050505050505050505050565b6109de8133611d56565b5f61125d8383610c5f565b6112dc575f8381526009602090815260408083206001600160a01b03861684529091529020805460ff191660011790556112943390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610627565b505f610627565b5f306001600160a01b037f0000000000000000000000008a370c951f34e295b2655b47bb0985dd08d8f7181614801561133b57507f000000000000000000000000000000000000000000000000000000000000000146145b1561136557507fe4cc1470bd97352610bdb51204e47c09b329b8c2b62a55a8a7db17b689cc2ff290565b610871604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f02fa15c817decb6d4886fa91737cc6ae3a5b7b4777ed3b8eff6cbd85d4dcc5ce918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a08201525f9060c00160405160208183030381529060405280519060200120905090565b5f6114178383610c5f565b156112dc575f8381526009602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610627565b6001600160a01b0382166114a05760405163ec442f0560e01b81525f60048201526024016106fa565b6109d05f8383611d8f565b6001600160a01b0382166114d457604051634b637e8f60e11b81525f60048201526024016106fa565b6109d0825f83611d8f565b6114e7610f93565b600a805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861151c3390565b6040516001600160a01b03909116815260200160405180910390a1565b6005546001600160a01b03163314610be95760405163118cdaa760e01b81523360048201526024016106fa565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f6115c28484610eb4565b90505f198114610862578181101561160657604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016106fa565b61086284848484035f611748565b60606108717f486f6d6d696573000000000000000000000000000000000000000000000000076006611eb5565b60606108717f31000000000000000000000000000000000000000000000000000000000000016007611eb5565b600a5460ff16610be95760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016106fa565b6116bf61166e565b600a805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa3361151c565b5f6106276116fc6112e3565b8360405161190160f01b8152600281019290925260228201526042902090565b5f805f8061172c88888888611f5e565b92509250925061173c8282612026565b50909695505050505050565b6001600160a01b0384166117715760405163e602df0560e01b81525f60048201526024016106fa565b6001600160a01b03831661179a57604051634a1406b160e11b81525f60048201526024016106fa565b6001600160a01b038085165f908152600160209081526040808320938716835292905220829055801561086257826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161180c91815260200190565b60405180910390a350505050565b5f606461182a60ff841685612621565b610d1c9190612694565b6001600160a01b03831661185d57604051634b637e8f60e11b81525f60048201526024016106fa565b6001600160a01b0382166118865760405163ec442f0560e01b81525f60048201526024016106fa565b6108a9838383611d8f565b5f6127108211156118d85760405162461bcd60e51b81526020600482015260116024820152700a6d8d2e0e0c2ceca40e8dede40d0d2ced607b1b60448201526064016106fa565b5f8060135f9054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa15801561192a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061194e91906126c9565b50915091505f60135f9054906101000a90046001600160a01b03166001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119a4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119c89190612715565b90505f60135f9054906101000a90046001600160a01b03166001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a1b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a3f9190612715565b90505f6001600160a01b0383163003611adc57601154604051630153543560e21b8152600481018a90526001600160701b038088166024830152861660448201526001600160a01b039091169063054d50d4906064015b602060405180830381865afa158015611ab1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ad5919061264b565b9050611b6c565b6001600160a01b0382163003611b3457601154604051630153543560e21b8152600481018a90526001600160701b038087166024830152871660448201526001600160a01b039091169063054d50d490606401611a96565b60405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b60448201526064016106fa565b5f612710611b7a8984612621565b611b849190612694565b9050611b908183612681565b9998505050505050505050565b611ba5610f93565b60115460405163095ea7b360e01b81526001600160a01b03909116600482015260248101839052309063095ea7b3906044016020604051808303815f875af1158015611bf3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c179190612662565b506040805160028082526060820183525f9260208301908036833701905050905030815f81518110611c4b57611c4b612730565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611ca2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611cc69190612715565b81600181518110611cd957611cd9612730565b6001600160a01b039283166020918202929092010152601154600e5460405163791ac94760e01b81529183169263791ac94792611d2492889288928892909116904290600401612744565b5f604051808303815f87803b158015611d3b575f80fd5b505af1158015611d4d573d5f803e3d5ffd5b50505050505050565b611d608282610c5f565b6109d05760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016106fa565b6001600160a01b038316611db9578060025f828254611dae9190612638565b90915550611e299050565b6001600160a01b0383165f9081526020819052604090205481811015611e0b5760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016106fa565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b038216611e4557600280548290039055611e63565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611ea891815260200190565b60405180910390a3505050565b606060ff8314611ecf57611ec8836120de565b9050610627565b818054611edb9061241b565b80601f0160208091040260200160405190810160405280929190818152602001828054611f079061241b565b8015611f525780601f10611f2957610100808354040283529160200191611f52565b820191905f5260205f20905b815481529060010190602001808311611f3557829003601f168201915b50505050509050610627565b5f80807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611f9757505f9150600390508261201c565b604080515f808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611fe8573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b03811661201357505f92506001915082905061201c565b92505f91508190505b9450945094915050565b5f826003811115612039576120396127b5565b03612042575050565b6001826003811115612056576120566127b5565b036120745760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115612088576120886127b5565b036120a95760405163fce698f760e01b8152600481018290526024016106fa565b60038260038111156120bd576120bd6127b5565b036109d0576040516335e2f38360e21b8152600481018290526024016106fa565b60605f6120ea8361211b565b6040805160208082528183019092529192505f91906020820181803683375050509182525060208101929092525090565b5f60ff8216601f81111561062757604051632cd44ac360e21b815260040160405180910390fd5b5f60208284031215612152575f80fd5b81356001600160e01b031981168114610d1c575f80fd5b5f81518084525f5b8181101561218d57602081850181015186830182015201612171565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f610d1c6020830184612169565b6001600160a01b03811681146109de575f80fd5b5f80604083850312156121e3575f80fd5b82356121ee816121be565b946020939093013593505050565b803560ff8116811461220c575f80fd5b919050565b5f805f60608486031215612223575f80fd5b61222c846121fc565b925061223a602085016121fc565b9150612248604085016121fc565b90509250925092565b5f805f60608486031215612263575f80fd5b833561226e816121be565b9250602084013561227e816121be565b929592945050506040919091013590565b5f6020828403121561229f575f80fd5b5035919050565b5f80604083850312156122b7575f80fd5b8235915060208301356122c9816121be565b809150509250929050565b5f602082840312156122e4575f80fd5b8135610d1c816121be565b60ff60f81b881681525f602060e0602084015261230f60e084018a612169565b8381036040850152612321818a612169565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825260208088019350909101905f5b8181101561237457835183529284019291840191600101612358565b50909c9b505050505050505050505050565b5f805f805f805f60e0888a03121561239c575f80fd5b87356123a7816121be565b965060208801356123b7816121be565b955060408801359450606088013593506123d3608089016121fc565b925060a0880135915060c0880135905092959891949750929550565b5f8060408385031215612400575f80fd5b823561240b816121be565b915060208301356122c9816121be565b600181811c9082168061242f57607f821691505b60208210810361244d57634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526016908201527521b0b63632b91034b9903737ba1030b71030b236b4b760511b604082015260600190565b6020808252600f908201526e496e76616c6964204164647265737360881b604082015260600190565b60208082526023908201527f416d6f756e742073686f756c642062652067726561746572207468616e207a6560408201526239379760e91b606082015260800190565b602080825260169082015275496e76616c69642057616c6c6574204164647265737360501b604082015260600190565b634e487b7160e01b5f52601160045260245ffd5b600181815b8085111561256d57815f19048211156125535761255361251f565b8085161561256057918102915b93841c9390800290612538565b509250929050565b5f8261258357506001610627565b8161258f57505f610627565b81600181146125a557600281146125af576125cb565b6001915050610627565b60ff8411156125c0576125c061251f565b50506001821b610627565b5060208310610133831016604e8410600b84101617156125ee575081810a610627565b6125f88383612533565b805f190482111561260b5761260b61251f565b029392505050565b5f610d1c60ff841683612575565b80820281158282048414176106275761062761251f565b808201808211156106275761062761251f565b5f6020828403121561265b575f80fd5b5051919050565b5f60208284031215612672575f80fd5b81518015158114610d1c575f80fd5b818103818111156106275761062761251f565b5f826126ae57634e487b7160e01b5f52601260045260245ffd5b500490565b80516001600160701b038116811461220c575f80fd5b5f805f606084860312156126db575f80fd5b6126e4846126b3565b92506126f2602085016126b3565b9150604084015163ffffffff8116811461270a575f80fd5b809150509250925092565b5f60208284031215612725575f80fd5b8151610d1c816121be565b634e487b7160e01b5f52603260045260245ffd5b5f60a08201878352602087602085015260a0604085015281875180845260c0860191506020890193505f5b818110156127945784516001600160a01b03168352938301939183019160010161276f565b50506001600160a01b03969096166060850152505050608001529392505050565b634e487b7160e01b5f52602160045260245ffdfea26469706673582212200a20798adad5c2326881a81590ea34b6343270527e3a9e27c839dc9006843b0964736f6c63430008160033
Verified Source Code Partial Match
Compiler: v0.8.22+commit.4fc1097e
EVM: shanghai
Optimization: Yes (200 runs)
Hommies.sol 3283 lines
/*
HHHHHHHHH HHHHHHHHH iiii
H:::::::H H:::::::H i::::i
H:::::::H H:::::::H iiii
HH::::::H H::::::HH
H:::::H H:::::H ooooooooooo mmmmmmm mmmmmmm mmmmmmm mmmmmmm iiiiiii eeeeeeeeeeee ssssssssss
H:::::H H:::::H oo:::::::::::oo mm:::::::m m:::::::mm mm:::::::m m:::::::mm i:::::i ee::::::::::::ee ss::::::::::s
H::::::HHHHH::::::H o:::::::::::::::om::::::::::mm::::::::::mm::::::::::mm::::::::::m i::::i e::::::eeeee:::::eess:::::::::::::s
H:::::::::::::::::H o:::::ooooo:::::om::::::::::::::::::::::mm::::::::::::::::::::::m i::::i e::::::e e:::::es::::::ssss:::::s
H:::::::::::::::::H o::::o o::::om:::::mmm::::::mmm:::::mm:::::mmm::::::mmm:::::m i::::i e:::::::eeeee::::::e s:::::s ssssss
H::::::HHHHH::::::H o::::o o::::om::::m m::::m m::::mm::::m m::::m m::::m i::::i e:::::::::::::::::e s::::::s
H:::::H H:::::H o::::o o::::om::::m m::::m m::::mm::::m m::::m m::::m i::::i e::::::eeeeeeeeeee s::::::s
H:::::H H:::::H o::::o o::::om::::m m::::m m::::mm::::m m::::m m::::m i::::i e:::::::e ssssss s:::::s
HH::::::H H::::::HHo:::::ooooo:::::om::::m m::::m m::::mm::::m m::::m m::::mi::::::ie::::::::e s:::::ssss::::::s
H:::::::H H:::::::Ho:::::::::::::::om::::m m::::m m::::mm::::m m::::m m::::mi::::::i e::::::::eeeeeeee s::::::::::::::s
H:::::::H H:::::::H oo:::::::::::oo m::::m m::::m m::::mm::::m m::::m m::::mi::::::i ee:::::::::::::e s:::::::::::ss
HHHHHHHHH HHHHHHHHH ooooooooooo mmmmmm mmmmmm mmmmmmmmmmmm mmmmmm mmmmmmiiiiiiii eeeeeeeeeeeeee sssssssssss
*/
// File: @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
// File: @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol
pragma solidity >=0.6.2;
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
// File: @uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: @uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* 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[EIP 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);
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// File: @openzeppelin/contracts/access/IAccessControl.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)
pragma solidity ^0.8.20;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev The `account` is missing a role.
*/
error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);
/**
* @dev The caller of a function is not the expected one.
*
* NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
*/
error AccessControlBadConfirmation();
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*/
function renounceRole(bytes32 role, address callerConfirmation) external;
}
// File: @openzeppelin/contracts/utils/Nonces.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides tracking nonces for addresses. Nonces will only increment.
*/
abstract contract Nonces {
/**
* @dev The nonce used for an `account` is not the expected current nonce.
*/
error InvalidAccountNonce(address account, uint256 currentNonce);
mapping(address account => uint256) private _nonces;
/**
* @dev Returns the next unused nonce for an address.
*/
function nonces(address owner) public view virtual returns (uint256) {
return _nonces[owner];
}
/**
* @dev Consumes a nonce.
*
* Returns the current value and increments nonce.
*/
function _useNonce(address owner) internal virtual returns (uint256) {
// For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be
// decremented or reset. This guarantees that the nonce never overflows.
unchecked {
// It is important to do x++ and not ++x here.
return _nonces[owner]++;
}
}
/**
* @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.
*/
function _useCheckedNonce(address owner, uint256 nonce) internal virtual {
uint256 current = _useNonce(owner);
if (nonce != current) {
revert InvalidAccountNonce(owner, current);
}
}
}
// File: @openzeppelin/contracts/interfaces/IERC5267.sol
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)
pragma solidity ^0.8.20;
interface IERC5267 {
/**
* @dev MAY be emitted to signal that the domain could have changed.
*/
event EIP712DomainChanged();
/**
* @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
* signature.
*/
function eip712Domain()
external
view
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
);
}
// File: @openzeppelin/contracts/utils/StorageSlot.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```solidity
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}
// File: @openzeppelin/contracts/utils/ShortStrings.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ShortStrings.sol)
pragma solidity ^0.8.20;
// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
// | length | 0x BB |
type ShortString is bytes32;
/**
* @dev This library provides functions to convert short memory strings
* into a `ShortString` type that can be used as an immutable variable.
*
* Strings of arbitrary length can be optimized using this library if
* they are short enough (up to 31 bytes) by packing them with their
* length (1 byte) in a single EVM word (32 bytes). Additionally, a
* fallback mechanism can be used for every other case.
*
* Usage example:
*
* ```solidity
* contract Named {
* using ShortStrings for *;
*
* ShortString private immutable _name;
* string private _nameFallback;
*
* constructor(string memory contractName) {
* _name = contractName.toShortStringWithFallback(_nameFallback);
* }
*
* function name() external view returns (string memory) {
* return _name.toStringWithFallback(_nameFallback);
* }
* }
* ```
*/
library ShortStrings {
// Used as an identifier for strings longer than 31 bytes.
bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;
error StringTooLong(string str);
error InvalidShortString();
/**
* @dev Encode a string of at most 31 chars into a `ShortString`.
*
* This will trigger a `StringTooLong` error is the input string is too long.
*/
function toShortString(string memory str) internal pure returns (ShortString) {
bytes memory bstr = bytes(str);
if (bstr.length > 31) {
revert StringTooLong(str);
}
return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
}
/**
* @dev Decode a `ShortString` back to a "normal" string.
*/
function toString(ShortString sstr) internal pure returns (string memory) {
uint256 len = byteLength(sstr);
// using `new string(len)` would work locally but is not memory safe.
string memory str = new string(32);
/// @solidity memory-safe-assembly
assembly {
mstore(str, len)
mstore(add(str, 0x20), sstr)
}
return str;
}
/**
* @dev Return the length of a `ShortString`.
*/
function byteLength(ShortString sstr) internal pure returns (uint256) {
uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
if (result > 31) {
revert InvalidShortString();
}
return result;
}
/**
* @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
*/
function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
if (bytes(value).length < 32) {
return toShortString(value);
} else {
StorageSlot.getStringSlot(store).value = value;
return ShortString.wrap(FALLBACK_SENTINEL);
}
}
/**
* @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
*/
function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
return toString(value);
} else {
return store;
}
}
/**
* @dev Return the length of a string that was encoded to `ShortString` or written to storage using
* {setWithFallback}.
*
* WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
* actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
*/
function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
return byteLength(value);
} else {
return bytes(store).length;
}
}
}
// File: @openzeppelin/contracts/utils/math/SignedMath.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}
// File: @openzeppelin/contracts/utils/math/Math.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @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 towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (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 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 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.
uint256 twos = denominator & (0 - denominator);
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 (unsignedRoundsUp(rounding) && 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
* towards zero.
*
* 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* 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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* 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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* 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 256, 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 + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
/**
* @dev The `value` string doesn't fit in the specified `length`.
*/
error StringsInsufficientHexLength(uint256 value, uint256 length);
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toStringSigned(int256 value) internal pure returns (string memory) {
return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
uint256 localValue = value;
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = HEX_DIGITS[localValue & 0xf];
localValue >>= 4;
}
if (localValue != 0) {
revert StringsInsufficientHexLength(value, length);
}
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
* representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
}
// File: @openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)
pragma solidity ^0.8.20;
/**
* @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
*
* The library provides methods for generating a hash of a message that conforms to the
* https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
* specifications.
*/
library MessageHashUtils {
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x45` (`personal_sign` messages).
*
* The digest is calculated by prefixing a bytes32 `messageHash` with
* `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
* hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
*
* NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
* keccak256, although any bytes32 value can be safely used because the final digest will
* be re-hashed.
*
* See {ECDSA-recover}.
*/
function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
}
}
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x45` (`personal_sign` messages).
*
* The digest is calculated by prefixing an arbitrary `message` with
* `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
* hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
*
* See {ECDSA-recover}.
*/
function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
return
keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
}
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x00` (data with intended validator).
*
* The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
* `validator` address. Then hashing the result.
*
* See {ECDSA-recover}.
*/
function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(hex"19_00", validator, data));
}
/**
* @dev Returns the keccak256 digest of an EIP-712 typed d...
// [truncated — 117903 bytes total]
Read Contract
DEFAULT_ADMIN_ROLE 0xa217fddf → bytes32
DOMAIN_SEPARATOR 0x3644e515 → bytes32
MINTER_ROLE 0xd5391393 → bytes32
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
buyTax 0x4f7041a5 → uint8
decimals 0x313ce567 → uint8
eip712Domain 0x84b0196e → bytes1, string, string, uint256, address, bytes32, uint256[]
getContractBalance 0x6f9fb98a → uint256
getRoleAdmin 0x248a9ca3 → bytes32
hasRole 0x91d14854 → bool
initialSupply 0x378dc3dc → uint256
maxSupply 0xd5abeb01 → uint256
name 0x06fdde03 → string
nonces 0x7ecebe00 → uint256
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
revenueThreshold 0x3b623865 → uint256
revenueWallet 0x44478425 → address
rewardWallet 0xfb75b2c7 → address
sellTax 0xcc1776d3 → uint8
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
transferTax 0x8124f7ac → uint8
uniswapPair 0xc816841b → address
uniswapRouter 0x735de9f7 → address
Write Contract 19 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 value
returns: bool
burn 0x42966c68
uint256 value
burnFrom 0x79cc6790
address account
uint256 value
grantRole 0x2f2ff15d
bytes32 role
address account
mint 0x40c10f19
address to
uint256 amount
pauseContract 0x439766ce
No parameters
returns: bool
permit 0xd505accf
address owner
address spender
uint256 value
uint256 deadline
uint8 v
bytes32 r
bytes32 s
renounceOwnership 0x715018a6
No parameters
renounceRole 0x36568abe
bytes32 role
address callerConfirmation
revokeRole 0xd547741f
bytes32 role
address account
setRevenueWallet 0xfb235f34
address _revenueWallet
setRewardWallet 0x5958621e
address _rewardWallet
setTaxes 0x0d2cf31f
uint8 _buyTax
uint8 _sellTax
uint8 _transferTax
setThresholdLimit 0x96804ba6
uint256 _limit
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unpauseContract 0xb33712c5
No parameters
returns: bool
withdrawTokens 0x49df728c
address _tokenContract
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address