Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x501bbe832e4163A5e14bbaab3281bDb163D05ecc
Balance 0 ETH
Nonce 1
Code Size 11744 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

11744 bytes
0x608060405234801561000f575f80fd5b50600436106101ee575f3560e01c806375f0a8741161010d578063bd9c47e3116100a0578063f2fde38b1161006f578063f2fde38b146105b2578063f52f2526146105ce578063f7c7724f146105ea578063fb5f4b6914610606576101ee565b8063bd9c47e314610518578063d469801614610548578063dd62ed3e14610566578063e8a97a3e14610596576101ee565b80639215abb0116100dc5780639215abb01461048e57806395d89b41146104ac57806397a23caf146104ca578063a9059cbb146104e8576101ee565b806375f0a8741461041a57806383f05489146104385780638da5cb5b1461045457806391e0e5ac14610472576101ee565b8063313ce56711610185578063599270441161015457806359927044146103a4578063665a11ca146103c257806370a08231146103e0578063715018a614610410576101ee565b8063313ce567146103145780633fa58f0d14610332578063409e22051461035057806351c6590a14610388576101ee565b806316345f18116101c157806316345f181461027857806318160ddd146102a85780631be05289146102c657806323b872dd146102e4576101ee565b806302f126e8146101f257806306fdde031461020e578063095ea7b31461022c5780630a861f2a1461025c575b5f80fd5b61020c60048036038101906102079190612031565b610622565b005b610216610748565b60405161022391906120cc565b60405180910390f35b61024660048036038101906102419190612146565b6107d8565b604051610253919061219e565b60405180910390f35b61027660048036038101906102719190612031565b6107fa565b005b610292600480360381019061028d91906121b7565b61088e565b60405161029f91906121f1565b60405180910390f35b6102b0610a1d565b6040516102bd91906121f1565b60405180910390f35b6102ce610a26565b6040516102db91906121f1565b60405180910390f35b6102fe60048036038101906102f9919061220a565b610a2d565b60405161030b919061219e565b60405180910390f35b61031c610a5b565b6040516103299190612275565b60405180910390f35b61033a610a63565b60405161034791906121f1565b60405180910390f35b61036a60048036038101906103659190612031565b610a69565b60405161037f9998979695949392919061229d565b60405180910390f35b6103a2600480360381019061039d9190612031565b610b0a565b005b6103ac610b59565b6040516103b99190612328565b60405180910390f35b6103ca610b7e565b6040516103d791906121f1565b60405180910390f35b6103fa60048036038101906103f591906121b7565b610b84565b60405161040791906121f1565b60405180910390f35b610418610bc9565b005b610422610bdc565b60405161042f9190612328565b60405180910390f35b610452600480360381019061044d919061236b565b610c01565b005b61045c610f88565b6040516104699190612328565b60405180910390f35b61048c60048036038101906104879190612031565b610fb0565b005b610496611059565b6040516104a391906121f1565b60405180910390f35b6104b461105f565b6040516104c191906120cc565b60405180910390f35b6104d26110ef565b6040516104df9190612328565b60405180910390f35b61050260048036038101906104fd9190612146565b611114565b60405161050f919061219e565b60405180910390f35b610532600480360381019061052d91906121b7565b611136565b60405161053f9190612328565b60405180910390f35b610550611166565b60405161055d9190612328565b60405180910390f35b610580600480360381019061057b91906123e2565b61118b565b60405161058d91906121f1565b60405180910390f35b6105b060048036038101906105ab91906123e2565b61120d565b005b6105cc60048036038101906105c791906121b7565b6112cd565b005b6105e860048036038101906105e39190612031565b611351565b005b61060460048036038101906105ff9190612031565b611672565b005b610620600480360381019061061b91906121b7565b611795565b005b5f60065f8381526020019081526020015f209050806007015f9054906101000a900460ff1615610687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067e9061246a565b60405180910390fd5b80600301544210156106ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c5906124d2565b60405180910390fd5b5f816004015490508060095f8282546106e7919061251d565b925050819055506001826007015f6101000a81548160ff0219169083151502179055507f8f6544d8c78d9fd78b90ea27e3776ac292537f551e436784cc8d0a3a2ea9d0b8838260405161073b929190612550565b60405180910390a1505050565b606060038054610757906125a4565b80601f0160208091040260200160405190810160405280929190818152602001828054610783906125a4565b80156107ce5780601f106107a5576101008083540402835291602001916107ce565b820191905f5260205f20905b8154815290600101906020018083116107b157829003601f168201915b5050505050905090565b5f806107e26117e0565b90506107ef8185856117e7565b600191505092915050565b6108026117f9565b600954811115610847576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083e9061261e565b60405180910390fd5b8060095f828254610858919061263c565b9250508190555061088b600c5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff163383611880565b50565b5f8060075f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361095d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610954906126df565b60405180910390fd5b5f8173ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156109a7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109cb9190612783565b5050509150505f8113610a13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0a90612844565b60405180910390fd5b8092505050919050565b5f600254905090565b6201518081565b5f80610a376117e0565b9050610a44858285611970565b610a4f858585611880565b60019150509392505050565b5f6012905090565b600a5481565b6006602052805f5260405f205f91509050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160149054906101000a900460ff1690806002015490806003015490806004015490806005015490806006015490806007015f9054906101000a900460ff16905089565b610b126117f9565b610b3e33600c5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683611880565b8060095f828254610b4f919061251d565b9250508190555050565b600d5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60095481565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b610bd16117f9565b610bda5f611a02565b565b600e5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f73ffffffffffffffffffffffffffffffffffffffff1660075f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610ccb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc2906128ac565b60405180910390fd5b5f610cd58661088e565b9050848015610ce357508084115b80610cf7575084158015610cf657508084105b5b610d36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2d90612914565b60405180910390fd5b5f6201518042610d46919061251d565b90506040518061012001604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff16815260200187151581526020018681526020018281526020018581526020014281526020018481526020015f151581525060065f60085481526020019081526020015f205f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160010160146101000a81548160ff021916908315150217905550606082015181600201556080820151816003015560a0820151816004015560c0820151816005015560e08201518160060155610100820151816007015f6101000a81548160ff021916908315150217905550905050610ed5333086611880565b8360095f828254610ee6919061251d565b9250508190555083600a5f828254610efe919061251d565b92505081905550610f0e84611ac5565b3373ffffffffffffffffffffffffffffffffffffffff167f787e08f26e24bb9fe5e74ec9bb25b30bd02a4b04ffd57c029baff414dbec5b6e600854898989868a604051610f6096959493929190612932565b60405180910390a260085f815480929190610f7a90612991565b919050555050505050505050565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610fb86117f9565b600954811115610ffd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff490612a22565b60405180910390fd5b8060095f82825461100e919061263c565b9250508190555061101f3082611b93565b7f7aac7a383ff58b472cb2a2f854a353ef5a4e24974a55702380a17b8587d15a278160405161104e91906121f1565b60405180910390a150565b60085481565b60606004805461106e906125a4565b80601f016020809104026020016040519081016040528092919081815260200182805461109a906125a4565b80156110e55780601f106110bc576101008083540402835291602001916110e5565b820191905f5260205f20905b8154815290600101906020018083116110c857829003601f168201915b5050505050905090565b600b5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f8061111e6117e0565b905061112b818585611880565b600191505092915050565b6007602052805f5260405f205f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b6112156117f9565b8060075f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f2940c4bfb544a4b0a5b4262767947b0acc0b8f144197528463c4d476658cff7982826040516112c1929190612a40565b60405180910390a15050565b6112d56117f9565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611345575f6040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161133c9190612328565b60405180910390fd5b61134e81611a02565b50565b5f60065f8381526020019081526020015f209050806007015f9054906101000a900460ff16156113b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ad9061246a565b60405180910390fd5b805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143d90612ab1565b60405180910390fd5b8060030154421061148c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148390612b19565b60405180910390fd5b5f6114b9826001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661088e565b90505f8260010160149054906101000a900460ff1680156114dd5750826002015482115b15611517576305f5e10083600601548460020154846114fc919061263c565b6115069190612b37565b6115109190612ba5565b90506115af565b8260010160149054906101000a900460ff161580156115395750826002015482105b15611573576305f5e1008360060154838560020154611558919061263c565b6115629190612b37565b61156c9190612ba5565b90506115ae565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a590612c1f565b60405180910390fd5b5b6009548111156115f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115eb90612c87565b60405180910390fd5b8060095f828254611605919061263c565b92505081905550611617303383611880565b6001836007015f6101000a81548160ff0219169083151502179055507f709a635a5462396a92927c659d5d8a7f96393228713769a8f62818093d8296c48482604051611664929190612550565b60405180910390a150505050565b600b5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611701576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f890612cef565b60405180910390fd5b5f8111611743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173a90612d57565b60405180910390fd5b8060095f828254611754919061251d565b925050819055507fc3dff9ec2a9266191f204f1e39b6d5cebfc2c3d718964dd6699f5e8e6d010fb08160405161178a91906121f1565b60405180910390a150565b61179d6117f9565b80600b5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f33905090565b6117f48383836001611c12565b505050565b6118016117e0565b73ffffffffffffffffffffffffffffffffffffffff1661181f610f88565b73ffffffffffffffffffffffffffffffffffffffff161461187e576118426117e0565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016118759190612328565b60405180910390fd5b565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036118f0575f6040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016118e79190612328565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611960575f6040517fec442f050000000000000000000000000000000000000000000000000000000081526004016119579190612328565b60405180910390fd5b61196b838383611de1565b505050565b5f61197b848461118b565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146119fc57818110156119ed578281836040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526004016119e493929190612d75565b60405180910390fd5b6119fb84848484035f611c12565b5b50505050565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f6064600583611ad59190612b37565b611adf9190612ba5565b90505f6064600384611af19190612b37565b611afb9190612ba5565b9050611b2930600d5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611880565b611b5530600e5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683611880565b7f40d8c854b6d5329fd5fccae04f5a931d7529963fbab81aced7337394e737cb4d8282604051611b86929190612550565b60405180910390a1505050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611c03575f6040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401611bfa9190612328565b60405180910390fd5b611c0e825f83611de1565b5050565b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611c82575f6040517fe602df05000000000000000000000000000000000000000000000000000000008152600401611c799190612328565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611cf2575f6040517f94280d62000000000000000000000000000000000000000000000000000000008152600401611ce99190612328565b60405180910390fd5b8160015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508015611ddb578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051611dd291906121f1565b60405180910390a35b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611e31578060025f828254611e25919061251d565b92505081905550611eff565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905081811015611eba578381836040517fe450d38c000000000000000000000000000000000000000000000000000000008152600401611eb193929190612d75565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550505b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611f46578060025f8282540392505081905550611f90565b805f808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611fed91906121f1565b60405180910390a3505050565b5f80fd5b5f819050919050565b61201081611ffe565b811461201a575f80fd5b50565b5f8135905061202b81612007565b92915050565b5f6020828403121561204657612045611ffa565b5b5f6120538482850161201d565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61209e8261205c565b6120a88185612066565b93506120b8818560208601612076565b6120c181612084565b840191505092915050565b5f6020820190508181035f8301526120e48184612094565b905092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f612115826120ec565b9050919050565b6121258161210b565b811461212f575f80fd5b50565b5f813590506121408161211c565b92915050565b5f806040838503121561215c5761215b611ffa565b5b5f61216985828601612132565b925050602061217a8582860161201d565b9150509250929050565b5f8115159050919050565b61219881612184565b82525050565b5f6020820190506121b15f83018461218f565b92915050565b5f602082840312156121cc576121cb611ffa565b5b5f6121d984828501612132565b91505092915050565b6121eb81611ffe565b82525050565b5f6020820190506122045f8301846121e2565b92915050565b5f805f6060848603121561222157612220611ffa565b5b5f61222e86828701612132565b935050602061223f86828701612132565b92505060406122508682870161201d565b9150509250925092565b5f60ff82169050919050565b61226f8161225a565b82525050565b5f6020820190506122885f830184612266565b92915050565b6122978161210b565b82525050565b5f610120820190506122b15f83018c61228e565b6122be602083018b61228e565b6122cb604083018a61218f565b6122d860608301896121e2565b6122e560808301886121e2565b6122f260a08301876121e2565b6122ff60c08301866121e2565b61230c60e08301856121e2565b61231a61010083018461218f565b9a9950505050505050505050565b5f60208201905061233b5f83018461228e565b92915050565b61234a81612184565b8114612354575f80fd5b50565b5f8135905061236581612341565b92915050565b5f805f805f60a0868803121561238457612383611ffa565b5b5f61239188828901612132565b95505060206123a288828901612357565b94505060406123b38882890161201d565b93505060606123c48882890161201d565b92505060806123d58882890161201d565b9150509295509295909350565b5f80604083850312156123f8576123f7611ffa565b5b5f61240585828601612132565b925050602061241685828601612132565b9150509250929050565b7f4f7074696f6e20616c726561647920736574746c6564000000000000000000005f82015250565b5f612454601683612066565b915061245f82612420565b602082019050919050565b5f6020820190508181035f83015261248181612448565b9050919050565b7f4f7074696f6e206e6f74207965742065787069726564000000000000000000005f82015250565b5f6124bc601683612066565b91506124c782612488565b602082019050919050565b5f6020820190508181035f8301526124e9816124b0565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61252782611ffe565b915061253283611ffe565b925082820190508082111561254a576125496124f0565b5b92915050565b5f6040820190506125635f8301856121e2565b61257060208301846121e2565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806125bb57607f821691505b6020821081036125ce576125cd612577565b5b50919050565b7f416d6f756e742065786365656473206c697175696469747920706f6f6c0000005f82015250565b5f612608601d83612066565b9150612613826125d4565b602082019050919050565b5f6020820190508181035f830152612635816125fc565b9050919050565b5f61264682611ffe565b915061265183611ffe565b9250828203905081811115612669576126686124f0565b5b92915050565b7f50726963652066656564206e6f7420617661696c61626c6520666f72207468695f8201527f7320746f6b656e00000000000000000000000000000000000000000000000000602082015250565b5f6126c9602783612066565b91506126d48261266f565b604082019050919050565b5f6020820190508181035f8301526126f6816126bd565b9050919050565b5f69ffffffffffffffffffff82169050919050565b61271b816126fd565b8114612725575f80fd5b50565b5f8151905061273681612712565b92915050565b5f819050919050565b61274e8161273c565b8114612758575f80fd5b50565b5f8151905061276981612745565b92915050565b5f8151905061277d81612007565b92915050565b5f805f805f60a0868803121561279c5761279b611ffa565b5b5f6127a988828901612728565b95505060206127ba8882890161275b565b94505060406127cb8882890161276f565b93505060606127dc8882890161276f565b92505060806127ed88828901612728565b9150509295509295909350565b7f496e76616c6964207072696365000000000000000000000000000000000000005f82015250565b5f61282e600d83612066565b9150612839826127fa565b602082019050919050565b5f6020820190508181035f83015261285b81612822565b9050919050565b7f556e737570706f7274656420746f6b656e0000000000000000000000000000005f82015250565b5f612896601183612066565b91506128a182612862565b602082019050919050565b5f6020820190508181035f8301526128c38161288a565b9050919050565b7f496e76616c696420737472696b652070726963650000000000000000000000005f82015250565b5f6128fe601483612066565b9150612909826128ca565b602082019050919050565b5f6020820190508181035f83015261292b816128f2565b9050919050565b5f60c0820190506129455f8301896121e2565b612952602083018861228e565b61295f604083018761218f565b61296c60608301866121e2565b61297960808301856121e2565b61298660a08301846121e2565b979650505050505050565b5f61299b82611ffe565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036129cd576129cc6124f0565b5b600182019050919050565b7f4e6f7420656e6f756768206c69717569646974790000000000000000000000005f82015250565b5f612a0c601483612066565b9150612a17826129d8565b602082019050919050565b5f6020820190508181035f830152612a3981612a00565b9050919050565b5f604082019050612a535f83018561228e565b612a60602083018461228e565b9392505050565b7f4e6f7420746865206f7074696f6e2062757965720000000000000000000000005f82015250565b5f612a9b601483612066565b9150612aa682612a67565b602082019050919050565b5f6020820190508181035f830152612ac881612a8f565b9050919050565b7f4f7074696f6e20657870697265640000000000000000000000000000000000005f82015250565b5f612b03600e83612066565b9150612b0e82612acf565b602082019050919050565b5f6020820190508181035f830152612b3081612af7565b9050919050565b5f612b4182611ffe565b9150612b4c83611ffe565b9250828202612b5a81611ffe565b91508282048414831517612b7157612b706124f0565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612baf82611ffe565b9150612bba83611ffe565b925082612bca57612bc9612b78565b5b828204905092915050565b7f4f7074696f6e206e6f7420696e20746865206d6f6e65790000000000000000005f82015250565b5f612c09601783612066565b9150612c1482612bd5565b602082019050919050565b5f6020820190508181035f830152612c3681612bfd565b9050919050565b7f496e73756666696369656e74206c6971756964697479000000000000000000005f82015250565b5f612c71601683612066565b9150612c7c82612c3d565b602082019050919050565b5f6020820190508181035f830152612c9e81612c65565b9050919050565b7f4e6f74207468652061726269747261676520626f7400000000000000000000005f82015250565b5f612cd9601583612066565b9150612ce482612ca5565b602082019050919050565b5f6020820190508181035f830152612d0681612ccd565b9050919050565b7f50726f666974206d75737420626520706f7369746976650000000000000000005f82015250565b5f612d41601783612066565b9150612d4c82612d0d565b602082019050919050565b5f6020820190508181035f830152612d6e81612d35565b9050919050565b5f606082019050612d885f83018661228e565b612d9560208301856121e2565b612da260408301846121e2565b94935050505056fea2646970667358221220ee215ccb751646d8c60bc849b703c550dc83df776e9680b11e919ceb7f94981b64736f6c634300081a0033

