Address Contract Partially Verified
Address
0x29Cff1aB6d4F7FA8c27eBF640808622983f32488
Balance
0 ETH
Nonce
1
Code Size
20460 bytes
Creator
0x32a691b6...Be87 at tx 0x1f316a77...d6711d
Indexed Transactions
0
Contract Bytecode
20460 bytes
0x6080604052600436106102b1575f3560e01c80638144ec0c11610174578063b88d4fde116100db578063d547cfb711610094578063e30c39781161006e578063e30c397814610a8a578063e985e9c514610ab4578063f2fde38b14610af0578063fbf6eaa514610b18576102b8565b8063d547cfb7146109fc578063dd62ed3e14610a26578063e0df5b6f14610a62576102b8565b8063b88d4fde146108f4578063bb8c3ee01461091c578063c024666814610946578063c492f0461461096e578063c816841b14610996578063c87b56dd146109c0576102b8565b80639b19251a1161012d5780639b19251a146107c8578063a22cb46514610804578063a4de3c191461082c578063a9059cbb14610854578063aacebbe314610890578063b62496f5146108b8576102b8565b80638144ec0c146106c05780638768a9cd146106e85780638da5cb5b14610724578063908bb2ae1461074e57806395d89b41146107765780639a7a23d6146107a0576102b8565b806353d6fd591161021857806370a08231116101d157806370a08231146105da578063715018a614610616578063735de9f71461062c57806375f0a8741461065657806379ba5097146106805780637a49325114610696576102b8565b806353d6fd59146104d057806357e871e7146104f85780635c975abb146105225780636352211e1461054c57806365048d081461058857806368b4cac9146105b2576102b8565b80632740c1971161026a5780632740c197146103da578063313ce56714610402578063423ce9cc1461042c57806342842e0e146104565780634f02c4201461047e578063504334c2146104a8576102b8565b806306fdde03146102bc578063081812fc146102e6578063095ea7b31461032257806318160ddd1461035e578063201e908e1461038857806323b872dd146103b2576102b8565b366102b857005b5f80fd5b3480156102c7575f80fd5b506102d0610b2e565b6040516102dd9190613cfd565b60405180910390f35b3480156102f1575f80fd5b5061030c60048036038101906103079190613d61565b610bba565b6040516103199190613dcb565b60405180910390f35b34801561032d575f80fd5b5061034860048036038101906103439190613e0e565b610bea565b6040516103559190613e66565b60405180910390f35b348015610369575f80fd5b50610372610ed1565b60405161037f9190613e8e565b60405180910390f35b348015610393575f80fd5b5061039c610ef5565b6040516103a99190613e8e565b60405180910390f35b3480156103bd575f80fd5b506103d860048036038101906103d39190613ea7565b610efb565b005b3480156103e5575f80fd5b5061040060048036038101906103fb9190613ef7565b6116f2565b005b34801561040d575f80fd5b5061041661170c565b6040516104239190613f50565b60405180910390f35b348015610437575f80fd5b50610440611730565b60405161044d9190613e66565b60405180910390f35b348015610461575f80fd5b5061047c60048036038101906104779190613ea7565b611743565b005b348015610489575f80fd5b50610492611872565b60405161049f9190613e8e565b60405180910390f35b3480156104b3575f80fd5b506104ce60048036038101906104c99190614095565b611878565b005b3480156104db575f80fd5b506104f660048036038101906104f19190614135565b61188e565b005b348015610503575f80fd5b5061050c6118ee565b6040516105199190613e8e565b60405180910390f35b34801561052d575f80fd5b506105366118f4565b6040516105439190613e66565b60405180910390f35b348015610557575f80fd5b50610572600480360381019061056d9190613d61565b611909565b60405161057f9190613dcb565b60405180910390f35b348015610593575f80fd5b5061059c6119a7565b6040516105a99190613e8e565b60405180910390f35b3480156105bd575f80fd5b506105d860048036038101906105d39190614173565b6119ad565b005b3480156105e5575f80fd5b5061060060048036038101906105fb919061419e565b611a09565b60405161060d9190613e8e565b60405180910390f35b348015610621575f80fd5b5061062a611a1e565b005b348015610637575f80fd5b50610640611a31565b60405161064d9190614224565b60405180910390f35b348015610661575f80fd5b5061066a611a56565b604051610677919061425d565b60405180910390f35b34801561068b575f80fd5b50610694611a7b565b005b3480156106a1575f80fd5b506106aa611b09565b6040516106b79190613e8e565b60405180910390f35b3480156106cb575f80fd5b506106e660048036038101906106e19190613d61565b611b0f565b005b3480156106f3575f80fd5b5061070e6004803603810190610709919061419e565b611b5a565b60405161071b9190613e66565b60405180910390f35b34801561072f575f80fd5b50610738611b77565b6040516107459190613dcb565b60405180910390f35b348015610759575f80fd5b50610774600480360381019061076f919061419e565b611b9e565b005b348015610781575f80fd5b5061078a6120ed565b6040516107979190613cfd565b60405180910390f35b3480156107ab575f80fd5b506107c660048036038101906107c19190614135565b612179565b005b3480156107d3575f80fd5b506107ee60048036038101906107e9919061419e565b61218f565b6040516107fb9190613e66565b60405180910390f35b34801561080f575f80fd5b5061082a60048036038101906108259190614135565b6121ac565b005b348015610837575f80fd5b50610852600480360381019061084d9190614135565b6122a4565b005b34801561085f575f80fd5b5061087a60048036038101906108759190613e0e565b612352565b6040516108879190613e66565b60405180910390f35b34801561089b575f80fd5b506108b660048036038101906108b1919061419e565b612366565b005b3480156108c3575f80fd5b506108de60048036038101906108d9919061419e565b6123b1565b6040516108eb9190613e66565b60405180910390f35b3480156108ff575f80fd5b5061091a600480360381019061091591906142d3565b6123ce565b005b348015610927575f80fd5b50610930612503565b60405161093d9190613e8e565b60405180910390f35b348015610951575f80fd5b5061096c60048036038101906109679190614135565b612509565b005b348015610979575f80fd5b50610994600480360381019061098f91906143ac565b6125b7565b005b3480156109a1575f80fd5b506109aa612695565b6040516109b79190613dcb565b60405180910390f35b3480156109cb575f80fd5b506109e660048036038101906109e19190613d61565b6126ba565b6040516109f39190613cfd565b60405180910390f35b348015610a07575f80fd5b50610a10612718565b604051610a1d9190613cfd565b60405180910390f35b348015610a31575f80fd5b50610a4c6004803603810190610a479190614409565b6127a4565b604051610a599190613e8e565b60405180910390f35b348015610a6d575f80fd5b50610a886004803603810190610a839190614447565b6127c4565b005b348015610a95575f80fd5b50610a9e6127df565b604051610aab9190613dcb565b60405180910390f35b348015610abf575f80fd5b50610ada6004803603810190610ad59190614409565b612807565b604051610ae79190613e66565b60405180910390f35b348015610afb575f80fd5b50610b166004803603810190610b11919061419e565b612831565b005b348015610b23575f80fd5b50610b2c6128dd565b005b60028054610b3b906144bb565b80601f0160208091040260200160405190810160405280929190818152602001828054610b67906144bb565b8015610bb25780601f10610b8957610100808354040283529160200191610bb2565b820191905f5260205f20905b815481529060010190602001808311610b9557829003601f168201915b505050505081565b6007602052805f5260405f205f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f6004548211158015610bfc57505f82115b15610de4575f60095f8481526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015610cf3575060085f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b15610d2a576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8360075f8581526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051610dd69190613e8e565b60405180910390a350610ec7565b8160065f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610ebe9190613e8e565b60405180910390a35b6001905092915050565b7f00000000000000000000000000000000000000000000003627e8f712373c000081565b601a5481565b60045481116115b35760095f8281526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610f99576040517fddb5de5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ffe576040517f9c8d2cd200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156110bc575060085f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b8015611124575060075f8281526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561115b576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111636128ee565b60055f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8282546111ae9190614518565b925050819055506111bd6128ee565b60055f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055508160095f8381526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060075f8281526020019081526020015f205f6101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555f600a5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206001600a5f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490506113139190614518565b815481106113245761132361454b565b5b905f5260205f200154905080600a5f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20600b5f8581526020019081526020015f2054815481106113905761138f61454b565b5b905f5260205f200181905550600a5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208054806113e9576113e8614578565b5b600190038181905f5260205f20015f90559055600b5f8381526020019081526020015f2054600b5f8381526020019081526020015f2081905550600a5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2082908060018154018082558091505060019003905f5260205f20015f90919091909150556001600a5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490506114d19190614518565b600b5f8481526020019081526020015f2081905550818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a48273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fe59fdd36d0d223c0c7d996db7ad796880f45e1936cb0bb7ac102e7082e0314876115986128ee565b6040516115a59190613e8e565b60405180910390a3506116ed565b5f60065f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205490507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146116df5781816116629190614518565b60065f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055505b6116ea848484612921565b50505b505050565b6116fa612cee565b81601481905550806015819055505050565b7f000000000000000000000000000000000000000000000000000000000000001281565b601160159054906101000a900460ff1681565b61174e838383610efb565b5f8273ffffffffffffffffffffffffffffffffffffffff163b14158015611836575063150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168273ffffffffffffffffffffffffffffffffffffffff1663150b7a023386856040518463ffffffff1660e01b81526004016117d4939291906145d8565b6020604051808303815f875af11580156117f0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118149190614675565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614155b1561186d576040517f3da6393100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b60045481565b611880612cee565b61188a8282612d75565b5050565b611896612cee565b80600c5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505050565b60195481565b5f600d5f9054906101000a900460ff16905090565b5f60095f8381526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036119a2576040517fc5723b5100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b60155481565b6119b5612cee565b80601160156101000a81548160ff0219169083151502179055507f701507a13d5701687328d70ea5a717a33a062f46c229a785b315fb4517fef069816040516119fe9190613e66565b60405180910390a150565b6005602052805f5260405f205f915090505481565b611a26612cee565b611a2f5f612d99565b565b60105f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60125f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f611a84612dc9565b90508073ffffffffffffffffffffffffffffffffffffffff16611aa56127df565b73ffffffffffffffffffffffffffffffffffffffff1614611afd57806040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401611af49190613dcb565b60405180910390fd5b611b0681612d99565b50565b60135481565b611b17612cee565b806013819055507f4fbe9e6627324d6e978a35ce6052f4445d8b166102b1901a17da2cec33af62fc601354604051611b4f9190613e8e565b60405180910390a150565b6017602052805f5260405f205f915054906101000a900460ff1681565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611ba6612cee565b60105f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2c90614710565b60405180910390fd5b60105f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fb6bf376037f707ef439f1e5e56d7987d6b0c55798fe21ff475fd00b1f37ed92060405160405180910390a38060105f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505f60105f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d5b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d7f9190614742565b73ffffffffffffffffffffffffffffffffffffffff1663e6a439053060105f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e05573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e299190614742565b6040518363ffffffff1660e01b8152600401611e4692919061476d565b602060405180830381865afa158015611e61573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e859190614742565b90505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036120525760105f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f24573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f489190614742565b73ffffffffffffffffffffffffffffffffffffffff1663c9c653963060105f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611fce573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ff29190614742565b6040518363ffffffff1660e01b815260040161200f92919061476d565b6020604051808303815f875af115801561202b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061204f9190614742565b90505b61207d60115f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff165f612dd0565b8060115f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506120e960115f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001612dd0565b5050565b600380546120fa906144bb565b80601f0160208091040260200160405190810160405280929190818152602001828054612126906144bb565b80156121715780601f1061214857610100808354040283529160200191612171565b820191905f5260205f20905b81548152906001019060200180831161215457829003601f168201915b505050505081565b612181612cee565b61218b8282612dd0565b5050565b600c602052805f5260405f205f915054906101000a900460ff1681565b8060085f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516122989190613e66565b60405180910390a35050565b6122ac612cee565b8060175f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fd3d1fab5db42ae85293059c69e12bf01ffffb1dd5ff4caa5e5568f99fc387f24826040516123469190613e66565b60405180910390a25050565b5f61235e338484612921565b905092915050565b61236e612cee565b8060125f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6018602052805f5260405f205f915054906101000a900460ff1681565b6123d9858585610efb565b5f8473ffffffffffffffffffffffffffffffffffffffff163b141580156124c5575063150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168473ffffffffffffffffffffffffffffffffffffffff1663150b7a0233888787876040518663ffffffff1660e01b81526004016124639594939291906147c0565b6020604051808303815f875af115801561247f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906124a39190614675565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614155b156124fc576040517f3da6393100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b60145481565b612511612cee565b8060165f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df7826040516125ab9190613e66565b60405180910390a25050565b6125bf612cee565b5f5b83839050811015612654578160165f8686858181106125e3576125e261454b565b5b90506020020160208101906125f8919061419e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506125c1565b507f7fdaf542373fa84f4ee8d662c642f44e4c2276a217d7d29e548b6eb29a233b35838383604051612688939291906148c8565b60405180910390a1505050565b60115f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60605f600f80546126ca906144bb565b9050116126e55760405180602001604052805f815250612711565b600f6126f083612e6e565b6040516020016127019291906149ea565b6040516020818303038152906040525b9050919050565b600f8054612725906144bb565b80601f0160208091040260200160405190810160405280929190818152602001828054612751906144bb565b801561279c5780601f106127735761010080835404028352916020019161279c565b820191905f5260205f20905b81548152906001019060200180831161277f57829003601f168201915b505050505081565b6006602052815f5260405f20602052805f5260405f205f91509150505481565b6127cc612cee565b80600f90816127db9190614b9e565b5050565b5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6008602052815f5260405f20602052805f5260405f205f915091509054906101000a900460ff1681565b612839612cee565b8060015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16612898611b77565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6128e5612cee565b43601981905550565b5f7f0000000000000000000000000000000000000000000000000000000000000012600a61291c9190614d9c565b905090565b5f61292a612f38565b601160159054906101000a900460ff1615612a42575f60055f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205490505f60135482101590508080156129a35750601160149054906101000a900460ff16155b80156129f6575060185f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b15612a3f576001601160146101000a81548160ff0219169083151502179055506013549150612a2482612f79565b5f601160146101000a81548160ff0219169083151502179055505b50505b60175f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168015612a9957505f601954145b15612aa657436019819055505b5f6001905060165f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680612b46575060165f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff165b15612b4f575f90505b8015612cd9575f60175f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680612bf1575060175f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff165b15612cd757601a5460195443612c079190614518565b11612c2c576064606385612c1b9190614de6565b612c259190614e54565b9050612cbc565b60175f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615612c9d5761271060145485612c8c9190614de6565b612c969190614e54565b9050612cbb565b61271060155485612cae9190614de6565b612cb89190614e54565b90505b5b8084612cc89190614518565b9350612cd5863083613242565b505b505b612ce4858585613242565b9150509392505050565b612cf6612dc9565b73ffffffffffffffffffffffffffffffffffffffff16612d14611b77565b73ffffffffffffffffffffffffffffffffffffffff1614612d7357612d37612dc9565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401612d6a9190613dcb565b60405180910390fd5b565b8160029081612d849190614b9e565b508060039081612d949190614b9e565b505050565b60015f6101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055612dc681613586565b50565b5f33905090565b8060185f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508015158273ffffffffffffffffffffffffffffffffffffffff167fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab60405160405180910390a35050565b60605f6001612e7c84613647565b0190505f8167ffffffffffffffff811115612e9a57612e99613f71565b5b6040519080825280601f01601f191660200182016040528015612ecc5781602001600182028036833780820191505090505b5090505f82602001820190505b600115612f2d578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581612f2257612f21614e27565b5b0494505f8503612ed9575b819350505050919050565b612f406118f4565b15612f77576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b5f600267ffffffffffffffff811115612f9557612f94613f71565b5b604051908082528060200260200182016040528015612fc35781602001602082028036833780820191505090505b50905030815f81518110612fda57612fd961454b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060105f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561307e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906130a29190614742565b816001815181106130b6576130b561454b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508160065f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f60105f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208190555060105f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947835f8460125f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518663ffffffff1660e01b8152600401613211959493929190614f5e565b5f604051808303815f87803b158015613228575f80fd5b505af115801561323a573d5f803e3d5ffd5b505050505050565b5f8061324c6128ee565b90505f60055f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205490505f60055f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205490508460055f8973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825461331c9190614518565b925050819055508460055f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8282540192505081905550600c5f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16613440575f8360055f8a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546134059190614e54565b84846134119190614e54565b61341b9190614518565b90505f5b8181101561343d5761343089613798565b808060010191505061341f565b50505b600c5f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16613513575f838261349b9190614e54565b8460055f8a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546134e49190614e54565b6134ee9190614518565b90505f5b8181101561351057613503886139dd565b80806001019150506134f2565b50505b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fe59fdd36d0d223c0c7d996db7ad796880f45e1936cb0bb7ac102e7082e031487876040516135709190613e8e565b60405180910390a3600193505050509392505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f805f90507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106136a3577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161369957613698614e27565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106136e0576d04ee2d6d415b85acef810000000083816136d6576136d5614e27565b5b0492506020810190505b662386f26fc10000831061370f57662386f26fc10000838161370557613704614e27565b5b0492506010810190505b6305f5e1008310613738576305f5e100838161372e5761372d614e27565b5b0492506008810190505b612710831061375d57612710838161375357613752614e27565b5b0492506004810190505b60648310613780576064838161377657613775614e27565b5b0492506002810190505b600a831061378f576001810190505b80915050919050565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036137fd576040517fddb5de5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f600a5f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206001600a5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490506138889190614518565b815481106138995761389861454b565b5b905f5260205f2001549050600a5f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208054806138f1576138f0614578565b5b600190038181905f5260205f20015f90559055600b5f8281526020019081526020015f205f905560095f8281526020019081526020015f205f6101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560075f8281526020019081526020015f205f6101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055805f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b6139e5612f38565b6139ee816139f1565b50565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603613a56576040517f9c8d2cd200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60045f81548092919060010191905055505f60045490505f73ffffffffffffffffffffffffffffffffffffffff1660095f8381526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613b02576040517f23369fa600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160095f8381526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a5f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081908060018154018082558091505060019003905f5260205f20015f90919091909150556001600a5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2080549050613bff9190614518565b600b5f8381526020019081526020015f2081905550808273ffffffffffffffffffffffffffffffffffffffff165f73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b5f81519050919050565b5f82825260208201905092915050565b5f5b83811015613caa578082015181840152602081019050613c8f565b5f8484015250505050565b5f601f19601f8301169050919050565b5f613ccf82613c73565b613cd98185613c7d565b9350613ce9818560208601613c8d565b613cf281613cb5565b840191505092915050565b5f6020820190508181035f830152613d158184613cc5565b905092915050565b5f604051905090565b5f80fd5b5f80fd5b5f819050919050565b613d4081613d2e565b8114613d4a575f80fd5b50565b5f81359050613d5b81613d37565b92915050565b5f60208284031215613d7657613d75613d26565b5b5f613d8384828501613d4d565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f613db582613d8c565b9050919050565b613dc581613dab565b82525050565b5f602082019050613dde5f830184613dbc565b92915050565b613ded81613dab565b8114613df7575f80fd5b50565b5f81359050613e0881613de4565b92915050565b5f8060408385031215613e2457613e23613d26565b5b5f613e3185828601613dfa565b9250506020613e4285828601613d4d565b9150509250929050565b5f8115159050919050565b613e6081613e4c565b82525050565b5f602082019050613e795f830184613e57565b92915050565b613e8881613d2e565b82525050565b5f602082019050613ea15f830184613e7f565b92915050565b5f805f60608486031215613ebe57613ebd613d26565b5b5f613ecb86828701613dfa565b9350506020613edc86828701613dfa565b9250506040613eed86828701613d4d565b9150509250925092565b5f8060408385031215613f0d57613f0c613d26565b5b5f613f1a85828601613d4d565b9250506020613f2b85828601613d4d565b9150509250929050565b5f60ff82169050919050565b613f4a81613f35565b82525050565b5f602082019050613f635f830184613f41565b92915050565b5f80fd5b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b613fa782613cb5565b810181811067ffffffffffffffff82111715613fc657613fc5613f71565b5b80604052505050565b5f613fd8613d1d565b9050613fe48282613f9e565b919050565b5f67ffffffffffffffff82111561400357614002613f71565b5b61400c82613cb5565b9050602081019050919050565b828183375f83830152505050565b5f61403961403484613fe9565b613fcf565b90508281526020810184848401111561405557614054613f6d565b5b614060848285614019565b509392505050565b5f82601f83011261407c5761407b613f69565b5b813561408c848260208601614027565b91505092915050565b5f80604083850312156140ab576140aa613d26565b5b5f83013567ffffffffffffffff8111156140c8576140c7613d2a565b5b6140d485828601614068565b925050602083013567ffffffffffffffff8111156140f5576140f4613d2a565b5b61410185828601614068565b9150509250929050565b61411481613e4c565b811461411e575f80fd5b50565b5f8135905061412f8161410b565b92915050565b5f806040838503121561414b5761414a613d26565b5b5f61415885828601613dfa565b925050602061416985828601614121565b9150509250929050565b5f6020828403121561418857614187613d26565b5b5f61419584828501614121565b91505092915050565b5f602082840312156141b3576141b2613d26565b5b5f6141c084828501613dfa565b91505092915050565b5f819050919050565b5f6141ec6141e76141e284613d8c565b6141c9565b613d8c565b9050919050565b5f6141fd826141d2565b9050919050565b5f61420e826141f3565b9050919050565b61421e81614204565b82525050565b5f6020820190506142375f830184614215565b92915050565b5f61424782613d8c565b9050919050565b6142578161423d565b82525050565b5f6020820190506142705f83018461424e565b92915050565b5f80fd5b5f80fd5b5f8083601f84011261429357614292613f69565b5b8235905067ffffffffffffffff8111156142b0576142af614276565b5b6020830191508360018202830111156142cc576142cb61427a565b5b9250929050565b5f805f805f608086880312156142ec576142eb613d26565b5b5f6142f988828901613dfa565b955050602061430a88828901613dfa565b945050604061431b88828901613d4d565b935050606086013567ffffffffffffffff81111561433c5761433b613d2a565b5b6143488882890161427e565b92509250509295509295909350565b5f8083601f84011261436c5761436b613f69565b5b8235905067ffffffffffffffff81111561438957614388614276565b5b6020830191508360208202830111156143a5576143a461427a565b5b9250929050565b5f805f604084860312156143c3576143c2613d26565b5b5f84013567ffffffffffffffff8111156143e0576143df613d2a565b5b6143ec86828701614357565b935093505060206143ff86828701614121565b9150509250925092565b5f806040838503121561441f5761441e613d26565b5b5f61442c85828601613dfa565b925050602061443d85828601613dfa565b9150509250929050565b5f6020828403121561445c5761445b613d26565b5b5f82013567ffffffffffffffff81111561447957614478613d2a565b5b61448584828501614068565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806144d257607f821691505b6020821081036144e5576144e461448e565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61452282613d2e565b915061452d83613d2e565b9250828203905081811115614545576145446144eb565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffd5b5f82825260208201905092915050565b50565b5f6145c35f836145a5565b91506145ce826145b5565b5f82019050919050565b5f6080820190506145eb5f830186613dbc565b6145f86020830185613dbc565b6146056040830184613e7f565b8181036060830152614616816145b8565b9050949350505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61465481614620565b811461465e575f80fd5b50565b5f8151905061466f8161464b565b92915050565b5f6020828403121561468a57614689613d26565b5b5f61469784828501614661565b91505092915050565b7f54686520726f7574657220616c726561647920686173207468617420616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f6146fa602383613c7d565b9150614705826146a0565b604082019050919050565b5f6020820190508181035f830152614727816146ee565b9050919050565b5f8151905061473c81613de4565b92915050565b5f6020828403121561475757614756613d26565b5b5f6147648482850161472e565b91505092915050565b5f6040820190506147805f830185613dbc565b61478d6020830184613dbc565b9392505050565b5f61479f83856145a5565b93506147ac838584614019565b6147b583613cb5565b840190509392505050565b5f6080820190506147d35f830188613dbc565b6147e06020830187613dbc565b6147ed6040830186613e7f565b8181036060830152614800818486614794565b90509695505050505050565b5f82825260208201905092915050565b5f819050919050565b61482e81613dab565b82525050565b5f61483f8383614825565b60208301905092915050565b5f6148596020840184613dfa565b905092915050565b5f602082019050919050565b5f614878838561480c565b93506148838261481c565b805f5b858110156148bb57614898828461484b565b6148a28882614834565b97506148ad83614861565b925050600181019050614886565b5085925050509392505050565b5f6040820190508181035f8301526148e181858761486d565b90506148f06020830184613e57565b949350505050565b5f81905092915050565b5f819050815f5260205f209050919050565b5f8154614920816144bb565b61492a81866148f8565b9450600182165f811461494457600181146149595761498b565b60ff198316865281151582028601935061498b565b61496285614902565b5f5b8381101561498357815481890152600182019150602081019050614964565b838801955050505b50505092915050565b5f61499e82613c73565b6149a881856148f8565b93506149b8818560208601613c8d565b80840191505092915050565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000815250565b5f6149f58285614914565b9150614a018284614994565b9150614a0c826149c4565b6005820191508190509392505050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302614a667fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82614a2b565b614a708683614a2b565b95508019841693508086168417925050509392505050565b5f614aa2614a9d614a9884613d2e565b6141c9565b613d2e565b9050919050565b5f819050919050565b614abb83614a88565b614acf614ac782614aa9565b848454614a37565b825550505050565b5f90565b614ae3614ad7565b614aee818484614ab2565b505050565b5b81811015614b1157614b065f82614adb565b600181019050614af4565b5050565b601f821115614b5657614b2781614902565b614b3084614a1c565b81016020851015614b3f578190505b614b53614b4b85614a1c565b830182614af3565b50505b505050565b5f82821c905092915050565b5f614b765f1984600802614b5b565b1980831691505092915050565b5f614b8e8383614b67565b9150826002028217905092915050565b614ba782613c73565b67ffffffffffffffff811115614bc057614bbf613f71565b5b614bca82546144bb565b614bd5828285614b15565b5f60209050601f831160018114614c06575f8415614bf4578287015190505b614bfe8582614b83565b865550614c65565b601f198416614c1486614902565b5f5b82811015614c3b57848901518255600182019150602085019450602081019050614c16565b86831015614c585784890151614c54601f891682614b67565b8355505b6001600288020188555050505b505050505050565b5f8160011c9050919050565b5f808291508390505b6001851115614cc257808604811115614c9e57614c9d6144eb565b5b6001851615614cad5780820291505b8081029050614cbb85614c6d565b9450614c82565b94509492505050565b5f82614cda5760019050614d95565b81614ce7575f9050614d95565b8160018114614cfd5760028114614d0757614d36565b6001915050614d95565b60ff841115614d1957614d186144eb565b5b8360020a915084821115614d3057614d2f6144eb565b5b50614d95565b5060208310610133831016604e8410600b8410161715614d6b5782820a905083811115614d6657614d656144eb565b5b614d95565b614d788484846001614c79565b92509050818404811115614d8f57614d8e6144eb565b5b81810290505b9392505050565b5f614da682613d2e565b9150614db183613f35565b9250614dde7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484614ccb565b905092915050565b5f614df082613d2e565b9150614dfb83613d2e565b9250828202614e0981613d2e565b91508282048414831517614e2057614e1f6144eb565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f614e5e82613d2e565b9150614e6983613d2e565b925082614e7957614e78614e27565b5b828204905092915050565b5f819050919050565b5f614ea7614ea2614e9d84614e84565b6141c9565b613d2e565b9050919050565b614eb781614e8d565b82525050565b5f81519050919050565b5f819050602082019050919050565b5f602082019050919050565b5f614eec82614ebd565b614ef6818561480c565b9350614f0183614ec7565b805f5b83811015614f31578151614f188882614834565b9750614f2383614ed6565b925050600181019050614f04565b5085935050505092915050565b5f614f48826141f3565b9050919050565b614f5881614f3e565b82525050565b5f60a082019050614f715f830188613e7f565b614f7e6020830187614eae565b8181036040830152614f908186614ee2565b9050614f9f6060830185614f4f565b614fac6080830184613e7f565b969550505050505056fea2646970667358221220753fc434f9eb701d3e281a481ae64ce5d2c17caee17907ed28645e1da76c188b64736f6c63430008180033
Verified Source Code Partial Match
Compiler: v0.8.24+commit.e11b9ed9
EVM: shanghai
Optimization: No
Dude.sol 1795 lines
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
// File: @openzeppelin/contracts/utils/ReentrancyGuard.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}
// 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/Context.sol
// 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;
}
}
// File: @openzeppelin/contracts/utils/Pausable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
bool private _paused;
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
/**
* @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);
}
}
// File: @openzeppelin/contracts/access/Ownable2Step.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is specified at deployment time in the constructor for `Ownable`. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2Step is Ownable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
if (pendingOwner() != sender) {
revert OwnableUnauthorizedAccount(sender);
}
_transferOwnership(sender);
}
}
// File: contracts/ERC404.sol
pragma solidity ^0.8.0;
abstract contract ERC721Receiver {
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external virtual returns (bytes4) {
return ERC721Receiver.onERC721Received.selector;
}
}
/// @notice ERC404
/// A gas-efficient, mixed ERC20 / ERC721 implementation
/// with native liquidity and fractionalization.
///
/// This is an experimental standard designed to integrate
/// with pre-existing ERC20 / ERC721 support as smoothly as
/// possible.
///
/// @dev In order to support full functionality of ERC20 and ERC721
/// supply assumptions are made that slightly constraint usage.
/// Ensure decimals are sufficiently large (standard 18 recommended)
/// as ids are effectively encoded in the lowest range of amounts.
///
/// NFTs are spent on ERC20 functions in a FILO queue, this is by
/// design.
///
abstract contract ERC404 is Ownable2Step {
// Events
event ERC20Transfer(
address indexed from,
address indexed to,
uint256 amount
);
event Approval(
address indexed owner,
address indexed spender,
uint256 amount
);
event Transfer(
address indexed from,
address indexed to,
uint256 indexed id
);
event ERC721Approval(
address indexed owner,
address indexed spender,
uint256 indexed id
);
event ApprovalForAll(
address indexed owner,
address indexed operator,
bool approved
);
// Errors
error NotFound();
error AlreadyExists();
error InvalidRecipient();
error InvalidSender();
error UnsafeRecipient();
error Unauthorized();
error InvalidOwner();
// Metadata
/// @dev Token name
string public name;
/// @dev Token symbol
string public symbol;
/// @dev Decimals for fractional representation
uint8 public immutable decimals;
/// @dev Total supply in fractionalized representation
uint256 public immutable totalSupply;
/// @dev Current mint counter, monotonically increasing to ensure accurate ownership
uint256 public minted;
// Mappings
/// @dev Balance of user in fractional representation
mapping(address => uint256) public balanceOf;
/// @dev Allowance of user in fractional representation
mapping(address => mapping(address => uint256)) public allowance;
/// @dev Approval in native representaion
mapping(uint256 => address) public getApproved;
/// @dev Approval for all in native representation
mapping(address => mapping(address => bool)) public isApprovedForAll;
/// @dev Owner of id in native representation
mapping(uint256 => address) internal _ownerOf;
/// @dev Array of owned ids in native representation
mapping(address => uint256[]) internal _owned;
/// @dev Tracks indices for the _owned mapping
mapping(uint256 => uint256) internal _ownedIndex;
/// @dev Addresses whitelisted from minting / burning for gas savings (pairs, routers, etc)
mapping(address => bool) public whitelist;
// Constructor
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals,
uint256 _totalNativeSupply,
address _owner
) Ownable(_owner) {
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = _totalNativeSupply * (10 ** decimals);
}
/// @notice Initialization function to set pairs / etc
/// saving gas by avoiding mint / burn on unnecessary targets
function setWhitelist(address target, bool state) public onlyOwner {
whitelist[target] = state;
}
/// @notice Function to find owner of a given native token
function ownerOf(uint256 id) public view virtual returns (address owner) {
owner = _ownerOf[id];
if (owner == address(0)) {
revert NotFound();
}
}
/// @notice tokenURI must be implemented by child contract
function tokenURI(uint256 id) public view virtual returns (string memory);
/// @notice Function for token approvals
/// @dev This function assumes id / native if amount less than or equal to current max id
function approve(
address spender,
uint256 amountOrId
) public virtual returns (bool) {
if (amountOrId <= minted && amountOrId > 0) {
address owner = _ownerOf[amountOrId];
if (msg.sender != owner && !isApprovedForAll[owner][msg.sender]) {
revert Unauthorized();
}
getApproved[amountOrId] = spender;
emit Approval(owner, spender, amountOrId);
} else {
allowance[msg.sender][spender] = amountOrId;
emit Approval(msg.sender, spender, amountOrId);
}
return true;
}
/// @notice Function native approvals
function setApprovalForAll(address operator, bool approved) public virtual {
isApprovedForAll[msg.sender][operator] = approved;
emit ApprovalForAll(msg.sender, operator, approved);
}
/// @notice Function for mixed transfers
/// @dev This function assumes id / native if amount less than or equal to current max id
function transferFrom(
address from,
address to,
uint256 amountOrId
) public virtual {
if (amountOrId <= minted) {
if (from != _ownerOf[amountOrId]) {
revert InvalidSender();
}
if (to == address(0)) {
revert InvalidRecipient();
}
if (
msg.sender != from &&
!isApprovedForAll[from][msg.sender] &&
msg.sender != getApproved[amountOrId]
) {
revert Unauthorized();
}
balanceOf[from] -= _getUnit();
unchecked {
balanceOf[to] += _getUnit();
}
_ownerOf[amountOrId] = to;
delete getApproved[amountOrId];
// update _owned for sender
uint256 updatedId = _owned[from][_owned[from].length - 1];
_owned[from][_ownedIndex[amountOrId]] = updatedId;
// pop
_owned[from].pop();
// update index for the moved id
_ownedIndex[updatedId] = _ownedIndex[amountOrId];
// push token to to owned
_owned[to].push(amountOrId);
// update index for to owned
_ownedIndex[amountOrId] = _owned[to].length - 1;
emit Transfer(from, to, amountOrId);
emit ERC20Transfer(from, to, _getUnit());
} else {
uint256 allowed = allowance[from][msg.sender];
if (allowed != type(uint256).max)
allowance[from][msg.sender] = allowed - amountOrId;
_transfer(from, to, amountOrId);
}
}
/// @notice Function for fractional transfers
function transfer(
address to,
uint256 amount
) public virtual returns (bool) {
return _transfer(msg.sender, to, amount);
}
/// @notice Function for native transfers with contract support
function safeTransferFrom(
address from,
address to,
uint256 id
) public virtual {
transferFrom(from, to, id);
if (
to.code.length != 0 &&
ERC721Receiver(to).onERC721Received(msg.sender, from, id, "") !=
ERC721Receiver.onERC721Received.selector
) {
revert UnsafeRecipient();
}
}
/// @notice Function for native transfers with contract support and callback data
function safeTransferFrom(
address from,
address to,
uint256 id,
bytes calldata data
) public virtual {
transferFrom(from, to, id);
if (
to.code.length != 0 &&
ERC721Receiver(to).onERC721Received(msg.sender, from, id, data) !=
ERC721Receiver.onERC721Received.selector
) {
revert UnsafeRecipient();
}
}
/// @notice Internal function for fractional transfers
function _transfer(
address from,
address to,
uint256 amount
) internal virtual returns (bool) {
uint256 unit = _getUnit();
uint256 balanceBeforeSender = balanceOf[from];
uint256 balanceBeforeReceiver = balanceOf[to];
balanceOf[from] -= amount;
unchecked {
balanceOf[to] += amount;
}
// Skip burn for certain addresses to save gas
if (!whitelist[from]) {
uint256 tokens_to_burn = (balanceBeforeSender / unit) -
(balanceOf[from] / unit);
for (uint256 i = 0; i < tokens_to_burn; i++) {
_burn(from);
}
}
// Skip minting for certain addresses to save gas
if (!whitelist[to]) {
uint256 tokens_to_mint = (balanceOf[to] / unit) -
(balanceBeforeReceiver / unit);
for (uint256 i = 0; i < tokens_to_mint; i++) {
_mint(to);
}
}
emit ERC20Transfer(from, to, amount);
return true;
}
// Internal utility logic
function _getUnit() internal view returns (uint256) {
return 10 ** decimals;
}
function _mint(address to) internal virtual {
if (to == address(0)) {
revert InvalidRecipient();
}
unchecked {
minted++;
}
uint256 id = minted;
if (_ownerOf[id] != address(0)) {
revert AlreadyExists();
}
_ownerOf[id] = to;
_owned[to].push(id);
_ownedIndex[id] = _owned[to].length - 1;
emit Transfer(address(0), to, id);
}
function _burn(address from) internal virtual {
if (from == address(0)) {
revert InvalidSender();
}
uint256 id = _owned[from][_owned[from].length - 1];
_owned[from].pop();
delete _ownedIndex[id];
delete _ownerOf[id];
delete getApproved[id];
emit Transfer(from, address(0), id);
}
function _setNameSymbol(
string memory _name,
string memory _symbol
) internal {
name = _name;
symbol = _symbol;
}
}
interface IUniswapPair {
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 swapFee() external view returns (uint32);
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;
function setSwapFee(uint32) external;
}
interface IUniswapFactory {
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;
function setSwapFee(address _pair, uint32 _swapFee) external;
}
interface IUniswapRouter01 {
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, uint swapFee) external pure returns (uint amountOut);
functio...
// [truncated — 60237 bytes total]
Read Contract
SwapAndLiquifyEnabled 0x423ce9cc → bool
_isGetFees 0x8768a9cd → bool
allowance 0xdd62ed3e → uint256
automatedMarketMakerPairs 0xb62496f5 → bool
balanceOf 0x70a08231 → uint256
baseTokenURI 0xd547cfb7 → string
blockDuration 0x201e908e → uint256
blockNumber 0x57e871e7 → uint256
decimals 0x313ce567 → uint8
feeOnBuy 0xbb8c3ee0 → uint256
feeOnSell 0x65048d08 → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
marketingWallet 0x75f0a874 → address
minted 0x4f02c420 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
pendingOwner 0xe30c3978 → address
symbol 0x95d89b41 → string
tokenAmountToSwap 0x7a493251 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
uniswapPair 0xc816841b → address
uniswapRouter 0x735de9f7 → address
whitelist 0x9b19251a → bool
Write Contract 22 functions
These functions modify contract state and require a wallet transaction to execute.
acceptOwnership 0x79ba5097
No parameters
approve 0x095ea7b3
address spender
uint256 amountOrId
returns: bool
excludeFromFees 0xc0246668
address account
bool excluded
excludeMultipleAccountsFromFees 0xc492f046
address[] accounts
bool excluded
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 id
safeTransferFrom 0xb88d4fde
address from
address to
uint256 id
bytes data
setApprovalForAll 0xa22cb465
address operator
bool approved
setAutomatedMarketMakerPair 0x9a7a23d6
address pair
bool value
setBlockNumber 0xfbf6eaa5
No parameters
setFeeAccount 0xa4de3c19
address account
bool isGetFee
setNameSymbol 0x504334c2
string _name
string _symbol
setTokenAmountToSwap 0x8144ec0c
uint256 _tokenAmount
setTokenURI 0xe0df5b6f
string _tokenURI
setWhitelist 0x53d6fd59
address target
bool state
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amountOrId
transferOwnership 0xf2fde38b
address newOwner
updateFee 0x2740c197
uint256 _onBuy
uint256 _onSell
updateMarketingWallet 0xaacebbe3
address _newWallet
updateSwapAndLiquifiy 0x68b4cac9
bool value
updateUniswapRouter 0x908bb2ae
address newAddress
Recent Transactions
No transactions found for this address