Verified Source Code Full Match

Compiler: v0.8.26+commit.8a97fa7a EVM: cancun Optimization: No
AggregatorV3Interface.sol 19 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface AggregatorV3Interface {
  function decimals() external view returns (uint8);

  function description() external view returns (string memory);

  function version() external view returns (uint256);

  function getRoundData(
    uint80 _roundId
  ) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);

  function latestRoundData()
    external
    view
    returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

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

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
draft-IERC6093.sol 161 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC-20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC-721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC-1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
ERC20.sol 312 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./extensions/IERC20Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC-20
 * applications.
 */
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
    mapping(address account => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

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

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

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

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

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

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

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, value);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Skips emitting an {Approval} event indicating an allowance update. This is not
     * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `value`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `value`.
     */
    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, value);
        _transfer(from, to, value);
        return true;
    }

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _transfer(address from, address to, uint256 value) internal {
        if (from == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        if (to == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(from, to, value);
    }

    /**
     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
     * this function.
     *
     * Emits a {Transfer} event.
     */
    function _update(address from, address to, uint256 value) internal virtual {
        if (from == address(0)) {
            // Overflow check required: The rest of the code assumes that totalSupply never overflows
            _totalSupply += value;
        } else {
            uint256 fromBalance = _balances[from];
            if (fromBalance < value) {
                revert ERC20InsufficientBalance(from, fromBalance, value);
            }
            unchecked {
                // Overflow not possible: value <= fromBalance <= totalSupply.
                _balances[from] = fromBalance - value;
            }
        }

        if (to == address(0)) {
            unchecked {
                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
                _totalSupply -= value;
            }
        } else {
            unchecked {
                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
                _balances[to] += value;
            }
        }

        emit Transfer(from, to, value);
    }

    /**
     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
     * Relies on the `_update` mechanism
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _mint(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(address(0), account, value);
    }

    /**
     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
     * Relies on the `_update` mechanism.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead
     */
    function _burn(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        _update(account, address(0), value);
    }

    /**
     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address owner, address spender, uint256 value) internal {
        _approve(owner, spender, value, true);
    }

    /**
     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
     *
     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
     * `Approval` event during `transferFrom` operations.
     *
     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
     * true using the following override:
     *
     * ```solidity
     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
     *     super._approve(owner, spender, value, true);
     * }
     * ```
     *
     * Requirements are the same as {_approve}.
     */
    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
        if (owner == address(0)) {
            revert ERC20InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert ERC20InvalidSpender(address(0));
        }
        _allowances[owner][spender] = value;
        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `value`.
     *
     * Does not update the allowance value in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Does not emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            if (currentAllowance < value) {
                revert ERC20InsufficientAllowance(spender, currentAllowance, value);
            }
            unchecked {
                _approve(owner, spender, currentAllowance - value, false);
            }
        }
    }
}
IERC20.sol 79 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}
IERC20Metadata.sol 26 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC-20 standard.
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}
OptionToken.sol 188 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract CryptoOptionsLiquidity is ERC20, Ownable (msg.sender) {
    struct Option {
        address buyer;
        address token; // Underlying token
        bool isCall; // True for call, false for put
        uint strikePrice; // Strike price in USD (8 decimals from Chainlink)
        uint expiration; 
        uint premium; // Premium paid in base tokens
        uint purchaseTime; 
        uint amount; // Amount of the underlying asset covered by the option
        bool settled; 
    }

    mapping(uint => Option) public options;
    mapping(address => address) public tokenPriceFeeds; 
    uint public nextOptionId;
    uint public constant DURATION = 24 hours;

    uint public liquidityPool; 
    uint public totalTradeVolume; 
    address public arbitrageBot; 

    
    address public liquidityWallet = 0x0c69046D60029698b8Fb73Cb49ba86d87d01A7Ae;
    address public teamWallet = 0x47029d1C90B3C2769370358a944Aab9d723979e9;
    address public marketingWallet = 0x3Bd82BB28bf469E6c61C1176432A31EcBDC4C447;

    event OptionCreated(uint optionId, address indexed buyer, address token, bool isCall, uint strikePrice, uint expiration, uint premium);
    event OptionExercised(uint optionId, uint payout);
    event OptionExpired(uint optionId, uint convertedLiquidity);
    event PriceFeedAdded(address token, address priceFeed);
    event ArbitrageExecuted(uint profit);
    event LiquidityBoost(uint amount);
    event FundsDistributed(uint teamShare, uint marketingShare);

    constructor() ERC20("CryptoOptionsToken", "OPTIONS") {
        _mint(msg.sender, 1_000_000_000 * 10 ** decimals()); 
        liquidityPool = 500_000_000 * 10 ** decimals(); 
    }

    modifier onlyArbitrageBot() {
        require(msg.sender == arbitrageBot, "Not the arbitrage bot");
        _;
    }

    function setArbitrageBot(address _bot) external onlyOwner {
        arbitrageBot = _bot;
    }

    
    function addPriceFeed(address token, address priceFeed) external onlyOwner {
        tokenPriceFeeds[token] = priceFeed;
        emit PriceFeedAdded(token, priceFeed);
    }

    
    function getLatestPrice(address token) public view returns (uint) {
        address priceFeed = tokenPriceFeeds[token];
        require(priceFeed != address(0), "Price feed not available for this token");
        (, int price, , , ) = AggregatorV3Interface(priceFeed).latestRoundData();
        require(price > 0, "Invalid price");
        return uint(price); 
    }

    
    function createOption(
        address token,
        bool isCall,
        uint strikePrice,
        uint premium,
        uint amount
    ) external {
        require(tokenPriceFeeds[token] != address(0), "Unsupported token");
        uint currentPrice = getLatestPrice(token);
        require(
            (isCall && strikePrice > currentPrice) || (!isCall && strikePrice < currentPrice),
            "Invalid strike price"
        );

        uint expiration = block.timestamp + DURATION;

        options[nextOptionId] = Option({
            buyer: msg.sender,
            token: token,
            isCall: isCall,
            strikePrice: strikePrice,
            expiration: expiration,
            premium: premium,
            purchaseTime: block.timestamp,
            amount: amount,
            settled: false
        });

        _transfer(msg.sender, address(this), premium);
        liquidityPool += premium;
        totalTradeVolume += premium;

        distributeFunds(premium);

        emit OptionCreated(nextOptionId, msg.sender, token, isCall, strikePrice, expiration, premium);
        nextOptionId++;
    }

    
    function exerciseOption(uint optionId) external {
        Option storage option = options[optionId];
        require(!option.settled, "Option already settled");
        require(msg.sender == option.buyer, "Not the option buyer");
        require(block.timestamp < option.expiration, "Option expired");

        uint currentPrice = getLatestPrice(option.token);
        uint payout;

        if (option.isCall && currentPrice > option.strikePrice) {
            payout = (currentPrice - option.strikePrice) * option.amount / 1e8;
        } else if (!option.isCall && currentPrice < option.strikePrice) {
            payout = (option.strikePrice - currentPrice) * option.amount / 1e8;
        } else {
            revert("Option not in the money");
        }

        require(payout <= liquidityPool, "Insufficient liquidity");
        liquidityPool -= payout;
        _transfer(address(this), msg.sender, payout);

        option.settled = true;
        emit OptionExercised(optionId, payout);
    }

    
    function expireOption(uint optionId) external {
        Option storage option = options[optionId];
        require(!option.settled, "Option already settled");
        require(block.timestamp >= option.expiration, "Option not yet expired");

        uint convertedLiquidity = option.premium;
        liquidityPool += convertedLiquidity;

        option.settled = true;
        emit OptionExpired(optionId, convertedLiquidity);
    }

    
    function executeArbitrage(uint profit) external onlyArbitrageBot {
        require(profit > 0, "Profit must be positive");
        liquidityPool += profit;
        emit ArbitrageExecuted(profit);
    }

    
    function boostLiquidity(uint amount) external onlyOwner {
        require(amount <= liquidityPool, "Not enough liquidity");
        liquidityPool -= amount;
        _burn(address(this), amount);
        emit LiquidityBoost(amount);
    }

    
    function addLiquidity(uint amount) external onlyOwner {
        _transfer(msg.sender, liquidityWallet, amount);
        liquidityPool += amount;
    }

    
    function withdrawLiquidity(uint amount) external onlyOwner {
        require(amount <= liquidityPool, "Amount exceeds liquidity pool");
        liquidityPool -= amount;
        _transfer(liquidityWallet, msg.sender, amount);
    }

    
    function distributeFunds(uint amount) internal {
        uint teamShare = (amount * 5) / 100; 
        uint marketingShare = (amount * 3) / 100; 

        _transfer(address(this), teamWallet, teamShare);
        _transfer(address(this), marketingWallet, marketingShare);

        emit FundsDistributed(teamShare, marketingShare);
    }
}

Read Contract

DURATION 0x1be05289 → uint256
allowance 0xdd62ed3e → uint256
arbitrageBot 0x97a23caf → address
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
getLatestPrice 0x16345f18 → uint256
liquidityPool 0x665a11ca → uint256
liquidityWallet 0xd4698016 → address
marketingWallet 0x75f0a874 → address
name 0x06fdde03 → string
nextOptionId 0x9215abb0 → uint256
options 0x409e2205 → address, address, bool, uint256, uint256, uint256, uint256, uint256, bool
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
teamWallet 0x59927044 → address
tokenPriceFeeds 0xbd9c47e3 → address
totalSupply 0x18160ddd → uint256
totalTradeVolume 0x3fa58f0d → uint256

Write Contract 14 functions

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

addLiquidity 0x51c6590a
uint256 amount
addPriceFeed 0xe8a97a3e
address token
address priceFeed
approve 0x095ea7b3
address spender
uint256 value
returns: bool
boostLiquidity 0x91e0e5ac
uint256 amount
createOption 0x83f05489
address token
bool isCall
uint256 strikePrice
uint256 premium
uint256 amount
executeArbitrage 0xf7c7724f
uint256 profit
exerciseOption 0xf52f2526
uint256 optionId
expireOption 0x02f126e8
uint256 optionId
renounceOwnership 0x715018a6
No parameters
setArbitrageBot 0xfb5f4b69
address _bot
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
withdrawLiquidity 0x0a861f2a
uint256 amount

Recent Transactions

No transactions found for this address