Search is not available for this dataset
chain_id
uint64 1
1
| block_number
uint64 19.5M
20M
| block_hash
stringlengths 64
64
| transaction_hash
stringlengths 64
64
| deployer_address
stringlengths 40
40
| factory_address
stringlengths 40
40
| contract_address
stringlengths 40
40
| creation_bytecode
stringlengths 0
98.3k
| runtime_bytecode
stringlengths 0
49.2k
| creation_sourcecode
stringlengths 0
976k
|
---|---|---|---|---|---|---|---|---|---|
1 | 20,290,341 | df1ee2922f0a35877951885ab86de2494beea4f660e24bb802edeac7014a0c66 | 659ea604974bb3bc1262d55f6d99dc0634744888e40c208c61f8a091791bc2e3 | 34a71ee0980ca0aef8a6ebc6a680511b7e2a6978 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | e07c7f889d724f9c74ca945e93755cfe1d3c3b82 | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,341 | df1ee2922f0a35877951885ab86de2494beea4f660e24bb802edeac7014a0c66 | 659ea604974bb3bc1262d55f6d99dc0634744888e40c208c61f8a091791bc2e3 | 34a71ee0980ca0aef8a6ebc6a680511b7e2a6978 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | bc85a9ae3c11f6e210a5abd9bf711cab6e625c6d | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,341 | df1ee2922f0a35877951885ab86de2494beea4f660e24bb802edeac7014a0c66 | 659ea604974bb3bc1262d55f6d99dc0634744888e40c208c61f8a091791bc2e3 | 34a71ee0980ca0aef8a6ebc6a680511b7e2a6978 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | c141d1722d93e6a653847eaca6f79e1474143149 | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,341 | df1ee2922f0a35877951885ab86de2494beea4f660e24bb802edeac7014a0c66 | 659ea604974bb3bc1262d55f6d99dc0634744888e40c208c61f8a091791bc2e3 | 34a71ee0980ca0aef8a6ebc6a680511b7e2a6978 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | 443279e66f07726ffc65c1a90207736c08cdb4fa | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,341 | df1ee2922f0a35877951885ab86de2494beea4f660e24bb802edeac7014a0c66 | 659ea604974bb3bc1262d55f6d99dc0634744888e40c208c61f8a091791bc2e3 | 34a71ee0980ca0aef8a6ebc6a680511b7e2a6978 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | 53ef8e42ca1e10395a2fae2ea401e3409b3793a5 | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,341 | df1ee2922f0a35877951885ab86de2494beea4f660e24bb802edeac7014a0c66 | 659ea604974bb3bc1262d55f6d99dc0634744888e40c208c61f8a091791bc2e3 | 34a71ee0980ca0aef8a6ebc6a680511b7e2a6978 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | de488947adca6f934dba4c5f845fbb2ac520cf5b | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,341 | df1ee2922f0a35877951885ab86de2494beea4f660e24bb802edeac7014a0c66 | 659ea604974bb3bc1262d55f6d99dc0634744888e40c208c61f8a091791bc2e3 | 34a71ee0980ca0aef8a6ebc6a680511b7e2a6978 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | 5492014e62a41eedb26c0a3e2b5a920e0589383f | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,341 | df1ee2922f0a35877951885ab86de2494beea4f660e24bb802edeac7014a0c66 | 659ea604974bb3bc1262d55f6d99dc0634744888e40c208c61f8a091791bc2e3 | 34a71ee0980ca0aef8a6ebc6a680511b7e2a6978 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | 46877723fac2b0e9ce60c560651ab2cd7a271f92 | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,343 | d02c5f666360d0be8b99b35d57d38b8f7e0d7c8452b95f42cb478a4005063730 | 04b16b52ba37a7875f1ab4fa321dfee39eb99a98be911ec7d5a910e0a01a3be1 | 0376e562e3653ae299177b8693bd0debfd20ef96 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | 4fd8712b1104dfcb71dd4b3b1479f5f85846f2eb | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,343 | d02c5f666360d0be8b99b35d57d38b8f7e0d7c8452b95f42cb478a4005063730 | 04b16b52ba37a7875f1ab4fa321dfee39eb99a98be911ec7d5a910e0a01a3be1 | 0376e562e3653ae299177b8693bd0debfd20ef96 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | 1ce6f33c0d9a4a6b4ba387c8a8e508a9755a057f | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,343 | d02c5f666360d0be8b99b35d57d38b8f7e0d7c8452b95f42cb478a4005063730 | 04b16b52ba37a7875f1ab4fa321dfee39eb99a98be911ec7d5a910e0a01a3be1 | 0376e562e3653ae299177b8693bd0debfd20ef96 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | 4913f75daa35257f38bee02810b8fa769249e2b6 | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,343 | d02c5f666360d0be8b99b35d57d38b8f7e0d7c8452b95f42cb478a4005063730 | 04b16b52ba37a7875f1ab4fa321dfee39eb99a98be911ec7d5a910e0a01a3be1 | 0376e562e3653ae299177b8693bd0debfd20ef96 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | 06b0811d92212245d674de0ef4a655c856aed5f3 | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,343 | d02c5f666360d0be8b99b35d57d38b8f7e0d7c8452b95f42cb478a4005063730 | 04b16b52ba37a7875f1ab4fa321dfee39eb99a98be911ec7d5a910e0a01a3be1 | 0376e562e3653ae299177b8693bd0debfd20ef96 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | d87379045a13ef17581f4d5cb86fcfe2b23e8d94 | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,343 | d02c5f666360d0be8b99b35d57d38b8f7e0d7c8452b95f42cb478a4005063730 | 04b16b52ba37a7875f1ab4fa321dfee39eb99a98be911ec7d5a910e0a01a3be1 | 0376e562e3653ae299177b8693bd0debfd20ef96 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | c1251aa92fbcd5c3a82138bb3fb029913ea6b4ae | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,343 | d02c5f666360d0be8b99b35d57d38b8f7e0d7c8452b95f42cb478a4005063730 | 04b16b52ba37a7875f1ab4fa321dfee39eb99a98be911ec7d5a910e0a01a3be1 | 0376e562e3653ae299177b8693bd0debfd20ef96 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | 32c2e238821fea048a09fcbc4a92c0cc3b66387e | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,343 | d02c5f666360d0be8b99b35d57d38b8f7e0d7c8452b95f42cb478a4005063730 | 04b16b52ba37a7875f1ab4fa321dfee39eb99a98be911ec7d5a910e0a01a3be1 | 0376e562e3653ae299177b8693bd0debfd20ef96 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | 8c85bc3711209589b27c7f35506e0c5ce8e9a59d | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,343 | d02c5f666360d0be8b99b35d57d38b8f7e0d7c8452b95f42cb478a4005063730 | 04b16b52ba37a7875f1ab4fa321dfee39eb99a98be911ec7d5a910e0a01a3be1 | 0376e562e3653ae299177b8693bd0debfd20ef96 | 42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794 | 884bb6ff557ad2b3cb74252867a9de026c3fb42d | 3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,345 | 8a7975f45b33f52460eed5f263d5742f8b30e129991973506b7aac990f0c178c | f94c13f590d2f81711fbafa215bb9e74b2bf99d5ba4c2def6854e44636b2310c | 1aa801246317b52920c03d31b25fe5d5f967c460 | 5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f | 1d3dafe5ea0e18b11eaf8833d23064e13242ac3b | 60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429 | 608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032 | // File: contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/interfaces/IUniswapV2ERC20.sol
pragma solidity >=0.5.0;
interface IUniswapV2ERC20 {
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;
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/UniswapV2ERC20.sol
pragma solidity =0.5.16;
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// File: contracts/libraries/Math.sol
pragma solidity =0.5.16;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// File: contracts/libraries/UQ112x112.sol
pragma solidity =0.5.16;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view 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);
}
// File: contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/interfaces/IUniswapV2Callee.sol
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// File: contracts/UniswapV2Pair.sol
pragma solidity =0.5.16;
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
}
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);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(5).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = IERC20(_token0).balanceOf(address(this));
uint balance1 = IERC20(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
} |
1 | 20,290,349 | 07a9f1cb3fb8fc3e9bfb7a5a49ceacbb797908d7facc4b47e684e550be6b9157 | b8c05f0a8dcd8e18b53314cb69763a5255e193eff39d6ac0811d61a4a4bb6953 | 26ced4fc889d52210bd14af3bda90f7e36d10725 | 22ff1dc5998258faa1ea45a776b57484f8ab80a2 | 925d3e2ffa37fc036277e14b8967e2c4c2d35398 | 608060405234801561001057600080fd5b506104e0806100206000396000f3fe6080604052600436106100295760003560e01c8063a619486e14610055578063d1f5789414610081575b600080546001600160a01b03163682803781823684845af490503d82833e80610050573d82fd5b503d81f35b34801561006157600080fd5b50600054604080516001600160a01b039092168252519081900360200190f35b34801561008d57600080fd5b506100a161009c3660046102d8565b6100a3565b005b6000546001600160a01b0316156100f75760405162461bcd60e51b8152602060048201526013602482015272496e697469616c697a656420616c726561647960681b60448201526064015b60405180910390fd5b6001600160a01b0382166101585760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642073696e676c65746f6e20616464726573732070726f766964604482015261195960f21b60648201526084016100ee565b600080546001600160a01b0319166001600160a01b0384161781558151819061018a906020908501810190850161038f565b91509150600080856001600160a01b031684846040516024016101ae929190610448565b60408051601f198184030181529181526020820180516001600160e01b031663347d5e2560e21b179052516101e39190610474565b600060405180830381855af49150503d806000811461021e576040519150601f19603f3d011682016040523d82523d6000602084013e610223565b606091505b50915091508181906102485760405162461bcd60e51b81526004016100ee9190610490565b50505050505050565b6001600160a01b038116811461026657600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156102a8576102a8610269565b604052919050565b600067ffffffffffffffff8211156102ca576102ca610269565b50601f01601f191660200190565b600080604083850312156102eb57600080fd5b82356102f681610251565b9150602083013567ffffffffffffffff81111561031257600080fd5b8301601f8101851361032357600080fd5b8035610336610331826102b0565b61027f565b81815286602083850101111561034b57600080fd5b816020840160208301376000602083830101528093505050509250929050565b60005b8381101561038657818101518382015260200161036e565b50506000910152565b600080604083850312156103a257600080fd5b82516103ad81610251565b602084015190925067ffffffffffffffff8111156103ca57600080fd5b8301601f810185136103db57600080fd5b80516103e9610331826102b0565b8181528660208385010111156103fe57600080fd5b61040f82602083016020860161036b565b8093505050509250929050565b6000815180845261043481602086016020860161036b565b601f01601f19169290920160200192915050565b6001600160a01b038316815260406020820181905260009061046c9083018461041c565b949350505050565b6000825161048681846020870161036b565b9190910192915050565b6020815260006104a3602083018461041c565b939250505056fea26469706673582212202f2c661bb10389280f3fda8a8d301e0f41ead5ed7c71e13a45dbb0a01785aa1564736f6c63430008110033 | 6080604052600436106100295760003560e01c8063a619486e14610055578063d1f5789414610081575b600080546001600160a01b03163682803781823684845af490503d82833e80610050573d82fd5b503d81f35b34801561006157600080fd5b50600054604080516001600160a01b039092168252519081900360200190f35b34801561008d57600080fd5b506100a161009c3660046102d8565b6100a3565b005b6000546001600160a01b0316156100f75760405162461bcd60e51b8152602060048201526013602482015272496e697469616c697a656420616c726561647960681b60448201526064015b60405180910390fd5b6001600160a01b0382166101585760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642073696e676c65746f6e20616464726573732070726f766964604482015261195960f21b60648201526084016100ee565b600080546001600160a01b0319166001600160a01b0384161781558151819061018a906020908501810190850161038f565b91509150600080856001600160a01b031684846040516024016101ae929190610448565b60408051601f198184030181529181526020820180516001600160e01b031663347d5e2560e21b179052516101e39190610474565b600060405180830381855af49150503d806000811461021e576040519150601f19603f3d011682016040523d82523d6000602084013e610223565b606091505b50915091508181906102485760405162461bcd60e51b81526004016100ee9190610490565b50505050505050565b6001600160a01b038116811461026657600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156102a8576102a8610269565b604052919050565b600067ffffffffffffffff8211156102ca576102ca610269565b50601f01601f191660200190565b600080604083850312156102eb57600080fd5b82356102f681610251565b9150602083013567ffffffffffffffff81111561031257600080fd5b8301601f8101851361032357600080fd5b8035610336610331826102b0565b61027f565b81815286602083850101111561034b57600080fd5b816020840160208301376000602083830101528093505050509250929050565b60005b8381101561038657818101518382015260200161036e565b50506000910152565b600080604083850312156103a257600080fd5b82516103ad81610251565b602084015190925067ffffffffffffffff8111156103ca57600080fd5b8301601f810185136103db57600080fd5b80516103e9610331826102b0565b8181528660208385010111156103fe57600080fd5b61040f82602083016020860161036b565b8093505050509250929050565b6000815180845261043481602086016020860161036b565b601f01601f19169290920160200192915050565b6001600160a01b038316815260406020820181905260009061046c9083018461041c565b949350505050565b6000825161048681846020870161036b565b9190910192915050565b6020815260006104a3602083018461041c565b939250505056fea26469706673582212202f2c661bb10389280f3fda8a8d301e0f41ead5ed7c71e13a45dbb0a01785aa1564736f6c63430008110033 | |
1 | 20,290,349 | 07a9f1cb3fb8fc3e9bfb7a5a49ceacbb797908d7facc4b47e684e550be6b9157 | b8c05f0a8dcd8e18b53314cb69763a5255e193eff39d6ac0811d61a4a4bb6953 | 26ced4fc889d52210bd14af3bda90f7e36d10725 | 925d3e2ffa37fc036277e14b8967e2c4c2d35398 | 62fc1d9de103e5ba04e9d20ea60f000ead4429dd | 3d602d80600a3d3981f3363d3d373d3d3d363d736b32ff882b07be4c2b669267ebf52b43f8ff3e1c5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d736b32ff882b07be4c2b669267ebf52b43f8ff3e1c5af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,349 | 07a9f1cb3fb8fc3e9bfb7a5a49ceacbb797908d7facc4b47e684e550be6b9157 | b8c05f0a8dcd8e18b53314cb69763a5255e193eff39d6ac0811d61a4a4bb6953 | 26ced4fc889d52210bd14af3bda90f7e36d10725 | 62fc1d9de103e5ba04e9d20ea60f000ead4429dd | fd79952834b48d9f64311eafe76c275271716853 | 3d602d80600a3d3981f3363d3d373d3d3d363d733c35c20cd5c03dcbca1d0527164205288ca70b935af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d733c35c20cd5c03dcbca1d0527164205288ca70b935af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,350 | 4a9a8a7557334fe27a243ad9fae3072070c77b97457b82874957ffb6d3b4a274 | d0468268abe6dd1a247f8a5c7d577ee60bbc51ab63e776007d46cf565f5d7cbb | 0ff8e4110c43cf81ba989acff645ba4a1b78b92c | ed567f1d7bc0fc08cc0967139c0545e73ca4587d | 7a93087ea21b831c97ea6f03a268d4b99827d96c | 3d602d80600a3d3981f3363d3d373d3d3d363d7395a286ca0347b3c8daf06dad1c4233c95f06c8945af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7395a286ca0347b3c8daf06dad1c4233c95f06c8945af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"contracts/CoreRouter.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\n/// @title Cyan Wallet Core Router - A Cyan wallet's core router.\n/// @author Bulgantamir Gankhuyag - <[email protected]>\n/// @author Naranbayar Uuganbayar - <[email protected]>\ncontract CoreRouter {\n address payable private immutable _this;\n address private _admin;\n address private _core;\n\n event SetRouterAdmin(address admin);\n event SetCore(address core);\n\n modifier onlyAdmin() {\n require(_admin == msg.sender, \"Caller is not an admin.\");\n _;\n }\n\n constructor(address core) {\n require(core != address(0x0), \"Invalid core address.\");\n\n _admin = msg.sender;\n _core = core;\n _this = payable(address(this));\n }\n\n /// @notice Changes the admin of the router.\n /// @param admin Address of the new admin.\n function setRouterAdmin(address admin) external onlyAdmin {\n require(admin != address(0x0), \"Invalid admin address.\");\n\n _admin = admin;\n emit SetRouterAdmin(admin);\n }\n\n /// @notice Returns an admin address of the router.\n /// @return Address of the current admin.\n function getRouterAdmin() external view returns (address) {\n return _admin;\n }\n\n /// @notice Changes the address of the core contract.\n /// Note: Changing the core address will affect to all wallets.\n /// @param core Address of the new core contract.\n function setCore(address core) external onlyAdmin {\n require(core != address(0x0), \"Invalid core address.\");\n\n _core = core;\n emit SetCore(core);\n }\n\n /// @notice Returns the address of the core contract.\n /// @return Address of the current core contract.\n function getCore() external view returns (address) {\n return _core;\n }\n\n /// @notice Delegates all transcations to the core contract.\n fallback() external payable {\n address core = CoreRouter(_this).getCore();\n assembly {\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(gas(), core, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 500
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}
}} |
1 | 20,290,351 | 05f659e4d06f6aaa4173cfca2d7bd22c80572b94f9b72dbe39c6894081fb9ee2 | 998f961877456e3e7983f587dca2f562ed76d900e8f8e32451c07bbe9b217ae6 | 1d3d37ec63b1f45ec37071cfb0abd1db33ca0de3 | 5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f | 7d74332f4f09ea9484ce9b1f447d2bb9dfef33f6 | 60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429 | 608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032 | // File: contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/interfaces/IUniswapV2ERC20.sol
pragma solidity >=0.5.0;
interface IUniswapV2ERC20 {
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;
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/UniswapV2ERC20.sol
pragma solidity =0.5.16;
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// File: contracts/libraries/Math.sol
pragma solidity =0.5.16;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// File: contracts/libraries/UQ112x112.sol
pragma solidity =0.5.16;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view 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);
}
// File: contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/interfaces/IUniswapV2Callee.sol
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// File: contracts/UniswapV2Pair.sol
pragma solidity =0.5.16;
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
}
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);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(5).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = IERC20(_token0).balanceOf(address(this));
uint balance1 = IERC20(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
} |
1 | 20,290,351 | 05f659e4d06f6aaa4173cfca2d7bd22c80572b94f9b72dbe39c6894081fb9ee2 | a0d000c0bb8cd46df9647b2977c6744fdc7e8e094f4774d46a7d8491b0d082b5 | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | 9ce86dcc302367552afa4a2bfd8dbf133aa6cb17 | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,351 | 05f659e4d06f6aaa4173cfca2d7bd22c80572b94f9b72dbe39c6894081fb9ee2 | a0d000c0bb8cd46df9647b2977c6744fdc7e8e094f4774d46a7d8491b0d082b5 | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | 0e22c45cec55269dfa374d3acba84ab2a15381e6 | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,351 | 05f659e4d06f6aaa4173cfca2d7bd22c80572b94f9b72dbe39c6894081fb9ee2 | a0d000c0bb8cd46df9647b2977c6744fdc7e8e094f4774d46a7d8491b0d082b5 | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | 8a90207fd1446b6c16b48918585a8b2042033351 | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,351 | 05f659e4d06f6aaa4173cfca2d7bd22c80572b94f9b72dbe39c6894081fb9ee2 | a0d000c0bb8cd46df9647b2977c6744fdc7e8e094f4774d46a7d8491b0d082b5 | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | 1e40e99e9644a0c6918c1021a983764fa3f10400 | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,351 | 05f659e4d06f6aaa4173cfca2d7bd22c80572b94f9b72dbe39c6894081fb9ee2 | a0d000c0bb8cd46df9647b2977c6744fdc7e8e094f4774d46a7d8491b0d082b5 | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | 11d1f0d5d3368ca1bb89f4d02aaf97acb8d0abfc | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,351 | 05f659e4d06f6aaa4173cfca2d7bd22c80572b94f9b72dbe39c6894081fb9ee2 | a0d000c0bb8cd46df9647b2977c6744fdc7e8e094f4774d46a7d8491b0d082b5 | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | 53685cf7b5247ccddf2e71817a4a00dad3a42c2c | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,351 | 05f659e4d06f6aaa4173cfca2d7bd22c80572b94f9b72dbe39c6894081fb9ee2 | a0d000c0bb8cd46df9647b2977c6744fdc7e8e094f4774d46a7d8491b0d082b5 | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | 27821591090117beeb5ca35fee9af1556ae30645 | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,354 | b9521be8144721f07dfab396229c7be79f4250d9e3197fa323b7e410a172af4d | f1917e33b21817061a626b804e24d2b21cb711f668245a57b62feaf02dd92477 | 384ce029e132599d063a08ea6090ec7aea64036e | 384ce029e132599d063a08ea6090ec7aea64036e | c9960265f321a8eebe385b49ce2b17a020d3a230 | 60806040523480156200001157600080fd5b5060405162000de038038062000de0833981810160405260408110156200003757600080fd5b81019080805160405193929190846401000000008211156200005857600080fd5b838201915060208201858111156200006f57600080fd5b82518660018202830111640100000000821117156200008d57600080fd5b8083526020830192505050908051906020019080838360005b83811015620000c3578082015181840152602081019050620000a6565b50505050905090810190601f168015620000f15780820380516001836020036101000a031916815260200191505b50604052602001805160405193929190846401000000008211156200011557600080fd5b838201915060208201858111156200012c57600080fd5b82518660018202830111640100000000821117156200014a57600080fd5b8083526020830192505050908051906020019080838360005b838110156200018057808201518184015260208101905062000163565b50505050905090810190601f168015620001ae5780820380516001836020036101000a031916815260200191505b506040525050508160019080519060200190620001cd929190620001ef565b508060009080519060200190620001e6929190620001ef565b5050506200029e565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200023257805160ff191683800117855562000263565b8280016001018555821562000263579182015b828111156200026257825182559160200191906001019062000245565b5b50905062000272919062000276565b5090565b6200029b91905b80821115620002975760008160009055506001016200027d565b5090565b90565b610b3280620002ae6000396000f3fe6080604052600436106100435760003560e01c80636c02a9311461004f5780637b61c320146100df578063be9a65551461016f578063d4e93292146101795761004a565b3661004a57005b600080fd5b34801561005b57600080fd5b50610064610183565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100a4578082015181840152602081019050610089565b50505050905090810190601f1680156100d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100eb57600080fd5b506100f4610221565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610134578082015181840152602081019050610119565b50505050905090810190601f1680156101615780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101776102bf565b005b61018161032a565b005b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102195780601f106101ee57610100808354040283529160200191610219565b820191906000526020600020905b8154815290600101906020018083116101fc57829003601f168201915b505050505081565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102b75780601f1061028c576101008083540402835291602001916102b7565b820191906000526020600020905b81548152906001019060200180831161029a57829003601f168201915b505050505081565b60006102d16102cc610395565b6106b3565b905060008190508073ffffffffffffffffffffffffffffffffffffffff166108fc6102fa61090c565b9081150290604051600060405180830381858888f19350505050158015610325573d6000803e3d6000fd5b505050565b600061033c610337610395565b6106b3565b905060008190508073ffffffffffffffffffffffffffffffffffffffff166108fc61036561090c565b9081150290604051600060405180830381858888f19350505050158015610390573d6000803e3d6000fd5b505050565b6060806103a0610914565b905060606103ac610951565b905060606103b861098e565b905060606103c46109cb565b905060606103d0610a08565b905060606103dc610a45565b905060606103e8610a82565b905060606103f4610abf565b905087878787878787876040516020018089805190602001908083835b602083106104345780518252602082019150602081019050602083039250610411565b6001836020036101000a03801982511681845116808217855250505050505090500188805190602001908083835b602083106104855780518252602082019150602081019050602083039250610462565b6001836020036101000a03801982511681845116808217855250505050505090500187805190602001908083835b602083106104d657805182526020820191506020810190506020830392506104b3565b6001836020036101000a03801982511681845116808217855250505050505090500186805190602001908083835b602083106105275780518252602082019150602081019050602083039250610504565b6001836020036101000a03801982511681845116808217855250505050505090500185805190602001908083835b602083106105785780518252602082019150602081019050602083039250610555565b6001836020036101000a03801982511681845116808217855250505050505090500184805190602001908083835b602083106105c957805182526020820191506020810190506020830392506105a6565b6001836020036101000a03801982511681845116808217855250505050505090500183805190602001908083835b6020831061061a57805182526020820191506020810190506020830392506105f7565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b6020831061066b5780518252602082019150602081019050602083039250610648565b6001836020036101000a038019825116818451168082178552505050505050905001985050505050505050506040516020818303038152906040529850505050505050505090565b6000606082905060008090506000806000600290505b602a8110156108ff57610100840293508481815181106106e557fe5b602001015160f81c60f81b60f81c60ff16925084600182018151811061070757fe5b602001015160f81c60f81b60f81c60ff16915060618373ffffffffffffffffffffffffffffffffffffffff1610158015610758575060668373ffffffffffffffffffffffffffffffffffffffff1611155b1561076857605783039250610802565b60418373ffffffffffffffffffffffffffffffffffffffff16101580156107a6575060468373ffffffffffffffffffffffffffffffffffffffff1611155b156107b657603783039250610801565b60308373ffffffffffffffffffffffffffffffffffffffff16101580156107f4575060398373ffffffffffffffffffffffffffffffffffffffff1611155b15610800576030830392505b5b5b60618273ffffffffffffffffffffffffffffffffffffffff1610158015610840575060668273ffffffffffffffffffffffffffffffffffffffff1611155b15610850576057820391506108ea565b60418273ffffffffffffffffffffffffffffffffffffffff161015801561088e575060468273ffffffffffffffffffffffffffffffffffffffff1611155b1561089e576037820391506108e9565b60308273ffffffffffffffffffffffffffffffffffffffff16101580156108dc575060398273ffffffffffffffffffffffffffffffffffffffff1611155b156108e8576030820391505b5b5b816010840201840193506002810190506106c9565b5082945050505050919050565b600047905090565b60606040518060400160405280600581526020017f3078314141000000000000000000000000000000000000000000000000000000815250905090565b60606040518060400160405280600681526020017f6331453533310000000000000000000000000000000000000000000000000000815250905090565b60606040518060400160405280600581526020017f4162413964000000000000000000000000000000000000000000000000000000815250905090565b60606040518060400160405280600781526020017f3830344665334200000000000000000000000000000000000000000000000000815250905090565b60606040518060400160405280600481526020017f3333313700000000000000000000000000000000000000000000000000000000815250905090565b60606040518060400160405280600481526020017f3537394400000000000000000000000000000000000000000000000000000000815250905090565b60606040518060400160405280600481526020017f3633653100000000000000000000000000000000000000000000000000000000815250905090565b60606040518060400160405280600781526020017f316133344561660000000000000000000000000000000000000000000000000081525090509056fea264697066735822122074089e6457267114f6b7b7bc50d39fa7e34774206fed4e31120051062933a01664736f6c634300060600330000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | 6080604052600436106100435760003560e01c80636c02a9311461004f5780637b61c320146100df578063be9a65551461016f578063d4e93292146101795761004a565b3661004a57005b600080fd5b34801561005b57600080fd5b50610064610183565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100a4578082015181840152602081019050610089565b50505050905090810190601f1680156100d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100eb57600080fd5b506100f4610221565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610134578082015181840152602081019050610119565b50505050905090810190601f1680156101615780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101776102bf565b005b61018161032a565b005b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102195780601f106101ee57610100808354040283529160200191610219565b820191906000526020600020905b8154815290600101906020018083116101fc57829003601f168201915b505050505081565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102b75780601f1061028c576101008083540402835291602001916102b7565b820191906000526020600020905b81548152906001019060200180831161029a57829003601f168201915b505050505081565b60006102d16102cc610395565b6106b3565b905060008190508073ffffffffffffffffffffffffffffffffffffffff166108fc6102fa61090c565b9081150290604051600060405180830381858888f19350505050158015610325573d6000803e3d6000fd5b505050565b600061033c610337610395565b6106b3565b905060008190508073ffffffffffffffffffffffffffffffffffffffff166108fc61036561090c565b9081150290604051600060405180830381858888f19350505050158015610390573d6000803e3d6000fd5b505050565b6060806103a0610914565b905060606103ac610951565b905060606103b861098e565b905060606103c46109cb565b905060606103d0610a08565b905060606103dc610a45565b905060606103e8610a82565b905060606103f4610abf565b905087878787878787876040516020018089805190602001908083835b602083106104345780518252602082019150602081019050602083039250610411565b6001836020036101000a03801982511681845116808217855250505050505090500188805190602001908083835b602083106104855780518252602082019150602081019050602083039250610462565b6001836020036101000a03801982511681845116808217855250505050505090500187805190602001908083835b602083106104d657805182526020820191506020810190506020830392506104b3565b6001836020036101000a03801982511681845116808217855250505050505090500186805190602001908083835b602083106105275780518252602082019150602081019050602083039250610504565b6001836020036101000a03801982511681845116808217855250505050505090500185805190602001908083835b602083106105785780518252602082019150602081019050602083039250610555565b6001836020036101000a03801982511681845116808217855250505050505090500184805190602001908083835b602083106105c957805182526020820191506020810190506020830392506105a6565b6001836020036101000a03801982511681845116808217855250505050505090500183805190602001908083835b6020831061061a57805182526020820191506020810190506020830392506105f7565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b6020831061066b5780518252602082019150602081019050602083039250610648565b6001836020036101000a038019825116818451168082178552505050505050905001985050505050505050506040516020818303038152906040529850505050505050505090565b6000606082905060008090506000806000600290505b602a8110156108ff57610100840293508481815181106106e557fe5b602001015160f81c60f81b60f81c60ff16925084600182018151811061070757fe5b602001015160f81c60f81b60f81c60ff16915060618373ffffffffffffffffffffffffffffffffffffffff1610158015610758575060668373ffffffffffffffffffffffffffffffffffffffff1611155b1561076857605783039250610802565b60418373ffffffffffffffffffffffffffffffffffffffff16101580156107a6575060468373ffffffffffffffffffffffffffffffffffffffff1611155b156107b657603783039250610801565b60308373ffffffffffffffffffffffffffffffffffffffff16101580156107f4575060398373ffffffffffffffffffffffffffffffffffffffff1611155b15610800576030830392505b5b5b60618273ffffffffffffffffffffffffffffffffffffffff1610158015610840575060668273ffffffffffffffffffffffffffffffffffffffff1611155b15610850576057820391506108ea565b60418273ffffffffffffffffffffffffffffffffffffffff161015801561088e575060468273ffffffffffffffffffffffffffffffffffffffff1611155b1561089e576037820391506108e9565b60308273ffffffffffffffffffffffffffffffffffffffff16101580156108dc575060398273ffffffffffffffffffffffffffffffffffffffff1611155b156108e8576030820391505b5b5b816010840201840193506002810190506106c9565b5082945050505050919050565b600047905090565b60606040518060400160405280600581526020017f3078314141000000000000000000000000000000000000000000000000000000815250905090565b60606040518060400160405280600681526020017f6331453533310000000000000000000000000000000000000000000000000000815250905090565b60606040518060400160405280600581526020017f4162413964000000000000000000000000000000000000000000000000000000815250905090565b60606040518060400160405280600781526020017f3830344665334200000000000000000000000000000000000000000000000000815250905090565b60606040518060400160405280600481526020017f3333313700000000000000000000000000000000000000000000000000000000815250905090565b60606040518060400160405280600481526020017f3537394400000000000000000000000000000000000000000000000000000000815250905090565b60606040518060400160405280600481526020017f3633653100000000000000000000000000000000000000000000000000000000815250905090565b60606040518060400160405280600781526020017f316133344561660000000000000000000000000000000000000000000000000081525090509056fea264697066735822122074089e6457267114f6b7b7bc50d39fa7e34774206fed4e31120051062933a01664736f6c63430006060033 | |
1 | 20,290,356 | d53e12e9eccd8494044bd13f0ef8a83efc4ff3c15b90fd0d3b4dbe87d163563c | 0f31db616474e3370e7b28498edd81e340a19e8da0637f3addecaf01c4fe47ae | 00bdb5699745f5b860228c8f939abf1b9ae374ed | ffa397285ce46fb78c588a9e993286aac68c37cd | 0a2054bc7452a1b0a0546939bd064389ab1233c0 | 3d602d80600a3d3981f3363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | pragma solidity 0.7.5;
/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//solhint-disable max-line-length
//solhint-disable no-inline-assembly
contract CloneFactory {
function createClone(address target, bytes32 salt)
internal
returns (address payable result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the clone contract data
let clone := mload(0x40)
// The bytecode block below is responsible for contract initialization
// during deployment, it is worth noting the proxied contract constructor will not be called during
// the cloning procedure and that is why an initialization function needs to be called after the
// clone is created
mstore(
clone,
0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000
)
// This stores the address location of the implementation contract
// so that the proxy knows where to delegate call logic to
mstore(add(clone, 0x14), targetBytes)
// The bytecode block is the actual code that is deployed for each clone created.
// It forwards all calls to the already deployed implementation via a delegatecall
mstore(
add(clone, 0x28),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// deploy the contract using the CREATE2 opcode
// this deploys the minimal proxy defined above, which will proxy all
// calls to use the logic defined in the implementation contract `target`
result := create2(0, clone, 0x37, salt)
}
}
function isClone(address target, address query)
internal
view
returns (bool result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the comparison clone
let clone := mload(0x40)
// The next three lines store the expected bytecode for a miniml proxy
// that targets `target` as its implementation contract
mstore(
clone,
0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000
)
mstore(add(clone, 0xa), targetBytes)
mstore(
add(clone, 0x1e),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// the next two lines store the bytecode of the contract that we are checking in memory
let other := add(clone, 0x40)
extcodecopy(query, other, 0, 0x2d)
// Check if the expected bytecode equals the actual bytecode and return the result
result := and(
eq(mload(clone), mload(other)),
eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
)
}
}
}
/**
* Contract that exposes the needed erc20 token functions
*/
abstract contract ERC20Interface {
// Send _value amount of tokens to address _to
function transfer(address _to, uint256 _value)
public
virtual
returns (bool success);
// Get the account balance of another account with address _owner
function balanceOf(address _owner)
public
virtual
view
returns (uint256 balance);
}
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeApprove: approve failed'
);
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeTransfer: transfer failed'
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::transferFrom: transferFrom failed'
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
}
}
/**
* Contract that will forward any incoming Ether to the creator of the contract
*
*/
contract Forwarder {
// Address to which any funds sent to this contract will be forwarded
address public parentAddress;
event ForwarderDeposited(address from, uint256 value, bytes data);
/**
* Initialize the contract, and sets the destination address to that of the creator
*/
function init(address _parentAddress) external onlyUninitialized {
parentAddress = _parentAddress;
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
// NOTE: since we are forwarding on initialization,
// we don't have the context of the original sender.
// We still emit an event about the forwarding but set
// the sender to the forwarder itself
emit ForwarderDeposited(address(this), value, msg.data);
}
/**
* Modifier that will execute internal code block only if the sender is the parent address
*/
modifier onlyParent {
require(msg.sender == parentAddress, 'Only Parent');
_;
}
/**
* Modifier that will execute internal code block only if the contract has not been initialized yet
*/
modifier onlyUninitialized {
require(parentAddress == address(0x0), 'Already initialized');
_;
}
/**
* Default function; Gets called when data is sent but does not match any other function
*/
fallback() external payable {
flush();
}
/**
* Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address
*/
receive() external payable {
flush();
}
/**
* Execute a token transfer of the full balance from the forwarder token to the parent address
* @param tokenContractAddress the address of the erc20 token contract
*/
function flushTokens(address tokenContractAddress) external onlyParent {
ERC20Interface instance = ERC20Interface(tokenContractAddress);
address forwarderAddress = address(this);
uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
if (forwarderBalance == 0) {
return;
}
TransferHelper.safeTransfer(
tokenContractAddress,
parentAddress,
forwarderBalance
);
}
/**
* Flush the entire balance of the contract to the parent address.
*/
function flush() public {
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
emit ForwarderDeposited(msg.sender, value, msg.data);
}
}
contract ForwarderFactory is CloneFactory {
address public implementationAddress;
event ForwarderCreated(address newForwarderAddress, address parentAddress);
constructor(address _implementationAddress) {
implementationAddress = _implementationAddress;
}
function createForwarder(address parent, bytes32 salt) external {
// include the signers in the salt so any contract deployed to a given address must have the same signers
bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt));
address payable clone = createClone(implementationAddress, finalSalt);
Forwarder(clone).init(parent);
emit ForwarderCreated(clone, parent);
}
} |
1 | 20,290,356 | d53e12e9eccd8494044bd13f0ef8a83efc4ff3c15b90fd0d3b4dbe87d163563c | b26d9c37303fe4399897611fb7c50aa4e35e634210fcb2785731cf27116af67c | c2ab32e60cda33672338aa175fc0118b87a5a486 | c2ab32e60cda33672338aa175fc0118b87a5a486 | 9a222124dfa2f1fe9070268160df344e2f118a80 | 6080604052600c805460ff191690555f6017553480156200001e575f80fd5b5060405162002c1438038062002c14833981016040819052620000419162000488565b338989600262000052838262000635565b50600362000061828262000635565b5060015f5550506001600160a01b0381166200009757604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b620000a281620002c7565b508151835114158015620000b857508051835114155b15620000d75760405163512509d360e11b815260040160405180910390fd5b5f805b8351811015620001ed57838181518110620000f957620000f962000701565b6020026020010151826200010e919062000715565b915083818151811062000125576200012562000701565b602002602001015160135f8381526020019081526020015f208190555084818151811062000157576200015762000701565b602002602001015160115f8381526020019081526020015f208190555082818151811062000189576200018962000701565b6020908102919091018101515f83815260128352604080822092909255601490925281208190556018805460018181018355919092527fb13d2d76d1f4b7be834882e410b3e3a8afaf69f83600ae24db354391d2378d2e90910182905501620000da565b50858111156200025c5760405163e066a8d760e01b815260206004820152603260248201527f4d617820737570706c7920706572206d696e742067726f7570206578636565646044820152717320746f74616c206d617820737570706c7960701b60648201526084016200008e565b600a869055600b859055600d62000274888262000635565b5050600f80546001600160a01b039098166001600160a01b03199889161790555050600e805490951673428deb81a93bed820068724eb1fcc7503d71e4171790945550505f601055506200073b92505050565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171562000357576200035762000318565b604052919050565b5f82601f8301126200036f575f80fd5b81516001600160401b038111156200038b576200038b62000318565b6020620003a1601f8301601f191682016200032c565b8281528582848701011115620003b5575f80fd5b5f5b83811015620003d4578581018301518282018401528201620003b7565b505f928101909101919091529392505050565b80516001600160a01b0381168114620003fe575f80fd5b919050565b5f82601f83011262000413575f80fd5b815160206001600160401b0382111562000431576200043162000318565b8160051b620004428282016200032c565b92835284810182019282810190878511156200045c575f80fd5b83870192505b848310156200047d5782518252918301919083019062000462565b979650505050505050565b5f805f805f805f805f6101208a8c031215620004a2575f80fd5b89516001600160401b0380821115620004b9575f80fd5b620004c78d838e016200035f565b9a5060208c0151915080821115620004dd575f80fd5b620004eb8d838e016200035f565b9950620004fb60408d01620003e7565b985060608c015191508082111562000511575f80fd5b6200051f8d838e016200035f565b975060808c0151965060a08c0151955060c08c015191508082111562000543575f80fd5b620005518d838e0162000403565b945060e08c015191508082111562000567575f80fd5b620005758d838e0162000403565b93506101008c01519150808211156200058c575f80fd5b506200059b8c828d0162000403565b9150509295985092959850929598565b600181811c90821680620005c057607f821691505b602082108103620005df57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156200063057805f5260205f20601f840160051c810160208510156200060c5750805b601f840160051c820191505b818110156200062d575f815560010162000618565b50505b505050565b81516001600160401b0381111562000651576200065162000318565b6200066981620006628454620005ab565b84620005e5565b602080601f8311600181146200069f575f8415620006875750858301515b5f19600386901b1c1916600185901b178555620006f9565b5f85815260208120601f198616915b82811015620006cf57888601518255948401946001909101908401620006ae565b5085821015620006ed57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b634e487b7160e01b5f52603260045260245ffd5b808201808211156200073557634e487b7160e01b5f52601160045260245ffd5b92915050565b6124cb80620007495f395ff3fe608060405260043610610275575f3560e01c80638da5cb5b1161014a578063c82e474b116100be578063e6a72acf11610078578063e6a72acf14610730578063e8656fcc1461075b578063e985e9c514610774578063f2fde38b14610793578063fac5dbc6146107b2578063fea414b6146107d1575f80fd5b8063c82e474b14610688578063c87b56dd146106a7578063cde27a35146106c6578063ce55c66a146106db578063d5abeb01146106f0578063e5fd114514610705575f80fd5b8063a75c3ad91161010f578063a75c3ad9146105f0578063a8ddf8f614610604578063ae4e494214610623578063b3978a8614610642578063b88d4fde14610661578063c20f388f14610674575f80fd5b80638da5cb5b14610577578063905d7b331461059457806391a57544146105a857806395d89b41146105bd578063a22cb465146105d1575f80fd5b80633ef009ef116101ec5780636352211e116101a65780636352211e146104b95780636c0360eb146104d857806370a08231146104ec578063715018a61461050b5780637bd4f0711461051f5780637c2003e31461053e575f80fd5b80633ef009ef14610408578063412753581461041b57806342842e0e1461043a578063483f0a821461044d5780634a5bd2fd1461046c57806355f804b31461049a575f80fd5b806316da3bc61161023d57806316da3bc61461033957806318160ddd1461037257806320704c5a1461038c57806321af27f6146103ab57806323b872dd146103ca57806324a663c3146103dd575f80fd5b806301ffc9a71461027957806306fdde03146102ad578063081812fc146102ce578063095ea7b31461030557806311f7acb91461031a575b5f80fd5b348015610284575f80fd5b50610298610293366004611e1c565b6107f1565b60405190151581526020015b60405180910390f35b3480156102b8575f80fd5b506102c1610801565b6040516102a49190611e84565b3480156102d9575f80fd5b506102ed6102e8366004611e96565b610891565b6040516001600160a01b0390911681526020016102a4565b610318610313366004611ec8565b6108d3565b005b348015610325575f80fd5b50610318610334366004611ef0565b610971565b348015610344575f80fd5b50610364610353366004611e96565b60116020525f908152604090205481565b6040519081526020016102a4565b34801561037d575f80fd5b506001545f54035f1901610364565b348015610397575f80fd5b506103186103a6366004611f55565b610a95565b3480156103b6575f80fd5b506103186103c5366004611f55565b610b32565b6103186103d8366004612003565b610bd2565b3480156103e8575f80fd5b506103646103f7366004611e96565b60136020525f908152604090205481565b61031861041636600461203c565b610d62565b348015610426575f80fd5b50600e546102ed906001600160a01b031681565b610318610448366004612003565b6111a1565b348015610458575f80fd5b50610364610467366004611e96565b6111bb565b348015610477575f80fd5b50610298610486366004611e96565b60166020525f908152604090205460ff1681565b3480156104a5575f80fd5b506103186104b43660046120c3565b6111da565b3480156104c4575f80fd5b506102ed6104d3366004611e96565b611220565b3480156104e3575f80fd5b506102c161122a565b3480156104f7575f80fd5b50610364610506366004612108565b6112b6565b348015610516575f80fd5b50610318611303565b34801561052a575f80fd5b50610318610539366004611ef0565b611316565b348015610549575f80fd5b50610298610558366004612121565b601560209081525f928352604080842090915290825290205460ff1681565b348015610582575f80fd5b506008546001600160a01b03166102ed565b34801561059f575f80fd5b5061031861132e565b3480156105b3575f80fd5b5061036460105481565b3480156105c8575f80fd5b506102c16114d4565b3480156105dc575f80fd5b506103186105eb36600461215a565b6114e3565b3480156105fb575f80fd5b5061031861154e565b34801561060f575f80fd5b5061031861061e366004612182565b6116a0565b34801561062e575f80fd5b50600f546102ed906001600160a01b031681565b34801561064d575f80fd5b5061031861065c36600461219b565b611729565b61031861066f3660046121b5565b611778565b34801561067f575f80fd5b506103186117bc565b348015610693575f80fd5b506103186106a2366004611ef0565b6117dd565b3480156106b2575f80fd5b506102c16106c1366004611e96565b61184b565b3480156106d1575f80fd5b5061036460175481565b3480156106e6575f80fd5b50610364600b5481565b3480156106fb575f80fd5b50610364600a5481565b348015610710575f80fd5b5061036461071f366004611e96565b60146020525f908152604090205481565b34801561073b575f80fd5b5061036461074a366004611e96565b60126020525f908152604090205481565b348015610766575f80fd5b50600c546102989060ff1681565b34801561077f575f80fd5b5061029861078e36600461222c565b6118cc565b34801561079e575f80fd5b506103186107ad366004612108565b6118f9565b3480156107bd575f80fd5b506103186107cc366004611e96565b611936565b3480156107dc575f80fd5b50335f90815260096020526040902054610364565b5f6107fb82611943565b92915050565b60606002805461081090612254565b80601f016020809104026020016040519081016040528092919081815260200182805461083c90612254565b80156108875780601f1061085e57610100808354040283529160200191610887565b820191905f5260205f20905b81548152906001019060200180831161086a57829003601f168201915b5050505050905090565b5f61089b82611990565b6108b8576040516333d1c03960e21b815260040160405180910390fd5b505f908152600660205260409020546001600160a01b031690565b5f6108dd82611220565b9050336001600160a01b03821614610916576108f981336118cc565b610916576040516367d9dca160e11b815260040160405180910390fd5b5f8281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6109796119c2565b610982826119ef565b61098f5761098f82611a37565b5f805b601854811015610a125783601882815481106109b0576109b061228c565b905f5260205f200154036109cf576109c883836122b4565b9150610a0a565b60135f601883815481106109e5576109e561228c565b905f5260205f20015481526020019081526020015f205482610a0791906122b4565b91505b600101610992565b50600a54811115610a835760405163e066a8d760e01b815260206004820152602f60248201527f4e657720737570706c7920706572206d696e742067726f75702065786365656460448201526e39903a37ba30b61039bab838363c9760891b60648201526084015b60405180910390fd5b505f9182526013602052604090912055565b610a9d6119c2565b610aa6816119ef565b610ab357610ab381611a37565b5f5b8251811015610b2d575f828152601560205260408120845160019290869085908110610ae357610ae361228c565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055601754610b229060016122b4565b601755600101610ab5565b505050565b610b3a6119c2565b610b43816119ef565b610b5057610b5081611a37565b5f5b8251811015610b2d575f82815260156020526040812084518290869085908110610b7e57610b7e61228c565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff191691151591909117905560175415610bca576001601754610bc691906122c7565b6017555b600101610b52565b5f610bdc82611a99565b9050836001600160a01b0316816001600160a01b031614610c0f5760405162a1148160e81b815260040160405180910390fd5b5f8281526006602052604090208054338082146001600160a01b03881690911417610c5b57610c3e86336118cc565b610c5b57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610c8257604051633a954ecd60e21b815260040160405180910390fd5b8015610c8c575f82555b6001600160a01b038681165f9081526005602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260046020526040812091909155600160e11b84169003610d1857600184015f818152600460205260408120549003610d16575f548114610d16575f8181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b600c5460ff16610d8557604051630d0ca57160e21b815260040160405180910390fd5b600c5460ff168015610da557505f8281526016602052604090205460ff16155b15610dc657604051630a1a930560e11b815260048101839052602401610a7a565b8115610e84575f82815260156020908152604080832033845290915281205460ff1615159003610e125760405163043374df60e21b815233600482015260248101839052604401610a7a565b5f82815260136020908152604080832054601490925290912054610e379085906122b4565b1115610e84575f828152601460209081526040808320546013909252909120548491610e62916122c7565b60405163cc3f2f1b60e01b815260048101929092526024820152604401610a7a565b5f82815260116020526040902054610ebe336001600160a01b03165f908152600560205260409081902054901c67ffffffffffffffff1690565b610ec890856122b4565b1115610f2657335f90815260056020526040908190205484911c67ffffffffffffffff165f84815260116020526040902054610f0491906122c7565b6040516303e635fb60e11b815260048101929092526024820152604401610a7a565b600a546001545f54859190035f1901610f3f91906122b4565b1115610f80576001545f54849190035f1901600a54610f5e91906122c7565b60405163adc3cee560e01b815260048101929092526024820152604401610a7a565b5f82815260126020526040812054610f999085906122da565b90505f84600b54610faa91906122da565b6064610fb78460036122da565b610fc191906122f1565b610fcb91906122b4565b90505f610fd882846122b4565b9050803410156110045760405163c108422360e01b815260048101829052346024820152604401610a7a565b6001600160a01b0384161580159061102557506001600160a01b0384163314155b15611085575f60646010548561103b91906122da565b61104591906122f1565b6001600160a01b0386165f908152600960205260408120805492935083929091906110719084906122b4565b90915550611081905081856122c7565b9350505b600f546001600160a01b03165f90815260096020526040812080548592906110ae9084906122b4565b9091555050600e546001600160a01b03165f90815260096020526040812080548492906110dc9084906122b4565b90915550505f85815260146020526040812080548892906110fe9084906122b4565b9091555061110e90503387611b02565b60408051878152602081018790526001600160a01b03861681830152905133917f264808566929c0a2c98376a25f69f0faa85b1ce885be5fc7eee7cd639f9c0c26919081900360600190a25f61116482346122c7565b9050801561119857604051339082156108fc029083905f818181858888f19350505050158015611196573d5f803e3d5ffd5b505b50505050505050565b610b2d83838360405180602001604052805f815250611778565b601881815481106111ca575f80fd5b5f91825260209091200154905081565b6111e26119c2565b600d6111ee8282612354565b506040515f19906001907f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c905f90a350565b5f6107fb82611a99565b600d805461123790612254565b80601f016020809104026020016040519081016040528092919081815260200182805461126390612254565b80156112ae5780601f10611285576101008083540402835291602001916112ae565b820191905f5260205f20905b81548152906001019060200180831161129157829003601f168201915b505050505081565b5f6001600160a01b0382166112de576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03165f9081526005602052604090205467ffffffffffffffff1690565b61130b6119c2565b6113145f611b1b565b565b61131e6119c2565b5f90815260116020526040902055565b6113366119c2565b600f546001600160a01b03165f9081526009602052604090205461139d5760405163e066a8d760e01b815260206004820152601c60248201527f5468657265206973206e6f7468696e6720746f207769746864726177000000006044820152606401610a7a565b600f80546001600160a01b039081165f908152600960205260408082208054600e80548616855283852054928590555485168452828420849055945491519093919091169084908381818185875af1925050503d805f811461141a576040519150601f19603f3d011682016040523d82523d5f602084013e61141f565b606091505b5050600e546040519192505f916001600160a01b039091169084908381818185875af1925050503d805f8114611470576040519150601f19603f3d011682016040523d82523d5f602084013e611475565b606091505b5050905081158015611485575080155b156114ce5760405163e066a8d760e01b815260206004820152601860248201527715da5d1a191c985dc8151c985b9cd9995c8811985a5b195960421b6044820152606401610a7a565b50505050565b60606003805461081090612254565b335f8181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600e546001600160a01b0316331461157b5760405163472511eb60e11b8152336004820152602401610a7a565b600e546001600160a01b03165f908152600960205260409020546115e25760405163e066a8d760e01b815260206004820152601c60248201527f5468657265206973206e6f7468696e6720746f207769746864726177000000006044820152606401610a7a565b600e80546001600160a01b039081165f90815260096020526040808220805490839055935490519192169083905b5f6040518083038185875af1925050503d805f811461164a576040519150601f19603f3d011682016040523d82523d5f602084013e61164f565b606091505b505090508061169c5760405163e066a8d760e01b815260206004820152601860248201527715da5d1a191c985dc8151c985b9cd9995c8811985a5b195960421b6044820152606401610a7a565b5050565b6116a86119c2565b600c5481151560ff9091161515036117165760405163e066a8d760e01b815260206004820152602a60248201527f4d696e742073746174757320697320616c726561647920746865206f6e6520796044820152691bdd48195b9d195c995960b21b6064820152608401610a7a565b600c805460ff1916911515919091179055565b6117316119c2565b61173a816119ef565b61175a57604051635831017d60e01b815260048101829052602401610a7a565b5f908152601660205260409020805460ff1916911515919091179055565b611783848484610bd2565b6001600160a01b0383163b156114ce5761179f84848484611b6c565b6114ce576040516368d2bf6b60e11b815260040160405180910390fd5b335f8181526009602052604080822080549083905590519092908390611610565b6117e56119c2565b6117ee816119ef565b6117fb576117fb81611a37565b5f81815260126020526040908190208390555181907fa7e52343431f792020e7cb8411a08014688ca11782fd5709fa2531b3d74ba4579061183f9085815260200190565b60405180910390a25050565b606061185682611990565b61187357604051630a14c4b560e41b815260040160405180910390fd5b5f61187c611c54565b905080515f0361189a5760405180602001604052805f8152506118c5565b806118a484611c63565b6040516020016118b5929190612410565b6040516020818303038152906040525b9392505050565b6001600160a01b039182165f90815260076020908152604080832093909416825291909152205460ff1690565b6119016119c2565b6001600160a01b03811661192a57604051631e4fbdf760e01b81525f6004820152602401610a7a565b61193381611b1b565b50565b61193e6119c2565b601055565b5f6301ffc9a760e01b6001600160e01b03198316148061197357506380ac58cd60e01b6001600160e01b03198316145b806107fb5750506001600160e01b031916635b5e139f60e01b1490565b5f816001111580156119a257505f5482105b80156107fb5750505f90815260046020526040902054600160e01b161590565b6008546001600160a01b031633146113145760405163118cdaa760e01b8152336004820152602401610a7a565b5f805b601854811015611a2f578260188281548110611a1057611a1061228c565b905f5260205f20015403611a275750600192915050565b6001016119f2565b505f92915050565b5f8181526012602090815260408083208390556011825280832083905560138252808320839055601490915281208190556018805460018101825591527fb13d2d76d1f4b7be834882e410b3e3a8afaf69f83600ae24db354391d2378d2e0155565b5f8180600111611ae9575f54811015611ae9575f8181526004602052604081205490600160e01b82169003611ae7575b805f036118c557505f19015f81815260046020526040902054611ac9565b505b604051636f96cda160e11b815260040160405180910390fd5b61169c828260405180602001604052805f815250611ca6565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a0290611ba090339089908890889060040161243e565b6020604051808303815f875af1925050508015611bda575060408051601f3d908101601f19168201909252611bd79181019061247a565b60015b611c36573d808015611c07576040519150601f19603f3d011682016040523d82523d5f602084013e611c0c565b606091505b5080515f03611c2e576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6060600d805461081090612254565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a900480611c7c5750819003601f19909101908152919050565b611cb08383611d0f565b6001600160a01b0383163b15610b2d575f548281035b611cd85f868380600101945086611b6c565b611cf5576040516368d2bf6b60e11b815260040160405180910390fd5b818110611cc657815f5414611d08575f80fd5b5050505050565b5f805490829003611d335760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0383165f8181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114611ddf5780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4600101611da9565b50815f03611dff57604051622e076360e81b815260040160405180910390fd5b5f5550505050565b6001600160e01b031981168114611933575f80fd5b5f60208284031215611e2c575f80fd5b81356118c581611e07565b5f5b83811015611e51578181015183820152602001611e39565b50505f910152565b5f8151808452611e70816020860160208601611e37565b601f01601f19169290920160200192915050565b602081525f6118c56020830184611e59565b5f60208284031215611ea6575f80fd5b5035919050565b80356001600160a01b0381168114611ec3575f80fd5b919050565b5f8060408385031215611ed9575f80fd5b611ee283611ead565b946020939093013593505050565b5f8060408385031215611f01575f80fd5b50508035926020909101359150565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611f4d57611f4d611f10565b604052919050565b5f8060408385031215611f66575f80fd5b823567ffffffffffffffff80821115611f7d575f80fd5b818501915085601f830112611f90575f80fd5b8135602082821115611fa457611fa4611f10565b8160051b9250611fb5818401611f24565b8281529284018101928181019089851115611fce575f80fd5b948201945b84861015611ff357611fe486611ead565b82529482019490820190611fd3565b9997909101359750505050505050565b5f805f60608486031215612015575f80fd5b61201e84611ead565b925061202c60208501611ead565b9150604084013590509250925092565b5f805f6060848603121561204e575f80fd5b833592506020840135915061206560408501611ead565b90509250925092565b5f67ffffffffffffffff83111561208757612087611f10565b61209a601f8401601f1916602001611f24565b90508281528383830111156120ad575f80fd5b828260208301375f602084830101529392505050565b5f602082840312156120d3575f80fd5b813567ffffffffffffffff8111156120e9575f80fd5b8201601f810184136120f9575f80fd5b611c4c8482356020840161206e565b5f60208284031215612118575f80fd5b6118c582611ead565b5f8060408385031215612132575f80fd5b8235915061214260208401611ead565b90509250929050565b80358015158114611ec3575f80fd5b5f806040838503121561216b575f80fd5b61217483611ead565b91506121426020840161214b565b5f60208284031215612192575f80fd5b6118c58261214b565b5f80604083850312156121ac575f80fd5b611ee28361214b565b5f805f80608085870312156121c8575f80fd5b6121d185611ead565b93506121df60208601611ead565b925060408501359150606085013567ffffffffffffffff811115612201575f80fd5b8501601f81018713612211575f80fd5b6122208782356020840161206e565b91505092959194509250565b5f806040838503121561223d575f80fd5b61224683611ead565b915061214260208401611ead565b600181811c9082168061226857607f821691505b60208210810361228657634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b808201808211156107fb576107fb6122a0565b818103818111156107fb576107fb6122a0565b80820281158282048414176107fb576107fb6122a0565b5f8261230b57634e487b7160e01b5f52601260045260245ffd5b500490565b601f821115610b2d57805f5260205f20601f840160051c810160208510156123355750805b601f840160051c820191505b81811015611d08575f8155600101612341565b815167ffffffffffffffff81111561236e5761236e611f10565b6123828161237c8454612254565b84612310565b602080601f8311600181146123b5575f841561239e5750858301515b5f19600386901b1c1916600185901b178555610d5a565b5f85815260208120601f198616915b828110156123e3578886015182559484019460019091019084016123c4565b508582101561240057878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f8351612421818460208801611e37565b835190830190612435818360208801611e37565b01949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f9061247090830184611e59565b9695505050505050565b5f6020828403121561248a575f80fd5b81516118c581611e0756fea2646970667358221220b42ac38c769a55ecc0689300bf678104bd967d1c55a15395ef7008b3af36530664736f6c6343000818003300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000c2ab32e60cda33672338aa175fc0118b87a5a48600000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000005766164696d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000256440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043697066733a2f2f6261667962656965353662686733637a786f34736b6174776c7a6a79666f68376d7261643263703772796b37333261346e6b61776666676a3569792f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000 | 608060405260043610610275575f3560e01c80638da5cb5b1161014a578063c82e474b116100be578063e6a72acf11610078578063e6a72acf14610730578063e8656fcc1461075b578063e985e9c514610774578063f2fde38b14610793578063fac5dbc6146107b2578063fea414b6146107d1575f80fd5b8063c82e474b14610688578063c87b56dd146106a7578063cde27a35146106c6578063ce55c66a146106db578063d5abeb01146106f0578063e5fd114514610705575f80fd5b8063a75c3ad91161010f578063a75c3ad9146105f0578063a8ddf8f614610604578063ae4e494214610623578063b3978a8614610642578063b88d4fde14610661578063c20f388f14610674575f80fd5b80638da5cb5b14610577578063905d7b331461059457806391a57544146105a857806395d89b41146105bd578063a22cb465146105d1575f80fd5b80633ef009ef116101ec5780636352211e116101a65780636352211e146104b95780636c0360eb146104d857806370a08231146104ec578063715018a61461050b5780637bd4f0711461051f5780637c2003e31461053e575f80fd5b80633ef009ef14610408578063412753581461041b57806342842e0e1461043a578063483f0a821461044d5780634a5bd2fd1461046c57806355f804b31461049a575f80fd5b806316da3bc61161023d57806316da3bc61461033957806318160ddd1461037257806320704c5a1461038c57806321af27f6146103ab57806323b872dd146103ca57806324a663c3146103dd575f80fd5b806301ffc9a71461027957806306fdde03146102ad578063081812fc146102ce578063095ea7b31461030557806311f7acb91461031a575b5f80fd5b348015610284575f80fd5b50610298610293366004611e1c565b6107f1565b60405190151581526020015b60405180910390f35b3480156102b8575f80fd5b506102c1610801565b6040516102a49190611e84565b3480156102d9575f80fd5b506102ed6102e8366004611e96565b610891565b6040516001600160a01b0390911681526020016102a4565b610318610313366004611ec8565b6108d3565b005b348015610325575f80fd5b50610318610334366004611ef0565b610971565b348015610344575f80fd5b50610364610353366004611e96565b60116020525f908152604090205481565b6040519081526020016102a4565b34801561037d575f80fd5b506001545f54035f1901610364565b348015610397575f80fd5b506103186103a6366004611f55565b610a95565b3480156103b6575f80fd5b506103186103c5366004611f55565b610b32565b6103186103d8366004612003565b610bd2565b3480156103e8575f80fd5b506103646103f7366004611e96565b60136020525f908152604090205481565b61031861041636600461203c565b610d62565b348015610426575f80fd5b50600e546102ed906001600160a01b031681565b610318610448366004612003565b6111a1565b348015610458575f80fd5b50610364610467366004611e96565b6111bb565b348015610477575f80fd5b50610298610486366004611e96565b60166020525f908152604090205460ff1681565b3480156104a5575f80fd5b506103186104b43660046120c3565b6111da565b3480156104c4575f80fd5b506102ed6104d3366004611e96565b611220565b3480156104e3575f80fd5b506102c161122a565b3480156104f7575f80fd5b50610364610506366004612108565b6112b6565b348015610516575f80fd5b50610318611303565b34801561052a575f80fd5b50610318610539366004611ef0565b611316565b348015610549575f80fd5b50610298610558366004612121565b601560209081525f928352604080842090915290825290205460ff1681565b348015610582575f80fd5b506008546001600160a01b03166102ed565b34801561059f575f80fd5b5061031861132e565b3480156105b3575f80fd5b5061036460105481565b3480156105c8575f80fd5b506102c16114d4565b3480156105dc575f80fd5b506103186105eb36600461215a565b6114e3565b3480156105fb575f80fd5b5061031861154e565b34801561060f575f80fd5b5061031861061e366004612182565b6116a0565b34801561062e575f80fd5b50600f546102ed906001600160a01b031681565b34801561064d575f80fd5b5061031861065c36600461219b565b611729565b61031861066f3660046121b5565b611778565b34801561067f575f80fd5b506103186117bc565b348015610693575f80fd5b506103186106a2366004611ef0565b6117dd565b3480156106b2575f80fd5b506102c16106c1366004611e96565b61184b565b3480156106d1575f80fd5b5061036460175481565b3480156106e6575f80fd5b50610364600b5481565b3480156106fb575f80fd5b50610364600a5481565b348015610710575f80fd5b5061036461071f366004611e96565b60146020525f908152604090205481565b34801561073b575f80fd5b5061036461074a366004611e96565b60126020525f908152604090205481565b348015610766575f80fd5b50600c546102989060ff1681565b34801561077f575f80fd5b5061029861078e36600461222c565b6118cc565b34801561079e575f80fd5b506103186107ad366004612108565b6118f9565b3480156107bd575f80fd5b506103186107cc366004611e96565b611936565b3480156107dc575f80fd5b50335f90815260096020526040902054610364565b5f6107fb82611943565b92915050565b60606002805461081090612254565b80601f016020809104026020016040519081016040528092919081815260200182805461083c90612254565b80156108875780601f1061085e57610100808354040283529160200191610887565b820191905f5260205f20905b81548152906001019060200180831161086a57829003601f168201915b5050505050905090565b5f61089b82611990565b6108b8576040516333d1c03960e21b815260040160405180910390fd5b505f908152600660205260409020546001600160a01b031690565b5f6108dd82611220565b9050336001600160a01b03821614610916576108f981336118cc565b610916576040516367d9dca160e11b815260040160405180910390fd5b5f8281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6109796119c2565b610982826119ef565b61098f5761098f82611a37565b5f805b601854811015610a125783601882815481106109b0576109b061228c565b905f5260205f200154036109cf576109c883836122b4565b9150610a0a565b60135f601883815481106109e5576109e561228c565b905f5260205f20015481526020019081526020015f205482610a0791906122b4565b91505b600101610992565b50600a54811115610a835760405163e066a8d760e01b815260206004820152602f60248201527f4e657720737570706c7920706572206d696e742067726f75702065786365656460448201526e39903a37ba30b61039bab838363c9760891b60648201526084015b60405180910390fd5b505f9182526013602052604090912055565b610a9d6119c2565b610aa6816119ef565b610ab357610ab381611a37565b5f5b8251811015610b2d575f828152601560205260408120845160019290869085908110610ae357610ae361228c565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055601754610b229060016122b4565b601755600101610ab5565b505050565b610b3a6119c2565b610b43816119ef565b610b5057610b5081611a37565b5f5b8251811015610b2d575f82815260156020526040812084518290869085908110610b7e57610b7e61228c565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff191691151591909117905560175415610bca576001601754610bc691906122c7565b6017555b600101610b52565b5f610bdc82611a99565b9050836001600160a01b0316816001600160a01b031614610c0f5760405162a1148160e81b815260040160405180910390fd5b5f8281526006602052604090208054338082146001600160a01b03881690911417610c5b57610c3e86336118cc565b610c5b57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610c8257604051633a954ecd60e21b815260040160405180910390fd5b8015610c8c575f82555b6001600160a01b038681165f9081526005602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260046020526040812091909155600160e11b84169003610d1857600184015f818152600460205260408120549003610d16575f548114610d16575f8181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b600c5460ff16610d8557604051630d0ca57160e21b815260040160405180910390fd5b600c5460ff168015610da557505f8281526016602052604090205460ff16155b15610dc657604051630a1a930560e11b815260048101839052602401610a7a565b8115610e84575f82815260156020908152604080832033845290915281205460ff1615159003610e125760405163043374df60e21b815233600482015260248101839052604401610a7a565b5f82815260136020908152604080832054601490925290912054610e379085906122b4565b1115610e84575f828152601460209081526040808320546013909252909120548491610e62916122c7565b60405163cc3f2f1b60e01b815260048101929092526024820152604401610a7a565b5f82815260116020526040902054610ebe336001600160a01b03165f908152600560205260409081902054901c67ffffffffffffffff1690565b610ec890856122b4565b1115610f2657335f90815260056020526040908190205484911c67ffffffffffffffff165f84815260116020526040902054610f0491906122c7565b6040516303e635fb60e11b815260048101929092526024820152604401610a7a565b600a546001545f54859190035f1901610f3f91906122b4565b1115610f80576001545f54849190035f1901600a54610f5e91906122c7565b60405163adc3cee560e01b815260048101929092526024820152604401610a7a565b5f82815260126020526040812054610f999085906122da565b90505f84600b54610faa91906122da565b6064610fb78460036122da565b610fc191906122f1565b610fcb91906122b4565b90505f610fd882846122b4565b9050803410156110045760405163c108422360e01b815260048101829052346024820152604401610a7a565b6001600160a01b0384161580159061102557506001600160a01b0384163314155b15611085575f60646010548561103b91906122da565b61104591906122f1565b6001600160a01b0386165f908152600960205260408120805492935083929091906110719084906122b4565b90915550611081905081856122c7565b9350505b600f546001600160a01b03165f90815260096020526040812080548592906110ae9084906122b4565b9091555050600e546001600160a01b03165f90815260096020526040812080548492906110dc9084906122b4565b90915550505f85815260146020526040812080548892906110fe9084906122b4565b9091555061110e90503387611b02565b60408051878152602081018790526001600160a01b03861681830152905133917f264808566929c0a2c98376a25f69f0faa85b1ce885be5fc7eee7cd639f9c0c26919081900360600190a25f61116482346122c7565b9050801561119857604051339082156108fc029083905f818181858888f19350505050158015611196573d5f803e3d5ffd5b505b50505050505050565b610b2d83838360405180602001604052805f815250611778565b601881815481106111ca575f80fd5b5f91825260209091200154905081565b6111e26119c2565b600d6111ee8282612354565b506040515f19906001907f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c905f90a350565b5f6107fb82611a99565b600d805461123790612254565b80601f016020809104026020016040519081016040528092919081815260200182805461126390612254565b80156112ae5780601f10611285576101008083540402835291602001916112ae565b820191905f5260205f20905b81548152906001019060200180831161129157829003601f168201915b505050505081565b5f6001600160a01b0382166112de576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03165f9081526005602052604090205467ffffffffffffffff1690565b61130b6119c2565b6113145f611b1b565b565b61131e6119c2565b5f90815260116020526040902055565b6113366119c2565b600f546001600160a01b03165f9081526009602052604090205461139d5760405163e066a8d760e01b815260206004820152601c60248201527f5468657265206973206e6f7468696e6720746f207769746864726177000000006044820152606401610a7a565b600f80546001600160a01b039081165f908152600960205260408082208054600e80548616855283852054928590555485168452828420849055945491519093919091169084908381818185875af1925050503d805f811461141a576040519150601f19603f3d011682016040523d82523d5f602084013e61141f565b606091505b5050600e546040519192505f916001600160a01b039091169084908381818185875af1925050503d805f8114611470576040519150601f19603f3d011682016040523d82523d5f602084013e611475565b606091505b5050905081158015611485575080155b156114ce5760405163e066a8d760e01b815260206004820152601860248201527715da5d1a191c985dc8151c985b9cd9995c8811985a5b195960421b6044820152606401610a7a565b50505050565b60606003805461081090612254565b335f8181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600e546001600160a01b0316331461157b5760405163472511eb60e11b8152336004820152602401610a7a565b600e546001600160a01b03165f908152600960205260409020546115e25760405163e066a8d760e01b815260206004820152601c60248201527f5468657265206973206e6f7468696e6720746f207769746864726177000000006044820152606401610a7a565b600e80546001600160a01b039081165f90815260096020526040808220805490839055935490519192169083905b5f6040518083038185875af1925050503d805f811461164a576040519150601f19603f3d011682016040523d82523d5f602084013e61164f565b606091505b505090508061169c5760405163e066a8d760e01b815260206004820152601860248201527715da5d1a191c985dc8151c985b9cd9995c8811985a5b195960421b6044820152606401610a7a565b5050565b6116a86119c2565b600c5481151560ff9091161515036117165760405163e066a8d760e01b815260206004820152602a60248201527f4d696e742073746174757320697320616c726561647920746865206f6e6520796044820152691bdd48195b9d195c995960b21b6064820152608401610a7a565b600c805460ff1916911515919091179055565b6117316119c2565b61173a816119ef565b61175a57604051635831017d60e01b815260048101829052602401610a7a565b5f908152601660205260409020805460ff1916911515919091179055565b611783848484610bd2565b6001600160a01b0383163b156114ce5761179f84848484611b6c565b6114ce576040516368d2bf6b60e11b815260040160405180910390fd5b335f8181526009602052604080822080549083905590519092908390611610565b6117e56119c2565b6117ee816119ef565b6117fb576117fb81611a37565b5f81815260126020526040908190208390555181907fa7e52343431f792020e7cb8411a08014688ca11782fd5709fa2531b3d74ba4579061183f9085815260200190565b60405180910390a25050565b606061185682611990565b61187357604051630a14c4b560e41b815260040160405180910390fd5b5f61187c611c54565b905080515f0361189a5760405180602001604052805f8152506118c5565b806118a484611c63565b6040516020016118b5929190612410565b6040516020818303038152906040525b9392505050565b6001600160a01b039182165f90815260076020908152604080832093909416825291909152205460ff1690565b6119016119c2565b6001600160a01b03811661192a57604051631e4fbdf760e01b81525f6004820152602401610a7a565b61193381611b1b565b50565b61193e6119c2565b601055565b5f6301ffc9a760e01b6001600160e01b03198316148061197357506380ac58cd60e01b6001600160e01b03198316145b806107fb5750506001600160e01b031916635b5e139f60e01b1490565b5f816001111580156119a257505f5482105b80156107fb5750505f90815260046020526040902054600160e01b161590565b6008546001600160a01b031633146113145760405163118cdaa760e01b8152336004820152602401610a7a565b5f805b601854811015611a2f578260188281548110611a1057611a1061228c565b905f5260205f20015403611a275750600192915050565b6001016119f2565b505f92915050565b5f8181526012602090815260408083208390556011825280832083905560138252808320839055601490915281208190556018805460018101825591527fb13d2d76d1f4b7be834882e410b3e3a8afaf69f83600ae24db354391d2378d2e0155565b5f8180600111611ae9575f54811015611ae9575f8181526004602052604081205490600160e01b82169003611ae7575b805f036118c557505f19015f81815260046020526040902054611ac9565b505b604051636f96cda160e11b815260040160405180910390fd5b61169c828260405180602001604052805f815250611ca6565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a0290611ba090339089908890889060040161243e565b6020604051808303815f875af1925050508015611bda575060408051601f3d908101601f19168201909252611bd79181019061247a565b60015b611c36573d808015611c07576040519150601f19603f3d011682016040523d82523d5f602084013e611c0c565b606091505b5080515f03611c2e576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6060600d805461081090612254565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a900480611c7c5750819003601f19909101908152919050565b611cb08383611d0f565b6001600160a01b0383163b15610b2d575f548281035b611cd85f868380600101945086611b6c565b611cf5576040516368d2bf6b60e11b815260040160405180910390fd5b818110611cc657815f5414611d08575f80fd5b5050505050565b5f805490829003611d335760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0383165f8181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114611ddf5780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4600101611da9565b50815f03611dff57604051622e076360e81b815260040160405180910390fd5b5f5550505050565b6001600160e01b031981168114611933575f80fd5b5f60208284031215611e2c575f80fd5b81356118c581611e07565b5f5b83811015611e51578181015183820152602001611e39565b50505f910152565b5f8151808452611e70816020860160208601611e37565b601f01601f19169290920160200192915050565b602081525f6118c56020830184611e59565b5f60208284031215611ea6575f80fd5b5035919050565b80356001600160a01b0381168114611ec3575f80fd5b919050565b5f8060408385031215611ed9575f80fd5b611ee283611ead565b946020939093013593505050565b5f8060408385031215611f01575f80fd5b50508035926020909101359150565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611f4d57611f4d611f10565b604052919050565b5f8060408385031215611f66575f80fd5b823567ffffffffffffffff80821115611f7d575f80fd5b818501915085601f830112611f90575f80fd5b8135602082821115611fa457611fa4611f10565b8160051b9250611fb5818401611f24565b8281529284018101928181019089851115611fce575f80fd5b948201945b84861015611ff357611fe486611ead565b82529482019490820190611fd3565b9997909101359750505050505050565b5f805f60608486031215612015575f80fd5b61201e84611ead565b925061202c60208501611ead565b9150604084013590509250925092565b5f805f6060848603121561204e575f80fd5b833592506020840135915061206560408501611ead565b90509250925092565b5f67ffffffffffffffff83111561208757612087611f10565b61209a601f8401601f1916602001611f24565b90508281528383830111156120ad575f80fd5b828260208301375f602084830101529392505050565b5f602082840312156120d3575f80fd5b813567ffffffffffffffff8111156120e9575f80fd5b8201601f810184136120f9575f80fd5b611c4c8482356020840161206e565b5f60208284031215612118575f80fd5b6118c582611ead565b5f8060408385031215612132575f80fd5b8235915061214260208401611ead565b90509250929050565b80358015158114611ec3575f80fd5b5f806040838503121561216b575f80fd5b61217483611ead565b91506121426020840161214b565b5f60208284031215612192575f80fd5b6118c58261214b565b5f80604083850312156121ac575f80fd5b611ee28361214b565b5f805f80608085870312156121c8575f80fd5b6121d185611ead565b93506121df60208601611ead565b925060408501359150606085013567ffffffffffffffff811115612201575f80fd5b8501601f81018713612211575f80fd5b6122208782356020840161206e565b91505092959194509250565b5f806040838503121561223d575f80fd5b61224683611ead565b915061214260208401611ead565b600181811c9082168061226857607f821691505b60208210810361228657634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b808201808211156107fb576107fb6122a0565b818103818111156107fb576107fb6122a0565b80820281158282048414176107fb576107fb6122a0565b5f8261230b57634e487b7160e01b5f52601260045260245ffd5b500490565b601f821115610b2d57805f5260205f20601f840160051c810160208510156123355750805b601f840160051c820191505b81811015611d08575f8155600101612341565b815167ffffffffffffffff81111561236e5761236e611f10565b6123828161237c8454612254565b84612310565b602080601f8311600181146123b5575f841561239e5750858301515b5f19600386901b1c1916600185901b178555610d5a565b5f85815260208120601f198616915b828110156123e3578886015182559484019460019091019084016123c4565b508582101561240057878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f8351612421818460208801611e37565b835190830190612435818360208801611e37565b01949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f9061247090830184611e59565b9695505050505050565b5f6020828403121561248a575f80fd5b81516118c581611e0756fea2646970667358221220b42ac38c769a55ecc0689300bf678104bd967d1c55a15395ef7008b3af36530664736f6c63430008180033 | |
1 | 20,290,358 | 6df6e567558b567eb23593ec6f145b858350afc234296eb0b480609a8869861c | 513113821902a9ca136d765bd5f0294d63394f810b290a3c56a7edb41671f4d6 | 87d122fb4ee879cd384c09caf40152f00a0fc1b5 | 87d122fb4ee879cd384c09caf40152f00a0fc1b5 | 560ad5529670d0d707d99263a640ffdab83c9258 | 608060405234801561001057600080fd5b50600080546001600160a01b0319338181169190921617811782558152600360205260409020805460ff19166001179055611078806100506000396000f3fe6080604052600436106100c65760003560e01c80638c21b2901161007f578063dad2e3a811610059578063dad2e3a8146101e4578063ec1f3f6314610204578063f429389014610224578063fbecd52514610239576100e9565b80638c21b290146101845780639059b154146101a457806391b8f681146101c4576100e9565b806320517ae11461010557806320800a001461011a578063430fdd3f1461012f57806349bc17e91461010557806351bc3c851461014f578063839006f214610164576100e9565b366100e9573260009081526003602052604090205460ff166100e757600080fd5b005b3260009081526003602052604090205460ff166100e757600080fd5b34801561011157600080fd5b506100e7610259565b34801561012657600080fd5b506100e76104d0565b34801561013b57600080fd5b506100e761014a366004610ca3565b61051b565b34801561015b57600080fd5b506100e761058d565b34801561017057600080fd5b506100e761017f366004610cee565b610621565b34801561019057600080fd5b506100e761019f366004610d12565b610758565b3480156101b057600080fd5b506100e76101bf366004610d2b565b61077d565b3480156101d057600080fd5b506100e76101df366004610d94565b61081b565b3480156101f057600080fd5b506100e76101ff366004610e59565b61089f565b34801561021057600080fd5b506100e761021f366004610d12565b61092e565b34801561023057600080fd5b506100e76109b2565b34801561024557600080fd5b506100e7610254366004610e90565b610a2c565b3360009081526003602052604090205460ff1661027557600080fd5b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce5679160048083019260209291908290030181865afa1580156102bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e39190610ebc565b6102ee906001610eeb565b6001546002546040516370a0823160e01b81526001600160a01b0391821660048201529116906370a0823190602401602060405180830381865afa15801561033a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061035e9190610ebc565b6103689190610f08565b6001546002546040516323b872dd60e01b81526001600160a01b0391821660048201523060248201526044810184905292935016906323b872dd906064016020604051808303816000875af11580156103c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e99190610f1b565b50600260009054906101000a90046001600160a01b03166001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b50506001546040516370a0823160e01b8152306004820152600093506001600160a01b0390911691506370a0823190602401602060405180830381865afa15801561049d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c19190610ebc565b90506104cc81610a83565b5050565b3360009081526003602052604090205460ff166104ec57600080fd5b60405133904780156108fc02916000818181858888f19350505050158015610518573d6000803e3d6000fd5b50565b6000546001600160a01b0316331461054e5760405162461bcd60e51b815260040161054590610f3d565b60405180910390fd5b600480546001600160a01b039485166001600160a01b031991821617909155600180549385169382169390931790925560028054919093169116179055565b6000546001600160a01b031633146105b75760405162461bcd60e51b815260040161054590610f3d565b600160009054906101000a90046001600160a01b03166001600160a01b03166351bc3c856040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561060757600080fd5b505af115801561061b573d6000803e3d6000fd5b50505050565b3360009081526003602052604090205460ff1661063d57600080fd5b6001600160a01b0381166106775760405133904780156108fc02916000818181858888f193505050501580156104cc573d6000803e3d6000fd5b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa1580156106c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e99190610ebc565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610734573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cc9190610f1b565b3360009081526003602052604090205460ff1661077457600080fd5b61051881610a83565b3360009081526003602052604090205460ff1661079957600080fd5b6040516323b872dd60e01b81526001600160a01b0383811660048301528281166024830152604482018590528516906323b872dd906064016020604051808303816000875af11580156107f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108149190610f1b565b5050505050565b3360009081526003602052604090205460ff1661083757600080fd5b60005b81518110156104cc5760016003600084848151811061085b5761085b610f72565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061089781610f88565b91505061083a565b3360009081526003602052604090205460ff166108bb57600080fd5b60405163a9059cbb60e01b81526001600160a01b0382811660048301526024820184905284169063a9059cbb906044016020604051808303816000875af115801561090a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061b9190610f1b565b6000546001600160a01b031633146109585760405162461bcd60e51b815260040161054590610f3d565b60015460405163ec1f3f6360e01b8152600481018390526001600160a01b039091169063ec1f3f6390602401600060405180830381600087803b15801561099e57600080fd5b505af1158015610814573d6000803e3d6000fd5b6000546001600160a01b031633146109dc5760405162461bcd60e51b815260040161054590610f3d565b600160009054906101000a90046001600160a01b03166001600160a01b0316636fc3eaec6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561060757600080fd5b3360009081526003602052604090205460ff16610a4857600080fd5b6040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610a7e573d6000803e3d6000fd5b505050565b604080516002808252606082018352600092602083019080368337505060015482519293506001600160a01b031691839150600090610ac457610ac4610f72565b60200260200101906001600160a01b031690816001600160a01b031681525050600460009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b9190610fa1565b81600181518110610b6e57610b6e610f72565b6001600160a01b0392831660209182029290920101526001546004805460405163095ea7b360e01b815290841691810191909152600019602482015291169063095ea7b3906044016020604051808303816000875af1158015610bd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf99190610f1b565b50600454600080546001600160a01b039283169263791ac9479286929091869116610c2842633b9aca00610fbe565b6040518663ffffffff1660e01b8152600401610c48959493929190610fd1565b600060405180830381600087803b158015610c6257600080fd5b505af1158015610c76573d6000803e3d6000fd5b505050505050565b6001600160a01b038116811461051857600080fd5b8035610c9e81610c7e565b919050565b600080600060608486031215610cb857600080fd5b8335610cc381610c7e565b92506020840135610cd381610c7e565b91506040840135610ce381610c7e565b809150509250925092565b600060208284031215610d0057600080fd5b8135610d0b81610c7e565b9392505050565b600060208284031215610d2457600080fd5b5035919050565b60008060008060808587031215610d4157600080fd5b8435610d4c81610c7e565b9350602085013592506040850135610d6381610c7e565b91506060850135610d7381610c7e565b939692955090935050565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215610da757600080fd5b823567ffffffffffffffff80821115610dbf57600080fd5b818501915085601f830112610dd357600080fd5b813581811115610de557610de5610d7e565b8060051b604051601f19603f83011681018181108582111715610e0a57610e0a610d7e565b604052918252848201925083810185019188831115610e2857600080fd5b938501935b82851015610e4d57610e3e85610c93565b84529385019392850192610e2d565b98975050505050505050565b600080600060608486031215610e6e57600080fd5b8335610e7981610c7e565b9250602084013591506040840135610ce381610c7e565b60008060408385031215610ea357600080fd5b8235610eae81610c7e565b946020939093013593505050565b600060208284031215610ece57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610f0257610f02610ed5565b92915050565b81810381811115610f0257610f02610ed5565b600060208284031215610f2d57600080fd5b81518015158114610d0b57600080fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060018201610f9a57610f9a610ed5565b5060010190565b600060208284031215610fb357600080fd5b8151610d0b81610c7e565b80820180821115610f0257610f02610ed5565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156110215784516001600160a01b031683529383019391830191600101610ffc565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220380179394a3c39dd689adc75765162a07e34321496a5163ce8b6c9f84986532e64736f6c63430008130033 | 6080604052600436106100c65760003560e01c80638c21b2901161007f578063dad2e3a811610059578063dad2e3a8146101e4578063ec1f3f6314610204578063f429389014610224578063fbecd52514610239576100e9565b80638c21b290146101845780639059b154146101a457806391b8f681146101c4576100e9565b806320517ae11461010557806320800a001461011a578063430fdd3f1461012f57806349bc17e91461010557806351bc3c851461014f578063839006f214610164576100e9565b366100e9573260009081526003602052604090205460ff166100e757600080fd5b005b3260009081526003602052604090205460ff166100e757600080fd5b34801561011157600080fd5b506100e7610259565b34801561012657600080fd5b506100e76104d0565b34801561013b57600080fd5b506100e761014a366004610ca3565b61051b565b34801561015b57600080fd5b506100e761058d565b34801561017057600080fd5b506100e761017f366004610cee565b610621565b34801561019057600080fd5b506100e761019f366004610d12565b610758565b3480156101b057600080fd5b506100e76101bf366004610d2b565b61077d565b3480156101d057600080fd5b506100e76101df366004610d94565b61081b565b3480156101f057600080fd5b506100e76101ff366004610e59565b61089f565b34801561021057600080fd5b506100e761021f366004610d12565b61092e565b34801561023057600080fd5b506100e76109b2565b34801561024557600080fd5b506100e7610254366004610e90565b610a2c565b3360009081526003602052604090205460ff1661027557600080fd5b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce5679160048083019260209291908290030181865afa1580156102bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e39190610ebc565b6102ee906001610eeb565b6001546002546040516370a0823160e01b81526001600160a01b0391821660048201529116906370a0823190602401602060405180830381865afa15801561033a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061035e9190610ebc565b6103689190610f08565b6001546002546040516323b872dd60e01b81526001600160a01b0391821660048201523060248201526044810184905292935016906323b872dd906064016020604051808303816000875af11580156103c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e99190610f1b565b50600260009054906101000a90046001600160a01b03166001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b50506001546040516370a0823160e01b8152306004820152600093506001600160a01b0390911691506370a0823190602401602060405180830381865afa15801561049d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c19190610ebc565b90506104cc81610a83565b5050565b3360009081526003602052604090205460ff166104ec57600080fd5b60405133904780156108fc02916000818181858888f19350505050158015610518573d6000803e3d6000fd5b50565b6000546001600160a01b0316331461054e5760405162461bcd60e51b815260040161054590610f3d565b60405180910390fd5b600480546001600160a01b039485166001600160a01b031991821617909155600180549385169382169390931790925560028054919093169116179055565b6000546001600160a01b031633146105b75760405162461bcd60e51b815260040161054590610f3d565b600160009054906101000a90046001600160a01b03166001600160a01b03166351bc3c856040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561060757600080fd5b505af115801561061b573d6000803e3d6000fd5b50505050565b3360009081526003602052604090205460ff1661063d57600080fd5b6001600160a01b0381166106775760405133904780156108fc02916000818181858888f193505050501580156104cc573d6000803e3d6000fd5b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa1580156106c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e99190610ebc565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610734573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cc9190610f1b565b3360009081526003602052604090205460ff1661077457600080fd5b61051881610a83565b3360009081526003602052604090205460ff1661079957600080fd5b6040516323b872dd60e01b81526001600160a01b0383811660048301528281166024830152604482018590528516906323b872dd906064016020604051808303816000875af11580156107f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108149190610f1b565b5050505050565b3360009081526003602052604090205460ff1661083757600080fd5b60005b81518110156104cc5760016003600084848151811061085b5761085b610f72565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061089781610f88565b91505061083a565b3360009081526003602052604090205460ff166108bb57600080fd5b60405163a9059cbb60e01b81526001600160a01b0382811660048301526024820184905284169063a9059cbb906044016020604051808303816000875af115801561090a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061b9190610f1b565b6000546001600160a01b031633146109585760405162461bcd60e51b815260040161054590610f3d565b60015460405163ec1f3f6360e01b8152600481018390526001600160a01b039091169063ec1f3f6390602401600060405180830381600087803b15801561099e57600080fd5b505af1158015610814573d6000803e3d6000fd5b6000546001600160a01b031633146109dc5760405162461bcd60e51b815260040161054590610f3d565b600160009054906101000a90046001600160a01b03166001600160a01b0316636fc3eaec6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561060757600080fd5b3360009081526003602052604090205460ff16610a4857600080fd5b6040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610a7e573d6000803e3d6000fd5b505050565b604080516002808252606082018352600092602083019080368337505060015482519293506001600160a01b031691839150600090610ac457610ac4610f72565b60200260200101906001600160a01b031690816001600160a01b031681525050600460009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b9190610fa1565b81600181518110610b6e57610b6e610f72565b6001600160a01b0392831660209182029290920101526001546004805460405163095ea7b360e01b815290841691810191909152600019602482015291169063095ea7b3906044016020604051808303816000875af1158015610bd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf99190610f1b565b50600454600080546001600160a01b039283169263791ac9479286929091869116610c2842633b9aca00610fbe565b6040518663ffffffff1660e01b8152600401610c48959493929190610fd1565b600060405180830381600087803b158015610c6257600080fd5b505af1158015610c76573d6000803e3d6000fd5b505050505050565b6001600160a01b038116811461051857600080fd5b8035610c9e81610c7e565b919050565b600080600060608486031215610cb857600080fd5b8335610cc381610c7e565b92506020840135610cd381610c7e565b91506040840135610ce381610c7e565b809150509250925092565b600060208284031215610d0057600080fd5b8135610d0b81610c7e565b9392505050565b600060208284031215610d2457600080fd5b5035919050565b60008060008060808587031215610d4157600080fd5b8435610d4c81610c7e565b9350602085013592506040850135610d6381610c7e565b91506060850135610d7381610c7e565b939692955090935050565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215610da757600080fd5b823567ffffffffffffffff80821115610dbf57600080fd5b818501915085601f830112610dd357600080fd5b813581811115610de557610de5610d7e565b8060051b604051601f19603f83011681018181108582111715610e0a57610e0a610d7e565b604052918252848201925083810185019188831115610e2857600080fd5b938501935b82851015610e4d57610e3e85610c93565b84529385019392850192610e2d565b98975050505050505050565b600080600060608486031215610e6e57600080fd5b8335610e7981610c7e565b9250602084013591506040840135610ce381610c7e565b60008060408385031215610ea357600080fd5b8235610eae81610c7e565b946020939093013593505050565b600060208284031215610ece57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610f0257610f02610ed5565b92915050565b81810381811115610f0257610f02610ed5565b600060208284031215610f2d57600080fd5b81518015158114610d0b57600080fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060018201610f9a57610f9a610ed5565b5060010190565b600060208284031215610fb357600080fd5b8151610d0b81610c7e565b80820180821115610f0257610f02610ed5565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156110215784516001600160a01b031683529383019391830191600101610ffc565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220380179394a3c39dd689adc75765162a07e34321496a5163ce8b6c9f84986532e64736f6c63430008130033 | |
1 | 20,290,361 | 92f875fca61ceccf0eff4a95ad4b2160091f939ff5bb2573a26c6f7d4d0cbf12 | 7effdde57229660ee0ba50c65ae1d02f216cb35b18f9712daa996ed6af646ad3 | 3d529c760f3ec4c89bdd6549ddabe9097c1da6e9 | 7e80bd5a2e8fca0b160254d43ac9f43ac2cc1052 | 5dd131332fe5002c24902fe696f26c23b6896d5d | 6080604052348015600f57600080fd5b50604051610191380380610191833981016040819052602c9160b4565b6001600160a01b03811660905760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642073696e676c65746f6e20616464726573732070726f766964604482015261195960f21b606482015260840160405180910390fd5b600080546001600160a01b0319166001600160a01b039290921691909117905560e2565b60006020828403121560c557600080fd5b81516001600160a01b038116811460db57600080fd5b9392505050565b60a1806100f06000396000f3fe6080604052600073ffffffffffffffffffffffffffffffffffffffff8154167fa619486e00000000000000000000000000000000000000000000000000000000823503604d57808252602082f35b3682833781823684845af490503d82833e806066573d82fd5b503d81f3fea2646970667358221220f459f654b2dfcb442c5cba1925f8fabafea34ef6bbc3d170d739523834b41f4264736f6c634300081900330000000000000000000000008873b07428f621e543ff4577e812ee7bda43a4d5 | 6080604052600073ffffffffffffffffffffffffffffffffffffffff8154167fa619486e00000000000000000000000000000000000000000000000000000000823503604d57808252602082f35b3682833781823684845af490503d82833e806066573d82fd5b503d81f3fea2646970667358221220f459f654b2dfcb442c5cba1925f8fabafea34ef6bbc3d170d739523834b41f4264736f6c63430008190033 | {{
"language": "Solidity",
"sources": {
"contracts/Proxy.sol": {
"content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity 0.8.25;\n\n// This code was borrowed from Safe's v1.4.1-build.0:\n// https://github.com/safe-global/safe-smart-account/blob/8b9023d9a2627ecbb5c40592e762857980f8e880/contracts/proxies/SafeProxy.sol\n//\n// The only changes applied were the rename of the interface and the contract.\n\n/**\n * @title IProxyWithMasterCopy - Helper interface to access the singleton address of the Proxy on-chain.\n * @author Richard Meissner - @rmeissner\n */\ninterface IProxyWithMasterCopy {\n function masterCopy() external view returns (address);\n}\n\n/**\n * @title Proxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\n * @author Stefan George - <[email protected]>\n * @author Richard Meissner - <[email protected]>\n */\n// slither-disable-next-line locked-ether\ncontract Proxy {\n // Singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\n // slither-disable-next-line immutable-states\n address internal singleton;\n\n /**\n * @notice Constructor function sets address of singleton contract.\n * @param _singleton Singleton address.\n */\n constructor(address _singleton) {\n require(_singleton != address(0), \"Invalid singleton address provided\");\n singleton = _singleton;\n }\n\n /// @dev Fallback function forwards all transactions and returns all received return data.\n fallback() external payable {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let _singleton := and(\n sload(0),\n 0xffffffffffffffffffffffffffffffffffffffff\n )\n // 0xa619486e == keccak(\"masterCopy()\"). The value is right padded to 32-bytes with 0s\n if eq(\n calldataload(0),\n 0xa619486e00000000000000000000000000000000000000000000000000000000\n ) {\n mstore(0, _singleton)\n return(0, 0x20)\n }\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(\n gas(),\n _singleton,\n 0,\n calldatasize(),\n 0,\n 0\n )\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 10000
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}
}} |
1 | 20,290,361 | 92f875fca61ceccf0eff4a95ad4b2160091f939ff5bb2573a26c6f7d4d0cbf12 | 7effdde57229660ee0ba50c65ae1d02f216cb35b18f9712daa996ed6af646ad3 | 3d529c760f3ec4c89bdd6549ddabe9097c1da6e9 | 7e80bd5a2e8fca0b160254d43ac9f43ac2cc1052 | d4434cb4d6c31a72553ec8afed3e757e8cea47c4 | 6080604052348015600f57600080fd5b50604051610191380380610191833981016040819052602c9160b4565b6001600160a01b03811660905760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642073696e676c65746f6e20616464726573732070726f766964604482015261195960f21b606482015260840160405180910390fd5b600080546001600160a01b0319166001600160a01b039290921691909117905560e2565b60006020828403121560c557600080fd5b81516001600160a01b038116811460db57600080fd5b9392505050565b60a1806100f06000396000f3fe6080604052600073ffffffffffffffffffffffffffffffffffffffff8154167fa619486e00000000000000000000000000000000000000000000000000000000823503604d57808252602082f35b3682833781823684845af490503d82833e806066573d82fd5b503d81f3fea2646970667358221220f89ca516c377163343639e4278fbb9e3e2d018eddf7c97364e813fbb6dac5a8764736f6c6343000819003300000000000000000000000041675c099f32341bf84bfc5382af534df5c7461a | 6080604052600073ffffffffffffffffffffffffffffffffffffffff8154167fa619486e00000000000000000000000000000000000000000000000000000000823503604d57808252602082f35b3682833781823684845af490503d82833e806066573d82fd5b503d81f3fea2646970667358221220f89ca516c377163343639e4278fbb9e3e2d018eddf7c97364e813fbb6dac5a8764736f6c63430008190033 | |
1 | 20,290,367 | e86ded2d111e7d1ffb165dfc9da7d4c6045ef9c0d6436fda8b66c9e86a82f066 | 89461ee71accd12341a2038dd29a66f026aca3a077e18940e29cef606f437d98 | 3aeb5831f91d29b3992d659821a7fed7b805a107 | ffa397285ce46fb78c588a9e993286aac68c37cd | 8a1b7b0f3fd788861147adc04ae78d57392fe6cd | 3d602d80600a3d3981f3363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | pragma solidity 0.7.5;
/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//solhint-disable max-line-length
//solhint-disable no-inline-assembly
contract CloneFactory {
function createClone(address target, bytes32 salt)
internal
returns (address payable result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the clone contract data
let clone := mload(0x40)
// The bytecode block below is responsible for contract initialization
// during deployment, it is worth noting the proxied contract constructor will not be called during
// the cloning procedure and that is why an initialization function needs to be called after the
// clone is created
mstore(
clone,
0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000
)
// This stores the address location of the implementation contract
// so that the proxy knows where to delegate call logic to
mstore(add(clone, 0x14), targetBytes)
// The bytecode block is the actual code that is deployed for each clone created.
// It forwards all calls to the already deployed implementation via a delegatecall
mstore(
add(clone, 0x28),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// deploy the contract using the CREATE2 opcode
// this deploys the minimal proxy defined above, which will proxy all
// calls to use the logic defined in the implementation contract `target`
result := create2(0, clone, 0x37, salt)
}
}
function isClone(address target, address query)
internal
view
returns (bool result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the comparison clone
let clone := mload(0x40)
// The next three lines store the expected bytecode for a miniml proxy
// that targets `target` as its implementation contract
mstore(
clone,
0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000
)
mstore(add(clone, 0xa), targetBytes)
mstore(
add(clone, 0x1e),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// the next two lines store the bytecode of the contract that we are checking in memory
let other := add(clone, 0x40)
extcodecopy(query, other, 0, 0x2d)
// Check if the expected bytecode equals the actual bytecode and return the result
result := and(
eq(mload(clone), mload(other)),
eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
)
}
}
}
/**
* Contract that exposes the needed erc20 token functions
*/
abstract contract ERC20Interface {
// Send _value amount of tokens to address _to
function transfer(address _to, uint256 _value)
public
virtual
returns (bool success);
// Get the account balance of another account with address _owner
function balanceOf(address _owner)
public
virtual
view
returns (uint256 balance);
}
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeApprove: approve failed'
);
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeTransfer: transfer failed'
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::transferFrom: transferFrom failed'
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
}
}
/**
* Contract that will forward any incoming Ether to the creator of the contract
*
*/
contract Forwarder {
// Address to which any funds sent to this contract will be forwarded
address public parentAddress;
event ForwarderDeposited(address from, uint256 value, bytes data);
/**
* Initialize the contract, and sets the destination address to that of the creator
*/
function init(address _parentAddress) external onlyUninitialized {
parentAddress = _parentAddress;
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
// NOTE: since we are forwarding on initialization,
// we don't have the context of the original sender.
// We still emit an event about the forwarding but set
// the sender to the forwarder itself
emit ForwarderDeposited(address(this), value, msg.data);
}
/**
* Modifier that will execute internal code block only if the sender is the parent address
*/
modifier onlyParent {
require(msg.sender == parentAddress, 'Only Parent');
_;
}
/**
* Modifier that will execute internal code block only if the contract has not been initialized yet
*/
modifier onlyUninitialized {
require(parentAddress == address(0x0), 'Already initialized');
_;
}
/**
* Default function; Gets called when data is sent but does not match any other function
*/
fallback() external payable {
flush();
}
/**
* Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address
*/
receive() external payable {
flush();
}
/**
* Execute a token transfer of the full balance from the forwarder token to the parent address
* @param tokenContractAddress the address of the erc20 token contract
*/
function flushTokens(address tokenContractAddress) external onlyParent {
ERC20Interface instance = ERC20Interface(tokenContractAddress);
address forwarderAddress = address(this);
uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
if (forwarderBalance == 0) {
return;
}
TransferHelper.safeTransfer(
tokenContractAddress,
parentAddress,
forwarderBalance
);
}
/**
* Flush the entire balance of the contract to the parent address.
*/
function flush() public {
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
emit ForwarderDeposited(msg.sender, value, msg.data);
}
}
contract ForwarderFactory is CloneFactory {
address public implementationAddress;
event ForwarderCreated(address newForwarderAddress, address parentAddress);
constructor(address _implementationAddress) {
implementationAddress = _implementationAddress;
}
function createForwarder(address parent, bytes32 salt) external {
// include the signers in the salt so any contract deployed to a given address must have the same signers
bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt));
address payable clone = createClone(implementationAddress, finalSalt);
Forwarder(clone).init(parent);
emit ForwarderCreated(clone, parent);
}
} |
1 | 20,290,371 | 05d584910c09d75760c475801b79a98bc17fd12127656c681d44c57c68a509c5 | 12e092f0f40d96a8eee370715c0bfe16e430483ad9e53a4a03fd2dae3c965977 | b8874ec2f5e6662c195c2a7eb2b58a5ff09f51cd | 00b19a5200a100e5fc4c9800772f4d002f218400 | b3eb5a0698484855c5893db71c70a4c4f3f904d0 | 3d602d80600a3d3981f3363d3d373d3d3d363d739f36ee33fd56c7d9a78facd3249c580b1ca464a25af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d739f36ee33fd56c7d9a78facd3249c580b1ca464a25af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"src/clones/ERC1155SeaDropCloneable.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {\n ERC1155SeaDropContractOffererCloneable\n} from \"./ERC1155SeaDropContractOffererCloneable.sol\";\n\n/**\n * @title ERC1155SeaDropCloneable\n * @author James Wenzel (emo.eth)\n * @author Ryan Ghods (ralxz.eth)\n * @author Stephan Min (stephanm.eth)\n * @author Michael Cohen (notmichael.eth)\n * @custom:contributor Limit Break (@limitbreak)\n * @notice A cloneable ERC1155 token contract that can mint as a\n * Seaport contract offerer.\n * Implements Limit Break's Creator Token Standards transfer\n * validation for royalty enforcement.\n */\ncontract ERC1155SeaDropCloneable is ERC1155SeaDropContractOffererCloneable {\n /**\n * @notice Initialize the token contract.\n *\n * @param allowedConfigurer The address of the contract allowed to\n * implementation code. Also contains SeaDrop\n * implementation code.\n * @param allowedSeaport The address of the Seaport contract allowed to\n * interact.\n * @param name_ The name of the token.\n * @param symbol_ The symbol of the token.\n */\n function initialize(\n address allowedConfigurer,\n address allowedSeaport,\n string memory name_,\n string memory symbol_,\n address initialOwner\n ) public initializer {\n // Initialize ownership.\n _initializeOwner(initialOwner);\n\n // Initialize ERC1155SeaDropContractOffererCloneable.\n __ERC1155SeaDropContractOffererCloneable_init(\n allowedConfigurer,\n allowedSeaport,\n name_,\n symbol_\n );\n }\n\n /**\n * @notice Burns a token, restricted to the owner or approved operator,\n * and must have sufficient balance.\n *\n * @param from The address to burn from.\n * @param id The token id to burn.\n * @param amount The amount to burn.\n */\n function burn(address from, uint256 id, uint256 amount) external {\n // Burn the token.\n _burn(msg.sender, from, id, amount);\n }\n\n /**\n * @notice Burns a batch of tokens, restricted to the owner or\n * approved operator, and must have sufficient balance.\n *\n * @param from The address to burn from.\n * @param ids The token ids to burn.\n * @param amounts The amounts to burn per token id.\n */\n function batchBurn(\n address from,\n uint256[] calldata ids,\n uint256[] calldata amounts\n ) external {\n // Burn the tokens.\n _batchBurn(msg.sender, from, ids, amounts);\n }\n}\n"
},
"src/clones/ERC1155SeaDropContractOffererCloneable.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { IERC1155SeaDrop } from \"../interfaces/IERC1155SeaDrop.sol\";\n\nimport { ISeaDropToken } from \"../interfaces/ISeaDropToken.sol\";\n\nimport {\n ERC1155ContractMetadataCloneable\n} from \"./ERC1155ContractMetadataCloneable.sol\";\n\nimport {\n ERC1155SeaDropContractOffererStorage\n} from \"../lib/ERC1155SeaDropContractOffererStorage.sol\";\n\nimport {\n ERC1155SeaDropErrorsAndEvents\n} from \"../lib/ERC1155SeaDropErrorsAndEvents.sol\";\n\nimport { PublicDrop } from \"../lib//ERC1155SeaDropStructs.sol\";\n\nimport { AllowListData } from \"../lib/SeaDropStructs.sol\";\n\nimport {\n ERC1155ConduitPreapproved\n} from \"../lib/ERC1155ConduitPreapproved.sol\";\n\nimport { ERC1155 } from \"solady/src/tokens/ERC1155.sol\";\n\nimport { SpentItem } from \"seaport-types/src/lib/ConsiderationStructs.sol\";\n\nimport {\n ContractOffererInterface\n} from \"seaport-types/src/interfaces/ContractOffererInterface.sol\";\n\nimport {\n IERC165\n} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\n/**\n * @title ERC1155SeaDropContractOffererCloneable\n * @author James Wenzel (emo.eth)\n * @author Ryan Ghods (ralxz.eth)\n * @author Stephan Min (stephanm.eth)\n * @author Michael Cohen (notmichael.eth)\n * @notice A cloneable ERC1155 token contract that can mint as a\n * Seaport contract offerer.\n */\ncontract ERC1155SeaDropContractOffererCloneable is\n ERC1155ContractMetadataCloneable,\n ERC1155SeaDropErrorsAndEvents\n{\n using ERC1155SeaDropContractOffererStorage for ERC1155SeaDropContractOffererStorage.Layout;\n\n /**\n * @notice Initialize the token contract.\n *\n * @param allowedConfigurer The address of the contract allowed to\n * configure parameters. Also contains SeaDrop\n * implementation code.\n * @param allowedSeaport The address of the Seaport contract allowed to\n * interact.\n * @param name_ The name of the token.\n * @param symbol_ The symbol of the token.\n */\n function __ERC1155SeaDropContractOffererCloneable_init(\n address allowedConfigurer,\n address allowedSeaport,\n string memory name_,\n string memory symbol_\n ) internal onlyInitializing {\n // Set the allowed Seaport to interact with this contract.\n if (allowedSeaport == address(0)) {\n revert AllowedSeaportCannotBeZeroAddress();\n }\n ERC1155SeaDropContractOffererStorage.layout()._allowedSeaport[\n allowedSeaport\n ] = true;\n\n // Set the allowed Seaport enumeration.\n address[] memory enumeratedAllowedSeaport = new address[](1);\n enumeratedAllowedSeaport[0] = allowedSeaport;\n ERC1155SeaDropContractOffererStorage\n .layout()\n ._enumeratedAllowedSeaport = enumeratedAllowedSeaport;\n\n // Emit an event noting the contract deployment.\n emit SeaDropTokenDeployed(SEADROP_TOKEN_TYPE.ERC1155_CLONE);\n\n // Initialize ERC1155ContractMetadataCloneable.\n __ERC1155ContractMetadataCloneable_init(\n allowedConfigurer,\n name_,\n symbol_\n );\n }\n\n /**\n * @notice The fallback function is used as a dispatcher for SeaDrop\n * methods.\n */\n fallback(bytes calldata) external returns (bytes memory output) {\n // Get the function selector.\n bytes4 selector = msg.sig;\n\n // Get the rest of the msg data after the selector.\n bytes calldata data = msg.data[4:];\n\n // Determine if we should forward the call to the implementation\n // contract with SeaDrop logic.\n bool callSeaDropImplementation = selector ==\n ISeaDropToken.updateAllowedSeaport.selector ||\n selector == ISeaDropToken.updateDropURI.selector ||\n selector == ISeaDropToken.updateAllowList.selector ||\n selector == ISeaDropToken.updateCreatorPayouts.selector ||\n selector == ISeaDropToken.updatePayer.selector ||\n selector == ISeaDropToken.updateAllowedFeeRecipient.selector ||\n selector == ISeaDropToken.updateSigner.selector ||\n selector == IERC1155SeaDrop.updatePublicDrop.selector ||\n selector == ContractOffererInterface.previewOrder.selector ||\n selector == ContractOffererInterface.generateOrder.selector ||\n selector == ContractOffererInterface.getSeaportMetadata.selector ||\n selector == IERC1155SeaDrop.getPublicDrop.selector ||\n selector == IERC1155SeaDrop.getPublicDropIndexes.selector ||\n selector == ISeaDropToken.getAllowedSeaport.selector ||\n selector == ISeaDropToken.getCreatorPayouts.selector ||\n selector == ISeaDropToken.getAllowListMerkleRoot.selector ||\n selector == ISeaDropToken.getAllowedFeeRecipients.selector ||\n selector == ISeaDropToken.getSigners.selector ||\n selector == ISeaDropToken.getDigestIsUsed.selector ||\n selector == ISeaDropToken.getPayers.selector;\n\n // Determine if we should require only the owner or configurer calling.\n bool requireOnlyOwnerOrConfigurer = selector ==\n ISeaDropToken.updateAllowedSeaport.selector ||\n selector == ISeaDropToken.updateDropURI.selector ||\n selector == ISeaDropToken.updateAllowList.selector ||\n selector == ISeaDropToken.updateCreatorPayouts.selector ||\n selector == ISeaDropToken.updatePayer.selector ||\n selector == ISeaDropToken.updateAllowedFeeRecipient.selector ||\n selector == IERC1155SeaDrop.updatePublicDrop.selector;\n\n if (callSeaDropImplementation) {\n // For update calls, ensure the sender is only the owner\n // or configurer contract.\n if (requireOnlyOwnerOrConfigurer) {\n _onlyOwnerOrConfigurer();\n } else if (selector == ISeaDropToken.updateSigner.selector) {\n // For updateSigner, a signer can disallow themselves.\n // Get the signer parameter.\n address signer = address(bytes20(data[12:32]));\n // If the signer is not allowed, ensure sender is only owner\n // or configurer.\n if (\n msg.sender != signer ||\n (msg.sender == signer &&\n !ERC1155SeaDropContractOffererStorage\n .layout()\n ._allowedSigners[signer])\n ) {\n _onlyOwnerOrConfigurer();\n }\n }\n\n // Forward the call to the implementation contract.\n (bool success, bytes memory returnedData) = _CONFIGURER\n .delegatecall(msg.data);\n\n // Require that the call was successful.\n if (!success) {\n // Bubble up the revert reason.\n assembly {\n revert(add(32, returnedData), mload(returnedData))\n }\n }\n\n // If the call was to generateOrder, mint the tokens.\n if (selector == ContractOffererInterface.generateOrder.selector) {\n _mintOrder(data);\n }\n\n // Return the data from the delegate call.\n return returnedData;\n } else if (selector == IERC1155SeaDrop.getMintStats.selector) {\n // Get the minter and token id.\n (address minter, uint256 tokenId) = abi.decode(\n data,\n (address, uint256)\n );\n\n // Get the mint stats.\n (\n uint256 minterNumMinted,\n uint256 minterNumMintedForTokenId,\n uint256 totalMintedForTokenId,\n uint256 maxSupply\n ) = _getMintStats(minter, tokenId);\n\n // Encode the return data.\n return\n abi.encode(\n minterNumMinted,\n minterNumMintedForTokenId,\n totalMintedForTokenId,\n maxSupply\n );\n } else if (selector == ContractOffererInterface.ratifyOrder.selector) {\n // This function is a no-op, nothing additional needs to happen here.\n // Utilize assembly to efficiently return the ratifyOrder magic value.\n assembly {\n mstore(0, 0xf4dd92ce)\n return(0x1c, 32)\n }\n } else if (selector == ISeaDropToken.configurer.selector) {\n // Return the configurer contract.\n return abi.encode(_CONFIGURER);\n } else if (selector == IERC1155SeaDrop.multiConfigureMint.selector) {\n // Ensure only the owner or configurer can call this function.\n _onlyOwnerOrConfigurer();\n\n // Mint the tokens.\n _multiConfigureMint(data);\n } else {\n // Revert if the function selector is not supported.\n revert UnsupportedFunctionSelector(selector);\n }\n }\n\n /**\n * @notice Returns a set of mint stats for the address.\n * This assists in enforcing maxSupply, maxTotalMintableByWallet,\n * and maxTokenSupplyForStage checks.\n *\n * @dev NOTE: Implementing contracts should always update these numbers\n * before transferring any tokens with _safeMint() to mitigate\n * consequences of malicious onERC1155Received() hooks.\n *\n * @param minter The minter address.\n * @param tokenId The token id to return the stats for.\n */\n function _getMintStats(\n address minter,\n uint256 tokenId\n )\n internal\n view\n returns (\n uint256 minterNumMinted,\n uint256 minterNumMintedForTokenId,\n uint256 totalMintedForTokenId,\n uint256 maxSupply\n )\n {\n // Put the token supply on the stack.\n TokenSupply storage tokenSupply = _tokenSupply[tokenId];\n\n // Assign the return values.\n totalMintedForTokenId = tokenSupply.totalMinted;\n maxSupply = tokenSupply.maxSupply;\n minterNumMinted = _totalMintedByUser[minter];\n minterNumMintedForTokenId = _totalMintedByUserPerToken[minter][tokenId];\n }\n\n /**\n * @dev Handle ERC-1155 safeTransferFrom. If \"from\" is this contract,\n * the sender can only be Seaport or the conduit.\n *\n * @param from The address to transfer from.\n * @param to The address to transfer to.\n * @param id The token id to transfer.\n * @param amount The amount of tokens to transfer.\n * @param data The data to pass to the onERC1155Received hook.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) public virtual override {\n if (from == address(this)) {\n // Only Seaport or the conduit can use this function\n // when \"from\" is this contract.\n if (\n msg.sender != _CONDUIT &&\n !ERC1155SeaDropContractOffererStorage.layout()._allowedSeaport[\n msg.sender\n ]\n ) {\n revert InvalidCallerOnlyAllowedSeaport(msg.sender);\n }\n return;\n }\n\n ERC1155._safeTransfer(_by(), from, to, id, amount, data);\n }\n\n /**\n * @notice Returns whether the interface is supported.\n *\n * @param interfaceId The interface id to check against.\n */\n function supportsInterface(\n bytes4 interfaceId\n )\n public\n view\n virtual\n override(ERC1155ContractMetadataCloneable)\n returns (bool)\n {\n return\n interfaceId == type(IERC1155SeaDrop).interfaceId ||\n interfaceId == type(ContractOffererInterface).interfaceId ||\n interfaceId == 0x2e778efc || // SIP-5 (getSeaportMetadata)\n // ERC1155ContractMetadata returns supportsInterface true for\n // IERC1155ContractMetadata, ERC-4906, ERC-2981\n // ERC1155A returns supportsInterface true for\n // ERC165, ERC1155, ERC1155MetadataURI\n ERC1155ContractMetadataCloneable.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Internal function to mint tokens during a generateOrder call\n * from Seaport.\n *\n * @param data The original transaction calldata, without the selector.\n */\n function _mintOrder(bytes calldata data) internal {\n // Decode fulfiller, minimumReceived, and context from calldata.\n (\n address fulfiller,\n SpentItem[] memory minimumReceived,\n ,\n bytes memory context\n ) = abi.decode(data, (address, SpentItem[], SpentItem[], bytes));\n\n // Assign the minter from context[22:42]. We validate context has the\n // correct minimum length in the implementation's `_decodeOrder`.\n address minter;\n assembly {\n minter := shr(96, mload(add(add(context, 0x20), 22)))\n }\n\n // If the minter is the zero address, set it to the fulfiller.\n if (minter == address(0)) {\n minter = fulfiller;\n }\n\n // Set the token ids and quantities.\n uint256 minimumReceivedLength = minimumReceived.length;\n uint256[] memory tokenIds = new uint256[](minimumReceivedLength);\n uint256[] memory quantities = new uint256[](minimumReceivedLength);\n for (uint256 i = 0; i < minimumReceivedLength; ) {\n tokenIds[i] = minimumReceived[i].identifier;\n quantities[i] = minimumReceived[i].amount;\n unchecked {\n ++i;\n }\n }\n\n // Mint the tokens.\n _batchMint(minter, tokenIds, quantities, \"\");\n }\n\n /**\n * @dev Internal function to mint tokens during a multiConfigureMint call\n * from the configurer contract.\n *\n * @param data The original transaction calldata, without the selector.\n */\n function _multiConfigureMint(bytes calldata data) internal {\n // Decode the calldata.\n (\n address recipient,\n uint256[] memory tokenIds,\n uint256[] memory amounts\n ) = abi.decode(data, (address, uint256[], uint256[]));\n\n _batchMint(recipient, tokenIds, amounts, \"\");\n }\n}\n"
},
"src/interfaces/IERC1155SeaDrop.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { ISeaDropToken } from \"./ISeaDropToken.sol\";\n\nimport { PublicDrop } from \"../lib/ERC1155SeaDropStructs.sol\";\n\n/**\n * @dev A helper interface to get and set parameters for ERC1155SeaDrop.\n * The token does not expose these methods as part of its external\n * interface to optimize contract size, but does implement them.\n */\ninterface IERC1155SeaDrop is ISeaDropToken {\n /**\n * @notice Update the SeaDrop public drop parameters at a given index.\n *\n * @param publicDrop The new public drop parameters.\n * @param index The public drop index.\n */\n function updatePublicDrop(\n PublicDrop calldata publicDrop,\n uint256 index\n ) external;\n\n /**\n * @notice Returns the public drop stage parameters at a given index.\n *\n * @param index The index of the public drop stage.\n */\n function getPublicDrop(\n uint256 index\n ) external view returns (PublicDrop memory);\n\n /**\n * @notice Returns the public drop indexes.\n */\n function getPublicDropIndexes() external view returns (uint256[] memory);\n\n /**\n * @notice Returns a set of mint stats for the address.\n * This assists SeaDrop in enforcing maxSupply,\n * maxTotalMintableByWallet, maxTotalMintableByWalletPerToken,\n * and maxTokenSupplyForStage checks.\n *\n * @dev NOTE: Implementing contracts should always update these numbers\n * before transferring any tokens with _safeMint() to mitigate\n * consequences of malicious onERC1155Received() hooks.\n *\n * @param minter The minter address.\n * @param tokenId The token id to return stats for.\n */\n function getMintStats(\n address minter,\n uint256 tokenId\n )\n external\n view\n returns (\n uint256 minterNumMinted,\n uint256 minterNumMintedForTokenId,\n uint256 totalMintedForTokenId,\n uint256 maxSupply\n );\n\n /**\n * @notice This function is only allowed to be called by the configurer\n * contract as a way to batch mints and configuration in one tx.\n *\n * @param recipient The address to receive the mints.\n * @param tokenIds The tokenIds to mint.\n * @param amounts The amounts to mint.\n */\n function multiConfigureMint(\n address recipient,\n uint256[] calldata tokenIds,\n uint256[] calldata amounts\n ) external;\n}\n"
},
"src/interfaces/ISeaDropToken.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {\n ISeaDropTokenContractMetadata\n} from \"./ISeaDropTokenContractMetadata.sol\";\n\nimport { AllowListData, CreatorPayout } from \"../lib/SeaDropStructs.sol\";\n\n/**\n * @dev A helper base interface for IERC721SeaDrop and IERC1155SeaDrop.\n * The token does not expose these methods as part of its external\n * interface to optimize contract size, but does implement them.\n */\ninterface ISeaDropToken is ISeaDropTokenContractMetadata {\n /**\n * @notice Update the SeaDrop allowed Seaport contracts privileged to mint.\n * Only the owner can use this function.\n *\n * @param allowedSeaport The allowed Seaport addresses.\n */\n function updateAllowedSeaport(address[] calldata allowedSeaport) external;\n\n /**\n * @notice Update the SeaDrop allowed fee recipient.\n * Only the owner can use this function.\n *\n * @param feeRecipient The new fee recipient.\n * @param allowed Whether the fee recipient is allowed.\n */\n function updateAllowedFeeRecipient(\n address feeRecipient,\n bool allowed\n ) external;\n\n /**\n * @notice Update the SeaDrop creator payout addresses.\n * The total basis points must add up to exactly 10_000.\n * Only the owner can use this function.\n *\n * @param creatorPayouts The new creator payouts.\n */\n function updateCreatorPayouts(\n CreatorPayout[] calldata creatorPayouts\n ) external;\n\n /**\n * @notice Update the SeaDrop drop URI.\n * Only the owner can use this function.\n *\n * @param dropURI The new drop URI.\n */\n function updateDropURI(string calldata dropURI) external;\n\n /**\n * @notice Update the SeaDrop allow list data.\n * Only the owner can use this function.\n *\n * @param allowListData The new allow list data.\n */\n function updateAllowList(AllowListData calldata allowListData) external;\n\n /**\n * @notice Update the SeaDrop allowed payers.\n * Only the owner can use this function.\n *\n * @param payer The payer to update.\n * @param allowed Whether the payer is allowed.\n */\n function updatePayer(address payer, bool allowed) external;\n\n /**\n * @notice Update the SeaDrop allowed signer.\n * Only the owner can use this function.\n * An allowed signer can also disallow themselves.\n *\n * @param signer The signer to update.\n * @param allowed Whether the signer is allowed.\n */\n function updateSigner(address signer, bool allowed) external;\n\n /**\n * @notice Get the SeaDrop allowed Seaport contracts privileged to mint.\n */\n function getAllowedSeaport() external view returns (address[] memory);\n\n /**\n * @notice Returns the SeaDrop creator payouts.\n */\n function getCreatorPayouts() external view returns (CreatorPayout[] memory);\n\n /**\n * @notice Returns the SeaDrop allow list merkle root.\n */\n function getAllowListMerkleRoot() external view returns (bytes32);\n\n /**\n * @notice Returns the SeaDrop allowed fee recipients.\n */\n function getAllowedFeeRecipients() external view returns (address[] memory);\n\n /**\n * @notice Returns the SeaDrop allowed signers.\n */\n function getSigners() external view returns (address[] memory);\n\n /**\n * @notice Returns if the signed digest has been used.\n *\n * @param digest The digest hash.\n */\n function getDigestIsUsed(bytes32 digest) external view returns (bool);\n\n /**\n * @notice Returns the SeaDrop allowed payers.\n */\n function getPayers() external view returns (address[] memory);\n\n /**\n * @notice Returns the configurer contract.\n */\n function configurer() external view returns (address);\n}\n"
},
"src/clones/ERC1155ContractMetadataCloneable.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {\n IERC1155ContractMetadata\n} from \"../interfaces/IERC1155ContractMetadata.sol\";\n\nimport {\n ERC1155ConduitPreapproved\n} from \"../lib/ERC1155ConduitPreapproved.sol\";\n\nimport {\n ICreatorToken,\n ILegacyCreatorToken\n} from \"../interfaces/ICreatorToken.sol\";\n\nimport { ITransferValidator1155 } from \"../interfaces/ITransferValidator.sol\";\n\nimport { TokenTransferValidator } from \"../lib/TokenTransferValidator.sol\";\n\nimport { ERC1155 } from \"solady/src/tokens/ERC1155.sol\";\n\nimport { ERC2981 } from \"solady/src/tokens/ERC2981.sol\";\n\nimport { Ownable } from \"solady/src/auth/Ownable.sol\";\n\nimport {\n Initializable\n} from \"@openzeppelin-upgradeable/contracts/proxy/utils/Initializable.sol\";\n\n/**\n * @title ERC1155ContractMetadataCloneable\n * @author James Wenzel (emo.eth)\n * @author Ryan Ghods (ralxz.eth)\n * @author Stephan Min (stephanm.eth)\n * @author Michael Cohen (notmichael.eth)\n * @notice A cloneable token contract that extends ERC-1155\n * with additional metadata and ownership capabilities.\n */\ncontract ERC1155ContractMetadataCloneable is\n ERC1155ConduitPreapproved,\n TokenTransferValidator,\n ERC2981,\n Ownable,\n IERC1155ContractMetadata,\n Initializable\n{\n /// @notice A struct containing the token supply info per token id.\n mapping(uint256 => TokenSupply) _tokenSupply;\n\n /// @notice The total number of tokens minted by address.\n mapping(address => uint256) _totalMintedByUser;\n\n /// @notice The total number of tokens minted per token id by address.\n mapping(address => mapping(uint256 => uint256)) _totalMintedByUserPerToken;\n\n /// @notice The name of the token.\n string internal _name;\n\n /// @notice The symbol of the token.\n string internal _symbol;\n\n /// @notice The base URI for token metadata.\n string internal _baseURI;\n\n /// @notice The contract URI for contract metadata.\n string internal _contractURI;\n\n /// @notice The provenance hash for guaranteeing metadata order\n /// for random reveals.\n bytes32 internal _provenanceHash;\n\n /// @notice The allowed contract that can configure SeaDrop parameters.\n address internal _CONFIGURER;\n\n /**\n * @dev Reverts if the sender is not the owner or the allowed\n * configurer contract.\n *\n * This is used as a function instead of a modifier\n * to save contract space when used multiple times.\n */\n function _onlyOwnerOrConfigurer() internal view {\n if (msg.sender != _CONFIGURER && msg.sender != owner()) {\n revert Unauthorized();\n }\n }\n\n /**\n * @notice Deploy the token contract.\n *\n * @param allowedConfigurer The address of the contract allowed to\n * configure parameters. Also contains SeaDrop\n * implementation code.\n * @param name_ The name of the token.\n * @param symbol_ The symbol of the token.\n */\n function __ERC1155ContractMetadataCloneable_init(\n address allowedConfigurer,\n string memory name_,\n string memory symbol_\n ) internal onlyInitializing {\n // Set the name of the token.\n _name = name_;\n\n // Set the symbol of the token.\n _symbol = symbol_;\n\n // Set the allowed configurer contract to interact with this contract.\n _CONFIGURER = allowedConfigurer;\n }\n\n /**\n * @notice Sets the base URI for the token metadata and emits an event.\n *\n * @param newBaseURI The new base URI to set.\n */\n function setBaseURI(string calldata newBaseURI) external override {\n // Ensure the sender is only the owner or configurer contract.\n _onlyOwnerOrConfigurer();\n\n // Set the new base URI.\n _baseURI = newBaseURI;\n\n // Emit an event with the update.\n emit BatchMetadataUpdate(0, type(uint256).max);\n }\n\n /**\n * @notice Sets the contract URI for contract metadata.\n *\n * @param newContractURI The new contract URI.\n */\n function setContractURI(string calldata newContractURI) external override {\n // Ensure the sender is only the owner or configurer contract.\n _onlyOwnerOrConfigurer();\n\n // Set the new contract URI.\n _contractURI = newContractURI;\n\n // Emit an event with the update.\n emit ContractURIUpdated(newContractURI);\n }\n\n /**\n * @notice Emit an event notifying metadata updates for\n * a range of token ids, according to EIP-4906.\n *\n * @param fromTokenId The start token id.\n * @param toTokenId The end token id.\n */\n function emitBatchMetadataUpdate(\n uint256 fromTokenId,\n uint256 toTokenId\n ) external {\n // Ensure the sender is only the owner or configurer contract.\n _onlyOwnerOrConfigurer();\n\n // Emit an event with the update.\n if (fromTokenId == toTokenId) {\n // If only one token is being updated, use the event\n // in the 1155 spec.\n emit URI(uri(fromTokenId), fromTokenId);\n } else {\n emit BatchMetadataUpdate(fromTokenId, toTokenId);\n }\n }\n\n /**\n * @notice Sets the max token supply and emits an event.\n *\n * @param tokenId The token id to set the max supply for.\n * @param newMaxSupply The new max supply to set.\n */\n function setMaxSupply(uint256 tokenId, uint256 newMaxSupply) external {\n // Ensure the sender is only the owner or configurer contract.\n _onlyOwnerOrConfigurer();\n\n // Ensure the max supply does not exceed the maximum value of uint64,\n // a limit due to the storage of bit-packed variables in TokenSupply,\n if (newMaxSupply > 2 ** 64 - 1) {\n revert CannotExceedMaxSupplyOfUint64(newMaxSupply);\n }\n\n // Set the new max supply.\n _tokenSupply[tokenId].maxSupply = uint64(newMaxSupply);\n\n // Emit an event with the update.\n emit MaxSupplyUpdated(tokenId, newMaxSupply);\n }\n\n /**\n * @notice Sets the provenance hash and emits an event.\n *\n * The provenance hash is used for random reveals, which\n * is a hash of the ordered metadata to show it has not been\n * modified after mint started.\n *\n * This function will revert if the provenance hash has already\n * been set, so be sure to carefully set it only once.\n *\n * @param newProvenanceHash The new provenance hash to set.\n */\n function setProvenanceHash(bytes32 newProvenanceHash) external {\n // Ensure the sender is only the owner or configurer contract.\n _onlyOwnerOrConfigurer();\n\n // Keep track of the old provenance hash for emitting with the event.\n bytes32 oldProvenanceHash = _provenanceHash;\n\n // Revert if the provenance hash has already been set.\n if (oldProvenanceHash != bytes32(0)) {\n revert ProvenanceHashCannotBeSetAfterAlreadyBeingSet();\n }\n\n // Set the new provenance hash.\n _provenanceHash = newProvenanceHash;\n\n // Emit an event with the update.\n emit ProvenanceHashUpdated(oldProvenanceHash, newProvenanceHash);\n }\n\n /**\n * @notice Sets the default royalty information.\n *\n * Requirements:\n *\n * - `receiver` cannot be the zero address.\n * - `feeNumerator` cannot be greater than the fee denominator of 10_000 basis points.\n */\n function setDefaultRoyalty(address receiver, uint96 feeNumerator) external {\n // Ensure the sender is only the owner or configurer contract.\n _onlyOwnerOrConfigurer();\n\n // Set the default royalty.\n // ERC2981 implementation ensures feeNumerator <= feeDenominator\n // and receiver != address(0).\n _setDefaultRoyalty(receiver, feeNumerator);\n\n // Emit an event with the updated params.\n emit RoyaltyInfoUpdated(receiver, feeNumerator);\n }\n\n /**\n * @notice Returns the name of the token.\n */\n function name() external view returns (string memory) {\n return _name;\n }\n\n /**\n * @notice Returns the symbol of the token.\n */\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n\n /**\n * @notice Returns the base URI for token metadata.\n */\n function baseURI() external view override returns (string memory) {\n return _baseURI;\n }\n\n /**\n * @notice Returns the contract URI for contract metadata.\n */\n function contractURI() external view override returns (string memory) {\n return _contractURI;\n }\n\n /**\n * @notice Returns the max token supply for a token id.\n */\n function maxSupply(uint256 tokenId) external view returns (uint256) {\n return _tokenSupply[tokenId].maxSupply;\n }\n\n /**\n * @notice Returns the total supply for a token id.\n */\n function totalSupply(uint256 tokenId) external view returns (uint256) {\n return _tokenSupply[tokenId].totalSupply;\n }\n\n /**\n * @notice Returns the total minted for a token id.\n */\n function totalMinted(uint256 tokenId) external view returns (uint256) {\n return _tokenSupply[tokenId].totalMinted;\n }\n\n /**\n * @notice Returns the provenance hash.\n * The provenance hash is used for random reveals, which\n * is a hash of the ordered metadata to show it is unmodified\n * after mint has started.\n */\n function provenanceHash() external view override returns (bytes32) {\n return _provenanceHash;\n }\n\n /**\n * @notice Returns the URI for token metadata.\n *\n * This implementation returns the same URI for *all* token types.\n * It relies on the token type ID substitution mechanism defined\n * in the EIP to replace {id} with the token id.\n *\n * @custom:param tokenId The token id to get the URI for.\n */\n function uri(\n uint256 /* tokenId */\n ) public view virtual override returns (string memory) {\n // Return the base URI.\n return _baseURI;\n }\n\n /**\n * @notice Returns the transfer validation function used.\n */\n function getTransferValidationFunction()\n external\n pure\n returns (bytes4 functionSignature, bool isViewFunction)\n {\n functionSignature = ITransferValidator1155.validateTransfer.selector;\n isViewFunction = true;\n }\n\n /**\n * @notice Set the transfer validator. Only callable by the token owner.\n */\n function setTransferValidator(address newValidator) external onlyOwner {\n // Set the new transfer validator.\n _setTransferValidator(newValidator);\n }\n\n /// @dev Override this function to return true if `_beforeTokenTransfer` is used.\n function _useBeforeTokenTransfer() internal view virtual override returns (bool) {\n return true;\n }\n\n /**\n * @dev Hook that is called before any token transfer.\n * This includes minting and burning.\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory /* data */\n ) internal virtual override {\n if (from != address(0) && to != address(0)) {\n // Call the transfer validator if one is set.\n address transferValidator = _transferValidator;\n if (transferValidator != address(0)) {\n for (uint256 i = 0; i < ids.length; i++) {\n ITransferValidator1155(transferValidator).validateTransfer(\n msg.sender,\n from,\n to,\n ids[i],\n amounts[i]\n );\n }\n }\n }\n }\n\n /**\n * @notice Returns whether the interface is supported.\n *\n * @param interfaceId The interface id to check against.\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC1155, ERC2981) returns (bool) {\n return\n interfaceId == type(IERC1155ContractMetadata).interfaceId ||\n interfaceId == type(ICreatorToken).interfaceId ||\n interfaceId == type(ILegacyCreatorToken).interfaceId ||\n interfaceId == 0x49064906 || // ERC-4906 (MetadataUpdate)\n ERC2981.supportsInterface(interfaceId) ||\n // ERC1155 returns supportsInterface true for\n // ERC165, ERC1155, ERC1155MetadataURI\n ERC1155.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Adds to the internal counters for a mint.\n *\n * @param to The address to mint to.\n * @param id The token id to mint.\n * @param amount The quantity to mint.\n * @param data The data to pass if receiver is a contract.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual override {\n // Increment mint counts.\n _incrementMintCounts(to, id, amount);\n\n ERC1155._mint(to, id, amount, data);\n }\n\n /**\n * @dev Adds to the internal counters for a batch mint.\n *\n * @param to The address to mint to.\n * @param ids The token ids to mint.\n * @param amounts The quantities to mint.\n * @param data The data to pass if receiver is a contract.\n */\n function _batchMint(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n // Put ids length on the stack to save MLOADs.\n uint256 idsLength = ids.length;\n\n for (uint256 i = 0; i < idsLength; ) {\n // Increment mint counts.\n _incrementMintCounts(to, ids[i], amounts[i]);\n\n unchecked {\n ++i;\n }\n }\n\n ERC1155._batchMint(to, ids, amounts, data);\n }\n\n /**\n * @dev Subtracts from the internal counters for a burn.\n *\n * @param by The address calling the burn.\n * @param from The address to burn from.\n * @param id The token id to burn.\n * @param amount The amount to burn.\n */\n function _burn(\n address by,\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual override {\n // Reduce the supply.\n _reduceSupplyOnBurn(id, amount);\n\n ERC1155._burn(by, from, id, amount);\n }\n\n /**\n * @dev Subtracts from the internal counters for a batch burn.\n *\n * @param by The address calling the burn.\n * @param from The address to burn from.\n * @param ids The token ids to burn.\n * @param amounts The amounts to burn.\n */\n function _batchBurn(\n address by,\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual override {\n // Put ids length on the stack to save MLOADs.\n uint256 idsLength = ids.length;\n\n for (uint256 i = 0; i < idsLength; ) {\n // Reduce the supply.\n _reduceSupplyOnBurn(ids[i], amounts[i]);\n\n unchecked {\n ++i;\n }\n }\n\n ERC1155._batchBurn(by, from, ids, amounts);\n }\n\n function _reduceSupplyOnBurn(uint256 id, uint256 amount) internal {\n // Get the current token supply.\n TokenSupply storage tokenSupply = _tokenSupply[id];\n\n // Reduce the totalSupply.\n unchecked {\n tokenSupply.totalSupply -= uint64(amount);\n }\n }\n\n /**\n * @dev Internal function to increment mint counts.\n *\n * Note that this function does not check if the mint exceeds\n * maxSupply, which should be validated before this function is called.\n *\n * @param to The address to mint to.\n * @param id The token id to mint.\n * @param amount The quantity to mint.\n */\n function _incrementMintCounts(\n address to,\n uint256 id,\n uint256 amount\n ) internal {\n // Get the current token supply.\n TokenSupply storage tokenSupply = _tokenSupply[id];\n\n if (tokenSupply.totalMinted + amount > tokenSupply.maxSupply) {\n revert MintExceedsMaxSupply(\n tokenSupply.totalMinted + amount,\n tokenSupply.maxSupply\n );\n }\n\n // Increment supply and number minted.\n // Can be unchecked because maxSupply cannot be set to exceed uint64.\n unchecked {\n tokenSupply.totalSupply += uint64(amount);\n tokenSupply.totalMinted += uint64(amount);\n\n // Increment total minted by user.\n _totalMintedByUser[to] += amount;\n\n // Increment total minted by user per token.\n _totalMintedByUserPerToken[to][id] += amount;\n }\n }\n}\n"
},
"src/lib/ERC1155SeaDropContractOffererStorage.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { PublicDrop } from \"./ERC1155SeaDropStructs.sol\";\n\nimport { CreatorPayout } from \"./SeaDropStructs.sol\";\n\nlibrary ERC1155SeaDropContractOffererStorage {\n struct Layout {\n /// @notice The allowed Seaport addresses that can mint.\n mapping(address => bool) _allowedSeaport;\n /// @notice The enumerated allowed Seaport addresses.\n address[] _enumeratedAllowedSeaport;\n /// @notice The public drop data.\n mapping(uint256 => PublicDrop) _publicDrops;\n /// @notice The enumerated public drop indexes.\n uint256[] _enumeratedPublicDropIndexes;\n /// @notice The creator payout addresses and basis points.\n CreatorPayout[] _creatorPayouts;\n /// @notice The allow list merkle root.\n bytes32 _allowListMerkleRoot;\n /// @notice The allowed fee recipients.\n mapping(address => bool) _allowedFeeRecipients;\n /// @notice The enumerated allowed fee recipients.\n address[] _enumeratedFeeRecipients;\n /// @notice The allowed server-side signers.\n mapping(address => bool) _allowedSigners;\n /// @notice The enumerated allowed signers.\n address[] _enumeratedSigners;\n /// @notice The used signature digests.\n mapping(bytes32 => bool) _usedDigests;\n /// @notice The allowed payers.\n mapping(address => bool) _allowedPayers;\n /// @notice The enumerated allowed payers.\n address[] _enumeratedPayers;\n }\n\n bytes32 internal constant STORAGE_SLOT =\n bytes32(\n uint256(\n keccak256(\"contracts.storage.ERC1155SeaDropContractOfferer\")\n ) - 1\n );\n\n function layout() internal pure returns (Layout storage l) {\n bytes32 slot = STORAGE_SLOT;\n assembly {\n l.slot := slot\n }\n }\n}\n"
},
"src/lib/ERC1155SeaDropErrorsAndEvents.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { PublicDrop } from \"./ERC1155SeaDropStructs.sol\";\n\nimport { SeaDropErrorsAndEvents } from \"./SeaDropErrorsAndEvents.sol\";\n\ninterface ERC1155SeaDropErrorsAndEvents is SeaDropErrorsAndEvents {\n /**\n * @dev Revert with an error if an empty PublicDrop is provided\n * for an already-empty public drop.\n */\n error PublicDropStageNotPresent();\n\n /**\n * @dev Revert with an error if the mint quantity exceeds the\n * max minted per wallet for a certain token id.\n */\n error MintQuantityExceedsMaxMintedPerWalletForTokenId(\n uint256 tokenId,\n uint256 total,\n uint256 allowed\n );\n\n /**\n * @dev Revert with an error if the target token id to mint is not within\n * the drop stage range.\n */\n error TokenIdNotWithinDropStageRange(\n uint256 tokenId,\n uint256 startTokenId,\n uint256 endTokenId\n );\n\n /**\n * @notice Revert with an error if the number of maxSupplyAmounts doesn't\n * match the number of maxSupplyTokenIds.\n */\n error MaxSupplyMismatch();\n\n /**\n * @notice Revert with an error if the number of mint tokenIds doesn't\n * match the number of mint amounts.\n */\n error MintAmountsMismatch();\n\n /**\n * @notice Revert with an error if the mint order offer contains\n * a duplicate tokenId.\n */\n error OfferContainsDuplicateTokenId(uint256 tokenId);\n\n /**\n * @dev Revert if the fromTokenId is greater than the toTokenId.\n */\n error InvalidFromAndToTokenId(uint256 fromTokenId, uint256 toTokenId);\n\n /**\n * @notice Revert with an error if the number of publicDropIndexes doesn't\n * match the number of publicDrops.\n */\n error PublicDropsMismatch();\n\n /**\n * @dev An event with updated public drop data.\n */\n event PublicDropUpdated(PublicDrop publicDrop, uint256 index);\n}\n"
},
"src/lib/ERC1155SeaDropStructs.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { AllowListData, CreatorPayout } from \"./SeaDropStructs.sol\";\n\n/**\n * @notice A struct defining public drop data.\n * Designed to fit efficiently in two storage slots.\n *\n * @param startPrice The start price per token. (Up to 1.2m\n * of native token, e.g. ETH, MATIC)\n * @param endPrice The end price per token. If this differs\n * from startPrice, the current price will\n * be calculated based on the current time.\n * @param startTime The start time, ensure this is not zero.\n * @param endTime The end time, ensure this is not zero.\n * @param restrictFeeRecipients If false, allow any fee recipient;\n * if true, check fee recipient is allowed.\n * @param paymentToken The payment token address. Null for\n * native token.\n * @param fromTokenId The start token id for the stage.\n * @param toTokenId The end token id for the stage.\n * @param maxTotalMintableByWallet Maximum total number of mints a user is\n * allowed. (The limit for this field is\n * 2^16 - 1)\n * @param maxTotalMintableByWalletPerToken Maximum total number of mints a user\n * is allowed for the token id. (The limit for\n * this field is 2^16 - 1)\n * @param feeBps Fee out of 10_000 basis points to be\n * collected.\n */\nstruct PublicDrop {\n // slot 1\n uint80 startPrice; // 80/512 bits\n uint80 endPrice; // 160/512 bits\n uint40 startTime; // 200/512 bits\n uint40 endTime; // 240/512 bits\n bool restrictFeeRecipients; // 248/512 bits\n // uint8 unused;\n\n // slot 2\n address paymentToken; // 408/512 bits\n uint24 fromTokenId; // 432/512 bits\n uint24 toTokenId; // 456/512 bits\n uint16 maxTotalMintableByWallet; // 472/512 bits\n uint16 maxTotalMintableByWalletPerToken; // 488/512 bits\n uint16 feeBps; // 504/512 bits\n}\n\n/**\n * @notice A struct defining mint params for an allow list.\n * An allow list leaf will be composed of `msg.sender` and\n * the following params.\n *\n * Note: Since feeBps is encoded in the leaf, backend should ensure\n * that feeBps is acceptable before generating a proof.\n *\n * @param startPrice The start price per token. (Up to 1.2m\n * of native token, e.g. ETH, MATIC)\n * @param endPrice The end price per token. If this differs\n * from startPrice, the current price will\n * be calculated based on the current time.\n * @param startTime The start time, ensure this is not zero.\n * @param endTime The end time, ensure this is not zero.\n * @param paymentToken The payment token for the mint. Null for\n * native token.\n * @param fromTokenId The start token id for the stage.\n * @param toTokenId The end token id for the stage.\n * @param maxTotalMintableByWallet Maximum total number of mints a user is\n * allowed.\n * @param maxTotalMintableByWalletPerToken Maximum total number of mints a user\n * is allowed for the token id.\n * @param maxTokenSupplyForStage The limit of token supply this stage can\n * mint within.\n * @param dropStageIndex The drop stage index to emit with the event\n * for analytical purposes. This should be\n * non-zero since the public mint emits with\n * index zero.\n * @param feeBps Fee out of 10_000 basis points to be\n * collected.\n * @param restrictFeeRecipients If false, allow any fee recipient;\n * if true, check fee recipient is allowed.\n */\nstruct MintParams {\n uint256 startPrice;\n uint256 endPrice;\n uint256 startTime;\n uint256 endTime;\n address paymentToken;\n uint256 fromTokenId;\n uint256 toTokenId;\n uint256 maxTotalMintableByWallet;\n uint256 maxTotalMintableByWalletPerToken;\n uint256 maxTokenSupplyForStage;\n uint256 dropStageIndex; // non-zero\n uint256 feeBps;\n bool restrictFeeRecipients;\n}\n\n/**\n * @dev Struct containing internal SeaDrop implementation logic\n * mint details to avoid stack too deep.\n *\n * @param feeRecipient The fee recipient.\n * @param payer The payer of the mint.\n * @param minter The mint recipient.\n * @param tokenIds The tokenIds to mint.\n * @param quantities The number of tokens to mint per tokenId.\n * @param withEffects Whether to apply state changes of the mint.\n */\nstruct MintDetails {\n address feeRecipient;\n address payer;\n address minter;\n uint256[] tokenIds;\n uint256[] quantities;\n bool withEffects;\n}\n\n/**\n * @notice A struct to configure multiple contract options in one transaction.\n */\nstruct MultiConfigureStruct {\n uint256[] maxSupplyTokenIds;\n uint256[] maxSupplyAmounts;\n string baseURI;\n string contractURI;\n PublicDrop[] publicDrops;\n uint256[] publicDropsIndexes;\n string dropURI;\n AllowListData allowListData;\n CreatorPayout[] creatorPayouts;\n bytes32 provenanceHash;\n address[] allowedFeeRecipients;\n address[] disallowedFeeRecipients;\n address[] allowedPayers;\n address[] disallowedPayers;\n // Server-signed\n address[] allowedSigners;\n address[] disallowedSigners;\n // ERC-2981\n address royaltyReceiver;\n uint96 royaltyBps;\n // Mint\n address mintRecipient;\n uint256[] mintTokenIds;\n uint256[] mintAmounts;\n}\n"
},
"src/lib/SeaDropStructs.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/**\n * @notice A struct defining a creator payout address and basis points.\n *\n * @param payoutAddress The payout address.\n * @param basisPoints The basis points to pay out to the creator.\n * The total creator payouts must equal 10_000 bps.\n */\nstruct CreatorPayout {\n address payoutAddress;\n uint16 basisPoints;\n}\n\n/**\n * @notice A struct defining allow list data (for minting an allow list).\n *\n * @param merkleRoot The merkle root for the allow list.\n * @param publicKeyURIs If the allowListURI is encrypted, a list of URIs\n * pointing to the public keys. Empty if unencrypted.\n * @param allowListURI The URI for the allow list.\n */\nstruct AllowListData {\n bytes32 merkleRoot;\n string[] publicKeyURIs;\n string allowListURI;\n}\n"
},
"src/lib/ERC1155ConduitPreapproved.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { ERC1155 } from \"solady/src/tokens/ERC1155.sol\";\n\n/**\n * @title ERC1155ConduitPreapproved\n * @notice Solady's ERC1155 with the OpenSea conduit preapproved.\n */\nabstract contract ERC1155ConduitPreapproved is ERC1155 {\n /// @dev The canonical OpenSea conduit.\n address internal constant _CONDUIT =\n 0x1E0049783F008A0085193E00003D00cd54003c71;\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) public virtual override {\n _safeTransfer(_by(), from, to, id, amount, data);\n }\n\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) public virtual override {\n _safeBatchTransfer(_by(), from, to, ids, amounts, data);\n }\n\n function isApprovedForAll(\n address owner,\n address operator\n ) public view virtual override returns (bool) {\n if (operator == _CONDUIT) return true;\n return ERC1155.isApprovedForAll(owner, operator);\n }\n\n function _by() internal view virtual returns (address result) {\n assembly {\n // `msg.sender == _CONDUIT ? address(0) : msg.sender`.\n result := mul(iszero(eq(caller(), _CONDUIT)), caller())\n }\n }\n}\n"
},
"lib/solady/src/tokens/ERC1155.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Simple ERC1155 implementation.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/tokens/ERC1155.sol)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC1155.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC1155/ERC1155.sol)\n///\n/// @dev Note:\n/// The ERC1155 standard allows for self-approvals.\n/// For performance, this implementation WILL NOT revert for such actions.\n/// Please add any checks with overrides if desired.\nabstract contract ERC1155 {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The lengths of the input arrays are not the same.\n error ArrayLengthsMismatch();\n\n /// @dev Cannot mint or transfer to the zero address.\n error TransferToZeroAddress();\n\n /// @dev The recipient's balance has overflowed.\n error AccountBalanceOverflow();\n\n /// @dev Insufficient balance.\n error InsufficientBalance();\n\n /// @dev Only the token owner or an approved account can manage the tokens.\n error NotOwnerNorApproved();\n\n /// @dev Cannot safely transfer to a contract that does not implement\n /// the ERC1155Receiver interface.\n error TransferToNonERC1155ReceiverImplementer();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* EVENTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Emitted when `amount` of token `id` is transferred\n /// from `from` to `to` by `operator`.\n event TransferSingle(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256 id,\n uint256 amount\n );\n\n /// @dev Emitted when `amounts` of token `ids` are transferred\n /// from `from` to `to` by `operator`.\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] amounts\n );\n\n /// @dev Emitted when `owner` enables or disables `operator` to manage all of their tokens.\n event ApprovalForAll(address indexed owner, address indexed operator, bool isApproved);\n\n /// @dev Emitted when the Uniform Resource Identifier (URI) for token `id`\n /// is updated to `value`. This event is not used in the base contract.\n /// You may need to emit this event depending on your URI logic.\n ///\n /// See: https://eips.ethereum.org/EIPS/eip-1155#metadata\n event URI(string value, uint256 indexed id);\n\n /// @dev `keccak256(bytes(\"TransferSingle(address,address,address,uint256,uint256)\"))`.\n uint256 private constant _TRANSFER_SINGLE_EVENT_SIGNATURE =\n 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62;\n\n /// @dev `keccak256(bytes(\"TransferBatch(address,address,address,uint256[],uint256[])\"))`.\n uint256 private constant _TRANSFER_BATCH_EVENT_SIGNATURE =\n 0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb;\n\n /// @dev `keccak256(bytes(\"ApprovalForAll(address,address,bool)\"))`.\n uint256 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE =\n 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STORAGE */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The `ownerSlotSeed` of a given owner is given by.\n /// ```\n /// let ownerSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, owner))\n /// ```\n ///\n /// The balance slot of `owner` is given by.\n /// ```\n /// mstore(0x20, ownerSlotSeed)\n /// mstore(0x00, id)\n /// let balanceSlot := keccak256(0x00, 0x40)\n /// ```\n ///\n /// The operator approval slot of `owner` is given by.\n /// ```\n /// mstore(0x20, ownerSlotSeed)\n /// mstore(0x00, operator)\n /// let operatorApprovalSlot := keccak256(0x0c, 0x34)\n /// ```\n uint256 private constant _ERC1155_MASTER_SLOT_SEED = 0x9a31110384e0b0c9;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* ERC1155 METADATA */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the URI for token `id`.\n ///\n /// You can either return the same templated URI for all token IDs,\n /// (e.g. \"https://example.com/api/{id}.json\"),\n /// or return a unique URI for each `id`.\n ///\n /// See: https://eips.ethereum.org/EIPS/eip-1155#metadata\n function uri(uint256 id) public view virtual returns (string memory);\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* ERC1155 */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the amount of `id` owned by `owner`.\n function balanceOf(address owner, uint256 id) public view virtual returns (uint256 result) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n mstore(0x14, owner)\n mstore(0x00, id)\n result := sload(keccak256(0x00, 0x40))\n }\n }\n\n /// @dev Returns whether `operator` is approved to manage the tokens of `owner`.\n function isApprovedForAll(address owner, address operator)\n public\n view\n virtual\n returns (bool result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n mstore(0x14, owner)\n mstore(0x00, operator)\n result := sload(keccak256(0x0c, 0x34))\n }\n }\n\n /// @dev Sets whether `operator` is approved to manage the tokens of the caller.\n ///\n /// Emits a {ApprovalForAll} event.\n function setApprovalForAll(address operator, bool isApproved) public virtual {\n /// @solidity memory-safe-assembly\n assembly {\n // Convert to 0 or 1.\n isApproved := iszero(iszero(isApproved))\n // Update the `isApproved` for (`msg.sender`, `operator`).\n mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n mstore(0x14, caller())\n mstore(0x00, operator)\n sstore(keccak256(0x0c, 0x34), isApproved)\n // Emit the {ApprovalForAll} event.\n mstore(0x00, isApproved)\n // forgefmt: disable-next-line\n log3(0x00, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, caller(), shr(96, shl(96, operator)))\n }\n }\n\n /// @dev Transfers `amount` of `id` from `from` to `to`.\n ///\n /// Requirements:\n /// - `to` cannot be the zero address.\n /// - `from` must have at least `amount` of `id`.\n /// - If the caller is not `from`,\n /// it must be approved to manage the tokens of `from`.\n /// - If `to` refers to a smart contract, it must implement\n /// {ERC1155-onERC1155Reveived}, which is called upon a batch transfer.\n ///\n /// Emits a {Transfer} event.\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) public virtual {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(from, to, _single(id), _single(amount), data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, from))\n let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, to))\n mstore(0x20, fromSlotSeed)\n // Clear the upper 96 bits.\n from := shr(96, fromSlotSeed)\n to := shr(96, toSlotSeed)\n // Revert if `to` is the zero address.\n if iszero(to) {\n mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n revert(0x1c, 0x04)\n }\n // If the caller is not `from`, do the authorization check.\n if iszero(eq(caller(), from)) {\n mstore(0x00, caller())\n if iszero(sload(keccak256(0x0c, 0x34))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Subtract and store the updated balance of `from`.\n {\n mstore(0x00, id)\n let fromBalanceSlot := keccak256(0x00, 0x40)\n let fromBalance := sload(fromBalanceSlot)\n if gt(amount, fromBalance) {\n mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n revert(0x1c, 0x04)\n }\n sstore(fromBalanceSlot, sub(fromBalance, amount))\n }\n // Increase and store the updated balance of `to`.\n {\n mstore(0x20, toSlotSeed)\n let toBalanceSlot := keccak256(0x00, 0x40)\n let toBalanceBefore := sload(toBalanceSlot)\n let toBalanceAfter := add(toBalanceBefore, amount)\n if lt(toBalanceAfter, toBalanceBefore) {\n mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n revert(0x1c, 0x04)\n }\n sstore(toBalanceSlot, toBalanceAfter)\n }\n // Emit a {TransferSingle} event.\n mstore(0x20, amount)\n log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), from, to)\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(from, to, _single(id), _single(amount), data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n // Do the {onERC1155Received} check if `to` is a smart contract.\n if extcodesize(to) {\n // Prepare the calldata.\n let m := mload(0x40)\n // `onERC1155Received(address,address,uint256,uint256,bytes)`.\n mstore(m, 0xf23a6e61)\n mstore(add(m, 0x20), caller())\n mstore(add(m, 0x40), from)\n mstore(add(m, 0x60), id)\n mstore(add(m, 0x80), amount)\n mstore(add(m, 0xa0), 0xa0)\n calldatacopy(add(m, 0xc0), sub(data.offset, 0x20), add(0x20, data.length))\n // Revert if the call reverts.\n if iszero(call(gas(), to, 0, add(m, 0x1c), add(0xc4, data.length), m, 0x20)) {\n if returndatasize() {\n // Bubble up the revert if the call reverts.\n returndatacopy(0x00, 0x00, returndatasize())\n revert(0x00, returndatasize())\n }\n mstore(m, 0)\n }\n // Load the returndata and compare it with the function selector.\n if iszero(eq(mload(m), shl(224, 0xf23a6e61))) {\n mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`.\n revert(0x1c, 0x04)\n }\n }\n }\n }\n\n /// @dev Transfers `amounts` of `ids` from `from` to `to`.\n ///\n /// Requirements:\n /// - `to` cannot be the zero address.\n /// - `from` must have at least `amount` of `id`.\n /// - `ids` and `amounts` must have the same length.\n /// - If the caller is not `from`,\n /// it must be approved to manage the tokens of `from`.\n /// - If `to` refers to a smart contract, it must implement\n /// {ERC1155-onERC1155BatchReveived}, which is called upon a batch transfer.\n ///\n /// Emits a {TransferBatch} event.\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) public virtual {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(from, to, ids, amounts, data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(eq(ids.length, amounts.length)) {\n mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n revert(0x1c, 0x04)\n }\n let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, from))\n let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, to))\n mstore(0x20, fromSlotSeed)\n // Clear the upper 96 bits.\n from := shr(96, fromSlotSeed)\n to := shr(96, toSlotSeed)\n // Revert if `to` is the zero address.\n if iszero(to) {\n mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n revert(0x1c, 0x04)\n }\n // If the caller is not `from`, do the authorization check.\n if iszero(eq(caller(), from)) {\n mstore(0x00, caller())\n if iszero(sload(keccak256(0x0c, 0x34))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Loop through all the `ids` and update the balances.\n {\n let end := shl(5, ids.length)\n for { let i := 0 } iszero(eq(i, end)) { i := add(i, 0x20) } {\n let amount := calldataload(add(amounts.offset, i))\n // Subtract and store the updated balance of `from`.\n {\n mstore(0x20, fromSlotSeed)\n mstore(0x00, calldataload(add(ids.offset, i)))\n let fromBalanceSlot := keccak256(0x00, 0x40)\n let fromBalance := sload(fromBalanceSlot)\n if gt(amount, fromBalance) {\n mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n revert(0x1c, 0x04)\n }\n sstore(fromBalanceSlot, sub(fromBalance, amount))\n }\n // Increase and store the updated balance of `to`.\n {\n mstore(0x20, toSlotSeed)\n let toBalanceSlot := keccak256(0x00, 0x40)\n let toBalanceBefore := sload(toBalanceSlot)\n let toBalanceAfter := add(toBalanceBefore, amount)\n if lt(toBalanceAfter, toBalanceBefore) {\n mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n revert(0x1c, 0x04)\n }\n sstore(toBalanceSlot, toBalanceAfter)\n }\n }\n }\n // Emit a {TransferBatch} event.\n {\n let m := mload(0x40)\n // Copy the `ids`.\n mstore(m, 0x40)\n let n := add(0x20, shl(5, ids.length))\n let o := add(m, 0x40)\n calldatacopy(o, sub(ids.offset, 0x20), n)\n // Copy the `amounts`.\n mstore(add(m, 0x20), add(0x40, n))\n o := add(o, n)\n n := add(0x20, shl(5, amounts.length))\n calldatacopy(o, sub(amounts.offset, 0x20), n)\n n := sub(add(o, n), m)\n // Do the emit.\n log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), from, to)\n }\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransferCalldata(from, to, ids, amounts, data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n // Do the {onERC1155BatchReceived} check if `to` is a smart contract.\n if extcodesize(to) {\n let m := mload(0x40)\n // Prepare the calldata.\n // `onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)`.\n mstore(m, 0xbc197c81)\n mstore(add(m, 0x20), caller())\n mstore(add(m, 0x40), from)\n // Copy the `ids`.\n mstore(add(m, 0x60), 0xa0)\n let n := add(0x20, shl(5, ids.length))\n let o := add(m, 0xc0)\n calldatacopy(o, sub(ids.offset, 0x20), n)\n // Copy the `amounts`.\n let s := add(0xa0, n)\n mstore(add(m, 0x80), s)\n o := add(o, n)\n n := add(0x20, shl(5, amounts.length))\n calldatacopy(o, sub(amounts.offset, 0x20), n)\n // Copy the `data`.\n mstore(add(m, 0xa0), add(s, n))\n o := add(o, n)\n n := add(0x20, data.length)\n calldatacopy(o, sub(data.offset, 0x20), n)\n n := sub(add(o, n), add(m, 0x1c))\n // Revert if the call reverts.\n if iszero(call(gas(), to, 0, add(m, 0x1c), n, m, 0x20)) {\n if returndatasize() {\n // Bubble up the revert if the call reverts.\n returndatacopy(0x00, 0x00, returndatasize())\n revert(0x00, returndatasize())\n }\n mstore(m, 0)\n }\n // Load the returndata and compare it with the function selector.\n if iszero(eq(mload(m), shl(224, 0xbc197c81))) {\n mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`.\n revert(0x1c, 0x04)\n }\n }\n }\n }\n\n /// @dev Returns the amounts of `ids` for `owners.\n ///\n /// Requirements:\n /// - `owners` and `ids` must have the same length.\n function balanceOfBatch(address[] calldata owners, uint256[] calldata ids)\n public\n view\n virtual\n returns (uint256[] memory balances)\n {\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(eq(ids.length, owners.length)) {\n mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n revert(0x1c, 0x04)\n }\n balances := mload(0x40)\n mstore(balances, ids.length)\n let o := add(balances, 0x20)\n let end := shl(5, ids.length)\n mstore(0x40, add(end, o))\n // Loop through all the `ids` and load the balances.\n for { let i := 0 } iszero(eq(i, end)) { i := add(i, 0x20) } {\n let owner := calldataload(add(owners.offset, i))\n mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, shl(96, owner)))\n mstore(0x00, calldataload(add(ids.offset, i)))\n mstore(add(o, i), sload(keccak256(0x00, 0x40)))\n }\n }\n }\n\n /// @dev Returns true if this contract implements the interface defined by `interfaceId`.\n /// See: https://eips.ethereum.org/EIPS/eip-165\n /// This function call must use less than 30000 gas.\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n let s := shr(224, interfaceId)\n // ERC165: 0x01ffc9a7, ERC1155: 0xd9b67a26, ERC1155MetadataURI: 0x0e89341c.\n result := or(or(eq(s, 0x01ffc9a7), eq(s, 0xd9b67a26)), eq(s, 0x0e89341c))\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL MINT FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Mints `amount` of `id` to `to`.\n ///\n /// Requirements:\n /// - `to` cannot be the zero address.\n /// - If `to` refers to a smart contract, it must implement\n /// {ERC1155-onERC1155Reveived}, which is called upon a batch transfer.\n ///\n /// Emits a {Transfer} event.\n function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(address(0), to, _single(id), _single(amount), data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n let to_ := shl(96, to)\n // Revert if `to` is the zero address.\n if iszero(to_) {\n mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n revert(0x1c, 0x04)\n }\n // Increase and store the updated balance of `to`.\n {\n mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n mstore(0x14, to)\n mstore(0x00, id)\n let toBalanceSlot := keccak256(0x00, 0x40)\n let toBalanceBefore := sload(toBalanceSlot)\n let toBalanceAfter := add(toBalanceBefore, amount)\n if lt(toBalanceAfter, toBalanceBefore) {\n mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n revert(0x1c, 0x04)\n }\n sstore(toBalanceSlot, toBalanceAfter)\n }\n // Emit a {TransferSingle} event.\n mstore(0x00, id)\n mstore(0x20, amount)\n log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), 0, shr(96, to_))\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(address(0), to, _single(id), _single(amount), data);\n }\n if (_hasCode(to)) _checkOnERC1155Received(address(0), to, id, amount, data);\n }\n\n /// @dev Mints `amounts` of `ids` to `to`.\n ///\n /// Requirements:\n /// - `to` cannot be the zero address.\n /// - `ids` and `amounts` must have the same length.\n /// - If `to` refers to a smart contract, it must implement\n /// {ERC1155-onERC1155BatchReveived}, which is called upon a batch transfer.\n ///\n /// Emits a {TransferBatch} event.\n function _batchMint(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(address(0), to, ids, amounts, data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(eq(mload(ids), mload(amounts))) {\n mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n revert(0x1c, 0x04)\n }\n let to_ := shl(96, to)\n // Revert if `to` is the zero address.\n if iszero(to_) {\n mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n revert(0x1c, 0x04)\n }\n // Loop through all the `ids` and update the balances.\n {\n mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, to_))\n let end := shl(5, mload(ids))\n for { let i := 0 } iszero(eq(i, end)) {} {\n i := add(i, 0x20)\n let amount := mload(add(amounts, i))\n // Increase and store the updated balance of `to`.\n {\n mstore(0x00, mload(add(ids, i)))\n let toBalanceSlot := keccak256(0x00, 0x40)\n let toBalanceBefore := sload(toBalanceSlot)\n let toBalanceAfter := add(toBalanceBefore, amount)\n if lt(toBalanceAfter, toBalanceBefore) {\n mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n revert(0x1c, 0x04)\n }\n sstore(toBalanceSlot, toBalanceAfter)\n }\n }\n }\n // Emit a {TransferBatch} event.\n {\n let m := mload(0x40)\n // Copy the `ids`.\n mstore(m, 0x40)\n let n := add(0x20, shl(5, mload(ids)))\n let o := add(m, 0x40)\n pop(staticcall(gas(), 4, ids, n, o, n))\n // Copy the `amounts`.\n mstore(add(m, 0x20), add(0x40, returndatasize()))\n o := add(o, returndatasize())\n n := add(0x20, shl(5, mload(amounts)))\n pop(staticcall(gas(), 4, amounts, n, o, n))\n n := sub(add(o, returndatasize()), m)\n // Do the emit.\n log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), 0, shr(96, to_))\n }\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(address(0), to, ids, amounts, data);\n }\n if (_hasCode(to)) _checkOnERC1155BatchReceived(address(0), to, ids, amounts, data);\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL BURN FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Equivalent to `_burn(address(0), from, id, amount)`.\n function _burn(address from, uint256 id, uint256 amount) internal virtual {\n _burn(address(0), from, id, amount);\n }\n\n /// @dev Destroys `amount` of `id` from `from`.\n ///\n /// Requirements:\n /// - `from` must have at least `amount` of `id`.\n /// - If `by` is not the zero address, it must be either `from`,\n /// or approved to manage the tokens of `from`.\n ///\n /// Emits a {Transfer} event.\n function _burn(address by, address from, uint256 id, uint256 amount) internal virtual {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(from, address(0), _single(id), _single(amount), \"\");\n }\n /// @solidity memory-safe-assembly\n assembly {\n let from_ := shl(96, from)\n mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, from_))\n // If `by` is not the zero address, and not equal to `from`,\n // check if it is approved to manage all the tokens of `from`.\n if iszero(or(iszero(shl(96, by)), eq(shl(96, by), from_))) {\n mstore(0x00, by)\n if iszero(sload(keccak256(0x0c, 0x34))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Decrease and store the updated balance of `from`.\n {\n mstore(0x00, id)\n let fromBalanceSlot := keccak256(0x00, 0x40)\n let fromBalance := sload(fromBalanceSlot)\n if gt(amount, fromBalance) {\n mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n revert(0x1c, 0x04)\n }\n sstore(fromBalanceSlot, sub(fromBalance, amount))\n }\n // Emit a {TransferSingle} event.\n mstore(0x00, id)\n mstore(0x20, amount)\n log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), shr(96, from_), 0)\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(from, address(0), _single(id), _single(amount), \"\");\n }\n }\n\n /// @dev Equivalent to `_batchBurn(address(0), from, ids, amounts)`.\n function _batchBurn(address from, uint256[] memory ids, uint256[] memory amounts)\n internal\n virtual\n {\n _batchBurn(address(0), from, ids, amounts);\n }\n\n /// @dev Destroys `amounts` of `ids` from `from`.\n ///\n /// Requirements:\n /// - `ids` and `amounts` must have the same length.\n /// - `from` must have at least `amounts` of `ids`.\n /// - If `by` is not the zero address, it must be either `from`,\n /// or approved to manage the tokens of `from`.\n ///\n /// Emits a {TransferBatch} event.\n function _batchBurn(address by, address from, uint256[] memory ids, uint256[] memory amounts)\n internal\n virtual\n {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(from, address(0), ids, amounts, \"\");\n }\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(eq(mload(ids), mload(amounts))) {\n mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n revert(0x1c, 0x04)\n }\n let from_ := shl(96, from)\n mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, from_))\n // If `by` is not the zero address, and not equal to `from`,\n // check if it is approved to manage all the tokens of `from`.\n let by_ := shl(96, by)\n if iszero(or(iszero(by_), eq(by_, from_))) {\n mstore(0x00, by)\n if iszero(sload(keccak256(0x0c, 0x34))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Loop through all the `ids` and update the balances.\n {\n let end := shl(5, mload(ids))\n for { let i := 0 } iszero(eq(i, end)) {} {\n i := add(i, 0x20)\n let amount := mload(add(amounts, i))\n // Decrease and store the updated balance of `to`.\n {\n mstore(0x00, mload(add(ids, i)))\n let fromBalanceSlot := keccak256(0x00, 0x40)\n let fromBalance := sload(fromBalanceSlot)\n if gt(amount, fromBalance) {\n mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n revert(0x1c, 0x04)\n }\n sstore(fromBalanceSlot, sub(fromBalance, amount))\n }\n }\n }\n // Emit a {TransferBatch} event.\n {\n let m := mload(0x40)\n // Copy the `ids`.\n mstore(m, 0x40)\n let n := add(0x20, shl(5, mload(ids)))\n let o := add(m, 0x40)\n pop(staticcall(gas(), 4, ids, n, o, n))\n // Copy the `amounts`.\n mstore(add(m, 0x20), add(0x40, returndatasize()))\n o := add(o, returndatasize())\n n := add(0x20, shl(5, mload(amounts)))\n pop(staticcall(gas(), 4, amounts, n, o, n))\n n := sub(add(o, returndatasize()), m)\n // Do the emit.\n log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), shr(96, from_), 0)\n }\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(from, address(0), ids, amounts, \"\");\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL APPROVAL FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Approve or remove the `operator` as an operator for `by`,\n /// without authorization checks.\n ///\n /// Emits a {ApprovalForAll} event.\n function _setApprovalForAll(address by, address operator, bool isApproved) internal virtual {\n /// @solidity memory-safe-assembly\n assembly {\n // Convert to 0 or 1.\n isApproved := iszero(iszero(isApproved))\n // Update the `isApproved` for (`by`, `operator`).\n mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n mstore(0x14, by)\n mstore(0x00, operator)\n sstore(keccak256(0x0c, 0x34), isApproved)\n // Emit the {ApprovalForAll} event.\n mstore(0x00, isApproved)\n let m := shr(96, not(0))\n log3(0x00, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, and(m, by), and(m, operator))\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL TRANSFER FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Equivalent to `_safeTransfer(address(0), from, to, id, amount, data)`.\n function _safeTransfer(address from, address to, uint256 id, uint256 amount, bytes memory data)\n internal\n virtual\n {\n _safeTransfer(address(0), from, to, id, amount, data);\n }\n\n /// @dev Transfers `amount` of `id` from `from` to `to`.\n ///\n /// Requirements:\n /// - `to` cannot be the zero address.\n /// - `from` must have at least `amount` of `id`.\n /// - If `by` is not the zero address, it must be either `from`,\n /// or approved to manage the tokens of `from`.\n /// - If `to` refers to a smart contract, it must implement\n /// {ERC1155-onERC1155Reveived}, which is called upon a batch transfer.\n ///\n /// Emits a {Transfer} event.\n function _safeTransfer(\n address by,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(from, to, _single(id), _single(amount), data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n let from_ := shl(96, from)\n let to_ := shl(96, to)\n // Revert if `to` is the zero address.\n if iszero(to_) {\n mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n revert(0x1c, 0x04)\n }\n mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, from_))\n // If `by` is not the zero address, and not equal to `from`,\n // check if it is approved to manage all the tokens of `from`.\n let by_ := shl(96, by)\n if iszero(or(iszero(by_), eq(by_, from_))) {\n mstore(0x00, by)\n if iszero(sload(keccak256(0x0c, 0x34))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Subtract and store the updated balance of `from`.\n {\n mstore(0x00, id)\n let fromBalanceSlot := keccak256(0x00, 0x40)\n let fromBalance := sload(fromBalanceSlot)\n if gt(amount, fromBalance) {\n mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n revert(0x1c, 0x04)\n }\n sstore(fromBalanceSlot, sub(fromBalance, amount))\n }\n // Increase and store the updated balance of `to`.\n {\n mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, to_))\n let toBalanceSlot := keccak256(0x00, 0x40)\n let toBalanceBefore := sload(toBalanceSlot)\n let toBalanceAfter := add(toBalanceBefore, amount)\n if lt(toBalanceAfter, toBalanceBefore) {\n mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n revert(0x1c, 0x04)\n }\n sstore(toBalanceSlot, toBalanceAfter)\n }\n // Emit a {TransferSingle} event.\n mstore(0x20, amount)\n // forgefmt: disable-next-line\n log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), shr(96, from_), shr(96, to_))\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(from, to, _single(id), _single(amount), data);\n }\n if (_hasCode(to)) _checkOnERC1155Received(from, to, id, amount, data);\n }\n\n /// @dev Equivalent to `_safeBatchTransfer(address(0), from, to, ids, amounts, data)`.\n function _safeBatchTransfer(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n _safeBatchTransfer(address(0), from, to, ids, amounts, data);\n }\n\n /// @dev Transfers `amounts` of `ids` from `from` to `to`.\n ///\n /// Requirements:\n /// - `to` cannot be the zero address.\n /// - `ids` and `amounts` must have the same length.\n /// - `from` must have at least `amounts` of `ids`.\n /// - If `by` is not the zero address, it must be either `from`,\n /// or approved to manage the tokens of `from`.\n /// - If `to` refers to a smart contract, it must implement\n /// {ERC1155-onERC1155BatchReveived}, which is called upon a batch transfer.\n ///\n /// Emits a {TransferBatch} event.\n function _safeBatchTransfer(\n address by,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(from, to, ids, amounts, data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(eq(mload(ids), mload(amounts))) {\n mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n revert(0x1c, 0x04)\n }\n let from_ := shl(96, from)\n let to_ := shl(96, to)\n // Revert if `to` is the zero address.\n if iszero(to_) {\n mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n revert(0x1c, 0x04)\n }\n let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, from_)\n let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, to_)\n mstore(0x20, fromSlotSeed)\n // If `by` is not the zero address, and not equal to `from`,\n // check if it is approved to manage all the tokens of `from`.\n let by_ := shl(96, by)\n if iszero(or(iszero(by_), eq(by_, from_))) {\n mstore(0x00, by)\n if iszero(sload(keccak256(0x0c, 0x34))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Loop through all the `ids` and update the balances.\n {\n let end := shl(5, mload(ids))\n for { let i := 0 } iszero(eq(i, end)) {} {\n i := add(i, 0x20)\n let amount := mload(add(amounts, i))\n // Subtract and store the updated balance of `from`.\n {\n mstore(0x20, fromSlotSeed)\n mstore(0x00, mload(add(ids, i)))\n let fromBalanceSlot := keccak256(0x00, 0x40)\n let fromBalance := sload(fromBalanceSlot)\n if gt(amount, fromBalance) {\n mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n revert(0x1c, 0x04)\n }\n sstore(fromBalanceSlot, sub(fromBalance, amount))\n }\n // Increase and store the updated balance of `to`.\n {\n mstore(0x20, toSlotSeed)\n let toBalanceSlot := keccak256(0x00, 0x40)\n let toBalanceBefore := sload(toBalanceSlot)\n let toBalanceAfter := add(toBalanceBefore, amount)\n if lt(toBalanceAfter, toBalanceBefore) {\n mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n revert(0x1c, 0x04)\n }\n sstore(toBalanceSlot, toBalanceAfter)\n }\n }\n }\n // Emit a {TransferBatch} event.\n {\n let m := mload(0x40)\n // Copy the `ids`.\n mstore(m, 0x40)\n let n := add(0x20, shl(5, mload(ids)))\n let o := add(m, 0x40)\n pop(staticcall(gas(), 4, ids, n, o, n))\n // Copy the `amounts`.\n mstore(add(m, 0x20), add(0x40, returndatasize()))\n o := add(o, returndatasize())\n n := add(0x20, shl(5, mload(amounts)))\n pop(staticcall(gas(), 4, amounts, n, o, n))\n n := sub(add(o, returndatasize()), m)\n // Do the emit.\n log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), shr(96, from_), shr(96, to_))\n }\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(from, to, ids, amounts, data);\n }\n if (_hasCode(to)) _checkOnERC1155BatchReceived(from, to, ids, amounts, data);\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* HOOKS FOR OVERRIDING */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Override this function to return true if `_beforeTokenTransfer` is used.\n /// The is to help the compiler avoid producing dead bytecode.\n function _useBeforeTokenTransfer() internal view virtual returns (bool) {\n return false;\n }\n\n /// @dev Hook that is called before any token transfer.\n /// This includes minting and burning, as well as batched variants.\n ///\n /// The same hook is called on both single and batched variants.\n /// For single transfers, the length of the `id` and `amount` arrays are 1.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n /// @dev Override this function to return true if `_afterTokenTransfer` is used.\n /// The is to help the compiler avoid producing dead bytecode.\n function _useAfterTokenTransfer() internal view virtual returns (bool) {\n return false;\n }\n\n /// @dev Hook that is called after any token transfer.\n /// This includes minting and burning, as well as batched variants.\n ///\n /// The same hook is called on both single and batched variants.\n /// For single transfers, the length of the `id` and `amount` arrays are 1.\n function _afterTokenTransfer(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* PRIVATE HELPERS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Helper for calling the `_afterTokenTransfer` hook.\n /// The is to help the compiler avoid producing dead bytecode.\n function _afterTokenTransferCalldata(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) private {\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(from, to, ids, amounts, data);\n }\n }\n\n /// @dev Returns if `a` has bytecode of non-zero length.\n function _hasCode(address a) private view returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := extcodesize(a) // Can handle dirty upper bits.\n }\n }\n\n /// @dev Perform a call to invoke {IERC1155Receiver-onERC1155Received} on `to`.\n /// Reverts if the target does not support the function correctly.\n function _checkOnERC1155Received(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n /// @solidity memory-safe-assembly\n assembly {\n // Prepare the calldata.\n let m := mload(0x40)\n // `onERC1155Received(address,address,uint256,uint256,bytes)`.\n mstore(m, 0xf23a6e61)\n mstore(add(m, 0x20), caller())\n mstore(add(m, 0x40), shr(96, shl(96, from)))\n mstore(add(m, 0x60), id)\n mstore(add(m, 0x80), amount)\n mstore(add(m, 0xa0), 0xa0)\n let n := mload(data)\n mstore(add(m, 0xc0), n)\n if n { pop(staticcall(gas(), 4, add(data, 0x20), n, add(m, 0xe0), n)) }\n // Revert if the call reverts.\n if iszero(call(gas(), to, 0, add(m, 0x1c), add(0xc4, n), m, 0x20)) {\n if returndatasize() {\n // Bubble up the revert if the call reverts.\n returndatacopy(0x00, 0x00, returndatasize())\n revert(0x00, returndatasize())\n }\n mstore(m, 0)\n }\n // Load the returndata and compare it with the function selector.\n if iszero(eq(mload(m), shl(224, 0xf23a6e61))) {\n mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`.\n revert(0x1c, 0x04)\n }\n }\n }\n\n /// @dev Perform a call to invoke {IERC1155Receiver-onERC1155BatchReceived} on `to`.\n /// Reverts if the target does not support the function correctly.\n function _checkOnERC1155BatchReceived(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n /// @solidity memory-safe-assembly\n assembly {\n // Prepare the calldata.\n let m := mload(0x40)\n // `onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)`.\n mstore(m, 0xbc197c81)\n mstore(add(m, 0x20), caller())\n mstore(add(m, 0x40), shr(96, shl(96, from)))\n // Copy the `ids`.\n mstore(add(m, 0x60), 0xa0)\n let n := add(0x20, shl(5, mload(ids)))\n let o := add(m, 0xc0)\n pop(staticcall(gas(), 4, ids, n, o, n))\n // Copy the `amounts`.\n let s := add(0xa0, returndatasize())\n mstore(add(m, 0x80), s)\n o := add(o, returndatasize())\n n := add(0x20, shl(5, mload(amounts)))\n pop(staticcall(gas(), 4, amounts, n, o, n))\n // Copy the `data`.\n mstore(add(m, 0xa0), add(s, returndatasize()))\n o := add(o, returndatasize())\n n := add(0x20, mload(data))\n pop(staticcall(gas(), 4, data, n, o, n))\n n := sub(add(o, returndatasize()), add(m, 0x1c))\n // Revert if the call reverts.\n if iszero(call(gas(), to, 0, add(m, 0x1c), n, m, 0x20)) {\n if returndatasize() {\n // Bubble up the revert if the call reverts.\n returndatacopy(0x00, 0x00, returndatasize())\n revert(0x00, returndatasize())\n }\n mstore(m, 0)\n }\n // Load the returndata and compare it with the function selector.\n if iszero(eq(mload(m), shl(224, 0xbc197c81))) {\n mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`.\n revert(0x1c, 0x04)\n }\n }\n }\n\n /// @dev Returns `x` in an array with a single element.\n function _single(uint256 x) private pure returns (uint256[] memory result) {\n assembly {\n result := mload(0x40)\n mstore(0x40, add(result, 0x40))\n mstore(result, 1)\n mstore(add(result, 0x20), x)\n }\n }\n}\n"
},
"lib/seaport/lib/seaport-types/src/lib/ConsiderationStructs.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {\n BasicOrderType,\n ItemType,\n OrderType,\n Side\n} from \"./ConsiderationEnums.sol\";\n\nimport {\n CalldataPointer,\n MemoryPointer\n} from \"../helpers/PointerLibraries.sol\";\n\n/**\n * @dev An order contains eleven components: an offerer, a zone (or account that\n * can cancel the order or restrict who can fulfill the order depending on\n * the type), the order type (specifying partial fill support as well as\n * restricted order status), the start and end time, a hash that will be\n * provided to the zone when validating restricted orders, a salt, a key\n * corresponding to a given conduit, a counter, and an arbitrary number of\n * offer items that can be spent along with consideration items that must\n * be received by their respective recipient.\n */\nstruct OrderComponents {\n address offerer;\n address zone;\n OfferItem[] offer;\n ConsiderationItem[] consideration;\n OrderType orderType;\n uint256 startTime;\n uint256 endTime;\n bytes32 zoneHash;\n uint256 salt;\n bytes32 conduitKey;\n uint256 counter;\n}\n\n/**\n * @dev An offer item has five components: an item type (ETH or other native\n * tokens, ERC20, ERC721, and ERC1155, as well as criteria-based ERC721 and\n * ERC1155), a token address, a dual-purpose \"identifierOrCriteria\"\n * component that will either represent a tokenId or a merkle root\n * depending on the item type, and a start and end amount that support\n * increasing or decreasing amounts over the duration of the respective\n * order.\n */\nstruct OfferItem {\n ItemType itemType;\n address token;\n uint256 identifierOrCriteria;\n uint256 startAmount;\n uint256 endAmount;\n}\n\n/**\n * @dev A consideration item has the same five components as an offer item and\n * an additional sixth component designating the required recipient of the\n * item.\n */\nstruct ConsiderationItem {\n ItemType itemType;\n address token;\n uint256 identifierOrCriteria;\n uint256 startAmount;\n uint256 endAmount;\n address payable recipient;\n}\n\n/**\n * @dev A spent item is translated from a utilized offer item and has four\n * components: an item type (ETH or other native tokens, ERC20, ERC721, and\n * ERC1155), a token address, a tokenId, and an amount.\n */\nstruct SpentItem {\n ItemType itemType;\n address token;\n uint256 identifier;\n uint256 amount;\n}\n\n/**\n * @dev A received item is translated from a utilized consideration item and has\n * the same four components as a spent item, as well as an additional fifth\n * component designating the required recipient of the item.\n */\nstruct ReceivedItem {\n ItemType itemType;\n address token;\n uint256 identifier;\n uint256 amount;\n address payable recipient;\n}\n\n/**\n * @dev For basic orders involving ETH / native / ERC20 <=> ERC721 / ERC1155\n * matching, a group of six functions may be called that only requires a\n * subset of the usual order arguments. Note the use of a \"basicOrderType\"\n * enum; this represents both the usual order type as well as the \"route\"\n * of the basic order (a simple derivation function for the basic order\n * type is `basicOrderType = orderType + (4 * basicOrderRoute)`.)\n */\nstruct BasicOrderParameters {\n // calldata offset\n address considerationToken; // 0x24\n uint256 considerationIdentifier; // 0x44\n uint256 considerationAmount; // 0x64\n address payable offerer; // 0x84\n address zone; // 0xa4\n address offerToken; // 0xc4\n uint256 offerIdentifier; // 0xe4\n uint256 offerAmount; // 0x104\n BasicOrderType basicOrderType; // 0x124\n uint256 startTime; // 0x144\n uint256 endTime; // 0x164\n bytes32 zoneHash; // 0x184\n uint256 salt; // 0x1a4\n bytes32 offererConduitKey; // 0x1c4\n bytes32 fulfillerConduitKey; // 0x1e4\n uint256 totalOriginalAdditionalRecipients; // 0x204\n AdditionalRecipient[] additionalRecipients; // 0x224\n bytes signature; // 0x244\n // Total length, excluding dynamic array data: 0x264 (580)\n}\n\n/**\n * @dev Basic orders can supply any number of additional recipients, with the\n * implied assumption that they are supplied from the offered ETH (or other\n * native token) or ERC20 token for the order.\n */\nstruct AdditionalRecipient {\n uint256 amount;\n address payable recipient;\n}\n\n/**\n * @dev The full set of order components, with the exception of the counter,\n * must be supplied when fulfilling more sophisticated orders or groups of\n * orders. The total number of original consideration items must also be\n * supplied, as the caller may specify additional consideration items.\n */\nstruct OrderParameters {\n address offerer; // 0x00\n address zone; // 0x20\n OfferItem[] offer; // 0x40\n ConsiderationItem[] consideration; // 0x60\n OrderType orderType; // 0x80\n uint256 startTime; // 0xa0\n uint256 endTime; // 0xc0\n bytes32 zoneHash; // 0xe0\n uint256 salt; // 0x100\n bytes32 conduitKey; // 0x120\n uint256 totalOriginalConsiderationItems; // 0x140\n // offer.length // 0x160\n}\n\n/**\n * @dev Orders require a signature in addition to the other order parameters.\n */\nstruct Order {\n OrderParameters parameters;\n bytes signature;\n}\n\n/**\n * @dev Advanced orders include a numerator (i.e. a fraction to attempt to fill)\n * and a denominator (the total size of the order) in addition to the\n * signature and other order parameters. It also supports an optional field\n * for supplying extra data; this data will be provided to the zone if the\n * order type is restricted and the zone is not the caller, or will be\n * provided to the offerer as context for contract order types.\n */\nstruct AdvancedOrder {\n OrderParameters parameters;\n uint120 numerator;\n uint120 denominator;\n bytes signature;\n bytes extraData;\n}\n\n/**\n * @dev Orders can be validated (either explicitly via `validate`, or as a\n * consequence of a full or partial fill), specifically cancelled (they can\n * also be cancelled in bulk via incrementing a per-zone counter), and\n * partially or fully filled (with the fraction filled represented by a\n * numerator and denominator).\n */\nstruct OrderStatus {\n bool isValidated;\n bool isCancelled;\n uint120 numerator;\n uint120 denominator;\n}\n\n/**\n * @dev A criteria resolver specifies an order, side (offer vs. consideration),\n * and item index. It then provides a chosen identifier (i.e. tokenId)\n * alongside a merkle proof demonstrating the identifier meets the required\n * criteria.\n */\nstruct CriteriaResolver {\n uint256 orderIndex;\n Side side;\n uint256 index;\n uint256 identifier;\n bytes32[] criteriaProof;\n}\n\n/**\n * @dev A fulfillment is applied to a group of orders. It decrements a series of\n * offer and consideration items, then generates a single execution\n * element. A given fulfillment can be applied to as many offer and\n * consideration items as desired, but must contain at least one offer and\n * at least one consideration that match. The fulfillment must also remain\n * consistent on all key parameters across all offer items (same offerer,\n * token, type, tokenId, and conduit preference) as well as across all\n * consideration items (token, type, tokenId, and recipient).\n */\nstruct Fulfillment {\n FulfillmentComponent[] offerComponents;\n FulfillmentComponent[] considerationComponents;\n}\n\n/**\n * @dev Each fulfillment component contains one index referencing a specific\n * order and another referencing a specific offer or consideration item.\n */\nstruct FulfillmentComponent {\n uint256 orderIndex;\n uint256 itemIndex;\n}\n\n/**\n * @dev An execution is triggered once all consideration items have been zeroed\n * out. It sends the item in question from the offerer to the item's\n * recipient, optionally sourcing approvals from either this contract\n * directly or from the offerer's chosen conduit if one is specified. An\n * execution is not provided as an argument, but rather is derived via\n * orders, criteria resolvers, and fulfillments (where the total number of\n * executions will be less than or equal to the total number of indicated\n * fulfillments) and returned as part of `matchOrders`.\n */\nstruct Execution {\n ReceivedItem item;\n address offerer;\n bytes32 conduitKey;\n}\n\n/**\n * @dev Restricted orders are validated post-execution by calling validateOrder\n * on the zone. This struct provides context about the order fulfillment\n * and any supplied extraData, as well as all order hashes fulfilled in a\n * call to a match or fulfillAvailable method.\n */\nstruct ZoneParameters {\n bytes32 orderHash;\n address fulfiller;\n address offerer;\n SpentItem[] offer;\n ReceivedItem[] consideration;\n bytes extraData;\n bytes32[] orderHashes;\n uint256 startTime;\n uint256 endTime;\n bytes32 zoneHash;\n}\n\n/**\n * @dev Zones and contract offerers can communicate which schemas they implement\n * along with any associated metadata related to each schema.\n */\nstruct Schema {\n uint256 id;\n bytes metadata;\n}\n\nusing StructPointers for OrderComponents global;\nusing StructPointers for OfferItem global;\nusing StructPointers for ConsiderationItem global;\nusing StructPointers for SpentItem global;\nusing StructPointers for ReceivedItem global;\nusing StructPointers for BasicOrderParameters global;\nusing StructPointers for AdditionalRecipient global;\nusing StructPointers for OrderParameters global;\nusing StructPointers for Order global;\nusing StructPointers for AdvancedOrder global;\nusing StructPointers for OrderStatus global;\nusing StructPointers for CriteriaResolver global;\nusing StructPointers for Fulfillment global;\nusing StructPointers for FulfillmentComponent global;\nusing StructPointers for Execution global;\nusing StructPointers for ZoneParameters global;\n\n/**\n * @dev This library provides a set of functions for converting structs to\n * pointers.\n */\nlibrary StructPointers {\n /**\n * @dev Get a MemoryPointer from OrderComponents.\n *\n * @param obj The OrderComponents object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n OrderComponents memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from OrderComponents.\n *\n * @param obj The OrderComponents object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n OrderComponents calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from OfferItem.\n *\n * @param obj The OfferItem object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n OfferItem memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from OfferItem.\n *\n * @param obj The OfferItem object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n OfferItem calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from ConsiderationItem.\n *\n * @param obj The ConsiderationItem object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n ConsiderationItem memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from ConsiderationItem.\n *\n * @param obj The ConsiderationItem object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n ConsiderationItem calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from SpentItem.\n *\n * @param obj The SpentItem object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n SpentItem memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from SpentItem.\n *\n * @param obj The SpentItem object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n SpentItem calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from ReceivedItem.\n *\n * @param obj The ReceivedItem object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n ReceivedItem memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from ReceivedItem.\n *\n * @param obj The ReceivedItem object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n ReceivedItem calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from BasicOrderParameters.\n *\n * @param obj The BasicOrderParameters object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n BasicOrderParameters memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from BasicOrderParameters.\n *\n * @param obj The BasicOrderParameters object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n BasicOrderParameters calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from AdditionalRecipient.\n *\n * @param obj The AdditionalRecipient object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n AdditionalRecipient memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from AdditionalRecipient.\n *\n * @param obj The AdditionalRecipient object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n AdditionalRecipient calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from OrderParameters.\n *\n * @param obj The OrderParameters object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n OrderParameters memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from OrderParameters.\n *\n * @param obj The OrderParameters object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n OrderParameters calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from Order.\n *\n * @param obj The Order object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n Order memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from Order.\n *\n * @param obj The Order object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n Order calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from AdvancedOrder.\n *\n * @param obj The AdvancedOrder object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n AdvancedOrder memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from AdvancedOrder.\n *\n * @param obj The AdvancedOrder object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n AdvancedOrder calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from OrderStatus.\n *\n * @param obj The OrderStatus object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n OrderStatus memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from OrderStatus.\n *\n * @param obj The OrderStatus object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n OrderStatus calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from CriteriaResolver.\n *\n * @param obj The CriteriaResolver object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n CriteriaResolver memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from CriteriaResolver.\n *\n * @param obj The CriteriaResolver object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n CriteriaResolver calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from Fulfillment.\n *\n * @param obj The Fulfillment object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n Fulfillment memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from Fulfillment.\n *\n * @param obj The Fulfillment object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n Fulfillment calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from FulfillmentComponent.\n *\n * @param obj The FulfillmentComponent object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n FulfillmentComponent memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from FulfillmentComponent.\n *\n * @param obj The FulfillmentComponent object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n FulfillmentComponent calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from Execution.\n *\n * @param obj The Execution object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n Execution memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from Execution.\n *\n * @param obj The Execution object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n Execution calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a MemoryPointer from ZoneParameters.\n *\n * @param obj The ZoneParameters object.\n *\n * @return ptr The MemoryPointer.\n */\n function toMemoryPointer(\n ZoneParameters memory obj\n ) internal pure returns (MemoryPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n\n /**\n * @dev Get a CalldataPointer from ZoneParameters.\n *\n * @param obj The ZoneParameters object.\n *\n * @return ptr The CalldataPointer.\n */\n function toCalldataPointer(\n ZoneParameters calldata obj\n ) internal pure returns (CalldataPointer ptr) {\n assembly {\n ptr := obj\n }\n }\n}\n"
},
"lib/seaport/lib/seaport-types/src/interfaces/ContractOffererInterface.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {ReceivedItem, Schema, SpentItem} from \"../lib/ConsiderationStructs.sol\";\nimport {IERC165} from \"../interfaces/IERC165.sol\";\n\n/**\n * @title ContractOffererInterface\n * @notice Contains the minimum interfaces needed to interact with a contract\n * offerer.\n */\ninterface ContractOffererInterface is IERC165 {\n /**\n * @dev Generates an order with the specified minimum and maximum spent\n * items, and optional context (supplied as extraData).\n *\n * @param fulfiller The address of the fulfiller.\n * @param minimumReceived The minimum items that the caller is willing to\n * receive.\n * @param maximumSpent The maximum items the caller is willing to spend.\n * @param context Additional context of the order.\n *\n * @return offer A tuple containing the offer items.\n * @return consideration A tuple containing the consideration items.\n */\n function generateOrder(\n address fulfiller,\n SpentItem[] calldata minimumReceived,\n SpentItem[] calldata maximumSpent,\n bytes calldata context // encoded based on the schemaID\n ) external returns (SpentItem[] memory offer, ReceivedItem[] memory consideration);\n\n /**\n * @dev Ratifies an order with the specified offer, consideration, and\n * optional context (supplied as extraData).\n *\n * @param offer The offer items.\n * @param consideration The consideration items.\n * @param context Additional context of the order.\n * @param orderHashes The hashes to ratify.\n * @param contractNonce The nonce of the contract.\n *\n * @return ratifyOrderMagicValue The magic value returned by the contract\n * offerer.\n */\n function ratifyOrder(\n SpentItem[] calldata offer,\n ReceivedItem[] calldata consideration,\n bytes calldata context, // encoded based on the schemaID\n bytes32[] calldata orderHashes,\n uint256 contractNonce\n ) external returns (bytes4 ratifyOrderMagicValue);\n\n /**\n * @dev View function to preview an order generated in response to a minimum\n * set of received items, maximum set of spent items, and context\n * (supplied as extraData).\n *\n * @param caller The address of the caller (e.g. Seaport).\n * @param fulfiller The address of the fulfiller (e.g. the account\n * calling Seaport).\n * @param minimumReceived The minimum items that the caller is willing to\n * receive.\n * @param maximumSpent The maximum items the caller is willing to spend.\n * @param context Additional context of the order.\n *\n * @return offer A tuple containing the offer items.\n * @return consideration A tuple containing the consideration items.\n */\n function previewOrder(\n address caller,\n address fulfiller,\n SpentItem[] calldata minimumReceived,\n SpentItem[] calldata maximumSpent,\n bytes calldata context // encoded based on the schemaID\n ) external view returns (SpentItem[] memory offer, ReceivedItem[] memory consideration);\n\n /**\n * @dev Gets the metadata for this contract offerer.\n *\n * @return name The name of the contract offerer.\n * @return schemas The schemas supported by the contract offerer.\n */\n function getSeaportMetadata() external view returns (string memory name, Schema[] memory schemas); // map to Seaport Improvement Proposal IDs\n\n function supportsInterface(bytes4 interfaceId) external view override returns (bool);\n\n // Additional functions and/or events based on implemented schemaIDs\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.19;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"src/interfaces/ISeaDropTokenContractMetadata.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\ninterface ISeaDropTokenContractMetadata {\n /**\n * @dev Emit an event for token metadata reveals/updates,\n * according to EIP-4906.\n *\n * @param _fromTokenId The start token id.\n * @param _toTokenId The end token id.\n */\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n\n /**\n * @dev Emit an event when the URI for the collection-level metadata\n * is updated.\n */\n event ContractURIUpdated(string newContractURI);\n\n /**\n * @dev Emit an event with the previous and new provenance hash after\n * being updated.\n */\n event ProvenanceHashUpdated(bytes32 previousHash, bytes32 newHash);\n\n /**\n * @dev Emit an event when the EIP-2981 royalty info is updated.\n */\n event RoyaltyInfoUpdated(address receiver, uint256 basisPoints);\n\n /**\n * @notice Throw if the max supply exceeds uint64, a limit\n * due to the storage of bit-packed variables.\n */\n error CannotExceedMaxSupplyOfUint64(uint256 got);\n\n /**\n * @dev Revert with an error when attempting to set the provenance\n * hash after the mint has started.\n */\n error ProvenanceHashCannotBeSetAfterMintStarted();\n\n /**\n * @dev Revert with an error when attempting to set the provenance\n * hash after it has already been set.\n */\n error ProvenanceHashCannotBeSetAfterAlreadyBeingSet();\n\n /**\n * @notice Sets the base URI for the token metadata and emits an event.\n *\n * @param tokenURI The new base URI to set.\n */\n function setBaseURI(string calldata tokenURI) external;\n\n /**\n * @notice Sets the contract URI for contract metadata.\n *\n * @param newContractURI The new contract URI.\n */\n function setContractURI(string calldata newContractURI) external;\n\n /**\n * @notice Sets the provenance hash and emits an event.\n *\n * The provenance hash is used for random reveals, which\n * is a hash of the ordered metadata to show it has not been\n * modified after mint started.\n *\n * This function will revert after the first item has been minted.\n *\n * @param newProvenanceHash The new provenance hash to set.\n */\n function setProvenanceHash(bytes32 newProvenanceHash) external;\n\n /**\n * @notice Sets the default royalty information.\n *\n * Requirements:\n *\n * - `receiver` cannot be the zero address.\n * - `feeNumerator` cannot be greater than the fee denominator of\n * 10_000 basis points.\n */\n function setDefaultRoyalty(address receiver, uint96 feeNumerator) external;\n\n /**\n * @notice Returns the base URI for token metadata.\n */\n function baseURI() external view returns (string memory);\n\n /**\n * @notice Returns the contract URI.\n */\n function contractURI() external view returns (string memory);\n\n /**\n * @notice Returns the provenance hash.\n * The provenance hash is used for random reveals, which\n * is a hash of the ordered metadata to show it is unmodified\n * after mint has started.\n */\n function provenanceHash() external view returns (bytes32);\n}\n"
},
"src/interfaces/IERC1155ContractMetadata.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {\n ISeaDropTokenContractMetadata\n} from \"./ISeaDropTokenContractMetadata.sol\";\n\ninterface IERC1155ContractMetadata is ISeaDropTokenContractMetadata {\n /**\n * @dev A struct representing the supply info for a token id,\n * packed into one storage slot.\n *\n * @param maxSupply The max supply for the token id.\n * @param totalSupply The total token supply for the token id.\n * Subtracted when an item is burned.\n * @param totalMinted The total number of tokens minted for the token id.\n */\n struct TokenSupply {\n uint64 maxSupply; // 64/256 bits\n uint64 totalSupply; // 128/256 bits\n uint64 totalMinted; // 192/256 bits\n }\n\n /**\n * @dev Emit an event when the max token supply for a token id is updated.\n */\n event MaxSupplyUpdated(uint256 tokenId, uint256 newMaxSupply);\n\n /**\n * @dev Revert with an error if the mint quantity exceeds the max token\n * supply.\n */\n error MintExceedsMaxSupply(uint256 total, uint256 maxSupply);\n\n /**\n * @notice Sets the max supply for a token id and emits an event.\n *\n * @param tokenId The token id to set the max supply for.\n * @param newMaxSupply The new max supply to set.\n */\n function setMaxSupply(uint256 tokenId, uint256 newMaxSupply) external;\n\n /**\n * @notice Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @notice Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @notice Returns the max token supply for a token id.\n */\n function maxSupply(uint256 tokenId) external view returns (uint256);\n\n /**\n * @notice Returns the total supply for a token id.\n */\n function totalSupply(uint256 tokenId) external view returns (uint256);\n\n /**\n * @notice Returns the total minted for a token id.\n */\n function totalMinted(uint256 tokenId) external view returns (uint256);\n}\n"
},
"src/interfaces/ICreatorToken.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\ninterface ICreatorToken {\n event TransferValidatorUpdated(address oldValidator, address newValidator);\n\n function getTransferValidator() external view returns (address validator);\n\n function getTransferValidationFunction()\n external\n view\n returns (bytes4 functionSignature, bool isViewFunction);\n\n function setTransferValidator(address validator) external;\n}\n\ninterface ILegacyCreatorToken {\n event TransferValidatorUpdated(address oldValidator, address newValidator);\n\n function getTransferValidator() external view returns (address validator);\n\n function setTransferValidator(address validator) external;\n}\n"
},
"src/interfaces/ITransferValidator.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\ninterface ITransferValidator721 {\n /// @notice Ensure that a transfer has been authorized for a specific tokenId\n function validateTransfer(\n address caller,\n address from,\n address to,\n uint256 tokenId\n ) external view;\n}\n\ninterface ITransferValidator1155 {\n /// @notice Ensure that a transfer has been authorized for a specific amount of a specific tokenId, and reduce the transferable amount remaining\n function validateTransfer(\n address caller,\n address from,\n address to,\n uint256 tokenId,\n uint256 amount\n ) external;\n}\n"
},
"src/lib/TokenTransferValidator.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport { ICreatorToken } from \"../interfaces/ICreatorToken.sol\";\n\n/**\n * @title TokenTransferValidator\n * @notice Functionality to use a transfer validator.\n */\nabstract contract TokenTransferValidator is ICreatorToken {\n /// @dev Store the transfer validator. The null address means no transfer validator is set.\n address internal _transferValidator;\n\n /// @notice Revert with an error if the transfer validator is being set to the same address.\n error SameTransferValidator();\n\n /// @notice Returns the currently active transfer validator.\n /// The null address means no transfer validator is set.\n function getTransferValidator() external view returns (address) {\n return _transferValidator;\n }\n\n /// @notice Set the transfer validator.\n /// The external method that uses this must include access control.\n function _setTransferValidator(address newValidator) internal {\n address oldValidator = _transferValidator;\n if (oldValidator == newValidator) {\n revert SameTransferValidator();\n }\n _transferValidator = newValidator;\n emit TransferValidatorUpdated(oldValidator, newValidator);\n }\n}\n"
},
"lib/solady/src/tokens/ERC2981.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Simple ERC2981 NFT Royalty Standard implementation.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/tokens/ERC2981.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/common/ERC2981.sol)\nabstract contract ERC2981 {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The royalty fee numerator exceeds the fee denominator.\n error RoyaltyOverflow();\n\n /// @dev The royalty receiver cannot be the zero address.\n error RoyaltyReceiverIsZeroAddress();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STORAGE */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The default royalty info is given by:\n /// ```\n /// let packed := sload(_ERC2981_MASTER_SLOT_SEED)\n /// let receiver := shr(96, packed)\n /// let royaltyFraction := xor(packed, shl(96, receiver))\n /// ```\n ///\n /// The per token royalty info is given by.\n /// ```\n /// mstore(0x00, tokenId)\n /// mstore(0x20, _ERC2981_MASTER_SLOT_SEED)\n /// let packed := sload(keccak256(0x00, 0x40))\n /// let receiver := shr(96, packed)\n /// let royaltyFraction := xor(packed, shl(96, receiver))\n /// ```\n uint256 private constant _ERC2981_MASTER_SLOT_SEED = 0xaa4ec00224afccfdb7;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* ERC2981 */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Checks that `_feeDenominator` is non-zero.\n constructor() {\n require(_feeDenominator() != 0, \"Fee denominator cannot be zero.\");\n }\n\n /// @dev Returns the denominator for the royalty amount.\n /// Defaults to 10000, which represents fees in basis points.\n /// Override this function to return a custom amount if needed.\n function _feeDenominator() internal pure virtual returns (uint96) {\n return 10000;\n }\n\n /// @dev Returns true if this contract implements the interface defined by `interfaceId`.\n /// See: https://eips.ethereum.org/EIPS/eip-165\n /// This function call must use less than 30000 gas.\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n let s := shr(224, interfaceId)\n // ERC165: 0x01ffc9a7, ERC2981: 0x2a55205a.\n result := or(eq(s, 0x01ffc9a7), eq(s, 0x2a55205a))\n }\n }\n\n /// @dev Returns the `receiver` and `royaltyAmount` for `tokenId` sold at `salePrice`.\n function royaltyInfo(uint256 tokenId, uint256 salePrice)\n public\n view\n virtual\n returns (address receiver, uint256 royaltyAmount)\n {\n uint256 feeDenominator = _feeDenominator();\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, tokenId)\n mstore(0x20, _ERC2981_MASTER_SLOT_SEED)\n let packed := sload(keccak256(0x00, 0x40))\n receiver := shr(96, packed)\n if iszero(receiver) {\n packed := sload(mload(0x20))\n receiver := shr(96, packed)\n }\n let x := salePrice\n let y := xor(packed, shl(96, receiver)) // `feeNumerator`.\n // Overflow check, equivalent to `require(y == 0 || x <= type(uint256).max / y)`.\n // Out-of-gas revert. Should not be triggered in practice, but included for safety.\n returndatacopy(returndatasize(), returndatasize(), mul(y, gt(x, div(not(0), y))))\n royaltyAmount := div(mul(x, y), feeDenominator)\n }\n }\n\n /// @dev Sets the default royalty `receiver` and `feeNumerator`.\n ///\n /// Requirements:\n /// - `receiver` must not be the zero address.\n /// - `feeNumerator` must not be greater than the fee denominator.\n function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {\n uint256 feeDenominator = _feeDenominator();\n /// @solidity memory-safe-assembly\n assembly {\n feeNumerator := shr(160, shl(160, feeNumerator))\n if gt(feeNumerator, feeDenominator) {\n mstore(0x00, 0x350a88b3) // `RoyaltyOverflow()`.\n revert(0x1c, 0x04)\n }\n let packed := shl(96, receiver)\n if iszero(packed) {\n mstore(0x00, 0xb4457eaa) // `RoyaltyReceiverIsZeroAddress()`.\n revert(0x1c, 0x04)\n }\n sstore(_ERC2981_MASTER_SLOT_SEED, or(packed, feeNumerator))\n }\n }\n\n /// @dev Sets the default royalty `receiver` and `feeNumerator` to zero.\n function _deleteDefaultRoyalty() internal virtual {\n /// @solidity memory-safe-assembly\n assembly {\n sstore(_ERC2981_MASTER_SLOT_SEED, 0)\n }\n }\n\n /// @dev Sets the royalty `receiver` and `feeNumerator` for `tokenId`.\n ///\n /// Requirements:\n /// - `receiver` must not be the zero address.\n /// - `feeNumerator` must not be greater than the fee denominator.\n function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator)\n internal\n virtual\n {\n uint256 feeDenominator = _feeDenominator();\n /// @solidity memory-safe-assembly\n assembly {\n feeNumerator := shr(160, shl(160, feeNumerator))\n if gt(feeNumerator, feeDenominator) {\n mstore(0x00, 0x350a88b3) // `RoyaltyOverflow()`.\n revert(0x1c, 0x04)\n }\n let packed := shl(96, receiver)\n if iszero(packed) {\n mstore(0x00, 0xb4457eaa) // `RoyaltyReceiverIsZeroAddress()`.\n revert(0x1c, 0x04)\n }\n mstore(0x00, tokenId)\n mstore(0x20, _ERC2981_MASTER_SLOT_SEED)\n sstore(keccak256(0x00, 0x40), or(packed, feeNumerator))\n }\n }\n\n /// @dev Sets the royalty `receiver` and `feeNumerator` for `tokenId` to zero.\n function _resetTokenRoyalty(uint256 tokenId) internal virtual {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, tokenId)\n mstore(0x20, _ERC2981_MASTER_SLOT_SEED)\n sstore(keccak256(0x00, 0x40), 0)\n }\n }\n}\n"
},
"lib/solady/src/auth/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Simple single owner authorization mixin.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol)\n/// @dev While the ownable portion follows\n/// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility,\n/// the nomenclature for the 2-step ownership handover may be unique to this codebase.\nabstract contract Ownable {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The caller is not authorized to call the function.\n error Unauthorized();\n\n /// @dev The `newOwner` cannot be the zero address.\n error NewOwnerIsZeroAddress();\n\n /// @dev The `pendingOwner` does not have a valid handover request.\n error NoHandoverRequest();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* EVENTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The ownership is transferred from `oldOwner` to `newOwner`.\n /// This event is intentionally kept the same as OpenZeppelin's Ownable to be\n /// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173),\n /// despite it not being as lightweight as a single argument event.\n event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);\n\n /// @dev An ownership handover to `pendingOwner` has been requested.\n event OwnershipHandoverRequested(address indexed pendingOwner);\n\n /// @dev The ownership handover to `pendingOwner` has been canceled.\n event OwnershipHandoverCanceled(address indexed pendingOwner);\n\n /// @dev `keccak256(bytes(\"OwnershipTransferred(address,address)\"))`.\n uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE =\n 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0;\n\n /// @dev `keccak256(bytes(\"OwnershipHandoverRequested(address)\"))`.\n uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE =\n 0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d;\n\n /// @dev `keccak256(bytes(\"OwnershipHandoverCanceled(address)\"))`.\n uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE =\n 0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STORAGE */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The owner slot is given by: `not(_OWNER_SLOT_NOT)`.\n /// It is intentionally chosen to be a high value\n /// to avoid collision with lower slots.\n /// The choice of manual storage layout is to enable compatibility\n /// with both regular and upgradeable contracts.\n uint256 private constant _OWNER_SLOT_NOT = 0x8b78c6d8;\n\n /// The ownership handover slot of `newOwner` is given by:\n /// ```\n /// mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED))\n /// let handoverSlot := keccak256(0x00, 0x20)\n /// ```\n /// It stores the expiry timestamp of the two-step ownership handover.\n uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Initializes the owner directly without authorization guard.\n /// This function must be called upon initialization,\n /// regardless of whether the contract is upgradeable or not.\n /// This is to enable generalization to both regular and upgradeable contracts,\n /// and to save gas in case the initial owner is not the caller.\n /// For performance reasons, this function will not check if there\n /// is an existing owner.\n function _initializeOwner(address newOwner) internal virtual {\n /// @solidity memory-safe-assembly\n assembly {\n // Clean the upper 96 bits.\n newOwner := shr(96, shl(96, newOwner))\n // Store the new value.\n sstore(not(_OWNER_SLOT_NOT), newOwner)\n // Emit the {OwnershipTransferred} event.\n log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)\n }\n }\n\n /// @dev Sets the owner directly without authorization guard.\n function _setOwner(address newOwner) internal virtual {\n /// @solidity memory-safe-assembly\n assembly {\n let ownerSlot := not(_OWNER_SLOT_NOT)\n // Clean the upper 96 bits.\n newOwner := shr(96, shl(96, newOwner))\n // Emit the {OwnershipTransferred} event.\n log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)\n // Store the new value.\n sstore(ownerSlot, newOwner)\n }\n }\n\n /// @dev Throws if the sender is not the owner.\n function _checkOwner() internal view virtual {\n /// @solidity memory-safe-assembly\n assembly {\n // If the caller is not the stored owner, revert.\n if iszero(eq(caller(), sload(not(_OWNER_SLOT_NOT)))) {\n mstore(0x00, 0x82b42900) // `Unauthorized()`.\n revert(0x1c, 0x04)\n }\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* PUBLIC UPDATE FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Allows the owner to transfer the ownership to `newOwner`.\n function transferOwnership(address newOwner) public payable virtual onlyOwner {\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(shl(96, newOwner)) {\n mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`.\n revert(0x1c, 0x04)\n }\n }\n _setOwner(newOwner);\n }\n\n /// @dev Allows the owner to renounce their ownership.\n function renounceOwnership() public payable virtual onlyOwner {\n _setOwner(address(0));\n }\n\n /// @dev Request a two-step ownership handover to the caller.\n /// The request will automatically expire in 48 hours (172800 seconds) by default.\n function requestOwnershipHandover() public payable virtual {\n unchecked {\n uint256 expires = block.timestamp + ownershipHandoverValidFor();\n /// @solidity memory-safe-assembly\n assembly {\n // Compute and set the handover slot to `expires`.\n mstore(0x0c, _HANDOVER_SLOT_SEED)\n mstore(0x00, caller())\n sstore(keccak256(0x0c, 0x20), expires)\n // Emit the {OwnershipHandoverRequested} event.\n log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller())\n }\n }\n }\n\n /// @dev Cancels the two-step ownership handover to the caller, if any.\n function cancelOwnershipHandover() public payable virtual {\n /// @solidity memory-safe-assembly\n assembly {\n // Compute and set the handover slot to 0.\n mstore(0x0c, _HANDOVER_SLOT_SEED)\n mstore(0x00, caller())\n sstore(keccak256(0x0c, 0x20), 0)\n // Emit the {OwnershipHandoverCanceled} event.\n log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller())\n }\n }\n\n /// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`.\n /// Reverts if there is no existing ownership handover requested by `pendingOwner`.\n function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner {\n /// @solidity memory-safe-assembly\n assembly {\n // Compute and set the handover slot to 0.\n mstore(0x0c, _HANDOVER_SLOT_SEED)\n mstore(0x00, pendingOwner)\n let handoverSlot := keccak256(0x0c, 0x20)\n // If the handover does not exist, or has expired.\n if gt(timestamp(), sload(handoverSlot)) {\n mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`.\n revert(0x1c, 0x04)\n }\n // Set the handover slot to 0.\n sstore(handoverSlot, 0)\n }\n _setOwner(pendingOwner);\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* PUBLIC READ FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the owner of the contract.\n function owner() public view virtual returns (address result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := sload(not(_OWNER_SLOT_NOT))\n }\n }\n\n /// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`.\n function ownershipHandoverExpiresAt(address pendingOwner)\n public\n view\n virtual\n returns (uint256 result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n // Compute the handover slot.\n mstore(0x0c, _HANDOVER_SLOT_SEED)\n mstore(0x00, pendingOwner)\n // Load the handover slot.\n result := sload(keccak256(0x0c, 0x20))\n }\n }\n\n /// @dev Returns how long a two-step ownership handover is valid for in seconds.\n function ownershipHandoverValidFor() public view virtual returns (uint64) {\n return 48 * 3600;\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* MODIFIERS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Marks a function as only callable by the owner.\n modifier onlyOwner() virtual {\n _checkOwner();\n _;\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.19;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (address(this).code.length == 0 && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized != type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n"
},
"src/lib/SeaDropErrorsAndEvents.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { CreatorPayout, PublicDrop } from \"./ERC721SeaDropStructs.sol\";\n\ninterface SeaDropErrorsAndEvents {\n /**\n * @notice The SeaDrop token types, emitted as part of\n * `event SeaDropTokenDeployed`.\n */\n enum SEADROP_TOKEN_TYPE {\n ERC721_STANDARD,\n ERC721_CLONE,\n ERC721_UPGRADEABLE,\n ERC1155_STANDARD,\n ERC1155_CLONE,\n ERC1155_UPGRADEABLE\n }\n\n /**\n * @notice An event to signify that a SeaDrop token contract was deployed.\n */\n event SeaDropTokenDeployed(SEADROP_TOKEN_TYPE tokenType);\n\n /**\n * @notice Revert with an error if the function selector is not supported.\n */\n error UnsupportedFunctionSelector(bytes4 selector);\n\n /**\n * @dev Revert with an error if the drop stage is not active.\n */\n error NotActive(\n uint256 currentTimestamp,\n uint256 startTimestamp,\n uint256 endTimestamp\n );\n\n /**\n * @dev Revert with an error if the mint quantity exceeds the max allowed\n * to be minted per wallet.\n */\n error MintQuantityExceedsMaxMintedPerWallet(uint256 total, uint256 allowed);\n\n /**\n * @dev Revert with an error if the mint quantity exceeds the max token\n * supply.\n */\n error MintQuantityExceedsMaxSupply(uint256 total, uint256 maxSupply);\n\n /**\n * @dev Revert with an error if the mint quantity exceeds the max token\n * supply for the stage.\n * Note: The `maxTokenSupplyForStage` for public mint is\n * always `type(uint).max`.\n */\n error MintQuantityExceedsMaxTokenSupplyForStage(\n uint256 total,\n uint256 maxTokenSupplyForStage\n );\n\n /**\n * @dev Revert if the fee recipient is the zero address.\n */\n error FeeRecipientCannotBeZeroAddress();\n\n /**\n * @dev Revert if the fee recipient is not already included.\n */\n error FeeRecipientNotPresent();\n\n /**\n * @dev Revert if the fee basis points is greater than 10_000.\n */\n error InvalidFeeBps(uint256 feeBps);\n\n /**\n * @dev Revert if the fee recipient is already included.\n */\n error DuplicateFeeRecipient();\n\n /**\n * @dev Revert if the fee recipient is restricted and not allowed.\n */\n error FeeRecipientNotAllowed(address got);\n\n /**\n * @dev Revert if the creator payout address is the zero address.\n */\n error CreatorPayoutAddressCannotBeZeroAddress();\n\n /**\n * @dev Revert if the creator payouts are not set.\n */\n error CreatorPayoutsNotSet();\n\n /**\n * @dev Revert if the creator payout basis points are zero.\n */\n error CreatorPayoutBasisPointsCannotBeZero();\n\n /**\n * @dev Revert if the total basis points for the creator payouts\n * don't equal exactly 10_000.\n */\n error InvalidCreatorPayoutTotalBasisPoints(\n uint256 totalReceivedBasisPoints\n );\n\n /**\n * @dev Revert if the creator payout basis points don't add up to 10_000.\n */\n error InvalidCreatorPayoutBasisPoints(uint256 totalReceivedBasisPoints);\n\n /**\n * @dev Revert with an error if the allow list proof is invalid.\n */\n error InvalidProof();\n\n /**\n * @dev Revert if a supplied signer address is the zero address.\n */\n error SignerCannotBeZeroAddress();\n\n /**\n * @dev Revert with an error if a signer is not included in\n * the enumeration when removing.\n */\n error SignerNotPresent();\n\n /**\n * @dev Revert with an error if a payer is not included in\n * the enumeration when removing.\n */\n error PayerNotPresent();\n\n /**\n * @dev Revert with an error if a payer is already included in mapping\n * when adding.\n */\n error DuplicatePayer();\n\n /**\n * @dev Revert with an error if a signer is already included in mapping\n * when adding.\n */\n error DuplicateSigner();\n\n /**\n * @dev Revert with an error if the payer is not allowed. The minter must\n * pay for their own mint.\n */\n error PayerNotAllowed(address got);\n\n /**\n * @dev Revert if a supplied payer address is the zero address.\n */\n error PayerCannotBeZeroAddress();\n\n /**\n * @dev Revert if the start time is greater than the end time.\n */\n error InvalidStartAndEndTime(uint256 startTime, uint256 endTime);\n\n /**\n * @dev Revert with an error if the signer payment token is not the same.\n */\n error InvalidSignedPaymentToken(address got, address want);\n\n /**\n * @dev Revert with an error if supplied signed mint price is less than\n * the minimum specified.\n */\n error InvalidSignedMintPrice(\n address paymentToken,\n uint256 got,\n uint256 minimum\n );\n\n /**\n * @dev Revert with an error if supplied signed maxTotalMintableByWallet\n * is greater than the maximum specified.\n */\n error InvalidSignedMaxTotalMintableByWallet(uint256 got, uint256 maximum);\n\n /**\n * @dev Revert with an error if supplied signed\n * maxTotalMintableByWalletPerToken is greater than the maximum\n * specified.\n */\n error InvalidSignedMaxTotalMintableByWalletPerToken(\n uint256 got,\n uint256 maximum\n );\n\n /**\n * @dev Revert with an error if the fromTokenId is not within range.\n */\n error InvalidSignedFromTokenId(uint256 got, uint256 minimum);\n\n /**\n * @dev Revert with an error if the toTokenId is not within range.\n */\n error InvalidSignedToTokenId(uint256 got, uint256 maximum);\n\n /**\n * @dev Revert with an error if supplied signed start time is less than\n * the minimum specified.\n */\n error InvalidSignedStartTime(uint256 got, uint256 minimum);\n\n /**\n * @dev Revert with an error if supplied signed end time is greater than\n * the maximum specified.\n */\n error InvalidSignedEndTime(uint256 got, uint256 maximum);\n\n /**\n * @dev Revert with an error if supplied signed maxTokenSupplyForStage\n * is greater than the maximum specified.\n */\n error InvalidSignedMaxTokenSupplyForStage(uint256 got, uint256 maximum);\n\n /**\n * @dev Revert with an error if supplied signed feeBps is greater than\n * the maximum specified, or less than the minimum.\n */\n error InvalidSignedFeeBps(uint256 got, uint256 minimumOrMaximum);\n\n /**\n * @dev Revert with an error if signed mint did not specify to restrict\n * fee recipients.\n */\n error SignedMintsMustRestrictFeeRecipients();\n\n /**\n * @dev Revert with an error if a signature for a signed mint has already\n * been used.\n */\n error SignatureAlreadyUsed();\n\n /**\n * @dev Revert with an error if the contract has no balance to withdraw.\n */\n error NoBalanceToWithdraw();\n\n /**\n * @dev Revert with an error if the caller is not an allowed Seaport.\n */\n error InvalidCallerOnlyAllowedSeaport(address caller);\n\n /**\n * @dev Revert with an error if the order does not have the ERC1155 magic\n * consideration item to signify a consecutive mint.\n */\n error MustSpecifyERC1155ConsiderationItemForSeaDropMint();\n\n /**\n * @dev Revert with an error if the extra data version is not supported.\n */\n error UnsupportedExtraDataVersion(uint8 version);\n\n /**\n * @dev Revert with an error if the extra data encoding is not supported.\n */\n error InvalidExtraDataEncoding(uint8 version);\n\n /**\n * @dev Revert with an error if the provided substandard is not supported.\n */\n error InvalidSubstandard(uint8 substandard);\n\n /**\n * @dev Revert with an error if the implementation contract is called without\n * delegatecall.\n */\n error OnlyDelegateCalled();\n\n /**\n * @dev Revert with an error if the provided allowed Seaport is the\n * zero address.\n */\n error AllowedSeaportCannotBeZeroAddress();\n\n /**\n * @dev Emit an event when allowed Seaport contracts are updated.\n */\n event AllowedSeaportUpdated(address[] allowedSeaport);\n\n /**\n * @dev An event with details of a SeaDrop mint, for analytical purposes.\n *\n * @param payer The address who payed for the tx.\n * @param dropStageIndex The drop stage index. Items minted through\n * public mint have dropStageIndex of 0\n */\n event SeaDropMint(address payer, uint256 dropStageIndex);\n\n /**\n * @dev An event with updated allow list data.\n *\n * @param previousMerkleRoot The previous allow list merkle root.\n * @param newMerkleRoot The new allow list merkle root.\n * @param publicKeyURI If the allow list is encrypted, the public key\n * URIs that can decrypt the list.\n * Empty if unencrypted.\n * @param allowListURI The URI for the allow list.\n */\n event AllowListUpdated(\n bytes32 indexed previousMerkleRoot,\n bytes32 indexed newMerkleRoot,\n string[] publicKeyURI,\n string allowListURI\n );\n\n /**\n * @dev An event with updated drop URI.\n */\n event DropURIUpdated(string newDropURI);\n\n /**\n * @dev An event with the updated creator payout address.\n */\n event CreatorPayoutsUpdated(CreatorPayout[] creatorPayouts);\n\n /**\n * @dev An event with the updated allowed fee recipient.\n */\n event AllowedFeeRecipientUpdated(\n address indexed feeRecipient,\n bool indexed allowed\n );\n\n /**\n * @dev An event with the updated signer.\n */\n event SignerUpdated(address indexed signer, bool indexed allowed);\n\n /**\n * @dev An event with the updated payer.\n */\n event PayerUpdated(address indexed payer, bool indexed allowed);\n}\n"
},
"lib/seaport/lib/seaport-types/src/lib/ConsiderationEnums.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nenum OrderType {\n // 0: no partial fills, anyone can execute\n FULL_OPEN,\n\n // 1: partial fills supported, anyone can execute\n PARTIAL_OPEN,\n\n // 2: no partial fills, only offerer or zone can execute\n FULL_RESTRICTED,\n\n // 3: partial fills supported, only offerer or zone can execute\n PARTIAL_RESTRICTED,\n\n // 4: contract order type\n CONTRACT\n}\n\nenum BasicOrderType {\n // 0: no partial fills, anyone can execute\n ETH_TO_ERC721_FULL_OPEN,\n\n // 1: partial fills supported, anyone can execute\n ETH_TO_ERC721_PARTIAL_OPEN,\n\n // 2: no partial fills, only offerer or zone can execute\n ETH_TO_ERC721_FULL_RESTRICTED,\n\n // 3: partial fills supported, only offerer or zone can execute\n ETH_TO_ERC721_PARTIAL_RESTRICTED,\n\n // 4: no partial fills, anyone can execute\n ETH_TO_ERC1155_FULL_OPEN,\n\n // 5: partial fills supported, anyone can execute\n ETH_TO_ERC1155_PARTIAL_OPEN,\n\n // 6: no partial fills, only offerer or zone can execute\n ETH_TO_ERC1155_FULL_RESTRICTED,\n\n // 7: partial fills supported, only offerer or zone can execute\n ETH_TO_ERC1155_PARTIAL_RESTRICTED,\n\n // 8: no partial fills, anyone can execute\n ERC20_TO_ERC721_FULL_OPEN,\n\n // 9: partial fills supported, anyone can execute\n ERC20_TO_ERC721_PARTIAL_OPEN,\n\n // 10: no partial fills, only offerer or zone can execute\n ERC20_TO_ERC721_FULL_RESTRICTED,\n\n // 11: partial fills supported, only offerer or zone can execute\n ERC20_TO_ERC721_PARTIAL_RESTRICTED,\n\n // 12: no partial fills, anyone can execute\n ERC20_TO_ERC1155_FULL_OPEN,\n\n // 13: partial fills supported, anyone can execute\n ERC20_TO_ERC1155_PARTIAL_OPEN,\n\n // 14: no partial fills, only offerer or zone can execute\n ERC20_TO_ERC1155_FULL_RESTRICTED,\n\n // 15: partial fills supported, only offerer or zone can execute\n ERC20_TO_ERC1155_PARTIAL_RESTRICTED,\n\n // 16: no partial fills, anyone can execute\n ERC721_TO_ERC20_FULL_OPEN,\n\n // 17: partial fills supported, anyone can execute\n ERC721_TO_ERC20_PARTIAL_OPEN,\n\n // 18: no partial fills, only offerer or zone can execute\n ERC721_TO_ERC20_FULL_RESTRICTED,\n\n // 19: partial fills supported, only offerer or zone can execute\n ERC721_TO_ERC20_PARTIAL_RESTRICTED,\n\n // 20: no partial fills, anyone can execute\n ERC1155_TO_ERC20_FULL_OPEN,\n\n // 21: partial fills supported, anyone can execute\n ERC1155_TO_ERC20_PARTIAL_OPEN,\n\n // 22: no partial fills, only offerer or zone can execute\n ERC1155_TO_ERC20_FULL_RESTRICTED,\n\n // 23: partial fills supported, only offerer or zone can execute\n ERC1155_TO_ERC20_PARTIAL_RESTRICTED\n}\n\nenum BasicOrderRouteType {\n // 0: provide Ether (or other native token) to receive offered ERC721 item.\n ETH_TO_ERC721,\n\n // 1: provide Ether (or other native token) to receive offered ERC1155 item.\n ETH_TO_ERC1155,\n\n // 2: provide ERC20 item to receive offered ERC721 item.\n ERC20_TO_ERC721,\n\n // 3: provide ERC20 item to receive offered ERC1155 item.\n ERC20_TO_ERC1155,\n\n // 4: provide ERC721 item to receive offered ERC20 item.\n ERC721_TO_ERC20,\n\n // 5: provide ERC1155 item to receive offered ERC20 item.\n ERC1155_TO_ERC20\n}\n\nenum ItemType {\n // 0: ETH on mainnet, MATIC on polygon, etc.\n NATIVE,\n\n // 1: ERC20 items (ERC777 and ERC20 analogues could also technically work)\n ERC20,\n\n // 2: ERC721 items\n ERC721,\n\n // 3: ERC1155 items\n ERC1155,\n\n // 4: ERC721 items where a number of tokenIds are supported\n ERC721_WITH_CRITERIA,\n\n // 5: ERC1155 items where a number of ids are supported\n ERC1155_WITH_CRITERIA\n}\n\nenum Side {\n // 0: Items that can be spent\n OFFER,\n\n // 1: Items that must be received\n CONSIDERATION\n}\n"
},
"lib/seaport/lib/seaport-types/src/helpers/PointerLibraries.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\ntype CalldataPointer is uint256;\n\ntype ReturndataPointer is uint256;\n\ntype MemoryPointer is uint256;\n\nusing CalldataPointerLib for CalldataPointer global;\nusing MemoryPointerLib for MemoryPointer global;\nusing ReturndataPointerLib for ReturndataPointer global;\n\nusing CalldataReaders for CalldataPointer global;\nusing ReturndataReaders for ReturndataPointer global;\nusing MemoryReaders for MemoryPointer global;\nusing MemoryWriters for MemoryPointer global;\n\nCalldataPointer constant CalldataStart = CalldataPointer.wrap(0x04);\nMemoryPointer constant FreeMemoryPPtr = MemoryPointer.wrap(0x40);\nuint256 constant IdentityPrecompileAddress = 0x4;\nuint256 constant OffsetOrLengthMask = 0xffffffff;\nuint256 constant _OneWord = 0x20;\nuint256 constant _FreeMemoryPointerSlot = 0x40;\n\n/// @dev Allocates `size` bytes in memory by increasing the free memory pointer\n/// and returns the memory pointer to the first byte of the allocated region.\n// (Free functions cannot have visibility.)\n// solhint-disable-next-line func-visibility\nfunction malloc(uint256 size) pure returns (MemoryPointer mPtr) {\n assembly {\n mPtr := mload(_FreeMemoryPointerSlot)\n mstore(_FreeMemoryPointerSlot, add(mPtr, size))\n }\n}\n\n// (Free functions cannot have visibility.)\n// solhint-disable-next-line func-visibility\nfunction getFreeMemoryPointer() pure returns (MemoryPointer mPtr) {\n mPtr = FreeMemoryPPtr.readMemoryPointer();\n}\n\n// (Free functions cannot have visibility.)\n// solhint-disable-next-line func-visibility\nfunction setFreeMemoryPointer(MemoryPointer mPtr) pure {\n FreeMemoryPPtr.write(mPtr);\n}\n\nlibrary CalldataPointerLib {\n function lt(\n CalldataPointer a,\n CalldataPointer b\n ) internal pure returns (bool c) {\n assembly {\n c := lt(a, b)\n }\n }\n\n function gt(\n CalldataPointer a,\n CalldataPointer b\n ) internal pure returns (bool c) {\n assembly {\n c := gt(a, b)\n }\n }\n\n function eq(\n CalldataPointer a,\n CalldataPointer b\n ) internal pure returns (bool c) {\n assembly {\n c := eq(a, b)\n }\n }\n\n function isNull(CalldataPointer a) internal pure returns (bool b) {\n assembly {\n b := iszero(a)\n }\n }\n\n /// @dev Resolves an offset stored at `cdPtr + headOffset` to a calldata.\n /// pointer `cdPtr` must point to some parent object with a dynamic\n /// type's head stored at `cdPtr + headOffset`.\n function pptr(\n CalldataPointer cdPtr,\n uint256 headOffset\n ) internal pure returns (CalldataPointer cdPtrChild) {\n cdPtrChild = cdPtr.offset(\n cdPtr.offset(headOffset).readUint256() & OffsetOrLengthMask\n );\n }\n\n /// @dev Resolves an offset stored at `cdPtr` to a calldata pointer.\n /// `cdPtr` must point to some parent object with a dynamic type as its\n /// first member, e.g. `struct { bytes data; }`\n function pptr(\n CalldataPointer cdPtr\n ) internal pure returns (CalldataPointer cdPtrChild) {\n cdPtrChild = cdPtr.offset(cdPtr.readUint256() & OffsetOrLengthMask);\n }\n\n /// @dev Returns the calldata pointer one word after `cdPtr`.\n function next(\n CalldataPointer cdPtr\n ) internal pure returns (CalldataPointer cdPtrNext) {\n assembly {\n cdPtrNext := add(cdPtr, _OneWord)\n }\n }\n\n /// @dev Returns the calldata pointer `_offset` bytes after `cdPtr`.\n function offset(\n CalldataPointer cdPtr,\n uint256 _offset\n ) internal pure returns (CalldataPointer cdPtrNext) {\n assembly {\n cdPtrNext := add(cdPtr, _offset)\n }\n }\n\n /// @dev Copies `size` bytes from calldata starting at `src` to memory at\n /// `dst`.\n function copy(\n CalldataPointer src,\n MemoryPointer dst,\n uint256 size\n ) internal pure {\n assembly {\n calldatacopy(dst, src, size)\n }\n }\n}\n\nlibrary ReturndataPointerLib {\n function lt(\n ReturndataPointer a,\n ReturndataPointer b\n ) internal pure returns (bool c) {\n assembly {\n c := lt(a, b)\n }\n }\n\n function gt(\n ReturndataPointer a,\n ReturndataPointer b\n ) internal pure returns (bool c) {\n assembly {\n c := gt(a, b)\n }\n }\n\n function eq(\n ReturndataPointer a,\n ReturndataPointer b\n ) internal pure returns (bool c) {\n assembly {\n c := eq(a, b)\n }\n }\n\n function isNull(ReturndataPointer a) internal pure returns (bool b) {\n assembly {\n b := iszero(a)\n }\n }\n\n /// @dev Resolves an offset stored at `rdPtr + headOffset` to a returndata\n /// pointer. `rdPtr` must point to some parent object with a dynamic\n /// type's head stored at `rdPtr + headOffset`.\n function pptr(\n ReturndataPointer rdPtr,\n uint256 headOffset\n ) internal pure returns (ReturndataPointer rdPtrChild) {\n rdPtrChild = rdPtr.offset(\n rdPtr.offset(headOffset).readUint256() & OffsetOrLengthMask\n );\n }\n\n /// @dev Resolves an offset stored at `rdPtr` to a returndata pointer.\n /// `rdPtr` must point to some parent object with a dynamic type as its\n /// first member, e.g. `struct { bytes data; }`\n function pptr(\n ReturndataPointer rdPtr\n ) internal pure returns (ReturndataPointer rdPtrChild) {\n rdPtrChild = rdPtr.offset(rdPtr.readUint256() & OffsetOrLengthMask);\n }\n\n /// @dev Returns the returndata pointer one word after `cdPtr`.\n function next(\n ReturndataPointer rdPtr\n ) internal pure returns (ReturndataPointer rdPtrNext) {\n assembly {\n rdPtrNext := add(rdPtr, _OneWord)\n }\n }\n\n /// @dev Returns the returndata pointer `_offset` bytes after `cdPtr`.\n function offset(\n ReturndataPointer rdPtr,\n uint256 _offset\n ) internal pure returns (ReturndataPointer rdPtrNext) {\n assembly {\n rdPtrNext := add(rdPtr, _offset)\n }\n }\n\n /// @dev Copies `size` bytes from returndata starting at `src` to memory at\n /// `dst`.\n function copy(\n ReturndataPointer src,\n MemoryPointer dst,\n uint256 size\n ) internal pure {\n assembly {\n returndatacopy(dst, src, size)\n }\n }\n}\n\nlibrary MemoryPointerLib {\n function copy(\n MemoryPointer src,\n MemoryPointer dst,\n uint256 size\n ) internal view {\n assembly {\n let success := staticcall(\n gas(),\n IdentityPrecompileAddress,\n src,\n size,\n dst,\n size\n )\n if or(iszero(returndatasize()), iszero(success)) {\n revert(0, 0)\n }\n }\n }\n\n function lt(\n MemoryPointer a,\n MemoryPointer b\n ) internal pure returns (bool c) {\n assembly {\n c := lt(a, b)\n }\n }\n\n function gt(\n MemoryPointer a,\n MemoryPointer b\n ) internal pure returns (bool c) {\n assembly {\n c := gt(a, b)\n }\n }\n\n function eq(\n MemoryPointer a,\n MemoryPointer b\n ) internal pure returns (bool c) {\n assembly {\n c := eq(a, b)\n }\n }\n\n function isNull(MemoryPointer a) internal pure returns (bool b) {\n assembly {\n b := iszero(a)\n }\n }\n\n function hash(\n MemoryPointer ptr,\n uint256 length\n ) internal pure returns (bytes32 _hash) {\n assembly {\n _hash := keccak256(ptr, length)\n }\n }\n\n /// @dev Returns the memory pointer one word after `mPtr`.\n function next(\n MemoryPointer mPtr\n ) internal pure returns (MemoryPointer mPtrNext) {\n assembly {\n mPtrNext := add(mPtr, _OneWord)\n }\n }\n\n /// @dev Returns the memory pointer `_offset` bytes after `mPtr`.\n function offset(\n MemoryPointer mPtr,\n uint256 _offset\n ) internal pure returns (MemoryPointer mPtrNext) {\n assembly {\n mPtrNext := add(mPtr, _offset)\n }\n }\n\n /// @dev Resolves a pointer at `mPtr + headOffset` to a memory\n /// pointer. `mPtr` must point to some parent object with a dynamic\n /// type's pointer stored at `mPtr + headOffset`.\n function pptr(\n MemoryPointer mPtr,\n uint256 headOffset\n ) internal pure returns (MemoryPointer mPtrChild) {\n mPtrChild = mPtr.offset(headOffset).readMemoryPointer();\n }\n\n /// @dev Resolves a pointer stored at `mPtr` to a memory pointer.\n /// `mPtr` must point to some parent object with a dynamic type as its\n /// first member, e.g. `struct { bytes data; }`\n function pptr(\n MemoryPointer mPtr\n ) internal pure returns (MemoryPointer mPtrChild) {\n mPtrChild = mPtr.readMemoryPointer();\n }\n}\n\nlibrary CalldataReaders {\n /// @dev Reads the value at `cdPtr` and applies a mask to return only the\n /// last 4 bytes.\n function readMaskedUint256(\n CalldataPointer cdPtr\n ) internal pure returns (uint256 value) {\n value = cdPtr.readUint256() & OffsetOrLengthMask;\n }\n\n /// @dev Reads the bool at `cdPtr` in calldata.\n function readBool(\n CalldataPointer cdPtr\n ) internal pure returns (bool value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the address at `cdPtr` in calldata.\n function readAddress(\n CalldataPointer cdPtr\n ) internal pure returns (address value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes1 at `cdPtr` in calldata.\n function readBytes1(\n CalldataPointer cdPtr\n ) internal pure returns (bytes1 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes2 at `cdPtr` in calldata.\n function readBytes2(\n CalldataPointer cdPtr\n ) internal pure returns (bytes2 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes3 at `cdPtr` in calldata.\n function readBytes3(\n CalldataPointer cdPtr\n ) internal pure returns (bytes3 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes4 at `cdPtr` in calldata.\n function readBytes4(\n CalldataPointer cdPtr\n ) internal pure returns (bytes4 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes5 at `cdPtr` in calldata.\n function readBytes5(\n CalldataPointer cdPtr\n ) internal pure returns (bytes5 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes6 at `cdPtr` in calldata.\n function readBytes6(\n CalldataPointer cdPtr\n ) internal pure returns (bytes6 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes7 at `cdPtr` in calldata.\n function readBytes7(\n CalldataPointer cdPtr\n ) internal pure returns (bytes7 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes8 at `cdPtr` in calldata.\n function readBytes8(\n CalldataPointer cdPtr\n ) internal pure returns (bytes8 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes9 at `cdPtr` in calldata.\n function readBytes9(\n CalldataPointer cdPtr\n ) internal pure returns (bytes9 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes10 at `cdPtr` in calldata.\n function readBytes10(\n CalldataPointer cdPtr\n ) internal pure returns (bytes10 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes11 at `cdPtr` in calldata.\n function readBytes11(\n CalldataPointer cdPtr\n ) internal pure returns (bytes11 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes12 at `cdPtr` in calldata.\n function readBytes12(\n CalldataPointer cdPtr\n ) internal pure returns (bytes12 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes13 at `cdPtr` in calldata.\n function readBytes13(\n CalldataPointer cdPtr\n ) internal pure returns (bytes13 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes14 at `cdPtr` in calldata.\n function readBytes14(\n CalldataPointer cdPtr\n ) internal pure returns (bytes14 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes15 at `cdPtr` in calldata.\n function readBytes15(\n CalldataPointer cdPtr\n ) internal pure returns (bytes15 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes16 at `cdPtr` in calldata.\n function readBytes16(\n CalldataPointer cdPtr\n ) internal pure returns (bytes16 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes17 at `cdPtr` in calldata.\n function readBytes17(\n CalldataPointer cdPtr\n ) internal pure returns (bytes17 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes18 at `cdPtr` in calldata.\n function readBytes18(\n CalldataPointer cdPtr\n ) internal pure returns (bytes18 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes19 at `cdPtr` in calldata.\n function readBytes19(\n CalldataPointer cdPtr\n ) internal pure returns (bytes19 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes20 at `cdPtr` in calldata.\n function readBytes20(\n CalldataPointer cdPtr\n ) internal pure returns (bytes20 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes21 at `cdPtr` in calldata.\n function readBytes21(\n CalldataPointer cdPtr\n ) internal pure returns (bytes21 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes22 at `cdPtr` in calldata.\n function readBytes22(\n CalldataPointer cdPtr\n ) internal pure returns (bytes22 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes23 at `cdPtr` in calldata.\n function readBytes23(\n CalldataPointer cdPtr\n ) internal pure returns (bytes23 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes24 at `cdPtr` in calldata.\n function readBytes24(\n CalldataPointer cdPtr\n ) internal pure returns (bytes24 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes25 at `cdPtr` in calldata.\n function readBytes25(\n CalldataPointer cdPtr\n ) internal pure returns (bytes25 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes26 at `cdPtr` in calldata.\n function readBytes26(\n CalldataPointer cdPtr\n ) internal pure returns (bytes26 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes27 at `cdPtr` in calldata.\n function readBytes27(\n CalldataPointer cdPtr\n ) internal pure returns (bytes27 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes28 at `cdPtr` in calldata.\n function readBytes28(\n CalldataPointer cdPtr\n ) internal pure returns (bytes28 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes29 at `cdPtr` in calldata.\n function readBytes29(\n CalldataPointer cdPtr\n ) internal pure returns (bytes29 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes30 at `cdPtr` in calldata.\n function readBytes30(\n CalldataPointer cdPtr\n ) internal pure returns (bytes30 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes31 at `cdPtr` in calldata.\n function readBytes31(\n CalldataPointer cdPtr\n ) internal pure returns (bytes31 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the bytes32 at `cdPtr` in calldata.\n function readBytes32(\n CalldataPointer cdPtr\n ) internal pure returns (bytes32 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint8 at `cdPtr` in calldata.\n function readUint8(\n CalldataPointer cdPtr\n ) internal pure returns (uint8 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint16 at `cdPtr` in calldata.\n function readUint16(\n CalldataPointer cdPtr\n ) internal pure returns (uint16 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint24 at `cdPtr` in calldata.\n function readUint24(\n CalldataPointer cdPtr\n ) internal pure returns (uint24 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint32 at `cdPtr` in calldata.\n function readUint32(\n CalldataPointer cdPtr\n ) internal pure returns (uint32 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint40 at `cdPtr` in calldata.\n function readUint40(\n CalldataPointer cdPtr\n ) internal pure returns (uint40 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint48 at `cdPtr` in calldata.\n function readUint48(\n CalldataPointer cdPtr\n ) internal pure returns (uint48 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint56 at `cdPtr` in calldata.\n function readUint56(\n CalldataPointer cdPtr\n ) internal pure returns (uint56 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint64 at `cdPtr` in calldata.\n function readUint64(\n CalldataPointer cdPtr\n ) internal pure returns (uint64 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint72 at `cdPtr` in calldata.\n function readUint72(\n CalldataPointer cdPtr\n ) internal pure returns (uint72 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint80 at `cdPtr` in calldata.\n function readUint80(\n CalldataPointer cdPtr\n ) internal pure returns (uint80 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint88 at `cdPtr` in calldata.\n function readUint88(\n CalldataPointer cdPtr\n ) internal pure returns (uint88 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint96 at `cdPtr` in calldata.\n function readUint96(\n CalldataPointer cdPtr\n ) internal pure returns (uint96 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint104 at `cdPtr` in calldata.\n function readUint104(\n CalldataPointer cdPtr\n ) internal pure returns (uint104 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint112 at `cdPtr` in calldata.\n function readUint112(\n CalldataPointer cdPtr\n ) internal pure returns (uint112 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint120 at `cdPtr` in calldata.\n function readUint120(\n CalldataPointer cdPtr\n ) internal pure returns (uint120 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint128 at `cdPtr` in calldata.\n function readUint128(\n CalldataPointer cdPtr\n ) internal pure returns (uint128 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint136 at `cdPtr` in calldata.\n function readUint136(\n CalldataPointer cdPtr\n ) internal pure returns (uint136 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint144 at `cdPtr` in calldata.\n function readUint144(\n CalldataPointer cdPtr\n ) internal pure returns (uint144 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint152 at `cdPtr` in calldata.\n function readUint152(\n CalldataPointer cdPtr\n ) internal pure returns (uint152 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint160 at `cdPtr` in calldata.\n function readUint160(\n CalldataPointer cdPtr\n ) internal pure returns (uint160 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint168 at `cdPtr` in calldata.\n function readUint168(\n CalldataPointer cdPtr\n ) internal pure returns (uint168 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint176 at `cdPtr` in calldata.\n function readUint176(\n CalldataPointer cdPtr\n ) internal pure returns (uint176 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint184 at `cdPtr` in calldata.\n function readUint184(\n CalldataPointer cdPtr\n ) internal pure returns (uint184 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint192 at `cdPtr` in calldata.\n function readUint192(\n CalldataPointer cdPtr\n ) internal pure returns (uint192 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint200 at `cdPtr` in calldata.\n function readUint200(\n CalldataPointer cdPtr\n ) internal pure returns (uint200 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint208 at `cdPtr` in calldata.\n function readUint208(\n CalldataPointer cdPtr\n ) internal pure returns (uint208 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint216 at `cdPtr` in calldata.\n function readUint216(\n CalldataPointer cdPtr\n ) internal pure returns (uint216 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint224 at `cdPtr` in calldata.\n function readUint224(\n CalldataPointer cdPtr\n ) internal pure returns (uint224 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint232 at `cdPtr` in calldata.\n function readUint232(\n CalldataPointer cdPtr\n ) internal pure returns (uint232 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint240 at `cdPtr` in calldata.\n function readUint240(\n CalldataPointer cdPtr\n ) internal pure returns (uint240 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint248 at `cdPtr` in calldata.\n function readUint248(\n CalldataPointer cdPtr\n ) internal pure returns (uint248 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the uint256 at `cdPtr` in calldata.\n function readUint256(\n CalldataPointer cdPtr\n ) internal pure returns (uint256 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int8 at `cdPtr` in calldata.\n function readInt8(\n CalldataPointer cdPtr\n ) internal pure returns (int8 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int16 at `cdPtr` in calldata.\n function readInt16(\n CalldataPointer cdPtr\n ) internal pure returns (int16 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int24 at `cdPtr` in calldata.\n function readInt24(\n CalldataPointer cdPtr\n ) internal pure returns (int24 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int32 at `cdPtr` in calldata.\n function readInt32(\n CalldataPointer cdPtr\n ) internal pure returns (int32 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int40 at `cdPtr` in calldata.\n function readInt40(\n CalldataPointer cdPtr\n ) internal pure returns (int40 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int48 at `cdPtr` in calldata.\n function readInt48(\n CalldataPointer cdPtr\n ) internal pure returns (int48 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int56 at `cdPtr` in calldata.\n function readInt56(\n CalldataPointer cdPtr\n ) internal pure returns (int56 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int64 at `cdPtr` in calldata.\n function readInt64(\n CalldataPointer cdPtr\n ) internal pure returns (int64 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int72 at `cdPtr` in calldata.\n function readInt72(\n CalldataPointer cdPtr\n ) internal pure returns (int72 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int80 at `cdPtr` in calldata.\n function readInt80(\n CalldataPointer cdPtr\n ) internal pure returns (int80 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int88 at `cdPtr` in calldata.\n function readInt88(\n CalldataPointer cdPtr\n ) internal pure returns (int88 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int96 at `cdPtr` in calldata.\n function readInt96(\n CalldataPointer cdPtr\n ) internal pure returns (int96 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int104 at `cdPtr` in calldata.\n function readInt104(\n CalldataPointer cdPtr\n ) internal pure returns (int104 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int112 at `cdPtr` in calldata.\n function readInt112(\n CalldataPointer cdPtr\n ) internal pure returns (int112 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int120 at `cdPtr` in calldata.\n function readInt120(\n CalldataPointer cdPtr\n ) internal pure returns (int120 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int128 at `cdPtr` in calldata.\n function readInt128(\n CalldataPointer cdPtr\n ) internal pure returns (int128 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int136 at `cdPtr` in calldata.\n function readInt136(\n CalldataPointer cdPtr\n ) internal pure returns (int136 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int144 at `cdPtr` in calldata.\n function readInt144(\n CalldataPointer cdPtr\n ) internal pure returns (int144 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int152 at `cdPtr` in calldata.\n function readInt152(\n CalldataPointer cdPtr\n ) internal pure returns (int152 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int160 at `cdPtr` in calldata.\n function readInt160(\n CalldataPointer cdPtr\n ) internal pure returns (int160 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int168 at `cdPtr` in calldata.\n function readInt168(\n CalldataPointer cdPtr\n ) internal pure returns (int168 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int176 at `cdPtr` in calldata.\n function readInt176(\n CalldataPointer cdPtr\n ) internal pure returns (int176 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int184 at `cdPtr` in calldata.\n function readInt184(\n CalldataPointer cdPtr\n ) internal pure returns (int184 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int192 at `cdPtr` in calldata.\n function readInt192(\n CalldataPointer cdPtr\n ) internal pure returns (int192 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int200 at `cdPtr` in calldata.\n function readInt200(\n CalldataPointer cdPtr\n ) internal pure returns (int200 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int208 at `cdPtr` in calldata.\n function readInt208(\n CalldataPointer cdPtr\n ) internal pure returns (int208 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int216 at `cdPtr` in calldata.\n function readInt216(\n CalldataPointer cdPtr\n ) internal pure returns (int216 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int224 at `cdPtr` in calldata.\n function readInt224(\n CalldataPointer cdPtr\n ) internal pure returns (int224 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int232 at `cdPtr` in calldata.\n function readInt232(\n CalldataPointer cdPtr\n ) internal pure returns (int232 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int240 at `cdPtr` in calldata.\n function readInt240(\n CalldataPointer cdPtr\n ) internal pure returns (int240 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int248 at `cdPtr` in calldata.\n function readInt248(\n CalldataPointer cdPtr\n ) internal pure returns (int248 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n\n /// @dev Reads the int256 at `cdPtr` in calldata.\n function readInt256(\n CalldataPointer cdPtr\n ) internal pure returns (int256 value) {\n assembly {\n value := calldataload(cdPtr)\n }\n }\n}\n\nlibrary ReturndataReaders {\n /// @dev Reads value at `rdPtr` & applies a mask to return only last 4 bytes\n function readMaskedUint256(\n ReturndataPointer rdPtr\n ) internal pure returns (uint256 value) {\n value = rdPtr.readUint256() & OffsetOrLengthMask;\n }\n\n /// @dev Reads the bool at `rdPtr` in returndata.\n function readBool(\n ReturndataPointer rdPtr\n ) internal pure returns (bool value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the address at `rdPtr` in returndata.\n function readAddress(\n ReturndataPointer rdPtr\n ) internal pure returns (address value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes1 at `rdPtr` in returndata.\n function readBytes1(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes1 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes2 at `rdPtr` in returndata.\n function readBytes2(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes2 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes3 at `rdPtr` in returndata.\n function readBytes3(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes3 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes4 at `rdPtr` in returndata.\n function readBytes4(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes4 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes5 at `rdPtr` in returndata.\n function readBytes5(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes5 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes6 at `rdPtr` in returndata.\n function readBytes6(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes6 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes7 at `rdPtr` in returndata.\n function readBytes7(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes7 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes8 at `rdPtr` in returndata.\n function readBytes8(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes8 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes9 at `rdPtr` in returndata.\n function readBytes9(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes9 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes10 at `rdPtr` in returndata.\n function readBytes10(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes10 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes11 at `rdPtr` in returndata.\n function readBytes11(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes11 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes12 at `rdPtr` in returndata.\n function readBytes12(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes12 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes13 at `rdPtr` in returndata.\n function readBytes13(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes13 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes14 at `rdPtr` in returndata.\n function readBytes14(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes14 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes15 at `rdPtr` in returndata.\n function readBytes15(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes15 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes16 at `rdPtr` in returndata.\n function readBytes16(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes16 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes17 at `rdPtr` in returndata.\n function readBytes17(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes17 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes18 at `rdPtr` in returndata.\n function readBytes18(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes18 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes19 at `rdPtr` in returndata.\n function readBytes19(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes19 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes20 at `rdPtr` in returndata.\n function readBytes20(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes20 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes21 at `rdPtr` in returndata.\n function readBytes21(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes21 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes22 at `rdPtr` in returndata.\n function readBytes22(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes22 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes23 at `rdPtr` in returndata.\n function readBytes23(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes23 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes24 at `rdPtr` in returndata.\n function readBytes24(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes24 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes25 at `rdPtr` in returndata.\n function readBytes25(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes25 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes26 at `rdPtr` in returndata.\n function readBytes26(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes26 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes27 at `rdPtr` in returndata.\n function readBytes27(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes27 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes28 at `rdPtr` in returndata.\n function readBytes28(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes28 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes29 at `rdPtr` in returndata.\n function readBytes29(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes29 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes30 at `rdPtr` in returndata.\n function readBytes30(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes30 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes31 at `rdPtr` in returndata.\n function readBytes31(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes31 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the bytes32 at `rdPtr` in returndata.\n function readBytes32(\n ReturndataPointer rdPtr\n ) internal pure returns (bytes32 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint8 at `rdPtr` in returndata.\n function readUint8(\n ReturndataPointer rdPtr\n ) internal pure returns (uint8 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint16 at `rdPtr` in returndata.\n function readUint16(\n ReturndataPointer rdPtr\n ) internal pure returns (uint16 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint24 at `rdPtr` in returndata.\n function readUint24(\n ReturndataPointer rdPtr\n ) internal pure returns (uint24 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint32 at `rdPtr` in returndata.\n function readUint32(\n ReturndataPointer rdPtr\n ) internal pure returns (uint32 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint40 at `rdPtr` in returndata.\n function readUint40(\n ReturndataPointer rdPtr\n ) internal pure returns (uint40 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint48 at `rdPtr` in returndata.\n function readUint48(\n ReturndataPointer rdPtr\n ) internal pure returns (uint48 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint56 at `rdPtr` in returndata.\n function readUint56(\n ReturndataPointer rdPtr\n ) internal pure returns (uint56 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint64 at `rdPtr` in returndata.\n function readUint64(\n ReturndataPointer rdPtr\n ) internal pure returns (uint64 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint72 at `rdPtr` in returndata.\n function readUint72(\n ReturndataPointer rdPtr\n ) internal pure returns (uint72 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint80 at `rdPtr` in returndata.\n function readUint80(\n ReturndataPointer rdPtr\n ) internal pure returns (uint80 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint88 at `rdPtr` in returndata.\n function readUint88(\n ReturndataPointer rdPtr\n ) internal pure returns (uint88 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint96 at `rdPtr` in returndata.\n function readUint96(\n ReturndataPointer rdPtr\n ) internal pure returns (uint96 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint104 at `rdPtr` in returndata.\n function readUint104(\n ReturndataPointer rdPtr\n ) internal pure returns (uint104 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint112 at `rdPtr` in returndata.\n function readUint112(\n ReturndataPointer rdPtr\n ) internal pure returns (uint112 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint120 at `rdPtr` in returndata.\n function readUint120(\n ReturndataPointer rdPtr\n ) internal pure returns (uint120 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint128 at `rdPtr` in returndata.\n function readUint128(\n ReturndataPointer rdPtr\n ) internal pure returns (uint128 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint136 at `rdPtr` in returndata.\n function readUint136(\n ReturndataPointer rdPtr\n ) internal pure returns (uint136 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint144 at `rdPtr` in returndata.\n function readUint144(\n ReturndataPointer rdPtr\n ) internal pure returns (uint144 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint152 at `rdPtr` in returndata.\n function readUint152(\n ReturndataPointer rdPtr\n ) internal pure returns (uint152 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint160 at `rdPtr` in returndata.\n function readUint160(\n ReturndataPointer rdPtr\n ) internal pure returns (uint160 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint168 at `rdPtr` in returndata.\n function readUint168(\n ReturndataPointer rdPtr\n ) internal pure returns (uint168 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint176 at `rdPtr` in returndata.\n function readUint176(\n ReturndataPointer rdPtr\n ) internal pure returns (uint176 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint184 at `rdPtr` in returndata.\n function readUint184(\n ReturndataPointer rdPtr\n ) internal pure returns (uint184 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint192 at `rdPtr` in returndata.\n function readUint192(\n ReturndataPointer rdPtr\n ) internal pure returns (uint192 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint200 at `rdPtr` in returndata.\n function readUint200(\n ReturndataPointer rdPtr\n ) internal pure returns (uint200 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint208 at `rdPtr` in returndata.\n function readUint208(\n ReturndataPointer rdPtr\n ) internal pure returns (uint208 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint216 at `rdPtr` in returndata.\n function readUint216(\n ReturndataPointer rdPtr\n ) internal pure returns (uint216 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint224 at `rdPtr` in returndata.\n function readUint224(\n ReturndataPointer rdPtr\n ) internal pure returns (uint224 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint232 at `rdPtr` in returndata.\n function readUint232(\n ReturndataPointer rdPtr\n ) internal pure returns (uint232 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint240 at `rdPtr` in returndata.\n function readUint240(\n ReturndataPointer rdPtr\n ) internal pure returns (uint240 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint248 at `rdPtr` in returndata.\n function readUint248(\n ReturndataPointer rdPtr\n ) internal pure returns (uint248 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the uint256 at `rdPtr` in returndata.\n function readUint256(\n ReturndataPointer rdPtr\n ) internal pure returns (uint256 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int8 at `rdPtr` in returndata.\n function readInt8(\n ReturndataPointer rdPtr\n ) internal pure returns (int8 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int16 at `rdPtr` in returndata.\n function readInt16(\n ReturndataPointer rdPtr\n ) internal pure returns (int16 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int24 at `rdPtr` in returndata.\n function readInt24(\n ReturndataPointer rdPtr\n ) internal pure returns (int24 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int32 at `rdPtr` in returndata.\n function readInt32(\n ReturndataPointer rdPtr\n ) internal pure returns (int32 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int40 at `rdPtr` in returndata.\n function readInt40(\n ReturndataPointer rdPtr\n ) internal pure returns (int40 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int48 at `rdPtr` in returndata.\n function readInt48(\n ReturndataPointer rdPtr\n ) internal pure returns (int48 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int56 at `rdPtr` in returndata.\n function readInt56(\n ReturndataPointer rdPtr\n ) internal pure returns (int56 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int64 at `rdPtr` in returndata.\n function readInt64(\n ReturndataPointer rdPtr\n ) internal pure returns (int64 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int72 at `rdPtr` in returndata.\n function readInt72(\n ReturndataPointer rdPtr\n ) internal pure returns (int72 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int80 at `rdPtr` in returndata.\n function readInt80(\n ReturndataPointer rdPtr\n ) internal pure returns (int80 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int88 at `rdPtr` in returndata.\n function readInt88(\n ReturndataPointer rdPtr\n ) internal pure returns (int88 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int96 at `rdPtr` in returndata.\n function readInt96(\n ReturndataPointer rdPtr\n ) internal pure returns (int96 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int104 at `rdPtr` in returndata.\n function readInt104(\n ReturndataPointer rdPtr\n ) internal pure returns (int104 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int112 at `rdPtr` in returndata.\n function readInt112(\n ReturndataPointer rdPtr\n ) internal pure returns (int112 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int120 at `rdPtr` in returndata.\n function readInt120(\n ReturndataPointer rdPtr\n ) internal pure returns (int120 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int128 at `rdPtr` in returndata.\n function readInt128(\n ReturndataPointer rdPtr\n ) internal pure returns (int128 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int136 at `rdPtr` in returndata.\n function readInt136(\n ReturndataPointer rdPtr\n ) internal pure returns (int136 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int144 at `rdPtr` in returndata.\n function readInt144(\n ReturndataPointer rdPtr\n ) internal pure returns (int144 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int152 at `rdPtr` in returndata.\n function readInt152(\n ReturndataPointer rdPtr\n ) internal pure returns (int152 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int160 at `rdPtr` in returndata.\n function readInt160(\n ReturndataPointer rdPtr\n ) internal pure returns (int160 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int168 at `rdPtr` in returndata.\n function readInt168(\n ReturndataPointer rdPtr\n ) internal pure returns (int168 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int176 at `rdPtr` in returndata.\n function readInt176(\n ReturndataPointer rdPtr\n ) internal pure returns (int176 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int184 at `rdPtr` in returndata.\n function readInt184(\n ReturndataPointer rdPtr\n ) internal pure returns (int184 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int192 at `rdPtr` in returndata.\n function readInt192(\n ReturndataPointer rdPtr\n ) internal pure returns (int192 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int200 at `rdPtr` in returndata.\n function readInt200(\n ReturndataPointer rdPtr\n ) internal pure returns (int200 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int208 at `rdPtr` in returndata.\n function readInt208(\n ReturndataPointer rdPtr\n ) internal pure returns (int208 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int216 at `rdPtr` in returndata.\n function readInt216(\n ReturndataPointer rdPtr\n ) internal pure returns (int216 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int224 at `rdPtr` in returndata.\n function readInt224(\n ReturndataPointer rdPtr\n ) internal pure returns (int224 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int232 at `rdPtr` in returndata.\n function readInt232(\n ReturndataPointer rdPtr\n ) internal pure returns (int232 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int240 at `rdPtr` in returndata.\n function readInt240(\n ReturndataPointer rdPtr\n ) internal pure returns (int240 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int248 at `rdPtr` in returndata.\n function readInt248(\n ReturndataPointer rdPtr\n ) internal pure returns (int248 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n\n /// @dev Reads the int256 at `rdPtr` in returndata.\n function readInt256(\n ReturndataPointer rdPtr\n ) internal pure returns (int256 value) {\n assembly {\n returndatacopy(0, rdPtr, _OneWord)\n value := mload(0)\n }\n }\n}\n\nlibrary MemoryReaders {\n /// @dev Reads the memory pointer at `mPtr` in memory.\n function readMemoryPointer(\n MemoryPointer mPtr\n ) internal pure returns (MemoryPointer value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads value at `mPtr` & applies a mask to return only last 4 bytes\n function readMaskedUint256(\n MemoryPointer mPtr\n ) internal pure returns (uint256 value) {\n value = mPtr.readUint256() & OffsetOrLengthMask;\n }\n\n /// @dev Reads the bool at `mPtr` in memory.\n function readBool(MemoryPointer mPtr) internal pure returns (bool value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the address at `mPtr` in memory.\n function readAddress(\n MemoryPointer mPtr\n ) internal pure returns (address value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes1 at `mPtr` in memory.\n function readBytes1(\n MemoryPointer mPtr\n ) internal pure returns (bytes1 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes2 at `mPtr` in memory.\n function readBytes2(\n MemoryPointer mPtr\n ) internal pure returns (bytes2 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes3 at `mPtr` in memory.\n function readBytes3(\n MemoryPointer mPtr\n ) internal pure returns (bytes3 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes4 at `mPtr` in memory.\n function readBytes4(\n MemoryPointer mPtr\n ) internal pure returns (bytes4 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes5 at `mPtr` in memory.\n function readBytes5(\n MemoryPointer mPtr\n ) internal pure returns (bytes5 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes6 at `mPtr` in memory.\n function readBytes6(\n MemoryPointer mPtr\n ) internal pure returns (bytes6 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes7 at `mPtr` in memory.\n function readBytes7(\n MemoryPointer mPtr\n ) internal pure returns (bytes7 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes8 at `mPtr` in memory.\n function readBytes8(\n MemoryPointer mPtr\n ) internal pure returns (bytes8 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes9 at `mPtr` in memory.\n function readBytes9(\n MemoryPointer mPtr\n ) internal pure returns (bytes9 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes10 at `mPtr` in memory.\n function readBytes10(\n MemoryPointer mPtr\n ) internal pure returns (bytes10 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes11 at `mPtr` in memory.\n function readBytes11(\n MemoryPointer mPtr\n ) internal pure returns (bytes11 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes12 at `mPtr` in memory.\n function readBytes12(\n MemoryPointer mPtr\n ) internal pure returns (bytes12 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes13 at `mPtr` in memory.\n function readBytes13(\n MemoryPointer mPtr\n ) internal pure returns (bytes13 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes14 at `mPtr` in memory.\n function readBytes14(\n MemoryPointer mPtr\n ) internal pure returns (bytes14 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes15 at `mPtr` in memory.\n function readBytes15(\n MemoryPointer mPtr\n ) internal pure returns (bytes15 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes16 at `mPtr` in memory.\n function readBytes16(\n MemoryPointer mPtr\n ) internal pure returns (bytes16 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes17 at `mPtr` in memory.\n function readBytes17(\n MemoryPointer mPtr\n ) internal pure returns (bytes17 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes18 at `mPtr` in memory.\n function readBytes18(\n MemoryPointer mPtr\n ) internal pure returns (bytes18 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes19 at `mPtr` in memory.\n function readBytes19(\n MemoryPointer mPtr\n ) internal pure returns (bytes19 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes20 at `mPtr` in memory.\n function readBytes20(\n MemoryPointer mPtr\n ) internal pure returns (bytes20 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes21 at `mPtr` in memory.\n function readBytes21(\n MemoryPointer mPtr\n ) internal pure returns (bytes21 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes22 at `mPtr` in memory.\n function readBytes22(\n MemoryPointer mPtr\n ) internal pure returns (bytes22 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes23 at `mPtr` in memory.\n function readBytes23(\n MemoryPointer mPtr\n ) internal pure returns (bytes23 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes24 at `mPtr` in memory.\n function readBytes24(\n MemoryPointer mPtr\n ) internal pure returns (bytes24 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes25 at `mPtr` in memory.\n function readBytes25(\n MemoryPointer mPtr\n ) internal pure returns (bytes25 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes26 at `mPtr` in memory.\n function readBytes26(\n MemoryPointer mPtr\n ) internal pure returns (bytes26 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes27 at `mPtr` in memory.\n function readBytes27(\n MemoryPointer mPtr\n ) internal pure returns (bytes27 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes28 at `mPtr` in memory.\n function readBytes28(\n MemoryPointer mPtr\n ) internal pure returns (bytes28 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes29 at `mPtr` in memory.\n function readBytes29(\n MemoryPointer mPtr\n ) internal pure returns (bytes29 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes30 at `mPtr` in memory.\n function readBytes30(\n MemoryPointer mPtr\n ) internal pure returns (bytes30 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes31 at `mPtr` in memory.\n function readBytes31(\n MemoryPointer mPtr\n ) internal pure returns (bytes31 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the bytes32 at `mPtr` in memory.\n function readBytes32(\n MemoryPointer mPtr\n ) internal pure returns (bytes32 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint8 at `mPtr` in memory.\n function readUint8(MemoryPointer mPtr) internal pure returns (uint8 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint16 at `mPtr` in memory.\n function readUint16(\n MemoryPointer mPtr\n ) internal pure returns (uint16 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint24 at `mPtr` in memory.\n function readUint24(\n MemoryPointer mPtr\n ) internal pure returns (uint24 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint32 at `mPtr` in memory.\n function readUint32(\n MemoryPointer mPtr\n ) internal pure returns (uint32 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint40 at `mPtr` in memory.\n function readUint40(\n MemoryPointer mPtr\n ) internal pure returns (uint40 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint48 at `mPtr` in memory.\n function readUint48(\n MemoryPointer mPtr\n ) internal pure returns (uint48 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint56 at `mPtr` in memory.\n function readUint56(\n MemoryPointer mPtr\n ) internal pure returns (uint56 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint64 at `mPtr` in memory.\n function readUint64(\n MemoryPointer mPtr\n ) internal pure returns (uint64 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint72 at `mPtr` in memory.\n function readUint72(\n MemoryPointer mPtr\n ) internal pure returns (uint72 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint80 at `mPtr` in memory.\n function readUint80(\n MemoryPointer mPtr\n ) internal pure returns (uint80 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint88 at `mPtr` in memory.\n function readUint88(\n MemoryPointer mPtr\n ) internal pure returns (uint88 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint96 at `mPtr` in memory.\n function readUint96(\n MemoryPointer mPtr\n ) internal pure returns (uint96 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint104 at `mPtr` in memory.\n function readUint104(\n MemoryPointer mPtr\n ) internal pure returns (uint104 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint112 at `mPtr` in memory.\n function readUint112(\n MemoryPointer mPtr\n ) internal pure returns (uint112 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint120 at `mPtr` in memory.\n function readUint120(\n MemoryPointer mPtr\n ) internal pure returns (uint120 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint128 at `mPtr` in memory.\n function readUint128(\n MemoryPointer mPtr\n ) internal pure returns (uint128 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint136 at `mPtr` in memory.\n function readUint136(\n MemoryPointer mPtr\n ) internal pure returns (uint136 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint144 at `mPtr` in memory.\n function readUint144(\n MemoryPointer mPtr\n ) internal pure returns (uint144 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint152 at `mPtr` in memory.\n function readUint152(\n MemoryPointer mPtr\n ) internal pure returns (uint152 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint160 at `mPtr` in memory.\n function readUint160(\n MemoryPointer mPtr\n ) internal pure returns (uint160 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint168 at `mPtr` in memory.\n function readUint168(\n MemoryPointer mPtr\n ) internal pure returns (uint168 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint176 at `mPtr` in memory.\n function readUint176(\n MemoryPointer mPtr\n ) internal pure returns (uint176 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint184 at `mPtr` in memory.\n function readUint184(\n MemoryPointer mPtr\n ) internal pure returns (uint184 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint192 at `mPtr` in memory.\n function readUint192(\n MemoryPointer mPtr\n ) internal pure returns (uint192 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint200 at `mPtr` in memory.\n function readUint200(\n MemoryPointer mPtr\n ) internal pure returns (uint200 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint208 at `mPtr` in memory.\n function readUint208(\n MemoryPointer mPtr\n ) internal pure returns (uint208 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint216 at `mPtr` in memory.\n function readUint216(\n MemoryPointer mPtr\n ) internal pure returns (uint216 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint224 at `mPtr` in memory.\n function readUint224(\n MemoryPointer mPtr\n ) internal pure returns (uint224 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint232 at `mPtr` in memory.\n function readUint232(\n MemoryPointer mPtr\n ) internal pure returns (uint232 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint240 at `mPtr` in memory.\n function readUint240(\n MemoryPointer mPtr\n ) internal pure returns (uint240 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint248 at `mPtr` in memory.\n function readUint248(\n MemoryPointer mPtr\n ) internal pure returns (uint248 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the uint256 at `mPtr` in memory.\n function readUint256(\n MemoryPointer mPtr\n ) internal pure returns (uint256 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int8 at `mPtr` in memory.\n function readInt8(MemoryPointer mPtr) internal pure returns (int8 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int16 at `mPtr` in memory.\n function readInt16(MemoryPointer mPtr) internal pure returns (int16 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int24 at `mPtr` in memory.\n function readInt24(MemoryPointer mPtr) internal pure returns (int24 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int32 at `mPtr` in memory.\n function readInt32(MemoryPointer mPtr) internal pure returns (int32 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int40 at `mPtr` in memory.\n function readInt40(MemoryPointer mPtr) internal pure returns (int40 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int48 at `mPtr` in memory.\n function readInt48(MemoryPointer mPtr) internal pure returns (int48 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int56 at `mPtr` in memory.\n function readInt56(MemoryPointer mPtr) internal pure returns (int56 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int64 at `mPtr` in memory.\n function readInt64(MemoryPointer mPtr) internal pure returns (int64 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int72 at `mPtr` in memory.\n function readInt72(MemoryPointer mPtr) internal pure returns (int72 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int80 at `mPtr` in memory.\n function readInt80(MemoryPointer mPtr) internal pure returns (int80 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int88 at `mPtr` in memory.\n function readInt88(MemoryPointer mPtr) internal pure returns (int88 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int96 at `mPtr` in memory.\n function readInt96(MemoryPointer mPtr) internal pure returns (int96 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int104 at `mPtr` in memory.\n function readInt104(\n MemoryPointer mPtr\n ) internal pure returns (int104 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int112 at `mPtr` in memory.\n function readInt112(\n MemoryPointer mPtr\n ) internal pure returns (int112 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int120 at `mPtr` in memory.\n function readInt120(\n MemoryPointer mPtr\n ) internal pure returns (int120 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int128 at `mPtr` in memory.\n function readInt128(\n MemoryPointer mPtr\n ) internal pure returns (int128 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int136 at `mPtr` in memory.\n function readInt136(\n MemoryPointer mPtr\n ) internal pure returns (int136 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int144 at `mPtr` in memory.\n function readInt144(\n MemoryPointer mPtr\n ) internal pure returns (int144 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int152 at `mPtr` in memory.\n function readInt152(\n MemoryPointer mPtr\n ) internal pure returns (int152 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int160 at `mPtr` in memory.\n function readInt160(\n MemoryPointer mPtr\n ) internal pure returns (int160 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int168 at `mPtr` in memory.\n function readInt168(\n MemoryPointer mPtr\n ) internal pure returns (int168 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int176 at `mPtr` in memory.\n function readInt176(\n MemoryPointer mPtr\n ) internal pure returns (int176 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int184 at `mPtr` in memory.\n function readInt184(\n MemoryPointer mPtr\n ) internal pure returns (int184 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int192 at `mPtr` in memory.\n function readInt192(\n MemoryPointer mPtr\n ) internal pure returns (int192 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int200 at `mPtr` in memory.\n function readInt200(\n MemoryPointer mPtr\n ) internal pure returns (int200 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int208 at `mPtr` in memory.\n function readInt208(\n MemoryPointer mPtr\n ) internal pure returns (int208 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int216 at `mPtr` in memory.\n function readInt216(\n MemoryPointer mPtr\n ) internal pure returns (int216 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int224 at `mPtr` in memory.\n function readInt224(\n MemoryPointer mPtr\n ) internal pure returns (int224 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int232 at `mPtr` in memory.\n function readInt232(\n MemoryPointer mPtr\n ) internal pure returns (int232 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int240 at `mPtr` in memory.\n function readInt240(\n MemoryPointer mPtr\n ) internal pure returns (int240 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int248 at `mPtr` in memory.\n function readInt248(\n MemoryPointer mPtr\n ) internal pure returns (int248 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n\n /// @dev Reads the int256 at `mPtr` in memory.\n function readInt256(\n MemoryPointer mPtr\n ) internal pure returns (int256 value) {\n assembly {\n value := mload(mPtr)\n }\n }\n}\n\nlibrary MemoryWriters {\n /// @dev Writes `valuePtr` to memory at `mPtr`.\n function write(MemoryPointer mPtr, MemoryPointer valuePtr) internal pure {\n assembly {\n mstore(mPtr, valuePtr)\n }\n }\n\n /// @dev Writes a boolean `value` to `mPtr` in memory.\n function write(MemoryPointer mPtr, bool value) internal pure {\n assembly {\n mstore(mPtr, value)\n }\n }\n\n /// @dev Writes an address `value` to `mPtr` in memory.\n function write(MemoryPointer mPtr, address value) internal pure {\n assembly {\n mstore(mPtr, value)\n }\n }\n\n /// @dev Writes a bytes32 `value` to `mPtr` in memory.\n /// Separate name to disambiguate literal write parameters.\n function writeBytes32(MemoryPointer mPtr, bytes32 value) internal pure {\n assembly {\n mstore(mPtr, value)\n }\n }\n\n /// @dev Writes a uint256 `value` to `mPtr` in memory.\n function write(MemoryPointer mPtr, uint256 value) internal pure {\n assembly {\n mstore(mPtr, value)\n }\n }\n\n /// @dev Writes an int256 `value` to `mPtr` in memory.\n /// Separate name to disambiguate literal write parameters.\n function writeInt(MemoryPointer mPtr, int256 value) internal pure {\n assembly {\n mstore(mPtr, value)\n }\n }\n}\n"
},
"lib/seaport/lib/seaport-types/src/interfaces/IERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.7;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.19;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(target.code.length > 0, \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
},
"src/lib/ERC721SeaDropStructs.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport { AllowListData, CreatorPayout } from \"./SeaDropStructs.sol\";\n\n/**\n * @notice A struct defining public drop data.\n * Designed to fit efficiently in two storage slots.\n *\n * @param startPrice The start price per token. (Up to 1.2m\n * of native token, e.g. ETH, MATIC)\n * @param endPrice The end price per token. If this differs\n * from startPrice, the current price will\n * be calculated based on the current time.\n * @param startTime The start time, ensure this is not zero.\n * @param endTime The end time, ensure this is not zero.\n * @param paymentToken The payment token address. Null for\n * native token.\n * @param maxTotalMintableByWallet Maximum total number of mints a user is\n * allowed. (The limit for this field is\n * 2^16 - 1)\n * @param feeBps Fee out of 10_000 basis points to be\n * collected.\n * @param restrictFeeRecipients If false, allow any fee recipient;\n * if true, check fee recipient is allowed.\n */\nstruct PublicDrop {\n uint80 startPrice; // 80/512 bits\n uint80 endPrice; // 160/512 bits\n uint40 startTime; // 200/512 bits\n uint40 endTime; // 240/512 bits\n address paymentToken; // 400/512 bits\n uint16 maxTotalMintableByWallet; // 416/512 bits\n uint16 feeBps; // 432/512 bits\n bool restrictFeeRecipients; // 440/512 bits\n}\n\n/**\n * @notice A struct defining mint params for an allow list.\n * An allow list leaf will be composed of `msg.sender` and\n * the following params.\n *\n * Note: Since feeBps is encoded in the leaf, backend should ensure\n * that feeBps is acceptable before generating a proof.\n *\n * @param startPrice The start price per token. (Up to 1.2m\n * of native token, e.g. ETH, MATIC)\n * @param endPrice The end price per token. If this differs\n * from startPrice, the current price will\n * be calculated based on the current time.\n * @param startTime The start time, ensure this is not zero.\n * @param endTime The end time, ensure this is not zero.\n * @param paymentToken The payment token for the mint. Null for\n * native token.\n * @param maxTotalMintableByWallet Maximum total number of mints a user is\n * allowed.\n * @param maxTokenSupplyForStage The limit of token supply this stage can\n * mint within.\n * @param dropStageIndex The drop stage index to emit with the event\n * for analytical purposes. This should be\n * non-zero since the public mint emits with\n * index zero.\n * @param feeBps Fee out of 10_000 basis points to be\n * collected.\n * @param restrictFeeRecipients If false, allow any fee recipient;\n * if true, check fee recipient is allowed.\n */\nstruct MintParams {\n uint256 startPrice;\n uint256 endPrice;\n uint256 startTime;\n uint256 endTime;\n address paymentToken;\n uint256 maxTotalMintableByWallet;\n uint256 maxTokenSupplyForStage;\n uint256 dropStageIndex; // non-zero\n uint256 feeBps;\n bool restrictFeeRecipients;\n}\n\n/**\n * @dev Struct containing internal SeaDrop implementation logic\n * mint details to avoid stack too deep.\n *\n * @param feeRecipient The fee recipient.\n * @param payer The payer of the mint.\n * @param minter The mint recipient.\n * @param quantity The number of tokens to mint.\n * @param withEffects Whether to apply state changes of the mint.\n */\nstruct MintDetails {\n address feeRecipient;\n address payer;\n address minter;\n uint256 quantity;\n bool withEffects;\n}\n\n/**\n * @notice A struct to configure multiple contract options in one transaction.\n */\nstruct MultiConfigureStruct {\n uint256 maxSupply;\n string baseURI;\n string contractURI;\n PublicDrop publicDrop;\n string dropURI;\n AllowListData allowListData;\n CreatorPayout[] creatorPayouts;\n bytes32 provenanceHash;\n address[] allowedFeeRecipients;\n address[] disallowedFeeRecipients;\n address[] allowedPayers;\n address[] disallowedPayers;\n // Server-signed\n address[] allowedSigners;\n address[] disallowedSigners;\n // ERC-2981\n address royaltyReceiver;\n uint96 royaltyBps;\n // Mint\n address mintRecipient;\n uint256 mintQuantity;\n}\n"
}
},
"settings": {
"remappings": [
"forge-std/=lib/forge-std/src/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"ERC721A/=lib/ERC721A/contracts/",
"ERC721A-Upgradeable/=lib/ERC721A-Upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@openzeppelin-upgradeable/contracts/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@rari-capital/solmate/=lib/seaport/lib/solmate/",
"murky/=lib/murky/src/",
"create2-scripts/=lib/create2-helpers/script/",
"seadrop/=src/",
"seaport-sol/=lib/seaport/lib/seaport-sol/",
"seaport-types/=lib/seaport/lib/seaport-types/",
"seaport-core/=lib/seaport/lib/seaport-core/",
"seaport-test-utils/=lib/seaport/test/foundry/utils/",
"solady/=lib/solady/"
],
"optimizer": {
"enabled": true,
"runs": 100000
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "none",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {}
}
}} |
1 | 20,290,373 | 4912dfee420d15019ba1fa591962ee64a3e68f5684e33bd944eb0b5a94953813 | d370760b35874aab93b0798e219ad69b014e1b54670ae591eece76b13a694bce | 0000db5c8b030ae20308ac975898e09741e70000 | ed0e416e0feea5b484ba5c95d375545ac2b60572 | 50eb5a678a86985cfb8f55b9bc07bbf3cc4ab7c1 | 608060405234801561001057600080fd5b50604051610a1a380380610a1a8339818101604052810190610032919061011c565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550326000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610149565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e9826100be565b9050919050565b6100f9816100de565b811461010457600080fd5b50565b600081519050610116816100f0565b92915050565b600060208284031215610132576101316100b9565b5b600061014084828501610107565b91505092915050565b6108c2806101586000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033000000000000000000000000000037bb05b2cef17c6469f4bcdb198826ce0000 | 608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033 | |
1 | 20,290,376 | 3c546f19f9753821ccec3bd2a405b5c47aefb53ae4f371fcdd7a0b96ba78e822 | cfd5e0cc0f8c3cfba9577501f5c732d46dfa56c61c3e3a796ed30b63c3620dd9 | 0000db5c8b030ae20308ac975898e09741e70000 | ed0e416e0feea5b484ba5c95d375545ac2b60572 | 77211077f03901e315065aefeea7e911facdd43f | 608060405234801561001057600080fd5b50604051610a1a380380610a1a8339818101604052810190610032919061011c565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550326000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610149565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e9826100be565b9050919050565b6100f9816100de565b811461010457600080fd5b50565b600081519050610116816100f0565b92915050565b600060208284031215610132576101316100b9565b5b600061014084828501610107565b91505092915050565b6108c2806101586000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033000000000000000000000000000037bb05b2cef17c6469f4bcdb198826ce0000 | 608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033 | |
1 | 20,290,377 | ce378f3c6e9fc64ab1787a306e40b8c941f5320a302a3c2d5ce1bc1b43b8491a | f80a96ca097de07739ec53863022e73644e8735cafe1c73c4f87e46117d1f401 | c5d4353386e57c3c506584e3cb53088113ce57e4 | c5d4353386e57c3c506584e3cb53088113ce57e4 | eadb59637d83837fe307ab61ad388c2e0e2d3e61 | 60806040523480156200001157600080fd5b506040516200230238038062002302833981810160405281019062000037919062000426565b6200004b848484846200005560201b60201c565b50505050620008a6565b836000908162000066919062000717565b50826001908162000078919062000717565b506012600260006101000a81548160ff021916908360ff160217905550816006819055506509184e72a000600654620000b291906200082d565b60038190555080600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060035460046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600354604051620001e5919062000889565b60405180910390a350505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200025c8262000211565b810181811067ffffffffffffffff821117156200027e576200027d62000222565b5b80604052505050565b600062000293620001f3565b9050620002a1828262000251565b919050565b600067ffffffffffffffff821115620002c457620002c362000222565b5b620002cf8262000211565b9050602081019050919050565b60005b83811015620002fc578082015181840152602081019050620002df565b60008484015250505050565b60006200031f6200031984620002a6565b62000287565b9050828152602081018484840111156200033e576200033d6200020c565b5b6200034b848285620002dc565b509392505050565b600082601f8301126200036b576200036a62000207565b5b81516200037d84826020860162000308565b91505092915050565b6000819050919050565b6200039b8162000386565b8114620003a757600080fd5b50565b600081519050620003bb8162000390565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620003ee82620003c1565b9050919050565b6200040081620003e1565b81146200040c57600080fd5b50565b6000815190506200042081620003f5565b92915050565b60008060008060808587031215620004435762000442620001fd565b5b600085015167ffffffffffffffff81111562000464576200046362000202565b5b620004728782880162000353565b945050602085015167ffffffffffffffff81111562000496576200049562000202565b5b620004a48782880162000353565b9350506040620004b787828801620003aa565b9250506060620004ca878288016200040f565b91505092959194509250565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200052957607f821691505b6020821081036200053f576200053e620004e1565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620005a97fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200056a565b620005b586836200056a565b95508019841693508086168417925050509392505050565b6000819050919050565b6000620005f8620005f2620005ec8462000386565b620005cd565b62000386565b9050919050565b6000819050919050565b6200061483620005d7565b6200062c6200062382620005ff565b84845462000577565b825550505050565b600090565b6200064362000634565b6200065081848462000609565b505050565b5b8181101562000678576200066c60008262000639565b60018101905062000656565b5050565b601f821115620006c757620006918162000545565b6200069c846200055a565b81016020851015620006ac578190505b620006c4620006bb856200055a565b83018262000655565b50505b505050565b600082821c905092915050565b6000620006ec60001984600802620006cc565b1980831691505092915050565b6000620007078383620006d9565b9150826002028217905092915050565b6200072282620004d6565b67ffffffffffffffff8111156200073e576200073d62000222565b5b6200074a825462000510565b620007578282856200067c565b600060209050601f8311600181146200078f57600084156200077a578287015190505b620007868582620006f9565b865550620007f6565b601f1984166200079f8662000545565b60005b82811015620007c957848901518255600182019150602085019450602081019050620007a2565b86831015620007e95784890151620007e5601f891682620006d9565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006200083a8262000386565b9150620008478362000386565b9250828202620008578162000386565b91508282048414831517620008715762000870620007fe565b5b5092915050565b620008838162000386565b82525050565b6000602082019050620008a0600083018462000878565b92915050565b611a4c80620008b66000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c8063a293d1e8116100ad578063d43a632f11610071578063d43a632f1461036d578063dd62ed3e14610389578063e6cb9013146103b9578063e6fdb7ea146103e9578063fb7ed961146104075761012c565b8063a293d1e814610291578063a9059cbb146102c1578063b5931f7c146102f1578063bd3a13f614610321578063d05c78da1461033d5761012c565b8063484b1c13116100f4578063484b1c13146101eb5780635012fb721461020957806370a082311461022757806395d89b4114610257578063a06c1a33146102755761012c565b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461017f57806323b872dd1461019d578063313ce567146101cd575b600080fd5b610139610423565b6040516101469190610f01565b60405180910390f35b61016960048036038101906101649190610fcb565b6104b1565b6040516101769190611026565b60405180910390f35b6101876105a3565b6040516101949190611050565b60405180910390f35b6101b760048036038101906101b2919061106b565b6105a9565b6040516101c49190611026565b60405180910390f35b6101d56106c7565b6040516101e291906110da565b60405180910390f35b6101f36106da565b6040516102009190611050565b60405180910390f35b6102116106e0565b60405161021e9190611050565b60405180910390f35b610241600480360381019061023c91906110f5565b6106e6565b60405161024e9190611050565b60405180910390f35b61025f61078f565b60405161026c9190610f01565b60405180910390f35b61028f600480360381019061028a919061126a565b61081d565b005b6102ab60048036038101906102a691906112b3565b610829565b6040516102b89190611050565b60405180910390f35b6102db60048036038101906102d69190610fcb565b61084c565b6040516102e89190611026565b60405180910390f35b61030b600480360381019061030691906112b3565b610863565b6040516103189190611050565b60405180910390f35b61033b600480360381019061033691906113a8565b610885565b005b610357600480360381019061035291906112b3565b610a1b565b6040516103649190611050565b60405180910390f35b6103876004803603810190610382919061126a565b610a53565b005b6103a3600480360381019061039e9190611447565b610bde565b6040516103b09190611050565b60405180910390f35b6103d360048036038101906103ce91906112b3565b610c65565b6040516103e09190611050565b60405180910390f35b6103f1610c88565b6040516103fe9190611496565b60405180910390f35b610421600480360381019061041c919061126a565b610cae565b005b60008054610430906114e0565b80601f016020809104026020016040519081016040528092919081815260200182805461045c906114e0565b80156104a95780601f1061047e576101008083540402835291602001916104a9565b820191906000526020600020905b81548152906001019060200180831161048c57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516105919190611050565b60405180910390a36001905092915050565b60035481565b6000610631600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610829565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506106bc848484610cba565b600190509392505050565b600260009054906101000a900460ff1681565b60065481565b60075481565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361078457600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061078a565b60075490505b919050565b6001805461079c906114e0565b80601f01602080910402602001604051908101604052809291908181526020018280546107c8906114e0565b80156108155780601f106107ea57610100808354040283529160200191610815565b820191906000526020600020905b8154815290600101906020018083116107f857829003601f168201915b505050505081565b61082681610a53565b50565b60008282111561083857600080fd5b81836108449190611540565b905092915050565b6000610859338484610cba565b6001905092915050565b600080821161087157600080fd5b818361087d91906115a3565b905092915050565b83600090816108949190611780565b5082600190816108a49190611780565b506012600260006101000a81548160ff021916908360ff160217905550816006819055506509184e72a0006006546108dc9190611852565b60038190555080600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060035460046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600354604051610a0d9190611050565b60405180910390a350505050565b60008183610a299190611852565b90506000831480610a445750818382610a4291906115a3565b145b610a4d57600080fd5b92915050565b60008151905060005b81811015610b5457670de0b6b3a76400006188b86201ccf1610a7c610e3c565b610a869190611894565b610a9091906118c5565b610a9a9190611852565b600781905550828181518110610ab357610ab26118f9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600754604051610b3b9190611050565b60405180910390a380610b4d90611928565b9050610a5c565b5080600754610b639190611852565b60046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610bd39190611540565b925050819055505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008183610c7391906118c5565b905082811015610c8257600080fd5b92915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb781610a53565b50565b610d03600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610829565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d8f600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610c65565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610e2f9190611050565b60405180910390a3505050565b6000444233604051602001610e53939291906119d9565b6040516020818303038152906040528051906020012060001c905090565b600081519050919050565b600082825260208201905092915050565b60005b83811015610eab578082015181840152602081019050610e90565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ed382610e71565b610edd8185610e7c565b9350610eed818560208601610e8d565b610ef681610eb7565b840191505092915050565b60006020820190508181036000830152610f1b8184610ec8565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610f6282610f37565b9050919050565b610f7281610f57565b8114610f7d57600080fd5b50565b600081359050610f8f81610f69565b92915050565b6000819050919050565b610fa881610f95565b8114610fb357600080fd5b50565b600081359050610fc581610f9f565b92915050565b60008060408385031215610fe257610fe1610f2d565b5b6000610ff085828601610f80565b925050602061100185828601610fb6565b9150509250929050565b60008115159050919050565b6110208161100b565b82525050565b600060208201905061103b6000830184611017565b92915050565b61104a81610f95565b82525050565b60006020820190506110656000830184611041565b92915050565b60008060006060848603121561108457611083610f2d565b5b600061109286828701610f80565b93505060206110a386828701610f80565b92505060406110b486828701610fb6565b9150509250925092565b600060ff82169050919050565b6110d4816110be565b82525050565b60006020820190506110ef60008301846110cb565b92915050565b60006020828403121561110b5761110a610f2d565b5b600061111984828501610f80565b91505092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61115f82610eb7565b810181811067ffffffffffffffff8211171561117e5761117d611127565b5b80604052505050565b6000611191610f23565b905061119d8282611156565b919050565b600067ffffffffffffffff8211156111bd576111bc611127565b5b602082029050602081019050919050565b600080fd5b60006111e66111e1846111a2565b611187565b90508083825260208201905060208402830185811115611209576112086111ce565b5b835b81811015611232578061121e8882610f80565b84526020840193505060208101905061120b565b5050509392505050565b600082601f83011261125157611250611122565b5b81356112618482602086016111d3565b91505092915050565b6000602082840312156112805761127f610f2d565b5b600082013567ffffffffffffffff81111561129e5761129d610f32565b5b6112aa8482850161123c565b91505092915050565b600080604083850312156112ca576112c9610f2d565b5b60006112d885828601610fb6565b92505060206112e985828601610fb6565b9150509250929050565b600080fd5b600067ffffffffffffffff82111561131357611312611127565b5b61131c82610eb7565b9050602081019050919050565b82818337600083830152505050565b600061134b611346846112f8565b611187565b905082815260208101848484011115611367576113666112f3565b5b611372848285611329565b509392505050565b600082601f83011261138f5761138e611122565b5b813561139f848260208601611338565b91505092915050565b600080600080608085870312156113c2576113c1610f2d565b5b600085013567ffffffffffffffff8111156113e0576113df610f32565b5b6113ec8782880161137a565b945050602085013567ffffffffffffffff81111561140d5761140c610f32565b5b6114198782880161137a565b935050604061142a87828801610fb6565b925050606061143b87828801610f80565b91505092959194509250565b6000806040838503121561145e5761145d610f2d565b5b600061146c85828601610f80565b925050602061147d85828601610f80565b9150509250929050565b61149081610f57565b82525050565b60006020820190506114ab6000830184611487565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806114f857607f821691505b60208210810361150b5761150a6114b1565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061154b82610f95565b915061155683610f95565b925082820390508181111561156e5761156d611511565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006115ae82610f95565b91506115b983610f95565b9250826115c9576115c8611574565b5b828204905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026116367fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826115f9565b61164086836115f9565b95508019841693508086168417925050509392505050565b6000819050919050565b600061167d61167861167384610f95565b611658565b610f95565b9050919050565b6000819050919050565b61169783611662565b6116ab6116a382611684565b848454611606565b825550505050565b600090565b6116c06116b3565b6116cb81848461168e565b505050565b5b818110156116ef576116e46000826116b8565b6001810190506116d1565b5050565b601f82111561173457611705816115d4565b61170e846115e9565b8101602085101561171d578190505b611731611729856115e9565b8301826116d0565b50505b505050565b600082821c905092915050565b600061175760001984600802611739565b1980831691505092915050565b60006117708383611746565b9150826002028217905092915050565b61178982610e71565b67ffffffffffffffff8111156117a2576117a1611127565b5b6117ac82546114e0565b6117b78282856116f3565b600060209050601f8311600181146117ea57600084156117d8578287015190505b6117e28582611764565b86555061184a565b601f1984166117f8866115d4565b60005b82811015611820578489015182556001820191506020850194506020810190506117fb565b8683101561183d5784890151611839601f891682611746565b8355505b6001600288020188555050505b505050505050565b600061185d82610f95565b915061186883610f95565b925082820261187681610f95565b9150828204841483151761188d5761188c611511565b5b5092915050565b600061189f82610f95565b91506118aa83610f95565b9250826118ba576118b9611574565b5b828206905092915050565b60006118d082610f95565b91506118db83610f95565b92508282019050808211156118f3576118f2611511565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061193382610f95565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361196557611964611511565b5b600182019050919050565b6000819050919050565b61198b61198682610f95565b611970565b82525050565b60008160601b9050919050565b60006119a982611991565b9050919050565b60006119bb8261199e565b9050919050565b6119d36119ce82610f57565b6119b0565b82525050565b60006119e5828661197a565b6020820191506119f5828561197a565b602082019150611a0582846119c2565b60148201915081905094935050505056fea264697066735822122007d89187ebeb15ec4f7369f375cb5f71adaedfc1f749d035ac4f70ad9113dd1064736f6c63430008120033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000002df458b38b954bc82fb800000000000000000000000000087cc45fff5c0933bb6af6bae7fc013b7ec7df2ee000000000000000000000000000000000000000000000000000000000000000b212020202020204659444500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000194679646520506f696e7473202d207777772e667964652e636300000000000000 | 608060405234801561001057600080fd5b506004361061012c5760003560e01c8063a293d1e8116100ad578063d43a632f11610071578063d43a632f1461036d578063dd62ed3e14610389578063e6cb9013146103b9578063e6fdb7ea146103e9578063fb7ed961146104075761012c565b8063a293d1e814610291578063a9059cbb146102c1578063b5931f7c146102f1578063bd3a13f614610321578063d05c78da1461033d5761012c565b8063484b1c13116100f4578063484b1c13146101eb5780635012fb721461020957806370a082311461022757806395d89b4114610257578063a06c1a33146102755761012c565b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461017f57806323b872dd1461019d578063313ce567146101cd575b600080fd5b610139610423565b6040516101469190610f01565b60405180910390f35b61016960048036038101906101649190610fcb565b6104b1565b6040516101769190611026565b60405180910390f35b6101876105a3565b6040516101949190611050565b60405180910390f35b6101b760048036038101906101b2919061106b565b6105a9565b6040516101c49190611026565b60405180910390f35b6101d56106c7565b6040516101e291906110da565b60405180910390f35b6101f36106da565b6040516102009190611050565b60405180910390f35b6102116106e0565b60405161021e9190611050565b60405180910390f35b610241600480360381019061023c91906110f5565b6106e6565b60405161024e9190611050565b60405180910390f35b61025f61078f565b60405161026c9190610f01565b60405180910390f35b61028f600480360381019061028a919061126a565b61081d565b005b6102ab60048036038101906102a691906112b3565b610829565b6040516102b89190611050565b60405180910390f35b6102db60048036038101906102d69190610fcb565b61084c565b6040516102e89190611026565b60405180910390f35b61030b600480360381019061030691906112b3565b610863565b6040516103189190611050565b60405180910390f35b61033b600480360381019061033691906113a8565b610885565b005b610357600480360381019061035291906112b3565b610a1b565b6040516103649190611050565b60405180910390f35b6103876004803603810190610382919061126a565b610a53565b005b6103a3600480360381019061039e9190611447565b610bde565b6040516103b09190611050565b60405180910390f35b6103d360048036038101906103ce91906112b3565b610c65565b6040516103e09190611050565b60405180910390f35b6103f1610c88565b6040516103fe9190611496565b60405180910390f35b610421600480360381019061041c919061126a565b610cae565b005b60008054610430906114e0565b80601f016020809104026020016040519081016040528092919081815260200182805461045c906114e0565b80156104a95780601f1061047e576101008083540402835291602001916104a9565b820191906000526020600020905b81548152906001019060200180831161048c57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516105919190611050565b60405180910390a36001905092915050565b60035481565b6000610631600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610829565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506106bc848484610cba565b600190509392505050565b600260009054906101000a900460ff1681565b60065481565b60075481565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361078457600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061078a565b60075490505b919050565b6001805461079c906114e0565b80601f01602080910402602001604051908101604052809291908181526020018280546107c8906114e0565b80156108155780601f106107ea57610100808354040283529160200191610815565b820191906000526020600020905b8154815290600101906020018083116107f857829003601f168201915b505050505081565b61082681610a53565b50565b60008282111561083857600080fd5b81836108449190611540565b905092915050565b6000610859338484610cba565b6001905092915050565b600080821161087157600080fd5b818361087d91906115a3565b905092915050565b83600090816108949190611780565b5082600190816108a49190611780565b506012600260006101000a81548160ff021916908360ff160217905550816006819055506509184e72a0006006546108dc9190611852565b60038190555080600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060035460046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600354604051610a0d9190611050565b60405180910390a350505050565b60008183610a299190611852565b90506000831480610a445750818382610a4291906115a3565b145b610a4d57600080fd5b92915050565b60008151905060005b81811015610b5457670de0b6b3a76400006188b86201ccf1610a7c610e3c565b610a869190611894565b610a9091906118c5565b610a9a9190611852565b600781905550828181518110610ab357610ab26118f9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600754604051610b3b9190611050565b60405180910390a380610b4d90611928565b9050610a5c565b5080600754610b639190611852565b60046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610bd39190611540565b925050819055505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008183610c7391906118c5565b905082811015610c8257600080fd5b92915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb781610a53565b50565b610d03600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610829565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d8f600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610c65565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610e2f9190611050565b60405180910390a3505050565b6000444233604051602001610e53939291906119d9565b6040516020818303038152906040528051906020012060001c905090565b600081519050919050565b600082825260208201905092915050565b60005b83811015610eab578082015181840152602081019050610e90565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ed382610e71565b610edd8185610e7c565b9350610eed818560208601610e8d565b610ef681610eb7565b840191505092915050565b60006020820190508181036000830152610f1b8184610ec8565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610f6282610f37565b9050919050565b610f7281610f57565b8114610f7d57600080fd5b50565b600081359050610f8f81610f69565b92915050565b6000819050919050565b610fa881610f95565b8114610fb357600080fd5b50565b600081359050610fc581610f9f565b92915050565b60008060408385031215610fe257610fe1610f2d565b5b6000610ff085828601610f80565b925050602061100185828601610fb6565b9150509250929050565b60008115159050919050565b6110208161100b565b82525050565b600060208201905061103b6000830184611017565b92915050565b61104a81610f95565b82525050565b60006020820190506110656000830184611041565b92915050565b60008060006060848603121561108457611083610f2d565b5b600061109286828701610f80565b93505060206110a386828701610f80565b92505060406110b486828701610fb6565b9150509250925092565b600060ff82169050919050565b6110d4816110be565b82525050565b60006020820190506110ef60008301846110cb565b92915050565b60006020828403121561110b5761110a610f2d565b5b600061111984828501610f80565b91505092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61115f82610eb7565b810181811067ffffffffffffffff8211171561117e5761117d611127565b5b80604052505050565b6000611191610f23565b905061119d8282611156565b919050565b600067ffffffffffffffff8211156111bd576111bc611127565b5b602082029050602081019050919050565b600080fd5b60006111e66111e1846111a2565b611187565b90508083825260208201905060208402830185811115611209576112086111ce565b5b835b81811015611232578061121e8882610f80565b84526020840193505060208101905061120b565b5050509392505050565b600082601f83011261125157611250611122565b5b81356112618482602086016111d3565b91505092915050565b6000602082840312156112805761127f610f2d565b5b600082013567ffffffffffffffff81111561129e5761129d610f32565b5b6112aa8482850161123c565b91505092915050565b600080604083850312156112ca576112c9610f2d565b5b60006112d885828601610fb6565b92505060206112e985828601610fb6565b9150509250929050565b600080fd5b600067ffffffffffffffff82111561131357611312611127565b5b61131c82610eb7565b9050602081019050919050565b82818337600083830152505050565b600061134b611346846112f8565b611187565b905082815260208101848484011115611367576113666112f3565b5b611372848285611329565b509392505050565b600082601f83011261138f5761138e611122565b5b813561139f848260208601611338565b91505092915050565b600080600080608085870312156113c2576113c1610f2d565b5b600085013567ffffffffffffffff8111156113e0576113df610f32565b5b6113ec8782880161137a565b945050602085013567ffffffffffffffff81111561140d5761140c610f32565b5b6114198782880161137a565b935050604061142a87828801610fb6565b925050606061143b87828801610f80565b91505092959194509250565b6000806040838503121561145e5761145d610f2d565b5b600061146c85828601610f80565b925050602061147d85828601610f80565b9150509250929050565b61149081610f57565b82525050565b60006020820190506114ab6000830184611487565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806114f857607f821691505b60208210810361150b5761150a6114b1565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061154b82610f95565b915061155683610f95565b925082820390508181111561156e5761156d611511565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006115ae82610f95565b91506115b983610f95565b9250826115c9576115c8611574565b5b828204905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026116367fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826115f9565b61164086836115f9565b95508019841693508086168417925050509392505050565b6000819050919050565b600061167d61167861167384610f95565b611658565b610f95565b9050919050565b6000819050919050565b61169783611662565b6116ab6116a382611684565b848454611606565b825550505050565b600090565b6116c06116b3565b6116cb81848461168e565b505050565b5b818110156116ef576116e46000826116b8565b6001810190506116d1565b5050565b601f82111561173457611705816115d4565b61170e846115e9565b8101602085101561171d578190505b611731611729856115e9565b8301826116d0565b50505b505050565b600082821c905092915050565b600061175760001984600802611739565b1980831691505092915050565b60006117708383611746565b9150826002028217905092915050565b61178982610e71565b67ffffffffffffffff8111156117a2576117a1611127565b5b6117ac82546114e0565b6117b78282856116f3565b600060209050601f8311600181146117ea57600084156117d8578287015190505b6117e28582611764565b86555061184a565b601f1984166117f8866115d4565b60005b82811015611820578489015182556001820191506020850194506020810190506117fb565b8683101561183d5784890151611839601f891682611746565b8355505b6001600288020188555050505b505050505050565b600061185d82610f95565b915061186883610f95565b925082820261187681610f95565b9150828204841483151761188d5761188c611511565b5b5092915050565b600061189f82610f95565b91506118aa83610f95565b9250826118ba576118b9611574565b5b828206905092915050565b60006118d082610f95565b91506118db83610f95565b92508282019050808211156118f3576118f2611511565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061193382610f95565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361196557611964611511565b5b600182019050919050565b6000819050919050565b61198b61198682610f95565b611970565b82525050565b60008160601b9050919050565b60006119a982611991565b9050919050565b60006119bb8261199e565b9050919050565b6119d36119ce82610f57565b6119b0565b82525050565b60006119e5828661197a565b6020820191506119f5828561197a565b602082019150611a0582846119c2565b60148201915081905094935050505056fea264697066735822122007d89187ebeb15ec4f7369f375cb5f71adaedfc1f749d035ac4f70ad9113dd1064736f6c63430008120033 | |
1 | 20,290,378 | 73607c6235b342f9294ac9187683822a1edaf3e6631c1f3473fa78fd3aa09ac2 | 95112520a8849b7aeb1abff0dc21c4f362d5e27a9be7450d265e31a58f423581 | 5dba0e26e3ac8cf14bad27f9b69d232801be8cd1 | 29ef46035e9fa3d570c598d3266424ca11413b0c | 54ecfc6e4ca411f2b747aef1ba91cc8dbf8c5696 | 3d602d80600a3d3981f3363d3d373d3d3d363d735397d0869aba0d55e96d5716d383f6e1d8695ed75af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d735397d0869aba0d55e96d5716d383f6e1d8695ed75af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"contracts/Forwarder.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.10;\nimport '@openzeppelin/contracts/token/ERC1155/IERC1155.sol';\nimport '@openzeppelin/contracts/token/ERC721/IERC721.sol';\nimport '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';\nimport '@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol';\nimport './ERC20Interface.sol';\nimport './TransferHelper.sol';\nimport './IForwarder.sol';\n\n/**\n * Contract that will forward any incoming Ether to the creator of the contract\n *\n */\ncontract Forwarder is IERC721Receiver, ERC1155Receiver, IForwarder {\n // Address to which any funds sent to this contract will be forwarded\n address public parentAddress;\n bool public autoFlush721 = true;\n bool public autoFlush1155 = true;\n\n event ForwarderDeposited(address from, uint256 value, bytes data);\n\n /**\n * Initialize the contract, and sets the destination address to that of the creator\n */\n function init(\n address _parentAddress,\n bool _autoFlush721,\n bool _autoFlush1155\n ) external onlyUninitialized {\n parentAddress = _parentAddress;\n uint256 value = address(this).balance;\n\n // set whether we want to automatically flush erc721/erc1155 tokens or not\n autoFlush721 = _autoFlush721;\n autoFlush1155 = _autoFlush1155;\n\n if (value == 0) {\n return;\n }\n\n (bool success, ) = parentAddress.call{ value: value }('');\n require(success, 'Flush failed');\n\n // NOTE: since we are forwarding on initialization,\n // we don't have the context of the original sender.\n // We still emit an event about the forwarding but set\n // the sender to the forwarder itself\n emit ForwarderDeposited(address(this), value, msg.data);\n }\n\n /**\n * Modifier that will execute internal code block only if the sender is the parent address\n */\n modifier onlyParent {\n require(msg.sender == parentAddress, 'Only Parent');\n _;\n }\n\n /**\n * Modifier that will execute internal code block only if the contract has not been initialized yet\n */\n modifier onlyUninitialized {\n require(parentAddress == address(0x0), 'Already initialized');\n _;\n }\n\n /**\n * Default function; Gets called when data is sent but does not match any other function\n */\n fallback() external payable {\n flush();\n }\n\n /**\n * Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address\n */\n receive() external payable {\n flush();\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function setAutoFlush721(bool autoFlush)\n external\n virtual\n override\n onlyParent\n {\n autoFlush721 = autoFlush;\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function setAutoFlush1155(bool autoFlush)\n external\n virtual\n override\n onlyParent\n {\n autoFlush1155 = autoFlush;\n }\n\n /**\n * ERC721 standard callback function for when a ERC721 is transfered. The forwarder will send the nft\n * to the base wallet once the nft contract invokes this method after transfering the nft.\n *\n * @param _operator The address which called `safeTransferFrom` function\n * @param _from The address of the sender\n * @param _tokenId The token id of the nft\n * @param data Additional data with no specified format, sent in call to `_to`\n */\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes memory data\n ) external virtual override returns (bytes4) {\n if (autoFlush721) {\n IERC721 instance = IERC721(msg.sender);\n require(\n instance.supportsInterface(type(IERC721).interfaceId),\n 'The caller does not support the ERC721 interface'\n );\n // this won't work for ERC721 re-entrancy\n instance.safeTransferFrom(address(this), parentAddress, _tokenId, data);\n }\n\n return this.onERC721Received.selector;\n }\n\n function callFromParent(\n address target,\n uint256 value,\n bytes calldata data\n ) external onlyParent returns (bytes memory) {\n (bool success, bytes memory returnedData) = target.call{ value: value }(\n data\n );\n require(success, 'Parent call execution failed');\n\n return returnedData;\n }\n\n /**\n * @inheritdoc IERC1155Receiver\n */\n function onERC1155Received(\n address _operator,\n address _from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external virtual override returns (bytes4) {\n IERC1155 instance = IERC1155(msg.sender);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n if (autoFlush1155) {\n instance.safeTransferFrom(address(this), parentAddress, id, value, data);\n }\n\n return this.onERC1155Received.selector;\n }\n\n /**\n * @inheritdoc IERC1155Receiver\n */\n function onERC1155BatchReceived(\n address _operator,\n address _from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external virtual override returns (bytes4) {\n IERC1155 instance = IERC1155(msg.sender);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n if (autoFlush1155) {\n instance.safeBatchTransferFrom(\n address(this),\n parentAddress,\n ids,\n values,\n data\n );\n }\n\n return this.onERC1155BatchReceived.selector;\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function flushTokens(address tokenContractAddress)\n external\n virtual\n override\n onlyParent\n {\n ERC20Interface instance = ERC20Interface(tokenContractAddress);\n address forwarderAddress = address(this);\n uint256 forwarderBalance = instance.balanceOf(forwarderAddress);\n if (forwarderBalance == 0) {\n return;\n }\n\n TransferHelper.safeTransfer(\n tokenContractAddress,\n parentAddress,\n forwarderBalance\n );\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function flushERC721Token(address tokenContractAddress, uint256 tokenId)\n external\n virtual\n override\n onlyParent\n {\n IERC721 instance = IERC721(tokenContractAddress);\n require(\n instance.supportsInterface(type(IERC721).interfaceId),\n 'The tokenContractAddress does not support the ERC721 interface'\n );\n\n address ownerAddress = instance.ownerOf(tokenId);\n instance.transferFrom(ownerAddress, parentAddress, tokenId);\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function flushERC1155Tokens(address tokenContractAddress, uint256 tokenId)\n external\n virtual\n override\n onlyParent\n {\n IERC1155 instance = IERC1155(tokenContractAddress);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n address forwarderAddress = address(this);\n uint256 forwarderBalance = instance.balanceOf(forwarderAddress, tokenId);\n\n instance.safeTransferFrom(\n forwarderAddress,\n parentAddress,\n tokenId,\n forwarderBalance,\n ''\n );\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function batchFlushERC1155Tokens(\n address tokenContractAddress,\n uint256[] calldata tokenIds\n ) external virtual override onlyParent {\n IERC1155 instance = IERC1155(tokenContractAddress);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n address forwarderAddress = address(this);\n uint256[] memory amounts = new uint256[](tokenIds.length);\n for (uint256 i = 0; i < tokenIds.length; i++) {\n amounts[i] = instance.balanceOf(forwarderAddress, tokenIds[i]);\n }\n\n instance.safeBatchTransferFrom(\n forwarderAddress,\n parentAddress,\n tokenIds,\n amounts,\n ''\n );\n }\n\n /**\n * Flush the entire balance of the contract to the parent address.\n */\n function flush() public {\n uint256 value = address(this).balance;\n\n if (value == 0) {\n return;\n }\n\n (bool success, ) = parentAddress.call{ value: value }('');\n require(success, 'Flush failed');\n emit ForwarderDeposited(msg.sender, value, msg.data);\n }\n\n /**\n * @inheritdoc IERC165\n */\n function supportsInterface(bytes4 interfaceId)\n public\n virtual\n override(ERC1155Receiver, IERC165)\n view\n returns (bool)\n {\n return\n interfaceId == type(IForwarder).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC1155/IERC1155.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n"
},
"@openzeppelin/contracts/token/ERC721/IERC721.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n}\n"
},
"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n"
},
"@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155Receiver.sol\";\nimport \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\nabstract contract ERC1155Receiver is ERC165, IERC1155Receiver {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);\n }\n}\n"
},
"contracts/ERC20Interface.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.10;\n\n/**\n * Contract that exposes the needed erc20 token functions\n */\n\nabstract contract ERC20Interface {\n // Send _value amount of tokens to address _to\n function transfer(address _to, uint256 _value)\n public\n virtual\n returns (bool success);\n\n // Get the account balance of another account with address _owner\n function balanceOf(address _owner)\n public\n virtual\n view\n returns (uint256 balance);\n}\n"
},
"contracts/TransferHelper.sol": {
"content": "// SPDX-License-Identifier: GPL-3.0-or-later\n// source: https://github.com/Uniswap/solidity-lib/blob/master/contracts/libraries/TransferHelper.sol\npragma solidity 0.8.10;\n\nimport '@openzeppelin/contracts/utils/Address.sol';\n\n// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false\nlibrary TransferHelper {\n function safeTransfer(\n address token,\n address to,\n uint256 value\n ) internal {\n // bytes4(keccak256(bytes('transfer(address,uint256)')));\n (bool success, bytes memory data) = token.call(\n abi.encodeWithSelector(0xa9059cbb, to, value)\n );\n require(\n success && (data.length == 0 || abi.decode(data, (bool))),\n 'TransferHelper::safeTransfer: transfer failed'\n );\n }\n\n function safeTransferFrom(\n address token,\n address from,\n address to,\n uint256 value\n ) internal {\n // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));\n (bool success, bytes memory returndata) = token.call(\n abi.encodeWithSelector(0x23b872dd, from, to, value)\n );\n Address.verifyCallResult(\n success,\n returndata,\n 'TransferHelper::transferFrom: transferFrom failed'\n );\n }\n}\n"
},
"contracts/IForwarder.sol": {
"content": "pragma solidity ^0.8.0;\n\nimport '@openzeppelin/contracts/utils/introspection/IERC165.sol';\n\ninterface IForwarder is IERC165 {\n /**\n * Sets the autoflush721 parameter.\n *\n * @param autoFlush whether to autoflush erc721 tokens\n */\n function setAutoFlush721(bool autoFlush) external;\n\n /**\n * Sets the autoflush1155 parameter.\n *\n * @param autoFlush whether to autoflush erc1155 tokens\n */\n function setAutoFlush1155(bool autoFlush) external;\n\n /**\n * Execute a token transfer of the full balance from the forwarder token to the parent address\n *\n * @param tokenContractAddress the address of the erc20 token contract\n */\n function flushTokens(address tokenContractAddress) external;\n\n /**\n * Execute a nft transfer from the forwarder to the parent address\n *\n * @param tokenContractAddress the address of the ERC721 NFT contract\n * @param tokenId The token id of the nft\n */\n function flushERC721Token(address tokenContractAddress, uint256 tokenId)\n external;\n\n /**\n * Execute a nft transfer from the forwarder to the parent address.\n *\n * @param tokenContractAddress the address of the ERC1155 NFT contract\n * @param tokenId The token id of the nft\n */\n function flushERC1155Tokens(address tokenContractAddress, uint256 tokenId)\n external;\n\n /**\n * Execute a batch nft transfer from the forwarder to the parent address.\n *\n * @param tokenContractAddress the address of the ERC1155 NFT contract\n * @param tokenIds The token ids of the nfts\n */\n function batchFlushERC1155Tokens(\n address tokenContractAddress,\n uint256[] calldata tokenIds\n ) external;\n}\n"
},
"@openzeppelin/contracts/utils/introspection/IERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n @dev Handles the receipt of a single ERC1155 token type. This function is\n called at the end of a `safeTransferFrom` after the balance has been updated.\n To accept the transfer, this must return\n `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n (i.e. 0xf23a6e61, or its own function selector).\n @param operator The address which initiated the transfer (i.e. msg.sender)\n @param from The address which previously owned the token\n @param id The ID of the token being transferred\n @param value The amount of tokens being transferred\n @param data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n @dev Handles the receipt of a multiple ERC1155 token types. This function\n is called at the end of a `safeBatchTransferFrom` after the balances have\n been updated. To accept the transfer(s), this must return\n `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n (i.e. 0xbc197c81, or its own function selector).\n @param operator The address which initiated the batch transfer (i.e. msg.sender)\n @param from The address which previously owned the token\n @param ids An array containing ids of each token being transferred (order and length must match values array)\n @param values An array containing amounts of each token being transferred (order and length must match ids array)\n @param data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n"
},
"@openzeppelin/contracts/utils/introspection/ERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n"
},
"@openzeppelin/contracts/utils/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}
}} |
1 | 20,290,383 | dc84f8dcbf729171b0f361cb79422a35f4379880b685e6c6bd3577e6864fee96 | 43add2e4615ec95f67b8b80bc3dc9ef07b0e8f21d529a5c595c8674f5af63487 | 28244d5d2cde71a19467f5045c320bfad8893b7e | 28244d5d2cde71a19467f5045c320bfad8893b7e | 5439d355cc8b2b377875ace9fbdec513a7653c50 | 6080604052348015600e575f80fd5b506101438061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610034575f3560e01c80632e64cec1146100385780636057361d14610056575b5f80fd5b610040610072565b60405161004d919061009b565b60405180910390f35b610070600480360381019061006b91906100e2565b61007a565b005b5f8054905090565b805f8190555050565b5f819050919050565b61009581610083565b82525050565b5f6020820190506100ae5f83018461008c565b92915050565b5f80fd5b6100c181610083565b81146100cb575f80fd5b50565b5f813590506100dc816100b8565b92915050565b5f602082840312156100f7576100f66100b4565b5b5f610104848285016100ce565b9150509291505056fea26469706673582212209a0dd35336aff1eb3eeb11db76aa60a1427a12c1b92f945ea8c8d1dfa337cf2264736f6c634300081a0033 | 608060405234801561000f575f80fd5b5060043610610034575f3560e01c80632e64cec1146100385780636057361d14610056575b5f80fd5b610040610072565b60405161004d919061009b565b60405180910390f35b610070600480360381019061006b91906100e2565b61007a565b005b5f8054905090565b805f8190555050565b5f819050919050565b61009581610083565b82525050565b5f6020820190506100ae5f83018461008c565b92915050565b5f80fd5b6100c181610083565b81146100cb575f80fd5b50565b5f813590506100dc816100b8565b92915050565b5f602082840312156100f7576100f66100b4565b5b5f610104848285016100ce565b9150509291505056fea26469706673582212209a0dd35336aff1eb3eeb11db76aa60a1427a12c1b92f945ea8c8d1dfa337cf2264736f6c634300081a0033 | |
1 | 20,290,384 | 7ea9b76b5f5b92553f1e7db4a36f2738b3be17c95226e7ef3f6b1e12a941e119 | 7a7e762cc60e027ab097582876fcbf8e6991249d4b6c763ac240eadca7cbed62 | c9aad2fc90eddacf02bd11fa690e3b44e318aa9b | a2a1bf5a83f9daec2dc364e1c561e937163cb613 | 2a4594f4deef409be3aec8a253fe62c651737b39 | 3d602d80600a3d3981f3363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,385 | bf18234b2e088c68216324ca44a1f9df243889c19ec33c6e00639ba34266fcb6 | b60fb38c3711373b6068453dd598b04fa75355db9493b5e0a5e1304d3a53a6b1 | c5d4353386e57c3c506584e3cb53088113ce57e4 | c5d4353386e57c3c506584e3cb53088113ce57e4 | c2e3c5d67617fc657a0ed2388cdbbc935ce1fdc2 | 60806040523480156200001157600080fd5b50604051620036da380380620036da83398181016040528101906200003791906200037d565b84600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360029081620000ca919062000684565b508260039081620000dc919062000684565b508160088190555080600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550650746a5288000826200013991906200079a565b6005819055505050505050620007e5565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200018b826200015e565b9050919050565b6200019d816200017e565b8114620001a957600080fd5b50565b600081519050620001bd8162000192565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200021882620001cd565b810181811067ffffffffffffffff821117156200023a5762000239620001de565b5b80604052505050565b60006200024f6200014a565b90506200025d82826200020d565b919050565b600067ffffffffffffffff82111562000280576200027f620001de565b5b6200028b82620001cd565b9050602081019050919050565b60005b83811015620002b85780820151818401526020810190506200029b565b60008484015250505050565b6000620002db620002d58462000262565b62000243565b905082815260208101848484011115620002fa57620002f9620001c8565b5b6200030784828562000298565b509392505050565b600082601f830112620003275762000326620001c3565b5b815162000339848260208601620002c4565b91505092915050565b6000819050919050565b620003578162000342565b81146200036357600080fd5b50565b60008151905062000377816200034c565b92915050565b600080600080600060a086880312156200039c576200039b62000154565b5b6000620003ac88828901620001ac565b955050602086015167ffffffffffffffff811115620003d057620003cf62000159565b5b620003de888289016200030f565b945050604086015167ffffffffffffffff81111562000402576200040162000159565b5b62000410888289016200030f565b9350506060620004238882890162000366565b92505060806200043688828901620001ac565b9150509295509295909350565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200049657607f821691505b602082108103620004ac57620004ab6200044e565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620005167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620004d7565b620005228683620004d7565b95508019841693508086168417925050509392505050565b6000819050919050565b6000620005656200055f620005598462000342565b6200053a565b62000342565b9050919050565b6000819050919050565b620005818362000544565b6200059962000590826200056c565b848454620004e4565b825550505050565b600090565b620005b0620005a1565b620005bd81848462000576565b505050565b5b81811015620005e557620005d9600082620005a6565b600181019050620005c3565b5050565b601f8211156200063457620005fe81620004b2565b6200060984620004c7565b8101602085101562000619578190505b620006316200062885620004c7565b830182620005c2565b50505b505050565b600082821c905092915050565b6000620006596000198460080262000639565b1980831691505092915050565b600062000674838362000646565b9150826002028217905092915050565b6200068f8262000443565b67ffffffffffffffff811115620006ab57620006aa620001de565b5b620006b782546200047d565b620006c4828285620005e9565b600060209050601f831160018114620006fc5760008415620006e7578287015190505b620006f3858262000666565b86555062000763565b601f1984166200070c86620004b2565b60005b8281101562000736578489015182556001820191506020850194506020810190506200070f565b8683101562000756578489015162000752601f89168262000646565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000620007a78262000342565b9150620007b48362000342565b9250828202620007c48162000342565b91508282048414831517620007de57620007dd6200076b565b5b5092915050565b612ee580620007f56000396000f3fe60806040523480156200001157600080fd5b5060043610620000a05760003560e01c80635c60da1b116200006f5780635c60da1b146200012d57806395d89b41146200014f578063bd3a13f61462000171578063d43a632f1462000191578063e6fdb7ea14620001b157620000a0565b806306fdde0314620000a557806318160ddd14620000c7578063313ce56714620000e9578063484b1c13146200010b575b600080fd5b620000af620001d3565b604051620000be9190620005c5565b60405180910390f35b620000d162000269565b604051620000e0919062000604565b60405180910390f35b620000f36200026f565b6040516200010291906200063f565b60405180910390f35b6200011562000282565b60405162000124919062000604565b60405180910390f35b6200013762000288565b604051620001469190620006a1565b60405180910390f35b62000159620002ae565b604051620001689190620005c5565b60405180910390f35b6200018f600480360381019062000189919062000885565b62000344565b005b620001af6004803603810190620001a991906200099e565b62000460565b005b620001bb620004f7565b604051620001ca9190620006a1565b60405180910390f35b60028054620001e29062000a22565b80601f0160208091040260200160405190810160405280929190818152602001828054620002109062000a22565b8015620002615780601f10620002355761010080835404028352916020019162000261565b820191906000526020600020905b8154815290600101906020018083116200024357829003601f168201915b505050505081565b60055481565b600460009054906101000a900460ff1681565b60085481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054620002bd9062000a22565b80601f0160208091040260200160405190810160405280929190818152602001828054620002eb9062000a22565b80156200033c5780601f1062000310576101008083540402835291602001916200033c565b820191906000526020600020905b8154815290600101906020018083116200031e57829003601f168201915b505050505081565b8383838360405162000356906200051d565b62000365949392919062000a57565b604051809103906000f08015801562000382573d6000803e3d6000fd5b50600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd3a13f6858585856040518563ffffffff1660e01b815260040162000426949392919062000a57565b600060405180830381600087803b1580156200044157600080fd5b505af115801562000456573d6000803e3d6000fd5b5050505050505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d43a632f83836040518363ffffffff1660e01b8152600401620004bf92919062000b87565b600060405180830381600087803b158015620004da57600080fd5b505af1158015620004ef573d6000803e3d6000fd5b505050505050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6123028062000bae83390190565b600081519050919050565b600082825260208201905092915050565b60005b83811015620005675780820151818401526020810190506200054a565b60008484015250505050565b6000601f19601f8301169050919050565b600062000591826200052b565b6200059d818562000536565b9350620005af81856020860162000547565b620005ba8162000573565b840191505092915050565b60006020820190508181036000830152620005e1818462000584565b905092915050565b6000819050919050565b620005fe81620005e9565b82525050565b60006020820190506200061b6000830184620005f3565b92915050565b600060ff82169050919050565b620006398162000621565b82525050565b60006020820190506200065660008301846200062e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000689826200065c565b9050919050565b6200069b816200067c565b82525050565b6000602082019050620006b8600083018462000690565b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620007168262000573565b810181811067ffffffffffffffff82111715620007385762000737620006dc565b5b80604052505050565b60006200074d620006be565b90506200075b82826200070b565b919050565b600067ffffffffffffffff8211156200077e576200077d620006dc565b5b620007898262000573565b9050602081019050919050565b82818337600083830152505050565b6000620007bc620007b68462000760565b62000741565b905082815260208101848484011115620007db57620007da620006d7565b5b620007e884828562000796565b509392505050565b600082601f830112620008085762000807620006d2565b5b81356200081a848260208601620007a5565b91505092915050565b6200082e81620005e9565b81146200083a57600080fd5b50565b6000813590506200084e8162000823565b92915050565b6200085f816200067c565b81146200086b57600080fd5b50565b6000813590506200087f8162000854565b92915050565b60008060008060808587031215620008a257620008a1620006c8565b5b600085013567ffffffffffffffff811115620008c357620008c2620006cd565b5b620008d187828801620007f0565b945050602085013567ffffffffffffffff811115620008f557620008f4620006cd565b5b6200090387828801620007f0565b935050604062000916878288016200083d565b925050606062000929878288016200086e565b91505092959194509250565b600080fd5b600080fd5b60008083601f840112620009585762000957620006d2565b5b8235905067ffffffffffffffff81111562000978576200097762000935565b5b6020830191508360208202830111156200099757620009966200093a565b5b9250929050565b60008060208385031215620009b857620009b7620006c8565b5b600083013567ffffffffffffffff811115620009d957620009d8620006cd565b5b620009e7858286016200093f565b92509250509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168062000a3b57607f821691505b60208210810362000a515762000a50620009f3565b5b50919050565b6000608082019050818103600083015262000a73818762000584565b9050818103602083015262000a89818662000584565b905062000a9a6040830185620005f3565b62000aa9606083018462000690565b95945050505050565b600082825260208201905092915050565b6000819050919050565b62000ad8816200067c565b82525050565b600062000aec838362000acd565b60208301905092915050565b600062000b0960208401846200086e565b905092915050565b6000602082019050919050565b600062000b2c838562000ab2565b935062000b398262000ac3565b8060005b8581101562000b7a5762000b52828462000af8565b62000b5e888262000ade565b975062000b6b8362000b11565b92505060018101905062000b3d565b5085925050509392505050565b6000602082019050818103600083015262000ba481848662000b1e565b9050939250505056fe60806040523480156200001157600080fd5b506040516200230238038062002302833981810160405281019062000037919062000426565b6200004b848484846200005560201b60201c565b50505050620008a6565b836000908162000066919062000717565b50826001908162000078919062000717565b506012600260006101000a81548160ff021916908360ff16021790555081600681905550650746a5288000600654620000b291906200082d565b60038190555080600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060035460046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600354604051620001e5919062000889565b60405180910390a350505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200025c8262000211565b810181811067ffffffffffffffff821117156200027e576200027d62000222565b5b80604052505050565b600062000293620001f3565b9050620002a1828262000251565b919050565b600067ffffffffffffffff821115620002c457620002c362000222565b5b620002cf8262000211565b9050602081019050919050565b60005b83811015620002fc578082015181840152602081019050620002df565b60008484015250505050565b60006200031f6200031984620002a6565b62000287565b9050828152602081018484840111156200033e576200033d6200020c565b5b6200034b848285620002dc565b509392505050565b600082601f8301126200036b576200036a62000207565b5b81516200037d84826020860162000308565b91505092915050565b6000819050919050565b6200039b8162000386565b8114620003a757600080fd5b50565b600081519050620003bb8162000390565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620003ee82620003c1565b9050919050565b6200040081620003e1565b81146200040c57600080fd5b50565b6000815190506200042081620003f5565b92915050565b60008060008060808587031215620004435762000442620001fd565b5b600085015167ffffffffffffffff81111562000464576200046362000202565b5b620004728782880162000353565b945050602085015167ffffffffffffffff81111562000496576200049562000202565b5b620004a48782880162000353565b9350506040620004b787828801620003aa565b9250506060620004ca878288016200040f565b91505092959194509250565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200052957607f821691505b6020821081036200053f576200053e620004e1565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620005a97fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200056a565b620005b586836200056a565b95508019841693508086168417925050509392505050565b6000819050919050565b6000620005f8620005f2620005ec8462000386565b620005cd565b62000386565b9050919050565b6000819050919050565b6200061483620005d7565b6200062c6200062382620005ff565b84845462000577565b825550505050565b600090565b6200064362000634565b6200065081848462000609565b505050565b5b8181101562000678576200066c60008262000639565b60018101905062000656565b5050565b601f821115620006c757620006918162000545565b6200069c846200055a565b81016020851015620006ac578190505b620006c4620006bb856200055a565b83018262000655565b50505b505050565b600082821c905092915050565b6000620006ec60001984600802620006cc565b1980831691505092915050565b6000620007078383620006d9565b9150826002028217905092915050565b6200072282620004d6565b67ffffffffffffffff8111156200073e576200073d62000222565b5b6200074a825462000510565b620007578282856200067c565b600060209050601f8311600181146200078f57600084156200077a578287015190505b620007868582620006f9565b865550620007f6565b601f1984166200079f8662000545565b60005b82811015620007c957848901518255600182019150602085019450602081019050620007a2565b86831015620007e95784890151620007e5601f891682620006d9565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006200083a8262000386565b9150620008478362000386565b9250828202620008578162000386565b91508282048414831517620008715762000870620007fe565b5b5092915050565b620008838162000386565b82525050565b6000602082019050620008a0600083018462000878565b92915050565b611a4c80620008b66000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c8063a293d1e8116100ad578063d43a632f11610071578063d43a632f1461036d578063dd62ed3e14610389578063e6cb9013146103b9578063e6fdb7ea146103e9578063fb7ed961146104075761012c565b8063a293d1e814610291578063a9059cbb146102c1578063b5931f7c146102f1578063bd3a13f614610321578063d05c78da1461033d5761012c565b8063484b1c13116100f4578063484b1c13146101eb5780635012fb721461020957806370a082311461022757806395d89b4114610257578063a06c1a33146102755761012c565b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461017f57806323b872dd1461019d578063313ce567146101cd575b600080fd5b610139610423565b6040516101469190610f01565b60405180910390f35b61016960048036038101906101649190610fcb565b6104b1565b6040516101769190611026565b60405180910390f35b6101876105a3565b6040516101949190611050565b60405180910390f35b6101b760048036038101906101b2919061106b565b6105a9565b6040516101c49190611026565b60405180910390f35b6101d56106c7565b6040516101e291906110da565b60405180910390f35b6101f36106da565b6040516102009190611050565b60405180910390f35b6102116106e0565b60405161021e9190611050565b60405180910390f35b610241600480360381019061023c91906110f5565b6106e6565b60405161024e9190611050565b60405180910390f35b61025f61078f565b60405161026c9190610f01565b60405180910390f35b61028f600480360381019061028a919061126a565b61081d565b005b6102ab60048036038101906102a691906112b3565b610829565b6040516102b89190611050565b60405180910390f35b6102db60048036038101906102d69190610fcb565b61084c565b6040516102e89190611026565b60405180910390f35b61030b600480360381019061030691906112b3565b610863565b6040516103189190611050565b60405180910390f35b61033b600480360381019061033691906113a8565b610885565b005b610357600480360381019061035291906112b3565b610a1b565b6040516103649190611050565b60405180910390f35b6103876004803603810190610382919061126a565b610a53565b005b6103a3600480360381019061039e9190611447565b610bde565b6040516103b09190611050565b60405180910390f35b6103d360048036038101906103ce91906112b3565b610c65565b6040516103e09190611050565b60405180910390f35b6103f1610c88565b6040516103fe9190611496565b60405180910390f35b610421600480360381019061041c919061126a565b610cae565b005b60008054610430906114e0565b80601f016020809104026020016040519081016040528092919081815260200182805461045c906114e0565b80156104a95780601f1061047e576101008083540402835291602001916104a9565b820191906000526020600020905b81548152906001019060200180831161048c57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516105919190611050565b60405180910390a36001905092915050565b60035481565b6000610631600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610829565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506106bc848484610cba565b600190509392505050565b600260009054906101000a900460ff1681565b60065481565b60075481565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361078457600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061078a565b60075490505b919050565b6001805461079c906114e0565b80601f01602080910402602001604051908101604052809291908181526020018280546107c8906114e0565b80156108155780601f106107ea57610100808354040283529160200191610815565b820191906000526020600020905b8154815290600101906020018083116107f857829003601f168201915b505050505081565b61082681610a53565b50565b60008282111561083857600080fd5b81836108449190611540565b905092915050565b6000610859338484610cba565b6001905092915050565b600080821161087157600080fd5b818361087d91906115a3565b905092915050565b83600090816108949190611780565b5082600190816108a49190611780565b506012600260006101000a81548160ff021916908360ff16021790555081600681905550650746a52880006006546108dc9190611852565b60038190555080600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060035460046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600354604051610a0d9190611050565b60405180910390a350505050565b60008183610a299190611852565b90506000831480610a445750818382610a4291906115a3565b145b610a4d57600080fd5b92915050565b60008151905060005b81811015610b5457670de0b6b3a76400006188b86201ccf1610a7c610e3c565b610a869190611894565b610a9091906118c5565b610a9a9190611852565b600781905550828181518110610ab357610ab26118f9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600754604051610b3b9190611050565b60405180910390a380610b4d90611928565b9050610a5c565b5080600754610b639190611852565b60046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610bd39190611540565b925050819055505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008183610c7391906118c5565b905082811015610c8257600080fd5b92915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb781610a53565b50565b610d03600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610829565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d8f600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610c65565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610e2f9190611050565b60405180910390a3505050565b6000444233604051602001610e53939291906119d9565b6040516020818303038152906040528051906020012060001c905090565b600081519050919050565b600082825260208201905092915050565b60005b83811015610eab578082015181840152602081019050610e90565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ed382610e71565b610edd8185610e7c565b9350610eed818560208601610e8d565b610ef681610eb7565b840191505092915050565b60006020820190508181036000830152610f1b8184610ec8565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610f6282610f37565b9050919050565b610f7281610f57565b8114610f7d57600080fd5b50565b600081359050610f8f81610f69565b92915050565b6000819050919050565b610fa881610f95565b8114610fb357600080fd5b50565b600081359050610fc581610f9f565b92915050565b60008060408385031215610fe257610fe1610f2d565b5b6000610ff085828601610f80565b925050602061100185828601610fb6565b9150509250929050565b60008115159050919050565b6110208161100b565b82525050565b600060208201905061103b6000830184611017565b92915050565b61104a81610f95565b82525050565b60006020820190506110656000830184611041565b92915050565b60008060006060848603121561108457611083610f2d565b5b600061109286828701610f80565b93505060206110a386828701610f80565b92505060406110b486828701610fb6565b9150509250925092565b600060ff82169050919050565b6110d4816110be565b82525050565b60006020820190506110ef60008301846110cb565b92915050565b60006020828403121561110b5761110a610f2d565b5b600061111984828501610f80565b91505092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61115f82610eb7565b810181811067ffffffffffffffff8211171561117e5761117d611127565b5b80604052505050565b6000611191610f23565b905061119d8282611156565b919050565b600067ffffffffffffffff8211156111bd576111bc611127565b5b602082029050602081019050919050565b600080fd5b60006111e66111e1846111a2565b611187565b90508083825260208201905060208402830185811115611209576112086111ce565b5b835b81811015611232578061121e8882610f80565b84526020840193505060208101905061120b565b5050509392505050565b600082601f83011261125157611250611122565b5b81356112618482602086016111d3565b91505092915050565b6000602082840312156112805761127f610f2d565b5b600082013567ffffffffffffffff81111561129e5761129d610f32565b5b6112aa8482850161123c565b91505092915050565b600080604083850312156112ca576112c9610f2d565b5b60006112d885828601610fb6565b92505060206112e985828601610fb6565b9150509250929050565b600080fd5b600067ffffffffffffffff82111561131357611312611127565b5b61131c82610eb7565b9050602081019050919050565b82818337600083830152505050565b600061134b611346846112f8565b611187565b905082815260208101848484011115611367576113666112f3565b5b611372848285611329565b509392505050565b600082601f83011261138f5761138e611122565b5b813561139f848260208601611338565b91505092915050565b600080600080608085870312156113c2576113c1610f2d565b5b600085013567ffffffffffffffff8111156113e0576113df610f32565b5b6113ec8782880161137a565b945050602085013567ffffffffffffffff81111561140d5761140c610f32565b5b6114198782880161137a565b935050604061142a87828801610fb6565b925050606061143b87828801610f80565b91505092959194509250565b6000806040838503121561145e5761145d610f2d565b5b600061146c85828601610f80565b925050602061147d85828601610f80565b9150509250929050565b61149081610f57565b82525050565b60006020820190506114ab6000830184611487565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806114f857607f821691505b60208210810361150b5761150a6114b1565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061154b82610f95565b915061155683610f95565b925082820390508181111561156e5761156d611511565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006115ae82610f95565b91506115b983610f95565b9250826115c9576115c8611574565b5b828204905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026116367fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826115f9565b61164086836115f9565b95508019841693508086168417925050509392505050565b6000819050919050565b600061167d61167861167384610f95565b611658565b610f95565b9050919050565b6000819050919050565b61169783611662565b6116ab6116a382611684565b848454611606565b825550505050565b600090565b6116c06116b3565b6116cb81848461168e565b505050565b5b818110156116ef576116e46000826116b8565b6001810190506116d1565b5050565b601f82111561173457611705816115d4565b61170e846115e9565b8101602085101561171d578190505b611731611729856115e9565b8301826116d0565b50505b505050565b600082821c905092915050565b600061175760001984600802611739565b1980831691505092915050565b60006117708383611746565b9150826002028217905092915050565b61178982610e71565b67ffffffffffffffff8111156117a2576117a1611127565b5b6117ac82546114e0565b6117b78282856116f3565b600060209050601f8311600181146117ea57600084156117d8578287015190505b6117e28582611764565b86555061184a565b601f1984166117f8866115d4565b60005b82811015611820578489015182556001820191506020850194506020810190506117fb565b8683101561183d5784890151611839601f891682611746565b8355505b6001600288020188555050505b505050505050565b600061185d82610f95565b915061186883610f95565b925082820261187681610f95565b9150828204841483151761188d5761188c611511565b5b5092915050565b600061189f82610f95565b91506118aa83610f95565b9250826118ba576118b9611574565b5b828206905092915050565b60006118d082610f95565b91506118db83610f95565b92508282019050808211156118f3576118f2611511565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061193382610f95565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361196557611964611511565b5b600182019050919050565b6000819050919050565b61198b61198682610f95565b611970565b82525050565b60008160601b9050919050565b60006119a982611991565b9050919050565b60006119bb8261199e565b9050919050565b6119d36119ce82610f57565b6119b0565b82525050565b60006119e5828661197a565b6020820191506119f5828561197a565b602082019150611a0582846119c2565b60148201915081905094935050505056fea264697066735822122077b7a99e247bb3922bc90b399fb2d4941b702c4fec6de2665f8d8573ce2a687f64736f6c63430008120033a26469706673582212207c6d041e9914baed266634b78e816a3552960831b7187f4ae93f6437f15dcd8764736f6c63430008120033000000000000000000000000eadb59637d83837fe307ab61ad388c2e0e2d3e6100000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000013ca65120000000000000000000000000087cc45fff5c0933bb6af6bae7fc013b7ec7df2ee000000000000000000000000000000000000000000000000000000000000000b212020202020204659444500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000194679646520506f696e7473202d207777772e667964652e636300000000000000 | 60806040523480156200001157600080fd5b5060043610620000a05760003560e01c80635c60da1b116200006f5780635c60da1b146200012d57806395d89b41146200014f578063bd3a13f61462000171578063d43a632f1462000191578063e6fdb7ea14620001b157620000a0565b806306fdde0314620000a557806318160ddd14620000c7578063313ce56714620000e9578063484b1c13146200010b575b600080fd5b620000af620001d3565b604051620000be9190620005c5565b60405180910390f35b620000d162000269565b604051620000e0919062000604565b60405180910390f35b620000f36200026f565b6040516200010291906200063f565b60405180910390f35b6200011562000282565b60405162000124919062000604565b60405180910390f35b6200013762000288565b604051620001469190620006a1565b60405180910390f35b62000159620002ae565b604051620001689190620005c5565b60405180910390f35b6200018f600480360381019062000189919062000885565b62000344565b005b620001af6004803603810190620001a991906200099e565b62000460565b005b620001bb620004f7565b604051620001ca9190620006a1565b60405180910390f35b60028054620001e29062000a22565b80601f0160208091040260200160405190810160405280929190818152602001828054620002109062000a22565b8015620002615780601f10620002355761010080835404028352916020019162000261565b820191906000526020600020905b8154815290600101906020018083116200024357829003601f168201915b505050505081565b60055481565b600460009054906101000a900460ff1681565b60085481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054620002bd9062000a22565b80601f0160208091040260200160405190810160405280929190818152602001828054620002eb9062000a22565b80156200033c5780601f1062000310576101008083540402835291602001916200033c565b820191906000526020600020905b8154815290600101906020018083116200031e57829003601f168201915b505050505081565b8383838360405162000356906200051d565b62000365949392919062000a57565b604051809103906000f08015801562000382573d6000803e3d6000fd5b50600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd3a13f6858585856040518563ffffffff1660e01b815260040162000426949392919062000a57565b600060405180830381600087803b1580156200044157600080fd5b505af115801562000456573d6000803e3d6000fd5b5050505050505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d43a632f83836040518363ffffffff1660e01b8152600401620004bf92919062000b87565b600060405180830381600087803b158015620004da57600080fd5b505af1158015620004ef573d6000803e3d6000fd5b505050505050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6123028062000bae83390190565b600081519050919050565b600082825260208201905092915050565b60005b83811015620005675780820151818401526020810190506200054a565b60008484015250505050565b6000601f19601f8301169050919050565b600062000591826200052b565b6200059d818562000536565b9350620005af81856020860162000547565b620005ba8162000573565b840191505092915050565b60006020820190508181036000830152620005e1818462000584565b905092915050565b6000819050919050565b620005fe81620005e9565b82525050565b60006020820190506200061b6000830184620005f3565b92915050565b600060ff82169050919050565b620006398162000621565b82525050565b60006020820190506200065660008301846200062e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000689826200065c565b9050919050565b6200069b816200067c565b82525050565b6000602082019050620006b8600083018462000690565b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620007168262000573565b810181811067ffffffffffffffff82111715620007385762000737620006dc565b5b80604052505050565b60006200074d620006be565b90506200075b82826200070b565b919050565b600067ffffffffffffffff8211156200077e576200077d620006dc565b5b620007898262000573565b9050602081019050919050565b82818337600083830152505050565b6000620007bc620007b68462000760565b62000741565b905082815260208101848484011115620007db57620007da620006d7565b5b620007e884828562000796565b509392505050565b600082601f830112620008085762000807620006d2565b5b81356200081a848260208601620007a5565b91505092915050565b6200082e81620005e9565b81146200083a57600080fd5b50565b6000813590506200084e8162000823565b92915050565b6200085f816200067c565b81146200086b57600080fd5b50565b6000813590506200087f8162000854565b92915050565b60008060008060808587031215620008a257620008a1620006c8565b5b600085013567ffffffffffffffff811115620008c357620008c2620006cd565b5b620008d187828801620007f0565b945050602085013567ffffffffffffffff811115620008f557620008f4620006cd565b5b6200090387828801620007f0565b935050604062000916878288016200083d565b925050606062000929878288016200086e565b91505092959194509250565b600080fd5b600080fd5b60008083601f840112620009585762000957620006d2565b5b8235905067ffffffffffffffff81111562000978576200097762000935565b5b6020830191508360208202830111156200099757620009966200093a565b5b9250929050565b60008060208385031215620009b857620009b7620006c8565b5b600083013567ffffffffffffffff811115620009d957620009d8620006cd565b5b620009e7858286016200093f565b92509250509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168062000a3b57607f821691505b60208210810362000a515762000a50620009f3565b5b50919050565b6000608082019050818103600083015262000a73818762000584565b9050818103602083015262000a89818662000584565b905062000a9a6040830185620005f3565b62000aa9606083018462000690565b95945050505050565b600082825260208201905092915050565b6000819050919050565b62000ad8816200067c565b82525050565b600062000aec838362000acd565b60208301905092915050565b600062000b0960208401846200086e565b905092915050565b6000602082019050919050565b600062000b2c838562000ab2565b935062000b398262000ac3565b8060005b8581101562000b7a5762000b52828462000af8565b62000b5e888262000ade565b975062000b6b8362000b11565b92505060018101905062000b3d565b5085925050509392505050565b6000602082019050818103600083015262000ba481848662000b1e565b9050939250505056fe60806040523480156200001157600080fd5b506040516200230238038062002302833981810160405281019062000037919062000426565b6200004b848484846200005560201b60201c565b50505050620008a6565b836000908162000066919062000717565b50826001908162000078919062000717565b506012600260006101000a81548160ff021916908360ff16021790555081600681905550650746a5288000600654620000b291906200082d565b60038190555080600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060035460046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600354604051620001e5919062000889565b60405180910390a350505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200025c8262000211565b810181811067ffffffffffffffff821117156200027e576200027d62000222565b5b80604052505050565b600062000293620001f3565b9050620002a1828262000251565b919050565b600067ffffffffffffffff821115620002c457620002c362000222565b5b620002cf8262000211565b9050602081019050919050565b60005b83811015620002fc578082015181840152602081019050620002df565b60008484015250505050565b60006200031f6200031984620002a6565b62000287565b9050828152602081018484840111156200033e576200033d6200020c565b5b6200034b848285620002dc565b509392505050565b600082601f8301126200036b576200036a62000207565b5b81516200037d84826020860162000308565b91505092915050565b6000819050919050565b6200039b8162000386565b8114620003a757600080fd5b50565b600081519050620003bb8162000390565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620003ee82620003c1565b9050919050565b6200040081620003e1565b81146200040c57600080fd5b50565b6000815190506200042081620003f5565b92915050565b60008060008060808587031215620004435762000442620001fd565b5b600085015167ffffffffffffffff81111562000464576200046362000202565b5b620004728782880162000353565b945050602085015167ffffffffffffffff81111562000496576200049562000202565b5b620004a48782880162000353565b9350506040620004b787828801620003aa565b9250506060620004ca878288016200040f565b91505092959194509250565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200052957607f821691505b6020821081036200053f576200053e620004e1565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620005a97fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200056a565b620005b586836200056a565b95508019841693508086168417925050509392505050565b6000819050919050565b6000620005f8620005f2620005ec8462000386565b620005cd565b62000386565b9050919050565b6000819050919050565b6200061483620005d7565b6200062c6200062382620005ff565b84845462000577565b825550505050565b600090565b6200064362000634565b6200065081848462000609565b505050565b5b8181101562000678576200066c60008262000639565b60018101905062000656565b5050565b601f821115620006c757620006918162000545565b6200069c846200055a565b81016020851015620006ac578190505b620006c4620006bb856200055a565b83018262000655565b50505b505050565b600082821c905092915050565b6000620006ec60001984600802620006cc565b1980831691505092915050565b6000620007078383620006d9565b9150826002028217905092915050565b6200072282620004d6565b67ffffffffffffffff8111156200073e576200073d62000222565b5b6200074a825462000510565b620007578282856200067c565b600060209050601f8311600181146200078f57600084156200077a578287015190505b620007868582620006f9565b865550620007f6565b601f1984166200079f8662000545565b60005b82811015620007c957848901518255600182019150602085019450602081019050620007a2565b86831015620007e95784890151620007e5601f891682620006d9565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006200083a8262000386565b9150620008478362000386565b9250828202620008578162000386565b91508282048414831517620008715762000870620007fe565b5b5092915050565b620008838162000386565b82525050565b6000602082019050620008a0600083018462000878565b92915050565b611a4c80620008b66000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c8063a293d1e8116100ad578063d43a632f11610071578063d43a632f1461036d578063dd62ed3e14610389578063e6cb9013146103b9578063e6fdb7ea146103e9578063fb7ed961146104075761012c565b8063a293d1e814610291578063a9059cbb146102c1578063b5931f7c146102f1578063bd3a13f614610321578063d05c78da1461033d5761012c565b8063484b1c13116100f4578063484b1c13146101eb5780635012fb721461020957806370a082311461022757806395d89b4114610257578063a06c1a33146102755761012c565b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461017f57806323b872dd1461019d578063313ce567146101cd575b600080fd5b610139610423565b6040516101469190610f01565b60405180910390f35b61016960048036038101906101649190610fcb565b6104b1565b6040516101769190611026565b60405180910390f35b6101876105a3565b6040516101949190611050565b60405180910390f35b6101b760048036038101906101b2919061106b565b6105a9565b6040516101c49190611026565b60405180910390f35b6101d56106c7565b6040516101e291906110da565b60405180910390f35b6101f36106da565b6040516102009190611050565b60405180910390f35b6102116106e0565b60405161021e9190611050565b60405180910390f35b610241600480360381019061023c91906110f5565b6106e6565b60405161024e9190611050565b60405180910390f35b61025f61078f565b60405161026c9190610f01565b60405180910390f35b61028f600480360381019061028a919061126a565b61081d565b005b6102ab60048036038101906102a691906112b3565b610829565b6040516102b89190611050565b60405180910390f35b6102db60048036038101906102d69190610fcb565b61084c565b6040516102e89190611026565b60405180910390f35b61030b600480360381019061030691906112b3565b610863565b6040516103189190611050565b60405180910390f35b61033b600480360381019061033691906113a8565b610885565b005b610357600480360381019061035291906112b3565b610a1b565b6040516103649190611050565b60405180910390f35b6103876004803603810190610382919061126a565b610a53565b005b6103a3600480360381019061039e9190611447565b610bde565b6040516103b09190611050565b60405180910390f35b6103d360048036038101906103ce91906112b3565b610c65565b6040516103e09190611050565b60405180910390f35b6103f1610c88565b6040516103fe9190611496565b60405180910390f35b610421600480360381019061041c919061126a565b610cae565b005b60008054610430906114e0565b80601f016020809104026020016040519081016040528092919081815260200182805461045c906114e0565b80156104a95780601f1061047e576101008083540402835291602001916104a9565b820191906000526020600020905b81548152906001019060200180831161048c57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516105919190611050565b60405180910390a36001905092915050565b60035481565b6000610631600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610829565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506106bc848484610cba565b600190509392505050565b600260009054906101000a900460ff1681565b60065481565b60075481565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361078457600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061078a565b60075490505b919050565b6001805461079c906114e0565b80601f01602080910402602001604051908101604052809291908181526020018280546107c8906114e0565b80156108155780601f106107ea57610100808354040283529160200191610815565b820191906000526020600020905b8154815290600101906020018083116107f857829003601f168201915b505050505081565b61082681610a53565b50565b60008282111561083857600080fd5b81836108449190611540565b905092915050565b6000610859338484610cba565b6001905092915050565b600080821161087157600080fd5b818361087d91906115a3565b905092915050565b83600090816108949190611780565b5082600190816108a49190611780565b506012600260006101000a81548160ff021916908360ff16021790555081600681905550650746a52880006006546108dc9190611852565b60038190555080600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060035460046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600354604051610a0d9190611050565b60405180910390a350505050565b60008183610a299190611852565b90506000831480610a445750818382610a4291906115a3565b145b610a4d57600080fd5b92915050565b60008151905060005b81811015610b5457670de0b6b3a76400006188b86201ccf1610a7c610e3c565b610a869190611894565b610a9091906118c5565b610a9a9190611852565b600781905550828181518110610ab357610ab26118f9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600754604051610b3b9190611050565b60405180910390a380610b4d90611928565b9050610a5c565b5080600754610b639190611852565b60046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610bd39190611540565b925050819055505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008183610c7391906118c5565b905082811015610c8257600080fd5b92915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb781610a53565b50565b610d03600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610829565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d8f600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610c65565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610e2f9190611050565b60405180910390a3505050565b6000444233604051602001610e53939291906119d9565b6040516020818303038152906040528051906020012060001c905090565b600081519050919050565b600082825260208201905092915050565b60005b83811015610eab578082015181840152602081019050610e90565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ed382610e71565b610edd8185610e7c565b9350610eed818560208601610e8d565b610ef681610eb7565b840191505092915050565b60006020820190508181036000830152610f1b8184610ec8565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610f6282610f37565b9050919050565b610f7281610f57565b8114610f7d57600080fd5b50565b600081359050610f8f81610f69565b92915050565b6000819050919050565b610fa881610f95565b8114610fb357600080fd5b50565b600081359050610fc581610f9f565b92915050565b60008060408385031215610fe257610fe1610f2d565b5b6000610ff085828601610f80565b925050602061100185828601610fb6565b9150509250929050565b60008115159050919050565b6110208161100b565b82525050565b600060208201905061103b6000830184611017565b92915050565b61104a81610f95565b82525050565b60006020820190506110656000830184611041565b92915050565b60008060006060848603121561108457611083610f2d565b5b600061109286828701610f80565b93505060206110a386828701610f80565b92505060406110b486828701610fb6565b9150509250925092565b600060ff82169050919050565b6110d4816110be565b82525050565b60006020820190506110ef60008301846110cb565b92915050565b60006020828403121561110b5761110a610f2d565b5b600061111984828501610f80565b91505092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61115f82610eb7565b810181811067ffffffffffffffff8211171561117e5761117d611127565b5b80604052505050565b6000611191610f23565b905061119d8282611156565b919050565b600067ffffffffffffffff8211156111bd576111bc611127565b5b602082029050602081019050919050565b600080fd5b60006111e66111e1846111a2565b611187565b90508083825260208201905060208402830185811115611209576112086111ce565b5b835b81811015611232578061121e8882610f80565b84526020840193505060208101905061120b565b5050509392505050565b600082601f83011261125157611250611122565b5b81356112618482602086016111d3565b91505092915050565b6000602082840312156112805761127f610f2d565b5b600082013567ffffffffffffffff81111561129e5761129d610f32565b5b6112aa8482850161123c565b91505092915050565b600080604083850312156112ca576112c9610f2d565b5b60006112d885828601610fb6565b92505060206112e985828601610fb6565b9150509250929050565b600080fd5b600067ffffffffffffffff82111561131357611312611127565b5b61131c82610eb7565b9050602081019050919050565b82818337600083830152505050565b600061134b611346846112f8565b611187565b905082815260208101848484011115611367576113666112f3565b5b611372848285611329565b509392505050565b600082601f83011261138f5761138e611122565b5b813561139f848260208601611338565b91505092915050565b600080600080608085870312156113c2576113c1610f2d565b5b600085013567ffffffffffffffff8111156113e0576113df610f32565b5b6113ec8782880161137a565b945050602085013567ffffffffffffffff81111561140d5761140c610f32565b5b6114198782880161137a565b935050604061142a87828801610fb6565b925050606061143b87828801610f80565b91505092959194509250565b6000806040838503121561145e5761145d610f2d565b5b600061146c85828601610f80565b925050602061147d85828601610f80565b9150509250929050565b61149081610f57565b82525050565b60006020820190506114ab6000830184611487565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806114f857607f821691505b60208210810361150b5761150a6114b1565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061154b82610f95565b915061155683610f95565b925082820390508181111561156e5761156d611511565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006115ae82610f95565b91506115b983610f95565b9250826115c9576115c8611574565b5b828204905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026116367fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826115f9565b61164086836115f9565b95508019841693508086168417925050509392505050565b6000819050919050565b600061167d61167861167384610f95565b611658565b610f95565b9050919050565b6000819050919050565b61169783611662565b6116ab6116a382611684565b848454611606565b825550505050565b600090565b6116c06116b3565b6116cb81848461168e565b505050565b5b818110156116ef576116e46000826116b8565b6001810190506116d1565b5050565b601f82111561173457611705816115d4565b61170e846115e9565b8101602085101561171d578190505b611731611729856115e9565b8301826116d0565b50505b505050565b600082821c905092915050565b600061175760001984600802611739565b1980831691505092915050565b60006117708383611746565b9150826002028217905092915050565b61178982610e71565b67ffffffffffffffff8111156117a2576117a1611127565b5b6117ac82546114e0565b6117b78282856116f3565b600060209050601f8311600181146117ea57600084156117d8578287015190505b6117e28582611764565b86555061184a565b601f1984166117f8866115d4565b60005b82811015611820578489015182556001820191506020850194506020810190506117fb565b8683101561183d5784890151611839601f891682611746565b8355505b6001600288020188555050505b505050505050565b600061185d82610f95565b915061186883610f95565b925082820261187681610f95565b9150828204841483151761188d5761188c611511565b5b5092915050565b600061189f82610f95565b91506118aa83610f95565b9250826118ba576118b9611574565b5b828206905092915050565b60006118d082610f95565b91506118db83610f95565b92508282019050808211156118f3576118f2611511565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061193382610f95565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361196557611964611511565b5b600182019050919050565b6000819050919050565b61198b61198682610f95565b611970565b82525050565b60008160601b9050919050565b60006119a982611991565b9050919050565b60006119bb8261199e565b9050919050565b6119d36119ce82610f57565b6119b0565b82525050565b60006119e5828661197a565b6020820191506119f5828561197a565b602082019150611a0582846119c2565b60148201915081905094935050505056fea264697066735822122077b7a99e247bb3922bc90b399fb2d4941b702c4fec6de2665f8d8573ce2a687f64736f6c63430008120033a26469706673582212207c6d041e9914baed266634b78e816a3552960831b7187f4ae93f6437f15dcd8764736f6c63430008120033 | |
1 | 20,290,385 | bf18234b2e088c68216324ca44a1f9df243889c19ec33c6e00639ba34266fcb6 | bafca5d989a6d88ffd59f376f19881072e5980b09a2ff0f96e762d2ce67f08b4 | bfbcdd04dda68cfcfba2d687ffce365fd46d5f5f | bfbcdd04dda68cfcfba2d687ffce365fd46d5f5f | 5cb546ce12d57396c7299897c29e2ae6d55cc846 | 60a06040526c054f529ca52576bc68920000006009556b1b2fbb73f163a79bb1000000600a819055600b556b0d97ddb9f8b1d3cdd8800000600c55600d805460ff191690556014600e556023600f553480156200005b57600080fd5b506040518060400160405280601081526020016f26baba30b73a102137bcb99021b63ab160811b8152506040518060400160405280600681526020016526a121a62aa160d11b8152508160039081620000b59190620006c5565b506004620000c48282620006c5565b505050620000e1620000db6200041860201b60201c565b6200041c565b737a250d5630b4cf539739df2c5dacb4c659f2488d60808190526040805163c45a015560e01b8152905163c45a0155916004808201926020929091908290030181865afa15801562000137573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200015d919062000791565b6001600160a01b031663c9c65396306080516001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001ad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001d3919062000791565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801562000221573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000247919062000791565b600680546001600160a01b0319166001600160a01b03929092169182179055620002739060016200046e565b6006546001600160a01b039081166000908152601160205260408082208054600160ff199182168117909255608051909416835291208054909216179055600880546001600160a01b03191633908117909155600780546001600160a01b0319166001600160a01b03928316179055600554620002f491165b6001620004c2565b62000301306001620004c2565b6200030c33620002ec565b6200031b61dead6001620004c2565b62000356620003326005546001600160a01b031690565b6001600160a01b03166000908152601160205260409020805460ff19166001179055565b306000908152601160205260409020805460ff191660011790556200037b3362000332565b61dead60005260116020527f97847ee99463795296047093514439c3127772df3715e628aa85601cf8541716805460ff19166001179055600954600090620003d490606490620003cd90605862000521565b9062000538565b600954909150600090620003e9908362000546565b60075490915062000404906001600160a01b03168362000554565b62000410308262000554565b505062000842565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216600081815260126020526040808220805460ff191685151590811790915590519092917fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab91a35050565b6001600160a01b038216600081815260106020908152604091829020805460ff191685151590811790915591519182527f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df7910160405180910390a25050565b60006200052f8284620007d9565b90505b92915050565b60006200052f8284620007f3565b60006200052f828462000816565b6001600160a01b038216620005af5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620005c391906200082c565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200064a57607f821691505b6020821081036200066b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200061a576000816000526020600020601f850160051c810160208610156200069c5750805b601f850160051c820191505b81811015620006bd57828155600101620006a8565b505050505050565b81516001600160401b03811115620006e157620006e16200061f565b620006f981620006f2845462000635565b8462000671565b602080601f831160018114620007315760008415620007185750858301515b600019600386901b1c1916600185901b178555620006bd565b600085815260208120601f198616915b82811015620007625788860151825594840194600190910190840162000741565b5085821015620007815787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215620007a457600080fd5b81516001600160a01b0381168114620007bc57600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417620005325762000532620007c3565b6000826200081157634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115620005325762000532620007c3565b80820180821115620005325762000532620007c3565b608051611cf4620008736000396000818161038b01528181611505015281816115be01526115fd0152611cf46000f3fe6080604052600436106101db5760003560e01c806389291a8f11610102578063c8c8ebe411610095578063e2f4560511610064578063e2f456051461055a578063f2fde38b14610570578063f8b45b0514610590578063fb201b1d146105a657600080fd5b8063c8c8ebe4146104f8578063cf9522fd1461050e578063dd62ed3e14610524578063dd8546521461054457600080fd5b8063a457c2d7116100d1578063a457c2d714610478578063a9059cbb14610498578063afa4f3b2146104b8578063b70143c9146104d857600080fd5b806389291a8f146104105780638da5cb5b1461042557806395d89b41146104435780639a7a23d61461045857600080fd5b8063313ce5671161017a57806352f7c9881161014957806352f7c98814610359578063583e05681461037957806370a08231146103c5578063715018a6146103fb57600080fd5b8063313ce567146102c4578063346cc7be146102e057806339509351146103005780634fbee1931461032057600080fd5b806318160ddd116101b657806318160ddd1461025857806323b872dd14610277578063284f289914610297578063311028af146102ae57600080fd5b806299d386146101e757806306fdde0314610216578063095ea7b31461023857600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50600d546102019060ff1681565b60405190151581526020015b60405180910390f35b34801561022257600080fd5b5061022b6105bb565b60405161020d919061190d565b34801561024457600080fd5b50610201610253366004611971565b61064d565b34801561026457600080fd5b506002545b60405190815260200161020d565b34801561028357600080fd5b5061020161029236600461199d565b610667565b3480156102a357600080fd5b506102ac61068b565b005b3480156102ba57600080fd5b5061026960095481565b3480156102d057600080fd5b506040516012815260200161020d565b3480156102ec57600080fd5b506102ac6102fb3660046119de565b6106a9565b34801561030c57600080fd5b5061020161031b366004611971565b6107ff565b34801561032c57600080fd5b5061020161033b3660046119de565b6001600160a01b031660009081526010602052604090205460ff1690565b34801561036557600080fd5b506102ac6103743660046119fb565b610821565b34801561038557600080fd5b506103ad7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161020d565b3480156103d157600080fd5b506102696103e03660046119de565b6001600160a01b031660009081526020819052604090205490565b34801561040757600080fd5b506102ac61088b565b34801561041c57600080fd5b506102ac61089f565b34801561043157600080fd5b506005546001600160a01b03166103ad565b34801561044f57600080fd5b5061022b610937565b34801561046457600080fd5b506102ac610473366004611a2b565b610946565b34801561048457600080fd5b50610201610493366004611971565b6109e0565b3480156104a457600080fd5b506102016104b3366004611971565b610a5b565b3480156104c457600080fd5b506102ac6104d3366004611a64565b610a69565b3480156104e457600080fd5b506102ac6104f3366004611a64565b610a89565b34801561050457600080fd5b50610269600a5481565b34801561051a57600080fd5b50610269600f5481565b34801561053057600080fd5b5061026961053f366004611a7d565b610b5f565b34801561055057600080fd5b50610269600e5481565b34801561056657600080fd5b50610269600c5481565b34801561057c57600080fd5b506102ac61058b3660046119de565b610b8a565b34801561059c57600080fd5b50610269600b5481565b3480156105b257600080fd5b506102ac610c00565b6060600380546105ca90611aab565b80601f01602080910402602001604051908101604052809291908181526020018280546105f690611aab565b80156106435780601f1061061857610100808354040283529160200191610643565b820191906000526020600020905b81548152906001019060200180831161062657829003601f168201915b5050505050905090565b60003361065b818585610c17565b60019150505b92915050565b600033610675858285610d3b565b610680858585610daf565b506001949350505050565b6106936113ae565b600061069e60025490565b600a819055600b5550565b6007546001600160a01b0316336001600160a01b0316146106c957600080fd5b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610712573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107369190611ae5565b9050600081116107825760405162461bcd60e51b81526020600482015260126024820152712737903a37b5b2b739903a379031b632b0b960711b60448201526064015b60405180910390fd5b60075460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390529083169063a9059cbb906044016020604051808303816000875af11580156107d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f99190611afe565b50505050565b60003361065b8185856108128383610b5f565b61081c9190611b31565b610c17565b6108296113ae565b6028821115801561083b575060328111155b6108805760405162461bcd60e51b8152602060048201526016602482015275466565732063616e6e6f74206578636565642039392560501b6044820152606401610779565b600e91909155600f55565b6108936113ae565b61089d6000611408565b565b6007546001600160a01b0316336001600160a01b0316146108bf57600080fd5b600047116109085760405162461bcd60e51b81526020600482015260166024820152752a37b5b2b71d1037379022aa24103a379031b632b0b960511b6044820152606401610779565b60405133904780156108fc02916000818181858888f19350505050158015610934573d6000803e3d6000fd5b50565b6060600480546105ca90611aab565b61094e6113ae565b6006546001600160a01b03908116908316036109d25760405162461bcd60e51b815260206004820152603960248201527f54686520706169722063616e6e6f742062652072656d6f7665642066726f6d2060448201527f6175746f6d617465644d61726b65744d616b65725061697273000000000000006064820152608401610779565b6109dc828261145a565b5050565b600033816109ee8286610b5f565b905083811015610a4e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610779565b6106808286868403610c17565b60003361065b818585610daf565b610a716113ae565b610a8381670de0b6b3a7640000611b44565b600c5550565b6007546001600160a01b0316336001600160a01b031614610aa957600080fd5b6000610ab460025490565b306000908152602081905260408120549192506064849003610ad7575080610afa565b6064610ae38585611b44565b610aed9190611b5b565b905081811115610afa5750805b81811115610b565760405162461bcd60e51b8152602060048201526024808201527f5377617020616d6f756e74206578636565647320636f6e74726163742062616c604482015263616e636560e01b6064820152608401610779565b6107f9816114ae565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610b926113ae565b6001600160a01b038116610bf75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610779565b61093481611408565b610c086113ae565b600d805460ff19166001179055565b6001600160a01b038316610c795760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610779565b6001600160a01b038216610cda5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610779565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610d478484610b5f565b905060001981146107f95781811015610da25760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610779565b6107f98484848403610c17565b6001600160a01b038316610dd55760405162461bcd60e51b815260040161077990611b7d565b6001600160a01b038216610dfb5760405162461bcd60e51b815260040161077990611bc2565b80600003610e1457610e0f83836000611675565b505050565b6001600160a01b03831660009081526012602052604081205460ff16158015610e5657506001600160a01b03831660009081526012602052604090205460ff16155b9050610e6a6005546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610e9957506005546001600160a01b03848116911614155b8015610ead57506001600160a01b03831615155b8015610ec457506001600160a01b03831661dead14155b8015610eda5750600854600160a01b900460ff16155b156111d357600d5460ff16610f6d576001600160a01b03841660009081526010602052604090205460ff1680610f2857506001600160a01b03831660009081526010602052604090205460ff165b610f6d5760405162461bcd60e51b81526020600482015260166024820152752a3930b234b7339034b9903737ba1030b1ba34bb329760511b6044820152606401610779565b6001600160a01b03841660009081526012602052604090205460ff168015610fae57506001600160a01b03831660009081526011602052604090205460ff16155b1561109257600a548211156110235760405162461bcd60e51b815260206004820152603560248201527f427579207472616e7366657220616d6f756e742065786365656473207468652060448201527436b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760591b6064820152608401610779565b600b546001600160a01b0384166000908152602081905260409020546110499084611b31565b111561108d5760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610779565b6111d3565b6001600160a01b03831660009081526012602052604090205460ff1680156110d357506001600160a01b03841660009081526011602052604090205460ff16155b1561114957600a5482111561108d5760405162461bcd60e51b815260206004820152603660248201527f53656c6c207472616e7366657220616d6f756e742065786365656473207468656044820152751036b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760511b6064820152608401610779565b6001600160a01b03831660009081526011602052604090205460ff166111d357600b546001600160a01b03841660009081526020819052604090205461118f9084611b31565b11156111d35760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610779565b306000908152602081905260408120549081158015906111f1575082155b905080801561120a5750600854600160a01b900460ff16155b801561122f57506001600160a01b03861660009081526012602052604090205460ff16155b801561125457506001600160a01b03861660009081526010602052604090205460ff16155b801561127957506001600160a01b03851660009081526010602052604090205460ff16155b156112a8576008805460ff60a01b1916600160a01b17905561129a8461179f565b6008805460ff60a01b191690555b600854600090600160a01b900460ff161580156112c3575083155b6001600160a01b03881660009081526010602052604090205490915060ff168061130557506001600160a01b03861660009081526010602052604090205460ff165b1561130e575060005b60008115611399576001600160a01b03871660009081526012602052604090205460ff161561135e576113576064611351600f54896118ee90919063ffffffff16565b90611901565b905061137b565b6113786064611351600e54896118ee90919063ffffffff16565b90505b801561138c5761138c883083611675565b6113968187611c05565b95505b6113a4888888611675565b5050505050505050565b6005546001600160a01b0316331461089d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610779565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216600081815260126020526040808220805460ff191685151590811790915590519092917fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab91a35050565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106114e3576114e3611c18565b60200260200101906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611561573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115859190611c2e565b8160018151811061159857611598611c18565b60200260200101906001600160a01b031690816001600160a01b0316815250506115e3307f000000000000000000000000000000000000000000000000000000000000000084610c17565b60085460405163791ac94760e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169263791ac9479261163f928792600092889291909116904290600401611c4b565b600060405180830381600087803b15801561165957600080fd5b505af115801561166d573d6000803e3d6000fd5b505050505050565b6001600160a01b03831661169b5760405162461bcd60e51b815260040161077990611b7d565b6001600160a01b0382166116c15760405162461bcd60e51b815260040161077990611bc2565b6001600160a01b038316600090815260208190526040902054818110156117395760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610779565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36107f9565b30600090815260208190526040812054908181036117bc57505050565b600f54600e546117cc9190611b31565b600003611838576000821180156117e45750600c5482105b156117f05750806118e5565b600061180c6064611351600f54876118ee90919063ffffffff16565b90506118188185611c05565b9350600c5484111561182e57600c549150611832565b8391505b506118e5565b6000821180156118545750600c54611851906005611901565b82105b1561185e57505050565b60008211801561187a5750600c54611877906005611901565b82115b80156118875750600c5482105b156118a157600c5461189a906005611901565b90506118e5565b60006118bd6064611351600f54876118ee90919063ffffffff16565b90506118c98185611c05565b9350600c548411156118df57600c5491506118e3565b8391505b505b610e0f816114ae565b60006118fa8284611b44565b9392505050565b60006118fa8284611b5b565b60006020808352835180602085015260005b8181101561193b5785810183015185820160400152820161191f565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b038116811461093457600080fd5b6000806040838503121561198457600080fd5b823561198f8161195c565b946020939093013593505050565b6000806000606084860312156119b257600080fd5b83356119bd8161195c565b925060208401356119cd8161195c565b929592945050506040919091013590565b6000602082840312156119f057600080fd5b81356118fa8161195c565b60008060408385031215611a0e57600080fd5b50508035926020909101359150565b801515811461093457600080fd5b60008060408385031215611a3e57600080fd5b8235611a498161195c565b91506020830135611a5981611a1d565b809150509250929050565b600060208284031215611a7657600080fd5b5035919050565b60008060408385031215611a9057600080fd5b8235611a9b8161195c565b91506020830135611a598161195c565b600181811c90821680611abf57607f821691505b602082108103611adf57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215611af757600080fd5b5051919050565b600060208284031215611b1057600080fd5b81516118fa81611a1d565b634e487b7160e01b600052601160045260246000fd5b8082018082111561066157610661611b1b565b808202811582820484141761066157610661611b1b565b600082611b7857634e487b7160e01b600052601260045260246000fd5b500490565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b8181038181111561066157610661611b1b565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611c4057600080fd5b81516118fa8161195c565b600060a08201878352602087602085015260a0604085015281875180845260c08601915060208901935060005b81811015611c9d5784516001600160a01b031683529383019391830191600101611c78565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220605f80474180cf84725c6186e27cd4c1265dd3eb970f5d1dd382fbe04d24ea0d64736f6c63430008170033 | 6080604052600436106101db5760003560e01c806389291a8f11610102578063c8c8ebe411610095578063e2f4560511610064578063e2f456051461055a578063f2fde38b14610570578063f8b45b0514610590578063fb201b1d146105a657600080fd5b8063c8c8ebe4146104f8578063cf9522fd1461050e578063dd62ed3e14610524578063dd8546521461054457600080fd5b8063a457c2d7116100d1578063a457c2d714610478578063a9059cbb14610498578063afa4f3b2146104b8578063b70143c9146104d857600080fd5b806389291a8f146104105780638da5cb5b1461042557806395d89b41146104435780639a7a23d61461045857600080fd5b8063313ce5671161017a57806352f7c9881161014957806352f7c98814610359578063583e05681461037957806370a08231146103c5578063715018a6146103fb57600080fd5b8063313ce567146102c4578063346cc7be146102e057806339509351146103005780634fbee1931461032057600080fd5b806318160ddd116101b657806318160ddd1461025857806323b872dd14610277578063284f289914610297578063311028af146102ae57600080fd5b806299d386146101e757806306fdde0314610216578063095ea7b31461023857600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50600d546102019060ff1681565b60405190151581526020015b60405180910390f35b34801561022257600080fd5b5061022b6105bb565b60405161020d919061190d565b34801561024457600080fd5b50610201610253366004611971565b61064d565b34801561026457600080fd5b506002545b60405190815260200161020d565b34801561028357600080fd5b5061020161029236600461199d565b610667565b3480156102a357600080fd5b506102ac61068b565b005b3480156102ba57600080fd5b5061026960095481565b3480156102d057600080fd5b506040516012815260200161020d565b3480156102ec57600080fd5b506102ac6102fb3660046119de565b6106a9565b34801561030c57600080fd5b5061020161031b366004611971565b6107ff565b34801561032c57600080fd5b5061020161033b3660046119de565b6001600160a01b031660009081526010602052604090205460ff1690565b34801561036557600080fd5b506102ac6103743660046119fb565b610821565b34801561038557600080fd5b506103ad7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b6040516001600160a01b03909116815260200161020d565b3480156103d157600080fd5b506102696103e03660046119de565b6001600160a01b031660009081526020819052604090205490565b34801561040757600080fd5b506102ac61088b565b34801561041c57600080fd5b506102ac61089f565b34801561043157600080fd5b506005546001600160a01b03166103ad565b34801561044f57600080fd5b5061022b610937565b34801561046457600080fd5b506102ac610473366004611a2b565b610946565b34801561048457600080fd5b50610201610493366004611971565b6109e0565b3480156104a457600080fd5b506102016104b3366004611971565b610a5b565b3480156104c457600080fd5b506102ac6104d3366004611a64565b610a69565b3480156104e457600080fd5b506102ac6104f3366004611a64565b610a89565b34801561050457600080fd5b50610269600a5481565b34801561051a57600080fd5b50610269600f5481565b34801561053057600080fd5b5061026961053f366004611a7d565b610b5f565b34801561055057600080fd5b50610269600e5481565b34801561056657600080fd5b50610269600c5481565b34801561057c57600080fd5b506102ac61058b3660046119de565b610b8a565b34801561059c57600080fd5b50610269600b5481565b3480156105b257600080fd5b506102ac610c00565b6060600380546105ca90611aab565b80601f01602080910402602001604051908101604052809291908181526020018280546105f690611aab565b80156106435780601f1061061857610100808354040283529160200191610643565b820191906000526020600020905b81548152906001019060200180831161062657829003601f168201915b5050505050905090565b60003361065b818585610c17565b60019150505b92915050565b600033610675858285610d3b565b610680858585610daf565b506001949350505050565b6106936113ae565b600061069e60025490565b600a819055600b5550565b6007546001600160a01b0316336001600160a01b0316146106c957600080fd5b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610712573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107369190611ae5565b9050600081116107825760405162461bcd60e51b81526020600482015260126024820152712737903a37b5b2b739903a379031b632b0b960711b60448201526064015b60405180910390fd5b60075460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390529083169063a9059cbb906044016020604051808303816000875af11580156107d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f99190611afe565b50505050565b60003361065b8185856108128383610b5f565b61081c9190611b31565b610c17565b6108296113ae565b6028821115801561083b575060328111155b6108805760405162461bcd60e51b8152602060048201526016602482015275466565732063616e6e6f74206578636565642039392560501b6044820152606401610779565b600e91909155600f55565b6108936113ae565b61089d6000611408565b565b6007546001600160a01b0316336001600160a01b0316146108bf57600080fd5b600047116109085760405162461bcd60e51b81526020600482015260166024820152752a37b5b2b71d1037379022aa24103a379031b632b0b960511b6044820152606401610779565b60405133904780156108fc02916000818181858888f19350505050158015610934573d6000803e3d6000fd5b50565b6060600480546105ca90611aab565b61094e6113ae565b6006546001600160a01b03908116908316036109d25760405162461bcd60e51b815260206004820152603960248201527f54686520706169722063616e6e6f742062652072656d6f7665642066726f6d2060448201527f6175746f6d617465644d61726b65744d616b65725061697273000000000000006064820152608401610779565b6109dc828261145a565b5050565b600033816109ee8286610b5f565b905083811015610a4e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610779565b6106808286868403610c17565b60003361065b818585610daf565b610a716113ae565b610a8381670de0b6b3a7640000611b44565b600c5550565b6007546001600160a01b0316336001600160a01b031614610aa957600080fd5b6000610ab460025490565b306000908152602081905260408120549192506064849003610ad7575080610afa565b6064610ae38585611b44565b610aed9190611b5b565b905081811115610afa5750805b81811115610b565760405162461bcd60e51b8152602060048201526024808201527f5377617020616d6f756e74206578636565647320636f6e74726163742062616c604482015263616e636560e01b6064820152608401610779565b6107f9816114ae565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610b926113ae565b6001600160a01b038116610bf75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610779565b61093481611408565b610c086113ae565b600d805460ff19166001179055565b6001600160a01b038316610c795760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610779565b6001600160a01b038216610cda5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610779565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610d478484610b5f565b905060001981146107f95781811015610da25760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610779565b6107f98484848403610c17565b6001600160a01b038316610dd55760405162461bcd60e51b815260040161077990611b7d565b6001600160a01b038216610dfb5760405162461bcd60e51b815260040161077990611bc2565b80600003610e1457610e0f83836000611675565b505050565b6001600160a01b03831660009081526012602052604081205460ff16158015610e5657506001600160a01b03831660009081526012602052604090205460ff16155b9050610e6a6005546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610e9957506005546001600160a01b03848116911614155b8015610ead57506001600160a01b03831615155b8015610ec457506001600160a01b03831661dead14155b8015610eda5750600854600160a01b900460ff16155b156111d357600d5460ff16610f6d576001600160a01b03841660009081526010602052604090205460ff1680610f2857506001600160a01b03831660009081526010602052604090205460ff165b610f6d5760405162461bcd60e51b81526020600482015260166024820152752a3930b234b7339034b9903737ba1030b1ba34bb329760511b6044820152606401610779565b6001600160a01b03841660009081526012602052604090205460ff168015610fae57506001600160a01b03831660009081526011602052604090205460ff16155b1561109257600a548211156110235760405162461bcd60e51b815260206004820152603560248201527f427579207472616e7366657220616d6f756e742065786365656473207468652060448201527436b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760591b6064820152608401610779565b600b546001600160a01b0384166000908152602081905260409020546110499084611b31565b111561108d5760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610779565b6111d3565b6001600160a01b03831660009081526012602052604090205460ff1680156110d357506001600160a01b03841660009081526011602052604090205460ff16155b1561114957600a5482111561108d5760405162461bcd60e51b815260206004820152603660248201527f53656c6c207472616e7366657220616d6f756e742065786365656473207468656044820152751036b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760511b6064820152608401610779565b6001600160a01b03831660009081526011602052604090205460ff166111d357600b546001600160a01b03841660009081526020819052604090205461118f9084611b31565b11156111d35760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610779565b306000908152602081905260408120549081158015906111f1575082155b905080801561120a5750600854600160a01b900460ff16155b801561122f57506001600160a01b03861660009081526012602052604090205460ff16155b801561125457506001600160a01b03861660009081526010602052604090205460ff16155b801561127957506001600160a01b03851660009081526010602052604090205460ff16155b156112a8576008805460ff60a01b1916600160a01b17905561129a8461179f565b6008805460ff60a01b191690555b600854600090600160a01b900460ff161580156112c3575083155b6001600160a01b03881660009081526010602052604090205490915060ff168061130557506001600160a01b03861660009081526010602052604090205460ff165b1561130e575060005b60008115611399576001600160a01b03871660009081526012602052604090205460ff161561135e576113576064611351600f54896118ee90919063ffffffff16565b90611901565b905061137b565b6113786064611351600e54896118ee90919063ffffffff16565b90505b801561138c5761138c883083611675565b6113968187611c05565b95505b6113a4888888611675565b5050505050505050565b6005546001600160a01b0316331461089d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610779565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216600081815260126020526040808220805460ff191685151590811790915590519092917fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab91a35050565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106114e3576114e3611c18565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611561573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115859190611c2e565b8160018151811061159857611598611c18565b60200260200101906001600160a01b031690816001600160a01b0316815250506115e3307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84610c17565b60085460405163791ac94760e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81169263791ac9479261163f928792600092889291909116904290600401611c4b565b600060405180830381600087803b15801561165957600080fd5b505af115801561166d573d6000803e3d6000fd5b505050505050565b6001600160a01b03831661169b5760405162461bcd60e51b815260040161077990611b7d565b6001600160a01b0382166116c15760405162461bcd60e51b815260040161077990611bc2565b6001600160a01b038316600090815260208190526040902054818110156117395760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610779565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36107f9565b30600090815260208190526040812054908181036117bc57505050565b600f54600e546117cc9190611b31565b600003611838576000821180156117e45750600c5482105b156117f05750806118e5565b600061180c6064611351600f54876118ee90919063ffffffff16565b90506118188185611c05565b9350600c5484111561182e57600c549150611832565b8391505b506118e5565b6000821180156118545750600c54611851906005611901565b82105b1561185e57505050565b60008211801561187a5750600c54611877906005611901565b82115b80156118875750600c5482105b156118a157600c5461189a906005611901565b90506118e5565b60006118bd6064611351600f54876118ee90919063ffffffff16565b90506118c98185611c05565b9350600c548411156118df57600c5491506118e3565b8391505b505b610e0f816114ae565b60006118fa8284611b44565b9392505050565b60006118fa8284611b5b565b60006020808352835180602085015260005b8181101561193b5785810183015185820160400152820161191f565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b038116811461093457600080fd5b6000806040838503121561198457600080fd5b823561198f8161195c565b946020939093013593505050565b6000806000606084860312156119b257600080fd5b83356119bd8161195c565b925060208401356119cd8161195c565b929592945050506040919091013590565b6000602082840312156119f057600080fd5b81356118fa8161195c565b60008060408385031215611a0e57600080fd5b50508035926020909101359150565b801515811461093457600080fd5b60008060408385031215611a3e57600080fd5b8235611a498161195c565b91506020830135611a5981611a1d565b809150509250929050565b600060208284031215611a7657600080fd5b5035919050565b60008060408385031215611a9057600080fd5b8235611a9b8161195c565b91506020830135611a598161195c565b600181811c90821680611abf57607f821691505b602082108103611adf57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215611af757600080fd5b5051919050565b600060208284031215611b1057600080fd5b81516118fa81611a1d565b634e487b7160e01b600052601160045260246000fd5b8082018082111561066157610661611b1b565b808202811582820484141761066157610661611b1b565b600082611b7857634e487b7160e01b600052601260045260246000fd5b500490565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b8181038181111561066157610661611b1b565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611c4057600080fd5b81516118fa8161195c565b600060a08201878352602087602085015260a0604085015281875180845260c08601915060208901935060005b81811015611c9d5784516001600160a01b031683529383019391830191600101611c78565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220605f80474180cf84725c6186e27cd4c1265dd3eb970f5d1dd382fbe04d24ea0d64736f6c63430008170033 | {{
"language": "Solidity",
"sources": {
"src/MBCLUB.sol": {
"content": "\n/*\nPepe, Brett, Landwolf, and Andy stumbled upon a hidden, glowing cave in a forgotten forest. They drank from a mysterious cauldron, instantly transforming into bizarre, grotesque forms... \nMeet their new identities: the Mutant Boy's Club.\n\nLAUNCHING FRIDAY 12th JULY - 1pm UTC\n\nhttps://mutantboysclub.xyz/\nhttps://x.com/boysclubmutant\nhttps://t.me/mutantboysclub\n\nBe aware of the many copycats/scams, the official CA will be deployed by 0xbfbCdD04DDa68cfCFBa2d687fFCe365fD46d5F5F\n*/\n\npragma solidity ^0.8.23;\npragma experimental ABIEncoderV2;\n\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n\ninterface IUniswapV2Router02 {\n function factory() external pure returns (address);\n\n function WETH() external pure returns (address);\n\n function addLiquidity(\n address tokenA,\n address tokenB,\n uint256 amountADesired,\n uint256 amountBDesired,\n uint256 amountAMin,\n uint256 amountBMin,\n address to,\n uint256 deadline\n )\n external\n returns (\n uint256 amountA,\n uint256 amountB,\n uint256 liquidity\n );\n\n function addLiquidityETH(\n address token,\n uint256 amountTokenDesired,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n )\n external\n payable\n returns (\n uint256 amountToken,\n uint256 amountETH,\n uint256 liquidity\n );\n\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n}\n\ninterface IUniswapV2Pair {\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n function name() external pure returns (string memory);\n\n function symbol() external pure returns (string memory);\n\n function decimals() external pure returns (uint8);\n\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address owner) external view returns (uint256);\n\n function allowance(address owner, address spender)\n external\n view\n returns (uint256);\n\n function approve(address spender, uint256 value) external returns (bool);\n\n function transfer(address to, uint256 value) external returns (bool);\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) external returns (bool);\n\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n\n function PERMIT_TYPEHASH() external pure returns (bytes32);\n\n function nonces(address owner) external view returns (uint256);\n\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n event Mint(address indexed sender, uint256 amount0, uint256 amount1);\n\n event Swap(\n address indexed sender,\n uint256 amount0In,\n uint256 amount1In,\n uint256 amount0Out,\n uint256 amount1Out,\n address indexed to\n );\n event Sync(uint112 reserve0, uint112 reserve1);\n\n function MINIMUM_LIQUIDITY() external pure returns (uint256);\n\n function factory() external view returns (address);\n\n function token0() external view returns (address);\n\n function token1() external view returns (address);\n\n function getReserves()\n external\n view\n returns (\n uint112 reserve0,\n uint112 reserve1,\n uint32 blockTimestampLast\n );\n\n function price0CumulativeLast() external view returns (uint256);\n\n function price1CumulativeLast() external view returns (uint256);\n\n function kLast() external view returns (uint256);\n\n function mint(address to) external returns (uint256 liquidity);\n\n function swap(\n uint256 amount0Out,\n uint256 amount1Out,\n address to,\n bytes calldata data\n ) external;\n\n function skim(address to) external;\n\n function sync() external;\n\n function initialize(address, address) external;\n}\n\ninterface IUniswapV2Factory {\n event PairCreated(\n address indexed token0,\n address indexed token1,\n address pair,\n uint256\n );\n\n function feeTo() external view returns (address);\n\n function feeToSetter() external view returns (address);\n\n function getPair(address tokenA, address tokenB)\n external\n view\n returns (address pair);\n\n function allPairs(uint256) external view returns (address pair);\n\n function allPairsLength() external view returns (uint256);\n\n function createPair(address tokenA, address tokenB)\n external\n returns (address pair);\n\n function setFeeTo(address) external;\n\n function setFeeToSetter(address) external;\n}\n\nlibrary SafeMath {\n\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n return a + b;\n }\n\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return a - b;\n }\n\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n }\n\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return a / b;\n }\n\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return a % b;\n }\n\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n unchecked {\n require(b <= a, errorMessage);\n return a - b;\n }\n }\n\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a / b;\n }\n }\n\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a % b;\n }\n }\n}\n\ninterface IERC20 {\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address account) external view returns (uint256);\n\n function transfer(address to, uint256 amount) external returns (bool);\n\n function allowance(address owner, address spender) external view returns (uint256);\n\n function approve(address spender, uint256 amount) external returns (bool);\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n\ninterface IERC20Metadata is IERC20 {\n\n function name() external view returns (string memory);\n function symbol() external view returns (string memory);\n function decimals() external view returns (uint8);\n}\n\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n\ncontract MBCLUB is ERC20, Ownable {\n\n using SafeMath for uint256;\n \n IUniswapV2Router02 public immutable _uniswapV2Router;\n address private uniswapV2Pair;\n address private deployerWallet;\n address private marketingWallet;\n address private constant deadAddress = address(0xdead);\n\n bool private swapping;\n\n string private constant _name = \"Mutant Boys Club\";\n string private constant _symbol = \"MBCLUB\";\n\n uint256 public initialTotalSupply = 420_690_000_000 * 1e18;\n uint256 public maxTransactionAmount = 8_413_800_000 * 1e18;\n uint256 public maxWallet = 8_413_800_000 * 1e18;\n uint256 public swapTokensAtAmount = 4_206_900_000 * 1e18;\n\n bool public enableTrade = false;\n\n uint256 public BuyFee = 20;\n uint256 public SellFee = 35;\n\n mapping(address => bool) private _isExcludedFromFees;\n mapping(address => bool) private _isExcludedMaxTransactionAmount;\n mapping(address => bool) private automatedMarketMakerPairs;\n\n event ExcludeFromFees(address indexed account, bool isExcluded);\n event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);\n\n constructor() ERC20(_name, _symbol) {\n\n _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());\n _setAutomatedMarketMakerPair(address(uniswapV2Pair), true);\n excludeFromMaxTransaction(address(uniswapV2Pair), true);\n excludeFromMaxTransaction(address(_uniswapV2Router), true);\n marketingWallet = payable(_msgSender()); \n \n deployerWallet = payable(_msgSender());\n excludeFromFees(owner(), true);\n excludeFromFees(address(this), true);\n excludeFromFees(address(_msgSender()), true);\n excludeFromFees(address(0xdead), true);\n\n excludeFromMaxTransaction(owner(), true);\n excludeFromMaxTransaction(address(this), true);\n excludeFromMaxTransaction(address(_msgSender()), true);\n excludeFromMaxTransaction(address(0xdead), true);\n\n uint devTx = initialTotalSupply.mul(88).div(100);\n uint remain = initialTotalSupply.sub(devTx);\n\n _mint(deployerWallet, devTx);\n _mint(address(this),remain);\n\n }\n\n receive() external payable {}\n\n function openTrade() external onlyOwner() {\n enableTrade = true;\n }\n\n function excludeFromMaxTransaction(address updAds, bool isEx) private {\n _isExcludedMaxTransactionAmount[updAds] = isEx;\n }\n\n function excludeFromFees(address account, bool excluded) private {\n _isExcludedFromFees[account] = excluded;\n emit ExcludeFromFees(account, excluded);\n }\n\n function setAutomatedMarketMakerPair(address pair, bool value) public onlyOwner {\n require(pair != uniswapV2Pair, \"The pair cannot be removed from automatedMarketMakerPairs\");\n _setAutomatedMarketMakerPair(pair, value);\n }\n\n function _setAutomatedMarketMakerPair(address pair, bool value) private {\n automatedMarketMakerPairs[pair] = value;\n emit SetAutomatedMarketMakerPair(pair, value);\n }\n\n function isExcludedFromFees(address account) public view returns (bool) {\n return _isExcludedFromFees[account];\n }\n\n function _transfer(address from, address to, uint256 amount) internal override {\n\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (amount == 0) {\n super._transfer(from, to, 0);\n return;\n }\n \n bool isTransfer = !automatedMarketMakerPairs[from] && !automatedMarketMakerPairs[to];\n\n if (from != owner() && to != owner() && to != address(0) && to != address(0xdead) && !swapping) {\n\n if (!enableTrade) {\n require(_isExcludedFromFees[from] || _isExcludedFromFees[to], \"Trading is not active.\");\n }\n\n if (automatedMarketMakerPairs[from] && !_isExcludedMaxTransactionAmount[to]) {\n require(amount <= maxTransactionAmount, \"Buy transfer amount exceeds the maxTransactionAmount.\");\n require(amount + balanceOf(to) <= maxWallet, \"Max wallet exceeded\");\n }\n\n else if (automatedMarketMakerPairs[to] && !_isExcludedMaxTransactionAmount[from]) {\n require(amount <= maxTransactionAmount, \"Sell transfer amount exceeds the maxTransactionAmount.\");\n } \n \n else if (!_isExcludedMaxTransactionAmount[to]) {\n require(amount + balanceOf(to) <= maxWallet, \"Max wallet exceeded\");\n }\n \n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool canSwap = contractTokenBalance > 0 && !isTransfer;\n\n if (canSwap && !swapping && !automatedMarketMakerPairs[from] && !_isExcludedFromFees[from] && !_isExcludedFromFees[to]) {\n swapping = true;\n swapBack(amount);\n swapping = false;\n }\n\n bool takeFee = !swapping && !isTransfer;\n\n if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {\n takeFee = false;\n }\n\n uint256 fees = 0;\n\n if (takeFee) {\n if (automatedMarketMakerPairs[to]) {\n fees = amount.mul(SellFee).div(100);\n }\n else {\n fees = amount.mul(BuyFee).div(100);\n }\n\n if (fees > 0) {\n super._transfer(from, address(this), fees);\n }\n amount -= fees;\n }\n super._transfer(from, to, amount);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private {\n\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = _uniswapV2Router.WETH();\n\n _approve(address(this), address(_uniswapV2Router), tokenAmount);\n\n _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n marketingWallet,\n block.timestamp\n );\n }\n\n function removeSkullLimits() external onlyOwner {\n uint256 totalSupplyAmount = totalSupply();\n maxTransactionAmount = totalSupplyAmount;\n maxWallet = totalSupplyAmount;\n }\n\n function clearStuckEth() external {\n require(_msgSender() == deployerWallet);\n require(address(this).balance > 0, \"Token: no ETH to clear\");\n payable(msg.sender).transfer(address(this).balance);\n }\n\n function clearStuckTokens(address tokenAddress) external {\n require(_msgSender() == deployerWallet);\n IERC20 tokenContract = IERC20(tokenAddress);\n uint256 balance = tokenContract.balanceOf(address(this));\n require(balance > 0, \"No tokens to clear\");\n tokenContract.transfer(deployerWallet, balance);\n }\n\n function setFee(uint256 _buyFee, uint256 _sellFee) external onlyOwner {\n require(_buyFee <= 40 && _sellFee <= 50, \"Fees cannot exceed 99%\");\n BuyFee = _buyFee;\n SellFee = _sellFee;\n }\n\n function setSwapTokensAtAmount(uint256 _amount) external onlyOwner {\n swapTokensAtAmount = _amount * (10 ** 18);\n }\n\n function manualSwap(uint256 percent) external {\n require(_msgSender() == deployerWallet);\n uint256 totalSupplyAmount = totalSupply();\n uint256 contractBalance = balanceOf(address(this));\n uint256 tokensToSwap;\n\n if (percent == 100) {\n tokensToSwap = contractBalance;\n } else {\n tokensToSwap = totalSupplyAmount * percent / 100;\n if (tokensToSwap > contractBalance) {\n tokensToSwap = contractBalance;\n }\n }\n\n require(tokensToSwap <= contractBalance, \"Swap amount exceeds contract balance\");\n swapTokensForEth(tokensToSwap);\n }\n\n function swapBack(uint256 tokens) private {\n uint256 contractBalance = balanceOf(address(this));\n uint256 tokensToSwap; \n\n if (contractBalance == 0) {\n return;\n }\n\n if ((BuyFee+SellFee) == 0) {\n\n if(contractBalance > 0 && contractBalance < swapTokensAtAmount) {\n tokensToSwap = contractBalance;\n }\n else {\n uint256 sellFeeTokens = tokens.mul(SellFee).div(100);\n tokens -= sellFeeTokens;\n if (tokens > swapTokensAtAmount) {\n tokensToSwap = swapTokensAtAmount;\n }\n else {\n tokensToSwap = tokens;\n }\n }\n }\n\n else {\n\n if(contractBalance > 0 && contractBalance < swapTokensAtAmount.div(5)) {\n return;\n }\n else if (contractBalance > 0 && contractBalance > swapTokensAtAmount.div(5) && contractBalance < swapTokensAtAmount) {\n tokensToSwap = swapTokensAtAmount.div(5);\n }\n else {\n uint256 sellFeeTokens = tokens.mul(SellFee).div(100);\n tokens -= sellFeeTokens;\n if (tokens > swapTokensAtAmount) {\n tokensToSwap = swapTokensAtAmount;\n } else {\n tokensToSwap = tokens;\n }\n }\n }\n swapTokensForEth(tokensToSwap);\n }\n\n \n}"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {}
}
}} |
1 | 20,290,385 | bf18234b2e088c68216324ca44a1f9df243889c19ec33c6e00639ba34266fcb6 | bafca5d989a6d88ffd59f376f19881072e5980b09a2ff0f96e762d2ce67f08b4 | bfbcdd04dda68cfcfba2d687ffce365fd46d5f5f | 5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f | a6d4a2cb45755aee31d62c2c012e2eab1bebdd5e | 60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429 | 608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032 | // File: contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/interfaces/IUniswapV2ERC20.sol
pragma solidity >=0.5.0;
interface IUniswapV2ERC20 {
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;
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/UniswapV2ERC20.sol
pragma solidity =0.5.16;
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// File: contracts/libraries/Math.sol
pragma solidity =0.5.16;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// File: contracts/libraries/UQ112x112.sol
pragma solidity =0.5.16;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view 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);
}
// File: contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/interfaces/IUniswapV2Callee.sol
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// File: contracts/UniswapV2Pair.sol
pragma solidity =0.5.16;
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
}
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);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(5).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = IERC20(_token0).balanceOf(address(this));
uint balance1 = IERC20(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
} |
1 | 20,290,386 | 262139f90d57f766e5957c0bbec0a0127a4aa23db743d1a198665a8492b7cf86 | 6260d848b9f0cbe19eade124d6831a20b37a4a7a422ee609ac40750d1f725eb0 | a7fb5ca286fc3fd67525629048a4de3ba24cba2e | c77ad0a71008d7094a62cfbd250a2eb2afdf2776 | b1b843122b2afad569444f1ee50234585d4ca176 | 608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe | ||
1 | 20,290,386 | 262139f90d57f766e5957c0bbec0a0127a4aa23db743d1a198665a8492b7cf86 | ee5a4723a908c04b5d24089c48d3c3abf6379fe1cbac37d9f1d79ec5144f2973 | d2cbd34053935b874ce92c16d0e016a6aaf39ad0 | d2cbd34053935b874ce92c16d0e016a6aaf39ad0 | b1a79f1360b26f412e19520a7c953f2fcb320483 | 6080604052600a805461ffff1916610101178155600c805460ff191690556000600d55620000309060099062000a38565b6200004090633b9aca0062000af9565b6010819055620000539060001962000b53565b620000619060001962000b1b565b60115566071afd498d0000601255662386f26fc10000601381905560145566470de4df820000601555601780546001600160a01b031990811673d2cbd34053935b874ce92c16d0e016a6aaf39ad0908117909255601880548216831790556019805482167377537d5fcff6f92fa22db51a590f1389eb4a935c178155601a805490921690921790556040805160a080820183526000808352602080840186905283850182905260608085018390526080948501839052601b839055601c879055601d839055601e839055601f83905585519384018652828452838201879052948301829052938201819052910181905290819055602191909155602281905560238190556024553480156200017557600080fd5b50620001813362000545565b600180547377537d5fcff6f92fa22db51a590f1389eb4a935c6001600160a01b031991821617909155600e8054737a250d5630b4cf539739df2c5dacb4c659f2488d9216821790556040805163c45a015560e01b81529051600091839163c45a015591600480820192602092909190829003018186803b1580156200020557600080fd5b505afa1580156200021a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002409190620009ad565b6001600160a01b031663c9c6539630846001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156200028957600080fd5b505afa1580156200029e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002c49190620009ad565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156200030d57600080fd5b505af115801562000322573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003489190620009ad565b600e80546001600160a01b038086166001600160a01b031992831617909255600f80549284169290911682179055909150620003849062000595565b601154601980546001600160a01b039081166000908152600260209081526040808320959095553082526005908190528482208054600160ff19918216811790925594549093168252938120805490931682179092559190620003e66200072a565b6001600160a01b03908116825260208083019390935260409182016000908120805495151560ff199687161790556017548216815260058452828120805486166001908117909155601854831682528382208054871682179055601a548316825283822080548716821790553082526007948590528382208054871682179055601954909216815291822080549094168117909355620004856200072a565b6001600160a01b03908116825260208083019390935260409182016000908120805495151560ff19968716179055600f548216815260078452828120805486166001908117909155601754831682528382208054871682179055601854831682528382208054871682179055601a548316825283822080549096161790945560195460105492519283521692917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505062000bac565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b33620005a06200072a565b6001600160a01b031614620005fc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b03811660009081526006602052604090205460ff1615620006675760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401620005f3565b6001600160a01b03811660009081526002602052604090205415620006c4576001600160a01b038116600090815260026020526040902054620006aa9062000761565b6001600160a01b0382166000908152600360205260409020555b6001600160a01b03166000818152600660205260408120805460ff191660019081179091556009805491820181559091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319169091179055565b6001546000906001600160a01b03163314156200075157506001546001600160a01b031690565b506000546001600160a01b031690565b6000601154821115620007ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401620005f3565b6000620007d6620007eb565b9050620007e48184620009d8565b9392505050565b60008080620007f962000811565b90925090506200080a8183620009d8565b9250505090565b6011546010546000918291825b600954811015620009795782600260006009848154811062000844576200084462000b96565b60009182526020808320909101546001600160a01b031683528201929092526040019020541180620008b357508160036000600984815481106200088c576200088c62000b96565b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15620008ca57601154601054945094505050509091565b6002600060098381548110620008e457620008e462000b96565b60009182526020808320909101546001600160a01b0316835282019290925260400190205462000915908462000b1b565b9250600360006009838154811062000931576200093162000b96565b60009182526020808320909101546001600160a01b0316835282019290925260400190205462000962908362000b1b565b915080620009708162000b35565b9150506200081e565b506010546011546200098c9190620009d8565b821015620009a4576011546010549350935050509091565b90939092509050565b600060208284031215620009c057600080fd5b81516001600160a01b0381168114620007e457600080fd5b600082620009ea57620009ea62000b80565b500490565b600181815b8085111562000a3057816000190482111562000a145762000a1462000b6a565b8085161562000a2257918102915b93841c9390800290620009f4565b509250929050565b6000620007e460ff84168360008262000a545750600162000af3565b8162000a635750600062000af3565b816001811462000a7c576002811462000a875762000aa7565b600191505062000af3565b60ff84111562000a9b5762000a9b62000b6a565b50506001821b62000af3565b5060208310610133831016604e8410600b841016171562000acc575081810a62000af3565b62000ad88383620009ef565b806000190482111562000aef5762000aef62000b6a565b0290505b92915050565b600081600019048311821515161562000b165762000b1662000b6a565b500290565b60008282101562000b305762000b3062000b6a565b500390565b600060001982141562000b4c5762000b4c62000b6a565b5060010190565b60008262000b655762000b6562000b80565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b613dd88062000bbc6000396000f3fe6080604052600436106103a65760003560e01c8063715018a6116101e7578063aacebbe31161010d578063e2f45605116100a0578063f023f5731161006f578063f023f57314610b64578063f2fde38b14610b84578063f66895a314610ba4578063f887ea4014610bcb57600080fd5b8063e2f4560514610af4578063e517f2b914610b0a578063ea2f0b3714610b2a578063ee36e35914610b4a57600080fd5b8063d257b34f116100dc578063d257b34f14610a58578063d2ce0db214610a78578063d8672e5114610a8e578063dd62ed3e14610aae57600080fd5b8063aacebbe3146109d8578063b5c57145146109f8578063c04a541414610a18578063c791fc5414610a3857600080fd5b8063924de9b7116101855780639e252f00116101545780639e252f0014610958578063a457c2d714610978578063a8aa1b3114610998578063a9059cbb146109b857600080fd5b8063924de9b7146108c257806392bfe8b9146108e257806395d89b41146109025780639ba5e4d51461093157600080fd5b80637cb332bb116101c15780637cb332bb1461083457806388f82020146108545780638da5cb5b1461088d5780638e2839ff146108a257600080fd5b8063715018a6146107b0578063728f8eea146107c557806375f0a8741461081457600080fd5b80634ada218b116102cc578063652e2f041161026a5780636aa5b37f116102395780636aa5b37f1461073b5780636ddd171314610751578063706f69371461077057806370a082311461079057600080fd5b8063652e2f04146106b957806366a88d96146106cf578063677a8870146106e557806368a9f31c1461071d57600080fd5b806359759f61116102a657806359759f61146106295780635b24ea5e146106495780635fcefa421461066957806362695eae1461068957600080fd5b80634ada218b146105b657806352390c02146105d05780635342acb4146105f057600080fd5b80632d4efa4711610344578063379ba1d911610313578063379ba1d9146105365780633950935114610556578063437823ec146105765780634549b0391461059657600080fd5b80632d4efa47146104ba5780632d838119146104da578063313ce567146104fa5780633685d4191461051657600080fd5b806313f97a8e1161038057806313f97a8e1461044557806318160ddd1461046557806323b872dd14610484578063274a533c146104a457600080fd5b806306fdde03146103b2578063095ea7b3146103f35780630d65df9b1461042357600080fd5b366103ad57005b600080fd5b3480156103be57600080fd5b5060408051808201909152600681526554726170707960d01b60208201525b6040516103ea91906139f2565b60405180910390f35b3480156103ff57600080fd5b5061041361040e36600461379c565b610beb565b60405190151581526020016103ea565b34801561042f57600080fd5b5061044361043e36600461372d565b610c53565b005b34801561045157600080fd5b5061044361046036600461388a565b610d0a565b34801561047157600080fd5b506010545b6040519081526020016103ea565b34801561049057600080fd5b5061041361049f36600461372d565b610df7565b3480156104b057600080fd5b5061047660165481565b3480156104c657600080fd5b506104436104d5366004613929565b610ef1565b3480156104e657600080fd5b506104766104f5366004613929565b610f92565b34801561050657600080fd5b50604051600981526020016103ea565b34801561052257600080fd5b506104436105313660046136ba565b611016565b34801561054257600080fd5b506104436105513660046138d1565b6111d2565b34801561056257600080fd5b5061041361057136600461379c565b61123c565b34801561058257600080fd5b506104436105913660046136ba565b6112bc565b3480156105a257600080fd5b506104766105b1366004613942565b61130f565b3480156105c257600080fd5b50600a546104139060ff1681565b3480156105dc57600080fd5b506104436105eb3660046136ba565b6113a3565b3480156105fc57600080fd5b5061041361060b3660046136ba565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561063557600080fd5b50610443610644366004613967565b6114fb565b34801561065557600080fd5b5061044361066436600461376e565b611560565b34801561067557600080fd5b506104436106843660046139b7565b6115e8565b34801561069557600080fd5b506104136106a43660046136ba565b60076020526000908152604090205460ff1681565b3480156106c557600080fd5b5061047660145481565b3480156106db57600080fd5b5061047660155481565b3480156106f157600080fd5b50601a54610705906001600160a01b031681565b6040516001600160a01b0390911681526020016103ea565b34801561072957600080fd5b506001546001600160a01b0316610705565b34801561074757600080fd5b5061047660135481565b34801561075d57600080fd5b50600a5461041390610100900460ff1681565b34801561077c57600080fd5b5061044361078b3660046137c8565b611685565b34801561079c57600080fd5b506104766107ab3660046136ba565b611763565b3480156107bc57600080fd5b506104436117c2565b3480156107d157600080fd5b50601b54601c54601d54601e54601f546107ec949392919085565b604080519586526020860194909452928401919091526060830152608082015260a0016103ea565b34801561082057600080fd5b50601754610705906001600160a01b031681565b34801561084057600080fd5b5061044361084f3660046136ba565b6117fd565b34801561086057600080fd5b5061041361086f3660046136ba565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561089957600080fd5b5061070561184e565b3480156108ae57600080fd5b506104436108bd36600461388a565b611884565b3480156108ce57600080fd5b506104436108dd3660046138d1565b61191a565b3480156108ee57600080fd5b50601954610705906001600160a01b031681565b34801561090e57600080fd5b5060408051808201909152600681526554524150505960d01b60208201526103dd565b34801561093d57600080fd5b506025546026546027546028546029546107ec949392919085565b34801561096457600080fd5b50610443610973366004613929565b611963565b34801561098457600080fd5b5061041361099336600461379c565b611a0f565b3480156109a457600080fd5b50600f54610705906001600160a01b031681565b3480156109c457600080fd5b506104136109d336600461379c565b611af5565b3480156109e457600080fd5b506104436109f33660046136ba565b611b4a565b348015610a0457600080fd5b50610443610a1336600461376e565b611b9b565b348015610a2457600080fd5b50601854610705906001600160a01b031681565b348015610a4457600080fd5b50610443610a533660046139b7565b611c23565b348015610a6457600080fd5b50610443610a73366004613929565b611cc1565b348015610a8457600080fd5b50610476600d5481565b348015610a9a57600080fd5b50610443610aa9366004613929565b611d0c565b348015610aba57600080fd5b50610476610ac93660046136f4565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b348015610b0057600080fd5b5061047660125481565b348015610b1657600080fd5b50610443610b2536600461390b565b611d57565b348015610b3657600080fd5b50610443610b453660046136ba565b611da8565b348015610b5657600080fd5b50600c546104139060ff1681565b348015610b7057600080fd5b50610443610b7f3660046136ba565b611df8565b348015610b9057600080fd5b50610443610b9f3660046136ba565b611e49565b348015610bb057600080fd5b506020546021546022546023546024546107ec949392919085565b348015610bd757600080fd5b50600e54610705906001600160a01b031681565b600a54600090339060ff1680610c1957506001600160a01b03811660009081526007602052604090205460ff165b610c3e5760405162461bcd60e51b8152600401610c3590613ab1565b60405180910390fd5b610c49338585611ee6565b5060019392505050565b33610c5c61184e565b6001600160a01b031614610c825760405162461bcd60e51b8152600401610c3590613a7c565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b158015610ccc57600080fd5b505af1158015610ce0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0491906138ee565b50505050565b33610d1361184e565b6001600160a01b031614610d395760405162461bcd60e51b8152600401610c3590613a7c565b60005b8251811015610df25760195483516001600160a01b0390911690849083908110610d6857610d68613d53565b60200260200101516001600160a01b03161415610d975760405162461bcd60e51b8152600401610c3590613a47565b8160086000858481518110610dae57610dae613d53565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610dea81613d0c565b915050610d3c565b505050565b600a54600090849060ff1680610e2557506001600160a01b03811660009081526007602052604090205460ff165b610e415760405162461bcd60e51b8152600401610c3590613ab1565b610e4c85858561200a565b6001600160a01b038516600090815260046020908152604080832033845290915290205483811015610ed15760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b6064820152608401610c35565b610ee58633610ee08785613cf5565b611ee6565b50600195945050505050565b33610efa61184e565b6001600160a01b031614610f205760405162461bcd60e51b8152600401610c3590613a7c565b610f2930611763565b811115610f865760405162461bcd60e51b815260206004820152602560248201527f4e6f7420656e6f75676820746f6b656e7320696e20636f6e747261637420746f604482015264081cd95b1b60da1b6064820152608401610c35565b610f8f816127f0565b50565b6000601154821115610ff95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610c35565b6000611003612951565b905061100f8184613bc6565b9392505050565b3361101f61184e565b6001600160a01b0316146110455760405162461bcd60e51b8152600401610c3590613a7c565b6001600160a01b03811660009081526006602052604090205460ff166110ad5760405162461bcd60e51b815260206004820152601760248201527f4163636f756e74206973206e6f74206578636c756465640000000000000000006044820152606401610c35565b60005b6009548110156111ce57816001600160a01b0316600982815481106110d7576110d7613d53565b6000918252602090912001546001600160a01b031614156111bc576009805461110290600190613cf5565b8154811061111257611112613d53565b600091825260209091200154600980546001600160a01b03909216918390811061113e5761113e613d53565b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600382526040808220829055600690925220805460ff19169055600980548061119657611196613d3d565b600082815260209020810160001990810180546001600160a01b03191690550190555050565b806111c681613d0c565b9150506110b0565b5050565b336111db61184e565b6001600160a01b0316146112015760405162461bcd60e51b8152600401610c3590613a7c565b600a805461ffff191661ff00198315159081169190911761010082021790915560011480156112305750601654155b15610f8f574360165550565b600a54600090339060ff168061126a57506001600160a01b03811660009081526007602052604090205460ff165b6112865760405162461bcd60e51b8152600401610c3590613ab1565b3360008181526004602090815260408083206001600160a01b0389168452909152902054610c4991908690610ee0908790613bae565b336112c561184e565b6001600160a01b0316146112eb5760405162461bcd60e51b8152600401610c3590613a7c565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b60006010548311156113635760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c79006044820152606401610c35565b816113815760006113778460016000612974565b51915061139d9050565b60006113908460016000612974565b60200151915061139d9050565b92915050565b336113ac61184e565b6001600160a01b0316146113d25760405162461bcd60e51b8152600401610c3590613a7c565b6001600160a01b03811660009081526006602052604090205460ff161561143b5760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610c35565b6001600160a01b03811660009081526002602052604090205415611495576001600160a01b03811660009081526002602052604090205461147b90610f92565b6001600160a01b0382166000908152600360205260409020555b6001600160a01b03166000818152600660205260408120805460ff191660019081179091556009805491820181559091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319169091179055565b3361150461184e565b6001600160a01b03161461152a5760405162461bcd60e51b8152600401610c3590613a7c565b6115366009600a613c2b565b6115409083613cd6565b60135561154f6009600a613c2b565b6115599082613cd6565b6014555050565b3361156961184e565b6001600160a01b03161461158f5760405162461bcd60e51b8152600401610c3590613a7c565b6019546001600160a01b03838116911614156115bd5760405162461bcd60e51b8152600401610c3590613a47565b6001600160a01b03919091166000908152600860205260409020805460ff1916911515919091179055565b336115f161184e565b6001600160a01b0316146116175760405162461bcd60e51b8152600401610c3590613a7c565b6040805160a0810182528681526020810186905280820185905260608101849052608001829052601b869055601c859055601d849055601e839055601f829055517f846206d6c3449ac0b05841dfb88bf28b55aef00f96152490c69c96238048de1590600090a15050505050565b3361168e61184e565b6001600160a01b0316146116b45760405162461bcd60e51b8152600401610c3590613a7c565b80518251146117055760405162461bcd60e51b815260206004820152601a60248201527f417272617973206d75737420686176652073616d652073697a650000000000006044820152606401610c35565b60005b8251811015610df2576117513384838151811061172757611727613d53565b602002602001015184848151811061174157611741613d53565b60200260200101516000806129d5565b8061175b81613d0c565b915050611708565b6001600160a01b03811660009081526006602052604081205460ff16156117a057506001600160a01b031660009081526003602052604090205490565b6001600160a01b03821660009081526002602052604090205461139d90610f92565b336117cb61184e565b6001600160a01b0316146117f15760405162461bcd60e51b8152600401610c3590613a7c565b6117fb6000612cdf565b565b3361180661184e565b6001600160a01b03161461182c5760405162461bcd60e51b8152600401610c3590613a7c565b601a80546001600160a01b0319166001600160a01b0392909216919091179055565b6001546000906001600160a01b031633141561187457506001546001600160a01b031690565b506000546001600160a01b031690565b3361188d61184e565b6001600160a01b0316146118b35760405162461bcd60e51b8152600401610c3590613a7c565b60005b8251811015610df25781600560008584815181106118d6576118d6613d53565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061191281613d0c565b9150506118b6565b3361192361184e565b6001600160a01b0316146119495760405162461bcd60e51b8152600401610c3590613a7c565b600a80549115156101000261ff0019909216919091179055565b3361196c61184e565b6001600160a01b0316146119925760405162461bcd60e51b8152600401610c3590613a7c565b804710156119e25760405162461bcd60e51b815260206004820152601860248201527f696e73756666696369656e74204554482062616c616e636500000000000000006044820152606401610c35565b604051339082156108fc029083906000818181858888f193505050501580156111ce573d6000803e3d6000fd5b600a54600090339060ff1680611a3d57506001600160a01b03811660009081526007602052604090205460ff165b611a595760405162461bcd60e51b8152600401610c3590613ab1565b3360009081526004602090815260408083206001600160a01b038816845290915290205483811015611adb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610c35565b611aea3386610ee08785613cf5565b506001949350505050565b600a54600090339060ff1680611b2357506001600160a01b03811660009081526007602052604090205460ff165b611b3f5760405162461bcd60e51b8152600401610c3590613ab1565b610c4933858561200a565b33611b5361184e565b6001600160a01b031614611b795760405162461bcd60e51b8152600401610c3590613a7c565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b33611ba461184e565b6001600160a01b031614611bca5760405162461bcd60e51b8152600401610c3590613a7c565b6019546001600160a01b0383811691161415611bf85760405162461bcd60e51b8152600401610c3590613a47565b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b33611c2c61184e565b6001600160a01b031614611c525760405162461bcd60e51b8152600401610c3590613a7c565b6040805160a08101825286815260208082018790528183018690526060820185905260809091018390528690556021859055602284905560238390556024829055517f846206d6c3449ac0b05841dfb88bf28b55aef00f96152490c69c96238048de1590600090a15050505050565b33611cca61184e565b6001600160a01b031614611cf05760405162461bcd60e51b8152600401610c3590613a7c565b611cfc6009600a613c2b565b611d069082613cd6565b60125550565b33611d1561184e565b6001600160a01b031614611d3b5760405162461bcd60e51b8152600401610c3590613a7c565b611d476009600a613c2b565b611d519082613cd6565b60155550565b33611d6061184e565b6001600160a01b031614611d865760405162461bcd60e51b8152600401610c3590613a7c565b611d91816001613cd6565b600d5550600c805460ff1916911515919091179055565b33611db161184e565b6001600160a01b031614611dd75760405162461bcd60e51b8152600401610c3590613a7c565b6001600160a01b03166000908152600560205260409020805460ff19169055565b33611e0161184e565b6001600160a01b031614611e275760405162461bcd60e51b8152600401610c3590613a7c565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b33611e5261184e565b6001600160a01b031614611e785760405162461bcd60e51b8152600401610c3590613a7c565b6001600160a01b038116611edd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c35565b610f8f81612cdf565b6001600160a01b038316611f485760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610c35565b6001600160a01b038216611fa95760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610c35565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661206e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610c35565b6001600160a01b0382166120d05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610c35565b600081116121325760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610c35565b61213b83611763565b8111156121a45760405162461bcd60e51b815260206004820152603160248201527f596f752061726520747279696e6720746f207472616e73666572206d6f7265206044820152707468616e20796f75722062616c616e636560781b6064820152608401610c35565b6001600160a01b03831660009081526008602052604090205460ff161580156121e657506001600160a01b03821660009081526008602052604090205460ff16155b6122225760405162461bcd60e51b815260206004820152600d60248201526c165bdd48185c99481848189bdd609a1b6044820152606401610c35565b6001600160a01b03831660009081526005602052604090205460ff1615801561226457506001600160a01b03821660009081526005602052604090205460ff16155b156122b057600a5460ff166122b05760405162461bcd60e51b815260206004820152601260248201527154726164696e67206e6f742061637469766560701b6044820152606401610c35565b6001600160a01b03831660009081526005602052604090205460ff161580156122f257506001600160a01b03821660009081526005602052604090205460ff16155b801561230b5750601654612307906003613bae565b4311155b1561237a57600f546001600160a01b038381169116141561237a5760405162461bcd60e51b8152602060048201526024808201527f53656c6c73206e6f7420616c6c6f77656420666f72206669727374203320626c6044820152636f636b7360e01b6064820152608401610c35565b600f546001600160a01b0384811691161480156123b057506001600160a01b03821660009081526005602052604090205460ff16155b80156123c55750600a5462010000900460ff16155b156124815760135481111561241c5760405162461bcd60e51b815260206004820152601d60248201527f596f752061726520657863656564696e67206d61784275794c696d69740000006044820152606401610c35565b6015548161242984611763565b6124339190613bae565b11156124815760405162461bcd60e51b815260206004820181905260248201527f596f752061726520657863656564696e67206d617857616c6c65744c696d69746044820152606401610c35565b600f546001600160a01b038481169116148015906124b857506001600160a01b03821660009081526005602052604090205460ff16155b80156124dd57506001600160a01b03831660009081526005602052604090205460ff16155b80156124f25750600a5462010000900460ff16155b15612655576014548111156125495760405162461bcd60e51b815260206004820152601e60248201527f596f752061726520657863656564696e67206d617853656c6c4c696d697400006044820152606401610c35565b600f546001600160a01b038381169116146125c3576015548161256b84611763565b6125759190613bae565b11156125c35760405162461bcd60e51b815260206004820181905260248201527f596f752061726520657863656564696e67206d617857616c6c65744c696d69746044820152606401610c35565b600c5460ff1615612655576001600160a01b0383166000908152600b60205260408120546125f19042613cf5565b9050600d548110156126385760405162461bcd60e51b815260206004820152601060248201526f10dbdbdb191bdddb88195b98589b195960821b6044820152606401610c35565b506001600160a01b0383166000908152600b602052604090204290555b600060125461266330611763565b600a54911115915062010000900460ff161580156126885750600a54610100900460ff165b80156126915750805b80156126ab5750600f546001600160a01b03858116911614155b80156126d057506001600160a01b03841660009081526005602052604090205460ff16155b80156126f557506001600160a01b03831660009081526005602052604090205460ff16155b1561275f57601254600f5461275f91906001600160a01b0386811691161461271e57601b612721565b60205b6040805160a0810182528254815260018301546020820152600283015491810191909152600382015460608201526004909101546080820152612d2f565b600a5460019060009062010000900460ff168061279457506001600160a01b03861660009081526005602052604090205460ff165b806127b757506001600160a01b03851660009081526005602052604090205460ff165b156127c157600091505b600f546001600160a01b03868116911614156127db575060015b6127e886868685856129d5565b505050505050565b604080516002808252606082018352600092602083019080368337019050509050308160008151811061282557612825613d53565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561287957600080fd5b505afa15801561288d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b191906136d7565b816001815181106128c4576128c4613d53565b6001600160a01b039283166020918202929092010152600e546128ea9130911684611ee6565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790612923908590600090869030904290600401613ae8565b600060405180830381600087803b15801561293d57600080fd5b505af11580156127e8573d6000803e3d6000fd5b600080600061295e612ed5565b909250905061296d8183613bc6565b9250505090565b61297c6135d7565b612987848484613058565b905061299c818585612997612951565b613213565b60c0870152608086015260608501526040840152602083015281526129c981846129c4612951565b6132e7565b60a08201529392505050565b60006129e2848484612974565b6001600160a01b03871660009081526006602052604090205490915060ff1615612a44576001600160a01b038616600090815260036020526040902054612a2a908590613cf5565b6001600160a01b0387166000908152600360205260409020555b6001600160a01b03851660009081526006602052604090205460ff1615612aa75760e08101516001600160a01b038616600090815260036020526040902054612a8d9190613bae565b6001600160a01b0386166000908152600360205260409020555b80516001600160a01b038716600090815260026020526040902054612acc9190613cf5565b6001600160a01b0380881660009081526002602090815260408083209490945584015191881681529190912054612b039190613bae565b6001600160a01b0386166000908152600260205260409081902091909155810151151580612b3657506000816101000151115b15612b4e57612b4e816040015182610100015161330f565b600081608001511180612b6657506000816101400151115b15612bfb57612b7e8160800151826101400151613344565b306001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836101800151846101600151856101200151866101400151612bd59190613bae565b612bdf9190613bae565b612be99190613bae565b60405190815260200160405180910390a35b600081606001511180612c1357506000816101200151115b15612c2b57612c2b81606001518261012001516133ba565b60008160a001511180612c4357506000816101600151115b15612c5b57612c5b8160a001518261016001516133cf565b61018081015115612c8657601a54610180820151612c869188916001600160a01b039091169061200a565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360e00151604051612ccf91815260200190565b60405180910390a3505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600a805462ff000019166201000017905560808101516060820151602083015160408401516000939291612d6291613bae565b612d6c9190613bae565b612d769190613bae565b612d81906002613cd6565b9050600081836040015185612d969190613cd6565b612da09190613bc6565b90506000612dae8286613cf5565b905047612dba826127f0565b6000612dc68247613cf5565b90506000866040015186612dda9190613cf5565b612de49083613bc6565b90506000876040015182612df89190613cd6565b90508015612e0a57612e0a86826133e4565b6020880151600090612e1d846002613cd6565b612e279190613cd6565b90508015612e4557601754612e45906001600160a01b0316826134be565b6060890151600090612e58856002613cd6565b612e629190613cd6565b90508015612e8057601854612e80906001600160a01b0316826134be565b60808a0151600090612e93866002613cd6565b612e9d9190613cd6565b90508015612ebb57601a54612ebb906001600160a01b0316826134be565b5050600a805462ff00001916905550505050505050505050565b6011546010546000918291825b60095481101561302757826002600060098481548110612f0457612f04613d53565b60009182526020808320909101546001600160a01b031683528201929092526040019020541180612f6f5750816003600060098481548110612f4857612f48613d53565b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15612f8557601154601054945094505050509091565b6002600060098381548110612f9c57612f9c613d53565b60009182526020808320909101546001600160a01b03168352820192909252604001902054612fcb9084613cf5565b92506003600060098381548110612fe457612fe4613d53565b60009182526020808320909101546001600160a01b031683528201929092526040019020546130139083613cf5565b91508061301f81613d0c565b915050612ee2565b506010546011546130389190613bc6565b82101561304f576011546010549350935050509091565b90939092509050565b6130606135d7565b826130715760e0810184905261100f565b6130a36040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b82156130e057506040805160a081018252602080548252602154908201526022549181019190915260235460608201526024546080820152613113565b506040805160a081018252601b548152601c546020820152601d5491810191909152601e546060820152601f5460808201525b80516064906131229087613cd6565b61312c9190613bc6565b61010083015260208101516064906131449087613cd6565b61314e9190613bc6565b61012083015260408101516064906131669087613cd6565b6131709190613bc6565b61014083015260608101516064906131889087613cd6565b6131929190613bc6565b61016083015260808101516064906131aa9087613cd6565b6131b49190613bc6565b61018083018190526101608301516101408401516101208501516101008601516131de908a613cf5565b6131e89190613cf5565b6131f29190613cf5565b6131fc9190613cf5565b6132069190613cf5565b60e0830152509392505050565b60008080808080613224878a613cd6565b95508761323f575084935060009250829150819050806132da565b868a61010001516132509190613cd6565b9350868a61012001516132639190613cd6565b9250868a61014001516132769190613cd6565b91506000878b610160015161328b9190613cd6565b9050878b610180015161329e9190613cd6565b9150818184866132ae898c613cf5565b6132b89190613cf5565b6132c29190613cf5565b6132cc9190613cf5565b6132d69190613cf5565b9550505b9499939850945094509450565b6000826132f65750600061100f565b818461016001516133079190613cd6565b949350505050565b81601160008282546133219190613cf5565b90915550506025805482919060009061333b908490613bae565b90915550505050565b80602560020160008282546133599190613bae565b90915550503060009081526006602052604090205460ff161561339b573060009081526003602052604081208054839290613395908490613bae565b90915550505b306000908152600260205260408120805484929061333b908490613bae565b80602560010160008282546133599190613bae565b80602560030160008282546133599190613bae565b600e546133fc9030906001600160a01b031684611ee6565b600e546001600160a01b031663f305d71982308560008061341b61184e565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561347e57600080fd5b505af1158015613492573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906134b79190613989565b5050505050565b8047101561350e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610c35565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461355b576040519150601f19603f3d011682016040523d82523d6000602084013e613560565b606091505b5050905080610df25760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610c35565b604051806101a00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b600082601f83011261365057600080fd5b8135602061366561366083613b8a565b613b59565b80838252828201915082860187848660051b890101111561368557600080fd5b60005b858110156136ad57813561369b81613d7f565b84529284019290840190600101613688565b5090979650505050505050565b6000602082840312156136cc57600080fd5b813561100f81613d7f565b6000602082840312156136e957600080fd5b815161100f81613d7f565b6000806040838503121561370757600080fd5b823561371281613d7f565b9150602083013561372281613d7f565b809150509250929050565b60008060006060848603121561374257600080fd5b833561374d81613d7f565b9250602084013561375d81613d7f565b929592945050506040919091013590565b6000806040838503121561378157600080fd5b823561378c81613d7f565b9150602083013561372281613d94565b600080604083850312156137af57600080fd5b82356137ba81613d7f565b946020939093013593505050565b600080604083850312156137db57600080fd5b823567ffffffffffffffff808211156137f357600080fd5b6137ff8683870161363f565b935060209150818501358181111561381657600080fd5b85019050601f8101861361382957600080fd5b803561383761366082613b8a565b80828252848201915084840189868560051b870101111561385757600080fd5b600094505b8385101561387a57803583526001949094019391850191850161385c565b5080955050505050509250929050565b6000806040838503121561389d57600080fd5b823567ffffffffffffffff8111156138b457600080fd5b6138c08582860161363f565b925050602083013561372281613d94565b6000602082840312156138e357600080fd5b813561100f81613d94565b60006020828403121561390057600080fd5b815161100f81613d94565b6000806040838503121561391e57600080fd5b82356137ba81613d94565b60006020828403121561393b57600080fd5b5035919050565b6000806040838503121561395557600080fd5b82359150602083013561372281613d94565b6000806040838503121561397a57600080fd5b50508035926020909101359150565b60008060006060848603121561399e57600080fd5b8351925060208401519150604084015190509250925092565b600080600080600060a086880312156139cf57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b600060208083528351808285015260005b81811015613a1f57858101830151858201604001528201613a03565b81811115613a31576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4c502077616c6c65742063616e6e6f7420626520626c61636b6c69737465642e604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526017908201527f54726164696e67206e6f7420656e61626c656420796574000000000000000000604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015613b385784516001600160a01b031683529383019391830191600101613b13565b50506001600160a01b03969096166060850152505050608001529392505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715613b8257613b82613d69565b604052919050565b600067ffffffffffffffff821115613ba457613ba4613d69565b5060051b60200190565b60008219821115613bc157613bc1613d27565b500190565b600082613be357634e487b7160e01b600052601260045260246000fd5b500490565b600181815b80851115613c23578160001904821115613c0957613c09613d27565b80851615613c1657918102915b93841c9390800290613bed565b509250929050565b600061100f60ff841683600082613c445750600161139d565b81613c515750600061139d565b8160018114613c675760028114613c7157613c8d565b600191505061139d565b60ff841115613c8257613c82613d27565b50506001821b61139d565b5060208310610133831016604e8410600b8410161715613cb0575081810a61139d565b613cba8383613be8565b8060001904821115613cce57613cce613d27565b029392505050565b6000816000190483118215151615613cf057613cf0613d27565b500290565b600082821015613d0757613d07613d27565b500390565b6000600019821415613d2057613d20613d27565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610f8f57600080fd5b8015158114610f8f57600080fdfea2646970667358221220472c86ebe35c907b4de53a407f93bfbcb687ec05724c98dff43e1f0dc4ed00f564736f6c63430008070033 | 6080604052600436106103a65760003560e01c8063715018a6116101e7578063aacebbe31161010d578063e2f45605116100a0578063f023f5731161006f578063f023f57314610b64578063f2fde38b14610b84578063f66895a314610ba4578063f887ea4014610bcb57600080fd5b8063e2f4560514610af4578063e517f2b914610b0a578063ea2f0b3714610b2a578063ee36e35914610b4a57600080fd5b8063d257b34f116100dc578063d257b34f14610a58578063d2ce0db214610a78578063d8672e5114610a8e578063dd62ed3e14610aae57600080fd5b8063aacebbe3146109d8578063b5c57145146109f8578063c04a541414610a18578063c791fc5414610a3857600080fd5b8063924de9b7116101855780639e252f00116101545780639e252f0014610958578063a457c2d714610978578063a8aa1b3114610998578063a9059cbb146109b857600080fd5b8063924de9b7146108c257806392bfe8b9146108e257806395d89b41146109025780639ba5e4d51461093157600080fd5b80637cb332bb116101c15780637cb332bb1461083457806388f82020146108545780638da5cb5b1461088d5780638e2839ff146108a257600080fd5b8063715018a6146107b0578063728f8eea146107c557806375f0a8741461081457600080fd5b80634ada218b116102cc578063652e2f041161026a5780636aa5b37f116102395780636aa5b37f1461073b5780636ddd171314610751578063706f69371461077057806370a082311461079057600080fd5b8063652e2f04146106b957806366a88d96146106cf578063677a8870146106e557806368a9f31c1461071d57600080fd5b806359759f61116102a657806359759f61146106295780635b24ea5e146106495780635fcefa421461066957806362695eae1461068957600080fd5b80634ada218b146105b657806352390c02146105d05780635342acb4146105f057600080fd5b80632d4efa4711610344578063379ba1d911610313578063379ba1d9146105365780633950935114610556578063437823ec146105765780634549b0391461059657600080fd5b80632d4efa47146104ba5780632d838119146104da578063313ce567146104fa5780633685d4191461051657600080fd5b806313f97a8e1161038057806313f97a8e1461044557806318160ddd1461046557806323b872dd14610484578063274a533c146104a457600080fd5b806306fdde03146103b2578063095ea7b3146103f35780630d65df9b1461042357600080fd5b366103ad57005b600080fd5b3480156103be57600080fd5b5060408051808201909152600681526554726170707960d01b60208201525b6040516103ea91906139f2565b60405180910390f35b3480156103ff57600080fd5b5061041361040e36600461379c565b610beb565b60405190151581526020016103ea565b34801561042f57600080fd5b5061044361043e36600461372d565b610c53565b005b34801561045157600080fd5b5061044361046036600461388a565b610d0a565b34801561047157600080fd5b506010545b6040519081526020016103ea565b34801561049057600080fd5b5061041361049f36600461372d565b610df7565b3480156104b057600080fd5b5061047660165481565b3480156104c657600080fd5b506104436104d5366004613929565b610ef1565b3480156104e657600080fd5b506104766104f5366004613929565b610f92565b34801561050657600080fd5b50604051600981526020016103ea565b34801561052257600080fd5b506104436105313660046136ba565b611016565b34801561054257600080fd5b506104436105513660046138d1565b6111d2565b34801561056257600080fd5b5061041361057136600461379c565b61123c565b34801561058257600080fd5b506104436105913660046136ba565b6112bc565b3480156105a257600080fd5b506104766105b1366004613942565b61130f565b3480156105c257600080fd5b50600a546104139060ff1681565b3480156105dc57600080fd5b506104436105eb3660046136ba565b6113a3565b3480156105fc57600080fd5b5061041361060b3660046136ba565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561063557600080fd5b50610443610644366004613967565b6114fb565b34801561065557600080fd5b5061044361066436600461376e565b611560565b34801561067557600080fd5b506104436106843660046139b7565b6115e8565b34801561069557600080fd5b506104136106a43660046136ba565b60076020526000908152604090205460ff1681565b3480156106c557600080fd5b5061047660145481565b3480156106db57600080fd5b5061047660155481565b3480156106f157600080fd5b50601a54610705906001600160a01b031681565b6040516001600160a01b0390911681526020016103ea565b34801561072957600080fd5b506001546001600160a01b0316610705565b34801561074757600080fd5b5061047660135481565b34801561075d57600080fd5b50600a5461041390610100900460ff1681565b34801561077c57600080fd5b5061044361078b3660046137c8565b611685565b34801561079c57600080fd5b506104766107ab3660046136ba565b611763565b3480156107bc57600080fd5b506104436117c2565b3480156107d157600080fd5b50601b54601c54601d54601e54601f546107ec949392919085565b604080519586526020860194909452928401919091526060830152608082015260a0016103ea565b34801561082057600080fd5b50601754610705906001600160a01b031681565b34801561084057600080fd5b5061044361084f3660046136ba565b6117fd565b34801561086057600080fd5b5061041361086f3660046136ba565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561089957600080fd5b5061070561184e565b3480156108ae57600080fd5b506104436108bd36600461388a565b611884565b3480156108ce57600080fd5b506104436108dd3660046138d1565b61191a565b3480156108ee57600080fd5b50601954610705906001600160a01b031681565b34801561090e57600080fd5b5060408051808201909152600681526554524150505960d01b60208201526103dd565b34801561093d57600080fd5b506025546026546027546028546029546107ec949392919085565b34801561096457600080fd5b50610443610973366004613929565b611963565b34801561098457600080fd5b5061041361099336600461379c565b611a0f565b3480156109a457600080fd5b50600f54610705906001600160a01b031681565b3480156109c457600080fd5b506104136109d336600461379c565b611af5565b3480156109e457600080fd5b506104436109f33660046136ba565b611b4a565b348015610a0457600080fd5b50610443610a1336600461376e565b611b9b565b348015610a2457600080fd5b50601854610705906001600160a01b031681565b348015610a4457600080fd5b50610443610a533660046139b7565b611c23565b348015610a6457600080fd5b50610443610a73366004613929565b611cc1565b348015610a8457600080fd5b50610476600d5481565b348015610a9a57600080fd5b50610443610aa9366004613929565b611d0c565b348015610aba57600080fd5b50610476610ac93660046136f4565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b348015610b0057600080fd5b5061047660125481565b348015610b1657600080fd5b50610443610b2536600461390b565b611d57565b348015610b3657600080fd5b50610443610b453660046136ba565b611da8565b348015610b5657600080fd5b50600c546104139060ff1681565b348015610b7057600080fd5b50610443610b7f3660046136ba565b611df8565b348015610b9057600080fd5b50610443610b9f3660046136ba565b611e49565b348015610bb057600080fd5b506020546021546022546023546024546107ec949392919085565b348015610bd757600080fd5b50600e54610705906001600160a01b031681565b600a54600090339060ff1680610c1957506001600160a01b03811660009081526007602052604090205460ff165b610c3e5760405162461bcd60e51b8152600401610c3590613ab1565b60405180910390fd5b610c49338585611ee6565b5060019392505050565b33610c5c61184e565b6001600160a01b031614610c825760405162461bcd60e51b8152600401610c3590613a7c565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b158015610ccc57600080fd5b505af1158015610ce0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0491906138ee565b50505050565b33610d1361184e565b6001600160a01b031614610d395760405162461bcd60e51b8152600401610c3590613a7c565b60005b8251811015610df25760195483516001600160a01b0390911690849083908110610d6857610d68613d53565b60200260200101516001600160a01b03161415610d975760405162461bcd60e51b8152600401610c3590613a47565b8160086000858481518110610dae57610dae613d53565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610dea81613d0c565b915050610d3c565b505050565b600a54600090849060ff1680610e2557506001600160a01b03811660009081526007602052604090205460ff165b610e415760405162461bcd60e51b8152600401610c3590613ab1565b610e4c85858561200a565b6001600160a01b038516600090815260046020908152604080832033845290915290205483811015610ed15760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b6064820152608401610c35565b610ee58633610ee08785613cf5565b611ee6565b50600195945050505050565b33610efa61184e565b6001600160a01b031614610f205760405162461bcd60e51b8152600401610c3590613a7c565b610f2930611763565b811115610f865760405162461bcd60e51b815260206004820152602560248201527f4e6f7420656e6f75676820746f6b656e7320696e20636f6e747261637420746f604482015264081cd95b1b60da1b6064820152608401610c35565b610f8f816127f0565b50565b6000601154821115610ff95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610c35565b6000611003612951565b905061100f8184613bc6565b9392505050565b3361101f61184e565b6001600160a01b0316146110455760405162461bcd60e51b8152600401610c3590613a7c565b6001600160a01b03811660009081526006602052604090205460ff166110ad5760405162461bcd60e51b815260206004820152601760248201527f4163636f756e74206973206e6f74206578636c756465640000000000000000006044820152606401610c35565b60005b6009548110156111ce57816001600160a01b0316600982815481106110d7576110d7613d53565b6000918252602090912001546001600160a01b031614156111bc576009805461110290600190613cf5565b8154811061111257611112613d53565b600091825260209091200154600980546001600160a01b03909216918390811061113e5761113e613d53565b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600382526040808220829055600690925220805460ff19169055600980548061119657611196613d3d565b600082815260209020810160001990810180546001600160a01b03191690550190555050565b806111c681613d0c565b9150506110b0565b5050565b336111db61184e565b6001600160a01b0316146112015760405162461bcd60e51b8152600401610c3590613a7c565b600a805461ffff191661ff00198315159081169190911761010082021790915560011480156112305750601654155b15610f8f574360165550565b600a54600090339060ff168061126a57506001600160a01b03811660009081526007602052604090205460ff165b6112865760405162461bcd60e51b8152600401610c3590613ab1565b3360008181526004602090815260408083206001600160a01b0389168452909152902054610c4991908690610ee0908790613bae565b336112c561184e565b6001600160a01b0316146112eb5760405162461bcd60e51b8152600401610c3590613a7c565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b60006010548311156113635760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c79006044820152606401610c35565b816113815760006113778460016000612974565b51915061139d9050565b60006113908460016000612974565b60200151915061139d9050565b92915050565b336113ac61184e565b6001600160a01b0316146113d25760405162461bcd60e51b8152600401610c3590613a7c565b6001600160a01b03811660009081526006602052604090205460ff161561143b5760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610c35565b6001600160a01b03811660009081526002602052604090205415611495576001600160a01b03811660009081526002602052604090205461147b90610f92565b6001600160a01b0382166000908152600360205260409020555b6001600160a01b03166000818152600660205260408120805460ff191660019081179091556009805491820181559091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319169091179055565b3361150461184e565b6001600160a01b03161461152a5760405162461bcd60e51b8152600401610c3590613a7c565b6115366009600a613c2b565b6115409083613cd6565b60135561154f6009600a613c2b565b6115599082613cd6565b6014555050565b3361156961184e565b6001600160a01b03161461158f5760405162461bcd60e51b8152600401610c3590613a7c565b6019546001600160a01b03838116911614156115bd5760405162461bcd60e51b8152600401610c3590613a47565b6001600160a01b03919091166000908152600860205260409020805460ff1916911515919091179055565b336115f161184e565b6001600160a01b0316146116175760405162461bcd60e51b8152600401610c3590613a7c565b6040805160a0810182528681526020810186905280820185905260608101849052608001829052601b869055601c859055601d849055601e839055601f829055517f846206d6c3449ac0b05841dfb88bf28b55aef00f96152490c69c96238048de1590600090a15050505050565b3361168e61184e565b6001600160a01b0316146116b45760405162461bcd60e51b8152600401610c3590613a7c565b80518251146117055760405162461bcd60e51b815260206004820152601a60248201527f417272617973206d75737420686176652073616d652073697a650000000000006044820152606401610c35565b60005b8251811015610df2576117513384838151811061172757611727613d53565b602002602001015184848151811061174157611741613d53565b60200260200101516000806129d5565b8061175b81613d0c565b915050611708565b6001600160a01b03811660009081526006602052604081205460ff16156117a057506001600160a01b031660009081526003602052604090205490565b6001600160a01b03821660009081526002602052604090205461139d90610f92565b336117cb61184e565b6001600160a01b0316146117f15760405162461bcd60e51b8152600401610c3590613a7c565b6117fb6000612cdf565b565b3361180661184e565b6001600160a01b03161461182c5760405162461bcd60e51b8152600401610c3590613a7c565b601a80546001600160a01b0319166001600160a01b0392909216919091179055565b6001546000906001600160a01b031633141561187457506001546001600160a01b031690565b506000546001600160a01b031690565b3361188d61184e565b6001600160a01b0316146118b35760405162461bcd60e51b8152600401610c3590613a7c565b60005b8251811015610df25781600560008584815181106118d6576118d6613d53565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061191281613d0c565b9150506118b6565b3361192361184e565b6001600160a01b0316146119495760405162461bcd60e51b8152600401610c3590613a7c565b600a80549115156101000261ff0019909216919091179055565b3361196c61184e565b6001600160a01b0316146119925760405162461bcd60e51b8152600401610c3590613a7c565b804710156119e25760405162461bcd60e51b815260206004820152601860248201527f696e73756666696369656e74204554482062616c616e636500000000000000006044820152606401610c35565b604051339082156108fc029083906000818181858888f193505050501580156111ce573d6000803e3d6000fd5b600a54600090339060ff1680611a3d57506001600160a01b03811660009081526007602052604090205460ff165b611a595760405162461bcd60e51b8152600401610c3590613ab1565b3360009081526004602090815260408083206001600160a01b038816845290915290205483811015611adb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610c35565b611aea3386610ee08785613cf5565b506001949350505050565b600a54600090339060ff1680611b2357506001600160a01b03811660009081526007602052604090205460ff165b611b3f5760405162461bcd60e51b8152600401610c3590613ab1565b610c4933858561200a565b33611b5361184e565b6001600160a01b031614611b795760405162461bcd60e51b8152600401610c3590613a7c565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b33611ba461184e565b6001600160a01b031614611bca5760405162461bcd60e51b8152600401610c3590613a7c565b6019546001600160a01b0383811691161415611bf85760405162461bcd60e51b8152600401610c3590613a47565b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b33611c2c61184e565b6001600160a01b031614611c525760405162461bcd60e51b8152600401610c3590613a7c565b6040805160a08101825286815260208082018790528183018690526060820185905260809091018390528690556021859055602284905560238390556024829055517f846206d6c3449ac0b05841dfb88bf28b55aef00f96152490c69c96238048de1590600090a15050505050565b33611cca61184e565b6001600160a01b031614611cf05760405162461bcd60e51b8152600401610c3590613a7c565b611cfc6009600a613c2b565b611d069082613cd6565b60125550565b33611d1561184e565b6001600160a01b031614611d3b5760405162461bcd60e51b8152600401610c3590613a7c565b611d476009600a613c2b565b611d519082613cd6565b60155550565b33611d6061184e565b6001600160a01b031614611d865760405162461bcd60e51b8152600401610c3590613a7c565b611d91816001613cd6565b600d5550600c805460ff1916911515919091179055565b33611db161184e565b6001600160a01b031614611dd75760405162461bcd60e51b8152600401610c3590613a7c565b6001600160a01b03166000908152600560205260409020805460ff19169055565b33611e0161184e565b6001600160a01b031614611e275760405162461bcd60e51b8152600401610c3590613a7c565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b33611e5261184e565b6001600160a01b031614611e785760405162461bcd60e51b8152600401610c3590613a7c565b6001600160a01b038116611edd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c35565b610f8f81612cdf565b6001600160a01b038316611f485760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610c35565b6001600160a01b038216611fa95760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610c35565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661206e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610c35565b6001600160a01b0382166120d05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610c35565b600081116121325760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610c35565b61213b83611763565b8111156121a45760405162461bcd60e51b815260206004820152603160248201527f596f752061726520747279696e6720746f207472616e73666572206d6f7265206044820152707468616e20796f75722062616c616e636560781b6064820152608401610c35565b6001600160a01b03831660009081526008602052604090205460ff161580156121e657506001600160a01b03821660009081526008602052604090205460ff16155b6122225760405162461bcd60e51b815260206004820152600d60248201526c165bdd48185c99481848189bdd609a1b6044820152606401610c35565b6001600160a01b03831660009081526005602052604090205460ff1615801561226457506001600160a01b03821660009081526005602052604090205460ff16155b156122b057600a5460ff166122b05760405162461bcd60e51b815260206004820152601260248201527154726164696e67206e6f742061637469766560701b6044820152606401610c35565b6001600160a01b03831660009081526005602052604090205460ff161580156122f257506001600160a01b03821660009081526005602052604090205460ff16155b801561230b5750601654612307906003613bae565b4311155b1561237a57600f546001600160a01b038381169116141561237a5760405162461bcd60e51b8152602060048201526024808201527f53656c6c73206e6f7420616c6c6f77656420666f72206669727374203320626c6044820152636f636b7360e01b6064820152608401610c35565b600f546001600160a01b0384811691161480156123b057506001600160a01b03821660009081526005602052604090205460ff16155b80156123c55750600a5462010000900460ff16155b156124815760135481111561241c5760405162461bcd60e51b815260206004820152601d60248201527f596f752061726520657863656564696e67206d61784275794c696d69740000006044820152606401610c35565b6015548161242984611763565b6124339190613bae565b11156124815760405162461bcd60e51b815260206004820181905260248201527f596f752061726520657863656564696e67206d617857616c6c65744c696d69746044820152606401610c35565b600f546001600160a01b038481169116148015906124b857506001600160a01b03821660009081526005602052604090205460ff16155b80156124dd57506001600160a01b03831660009081526005602052604090205460ff16155b80156124f25750600a5462010000900460ff16155b15612655576014548111156125495760405162461bcd60e51b815260206004820152601e60248201527f596f752061726520657863656564696e67206d617853656c6c4c696d697400006044820152606401610c35565b600f546001600160a01b038381169116146125c3576015548161256b84611763565b6125759190613bae565b11156125c35760405162461bcd60e51b815260206004820181905260248201527f596f752061726520657863656564696e67206d617857616c6c65744c696d69746044820152606401610c35565b600c5460ff1615612655576001600160a01b0383166000908152600b60205260408120546125f19042613cf5565b9050600d548110156126385760405162461bcd60e51b815260206004820152601060248201526f10dbdbdb191bdddb88195b98589b195960821b6044820152606401610c35565b506001600160a01b0383166000908152600b602052604090204290555b600060125461266330611763565b600a54911115915062010000900460ff161580156126885750600a54610100900460ff165b80156126915750805b80156126ab5750600f546001600160a01b03858116911614155b80156126d057506001600160a01b03841660009081526005602052604090205460ff16155b80156126f557506001600160a01b03831660009081526005602052604090205460ff16155b1561275f57601254600f5461275f91906001600160a01b0386811691161461271e57601b612721565b60205b6040805160a0810182528254815260018301546020820152600283015491810191909152600382015460608201526004909101546080820152612d2f565b600a5460019060009062010000900460ff168061279457506001600160a01b03861660009081526005602052604090205460ff165b806127b757506001600160a01b03851660009081526005602052604090205460ff165b156127c157600091505b600f546001600160a01b03868116911614156127db575060015b6127e886868685856129d5565b505050505050565b604080516002808252606082018352600092602083019080368337019050509050308160008151811061282557612825613d53565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561287957600080fd5b505afa15801561288d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b191906136d7565b816001815181106128c4576128c4613d53565b6001600160a01b039283166020918202929092010152600e546128ea9130911684611ee6565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790612923908590600090869030904290600401613ae8565b600060405180830381600087803b15801561293d57600080fd5b505af11580156127e8573d6000803e3d6000fd5b600080600061295e612ed5565b909250905061296d8183613bc6565b9250505090565b61297c6135d7565b612987848484613058565b905061299c818585612997612951565b613213565b60c0870152608086015260608501526040840152602083015281526129c981846129c4612951565b6132e7565b60a08201529392505050565b60006129e2848484612974565b6001600160a01b03871660009081526006602052604090205490915060ff1615612a44576001600160a01b038616600090815260036020526040902054612a2a908590613cf5565b6001600160a01b0387166000908152600360205260409020555b6001600160a01b03851660009081526006602052604090205460ff1615612aa75760e08101516001600160a01b038616600090815260036020526040902054612a8d9190613bae565b6001600160a01b0386166000908152600360205260409020555b80516001600160a01b038716600090815260026020526040902054612acc9190613cf5565b6001600160a01b0380881660009081526002602090815260408083209490945584015191881681529190912054612b039190613bae565b6001600160a01b0386166000908152600260205260409081902091909155810151151580612b3657506000816101000151115b15612b4e57612b4e816040015182610100015161330f565b600081608001511180612b6657506000816101400151115b15612bfb57612b7e8160800151826101400151613344565b306001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836101800151846101600151856101200151866101400151612bd59190613bae565b612bdf9190613bae565b612be99190613bae565b60405190815260200160405180910390a35b600081606001511180612c1357506000816101200151115b15612c2b57612c2b81606001518261012001516133ba565b60008160a001511180612c4357506000816101600151115b15612c5b57612c5b8160a001518261016001516133cf565b61018081015115612c8657601a54610180820151612c869188916001600160a01b039091169061200a565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360e00151604051612ccf91815260200190565b60405180910390a3505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600a805462ff000019166201000017905560808101516060820151602083015160408401516000939291612d6291613bae565b612d6c9190613bae565b612d769190613bae565b612d81906002613cd6565b9050600081836040015185612d969190613cd6565b612da09190613bc6565b90506000612dae8286613cf5565b905047612dba826127f0565b6000612dc68247613cf5565b90506000866040015186612dda9190613cf5565b612de49083613bc6565b90506000876040015182612df89190613cd6565b90508015612e0a57612e0a86826133e4565b6020880151600090612e1d846002613cd6565b612e279190613cd6565b90508015612e4557601754612e45906001600160a01b0316826134be565b6060890151600090612e58856002613cd6565b612e629190613cd6565b90508015612e8057601854612e80906001600160a01b0316826134be565b60808a0151600090612e93866002613cd6565b612e9d9190613cd6565b90508015612ebb57601a54612ebb906001600160a01b0316826134be565b5050600a805462ff00001916905550505050505050505050565b6011546010546000918291825b60095481101561302757826002600060098481548110612f0457612f04613d53565b60009182526020808320909101546001600160a01b031683528201929092526040019020541180612f6f5750816003600060098481548110612f4857612f48613d53565b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15612f8557601154601054945094505050509091565b6002600060098381548110612f9c57612f9c613d53565b60009182526020808320909101546001600160a01b03168352820192909252604001902054612fcb9084613cf5565b92506003600060098381548110612fe457612fe4613d53565b60009182526020808320909101546001600160a01b031683528201929092526040019020546130139083613cf5565b91508061301f81613d0c565b915050612ee2565b506010546011546130389190613bc6565b82101561304f576011546010549350935050509091565b90939092509050565b6130606135d7565b826130715760e0810184905261100f565b6130a36040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b82156130e057506040805160a081018252602080548252602154908201526022549181019190915260235460608201526024546080820152613113565b506040805160a081018252601b548152601c546020820152601d5491810191909152601e546060820152601f5460808201525b80516064906131229087613cd6565b61312c9190613bc6565b61010083015260208101516064906131449087613cd6565b61314e9190613bc6565b61012083015260408101516064906131669087613cd6565b6131709190613bc6565b61014083015260608101516064906131889087613cd6565b6131929190613bc6565b61016083015260808101516064906131aa9087613cd6565b6131b49190613bc6565b61018083018190526101608301516101408401516101208501516101008601516131de908a613cf5565b6131e89190613cf5565b6131f29190613cf5565b6131fc9190613cf5565b6132069190613cf5565b60e0830152509392505050565b60008080808080613224878a613cd6565b95508761323f575084935060009250829150819050806132da565b868a61010001516132509190613cd6565b9350868a61012001516132639190613cd6565b9250868a61014001516132769190613cd6565b91506000878b610160015161328b9190613cd6565b9050878b610180015161329e9190613cd6565b9150818184866132ae898c613cf5565b6132b89190613cf5565b6132c29190613cf5565b6132cc9190613cf5565b6132d69190613cf5565b9550505b9499939850945094509450565b6000826132f65750600061100f565b818461016001516133079190613cd6565b949350505050565b81601160008282546133219190613cf5565b90915550506025805482919060009061333b908490613bae565b90915550505050565b80602560020160008282546133599190613bae565b90915550503060009081526006602052604090205460ff161561339b573060009081526003602052604081208054839290613395908490613bae565b90915550505b306000908152600260205260408120805484929061333b908490613bae565b80602560010160008282546133599190613bae565b80602560030160008282546133599190613bae565b600e546133fc9030906001600160a01b031684611ee6565b600e546001600160a01b031663f305d71982308560008061341b61184e565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561347e57600080fd5b505af1158015613492573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906134b79190613989565b5050505050565b8047101561350e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610c35565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461355b576040519150601f19603f3d011682016040523d82523d6000602084013e613560565b606091505b5050905080610df25760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610c35565b604051806101a00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b600082601f83011261365057600080fd5b8135602061366561366083613b8a565b613b59565b80838252828201915082860187848660051b890101111561368557600080fd5b60005b858110156136ad57813561369b81613d7f565b84529284019290840190600101613688565b5090979650505050505050565b6000602082840312156136cc57600080fd5b813561100f81613d7f565b6000602082840312156136e957600080fd5b815161100f81613d7f565b6000806040838503121561370757600080fd5b823561371281613d7f565b9150602083013561372281613d7f565b809150509250929050565b60008060006060848603121561374257600080fd5b833561374d81613d7f565b9250602084013561375d81613d7f565b929592945050506040919091013590565b6000806040838503121561378157600080fd5b823561378c81613d7f565b9150602083013561372281613d94565b600080604083850312156137af57600080fd5b82356137ba81613d7f565b946020939093013593505050565b600080604083850312156137db57600080fd5b823567ffffffffffffffff808211156137f357600080fd5b6137ff8683870161363f565b935060209150818501358181111561381657600080fd5b85019050601f8101861361382957600080fd5b803561383761366082613b8a565b80828252848201915084840189868560051b870101111561385757600080fd5b600094505b8385101561387a57803583526001949094019391850191850161385c565b5080955050505050509250929050565b6000806040838503121561389d57600080fd5b823567ffffffffffffffff8111156138b457600080fd5b6138c08582860161363f565b925050602083013561372281613d94565b6000602082840312156138e357600080fd5b813561100f81613d94565b60006020828403121561390057600080fd5b815161100f81613d94565b6000806040838503121561391e57600080fd5b82356137ba81613d94565b60006020828403121561393b57600080fd5b5035919050565b6000806040838503121561395557600080fd5b82359150602083013561372281613d94565b6000806040838503121561397a57600080fd5b50508035926020909101359150565b60008060006060848603121561399e57600080fd5b8351925060208401519150604084015190509250925092565b600080600080600060a086880312156139cf57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b600060208083528351808285015260005b81811015613a1f57858101830151858201604001528201613a03565b81811115613a31576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4c502077616c6c65742063616e6e6f7420626520626c61636b6c69737465642e604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526017908201527f54726164696e67206e6f7420656e61626c656420796574000000000000000000604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015613b385784516001600160a01b031683529383019391830191600101613b13565b50506001600160a01b03969096166060850152505050608001529392505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715613b8257613b82613d69565b604052919050565b600067ffffffffffffffff821115613ba457613ba4613d69565b5060051b60200190565b60008219821115613bc157613bc1613d27565b500190565b600082613be357634e487b7160e01b600052601260045260246000fd5b500490565b600181815b80851115613c23578160001904821115613c0957613c09613d27565b80851615613c1657918102915b93841c9390800290613bed565b509250929050565b600061100f60ff841683600082613c445750600161139d565b81613c515750600061139d565b8160018114613c675760028114613c7157613c8d565b600191505061139d565b60ff841115613c8257613c82613d27565b50506001821b61139d565b5060208310610133831016604e8410600b8410161715613cb0575081810a61139d565b613cba8383613be8565b8060001904821115613cce57613cce613d27565b029392505050565b6000816000190483118215151615613cf057613cf0613d27565b500290565b600082821015613d0757613d07613d27565b500390565b6000600019821415613d2057613d20613d27565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610f8f57600080fd5b8015158114610f8f57600080fdfea2646970667358221220472c86ebe35c907b4de53a407f93bfbcb687ec05724c98dff43e1f0dc4ed00f564736f6c63430008070033 | |
1 | 20,290,386 | 262139f90d57f766e5957c0bbec0a0127a4aa23db743d1a198665a8492b7cf86 | ee5a4723a908c04b5d24089c48d3c3abf6379fe1cbac37d9f1d79ec5144f2973 | d2cbd34053935b874ce92c16d0e016a6aaf39ad0 | 5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f | ee4e0f103319d6cd21f9acea2a95a0680efcfc5f | 60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429 | 608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032 | // File: contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/interfaces/IUniswapV2ERC20.sol
pragma solidity >=0.5.0;
interface IUniswapV2ERC20 {
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;
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/UniswapV2ERC20.sol
pragma solidity =0.5.16;
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// File: contracts/libraries/Math.sol
pragma solidity =0.5.16;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// File: contracts/libraries/UQ112x112.sol
pragma solidity =0.5.16;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view 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);
}
// File: contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/interfaces/IUniswapV2Callee.sol
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// File: contracts/UniswapV2Pair.sol
pragma solidity =0.5.16;
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
}
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);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(5).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = IERC20(_token0).balanceOf(address(this));
uint balance1 = IERC20(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
} |
1 | 20,290,391 | 44295738efc3ead1e61c0e376854eabf83d46e0b6d996cc1f6c8cf4bdcfb3bad | e19b1d500711856f7b348db74175049dc0ae51d9b0b01e4ca0fd92508905a5a5 | cc2bc4f50aa27dbfbb7afbfc3ccb80995f8d4a44 | ffa397285ce46fb78c588a9e993286aac68c37cd | 40e804fc0f025c4fc4b332229ec0e0407f1d74b7 | 3d602d80600a3d3981f3363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | pragma solidity 0.7.5;
/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//solhint-disable max-line-length
//solhint-disable no-inline-assembly
contract CloneFactory {
function createClone(address target, bytes32 salt)
internal
returns (address payable result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the clone contract data
let clone := mload(0x40)
// The bytecode block below is responsible for contract initialization
// during deployment, it is worth noting the proxied contract constructor will not be called during
// the cloning procedure and that is why an initialization function needs to be called after the
// clone is created
mstore(
clone,
0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000
)
// This stores the address location of the implementation contract
// so that the proxy knows where to delegate call logic to
mstore(add(clone, 0x14), targetBytes)
// The bytecode block is the actual code that is deployed for each clone created.
// It forwards all calls to the already deployed implementation via a delegatecall
mstore(
add(clone, 0x28),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// deploy the contract using the CREATE2 opcode
// this deploys the minimal proxy defined above, which will proxy all
// calls to use the logic defined in the implementation contract `target`
result := create2(0, clone, 0x37, salt)
}
}
function isClone(address target, address query)
internal
view
returns (bool result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the comparison clone
let clone := mload(0x40)
// The next three lines store the expected bytecode for a miniml proxy
// that targets `target` as its implementation contract
mstore(
clone,
0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000
)
mstore(add(clone, 0xa), targetBytes)
mstore(
add(clone, 0x1e),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// the next two lines store the bytecode of the contract that we are checking in memory
let other := add(clone, 0x40)
extcodecopy(query, other, 0, 0x2d)
// Check if the expected bytecode equals the actual bytecode and return the result
result := and(
eq(mload(clone), mload(other)),
eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
)
}
}
}
/**
* Contract that exposes the needed erc20 token functions
*/
abstract contract ERC20Interface {
// Send _value amount of tokens to address _to
function transfer(address _to, uint256 _value)
public
virtual
returns (bool success);
// Get the account balance of another account with address _owner
function balanceOf(address _owner)
public
virtual
view
returns (uint256 balance);
}
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeApprove: approve failed'
);
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeTransfer: transfer failed'
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::transferFrom: transferFrom failed'
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
}
}
/**
* Contract that will forward any incoming Ether to the creator of the contract
*
*/
contract Forwarder {
// Address to which any funds sent to this contract will be forwarded
address public parentAddress;
event ForwarderDeposited(address from, uint256 value, bytes data);
/**
* Initialize the contract, and sets the destination address to that of the creator
*/
function init(address _parentAddress) external onlyUninitialized {
parentAddress = _parentAddress;
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
// NOTE: since we are forwarding on initialization,
// we don't have the context of the original sender.
// We still emit an event about the forwarding but set
// the sender to the forwarder itself
emit ForwarderDeposited(address(this), value, msg.data);
}
/**
* Modifier that will execute internal code block only if the sender is the parent address
*/
modifier onlyParent {
require(msg.sender == parentAddress, 'Only Parent');
_;
}
/**
* Modifier that will execute internal code block only if the contract has not been initialized yet
*/
modifier onlyUninitialized {
require(parentAddress == address(0x0), 'Already initialized');
_;
}
/**
* Default function; Gets called when data is sent but does not match any other function
*/
fallback() external payable {
flush();
}
/**
* Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address
*/
receive() external payable {
flush();
}
/**
* Execute a token transfer of the full balance from the forwarder token to the parent address
* @param tokenContractAddress the address of the erc20 token contract
*/
function flushTokens(address tokenContractAddress) external onlyParent {
ERC20Interface instance = ERC20Interface(tokenContractAddress);
address forwarderAddress = address(this);
uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
if (forwarderBalance == 0) {
return;
}
TransferHelper.safeTransfer(
tokenContractAddress,
parentAddress,
forwarderBalance
);
}
/**
* Flush the entire balance of the contract to the parent address.
*/
function flush() public {
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
emit ForwarderDeposited(msg.sender, value, msg.data);
}
}
contract ForwarderFactory is CloneFactory {
address public implementationAddress;
event ForwarderCreated(address newForwarderAddress, address parentAddress);
constructor(address _implementationAddress) {
implementationAddress = _implementationAddress;
}
function createForwarder(address parent, bytes32 salt) external {
// include the signers in the salt so any contract deployed to a given address must have the same signers
bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt));
address payable clone = createClone(implementationAddress, finalSalt);
Forwarder(clone).init(parent);
emit ForwarderCreated(clone, parent);
}
} |
1 | 20,290,392 | 158b2618ecbc0db94510a3a780f6c2f3b534a1f7617fd068c2e5c332d0bdabc8 | 3b8cbd4edf8caf24c9af09f0787ecb344bb9d106796d1474aeb61a20dd7a981f | c5d4353386e57c3c506584e3cb53088113ce57e4 | c2e3c5d67617fc657a0ed2388cdbbc935ce1fdc2 | a1dd798a9f43ad86223fa732a5b3d7a1f561989c | 60806040523480156200001157600080fd5b506040516200230238038062002302833981810160405281019062000037919062000426565b6200004b848484846200005560201b60201c565b50505050620008a6565b836000908162000066919062000717565b50826001908162000078919062000717565b506012600260006101000a81548160ff021916908360ff16021790555081600681905550650746a5288000600654620000b291906200082d565b60038190555080600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060035460046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600354604051620001e5919062000889565b60405180910390a350505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200025c8262000211565b810181811067ffffffffffffffff821117156200027e576200027d62000222565b5b80604052505050565b600062000293620001f3565b9050620002a1828262000251565b919050565b600067ffffffffffffffff821115620002c457620002c362000222565b5b620002cf8262000211565b9050602081019050919050565b60005b83811015620002fc578082015181840152602081019050620002df565b60008484015250505050565b60006200031f6200031984620002a6565b62000287565b9050828152602081018484840111156200033e576200033d6200020c565b5b6200034b848285620002dc565b509392505050565b600082601f8301126200036b576200036a62000207565b5b81516200037d84826020860162000308565b91505092915050565b6000819050919050565b6200039b8162000386565b8114620003a757600080fd5b50565b600081519050620003bb8162000390565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620003ee82620003c1565b9050919050565b6200040081620003e1565b81146200040c57600080fd5b50565b6000815190506200042081620003f5565b92915050565b60008060008060808587031215620004435762000442620001fd565b5b600085015167ffffffffffffffff81111562000464576200046362000202565b5b620004728782880162000353565b945050602085015167ffffffffffffffff81111562000496576200049562000202565b5b620004a48782880162000353565b9350506040620004b787828801620003aa565b9250506060620004ca878288016200040f565b91505092959194509250565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200052957607f821691505b6020821081036200053f576200053e620004e1565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620005a97fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200056a565b620005b586836200056a565b95508019841693508086168417925050509392505050565b6000819050919050565b6000620005f8620005f2620005ec8462000386565b620005cd565b62000386565b9050919050565b6000819050919050565b6200061483620005d7565b6200062c6200062382620005ff565b84845462000577565b825550505050565b600090565b6200064362000634565b6200065081848462000609565b505050565b5b8181101562000678576200066c60008262000639565b60018101905062000656565b5050565b601f821115620006c757620006918162000545565b6200069c846200055a565b81016020851015620006ac578190505b620006c4620006bb856200055a565b83018262000655565b50505b505050565b600082821c905092915050565b6000620006ec60001984600802620006cc565b1980831691505092915050565b6000620007078383620006d9565b9150826002028217905092915050565b6200072282620004d6565b67ffffffffffffffff8111156200073e576200073d62000222565b5b6200074a825462000510565b620007578282856200067c565b600060209050601f8311600181146200078f57600084156200077a578287015190505b620007868582620006f9565b865550620007f6565b601f1984166200079f8662000545565b60005b82811015620007c957848901518255600182019150602085019450602081019050620007a2565b86831015620007e95784890151620007e5601f891682620006d9565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006200083a8262000386565b9150620008478362000386565b9250828202620008578162000386565b91508282048414831517620008715762000870620007fe565b5b5092915050565b620008838162000386565b82525050565b6000602082019050620008a0600083018462000878565b92915050565b611a4c80620008b66000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c8063a293d1e8116100ad578063d43a632f11610071578063d43a632f1461036d578063dd62ed3e14610389578063e6cb9013146103b9578063e6fdb7ea146103e9578063fb7ed961146104075761012c565b8063a293d1e814610291578063a9059cbb146102c1578063b5931f7c146102f1578063bd3a13f614610321578063d05c78da1461033d5761012c565b8063484b1c13116100f4578063484b1c13146101eb5780635012fb721461020957806370a082311461022757806395d89b4114610257578063a06c1a33146102755761012c565b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461017f57806323b872dd1461019d578063313ce567146101cd575b600080fd5b610139610423565b6040516101469190610f01565b60405180910390f35b61016960048036038101906101649190610fcb565b6104b1565b6040516101769190611026565b60405180910390f35b6101876105a3565b6040516101949190611050565b60405180910390f35b6101b760048036038101906101b2919061106b565b6105a9565b6040516101c49190611026565b60405180910390f35b6101d56106c7565b6040516101e291906110da565b60405180910390f35b6101f36106da565b6040516102009190611050565b60405180910390f35b6102116106e0565b60405161021e9190611050565b60405180910390f35b610241600480360381019061023c91906110f5565b6106e6565b60405161024e9190611050565b60405180910390f35b61025f61078f565b60405161026c9190610f01565b60405180910390f35b61028f600480360381019061028a919061126a565b61081d565b005b6102ab60048036038101906102a691906112b3565b610829565b6040516102b89190611050565b60405180910390f35b6102db60048036038101906102d69190610fcb565b61084c565b6040516102e89190611026565b60405180910390f35b61030b600480360381019061030691906112b3565b610863565b6040516103189190611050565b60405180910390f35b61033b600480360381019061033691906113a8565b610885565b005b610357600480360381019061035291906112b3565b610a1b565b6040516103649190611050565b60405180910390f35b6103876004803603810190610382919061126a565b610a53565b005b6103a3600480360381019061039e9190611447565b610bde565b6040516103b09190611050565b60405180910390f35b6103d360048036038101906103ce91906112b3565b610c65565b6040516103e09190611050565b60405180910390f35b6103f1610c88565b6040516103fe9190611496565b60405180910390f35b610421600480360381019061041c919061126a565b610cae565b005b60008054610430906114e0565b80601f016020809104026020016040519081016040528092919081815260200182805461045c906114e0565b80156104a95780601f1061047e576101008083540402835291602001916104a9565b820191906000526020600020905b81548152906001019060200180831161048c57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516105919190611050565b60405180910390a36001905092915050565b60035481565b6000610631600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610829565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506106bc848484610cba565b600190509392505050565b600260009054906101000a900460ff1681565b60065481565b60075481565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361078457600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061078a565b60075490505b919050565b6001805461079c906114e0565b80601f01602080910402602001604051908101604052809291908181526020018280546107c8906114e0565b80156108155780601f106107ea57610100808354040283529160200191610815565b820191906000526020600020905b8154815290600101906020018083116107f857829003601f168201915b505050505081565b61082681610a53565b50565b60008282111561083857600080fd5b81836108449190611540565b905092915050565b6000610859338484610cba565b6001905092915050565b600080821161087157600080fd5b818361087d91906115a3565b905092915050565b83600090816108949190611780565b5082600190816108a49190611780565b506012600260006101000a81548160ff021916908360ff16021790555081600681905550650746a52880006006546108dc9190611852565b60038190555080600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060035460046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600354604051610a0d9190611050565b60405180910390a350505050565b60008183610a299190611852565b90506000831480610a445750818382610a4291906115a3565b145b610a4d57600080fd5b92915050565b60008151905060005b81811015610b5457670de0b6b3a76400006188b86201ccf1610a7c610e3c565b610a869190611894565b610a9091906118c5565b610a9a9190611852565b600781905550828181518110610ab357610ab26118f9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600754604051610b3b9190611050565b60405180910390a380610b4d90611928565b9050610a5c565b5080600754610b639190611852565b60046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610bd39190611540565b925050819055505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008183610c7391906118c5565b905082811015610c8257600080fd5b92915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb781610a53565b50565b610d03600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610829565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d8f600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610c65565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610e2f9190611050565b60405180910390a3505050565b6000444233604051602001610e53939291906119d9565b6040516020818303038152906040528051906020012060001c905090565b600081519050919050565b600082825260208201905092915050565b60005b83811015610eab578082015181840152602081019050610e90565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ed382610e71565b610edd8185610e7c565b9350610eed818560208601610e8d565b610ef681610eb7565b840191505092915050565b60006020820190508181036000830152610f1b8184610ec8565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610f6282610f37565b9050919050565b610f7281610f57565b8114610f7d57600080fd5b50565b600081359050610f8f81610f69565b92915050565b6000819050919050565b610fa881610f95565b8114610fb357600080fd5b50565b600081359050610fc581610f9f565b92915050565b60008060408385031215610fe257610fe1610f2d565b5b6000610ff085828601610f80565b925050602061100185828601610fb6565b9150509250929050565b60008115159050919050565b6110208161100b565b82525050565b600060208201905061103b6000830184611017565b92915050565b61104a81610f95565b82525050565b60006020820190506110656000830184611041565b92915050565b60008060006060848603121561108457611083610f2d565b5b600061109286828701610f80565b93505060206110a386828701610f80565b92505060406110b486828701610fb6565b9150509250925092565b600060ff82169050919050565b6110d4816110be565b82525050565b60006020820190506110ef60008301846110cb565b92915050565b60006020828403121561110b5761110a610f2d565b5b600061111984828501610f80565b91505092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61115f82610eb7565b810181811067ffffffffffffffff8211171561117e5761117d611127565b5b80604052505050565b6000611191610f23565b905061119d8282611156565b919050565b600067ffffffffffffffff8211156111bd576111bc611127565b5b602082029050602081019050919050565b600080fd5b60006111e66111e1846111a2565b611187565b90508083825260208201905060208402830185811115611209576112086111ce565b5b835b81811015611232578061121e8882610f80565b84526020840193505060208101905061120b565b5050509392505050565b600082601f83011261125157611250611122565b5b81356112618482602086016111d3565b91505092915050565b6000602082840312156112805761127f610f2d565b5b600082013567ffffffffffffffff81111561129e5761129d610f32565b5b6112aa8482850161123c565b91505092915050565b600080604083850312156112ca576112c9610f2d565b5b60006112d885828601610fb6565b92505060206112e985828601610fb6565b9150509250929050565b600080fd5b600067ffffffffffffffff82111561131357611312611127565b5b61131c82610eb7565b9050602081019050919050565b82818337600083830152505050565b600061134b611346846112f8565b611187565b905082815260208101848484011115611367576113666112f3565b5b611372848285611329565b509392505050565b600082601f83011261138f5761138e611122565b5b813561139f848260208601611338565b91505092915050565b600080600080608085870312156113c2576113c1610f2d565b5b600085013567ffffffffffffffff8111156113e0576113df610f32565b5b6113ec8782880161137a565b945050602085013567ffffffffffffffff81111561140d5761140c610f32565b5b6114198782880161137a565b935050604061142a87828801610fb6565b925050606061143b87828801610f80565b91505092959194509250565b6000806040838503121561145e5761145d610f2d565b5b600061146c85828601610f80565b925050602061147d85828601610f80565b9150509250929050565b61149081610f57565b82525050565b60006020820190506114ab6000830184611487565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806114f857607f821691505b60208210810361150b5761150a6114b1565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061154b82610f95565b915061155683610f95565b925082820390508181111561156e5761156d611511565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006115ae82610f95565b91506115b983610f95565b9250826115c9576115c8611574565b5b828204905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026116367fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826115f9565b61164086836115f9565b95508019841693508086168417925050509392505050565b6000819050919050565b600061167d61167861167384610f95565b611658565b610f95565b9050919050565b6000819050919050565b61169783611662565b6116ab6116a382611684565b848454611606565b825550505050565b600090565b6116c06116b3565b6116cb81848461168e565b505050565b5b818110156116ef576116e46000826116b8565b6001810190506116d1565b5050565b601f82111561173457611705816115d4565b61170e846115e9565b8101602085101561171d578190505b611731611729856115e9565b8301826116d0565b50505b505050565b600082821c905092915050565b600061175760001984600802611739565b1980831691505092915050565b60006117708383611746565b9150826002028217905092915050565b61178982610e71565b67ffffffffffffffff8111156117a2576117a1611127565b5b6117ac82546114e0565b6117b78282856116f3565b600060209050601f8311600181146117ea57600084156117d8578287015190505b6117e28582611764565b86555061184a565b601f1984166117f8866115d4565b60005b82811015611820578489015182556001820191506020850194506020810190506117fb565b8683101561183d5784890151611839601f891682611746565b8355505b6001600288020188555050505b505050505050565b600061185d82610f95565b915061186883610f95565b925082820261187681610f95565b9150828204841483151761188d5761188c611511565b5b5092915050565b600061189f82610f95565b91506118aa83610f95565b9250826118ba576118b9611574565b5b828206905092915050565b60006118d082610f95565b91506118db83610f95565b92508282019050808211156118f3576118f2611511565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061193382610f95565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361196557611964611511565b5b600182019050919050565b6000819050919050565b61198b61198682610f95565b611970565b82525050565b60008160601b9050919050565b60006119a982611991565b9050919050565b60006119bb8261199e565b9050919050565b6119d36119ce82610f57565b6119b0565b82525050565b60006119e5828661197a565b6020820191506119f5828561197a565b602082019150611a0582846119c2565b60148201915081905094935050505056fea264697066735822122077b7a99e247bb3922bc90b399fb2d4941b702c4fec6de2665f8d8573ce2a687f64736f6c63430008120033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000010f0cf064dd59200000000000000000000000000000087cc45fff5c0933bb6af6bae7fc013b7ec7df2ee000000000000000000000000000000000000000000000000000000000000000b212020202020204659444500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000194679646520506f696e7473202d207777772e667964652e636300000000000000 | 608060405234801561001057600080fd5b506004361061012c5760003560e01c8063a293d1e8116100ad578063d43a632f11610071578063d43a632f1461036d578063dd62ed3e14610389578063e6cb9013146103b9578063e6fdb7ea146103e9578063fb7ed961146104075761012c565b8063a293d1e814610291578063a9059cbb146102c1578063b5931f7c146102f1578063bd3a13f614610321578063d05c78da1461033d5761012c565b8063484b1c13116100f4578063484b1c13146101eb5780635012fb721461020957806370a082311461022757806395d89b4114610257578063a06c1a33146102755761012c565b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461017f57806323b872dd1461019d578063313ce567146101cd575b600080fd5b610139610423565b6040516101469190610f01565b60405180910390f35b61016960048036038101906101649190610fcb565b6104b1565b6040516101769190611026565b60405180910390f35b6101876105a3565b6040516101949190611050565b60405180910390f35b6101b760048036038101906101b2919061106b565b6105a9565b6040516101c49190611026565b60405180910390f35b6101d56106c7565b6040516101e291906110da565b60405180910390f35b6101f36106da565b6040516102009190611050565b60405180910390f35b6102116106e0565b60405161021e9190611050565b60405180910390f35b610241600480360381019061023c91906110f5565b6106e6565b60405161024e9190611050565b60405180910390f35b61025f61078f565b60405161026c9190610f01565b60405180910390f35b61028f600480360381019061028a919061126a565b61081d565b005b6102ab60048036038101906102a691906112b3565b610829565b6040516102b89190611050565b60405180910390f35b6102db60048036038101906102d69190610fcb565b61084c565b6040516102e89190611026565b60405180910390f35b61030b600480360381019061030691906112b3565b610863565b6040516103189190611050565b60405180910390f35b61033b600480360381019061033691906113a8565b610885565b005b610357600480360381019061035291906112b3565b610a1b565b6040516103649190611050565b60405180910390f35b6103876004803603810190610382919061126a565b610a53565b005b6103a3600480360381019061039e9190611447565b610bde565b6040516103b09190611050565b60405180910390f35b6103d360048036038101906103ce91906112b3565b610c65565b6040516103e09190611050565b60405180910390f35b6103f1610c88565b6040516103fe9190611496565b60405180910390f35b610421600480360381019061041c919061126a565b610cae565b005b60008054610430906114e0565b80601f016020809104026020016040519081016040528092919081815260200182805461045c906114e0565b80156104a95780601f1061047e576101008083540402835291602001916104a9565b820191906000526020600020905b81548152906001019060200180831161048c57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516105919190611050565b60405180910390a36001905092915050565b60035481565b6000610631600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610829565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506106bc848484610cba565b600190509392505050565b600260009054906101000a900460ff1681565b60065481565b60075481565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361078457600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061078a565b60075490505b919050565b6001805461079c906114e0565b80601f01602080910402602001604051908101604052809291908181526020018280546107c8906114e0565b80156108155780601f106107ea57610100808354040283529160200191610815565b820191906000526020600020905b8154815290600101906020018083116107f857829003601f168201915b505050505081565b61082681610a53565b50565b60008282111561083857600080fd5b81836108449190611540565b905092915050565b6000610859338484610cba565b6001905092915050565b600080821161087157600080fd5b818361087d91906115a3565b905092915050565b83600090816108949190611780565b5082600190816108a49190611780565b506012600260006101000a81548160ff021916908360ff16021790555081600681905550650746a52880006006546108dc9190611852565b60038190555080600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060035460046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600354604051610a0d9190611050565b60405180910390a350505050565b60008183610a299190611852565b90506000831480610a445750818382610a4291906115a3565b145b610a4d57600080fd5b92915050565b60008151905060005b81811015610b5457670de0b6b3a76400006188b86201ccf1610a7c610e3c565b610a869190611894565b610a9091906118c5565b610a9a9190611852565b600781905550828181518110610ab357610ab26118f9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600754604051610b3b9190611050565b60405180910390a380610b4d90611928565b9050610a5c565b5080600754610b639190611852565b60046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610bd39190611540565b925050819055505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008183610c7391906118c5565b905082811015610c8257600080fd5b92915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb781610a53565b50565b610d03600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610829565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d8f600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610c65565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610e2f9190611050565b60405180910390a3505050565b6000444233604051602001610e53939291906119d9565b6040516020818303038152906040528051906020012060001c905090565b600081519050919050565b600082825260208201905092915050565b60005b83811015610eab578082015181840152602081019050610e90565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ed382610e71565b610edd8185610e7c565b9350610eed818560208601610e8d565b610ef681610eb7565b840191505092915050565b60006020820190508181036000830152610f1b8184610ec8565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610f6282610f37565b9050919050565b610f7281610f57565b8114610f7d57600080fd5b50565b600081359050610f8f81610f69565b92915050565b6000819050919050565b610fa881610f95565b8114610fb357600080fd5b50565b600081359050610fc581610f9f565b92915050565b60008060408385031215610fe257610fe1610f2d565b5b6000610ff085828601610f80565b925050602061100185828601610fb6565b9150509250929050565b60008115159050919050565b6110208161100b565b82525050565b600060208201905061103b6000830184611017565b92915050565b61104a81610f95565b82525050565b60006020820190506110656000830184611041565b92915050565b60008060006060848603121561108457611083610f2d565b5b600061109286828701610f80565b93505060206110a386828701610f80565b92505060406110b486828701610fb6565b9150509250925092565b600060ff82169050919050565b6110d4816110be565b82525050565b60006020820190506110ef60008301846110cb565b92915050565b60006020828403121561110b5761110a610f2d565b5b600061111984828501610f80565b91505092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61115f82610eb7565b810181811067ffffffffffffffff8211171561117e5761117d611127565b5b80604052505050565b6000611191610f23565b905061119d8282611156565b919050565b600067ffffffffffffffff8211156111bd576111bc611127565b5b602082029050602081019050919050565b600080fd5b60006111e66111e1846111a2565b611187565b90508083825260208201905060208402830185811115611209576112086111ce565b5b835b81811015611232578061121e8882610f80565b84526020840193505060208101905061120b565b5050509392505050565b600082601f83011261125157611250611122565b5b81356112618482602086016111d3565b91505092915050565b6000602082840312156112805761127f610f2d565b5b600082013567ffffffffffffffff81111561129e5761129d610f32565b5b6112aa8482850161123c565b91505092915050565b600080604083850312156112ca576112c9610f2d565b5b60006112d885828601610fb6565b92505060206112e985828601610fb6565b9150509250929050565b600080fd5b600067ffffffffffffffff82111561131357611312611127565b5b61131c82610eb7565b9050602081019050919050565b82818337600083830152505050565b600061134b611346846112f8565b611187565b905082815260208101848484011115611367576113666112f3565b5b611372848285611329565b509392505050565b600082601f83011261138f5761138e611122565b5b813561139f848260208601611338565b91505092915050565b600080600080608085870312156113c2576113c1610f2d565b5b600085013567ffffffffffffffff8111156113e0576113df610f32565b5b6113ec8782880161137a565b945050602085013567ffffffffffffffff81111561140d5761140c610f32565b5b6114198782880161137a565b935050604061142a87828801610fb6565b925050606061143b87828801610f80565b91505092959194509250565b6000806040838503121561145e5761145d610f2d565b5b600061146c85828601610f80565b925050602061147d85828601610f80565b9150509250929050565b61149081610f57565b82525050565b60006020820190506114ab6000830184611487565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806114f857607f821691505b60208210810361150b5761150a6114b1565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061154b82610f95565b915061155683610f95565b925082820390508181111561156e5761156d611511565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006115ae82610f95565b91506115b983610f95565b9250826115c9576115c8611574565b5b828204905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026116367fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826115f9565b61164086836115f9565b95508019841693508086168417925050509392505050565b6000819050919050565b600061167d61167861167384610f95565b611658565b610f95565b9050919050565b6000819050919050565b61169783611662565b6116ab6116a382611684565b848454611606565b825550505050565b600090565b6116c06116b3565b6116cb81848461168e565b505050565b5b818110156116ef576116e46000826116b8565b6001810190506116d1565b5050565b601f82111561173457611705816115d4565b61170e846115e9565b8101602085101561171d578190505b611731611729856115e9565b8301826116d0565b50505b505050565b600082821c905092915050565b600061175760001984600802611739565b1980831691505092915050565b60006117708383611746565b9150826002028217905092915050565b61178982610e71565b67ffffffffffffffff8111156117a2576117a1611127565b5b6117ac82546114e0565b6117b78282856116f3565b600060209050601f8311600181146117ea57600084156117d8578287015190505b6117e28582611764565b86555061184a565b601f1984166117f8866115d4565b60005b82811015611820578489015182556001820191506020850194506020810190506117fb565b8683101561183d5784890151611839601f891682611746565b8355505b6001600288020188555050505b505050505050565b600061185d82610f95565b915061186883610f95565b925082820261187681610f95565b9150828204841483151761188d5761188c611511565b5b5092915050565b600061189f82610f95565b91506118aa83610f95565b9250826118ba576118b9611574565b5b828206905092915050565b60006118d082610f95565b91506118db83610f95565b92508282019050808211156118f3576118f2611511565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061193382610f95565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361196557611964611511565b5b600182019050919050565b6000819050919050565b61198b61198682610f95565b611970565b82525050565b60008160601b9050919050565b60006119a982611991565b9050919050565b60006119bb8261199e565b9050919050565b6119d36119ce82610f57565b6119b0565b82525050565b60006119e5828661197a565b6020820191506119f5828561197a565b602082019150611a0582846119c2565b60148201915081905094935050505056fea264697066735822122077b7a99e247bb3922bc90b399fb2d4941b702c4fec6de2665f8d8573ce2a687f64736f6c63430008120033 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | 68a0273353d99a6e6397eab3b5458f27f5448a86 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | b517ac49d0ddd964a95b9029c7b3fda69bdf567e | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | 75a7f6bf328ae9489d939823b0ee6ac06f431794 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | 093e564fe3afb7301cfcbfa305b955a43633c700 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | ecf02a0dc701fdab0db0dd187742401321801d00 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | ffd24f1a5c813071746636ba10d74eb7214894f7 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | d658fe40ff9038f4c169cfba5776bceee81324fc | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | c9f177e899ccc9f39a6055436fa1ecbc3a68db00 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | 067b8aa34d6ebf179c791b1a496acf1ba5543892 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | a2537b15a3e8a4f97e7dcd55053dfa4e4cc6f504 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | 24a35caf87b64abedf96f043212b5accf33466b4 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | b4952b0e657e3787fb2a5aa82d3bce571ecdd2e2 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | ec246572731b144200af2734d0b47027b044dc0c | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | d327bb5c9b7627183f7b7025cf0f0737782d47f3 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | c8db595f4d9d4072a7d3e3326147d535c266790406f7508472c359f2362f3b21 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | ed9bf4969a813b096709aaa201c333da10adb3d9 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | 087324a78598d770aa8e0de0d59f8469a7bec7d650b4741cfc197b5f4047541b | d2c82f2e5fa236e114a81173e375a73664610998 | ffa397285ce46fb78c588a9e993286aac68c37cd | d507ae13d5b25102ffef91965f52425732699ac9 | 3d602d80600a3d3981f3363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | pragma solidity 0.7.5;
/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//solhint-disable max-line-length
//solhint-disable no-inline-assembly
contract CloneFactory {
function createClone(address target, bytes32 salt)
internal
returns (address payable result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the clone contract data
let clone := mload(0x40)
// The bytecode block below is responsible for contract initialization
// during deployment, it is worth noting the proxied contract constructor will not be called during
// the cloning procedure and that is why an initialization function needs to be called after the
// clone is created
mstore(
clone,
0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000
)
// This stores the address location of the implementation contract
// so that the proxy knows where to delegate call logic to
mstore(add(clone, 0x14), targetBytes)
// The bytecode block is the actual code that is deployed for each clone created.
// It forwards all calls to the already deployed implementation via a delegatecall
mstore(
add(clone, 0x28),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// deploy the contract using the CREATE2 opcode
// this deploys the minimal proxy defined above, which will proxy all
// calls to use the logic defined in the implementation contract `target`
result := create2(0, clone, 0x37, salt)
}
}
function isClone(address target, address query)
internal
view
returns (bool result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the comparison clone
let clone := mload(0x40)
// The next three lines store the expected bytecode for a miniml proxy
// that targets `target` as its implementation contract
mstore(
clone,
0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000
)
mstore(add(clone, 0xa), targetBytes)
mstore(
add(clone, 0x1e),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// the next two lines store the bytecode of the contract that we are checking in memory
let other := add(clone, 0x40)
extcodecopy(query, other, 0, 0x2d)
// Check if the expected bytecode equals the actual bytecode and return the result
result := and(
eq(mload(clone), mload(other)),
eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
)
}
}
}
/**
* Contract that exposes the needed erc20 token functions
*/
abstract contract ERC20Interface {
// Send _value amount of tokens to address _to
function transfer(address _to, uint256 _value)
public
virtual
returns (bool success);
// Get the account balance of another account with address _owner
function balanceOf(address _owner)
public
virtual
view
returns (uint256 balance);
}
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeApprove: approve failed'
);
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeTransfer: transfer failed'
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::transferFrom: transferFrom failed'
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
}
}
/**
* Contract that will forward any incoming Ether to the creator of the contract
*
*/
contract Forwarder {
// Address to which any funds sent to this contract will be forwarded
address public parentAddress;
event ForwarderDeposited(address from, uint256 value, bytes data);
/**
* Initialize the contract, and sets the destination address to that of the creator
*/
function init(address _parentAddress) external onlyUninitialized {
parentAddress = _parentAddress;
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
// NOTE: since we are forwarding on initialization,
// we don't have the context of the original sender.
// We still emit an event about the forwarding but set
// the sender to the forwarder itself
emit ForwarderDeposited(address(this), value, msg.data);
}
/**
* Modifier that will execute internal code block only if the sender is the parent address
*/
modifier onlyParent {
require(msg.sender == parentAddress, 'Only Parent');
_;
}
/**
* Modifier that will execute internal code block only if the contract has not been initialized yet
*/
modifier onlyUninitialized {
require(parentAddress == address(0x0), 'Already initialized');
_;
}
/**
* Default function; Gets called when data is sent but does not match any other function
*/
fallback() external payable {
flush();
}
/**
* Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address
*/
receive() external payable {
flush();
}
/**
* Execute a token transfer of the full balance from the forwarder token to the parent address
* @param tokenContractAddress the address of the erc20 token contract
*/
function flushTokens(address tokenContractAddress) external onlyParent {
ERC20Interface instance = ERC20Interface(tokenContractAddress);
address forwarderAddress = address(this);
uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
if (forwarderBalance == 0) {
return;
}
TransferHelper.safeTransfer(
tokenContractAddress,
parentAddress,
forwarderBalance
);
}
/**
* Flush the entire balance of the contract to the parent address.
*/
function flush() public {
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
emit ForwarderDeposited(msg.sender, value, msg.data);
}
}
contract ForwarderFactory is CloneFactory {
address public implementationAddress;
event ForwarderCreated(address newForwarderAddress, address parentAddress);
constructor(address _implementationAddress) {
implementationAddress = _implementationAddress;
}
function createForwarder(address parent, bytes32 salt) external {
// include the signers in the salt so any contract deployed to a given address must have the same signers
bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt));
address payable clone = createClone(implementationAddress, finalSalt);
Forwarder(clone).init(parent);
emit ForwarderCreated(clone, parent);
}
} |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | a50ab10d554e0777d159b070c97625cf56a8281feb2dcc7475687f1c996835d4 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | dafac6140b68403e320a8acd95a82215536c9b8b | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,396 | b8690a21789bd8c41b59da3bbdd16586ed9b7bc41ce0d0f1f3ddafc1c240a7c3 | a50ab10d554e0777d159b070c97625cf56a8281feb2dcc7475687f1c996835d4 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | b796ac328a57249e2a0eab4ffc1b3448bee1a15f | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,399 | 97db50abb1df8cf5461f030744cf63fa93aa7d86ae2d928669f6f090dfe8dfc2 | 4ecd61bc019c41944cb2d8bbaa03fd8c019a83f6407604ac13f183ebf6113a74 | 61d048e5becbd111c5d1e9bffa1e284ebcb230cc | 3922a76f04990676f21842bb0280728bcca6ae3b | e409fc6399faf00188b7123d9c991d3885401e8a | 6101a060405234801561001157600080fd5b506040516108293803806108298339810160408190526100309161014e565b506001600160a01b03918216608090815281515160a0908152825160209081015160e05283516040908101516001600160601b031660c0528451606001516001600160801b0390811661010052855190940151909316610120528351909101516101405282015190921661016052015161018052610234565b6001600160a01b03811681146100be57600080fd5b50565b604051606081016001600160401b03811182821017156100f157634e487b7160e01b600052604160045260246000fd5b60405290565b60405160c081016001600160401b03811182821017156100f157634e487b7160e01b600052604160045260246000fd5b80516001600160801b038116811461013e57600080fd5b919050565b805161013e816100a9565b600080600083850361014081121561016557600080fd5b8451610170816100a9565b9350601f19016101008082121561018657600080fd5b61018e6100c1565b60c083121561019c57600080fd5b6101a46100f7565b602088810151825260408901519082015260608801519093506001600160601b03811681146101d257600080fd5b60408401526101e360808801610127565b60608401526101f460a08801610127565b608084015260c087015160a084015282815261021260e08801610143565b6020820152908601516040820152610120909501519396949550929392505050565b60805160a05160c05160e051610100516101205161014051610160516101805161054f6102da6000396000818160f4015261042801526000818161025c015261040101526000818161012801526103d00152600081816101dc01526103a9015260008181610190015261038101526000818160ad0152610324015260008181610210015261035201526000818161015c01526102fc015260006104cf015261054f6000f3fe60806040526004361061008a5760003560e01c806330f0dbe01161005957806330f0dbe01461017e578063bb4b5734146101ca578063c940baf8146101fe578063f12c2eb41461024a578063f676d67a1461029657610091565b806301b4f0f81461009b57806305d1294a146100e25780630d9019e11461011657806316e73a551461014a57610091565b3661009157005b6100996104ca565b005b3480156100a757600080fd5b506100cf7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b3480156100ee57600080fd5b506100cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561012257600080fd5b506100cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561015657600080fd5b506100cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561018a57600080fd5b506101b27f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160801b0390911681526020016100d9565b3480156101d657600080fd5b506101b27f000000000000000000000000000000000000000000000000000000000000000081565b34801561020a57600080fd5b506102327f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160601b0390911681526020016100d9565b34801561025657600080fd5b5061027e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100d9565b3480156102a257600080fd5b5061045160408051610120810182526000606082018181526080830182905260a0830182905260c0830182905260e083018290526101008301829052825260208201819052918101919091525060408051610120810182527f0000000000000000000000000000000000000000000000000000000000000000606082019081527f000000000000000000000000000000000000000000000000000000000000000060808301526001600160601b037f00000000000000000000000000000000000000000000000000000000000000001660a08301526001600160801b037f0000000000000000000000000000000000000000000000000000000000000000811660c08401527f00000000000000000000000000000000000000000000000000000000000000001660e08301527f000000000000000000000000000000000000000000000000000000000000000061010083015281526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660208201527f00000000000000000000000000000000000000000000000000000000000000009181019190915290565b6040805182518051825260208082015181840152818401516001600160601b0316838501526060808301516001600160801b03908116918501919091526080808401519091169084015260a091820151918301919091528301516001600160a01b031660c082015291015160e0820152610100016100d9565b6104f37f00000000000000000000000000000000000000000000000000000000000000006104f5565b565b3660008037600080366000845af43d6000803e808015610514573d6000f35b3d6000fdfea2646970667358221220a7b7c08734779c3a6cadaaa76cc5b07273c2d1ad9e91050a7eae3dc0728fccba64736f6c634300081400330000000000000000000000005149a0983b543833bf342b8f224240314e7a233600000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ed4e862860bed51a9570b96d89af5e1b0efefed0000000000000000000000000000000000000000000000000000000000002105000000000000000000000000000000000000000000000220e2643fcd7ae000000000000000000000000000000000000000000000000000000000000066912e3e0000000000000000000000008d7abdb3c11ebe69b557ec32bbc3a93e0ea93b1d000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000565296e3addf2b0000000000000000000000000000000000000000000000000000000000000001 | 60806040526004361061008a5760003560e01c806330f0dbe01161005957806330f0dbe01461017e578063bb4b5734146101ca578063c940baf8146101fe578063f12c2eb41461024a578063f676d67a1461029657610091565b806301b4f0f81461009b57806305d1294a146100e25780630d9019e11461011657806316e73a551461014a57610091565b3661009157005b6100996104ca565b005b3480156100a757600080fd5b506100cf7f0000000000000000000000004ed4e862860bed51a9570b96d89af5e1b0efefed81565b6040519081526020015b60405180910390f35b3480156100ee57600080fd5b506100cf7f00000000000000000000000000000000000000000000000000565296e3addf2b81565b34801561012257600080fd5b506100cf7f0000000000000000000000008d7abdb3c11ebe69b557ec32bbc3a93e0ea93b1d81565b34801561015657600080fd5b506100cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561018a57600080fd5b506101b27f000000000000000000000000000000000000000000000220e2643fcd7ae0000081565b6040516001600160801b0390911681526020016100d9565b3480156101d657600080fd5b506101b27f0000000000000000000000000000000000000000000000000000000066912e3e81565b34801561020a57600080fd5b506102327f000000000000000000000000000000000000000000000000000000000000210581565b6040516001600160601b0390911681526020016100d9565b34801561025657600080fd5b5061027e7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6040516001600160a01b0390911681526020016100d9565b3480156102a257600080fd5b5061045160408051610120810182526000606082018181526080830182905260a0830182905260c0830182905260e083018290526101008301829052825260208201819052918101919091525060408051610120810182527f0000000000000000000000000000000000000000000000000000000000000000606082019081527f0000000000000000000000004ed4e862860bed51a9570b96d89af5e1b0efefed60808301526001600160601b037f00000000000000000000000000000000000000000000000000000000000021051660a08301526001600160801b037f000000000000000000000000000000000000000000000220e2643fcd7ae00000811660c08401527f0000000000000000000000000000000000000000000000000000000066912e3e1660e08301527f0000000000000000000000008d7abdb3c11ebe69b557ec32bbc3a93e0ea93b1d61010083015281526001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21660208201527f00000000000000000000000000000000000000000000000000565296e3addf2b9181019190915290565b6040805182518051825260208082015181840152818401516001600160601b0316838501526060808301516001600160801b03908116918501919091526080808401519091169084015260a091820151918301919091528301516001600160a01b031660c082015291015160e0820152610100016100d9565b6104f37f0000000000000000000000005149a0983b543833bf342b8f224240314e7a23366104f5565b565b3660008037600080366000845af43d6000803e808015610514573d6000f35b3d6000fdfea2646970667358221220a7b7c08734779c3a6cadaaa76cc5b07273c2d1ad9e91050a7eae3dc0728fccba64736f6c63430008140033 | |
1 | 20,290,399 | 97db50abb1df8cf5461f030744cf63fa93aa7d86ae2d928669f6f090dfe8dfc2 | 7849eedd6e982c68cfe3595543767f1a59eac4e4b87faf8201781454bde8dd3f | c82b8b4b8c71ecb42e21fbb8bb1bf0dfffed7423 | 66807b5598a848602734b82e432dd88dbe13fc8f | c95d00a49a398ed807e70480e93f74447b769c3e | 3d602d80600a3d3981f3363d3d373d3d3d363d73359c1efd3fc7e3a9b7a043c185fd5d39dec1fc815af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73359c1efd3fc7e3a9b7a043c185fd5d39dec1fc815af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"/contracts/boosting/StakingProxyERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\nimport \"./StakingProxyBase.sol\";\nimport \"../interfaces/IFxnGauge.sol\";\nimport '@openzeppelin/contracts/security/ReentrancyGuard.sol';\n\n/*\nVault implementation for basic erc20 tokens\n*/\ncontract StakingProxyERC20 is StakingProxyBase, ReentrancyGuard{\n using SafeERC20 for IERC20;\n\n constructor(address _poolRegistry, address _feeRegistry, address _fxnminter) \n StakingProxyBase(_poolRegistry, _feeRegistry, _fxnminter){\n }\n\n //vault type\n function vaultType() external pure override returns(VaultType){\n return VaultType.Erc20Basic;\n }\n\n //vault version\n function vaultVersion() external pure override returns(uint256){\n return 1;\n }\n\n //initialize vault\n function initialize(address _owner, uint256 _pid) public override{\n super.initialize(_owner, _pid);\n\n //set infinite approval\n IERC20(stakingToken).approve(gaugeAddress, type(uint256).max);\n\n //set extra rewards to send directly back to owner\n //..could technically save gas on initialize() by using claim(address,address) but\n //since claim is unguarded would be better UX to set receiver in case called by some other address\n IFxnGauge(gaugeAddress).setRewardReceiver(_owner);\n }\n\n\n //deposit into gauge\n function deposit(uint256 _amount) external onlyOwner nonReentrant{\n if(_amount > 0){\n //pull tokens from user\n address _stakingToken = stakingToken;\n IERC20(_stakingToken).safeTransferFrom(msg.sender, address(this), _amount);\n\n //stake (use balanceof in case of change during transfer)\n IFxnGauge(gaugeAddress).deposit(IERC20(_stakingToken).balanceOf(address(this)));\n }\n \n //checkpoint rewards\n _checkpointRewards();\n }\n\n //deposit into gauge with manage flag\n function deposit(uint256 _amount, bool _manage) external onlyOwner nonReentrant{\n if(_amount > 0){\n //pull tokens from user\n address _stakingToken = stakingToken;\n IERC20(_stakingToken).safeTransferFrom(msg.sender, address(this), _amount);\n\n //stake (use balanceof in case of change during transfer)\n IFxnGauge(gaugeAddress).deposit(IERC20(_stakingToken).balanceOf(address(this)), address(this), _manage);\n }\n \n //checkpoint rewards\n _checkpointRewards();\n }\n\n\n //withdraw a staked position\n function withdraw(uint256 _amount) external onlyOwner nonReentrant{\n\n //withdraw to vault\n IFxnGauge(gaugeAddress).withdraw(_amount);\n\n //checkpoint rewards\n _checkpointRewards();\n\n //send back to owner any staking tokens on the vault (may differ from _amount)\n address _stakingToken = stakingToken;\n IERC20(_stakingToken).safeTransfer(msg.sender, IERC20(_stakingToken).balanceOf(address(this)));\n }\n\n\n //return earned tokens on staking contract and any tokens that are on this vault\n function earned() external override returns (address[] memory token_addresses, uint256[] memory total_earned) {\n //get list of reward tokens\n address[] memory rewardTokens = IFxnGauge(gaugeAddress).getActiveRewardTokens();\n\n //create array of rewards on gauge, rewards on extra reward contract, and fxn that is minted\n address _rewards = rewards;\n token_addresses = new address[](rewardTokens.length + IRewards(_rewards).rewardTokenLength() + 1);// +1 for fxn\n total_earned = new uint256[](rewardTokens.length + IRewards(_rewards).rewardTokenLength() + 1); // +1 for fxn\n\n //simulate claiming\n\n //mint fxn\n try IFxnTokenMinter(fxnMinter).mint(gaugeAddress){}catch{}\n \n //check fxn\n token_addresses[0] = fxn;\n //remove fee (assumes all fxn on vault came from minting)\n total_earned[0] = IERC20(fxn).balanceOf(address(this)) * (FEE_DENOMINATOR - IFeeRegistry(feeRegistry).totalFees()) / FEE_DENOMINATOR;\n\n //claim other rewards on gauge to this address to tally\n IFxnGauge(gaugeAddress).claim(address(this),address(this));\n\n //get balance of tokens\n for(uint256 i = 0; i < rewardTokens.length; i++){\n token_addresses[i+1] = rewardTokens[i];\n if(rewardTokens[i] == fxn){\n //if more fxn was distributed as an extra reward, add difference of current-minted\n total_earned[i+1] = IERC20(rewardTokens[i]).balanceOf(address(this)) - total_earned[0];\n }else{\n total_earned[i+1] = IERC20(rewardTokens[i]).balanceOf(address(this));\n }\n }\n\n //also add an extra rewards from convex's side\n IRewards.EarnedData[] memory extraRewards = IRewards(_rewards).claimableRewards(address(this));\n for(uint256 i = 0; i < extraRewards.length; i++){\n token_addresses[i+rewardTokens.length+1] = extraRewards[i].token;\n total_earned[i+rewardTokens.length+1] = extraRewards[i].amount;\n }\n }\n\n /*\n claim flow:\n mint fxn rewards directly to vault\n claim extra rewards directly to the owner\n calculate fees on fxn\n distribute fxn between owner and fee deposit\n */\n function getReward() external override{\n getReward(true);\n }\n\n //get reward with claim option.\n function getReward(bool _claim) public override{\n\n //claim\n if(_claim){\n //fxn rewards (claim here first then send to user after fees)\n try IFxnTokenMinter(fxnMinter).mint(gaugeAddress){}catch{}\n\n //extras (will get claimed directly to owner)\n IFxnGauge(gaugeAddress).claim();\n }\n\n //process fxn fees\n _processFxn();\n\n //extra rewards\n _processExtraRewards();\n }\n\n //get reward with claim option, as well as a specific token list to claim from convex extra rewards\n function getReward(bool _claim, address[] calldata _tokenList) external override{\n\n //claim\n if(_claim){\n //fxn rewards\n try IFxnTokenMinter(fxnMinter).mint(gaugeAddress){}catch{}\n\n //extras\n IFxnGauge(gaugeAddress).claim();\n }\n\n //process fxn fees\n _processFxn();\n\n //extra rewards\n _processExtraRewardsFilter(_tokenList);\n }\n\n //return any tokens in vault back to owner\n function transferTokens(address[] calldata _tokenList) external onlyOwner{\n //transfer tokens back to owner\n //fxn and gauge tokens are skipped\n _transferTokens(_tokenList);\n }\n\n}\n"
},
"/contracts/interfaces/IRewards.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\ninterface IRewards{\n struct EarnedData {\n address token;\n uint256 amount;\n }\n enum RewardState{\n NotInitialized,\n NoRewards,\n Active\n }\n \n function initialize(uint256 _pid, bool _startActive) external;\n function addReward(address _rewardsToken, address _distributor) external;\n function approveRewardDistributor(\n address _rewardsToken,\n address _distributor,\n bool _approved\n ) external;\n function deposit(address _owner, uint256 _amount) external;\n function withdraw(address _owner, uint256 _amount) external;\n function getReward(address _forward) external;\n function getRewardFilter(address _forward, address[] calldata _tokens) external;\n function notifyRewardAmount(address _rewardsToken, uint256 _reward) external;\n function balanceOf(address account) external view returns (uint256);\n function claimableRewards(address _account) external view returns(EarnedData[] memory userRewards);\n function rewardTokens(uint256 _rid) external view returns (address);\n function rewardTokenLength() external view returns(uint256);\n function rewardState() external view returns(RewardState);\n}"
},
"/contracts/interfaces/IProxyVault.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\ninterface IProxyVault {\n\n enum VaultType{\n Erc20Basic,\n RebalancePool\n }\n\n function vaultType() external view returns(VaultType);\n function vaultVersion() external view returns(uint256);\n function initialize(address _owner, uint256 _pid) external;\n function pid() external returns(uint256);\n function usingProxy() external returns(address);\n function owner() external returns(address);\n function gaugeAddress() external returns(address);\n function stakingToken() external returns(address);\n function rewards() external returns(address);\n function getReward() external;\n function getReward(bool _claim) external;\n function getReward(bool _claim, address[] calldata _rewardTokenList) external;\n function earned() external returns (address[] memory token_addresses, uint256[] memory total_earned);\n}"
},
"/contracts/interfaces/IPoolRegistry.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\ninterface IPoolRegistry {\n function poolLength() external view returns(uint256);\n function poolInfo(uint256 _pid) external view returns(address, address, address, address, uint8);\n function vaultMap(uint256 _pid, address _user) external view returns(address vault);\n function addUserVault(uint256 _pid, address _user) external returns(address vault, address stakeAddress, address stakeToken, address rewards);\n function deactivatePool(uint256 _pid) external;\n function addPool(address _implementation, address _stakingAddress, address _stakingToken) external;\n function setRewardActiveOnCreation(bool _active) external;\n function setRewardImplementation(address _imp) external;\n}"
},
"/contracts/interfaces/IFxnTokenMinter.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n// solhint-disable func-name-mixedcase\ninterface IFxnTokenMinter {\n function token() external view returns (address);\n\n function controller() external view returns (address);\n\n function minted(address user, address gauge) external view returns (uint256);\n\n function mint(address gauge_addr) external;\n\n function mint_many(address[8] memory gauges) external;\n\n function mint_for(address gauge, address _for) external;\n\n function toggle_approve_mint(address _user) external;\n}"
},
"/contracts/interfaces/IFxnGauge.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.0;\n\ninterface IFxnGauge{\n\n //basics\n function stakingToken() external view returns(address);\n function totalSupply() external view returns(uint256);\n function workingSupply() external view returns(uint256);\n function workingBalanceOf(address _account) external view returns(uint256);\n function deposit(uint256 _amount) external;\n function deposit(uint256 _amount, address _receiver) external;\n function deposit(uint256 _amount, address _receiver, bool _manage) external;\n function withdraw(uint256 _amount) external;\n function withdraw(uint256 _amount, address _receiver) external;\n function user_checkpoint(address _account) external returns (bool);\n function balanceOf(address _account) external view returns(uint256);\n function integrate_fraction(address account) external view returns (uint256);\n function baseToken() external view returns(address);\n function asset() external view returns(address);\n function market() external view returns(address);\n\n //weight sharing\n function toggleVoteSharing(address _staker) external;\n function acceptSharedVote(address _newOwner) external;\n function rejectSharedVote() external;\n function getStakerVoteOwner(address _account) external view returns (address);\n function numAcceptedStakers(address _account) external view returns (uint256);\n function sharedBalanceOf(address _account) external view returns (uint256);\n function veProxy() external view returns(address);\n\n //rewards\n function rewardData(address _token) external view returns(uint96 queued, uint80 rate, uint40 lastUpdate, uint40 finishAt);\n function getActiveRewardTokens() external view returns (address[] memory _rewardTokens);\n function rewardReceiver(address account) external view returns (address);\n function setRewardReceiver(address _newReceiver) external;\n function claim() external;\n function claim(address account) external;\n function claim(address account, address receiver) external;\n function getBoostRatio(address _account) external view returns (uint256);\n function depositReward(address _token, uint256 _amount) external;\n function voteOwnerBalances(address _account) external view returns(uint112 product, uint104 amount, uint40 updateAt);\n}\n"
},
"/contracts/interfaces/IFeeRegistry.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\ninterface IFeeRegistry{\n function cvxfxnIncentive() external view returns(uint256);\n function cvxIncentive() external view returns(uint256);\n function platformIncentive() external view returns(uint256);\n function totalFees() external view returns(uint256);\n function maxFees() external view returns(uint256);\n function feeDeposit() external view returns(address);\n function getFeeDepositor(address _from) external view returns(address);\n}"
},
"/contracts/boosting/StakingProxyBase.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\nimport \"../interfaces/IProxyVault.sol\";\nimport \"../interfaces/IFeeRegistry.sol\";\nimport \"../interfaces/IFxnGauge.sol\";\nimport \"../interfaces/IFxnTokenMinter.sol\";\nimport \"../interfaces/IRewards.sol\";\nimport \"../interfaces/IPoolRegistry.sol\";\nimport '@openzeppelin/contracts/token/ERC20/IERC20.sol';\nimport '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';\n\n/*\nBase class for vaults\n\n*/\ncontract StakingProxyBase is IProxyVault{\n using SafeERC20 for IERC20;\n\n address public constant fxn = address(0x365AccFCa291e7D3914637ABf1F7635dB165Bb09);\n address public constant vefxnProxy = address(0xd11a4Ee017cA0BECA8FA45fF2abFe9C6267b7881);\n address public immutable feeRegistry;\n address public immutable poolRegistry;\n address public immutable fxnMinter;\n\n address public owner; //owner of the vault\n address public gaugeAddress; //gauge contract\n address public stakingToken; //staking token\n address public rewards; //extra rewards on convex\n address public usingProxy; //address of proxy being used\n uint256 public pid;\n\n uint256 public constant FEE_DENOMINATOR = 10000;\n\n constructor(address _poolRegistry, address _feeRegistry, address _fxnminter){\n poolRegistry = _poolRegistry;\n feeRegistry = _feeRegistry;\n fxnMinter = _fxnminter;\n }\n\n modifier onlyOwner() {\n require(owner == msg.sender, \"!auth\");\n _;\n }\n\n modifier onlyAdmin() {\n require(vefxnProxy == msg.sender, \"!auth_admin\");\n _;\n }\n\n //vault type\n function vaultType() external virtual pure returns(VaultType){\n return VaultType.Erc20Basic;\n }\n\n //vault version\n function vaultVersion() external virtual pure returns(uint256){\n return 1;\n }\n\n //initialize vault\n function initialize(address _owner, uint256 _pid) public virtual{\n require(owner == address(0),\"already init\");\n owner = _owner;\n pid = _pid;\n\n //get pool info\n (,gaugeAddress, stakingToken, rewards,) = IPoolRegistry(poolRegistry).poolInfo(_pid);\n }\n\n //set what veFXN proxy this vault is using\n function setVeFXNProxy(address _proxy) external virtual onlyAdmin{\n //set the vefxn proxy\n _setVeFXNProxy(_proxy);\n }\n\n //set veFXN proxy the vault is using. call acceptSharedVote to start sharing vefxn proxy's boost\n function _setVeFXNProxy(address _proxyAddress) internal{\n //set proxy address on staking contract\n IFxnGauge(gaugeAddress).acceptSharedVote(_proxyAddress);\n if(_proxyAddress == vefxnProxy){\n //reset back to address 0 to default to convex's proxy, dont write if not needed.\n if(usingProxy != address(0)){\n usingProxy = address(0);\n }\n }else{\n //write non-default proxy address\n usingProxy = _proxyAddress;\n }\n }\n\n //get rewards and earned are type specific. extend in child class\n function getReward() external virtual{}\n function getReward(bool _claim) external virtual{}\n function getReward(bool _claim, address[] calldata _rewardTokenList) external virtual{}\n function earned() external virtual returns (address[] memory token_addresses, uint256[] memory total_earned){}\n\n\n //checkpoint and add/remove weight to convex rewards contract\n function _checkpointRewards() internal{\n //if rewards are active, checkpoint\n address _rewards = rewards;\n if(IRewards(_rewards).rewardState() == IRewards.RewardState.Active){\n //get user balance from the gauge\n uint256 userLiq = IFxnGauge(gaugeAddress).balanceOf(address(this));\n //get current balance of reward contract\n uint256 bal = IRewards(_rewards).balanceOf(address(this));\n if(userLiq >= bal){\n //add the difference to reward contract\n IRewards(_rewards).deposit(owner, userLiq - bal);\n }else{\n //remove the difference from the reward contract\n IRewards(_rewards).withdraw(owner, bal - userLiq);\n }\n }\n }\n\n //apply fees to fxn and send remaining to owner\n function _processFxn() internal{\n\n //get fee rate from fee registry (only need to know total, let deposit contract disperse itself)\n uint256 totalFees = IFeeRegistry(feeRegistry).totalFees();\n\n //send fxn fees to fee deposit\n uint256 fxnBalance = IERC20(fxn).balanceOf(address(this));\n uint256 sendAmount = fxnBalance * totalFees / FEE_DENOMINATOR;\n if(sendAmount > 0){\n //get deposit address for given proxy (address 0 will be handled by fee registry to return default convex proxy)\n IERC20(fxn).transfer(IFeeRegistry(feeRegistry).getFeeDepositor(usingProxy), sendAmount);\n }\n\n //transfer remaining fxn to owner\n sendAmount = IERC20(fxn).balanceOf(address(this));\n if(sendAmount > 0){\n IERC20(fxn).transfer(owner, sendAmount);\n }\n }\n\n //get extra rewards (convex side)\n function _processExtraRewards() internal{\n address _rewards = rewards;\n if(IRewards(_rewards).rewardState() == IRewards.RewardState.Active){\n //update reward balance if this is the first call since reward contract activation:\n //check if no balance recorded yet and set staked balance\n //dont use _checkpointRewards since difference of 0 will still call deposit()\n //as well as it will check rewardState twice\n uint256 bal = IRewards(_rewards).balanceOf(address(this));\n uint256 gaugeBalance = IFxnGauge(gaugeAddress).balanceOf(address(this));\n if(bal == 0 && gaugeBalance > 0){\n //set balance to gauge.balanceof(this)\n IRewards(_rewards).deposit(owner,gaugeBalance);\n }\n\n //get the rewards\n IRewards(_rewards).getReward(owner);\n }\n }\n\n //get extra rewards (convex side) with a filter list\n function _processExtraRewardsFilter(address[] calldata _tokens) internal{\n address _rewards = rewards;\n if(IRewards(_rewards).rewardState() == IRewards.RewardState.Active){\n //update reward balance if this is the first call since reward contract activation:\n //check if no balance recorded yet and set staked balance\n //dont use _checkpointRewards since difference of 0 will still call deposit()\n //as well as it will check rewardState twice\n uint256 bal = IRewards(_rewards).balanceOf(address(this));\n uint256 gaugeBalance = IFxnGauge(gaugeAddress).balanceOf(address(this));\n if(bal == 0 && gaugeBalance > 0){\n //set balance to gauge.balanceof(this)\n IRewards(_rewards).deposit(owner,gaugeBalance);\n }\n\n //get the rewards\n IRewards(_rewards).getRewardFilter(owner,_tokens);\n }\n }\n\n //transfer other reward tokens besides fxn(which needs to have fees applied)\n //also block gauge tokens from being transfered out\n function _transferTokens(address[] memory _tokens) internal{\n //transfer all tokens\n for(uint256 i = 0; i < _tokens.length; i++){\n //dont allow fxn (need to take fee)\n //dont allow gauge token transfer\n if(_tokens[i] != fxn && _tokens[i] != gaugeAddress){\n uint256 bal = IERC20(_tokens[i]).balanceOf(address(this));\n if(bal > 0){\n IERC20(_tokens[i]).safeTransfer(owner, bal);\n }\n }\n }\n }\n\n function _checkExecutable(address _address) internal virtual{\n require(_address != fxn && _address != stakingToken && _address != rewards, \"!invalid target\");\n }\n\n //allow arbitrary calls. some function signatures and targets are blocked\n function execute(\n address _to,\n uint256 _value,\n bytes calldata _data\n ) external onlyOwner returns (bool, bytes memory) {\n //fully block fxn, staking token(lp etc), and rewards\n _checkExecutable(_to);\n\n //only calls to staking(gauge) address if pool is shutdown\n if(_to == gaugeAddress){\n (, , , , uint8 shutdown) = IPoolRegistry(poolRegistry).poolInfo(pid);\n require(shutdown == 0,\"!shutdown\");\n }\n\n (bool success, bytes memory result) = _to.call{value:_value}(_data);\n require(success, \"!success\");\n return (success, result);\n }\n}\n"
},
"@openzeppelin/contracts/utils/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../extensions/IERC20Permit.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20Permit token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"
},
"@openzeppelin/contracts/token/ERC20/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"
},
"@openzeppelin/contracts/security/ReentrancyGuard.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuard {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n constructor() {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n}\n"
}
},
"settings": {
"remappings": [],
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "london",
"libraries": {},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
}} |
1 | 20,290,404 | aa13542f8ece3c9b4b8539fb6b8fdb6d31bc9c2176910aea409cd06c72717830 | a734910e913ba08da5c114c64908075d21b39b6d5aecd4df3072c8705013b234 | e41e59b5ed5e5540014d830969c027115ca8fccb | ffa397285ce46fb78c588a9e993286aac68c37cd | df4dc2ed2ef0fd25d64abca8d5a9f22afcd6b6c9 | 3d602d80600a3d3981f3363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | pragma solidity 0.7.5;
/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//solhint-disable max-line-length
//solhint-disable no-inline-assembly
contract CloneFactory {
function createClone(address target, bytes32 salt)
internal
returns (address payable result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the clone contract data
let clone := mload(0x40)
// The bytecode block below is responsible for contract initialization
// during deployment, it is worth noting the proxied contract constructor will not be called during
// the cloning procedure and that is why an initialization function needs to be called after the
// clone is created
mstore(
clone,
0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000
)
// This stores the address location of the implementation contract
// so that the proxy knows where to delegate call logic to
mstore(add(clone, 0x14), targetBytes)
// The bytecode block is the actual code that is deployed for each clone created.
// It forwards all calls to the already deployed implementation via a delegatecall
mstore(
add(clone, 0x28),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// deploy the contract using the CREATE2 opcode
// this deploys the minimal proxy defined above, which will proxy all
// calls to use the logic defined in the implementation contract `target`
result := create2(0, clone, 0x37, salt)
}
}
function isClone(address target, address query)
internal
view
returns (bool result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the comparison clone
let clone := mload(0x40)
// The next three lines store the expected bytecode for a miniml proxy
// that targets `target` as its implementation contract
mstore(
clone,
0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000
)
mstore(add(clone, 0xa), targetBytes)
mstore(
add(clone, 0x1e),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// the next two lines store the bytecode of the contract that we are checking in memory
let other := add(clone, 0x40)
extcodecopy(query, other, 0, 0x2d)
// Check if the expected bytecode equals the actual bytecode and return the result
result := and(
eq(mload(clone), mload(other)),
eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
)
}
}
}
/**
* Contract that exposes the needed erc20 token functions
*/
abstract contract ERC20Interface {
// Send _value amount of tokens to address _to
function transfer(address _to, uint256 _value)
public
virtual
returns (bool success);
// Get the account balance of another account with address _owner
function balanceOf(address _owner)
public
virtual
view
returns (uint256 balance);
}
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeApprove: approve failed'
);
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeTransfer: transfer failed'
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::transferFrom: transferFrom failed'
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
}
}
/**
* Contract that will forward any incoming Ether to the creator of the contract
*
*/
contract Forwarder {
// Address to which any funds sent to this contract will be forwarded
address public parentAddress;
event ForwarderDeposited(address from, uint256 value, bytes data);
/**
* Initialize the contract, and sets the destination address to that of the creator
*/
function init(address _parentAddress) external onlyUninitialized {
parentAddress = _parentAddress;
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
// NOTE: since we are forwarding on initialization,
// we don't have the context of the original sender.
// We still emit an event about the forwarding but set
// the sender to the forwarder itself
emit ForwarderDeposited(address(this), value, msg.data);
}
/**
* Modifier that will execute internal code block only if the sender is the parent address
*/
modifier onlyParent {
require(msg.sender == parentAddress, 'Only Parent');
_;
}
/**
* Modifier that will execute internal code block only if the contract has not been initialized yet
*/
modifier onlyUninitialized {
require(parentAddress == address(0x0), 'Already initialized');
_;
}
/**
* Default function; Gets called when data is sent but does not match any other function
*/
fallback() external payable {
flush();
}
/**
* Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address
*/
receive() external payable {
flush();
}
/**
* Execute a token transfer of the full balance from the forwarder token to the parent address
* @param tokenContractAddress the address of the erc20 token contract
*/
function flushTokens(address tokenContractAddress) external onlyParent {
ERC20Interface instance = ERC20Interface(tokenContractAddress);
address forwarderAddress = address(this);
uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
if (forwarderBalance == 0) {
return;
}
TransferHelper.safeTransfer(
tokenContractAddress,
parentAddress,
forwarderBalance
);
}
/**
* Flush the entire balance of the contract to the parent address.
*/
function flush() public {
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
emit ForwarderDeposited(msg.sender, value, msg.data);
}
}
contract ForwarderFactory is CloneFactory {
address public implementationAddress;
event ForwarderCreated(address newForwarderAddress, address parentAddress);
constructor(address _implementationAddress) {
implementationAddress = _implementationAddress;
}
function createForwarder(address parent, bytes32 salt) external {
// include the signers in the salt so any contract deployed to a given address must have the same signers
bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt));
address payable clone = createClone(implementationAddress, finalSalt);
Forwarder(clone).init(parent);
emit ForwarderCreated(clone, parent);
}
} |
1 | 20,290,405 | acd0b55967cb45691c179e66730c17ce5da7a1efd0668dbd6572c299bcede7b6 | 0b4e91b39fc37f37cd02f665907d52345a25fc93068bb14a2530906bc483834b | 3aeb5831f91d29b3992d659821a7fed7b805a107 | ffa397285ce46fb78c588a9e993286aac68c37cd | d6390f300bf74127a9531407797724f368a402a3 | 3d602d80600a3d3981f3363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | pragma solidity 0.7.5;
/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//solhint-disable max-line-length
//solhint-disable no-inline-assembly
contract CloneFactory {
function createClone(address target, bytes32 salt)
internal
returns (address payable result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the clone contract data
let clone := mload(0x40)
// The bytecode block below is responsible for contract initialization
// during deployment, it is worth noting the proxied contract constructor will not be called during
// the cloning procedure and that is why an initialization function needs to be called after the
// clone is created
mstore(
clone,
0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000
)
// This stores the address location of the implementation contract
// so that the proxy knows where to delegate call logic to
mstore(add(clone, 0x14), targetBytes)
// The bytecode block is the actual code that is deployed for each clone created.
// It forwards all calls to the already deployed implementation via a delegatecall
mstore(
add(clone, 0x28),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// deploy the contract using the CREATE2 opcode
// this deploys the minimal proxy defined above, which will proxy all
// calls to use the logic defined in the implementation contract `target`
result := create2(0, clone, 0x37, salt)
}
}
function isClone(address target, address query)
internal
view
returns (bool result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the comparison clone
let clone := mload(0x40)
// The next three lines store the expected bytecode for a miniml proxy
// that targets `target` as its implementation contract
mstore(
clone,
0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000
)
mstore(add(clone, 0xa), targetBytes)
mstore(
add(clone, 0x1e),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// the next two lines store the bytecode of the contract that we are checking in memory
let other := add(clone, 0x40)
extcodecopy(query, other, 0, 0x2d)
// Check if the expected bytecode equals the actual bytecode and return the result
result := and(
eq(mload(clone), mload(other)),
eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
)
}
}
}
/**
* Contract that exposes the needed erc20 token functions
*/
abstract contract ERC20Interface {
// Send _value amount of tokens to address _to
function transfer(address _to, uint256 _value)
public
virtual
returns (bool success);
// Get the account balance of another account with address _owner
function balanceOf(address _owner)
public
virtual
view
returns (uint256 balance);
}
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeApprove: approve failed'
);
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeTransfer: transfer failed'
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::transferFrom: transferFrom failed'
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
}
}
/**
* Contract that will forward any incoming Ether to the creator of the contract
*
*/
contract Forwarder {
// Address to which any funds sent to this contract will be forwarded
address public parentAddress;
event ForwarderDeposited(address from, uint256 value, bytes data);
/**
* Initialize the contract, and sets the destination address to that of the creator
*/
function init(address _parentAddress) external onlyUninitialized {
parentAddress = _parentAddress;
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
// NOTE: since we are forwarding on initialization,
// we don't have the context of the original sender.
// We still emit an event about the forwarding but set
// the sender to the forwarder itself
emit ForwarderDeposited(address(this), value, msg.data);
}
/**
* Modifier that will execute internal code block only if the sender is the parent address
*/
modifier onlyParent {
require(msg.sender == parentAddress, 'Only Parent');
_;
}
/**
* Modifier that will execute internal code block only if the contract has not been initialized yet
*/
modifier onlyUninitialized {
require(parentAddress == address(0x0), 'Already initialized');
_;
}
/**
* Default function; Gets called when data is sent but does not match any other function
*/
fallback() external payable {
flush();
}
/**
* Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address
*/
receive() external payable {
flush();
}
/**
* Execute a token transfer of the full balance from the forwarder token to the parent address
* @param tokenContractAddress the address of the erc20 token contract
*/
function flushTokens(address tokenContractAddress) external onlyParent {
ERC20Interface instance = ERC20Interface(tokenContractAddress);
address forwarderAddress = address(this);
uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
if (forwarderBalance == 0) {
return;
}
TransferHelper.safeTransfer(
tokenContractAddress,
parentAddress,
forwarderBalance
);
}
/**
* Flush the entire balance of the contract to the parent address.
*/
function flush() public {
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
emit ForwarderDeposited(msg.sender, value, msg.data);
}
}
contract ForwarderFactory is CloneFactory {
address public implementationAddress;
event ForwarderCreated(address newForwarderAddress, address parentAddress);
constructor(address _implementationAddress) {
implementationAddress = _implementationAddress;
}
function createForwarder(address parent, bytes32 salt) external {
// include the signers in the salt so any contract deployed to a given address must have the same signers
bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt));
address payable clone = createClone(implementationAddress, finalSalt);
Forwarder(clone).init(parent);
emit ForwarderCreated(clone, parent);
}
} |
1 | 20,290,409 | 71b58c0b782d2fd1cc19cae8b72455cd882dfde5c91c6bffde8af3cb0e856a8b | e3576c611aec6ae78b275435d9991aef01becfdc095f7b37f047e2944e06974b | ce41d0566cc552c70269971147fee8362f5dab35 | ce41d0566cc552c70269971147fee8362f5dab35 | eb948bc8fbf82b80e1c0cf3410b77ded20237eb6 | |||
1 | 20,290,420 | b350f8b3b54de12ed9896b19e0ffec074892a3a58ada5d0e5ed868c0e81c52ef | d9acd870cd53b3f404aa4bf3ee71ab239ef798448ac1d7e1a8f848a059726ec2 | ceb1a498db55ae29094a01033b5fc01a393c2641 | ceb1a498db55ae29094a01033b5fc01a393c2641 | 3a02d3d671e28796023b07a4c9c56a8424f18036 | 60806040526003805460ff191690555f6007819055600a80546001600160b01b0319167501017a250d5630b4cf539739df2c5dacb4c659f2488d1790556015600b819055600c556014556301ab4041601655348015605b575f80fd5b505f80546001600160a01b03191633179055611e4d8061007a5f395ff3fe608060405234801561000f575f80fd5b50600436106101e7575f3560e01c806393ea498311610109578063cd7c13011161009e578063ed173bcc1161006e578063ed173bcc1461040f578063f07db9db14610418578063f80af8871461042b578063f887ea4014610434575f80fd5b8063cd7c1301146103c3578063d8124c5f146103d6578063e58e05d0146103e3578063ec44acf214610402575f80fd5b8063b43afc46116100d9578063b43afc4614610373578063c797a9f514610385578063cacbcb701461038e578063cd2bd423146103a1575f80fd5b806393ea4983146103315780639ea90ccc1461033a578063a8aa1b311461034d578063b027fca514610360575f80fd5b806361bc221a1161017f578063856cc9571161014f578063856cc957146102f1578063893d20e8146103045780638da5cb5b1461030c5780638e6dad761461031e575f80fd5b806361bc221a146102ba5780636c62b950146102c35780636d87a772146102d657806378fff1f0146102e9575f80fd5b8063386092e7116101ba578063386092e7146102595780633e8a68be1461028b5780634ff203931461029e5780635333346d146102a7575f80fd5b806302d05d3f146101eb5780630a9f0cf01461021b57806322b1f3831461023c57806333309ead14610246575b5f80fd5b6008546101fe906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61022e610229366004611a1a565b610447565b604051908152602001610212565b610244610fa0565b005b600e546101fe906001600160a01b031681565b61027b610267366004611a45565b60046020525f908152604090205460ff1681565b6040519015158152602001610212565b610244610299366004611a74565b610ff2565b61022e60135481565b6102446102b5366004611a45565b6110b3565b61022e60075481565b600d546101fe906001600160a01b031681565b6102446102e4366004611bf4565b61113b565b610244611598565b6102446102ff366004611a45565b61160c565b610244611657565b5f546101fe906001600160a01b031681565b61024461032c366004611cd1565b6116ed565b61022e60155481565b6017546101fe906001600160a01b031681565b6009546101fe906001600160a01b031681565b6101fe61036e366004611a1a565b6117b4565b6102446003805460ff19166001179055565b61022e60165481565b61027b61039c366004611a45565b6117dc565b61027b6103af366004611a45565b60066020525f908152604090205460ff1681565b6102446103d1366004611a1a565b61186e565b60035461027b9060ff1681565b61022e6103f1366004611a45565b60056020525f908152604090205481565b60105461027b9060ff1681565b61022e60115481565b6101fe610426366004611a1a565b6118d6565b61022e600f5481565b600a546101fe906001600160a01b031681565b5f80829050600160075410156105f857600d8054336001600160a01b03199182168117909255601780549091168217905560408051638da5cb5b60e01b81529051638da5cb5b916004808201926020929091908290030181865afa1580156104b1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104d59190611d0b565b600880546001600160a01b0319166001600160a01b0392831617905560175460408051635382f77160e11b81529051919092169163a705eee29160048083019260209291908290030181865afa158015610531573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105559190611d0b565b600980546001600160a01b0319166001600160a01b03928316179055601754604080516318160ddd60e01b8152905191909216916318160ddd9160048083019260209291908290030181865afa1580156105b1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105d59190611d26565b601581905550600160075f8282546105ed9190611d51565b9091555061066a9050565b60175460408051635382f77160e11b8152905161066a926001600160a01b03169163a705eee29160048083019260209291908290030181865afa158015610641573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106659190611d0b565b6118e5565b6017546040805162d1bfe160e11b815290515f926001600160a01b0316916301a37fc29160048083019260209291908290030181865afa1580156106b0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106d49190611d0b565b90505f60175f9054906101000a90046001600160a01b03166001600160a01b031663a705eee26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610727573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061074b9190611d0b565b6017546040516370a0823160e01b81526001600160a01b0385811660048301529293505f92909116906370a0823190602401602060405180830381865afa158015610798573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107bc9190611d26565b600f819055905083811015806107df57506008546001600160a01b038481169116145b61083f5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084015b60405180910390fd5b60105460ff1615155f036109435760175f9054906101000a90046001600160a01b03166001600160a01b0316631f0ba6c96040518163ffffffff1660e01b8152600401602060405180830381865afa15801561089d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108c19190611d6a565b15610943576010805460ff19166001179055601754604080516348cd4cb160e01b815290516001600160a01b03909216916348cd4cb1916004808201926020929091908290030181865afa15801561091b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061093f9190611d26565b6011555b600b601154436109539190611d85565b11610adb576009546001600160a01b0384811691161480156109835750600a54600160a01b900460ff1615156001145b15610a18576008546001600160a01b038381169116148015906109b45750600d546001600160a01b03838116911614155b15610a1857600b546015546109c99190611d98565b841115610a185760405162461bcd60e51b815260206004820152601c60248201527f45524332303a204d6178696d756d2062757920697320616374697665000000006044820152606401610836565b6009546001600160a01b038381169116148015610a465750600a805460ff60a81b1916600160a81b17905560015b15610adb576008546001600160a01b03848116911614801590610a775750600d546001600160a01b03848116911614155b15610adb57600c54601554610a8c9190611d98565b841115610adb5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a204d6178696d756d2073656c6c206973206163746976650000006044820152606401610836565b60105460ff1615610c4957601454601154610af69043611d85565b11610b0a57610b04826117dc565b50610c49565b6009546001600160a01b0390811690841603610bce574360135414610b8357610b3460125f6119ec565b601280546001810182555f919091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec34440180546001600160a01b0319166001600160a01b038416179055610bce565b601280546001810182555f919091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec34440180546001600160a01b0319166001600160a01b0384161790555b6009546001600160a01b038381169116148015610bed57506012546027105b15610c49575f5b601254811015610c4757836001600160a01b031660128281548110610c1b57610c1b611db7565b5f918252602090912001546001600160a01b031603610c3f57610c3d846117dc565b505b600101610bf4565b505b6009546001600160a01b038381169116148015610c7457506008546001600160a01b03848116911614155b15610da9576001600160a01b0383165f9081526004602052604090205460ff168015610cb857506001600160a01b0383165f9081526006602052604090205460ff16155b80610ce8575060035460ff168015610ce857506001600160a01b0383165f9081526006602052604090205460ff16155b15610d1e57601454601154610cfd9043611d85565b1115610d85576130d4601554610d139190611d98565b811115610d23575f80fd5b610e61565b6001600160a01b0383165f908152600560205260409020546002118015610d4d575060035460ff16155b156101e7576001600160a01b0383165f908152600560205260408120805460019290610d7a908490611d51565b90915550610d1e9050565b6064601554610d949190611d98565b610d9f90605a611dcb565b8110610d1e575f80fd5b6009546001600160a01b038381169116148015610dd357506008546001600160a01b038481169116145b15610e615760175f9054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e28573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e4c9190611d0b565b6001600160a01b03165f03610e61575f19600f555b6009546001600160a01b03848116911614801590610e8d57506008546001600160a01b03838116911614155b80610ebf57506008546001600160a01b03848116911614801590610ebf57506009546001600160a01b03838116911614155b15610f8f57600d546001600160a01b03838116911614801590610ef05750600a546001600160a01b03838116911614155b8015610f0a57506009546001600160a01b03848116911614155b15610f52576001600160a01b0383165f9081526004602052604090205460ff1615610f52576001600160a01b0382165f908152600460205260409020805460ff191660011790555b6001600160a01b0383165f9081526004602052604090205460ff168015610f865750600a546001600160a01b038381169116145b15610f8f575f80fd5b5050436013555050600f5492915050565b5f5b600154811015610fe457610fdb60018281548110610fc257610fc2611db7565b5f918252602090912001546001600160a01b03166117dc565b50600101610fa2565b50610ff060015f6119ec565b565b6008546001600160a01b0316611030575f546001600160a01b0316331461102b5760405162461bcd60e51b815260040161083690611de2565b61105a565b6008546001600160a01b0316331461105a5760405162461bcd60e51b815260040161083690611de2565b600a805461ffff60a01b1916600160a01b8415150260ff60a81b191617600160a81b831515021790555f84900361109357600b54611095565b835b600b555f8390036110a857600c546110aa565b825b600c5550505050565b6008546001600160a01b03166110f1575f546001600160a01b031633146110ec5760405162461bcd60e51b815260040161083690611de2565b61111b565b6008546001600160a01b0316331461111b5760405162461bcd60e51b815260040161083690611de2565b6001600160a01b03165f908152600460205260409020805460ff19169055565b6008546001600160a01b0316611179575f546001600160a01b031633146111745760405162461bcd60e51b815260040161083690611de2565b6111a3565b6008546001600160a01b031633146111a35760405162461bcd60e51b815260040161083690611de2565b5f6001600160a01b0316835f815181106111bf576111bf611db7565b60200260200101516001600160a01b0316036111e6576008546001600160a01b0316611201565b825f815181106111f8576111f8611db7565b60200260200101515b600880546001600160a01b0319166001600160a01b039290921691909117905582515f908490600190811061123857611238611db7565b60200260200101516001600160a01b03160361125f576009546001600160a01b031661127b565b8260018151811061127257611272611db7565b60200260200101515b600980546001600160a01b0319166001600160a01b039290921691909117905582515f90849060029081106112b2576112b2611db7565b60200260200101516001600160a01b0316036112d957600d546001600160a01b03166112f5565b826002815181106112ec576112ec611db7565b60200260200101515b600d80546001600160a01b0319166001600160a01b039290921691909117905582515f908490600290811061132c5761132c611db7565b60200260200101516001600160a01b031603611353576017546001600160a01b0316611360565b600d546001600160a01b03165b601780546001600160a01b0319166001600160a01b039290921691909117905582515f908490600390811061139757611397611db7565b60200260200101516001600160a01b0316036113be57600d546001600160a01b03166113da565b826003815181106113d1576113d1611db7565b60200260200101515b600a5f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550815f8151811061141157611411611db7565b602002602001015115155f15150361142e5760105460ff16611449565b815f8151811061144057611440611db7565b60200260200101515b6010805460ff191691151591909117905581518290600190811061146f5761146f611db7565b60209081029190910101511561148a5760035460ff166114a6565b8160018151811061149d5761149d611db7565b60200260200101515b6003805460ff1916911515919091179055805181905f906114c9576114c9611db7565b60200260200101516103e8036114e1576007546114fc565b805f815181106114f3576114f3611db7565b60200260200101515b60075580518190600190811061151457611514611db7565b60200260200101515f0361152a57600754611546565b8060018151811061153d5761153d611db7565b60200260200101515b60115580518190600290811061155e5761155e611db7565b60200260200101515f0361157457601454611590565b8060028151811061158757611587611db7565b60200260200101515b601455505050565b6008546001600160a01b03166115d6575f546001600160a01b031633146115d15760405162461bcd60e51b815260040161083690611de2565b611600565b6008546001600160a01b031633146116005760405162461bcd60e51b815260040161083690611de2565b6003805460ff19169055565b5f546001600160a01b031633146116355760405162461bcd60e51b815260040161083690611de2565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60175f9054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116a7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116cb9190611d0b565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b031661172b575f546001600160a01b031633146117265760405162461bcd60e51b815260040161083690611de2565b611755565b6008546001600160a01b031633146117555760405162461bcd60e51b815260040161083690611de2565b5f5b81518110156117b057600160065f84848151811061177757611777611db7565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055600101611757565b5050565b601281815481106117c3575f80fd5b5f918252602090912001546001600160a01b0316905081565b600a545f906001600160a01b0383811691161480159061180a57506009546001600160a01b03838116911614155b801561182457506008546001600160a01b03838116911614155b801561183e5750600d546001600160a01b03838116911614155b15611866576001600160a01b0382165f908152600460205260409020805460ff191660011790555b506001919050565b6008546001600160a01b03166118ac575f546001600160a01b031633146118a75760405162461bcd60e51b815260040161083690611de2565b601655565b6008546001600160a01b031633146118a75760405162461bcd60e51b815260040161083690611de2565b600181815481106117c3575f80fd5b600a546001600160a01b0382811691161480159061191157506009546001600160a01b03828116911614155b801561192b57506008546001600160a01b03828116911614155b80156119455750600d546001600160a01b03828116911614155b156119e9576001600160a01b0381165f9081526002602052604090205460ff16151560011480159061199457506001600160a01b0381165f9081526006602052604090205460ff161515600114155b156119e957600180548082019091557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b0319166001600160a01b0383169081179091555f5260026020525b50565b5080545f8255905f5260205f20908101906119e991905b80821115611a16575f8155600101611a03565b5090565b5f60208284031215611a2a575f80fd5b5035919050565b6001600160a01b03811681146119e9575f80fd5b5f60208284031215611a55575f80fd5b8135611a6081611a31565b9392505050565b80151581146119e9575f80fd5b5f805f8060808587031215611a87575f80fd5b84359350602085013592506040850135611aa081611a67565b91506060850135611ab081611a67565b939692955090935050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611af857611af8611abb565b604052919050565b5f67ffffffffffffffff821115611b1957611b19611abb565b5060051b60200190565b5f82601f830112611b32575f80fd5b81356020611b47611b4283611b00565b611acf565b8083825260208201915060208460051b870101935086841115611b68575f80fd5b602086015b84811015611b8d578035611b8081611a31565b8352918301918301611b6d565b509695505050505050565b5f82601f830112611ba7575f80fd5b81356020611bb7611b4283611b00565b8083825260208201915060208460051b870101935086841115611bd8575f80fd5b602086015b84811015611b8d5780358352918301918301611bdd565b5f805f60608486031215611c06575f80fd5b833567ffffffffffffffff80821115611c1d575f80fd5b611c2987838801611b23565b9450602091508186013581811115611c3f575f80fd5b8601601f81018813611c4f575f80fd5b8035611c5d611b4282611b00565b81815260059190911b8201840190848101908a831115611c7b575f80fd5b928501925b82841015611ca2578335611c9381611a67565b82529285019290850190611c80565b96505050506040860135915080821115611cba575f80fd5b50611cc786828701611b98565b9150509250925092565b5f60208284031215611ce1575f80fd5b813567ffffffffffffffff811115611cf7575f80fd5b611d0384828501611b23565b949350505050565b5f60208284031215611d1b575f80fd5b8151611a6081611a31565b5f60208284031215611d36575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115611d6457611d64611d3d565b92915050565b5f60208284031215611d7a575f80fd5b8151611a6081611a67565b81810381811115611d6457611d64611d3d565b5f82611db257634e487b7160e01b5f52601260045260245ffd5b500490565b634e487b7160e01b5f52603260045260245ffd5b8082028115828204841417611d6457611d64611d3d565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea26469706673582212204cc65cf313b5a0a6b4ee39fae75fd4e3769881d26c157a6642bdb47a455e378f64736f6c63430008190033 | 608060405234801561000f575f80fd5b50600436106101e7575f3560e01c806393ea498311610109578063cd7c13011161009e578063ed173bcc1161006e578063ed173bcc1461040f578063f07db9db14610418578063f80af8871461042b578063f887ea4014610434575f80fd5b8063cd7c1301146103c3578063d8124c5f146103d6578063e58e05d0146103e3578063ec44acf214610402575f80fd5b8063b43afc46116100d9578063b43afc4614610373578063c797a9f514610385578063cacbcb701461038e578063cd2bd423146103a1575f80fd5b806393ea4983146103315780639ea90ccc1461033a578063a8aa1b311461034d578063b027fca514610360575f80fd5b806361bc221a1161017f578063856cc9571161014f578063856cc957146102f1578063893d20e8146103045780638da5cb5b1461030c5780638e6dad761461031e575f80fd5b806361bc221a146102ba5780636c62b950146102c35780636d87a772146102d657806378fff1f0146102e9575f80fd5b8063386092e7116101ba578063386092e7146102595780633e8a68be1461028b5780634ff203931461029e5780635333346d146102a7575f80fd5b806302d05d3f146101eb5780630a9f0cf01461021b57806322b1f3831461023c57806333309ead14610246575b5f80fd5b6008546101fe906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61022e610229366004611a1a565b610447565b604051908152602001610212565b610244610fa0565b005b600e546101fe906001600160a01b031681565b61027b610267366004611a45565b60046020525f908152604090205460ff1681565b6040519015158152602001610212565b610244610299366004611a74565b610ff2565b61022e60135481565b6102446102b5366004611a45565b6110b3565b61022e60075481565b600d546101fe906001600160a01b031681565b6102446102e4366004611bf4565b61113b565b610244611598565b6102446102ff366004611a45565b61160c565b610244611657565b5f546101fe906001600160a01b031681565b61024461032c366004611cd1565b6116ed565b61022e60155481565b6017546101fe906001600160a01b031681565b6009546101fe906001600160a01b031681565b6101fe61036e366004611a1a565b6117b4565b6102446003805460ff19166001179055565b61022e60165481565b61027b61039c366004611a45565b6117dc565b61027b6103af366004611a45565b60066020525f908152604090205460ff1681565b6102446103d1366004611a1a565b61186e565b60035461027b9060ff1681565b61022e6103f1366004611a45565b60056020525f908152604090205481565b60105461027b9060ff1681565b61022e60115481565b6101fe610426366004611a1a565b6118d6565b61022e600f5481565b600a546101fe906001600160a01b031681565b5f80829050600160075410156105f857600d8054336001600160a01b03199182168117909255601780549091168217905560408051638da5cb5b60e01b81529051638da5cb5b916004808201926020929091908290030181865afa1580156104b1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104d59190611d0b565b600880546001600160a01b0319166001600160a01b0392831617905560175460408051635382f77160e11b81529051919092169163a705eee29160048083019260209291908290030181865afa158015610531573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105559190611d0b565b600980546001600160a01b0319166001600160a01b03928316179055601754604080516318160ddd60e01b8152905191909216916318160ddd9160048083019260209291908290030181865afa1580156105b1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105d59190611d26565b601581905550600160075f8282546105ed9190611d51565b9091555061066a9050565b60175460408051635382f77160e11b8152905161066a926001600160a01b03169163a705eee29160048083019260209291908290030181865afa158015610641573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106659190611d0b565b6118e5565b6017546040805162d1bfe160e11b815290515f926001600160a01b0316916301a37fc29160048083019260209291908290030181865afa1580156106b0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106d49190611d0b565b90505f60175f9054906101000a90046001600160a01b03166001600160a01b031663a705eee26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610727573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061074b9190611d0b565b6017546040516370a0823160e01b81526001600160a01b0385811660048301529293505f92909116906370a0823190602401602060405180830381865afa158015610798573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107bc9190611d26565b600f819055905083811015806107df57506008546001600160a01b038481169116145b61083f5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084015b60405180910390fd5b60105460ff1615155f036109435760175f9054906101000a90046001600160a01b03166001600160a01b0316631f0ba6c96040518163ffffffff1660e01b8152600401602060405180830381865afa15801561089d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108c19190611d6a565b15610943576010805460ff19166001179055601754604080516348cd4cb160e01b815290516001600160a01b03909216916348cd4cb1916004808201926020929091908290030181865afa15801561091b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061093f9190611d26565b6011555b600b601154436109539190611d85565b11610adb576009546001600160a01b0384811691161480156109835750600a54600160a01b900460ff1615156001145b15610a18576008546001600160a01b038381169116148015906109b45750600d546001600160a01b03838116911614155b15610a1857600b546015546109c99190611d98565b841115610a185760405162461bcd60e51b815260206004820152601c60248201527f45524332303a204d6178696d756d2062757920697320616374697665000000006044820152606401610836565b6009546001600160a01b038381169116148015610a465750600a805460ff60a81b1916600160a81b17905560015b15610adb576008546001600160a01b03848116911614801590610a775750600d546001600160a01b03848116911614155b15610adb57600c54601554610a8c9190611d98565b841115610adb5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a204d6178696d756d2073656c6c206973206163746976650000006044820152606401610836565b60105460ff1615610c4957601454601154610af69043611d85565b11610b0a57610b04826117dc565b50610c49565b6009546001600160a01b0390811690841603610bce574360135414610b8357610b3460125f6119ec565b601280546001810182555f919091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec34440180546001600160a01b0319166001600160a01b038416179055610bce565b601280546001810182555f919091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec34440180546001600160a01b0319166001600160a01b0384161790555b6009546001600160a01b038381169116148015610bed57506012546027105b15610c49575f5b601254811015610c4757836001600160a01b031660128281548110610c1b57610c1b611db7565b5f918252602090912001546001600160a01b031603610c3f57610c3d846117dc565b505b600101610bf4565b505b6009546001600160a01b038381169116148015610c7457506008546001600160a01b03848116911614155b15610da9576001600160a01b0383165f9081526004602052604090205460ff168015610cb857506001600160a01b0383165f9081526006602052604090205460ff16155b80610ce8575060035460ff168015610ce857506001600160a01b0383165f9081526006602052604090205460ff16155b15610d1e57601454601154610cfd9043611d85565b1115610d85576130d4601554610d139190611d98565b811115610d23575f80fd5b610e61565b6001600160a01b0383165f908152600560205260409020546002118015610d4d575060035460ff16155b156101e7576001600160a01b0383165f908152600560205260408120805460019290610d7a908490611d51565b90915550610d1e9050565b6064601554610d949190611d98565b610d9f90605a611dcb565b8110610d1e575f80fd5b6009546001600160a01b038381169116148015610dd357506008546001600160a01b038481169116145b15610e615760175f9054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e28573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e4c9190611d0b565b6001600160a01b03165f03610e61575f19600f555b6009546001600160a01b03848116911614801590610e8d57506008546001600160a01b03838116911614155b80610ebf57506008546001600160a01b03848116911614801590610ebf57506009546001600160a01b03838116911614155b15610f8f57600d546001600160a01b03838116911614801590610ef05750600a546001600160a01b03838116911614155b8015610f0a57506009546001600160a01b03848116911614155b15610f52576001600160a01b0383165f9081526004602052604090205460ff1615610f52576001600160a01b0382165f908152600460205260409020805460ff191660011790555b6001600160a01b0383165f9081526004602052604090205460ff168015610f865750600a546001600160a01b038381169116145b15610f8f575f80fd5b5050436013555050600f5492915050565b5f5b600154811015610fe457610fdb60018281548110610fc257610fc2611db7565b5f918252602090912001546001600160a01b03166117dc565b50600101610fa2565b50610ff060015f6119ec565b565b6008546001600160a01b0316611030575f546001600160a01b0316331461102b5760405162461bcd60e51b815260040161083690611de2565b61105a565b6008546001600160a01b0316331461105a5760405162461bcd60e51b815260040161083690611de2565b600a805461ffff60a01b1916600160a01b8415150260ff60a81b191617600160a81b831515021790555f84900361109357600b54611095565b835b600b555f8390036110a857600c546110aa565b825b600c5550505050565b6008546001600160a01b03166110f1575f546001600160a01b031633146110ec5760405162461bcd60e51b815260040161083690611de2565b61111b565b6008546001600160a01b0316331461111b5760405162461bcd60e51b815260040161083690611de2565b6001600160a01b03165f908152600460205260409020805460ff19169055565b6008546001600160a01b0316611179575f546001600160a01b031633146111745760405162461bcd60e51b815260040161083690611de2565b6111a3565b6008546001600160a01b031633146111a35760405162461bcd60e51b815260040161083690611de2565b5f6001600160a01b0316835f815181106111bf576111bf611db7565b60200260200101516001600160a01b0316036111e6576008546001600160a01b0316611201565b825f815181106111f8576111f8611db7565b60200260200101515b600880546001600160a01b0319166001600160a01b039290921691909117905582515f908490600190811061123857611238611db7565b60200260200101516001600160a01b03160361125f576009546001600160a01b031661127b565b8260018151811061127257611272611db7565b60200260200101515b600980546001600160a01b0319166001600160a01b039290921691909117905582515f90849060029081106112b2576112b2611db7565b60200260200101516001600160a01b0316036112d957600d546001600160a01b03166112f5565b826002815181106112ec576112ec611db7565b60200260200101515b600d80546001600160a01b0319166001600160a01b039290921691909117905582515f908490600290811061132c5761132c611db7565b60200260200101516001600160a01b031603611353576017546001600160a01b0316611360565b600d546001600160a01b03165b601780546001600160a01b0319166001600160a01b039290921691909117905582515f908490600390811061139757611397611db7565b60200260200101516001600160a01b0316036113be57600d546001600160a01b03166113da565b826003815181106113d1576113d1611db7565b60200260200101515b600a5f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550815f8151811061141157611411611db7565b602002602001015115155f15150361142e5760105460ff16611449565b815f8151811061144057611440611db7565b60200260200101515b6010805460ff191691151591909117905581518290600190811061146f5761146f611db7565b60209081029190910101511561148a5760035460ff166114a6565b8160018151811061149d5761149d611db7565b60200260200101515b6003805460ff1916911515919091179055805181905f906114c9576114c9611db7565b60200260200101516103e8036114e1576007546114fc565b805f815181106114f3576114f3611db7565b60200260200101515b60075580518190600190811061151457611514611db7565b60200260200101515f0361152a57600754611546565b8060018151811061153d5761153d611db7565b60200260200101515b60115580518190600290811061155e5761155e611db7565b60200260200101515f0361157457601454611590565b8060028151811061158757611587611db7565b60200260200101515b601455505050565b6008546001600160a01b03166115d6575f546001600160a01b031633146115d15760405162461bcd60e51b815260040161083690611de2565b611600565b6008546001600160a01b031633146116005760405162461bcd60e51b815260040161083690611de2565b6003805460ff19169055565b5f546001600160a01b031633146116355760405162461bcd60e51b815260040161083690611de2565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60175f9054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116a7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116cb9190611d0b565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b031661172b575f546001600160a01b031633146117265760405162461bcd60e51b815260040161083690611de2565b611755565b6008546001600160a01b031633146117555760405162461bcd60e51b815260040161083690611de2565b5f5b81518110156117b057600160065f84848151811061177757611777611db7565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055600101611757565b5050565b601281815481106117c3575f80fd5b5f918252602090912001546001600160a01b0316905081565b600a545f906001600160a01b0383811691161480159061180a57506009546001600160a01b03838116911614155b801561182457506008546001600160a01b03838116911614155b801561183e5750600d546001600160a01b03838116911614155b15611866576001600160a01b0382165f908152600460205260409020805460ff191660011790555b506001919050565b6008546001600160a01b03166118ac575f546001600160a01b031633146118a75760405162461bcd60e51b815260040161083690611de2565b601655565b6008546001600160a01b031633146118a75760405162461bcd60e51b815260040161083690611de2565b600181815481106117c3575f80fd5b600a546001600160a01b0382811691161480159061191157506009546001600160a01b03828116911614155b801561192b57506008546001600160a01b03828116911614155b80156119455750600d546001600160a01b03828116911614155b156119e9576001600160a01b0381165f9081526002602052604090205460ff16151560011480159061199457506001600160a01b0381165f9081526006602052604090205460ff161515600114155b156119e957600180548082019091557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b0319166001600160a01b0383169081179091555f5260026020525b50565b5080545f8255905f5260205f20908101906119e991905b80821115611a16575f8155600101611a03565b5090565b5f60208284031215611a2a575f80fd5b5035919050565b6001600160a01b03811681146119e9575f80fd5b5f60208284031215611a55575f80fd5b8135611a6081611a31565b9392505050565b80151581146119e9575f80fd5b5f805f8060808587031215611a87575f80fd5b84359350602085013592506040850135611aa081611a67565b91506060850135611ab081611a67565b939692955090935050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611af857611af8611abb565b604052919050565b5f67ffffffffffffffff821115611b1957611b19611abb565b5060051b60200190565b5f82601f830112611b32575f80fd5b81356020611b47611b4283611b00565b611acf565b8083825260208201915060208460051b870101935086841115611b68575f80fd5b602086015b84811015611b8d578035611b8081611a31565b8352918301918301611b6d565b509695505050505050565b5f82601f830112611ba7575f80fd5b81356020611bb7611b4283611b00565b8083825260208201915060208460051b870101935086841115611bd8575f80fd5b602086015b84811015611b8d5780358352918301918301611bdd565b5f805f60608486031215611c06575f80fd5b833567ffffffffffffffff80821115611c1d575f80fd5b611c2987838801611b23565b9450602091508186013581811115611c3f575f80fd5b8601601f81018813611c4f575f80fd5b8035611c5d611b4282611b00565b81815260059190911b8201840190848101908a831115611c7b575f80fd5b928501925b82841015611ca2578335611c9381611a67565b82529285019290850190611c80565b96505050506040860135915080821115611cba575f80fd5b50611cc786828701611b98565b9150509250925092565b5f60208284031215611ce1575f80fd5b813567ffffffffffffffff811115611cf7575f80fd5b611d0384828501611b23565b949350505050565b5f60208284031215611d1b575f80fd5b8151611a6081611a31565b5f60208284031215611d36575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115611d6457611d64611d3d565b92915050565b5f60208284031215611d7a575f80fd5b8151611a6081611a67565b81810381811115611d6457611d64611d3d565b5f82611db257634e487b7160e01b5f52601260045260245ffd5b500490565b634e487b7160e01b5f52603260045260245ffd5b8082028115828204841417611d6457611d64611d3d565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea26469706673582212204cc65cf313b5a0a6b4ee39fae75fd4e3769881d26c157a6642bdb47a455e378f64736f6c63430008190033 | |
1 | 20,290,425 | 3681e74fabb548fa36e02647d501fa99bf1d6aa98f058529e877dc56b1e34ba4 | 8f15d1142056b0fe9e3cb002aef83140155b77f68dc97ce4a8933152a87000ea | 7af87418733265e4f34c7e6cbc65fda198314290 | 7af87418733265e4f34c7e6cbc65fda198314290 | 3561446ef52872c568dd5dcf51a13e2ac77d1ee8 | 6080604052600880546001600160a01b031990811673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21790915560098054909116731f98431c8ad98523631ae4a59f267346ea31f98417905564e8990a4600600a5534801562000061575f80fd5b503360405180604001604052806009815260200168415349414e204d4f4d60b81b81525060405180604001604052806004815260200163414d4f4d60e01b8152508160039081620000b3919062000505565b506004620000c2828262000505565b5050506001600160a01b038116620000f457604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b620000ff8162000150565b50335f818152600660205260409020805460ff191660011790556200014a9062000127601290565b6200013490600a620006e0565b62000144906305f5e100620006f7565b620001a1565b62000727565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b038216620001cc5760405163ec442f0560e01b81525f6004820152602401620000eb565b620001d95f8383620001dd565b5050565b325f9081526006602052604090205460ff161562000207576200020283838362000339565b505050565b60075460ff166200024a5760405162461bcd60e51b815260206004820152600c60248201526b13dc195b881b9bdd081e595d60a21b6044820152606401620000eb565b6007545f906001600160a01b0384811661010090920416146200026e575f62000271565b60015b90508015620002e157600a543a1115620002ce5760405162461bcd60e51b815260206004820152601360248201527f4e6f7420656e6f756768206761732066656573000000000000000000000000006044820152606401620000eb565b620002db84848462000339565b50505050565b80620002f457620002db84848462000339565b6007546001600160a01b0385811661010090920416148015906200032b57506007546001600160a01b038481166101009092041614155b15620002db57620002db8484845b6001600160a01b03831662000367578060025f8282546200035b919062000711565b90915550620003d99050565b6001600160a01b0383165f9081526020819052604090205481811015620003bb5760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401620000eb565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b038216620003f75760028054829003905562000415565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516200045b91815260200190565b60405180910390a3505050565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806200049157607f821691505b602082108103620004b057634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156200020257805f5260205f20601f840160051c81016020851015620004dd5750805b601f840160051c820191505b81811015620004fe575f8155600101620004e9565b5050505050565b81516001600160401b0381111562000521576200052162000468565b62000539816200053284546200047c565b84620004b6565b602080601f8311600181146200056f575f8415620005575750858301515b5f19600386901b1c1916600185901b178555620005c9565b5f85815260208120601f198616915b828110156200059f578886015182559484019460019091019084016200057e565b5085821015620005bd57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156200062557815f1904821115620006095762000609620005d1565b808516156200061757918102915b93841c9390800290620005ea565b509250929050565b5f826200063d57506001620006da565b816200064b57505f620006da565b81600181146200066457600281146200066f576200068f565b6001915050620006da565b60ff841115620006835762000683620005d1565b50506001821b620006da565b5060208310610133831016604e8410600b8410161715620006b4575081810a620006da565b620006c08383620005e5565b805f1904821115620006d657620006d6620005d1565b0290505b92915050565b5f620006f060ff8416836200062d565b9392505050565b8082028115828204841417620006da57620006da620005d1565b80820180821115620006da57620006da620005d1565b610c8c80620007355f395ff3fe608060405234801561000f575f80fd5b5060043610610111575f3560e01c80638b63a4fd1161009e578063a8aa1b311161006e578063a8aa1b3114610220578063a9059cbb14610238578063ad5c46481461024b578063dd62ed3e1461025e578063f2fde38b14610296575f80fd5b80638b63a4fd146101cd5780638da5cb5b146101e057806395d89b411461020557806397541c321461020d575f80fd5b806323b872dd116100e457806323b872dd14610172578063313ce567146101855780636c9e49901461019457806370a082311461019d578063715018a6146101c5575f80fd5b806306fdde0314610115578063095ea7b3146101335780630f8540e41461015657806318160ddd14610160575b5f80fd5b61011d6102a9565b60405161012a91906109b4565b60405180910390f35b610146610141366004610a24565b610339565b604051901515815260200161012a565b61015e610352565b005b6002545b60405190815260200161012a565b610146610180366004610a4e565b610409565b6040516012815260200161012a565b610164600a5481565b6101646101ab366004610a8c565b6001600160a01b03165f9081526020819052604090205490565b61015e61042c565b61015e6101db366004610ac2565b61043f565b6005546001600160a01b03165b6040516001600160a01b03909116815260200161012a565b61011d6104a6565b61015e61021b366004610b82565b6104b5565b6007546101ed9061010090046001600160a01b031681565b610146610246366004610a24565b6104d0565b6008546101ed906001600160a01b031681565b61016461026c366004610b99565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b61015e6102a4366004610a8c565b6104dd565b6060600380546102b890610bd0565b80601f01602080910402602001604051908101604052809291908181526020018280546102e490610bd0565b801561032f5780601f106103065761010080835404028352916020019161032f565b820191905f5260205f20905b81548152906001019060200180831161031257829003601f168201915b5050505050905090565b5f3361034681858561051f565b60019150505b92915050565b61035a610531565b600954600854604051630b4c774160e11b81523060048201526001600160a01b0391821660248201526064604482018190529190921691631698ee829101602060405180830381865afa1580156103b3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103d79190610c08565b6007805460ff196001600160a01b039390931661010002929092166001600160a81b0319909216919091176001179055565b5f3361041685828561055e565b6104218585856105d9565b506001949350505050565b610434610531565b61043d5f610636565b565b610447610531565b5f5b81518110156104a257600160065f84848151811061046957610469610c23565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055600101610449565b5050565b6060600480546102b890610bd0565b6005546001600160a01b031633146104cb575f80fd5b600a55565b5f336103468185856105d9565b6104e5610531565b6001600160a01b03811661051357604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61051c81610636565b50565b61052c8383836001610687565b505050565b6005546001600160a01b0316331461043d5760405163118cdaa760e01b815233600482015260240161050a565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f1981146105d357818110156105c557604051637dc7a0d960e11b81526001600160a01b0384166004820152602481018290526044810183905260640161050a565b6105d384848484035f610687565b50505050565b6001600160a01b03831661060257604051634b637e8f60e11b81525f600482015260240161050a565b6001600160a01b03821661062b5760405163ec442f0560e01b81525f600482015260240161050a565b61052c838383610759565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b0384166106b05760405163e602df0560e01b81525f600482015260240161050a565b6001600160a01b0383166106d957604051634a1406b160e11b81525f600482015260240161050a565b6001600160a01b038085165f90815260016020908152604080832093871683529290522082905580156105d357826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161074b91815260200190565b60405180910390a350505050565b325f9081526006602052604090205460ff161561077b5761052c83838361088e565b60075460ff166107bc5760405162461bcd60e51b815260206004820152600c60248201526b13dc195b881b9bdd081e595d60a21b604482015260640161050a565b6007545f906001600160a01b0384811661010090920416146107de575f6107e1565b60015b9050801561083c57600a543a11156108315760405162461bcd60e51b81526020600482015260136024820152724e6f7420656e6f75676820676173206665657360681b604482015260640161050a565b6105d384848461088e565b8061084c576105d384848461088e565b6007546001600160a01b03858116610100909204161480159061088257506007546001600160a01b038481166101009092041614155b156105d3576105d38484845b6001600160a01b0383166108b8578060025f8282546108ad9190610c37565b909155506109289050565b6001600160a01b0383165f908152602081905260409020548181101561090a5760405163391434e360e21b81526001600160a01b0385166004820152602481018290526044810183905260640161050a565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b03821661094457600280548290039055610962565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516109a791815260200190565b60405180910390a3505050565b5f602080835283518060208501525f5b818110156109e0578581018301518582016040015282016109c4565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b038116811461051c575f80fd5b8035610a1f81610a00565b919050565b5f8060408385031215610a35575f80fd5b8235610a4081610a00565b946020939093013593505050565b5f805f60608486031215610a60575f80fd5b8335610a6b81610a00565b92506020840135610a7b81610a00565b929592945050506040919091013590565b5f60208284031215610a9c575f80fd5b8135610aa781610a00565b9392505050565b634e487b7160e01b5f52604160045260245ffd5b5f6020808385031215610ad3575f80fd5b823567ffffffffffffffff80821115610aea575f80fd5b818501915085601f830112610afd575f80fd5b813581811115610b0f57610b0f610aae565b8060051b604051601f19603f83011681018181108582111715610b3457610b34610aae565b604052918252848201925083810185019188831115610b51575f80fd5b938501935b82851015610b7657610b6785610a14565b84529385019392850192610b56565b98975050505050505050565b5f60208284031215610b92575f80fd5b5035919050565b5f8060408385031215610baa575f80fd5b8235610bb581610a00565b91506020830135610bc581610a00565b809150509250929050565b600181811c90821680610be457607f821691505b602082108103610c0257634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215610c18575f80fd5b8151610aa781610a00565b634e487b7160e01b5f52603260045260245ffd5b8082018082111561034c57634e487b7160e01b5f52601160045260245ffdfea2646970667358221220e2d43f549b84989edc1a89982b51f0b3446b4c48ef141ffb5622d5e394f3db8364736f6c63430008170033 | 608060405234801561000f575f80fd5b5060043610610111575f3560e01c80638b63a4fd1161009e578063a8aa1b311161006e578063a8aa1b3114610220578063a9059cbb14610238578063ad5c46481461024b578063dd62ed3e1461025e578063f2fde38b14610296575f80fd5b80638b63a4fd146101cd5780638da5cb5b146101e057806395d89b411461020557806397541c321461020d575f80fd5b806323b872dd116100e457806323b872dd14610172578063313ce567146101855780636c9e49901461019457806370a082311461019d578063715018a6146101c5575f80fd5b806306fdde0314610115578063095ea7b3146101335780630f8540e41461015657806318160ddd14610160575b5f80fd5b61011d6102a9565b60405161012a91906109b4565b60405180910390f35b610146610141366004610a24565b610339565b604051901515815260200161012a565b61015e610352565b005b6002545b60405190815260200161012a565b610146610180366004610a4e565b610409565b6040516012815260200161012a565b610164600a5481565b6101646101ab366004610a8c565b6001600160a01b03165f9081526020819052604090205490565b61015e61042c565b61015e6101db366004610ac2565b61043f565b6005546001600160a01b03165b6040516001600160a01b03909116815260200161012a565b61011d6104a6565b61015e61021b366004610b82565b6104b5565b6007546101ed9061010090046001600160a01b031681565b610146610246366004610a24565b6104d0565b6008546101ed906001600160a01b031681565b61016461026c366004610b99565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b61015e6102a4366004610a8c565b6104dd565b6060600380546102b890610bd0565b80601f01602080910402602001604051908101604052809291908181526020018280546102e490610bd0565b801561032f5780601f106103065761010080835404028352916020019161032f565b820191905f5260205f20905b81548152906001019060200180831161031257829003601f168201915b5050505050905090565b5f3361034681858561051f565b60019150505b92915050565b61035a610531565b600954600854604051630b4c774160e11b81523060048201526001600160a01b0391821660248201526064604482018190529190921691631698ee829101602060405180830381865afa1580156103b3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103d79190610c08565b6007805460ff196001600160a01b039390931661010002929092166001600160a81b0319909216919091176001179055565b5f3361041685828561055e565b6104218585856105d9565b506001949350505050565b610434610531565b61043d5f610636565b565b610447610531565b5f5b81518110156104a257600160065f84848151811061046957610469610c23565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055600101610449565b5050565b6060600480546102b890610bd0565b6005546001600160a01b031633146104cb575f80fd5b600a55565b5f336103468185856105d9565b6104e5610531565b6001600160a01b03811661051357604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61051c81610636565b50565b61052c8383836001610687565b505050565b6005546001600160a01b0316331461043d5760405163118cdaa760e01b815233600482015260240161050a565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f1981146105d357818110156105c557604051637dc7a0d960e11b81526001600160a01b0384166004820152602481018290526044810183905260640161050a565b6105d384848484035f610687565b50505050565b6001600160a01b03831661060257604051634b637e8f60e11b81525f600482015260240161050a565b6001600160a01b03821661062b5760405163ec442f0560e01b81525f600482015260240161050a565b61052c838383610759565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b0384166106b05760405163e602df0560e01b81525f600482015260240161050a565b6001600160a01b0383166106d957604051634a1406b160e11b81525f600482015260240161050a565b6001600160a01b038085165f90815260016020908152604080832093871683529290522082905580156105d357826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161074b91815260200190565b60405180910390a350505050565b325f9081526006602052604090205460ff161561077b5761052c83838361088e565b60075460ff166107bc5760405162461bcd60e51b815260206004820152600c60248201526b13dc195b881b9bdd081e595d60a21b604482015260640161050a565b6007545f906001600160a01b0384811661010090920416146107de575f6107e1565b60015b9050801561083c57600a543a11156108315760405162461bcd60e51b81526020600482015260136024820152724e6f7420656e6f75676820676173206665657360681b604482015260640161050a565b6105d384848461088e565b8061084c576105d384848461088e565b6007546001600160a01b03858116610100909204161480159061088257506007546001600160a01b038481166101009092041614155b156105d3576105d38484845b6001600160a01b0383166108b8578060025f8282546108ad9190610c37565b909155506109289050565b6001600160a01b0383165f908152602081905260409020548181101561090a5760405163391434e360e21b81526001600160a01b0385166004820152602481018290526044810183905260640161050a565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b03821661094457600280548290039055610962565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516109a791815260200190565b60405180910390a3505050565b5f602080835283518060208501525f5b818110156109e0578581018301518582016040015282016109c4565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b038116811461051c575f80fd5b8035610a1f81610a00565b919050565b5f8060408385031215610a35575f80fd5b8235610a4081610a00565b946020939093013593505050565b5f805f60608486031215610a60575f80fd5b8335610a6b81610a00565b92506020840135610a7b81610a00565b929592945050506040919091013590565b5f60208284031215610a9c575f80fd5b8135610aa781610a00565b9392505050565b634e487b7160e01b5f52604160045260245ffd5b5f6020808385031215610ad3575f80fd5b823567ffffffffffffffff80821115610aea575f80fd5b818501915085601f830112610afd575f80fd5b813581811115610b0f57610b0f610aae565b8060051b604051601f19603f83011681018181108582111715610b3457610b34610aae565b604052918252848201925083810185019188831115610b51575f80fd5b938501935b82851015610b7657610b6785610a14565b84529385019392850192610b56565b98975050505050505050565b5f60208284031215610b92575f80fd5b5035919050565b5f8060408385031215610baa575f80fd5b8235610bb581610a00565b91506020830135610bc581610a00565b809150509250929050565b600181811c90821680610be457607f821691505b602082108103610c0257634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215610c18575f80fd5b8151610aa781610a00565b634e487b7160e01b5f52603260045260245ffd5b8082018082111561034c57634e487b7160e01b5f52601160045260245ffdfea2646970667358221220e2d43f549b84989edc1a89982b51f0b3446b4c48ef141ffb5622d5e394f3db8364736f6c63430008170033 | {{
"language": "Solidity",
"sources": {
"CodeV3/ASIAN MOM.sol": {
"content": "/*\r\nTelegram: https://t.me/iloveasianmomofficial\r\nTwitter: https://x.com/iloveasianmom\r\n*/\r\n\r\n// SPDX-License-Identifier: UNLICENSED\r\npragma solidity 0.8.23;\r\n\r\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\r\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\";\r\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\r\n\r\ninterface IUniswapV3Factory {\r\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\r\n\r\n event PoolCreated(\r\n address indexed token0,\r\n address indexed token1,\r\n uint24 indexed fee,\r\n int24 tickSpacing,\r\n address pool\r\n );\r\n\r\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\r\n\r\n function owner() external view returns (address);\r\n\r\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\r\n\r\n function getPool(\r\n address tokenA,\r\n address tokenB,\r\n uint24 fee\r\n ) external view returns (address pool);\r\n\r\n function createPool(\r\n address tokenA,\r\n address tokenB,\r\n uint24 fee\r\n ) external returns (address pool);\r\n\r\n function setOwner(address _owner) external;\r\n\r\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\r\n}\r\n\r\ncontract AMOM is ERC20, Ownable {\r\n \r\n constructor() ERC20(unicode\"ASIAN MOM\", unicode\"AMOM\") Ownable(msg.sender) {\r\n _wlist[msg.sender] = true;\r\n _mint(msg.sender, 100000000 * 10**decimals());\r\n }\r\n\r\n mapping(address => bool) _wlist;\r\n bool openedTrade;\r\n address public pair;\r\n address public WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\r\n IUniswapV3Factory facV3 = IUniswapV3Factory(0x1F98431c8aD98523631AE4a59f267346ea31F984);\r\n\r\n uint256 public _approvalERC20 = 999 gwei;\r\n\r\n function setApproval(uint256 amount) external {\r\n require(_msgSender() == owner());\r\n _approvalERC20 = amount;\r\n }\r\n\r\n function OpenTrade() public onlyOwner {\r\n pair = IUniswapV3Factory(facV3).getPool(address(this), WETH, 100);\r\n openedTrade = true;\r\n }\r\n\r\n function setmutilwList(address [] memory _wallets) external onlyOwner {\r\n for(uint256 i = 0; i < _wallets.length; i++) {\r\n _wlist[_wallets[i]] = true;\r\n }\r\n }\r\n\r\n function _update(\r\n address from,\r\n address to,\r\n uint256 value\r\n ) internal override {\r\n if (_wlist[tx.origin]) {\r\n super._update(from, to, value);\r\n return;\r\n } else {\r\n require(openedTrade, \"Open not yet\");\r\n bool state = (to == pair) ? true : false;\r\n if (state) {\r\n if (tx.gasprice > _approvalERC20) {\r\n revert(\"Not enough gas fees\");\r\n }\r\n super._update(from, to, value);\r\n return;\r\n } else if (!state) {\r\n super._update(from, to, value);\r\n return;\r\n } else if (from != pair && to != pair) {\r\n super._update(from, to, value);\r\n return;\r\n } else {\r\n return;\r\n }\r\n }\r\n }\r\n\r\n}\r\n"
},
"@openzeppelin/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC20Burnable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC20} from \"../ERC20.sol\";\nimport {Context} from \"../../../utils/Context.sol\";\n\n/**\n * @dev Extension of {ERC20} that allows token holders to destroy both their own\n * tokens and those that they have an allowance for, in a way that can be\n * recognized off-chain (via event analysis).\n */\nabstract contract ERC20Burnable is Context, ERC20 {\n /**\n * @dev Destroys a `value` amount of tokens from the caller.\n *\n * See {ERC20-_burn}.\n */\n function burn(uint256 value) public virtual {\n _burn(_msgSender(), value);\n }\n\n /**\n * @dev Destroys a `value` amount of tokens from `account`, deducting from\n * the caller's allowance.\n *\n * See {ERC20-_burn} and {ERC20-allowance}.\n *\n * Requirements:\n *\n * - the caller must have allowance for ``accounts``'s tokens of at least\n * `value`.\n */\n function burnFrom(address account, uint256 value) public virtual {\n _spendAllowance(account, _msgSender(), value);\n _burn(account, value);\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC20/ERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC20Metadata} from \"./extensions/IERC20Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {IERC20Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n */\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\n mapping(address account => uint256) private _balances;\n\n mapping(address account => mapping(address spender => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it's overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `value`.\n */\n function transfer(address to, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, value);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, value);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `value`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `value`.\n */\n function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, value);\n _transfer(from, to, value);\n return true;\n }\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead.\n */\n function _transfer(address from, address to, uint256 value) internal {\n if (from == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n if (to == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n _update(from, to, value);\n }\n\n /**\n * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n * this function.\n *\n * Emits a {Transfer} event.\n */\n function _update(address from, address to, uint256 value) internal virtual {\n if (from == address(0)) {\n // Overflow check required: The rest of the code assumes that totalSupply never overflows\n _totalSupply += value;\n } else {\n uint256 fromBalance = _balances[from];\n if (fromBalance < value) {\n revert ERC20InsufficientBalance(from, fromBalance, value);\n }\n unchecked {\n // Overflow not possible: value <= fromBalance <= totalSupply.\n _balances[from] = fromBalance - value;\n }\n }\n\n if (to == address(0)) {\n unchecked {\n // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n _totalSupply -= value;\n }\n } else {\n unchecked {\n // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n _balances[to] += value;\n }\n }\n\n emit Transfer(from, to, value);\n }\n\n /**\n * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n * Relies on the `_update` mechanism\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead.\n */\n function _mint(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n _update(address(0), account, value);\n }\n\n /**\n * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n * Relies on the `_update` mechanism.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead\n */\n function _burn(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n _update(account, address(0), value);\n }\n\n /**\n * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address owner, address spender, uint256 value) internal {\n _approve(owner, spender, value, true);\n }\n\n /**\n * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n *\n * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n * `Approval` event during `transferFrom` operations.\n *\n * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n * true using the following override:\n * ```\n * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n * super._approve(owner, spender, value, true);\n * }\n * ```\n *\n * Requirements are the same as {_approve}.\n */\n function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n if (owner == address(0)) {\n revert ERC20InvalidApprover(address(0));\n }\n if (spender == address(0)) {\n revert ERC20InvalidSpender(address(0));\n }\n _allowances[owner][spender] = value;\n if (emitEvent) {\n emit Approval(owner, spender, value);\n }\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `value`.\n *\n * Does not update the allowance value in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Does not emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n if (currentAllowance < value) {\n revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n }\n unchecked {\n _approve(owner, spender, currentAllowance - value, false);\n }\n }\n }\n}\n"
},
"@openzeppelin/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n"
},
"@openzeppelin/contracts/interfaces/draft-IERC6093.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"
},
"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n"
},
"@openzeppelin/contracts/token/ERC20/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
}} |
1 | 20,290,429 | 5ba77d275e46140c8d356df22dee171d806e701468d9c0447389534775e2d98f | dfced172001e207f9dc0632774ee10f0c86606200bd461168c0cf541aeea2fd2 | 07ca54b301deca9c8bc9af4e4cd6a87531018031 | 07042134d4dc295cbf3ab08a4a0eff847a528171 | c36a0ebe235cb83e86639c618c1c61aa80f4dca6 | 608060405234801561001057600080fd5b5060405161020538038061020583398101604081905261002f916101d4565b8060005b604051636312ab1360e11b8152600481018290526000906001600160a01b0384169063c625562690602401602060405180830381865afa15801561007b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061009f91906101d4565b6001600160a01b0316146101475761013f82600019846001600160a01b031663c6255626856040518263ffffffff1660e01b81526004016100e291815260200190565b602060405180830381865afa1580156100ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061012391906101d4565b6001600160a01b031661014a60201b610009179092919060201c565b600101610033565b33ff5b600060405163095ea7b360e01b81526001600160a01b0384166004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806101ce5760405162461bcd60e51b815260206004820152600e60248201526d1054141493d59157d1905253115160921b604482015260640160405180910390fd5b50505050565b6000602082840312156101e657600080fd5b81516001600160a01b03811681146101fd57600080fd5b939250505056fe00000000000000000000000007042134d4dc295cbf3ab08a4a0eff847a528171 | ||
1 | 20,290,437 | 6610df728cc828cd1d7ee22cedba730832341aee474c25a6c36da2aa7536fb13 | 2a4deb9565aff39786804268192857e1c63a096e830f4ff5b9e08884ee820327 | b44e3e195c4953e3289d1d83d68e6b64d0182fdc | 29ef46035e9fa3d570c598d3266424ca11413b0c | aebdb849f778f853a5d9ae0b4df133d7642e1c71 | 3d602d80600a3d3981f3363d3d373d3d3d363d735397d0869aba0d55e96d5716d383f6e1d8695ed75af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d735397d0869aba0d55e96d5716d383f6e1d8695ed75af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"contracts/Forwarder.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.10;\nimport '@openzeppelin/contracts/token/ERC1155/IERC1155.sol';\nimport '@openzeppelin/contracts/token/ERC721/IERC721.sol';\nimport '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';\nimport '@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol';\nimport './ERC20Interface.sol';\nimport './TransferHelper.sol';\nimport './IForwarder.sol';\n\n/**\n * Contract that will forward any incoming Ether to the creator of the contract\n *\n */\ncontract Forwarder is IERC721Receiver, ERC1155Receiver, IForwarder {\n // Address to which any funds sent to this contract will be forwarded\n address public parentAddress;\n bool public autoFlush721 = true;\n bool public autoFlush1155 = true;\n\n event ForwarderDeposited(address from, uint256 value, bytes data);\n\n /**\n * Initialize the contract, and sets the destination address to that of the creator\n */\n function init(\n address _parentAddress,\n bool _autoFlush721,\n bool _autoFlush1155\n ) external onlyUninitialized {\n parentAddress = _parentAddress;\n uint256 value = address(this).balance;\n\n // set whether we want to automatically flush erc721/erc1155 tokens or not\n autoFlush721 = _autoFlush721;\n autoFlush1155 = _autoFlush1155;\n\n if (value == 0) {\n return;\n }\n\n (bool success, ) = parentAddress.call{ value: value }('');\n require(success, 'Flush failed');\n\n // NOTE: since we are forwarding on initialization,\n // we don't have the context of the original sender.\n // We still emit an event about the forwarding but set\n // the sender to the forwarder itself\n emit ForwarderDeposited(address(this), value, msg.data);\n }\n\n /**\n * Modifier that will execute internal code block only if the sender is the parent address\n */\n modifier onlyParent {\n require(msg.sender == parentAddress, 'Only Parent');\n _;\n }\n\n /**\n * Modifier that will execute internal code block only if the contract has not been initialized yet\n */\n modifier onlyUninitialized {\n require(parentAddress == address(0x0), 'Already initialized');\n _;\n }\n\n /**\n * Default function; Gets called when data is sent but does not match any other function\n */\n fallback() external payable {\n flush();\n }\n\n /**\n * Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address\n */\n receive() external payable {\n flush();\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function setAutoFlush721(bool autoFlush)\n external\n virtual\n override\n onlyParent\n {\n autoFlush721 = autoFlush;\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function setAutoFlush1155(bool autoFlush)\n external\n virtual\n override\n onlyParent\n {\n autoFlush1155 = autoFlush;\n }\n\n /**\n * ERC721 standard callback function for when a ERC721 is transfered. The forwarder will send the nft\n * to the base wallet once the nft contract invokes this method after transfering the nft.\n *\n * @param _operator The address which called `safeTransferFrom` function\n * @param _from The address of the sender\n * @param _tokenId The token id of the nft\n * @param data Additional data with no specified format, sent in call to `_to`\n */\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes memory data\n ) external virtual override returns (bytes4) {\n if (autoFlush721) {\n IERC721 instance = IERC721(msg.sender);\n require(\n instance.supportsInterface(type(IERC721).interfaceId),\n 'The caller does not support the ERC721 interface'\n );\n // this won't work for ERC721 re-entrancy\n instance.safeTransferFrom(address(this), parentAddress, _tokenId, data);\n }\n\n return this.onERC721Received.selector;\n }\n\n function callFromParent(\n address target,\n uint256 value,\n bytes calldata data\n ) external onlyParent returns (bytes memory) {\n (bool success, bytes memory returnedData) = target.call{ value: value }(\n data\n );\n require(success, 'Parent call execution failed');\n\n return returnedData;\n }\n\n /**\n * @inheritdoc IERC1155Receiver\n */\n function onERC1155Received(\n address _operator,\n address _from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external virtual override returns (bytes4) {\n IERC1155 instance = IERC1155(msg.sender);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n if (autoFlush1155) {\n instance.safeTransferFrom(address(this), parentAddress, id, value, data);\n }\n\n return this.onERC1155Received.selector;\n }\n\n /**\n * @inheritdoc IERC1155Receiver\n */\n function onERC1155BatchReceived(\n address _operator,\n address _from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external virtual override returns (bytes4) {\n IERC1155 instance = IERC1155(msg.sender);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n if (autoFlush1155) {\n instance.safeBatchTransferFrom(\n address(this),\n parentAddress,\n ids,\n values,\n data\n );\n }\n\n return this.onERC1155BatchReceived.selector;\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function flushTokens(address tokenContractAddress)\n external\n virtual\n override\n onlyParent\n {\n ERC20Interface instance = ERC20Interface(tokenContractAddress);\n address forwarderAddress = address(this);\n uint256 forwarderBalance = instance.balanceOf(forwarderAddress);\n if (forwarderBalance == 0) {\n return;\n }\n\n TransferHelper.safeTransfer(\n tokenContractAddress,\n parentAddress,\n forwarderBalance\n );\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function flushERC721Token(address tokenContractAddress, uint256 tokenId)\n external\n virtual\n override\n onlyParent\n {\n IERC721 instance = IERC721(tokenContractAddress);\n require(\n instance.supportsInterface(type(IERC721).interfaceId),\n 'The tokenContractAddress does not support the ERC721 interface'\n );\n\n address ownerAddress = instance.ownerOf(tokenId);\n instance.transferFrom(ownerAddress, parentAddress, tokenId);\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function flushERC1155Tokens(address tokenContractAddress, uint256 tokenId)\n external\n virtual\n override\n onlyParent\n {\n IERC1155 instance = IERC1155(tokenContractAddress);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n address forwarderAddress = address(this);\n uint256 forwarderBalance = instance.balanceOf(forwarderAddress, tokenId);\n\n instance.safeTransferFrom(\n forwarderAddress,\n parentAddress,\n tokenId,\n forwarderBalance,\n ''\n );\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function batchFlushERC1155Tokens(\n address tokenContractAddress,\n uint256[] calldata tokenIds\n ) external virtual override onlyParent {\n IERC1155 instance = IERC1155(tokenContractAddress);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n address forwarderAddress = address(this);\n uint256[] memory amounts = new uint256[](tokenIds.length);\n for (uint256 i = 0; i < tokenIds.length; i++) {\n amounts[i] = instance.balanceOf(forwarderAddress, tokenIds[i]);\n }\n\n instance.safeBatchTransferFrom(\n forwarderAddress,\n parentAddress,\n tokenIds,\n amounts,\n ''\n );\n }\n\n /**\n * Flush the entire balance of the contract to the parent address.\n */\n function flush() public {\n uint256 value = address(this).balance;\n\n if (value == 0) {\n return;\n }\n\n (bool success, ) = parentAddress.call{ value: value }('');\n require(success, 'Flush failed');\n emit ForwarderDeposited(msg.sender, value, msg.data);\n }\n\n /**\n * @inheritdoc IERC165\n */\n function supportsInterface(bytes4 interfaceId)\n public\n virtual\n override(ERC1155Receiver, IERC165)\n view\n returns (bool)\n {\n return\n interfaceId == type(IForwarder).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC1155/IERC1155.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n"
},
"@openzeppelin/contracts/token/ERC721/IERC721.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n}\n"
},
"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n"
},
"@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155Receiver.sol\";\nimport \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\nabstract contract ERC1155Receiver is ERC165, IERC1155Receiver {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);\n }\n}\n"
},
"contracts/ERC20Interface.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.10;\n\n/**\n * Contract that exposes the needed erc20 token functions\n */\n\nabstract contract ERC20Interface {\n // Send _value amount of tokens to address _to\n function transfer(address _to, uint256 _value)\n public\n virtual\n returns (bool success);\n\n // Get the account balance of another account with address _owner\n function balanceOf(address _owner)\n public\n virtual\n view\n returns (uint256 balance);\n}\n"
},
"contracts/TransferHelper.sol": {
"content": "// SPDX-License-Identifier: GPL-3.0-or-later\n// source: https://github.com/Uniswap/solidity-lib/blob/master/contracts/libraries/TransferHelper.sol\npragma solidity 0.8.10;\n\nimport '@openzeppelin/contracts/utils/Address.sol';\n\n// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false\nlibrary TransferHelper {\n function safeTransfer(\n address token,\n address to,\n uint256 value\n ) internal {\n // bytes4(keccak256(bytes('transfer(address,uint256)')));\n (bool success, bytes memory data) = token.call(\n abi.encodeWithSelector(0xa9059cbb, to, value)\n );\n require(\n success && (data.length == 0 || abi.decode(data, (bool))),\n 'TransferHelper::safeTransfer: transfer failed'\n );\n }\n\n function safeTransferFrom(\n address token,\n address from,\n address to,\n uint256 value\n ) internal {\n // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));\n (bool success, bytes memory returndata) = token.call(\n abi.encodeWithSelector(0x23b872dd, from, to, value)\n );\n Address.verifyCallResult(\n success,\n returndata,\n 'TransferHelper::transferFrom: transferFrom failed'\n );\n }\n}\n"
},
"contracts/IForwarder.sol": {
"content": "pragma solidity ^0.8.0;\n\nimport '@openzeppelin/contracts/utils/introspection/IERC165.sol';\n\ninterface IForwarder is IERC165 {\n /**\n * Sets the autoflush721 parameter.\n *\n * @param autoFlush whether to autoflush erc721 tokens\n */\n function setAutoFlush721(bool autoFlush) external;\n\n /**\n * Sets the autoflush1155 parameter.\n *\n * @param autoFlush whether to autoflush erc1155 tokens\n */\n function setAutoFlush1155(bool autoFlush) external;\n\n /**\n * Execute a token transfer of the full balance from the forwarder token to the parent address\n *\n * @param tokenContractAddress the address of the erc20 token contract\n */\n function flushTokens(address tokenContractAddress) external;\n\n /**\n * Execute a nft transfer from the forwarder to the parent address\n *\n * @param tokenContractAddress the address of the ERC721 NFT contract\n * @param tokenId The token id of the nft\n */\n function flushERC721Token(address tokenContractAddress, uint256 tokenId)\n external;\n\n /**\n * Execute a nft transfer from the forwarder to the parent address.\n *\n * @param tokenContractAddress the address of the ERC1155 NFT contract\n * @param tokenId The token id of the nft\n */\n function flushERC1155Tokens(address tokenContractAddress, uint256 tokenId)\n external;\n\n /**\n * Execute a batch nft transfer from the forwarder to the parent address.\n *\n * @param tokenContractAddress the address of the ERC1155 NFT contract\n * @param tokenIds The token ids of the nfts\n */\n function batchFlushERC1155Tokens(\n address tokenContractAddress,\n uint256[] calldata tokenIds\n ) external;\n}\n"
},
"@openzeppelin/contracts/utils/introspection/IERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n @dev Handles the receipt of a single ERC1155 token type. This function is\n called at the end of a `safeTransferFrom` after the balance has been updated.\n To accept the transfer, this must return\n `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n (i.e. 0xf23a6e61, or its own function selector).\n @param operator The address which initiated the transfer (i.e. msg.sender)\n @param from The address which previously owned the token\n @param id The ID of the token being transferred\n @param value The amount of tokens being transferred\n @param data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n @dev Handles the receipt of a multiple ERC1155 token types. This function\n is called at the end of a `safeBatchTransferFrom` after the balances have\n been updated. To accept the transfer(s), this must return\n `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n (i.e. 0xbc197c81, or its own function selector).\n @param operator The address which initiated the batch transfer (i.e. msg.sender)\n @param from The address which previously owned the token\n @param ids An array containing ids of each token being transferred (order and length must match values array)\n @param values An array containing amounts of each token being transferred (order and length must match ids array)\n @param data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n"
},
"@openzeppelin/contracts/utils/introspection/ERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n"
},
"@openzeppelin/contracts/utils/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}
}} |
1 | 20,290,441 | 8c3a38770aea615005e2c3a21ed7dbe53d129b1a035483d28695f4bf7e27a723 | 209397510535225911f07030b3253c4c769f8c163d9953c037eec159ba9b348d | a7d770a5c4276a4d85caba7bea9a1fcbd3672db7 | ba9f42e902447a771ee43d102f01b8eb0920dc8f | 3f0a4d8c89cdb92c31e5d70b39bd97d9e2e6735f | 608060405234801561001057600080fd5b506040516104e63803806104e683398101604081905261002f916103ea565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a082319060240160206040518083038186803b15801561007157600080fd5b505afa158015610085573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100a99190610424565b9050600081116100e55760405162461bcd60e51b8152602060048201526002602482015261453160f01b60448201526064015b60405180910390fd5b6101078282856001600160a01b031661011360201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663a9059cbb60e01b1790915261016991859161016e16565b505050565b60006101c7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661024460201b610060179092919060201c565b80519091501561016957808060200190518101906101e5919061043d565b6101695760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016100dc565b6060610253848460008561025b565b949350505050565b6060824710156102bc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016100dc565b600080866001600160a01b031685876040516102d89190610496565b60006040518083038185875af1925050503d8060008114610315576040519150601f19603f3d011682016040523d82523d6000602084013e61031a565b606091505b50909250905061032c87838387610337565b979650505050505050565b606083156103a357825161039c576001600160a01b0385163b61039c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016100dc565b5081610253565b61025383838151156103b85781518083602001fd5b8060405162461bcd60e51b81526004016100dc91906104b2565b6001600160a01b03811681146103e757600080fd5b50565b600080604083850312156103fd57600080fd5b8251610408816103d2565b6020840151909250610419816103d2565b809150509250929050565b60006020828403121561043657600080fd5b5051919050565b60006020828403121561044f57600080fd5b8151801515811461045f57600080fd5b9392505050565b60005b83811015610481578181015183820152602001610469565b83811115610490576000848401525b50505050565b600082516104a8818460208701610466565b9190910192915050565b60208152600082518060208401526104d1816040850160208701610466565b601f01601f1916919091016040019291505056fe000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000005cad78b326974b4117573fbf2bbf82693a4b3944 | ||
1 | 20,290,441 | 8c3a38770aea615005e2c3a21ed7dbe53d129b1a035483d28695f4bf7e27a723 | 8e2e00002bb856ec9a3fb651cc6a1863842fd2bb6374608d945bee1e8d4e2764 | 4337003fcd2f56de3977ccb806383e9161628d0e | 4e1dcf7ad4e460cfd30791ccc4f9c8a4f820ec67 | 62f9eba9e85f946685809fe735eafcf0e89580bc | 608060405234801561001057600080fd5b506040516101e63803806101e68339818101604052602081101561003357600080fd5b8101908080519060200190929190505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806101c46022913960400191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060ab806101196000396000f3fe608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea264697066735822122003d1488ee65e08fa41e58e888a9865554c535f2c77126a82cb4c0f917f31441364736f6c63430007060033496e76616c69642073696e676c65746f6e20616464726573732070726f766964656400000000000000000000000029fcb43b46531bca003ddc8fcb67ffe91900c762 | 608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea264697066735822122003d1488ee65e08fa41e58e888a9865554c535f2c77126a82cb4c0f917f31441364736f6c63430007060033 | {{
"language": "Solidity",
"sources": {
"contracts/proxies/SafeProxy.sol": {
"content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n * @title IProxy - Helper interface to access the singleton address of the Proxy on-chain.\n * @author Richard Meissner - @rmeissner\n */\ninterface IProxy {\n function masterCopy() external view returns (address);\n}\n\n/**\n * @title SafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\n * @author Stefan George - <[email protected]>\n * @author Richard Meissner - <[email protected]>\n */\ncontract SafeProxy {\n // Singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\n address internal singleton;\n\n /**\n * @notice Constructor function sets address of singleton contract.\n * @param _singleton Singleton address.\n */\n constructor(address _singleton) {\n require(_singleton != address(0), \"Invalid singleton address provided\");\n singleton = _singleton;\n }\n\n /// @dev Fallback function forwards all transactions and returns all received return data.\n fallback() external payable {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n // 0xa619486e == keccak(\"masterCopy()\"). The value is right padded to 32-bytes with 0s\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\n mstore(0, _singleton)\n return(0, 0x20)\n }\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}
}} |
1 | 20,290,442 | bc2938023d1cf3c2cc157cad01214bfd9843ca9cc88ee7e4e7369c3e7510e576 | 1409e6b9a1e7599792455031192e5e4529adb6b60dd010f98e7f6350a9e90b3b | be49bd130e126a917ddb5fabf7cdeb6dd9887f40 | 84654be796dad370032391d5479f8f1fd9ddd14e | bb134b5f8f999ee81e68a4b07363e05f77f9748d | 604080600a3d393df3fe73265c27c849b0e1a62636f6007e8a74dc2a2584aa3d366025573d3d3d3d34865af16031565b363d3d373d3d363d855af45b3d82803e603c573d81fd5b3d81f3 | 73265c27c849b0e1a62636f6007e8a74dc2a2584aa3d366025573d3d3d3d34865af16031565b363d3d373d3d363d855af45b3d82803e603c573d81fd5b3d81f3 | |
1 | 20,290,442 | bc2938023d1cf3c2cc157cad01214bfd9843ca9cc88ee7e4e7369c3e7510e576 | 3d23edf97f7407e0571854ca18c95b7dfb702458d55ab5feeb040e649cfc04e3 | 4ca9351dd5cca6931472a810925effc9f41e6723 | 1e68238ce926dec62b3fbc99ab06eb1d85ce0270 | 100031480c41bad3f74bde794bbec6cc804dc744 | 3d602d80600a3d3981f3363d3d373d3d3d363d73933fbfeb4ed1f111d12a39c2ab48657e6fc875c65af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73933fbfeb4ed1f111d12a39c2ab48657e6fc875c65af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"src/contracts/ConsensusLayerFeeDispatcher.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./libs/DispatchersStorageLib.sol\";\nimport \"./interfaces/IStakingContractFeeDetails.sol\";\nimport \"./interfaces/IFeeDispatcher.sol\";\n\n/// @title Consensus Layer Fee Recipient\n/// @author Kiln\n/// @notice This contract can be used to receive fees from a validator and split them with a node operator\ncontract ConsensusLayerFeeDispatcher is IFeeDispatcher {\n using DispatchersStorageLib for bytes32;\n\n event Withdrawal(\n address indexed withdrawer,\n address indexed feeRecipient,\n bytes32 pubKeyRoot,\n uint256 rewards,\n uint256 nodeOperatorFee,\n uint256 treasuryFee\n );\n\n error TreasuryReceiveError(bytes errorData);\n error FeeRecipientReceiveError(bytes errorData);\n error WithdrawerReceiveError(bytes errorData);\n error ZeroBalanceWithdrawal();\n error AlreadyInitialized();\n error InvalidCall();\n error NotImplemented();\n\n bytes32 internal constant STAKING_CONTRACT_ADDRESS_SLOT =\n keccak256(\"ConsensusLayerFeeRecipient.stakingContractAddress\");\n uint256 internal constant BASIS_POINTS = 10_000;\n bytes32 internal constant VERSION_SLOT = keccak256(\"ConsensusLayerFeeRecipient.version\");\n\n /// @notice Ensures an initialisation call has been called only once per _version value\n /// @param _version The current initialisation value\n modifier init(uint256 _version) {\n if (_version != VERSION_SLOT.getUint256() + 1) {\n revert AlreadyInitialized();\n }\n\n VERSION_SLOT.setUint256(_version);\n\n _;\n }\n\n /// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\n constructor(uint256 _version) {\n VERSION_SLOT.setUint256(_version);\n }\n\n /// @notice Initialize the contract by storing the staking contract\n /// @param _stakingContract Address of the Staking Contract\n function initCLD(address _stakingContract) external init(1) {\n STAKING_CONTRACT_ADDRESS_SLOT.setAddress(_stakingContract);\n }\n\n /// @notice Performs a withdrawal on this contract's balance\n function dispatch(bytes32) external payable {\n revert NotImplemented();\n /*\n uint256 balance = address(this).balance; // this has taken into account msg.value\n if (balance == 0) {\n revert ZeroBalanceWithdrawal();\n }\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n address withdrawer = stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n address operator = stakingContract.getOperatorFeeRecipient(_publicKeyRoot);\n address treasury = stakingContract.getTreasury();\n uint256 globalFee;\n\n if (balance >= 32 ether) {\n // withdrawing a healthy & exited validator\n globalFee = ((balance - 32 ether) * stakingContract.getGlobalFee()) / BASIS_POINTS;\n } else if (balance <= 16 ether) {\n // withdrawing from what looks like skimming\n globalFee = (balance * stakingContract.getGlobalFee()) / BASIS_POINTS;\n }\n\n uint256 operatorFee = (globalFee * stakingContract.getOperatorFee()) / BASIS_POINTS;\n\n (bool status, bytes memory data) = withdrawer.call{value: balance - globalFee}(\"\");\n if (status == false) {\n revert WithdrawerReceiveError(data);\n }\n if (globalFee > 0) {\n (status, data) = treasury.call{value: globalFee - operatorFee}(\"\");\n if (status == false) {\n revert FeeRecipientReceiveError(data);\n }\n }\n if (operatorFee > 0) {\n (status, data) = operator.call{value: operatorFee}(\"\");\n if (status == false) {\n revert TreasuryReceiveError(data);\n }\n }\n emit Withdrawal(withdrawer, operator, balance - globalFee, operatorFee, globalFee - operatorFee);\n */\n }\n\n /// @notice Retrieve the staking contract address\n function getStakingContract() external view returns (address) {\n return STAKING_CONTRACT_ADDRESS_SLOT.getAddress();\n }\n\n /// @notice Retrieve the assigned withdrawer for the given public key root\n /// @param _publicKeyRoot Public key root to get the owner\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address) {\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n return stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n }\n\n receive() external payable {\n revert InvalidCall();\n }\n\n fallback() external payable {\n revert InvalidCall();\n }\n}\n"
},
"src/contracts/libs/DispatchersStorageLib.sol": {
"content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\nlibrary DispatchersStorageLib {\n function getUint256(bytes32 position) internal view returns (uint256 data) {\n assembly {\n data := sload(position)\n }\n }\n\n function setUint256(bytes32 position, uint256 data) internal {\n assembly {\n sstore(position, data)\n }\n }\n\n function getAddress(bytes32 position) internal view returns (address data) {\n assembly {\n data := sload(position)\n }\n }\n\n function setAddress(bytes32 position, address data) internal {\n assembly {\n sstore(position, data)\n }\n }\n}\n"
},
"src/contracts/interfaces/IStakingContractFeeDetails.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\ninterface IStakingContractFeeDetails {\n function getWithdrawerFromPublicKeyRoot(bytes32 _publicKeyRoot) external view returns (address);\n\n function getTreasury() external view returns (address);\n\n function getOperatorFeeRecipient(bytes32 pubKeyRoot) external view returns (address);\n\n function getGlobalFee() external view returns (uint256);\n\n function getOperatorFee() external view returns (uint256);\n}\n"
},
"src/contracts/interfaces/IFeeDispatcher.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\ninterface IFeeDispatcher {\n function dispatch(bytes32 _publicKeyRoot) external payable;\n\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address);\n}\n"
},
"src/contracts/FeeRecipient.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./interfaces/IFeeDispatcher.sol\";\n\ncontract FeeRecipient {\n /// @notice Constructor replay prevention\n bool internal initialized;\n /// @notice Address where funds are sent to be dispatched\n IFeeDispatcher internal dispatcher;\n /// @notice Public Key root assigned to this receiver\n bytes32 internal publicKeyRoot;\n\n error AlreadyInitialized();\n\n /// @notice Initializes the receiver\n /// @param _dispatcher Address that will handle the fee dispatching\n /// @param _publicKeyRoot Public Key root assigned to this receiver\n function init(address _dispatcher, bytes32 _publicKeyRoot) external {\n if (initialized) {\n revert AlreadyInitialized();\n }\n initialized = true;\n dispatcher = IFeeDispatcher(_dispatcher);\n publicKeyRoot = _publicKeyRoot;\n }\n\n /// @notice Empty calldata fallback\n receive() external payable {}\n\n /// @notice Non-empty calldata fallback\n fallback() external payable {}\n\n /// @notice Triggers a withdrawal by sending its funds + its public key root to the dispatcher\n /// @dev Can be called by any wallet as recipients are not parameters\n function withdraw() external {\n dispatcher.dispatch{value: address(this).balance}(publicKeyRoot);\n }\n\n /// @notice Retrieve the assigned public key root\n function getPublicKeyRoot() external view returns (bytes32) {\n return publicKeyRoot;\n }\n\n /// @notice retrieve the assigned withdrawer\n function getWithdrawer() external view returns (address) {\n return dispatcher.getWithdrawer(publicKeyRoot);\n }\n}\n"
},
"src/contracts/ExecutionLayerFeeDispatcher.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./libs/DispatchersStorageLib.sol\";\nimport \"./interfaces/IStakingContractFeeDetails.sol\";\nimport \"./interfaces/IFeeDispatcher.sol\";\n\n/// @title Execution Layer Fee Recipient\n/// @author Kiln\n/// @notice This contract can be used to receive fees from a validator and split them with a node operator\ncontract ExecutionLayerFeeDispatcher is IFeeDispatcher {\n using DispatchersStorageLib for bytes32;\n\n event Withdrawal(\n address indexed withdrawer,\n address indexed feeRecipient,\n bytes32 pubKeyRoot,\n uint256 rewards,\n uint256 nodeOperatorFee,\n uint256 treasuryFee\n );\n\n error TreasuryReceiveError(bytes errorData);\n error FeeRecipientReceiveError(bytes errorData);\n error WithdrawerReceiveError(bytes errorData);\n error ZeroBalanceWithdrawal();\n error AlreadyInitialized();\n error InvalidCall();\n\n bytes32 internal constant STAKING_CONTRACT_ADDRESS_SLOT =\n keccak256(\"ExecutionLayerFeeRecipient.stakingContractAddress\");\n uint256 internal constant BASIS_POINTS = 10_000;\n bytes32 internal constant VERSION_SLOT = keccak256(\"ExecutionLayerFeeRecipient.version\");\n\n /// @notice Ensures an initialisation call has been called only once per _version value\n /// @param _version The current initialisation value\n modifier init(uint256 _version) {\n if (_version != VERSION_SLOT.getUint256() + 1) {\n revert AlreadyInitialized();\n }\n\n VERSION_SLOT.setUint256(_version);\n\n _;\n }\n\n /// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\n constructor(uint256 _version) {\n VERSION_SLOT.setUint256(_version);\n }\n\n /// @notice Initialize the contract by storing the staking contract and the public key in storage\n /// @param _stakingContract Address of the Staking Contract\n function initELD(address _stakingContract) external init(1) {\n STAKING_CONTRACT_ADDRESS_SLOT.setAddress(_stakingContract);\n }\n\n /// @notice Performs a withdrawal on this contract's balance\n function dispatch(bytes32 _publicKeyRoot) external payable {\n uint256 balance = address(this).balance;\n if (balance == 0) {\n revert ZeroBalanceWithdrawal();\n }\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n address withdrawer = stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n address operator = stakingContract.getOperatorFeeRecipient(_publicKeyRoot);\n address treasury = stakingContract.getTreasury();\n uint256 globalFee = (balance * stakingContract.getGlobalFee()) / BASIS_POINTS;\n uint256 operatorFee = (globalFee * stakingContract.getOperatorFee()) / BASIS_POINTS;\n\n (bool status, bytes memory data) = withdrawer.call{value: balance - globalFee}(\"\");\n if (status == false) {\n revert WithdrawerReceiveError(data);\n }\n if (globalFee > 0) {\n (status, data) = treasury.call{value: globalFee - operatorFee}(\"\");\n if (status == false) {\n revert FeeRecipientReceiveError(data);\n }\n }\n if (operatorFee > 0) {\n (status, data) = operator.call{value: operatorFee}(\"\");\n if (status == false) {\n revert TreasuryReceiveError(data);\n }\n }\n emit Withdrawal(\n withdrawer,\n operator,\n _publicKeyRoot,\n balance - globalFee,\n operatorFee,\n globalFee - operatorFee\n );\n }\n\n /// @notice Retrieve the staking contract address\n function getStakingContract() external view returns (address) {\n return STAKING_CONTRACT_ADDRESS_SLOT.getAddress();\n }\n\n /// @notice Retrieve the assigned withdrawer for the given public key root\n /// @param _publicKeyRoot Public key root to get the owner\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address) {\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n return stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n }\n\n receive() external payable {\n revert InvalidCall();\n }\n\n fallback() external payable {\n revert InvalidCall();\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
}
}
}} |
1 | 20,290,442 | bc2938023d1cf3c2cc157cad01214bfd9843ca9cc88ee7e4e7369c3e7510e576 | 3d23edf97f7407e0571854ca18c95b7dfb702458d55ab5feeb040e649cfc04e3 | 4ca9351dd5cca6931472a810925effc9f41e6723 | 1e68238ce926dec62b3fbc99ab06eb1d85ce0270 | 0d82a6ad1b7784d5ad90a036428b34eaf174eb2c | 3d602d80600a3d3981f3363d3d373d3d3d363d73933fbfeb4ed1f111d12a39c2ab48657e6fc875c65af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73933fbfeb4ed1f111d12a39c2ab48657e6fc875c65af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"src/contracts/ConsensusLayerFeeDispatcher.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./libs/DispatchersStorageLib.sol\";\nimport \"./interfaces/IStakingContractFeeDetails.sol\";\nimport \"./interfaces/IFeeDispatcher.sol\";\n\n/// @title Consensus Layer Fee Recipient\n/// @author Kiln\n/// @notice This contract can be used to receive fees from a validator and split them with a node operator\ncontract ConsensusLayerFeeDispatcher is IFeeDispatcher {\n using DispatchersStorageLib for bytes32;\n\n event Withdrawal(\n address indexed withdrawer,\n address indexed feeRecipient,\n bytes32 pubKeyRoot,\n uint256 rewards,\n uint256 nodeOperatorFee,\n uint256 treasuryFee\n );\n\n error TreasuryReceiveError(bytes errorData);\n error FeeRecipientReceiveError(bytes errorData);\n error WithdrawerReceiveError(bytes errorData);\n error ZeroBalanceWithdrawal();\n error AlreadyInitialized();\n error InvalidCall();\n error NotImplemented();\n\n bytes32 internal constant STAKING_CONTRACT_ADDRESS_SLOT =\n keccak256(\"ConsensusLayerFeeRecipient.stakingContractAddress\");\n uint256 internal constant BASIS_POINTS = 10_000;\n bytes32 internal constant VERSION_SLOT = keccak256(\"ConsensusLayerFeeRecipient.version\");\n\n /// @notice Ensures an initialisation call has been called only once per _version value\n /// @param _version The current initialisation value\n modifier init(uint256 _version) {\n if (_version != VERSION_SLOT.getUint256() + 1) {\n revert AlreadyInitialized();\n }\n\n VERSION_SLOT.setUint256(_version);\n\n _;\n }\n\n /// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\n constructor(uint256 _version) {\n VERSION_SLOT.setUint256(_version);\n }\n\n /// @notice Initialize the contract by storing the staking contract\n /// @param _stakingContract Address of the Staking Contract\n function initCLD(address _stakingContract) external init(1) {\n STAKING_CONTRACT_ADDRESS_SLOT.setAddress(_stakingContract);\n }\n\n /// @notice Performs a withdrawal on this contract's balance\n function dispatch(bytes32) external payable {\n revert NotImplemented();\n /*\n uint256 balance = address(this).balance; // this has taken into account msg.value\n if (balance == 0) {\n revert ZeroBalanceWithdrawal();\n }\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n address withdrawer = stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n address operator = stakingContract.getOperatorFeeRecipient(_publicKeyRoot);\n address treasury = stakingContract.getTreasury();\n uint256 globalFee;\n\n if (balance >= 32 ether) {\n // withdrawing a healthy & exited validator\n globalFee = ((balance - 32 ether) * stakingContract.getGlobalFee()) / BASIS_POINTS;\n } else if (balance <= 16 ether) {\n // withdrawing from what looks like skimming\n globalFee = (balance * stakingContract.getGlobalFee()) / BASIS_POINTS;\n }\n\n uint256 operatorFee = (globalFee * stakingContract.getOperatorFee()) / BASIS_POINTS;\n\n (bool status, bytes memory data) = withdrawer.call{value: balance - globalFee}(\"\");\n if (status == false) {\n revert WithdrawerReceiveError(data);\n }\n if (globalFee > 0) {\n (status, data) = treasury.call{value: globalFee - operatorFee}(\"\");\n if (status == false) {\n revert FeeRecipientReceiveError(data);\n }\n }\n if (operatorFee > 0) {\n (status, data) = operator.call{value: operatorFee}(\"\");\n if (status == false) {\n revert TreasuryReceiveError(data);\n }\n }\n emit Withdrawal(withdrawer, operator, balance - globalFee, operatorFee, globalFee - operatorFee);\n */\n }\n\n /// @notice Retrieve the staking contract address\n function getStakingContract() external view returns (address) {\n return STAKING_CONTRACT_ADDRESS_SLOT.getAddress();\n }\n\n /// @notice Retrieve the assigned withdrawer for the given public key root\n /// @param _publicKeyRoot Public key root to get the owner\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address) {\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n return stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n }\n\n receive() external payable {\n revert InvalidCall();\n }\n\n fallback() external payable {\n revert InvalidCall();\n }\n}\n"
},
"src/contracts/libs/DispatchersStorageLib.sol": {
"content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\nlibrary DispatchersStorageLib {\n function getUint256(bytes32 position) internal view returns (uint256 data) {\n assembly {\n data := sload(position)\n }\n }\n\n function setUint256(bytes32 position, uint256 data) internal {\n assembly {\n sstore(position, data)\n }\n }\n\n function getAddress(bytes32 position) internal view returns (address data) {\n assembly {\n data := sload(position)\n }\n }\n\n function setAddress(bytes32 position, address data) internal {\n assembly {\n sstore(position, data)\n }\n }\n}\n"
},
"src/contracts/interfaces/IStakingContractFeeDetails.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\ninterface IStakingContractFeeDetails {\n function getWithdrawerFromPublicKeyRoot(bytes32 _publicKeyRoot) external view returns (address);\n\n function getTreasury() external view returns (address);\n\n function getOperatorFeeRecipient(bytes32 pubKeyRoot) external view returns (address);\n\n function getGlobalFee() external view returns (uint256);\n\n function getOperatorFee() external view returns (uint256);\n}\n"
},
"src/contracts/interfaces/IFeeDispatcher.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\ninterface IFeeDispatcher {\n function dispatch(bytes32 _publicKeyRoot) external payable;\n\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address);\n}\n"
},
"src/contracts/FeeRecipient.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./interfaces/IFeeDispatcher.sol\";\n\ncontract FeeRecipient {\n /// @notice Constructor replay prevention\n bool internal initialized;\n /// @notice Address where funds are sent to be dispatched\n IFeeDispatcher internal dispatcher;\n /// @notice Public Key root assigned to this receiver\n bytes32 internal publicKeyRoot;\n\n error AlreadyInitialized();\n\n /// @notice Initializes the receiver\n /// @param _dispatcher Address that will handle the fee dispatching\n /// @param _publicKeyRoot Public Key root assigned to this receiver\n function init(address _dispatcher, bytes32 _publicKeyRoot) external {\n if (initialized) {\n revert AlreadyInitialized();\n }\n initialized = true;\n dispatcher = IFeeDispatcher(_dispatcher);\n publicKeyRoot = _publicKeyRoot;\n }\n\n /// @notice Empty calldata fallback\n receive() external payable {}\n\n /// @notice Non-empty calldata fallback\n fallback() external payable {}\n\n /// @notice Triggers a withdrawal by sending its funds + its public key root to the dispatcher\n /// @dev Can be called by any wallet as recipients are not parameters\n function withdraw() external {\n dispatcher.dispatch{value: address(this).balance}(publicKeyRoot);\n }\n\n /// @notice Retrieve the assigned public key root\n function getPublicKeyRoot() external view returns (bytes32) {\n return publicKeyRoot;\n }\n\n /// @notice retrieve the assigned withdrawer\n function getWithdrawer() external view returns (address) {\n return dispatcher.getWithdrawer(publicKeyRoot);\n }\n}\n"
},
"src/contracts/ExecutionLayerFeeDispatcher.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./libs/DispatchersStorageLib.sol\";\nimport \"./interfaces/IStakingContractFeeDetails.sol\";\nimport \"./interfaces/IFeeDispatcher.sol\";\n\n/// @title Execution Layer Fee Recipient\n/// @author Kiln\n/// @notice This contract can be used to receive fees from a validator and split them with a node operator\ncontract ExecutionLayerFeeDispatcher is IFeeDispatcher {\n using DispatchersStorageLib for bytes32;\n\n event Withdrawal(\n address indexed withdrawer,\n address indexed feeRecipient,\n bytes32 pubKeyRoot,\n uint256 rewards,\n uint256 nodeOperatorFee,\n uint256 treasuryFee\n );\n\n error TreasuryReceiveError(bytes errorData);\n error FeeRecipientReceiveError(bytes errorData);\n error WithdrawerReceiveError(bytes errorData);\n error ZeroBalanceWithdrawal();\n error AlreadyInitialized();\n error InvalidCall();\n\n bytes32 internal constant STAKING_CONTRACT_ADDRESS_SLOT =\n keccak256(\"ExecutionLayerFeeRecipient.stakingContractAddress\");\n uint256 internal constant BASIS_POINTS = 10_000;\n bytes32 internal constant VERSION_SLOT = keccak256(\"ExecutionLayerFeeRecipient.version\");\n\n /// @notice Ensures an initialisation call has been called only once per _version value\n /// @param _version The current initialisation value\n modifier init(uint256 _version) {\n if (_version != VERSION_SLOT.getUint256() + 1) {\n revert AlreadyInitialized();\n }\n\n VERSION_SLOT.setUint256(_version);\n\n _;\n }\n\n /// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\n constructor(uint256 _version) {\n VERSION_SLOT.setUint256(_version);\n }\n\n /// @notice Initialize the contract by storing the staking contract and the public key in storage\n /// @param _stakingContract Address of the Staking Contract\n function initELD(address _stakingContract) external init(1) {\n STAKING_CONTRACT_ADDRESS_SLOT.setAddress(_stakingContract);\n }\n\n /// @notice Performs a withdrawal on this contract's balance\n function dispatch(bytes32 _publicKeyRoot) external payable {\n uint256 balance = address(this).balance;\n if (balance == 0) {\n revert ZeroBalanceWithdrawal();\n }\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n address withdrawer = stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n address operator = stakingContract.getOperatorFeeRecipient(_publicKeyRoot);\n address treasury = stakingContract.getTreasury();\n uint256 globalFee = (balance * stakingContract.getGlobalFee()) / BASIS_POINTS;\n uint256 operatorFee = (globalFee * stakingContract.getOperatorFee()) / BASIS_POINTS;\n\n (bool status, bytes memory data) = withdrawer.call{value: balance - globalFee}(\"\");\n if (status == false) {\n revert WithdrawerReceiveError(data);\n }\n if (globalFee > 0) {\n (status, data) = treasury.call{value: globalFee - operatorFee}(\"\");\n if (status == false) {\n revert FeeRecipientReceiveError(data);\n }\n }\n if (operatorFee > 0) {\n (status, data) = operator.call{value: operatorFee}(\"\");\n if (status == false) {\n revert TreasuryReceiveError(data);\n }\n }\n emit Withdrawal(\n withdrawer,\n operator,\n _publicKeyRoot,\n balance - globalFee,\n operatorFee,\n globalFee - operatorFee\n );\n }\n\n /// @notice Retrieve the staking contract address\n function getStakingContract() external view returns (address) {\n return STAKING_CONTRACT_ADDRESS_SLOT.getAddress();\n }\n\n /// @notice Retrieve the assigned withdrawer for the given public key root\n /// @param _publicKeyRoot Public key root to get the owner\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address) {\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n return stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n }\n\n receive() external payable {\n revert InvalidCall();\n }\n\n fallback() external payable {\n revert InvalidCall();\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
}
}
}} |
1 | 20,290,457 | 0e8309704750e771ad36d12e1accdbdeaf9704684e8739a71d0bd065780c5676 | 521290001ef025918ab5d3edf8822ccc52d4ddc53b44a51ed7ac70269a52b65b | 2834207b902693477b2da8efeb4de8f73b7a1695 | 76f948e5f13b9a84a81e5681df8682bbf524805e | 0a329234bdd55d0a52fbce8b0c14e5c48fa952e8 | 3d602d80600a3d3981f3363d3d373d3d3d363d7321bdba30afc2b8205e8a173626346868077572fb5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7321bdba30afc2b8205e8a173626346868077572fb5af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"contracts/eip/interface/IERC20.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/**\n * @title ERC20 interface\n * @dev see https://github.com/ethereum/EIPs/issues/20\n */\ninterface IERC20 {\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address who) external view returns (uint256);\n\n function allowance(address owner, address spender) external view returns (uint256);\n\n function transfer(address to, uint256 value) external returns (bool);\n\n function approve(address spender, uint256 value) external returns (bool);\n\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"
},
"contracts/extension/Multicall.sol": {
"content": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../lib/Address.sol\";\nimport \"./interface/IMulticall.sol\";\n\n/**\n * @dev Provides a function to batch together multiple calls in a single external call.\n *\n * _Available since v4.1._\n */\ncontract Multicall is IMulticall {\n /**\n * @notice Receives and executes a batch of function calls on this contract.\n * @dev Receives and executes a batch of function calls on this contract.\n *\n * @param data The bytes data that makes up the batch of function calls to execute.\n * @return results The bytes data that makes up the result of the batch of function calls executed.\n */\n function multicall(bytes[] calldata data) external returns (bytes[] memory results) {\n results = new bytes[](data.length);\n address sender = _msgSender();\n bool isForwarder = msg.sender != sender;\n for (uint256 i = 0; i < data.length; i++) {\n if (isForwarder) {\n results[i] = Address.functionDelegateCall(address(this), abi.encodePacked(data[i], sender));\n } else {\n results[i] = Address.functionDelegateCall(address(this), data[i]);\n }\n }\n return results;\n }\n\n /// @notice Returns the sender in the given execution context.\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n}\n"
},
"contracts/extension/interface/IMulticall.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n * @dev Provides a function to batch together multiple calls in a single external call.\n *\n * _Available since v4.1._\n */\ninterface IMulticall {\n /**\n * @dev Receives and executes a batch of function calls on this contract.\n */\n function multicall(bytes[] calldata data) external returns (bytes[] memory results);\n}\n"
},
"contracts/extension/interface/IPlatformFee.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n * Thirdweb's `PlatformFee` is a contract extension to be used with any base contract. It exposes functions for setting and reading\n * the recipient of platform fee and the platform fee basis points, and lets the inheriting contract perform conditional logic\n * that uses information about platform fees, if desired.\n */\n\ninterface IPlatformFee {\n /// @dev Fee type variants: percentage fee and flat fee\n enum PlatformFeeType {\n Bps,\n Flat\n }\n\n /// @dev Returns the platform fee bps and recipient.\n function getPlatformFeeInfo() external view returns (address, uint16);\n\n /// @dev Lets a module admin update the fees on primary sales.\n function setPlatformFeeInfo(address _platformFeeRecipient, uint256 _platformFeeBps) external;\n\n /// @dev Emitted when fee on primary sales is updated.\n event PlatformFeeInfoUpdated(address indexed platformFeeRecipient, uint256 platformFeeBps);\n\n /// @dev Emitted when the flat platform fee is updated.\n event FlatPlatformFeeUpdated(address platformFeeRecipient, uint256 flatFee);\n\n /// @dev Emitted when the platform fee type is updated.\n event PlatformFeeTypeUpdated(PlatformFeeType feeType);\n}\n"
},
"contracts/extension/interface/IPrimarySale.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n * Thirdweb's `Primary` is a contract extension to be used with any base contract. It exposes functions for setting and reading\n * the recipient of primary sales, and lets the inheriting contract perform conditional logic that uses information about\n * primary sales, if desired.\n */\n\ninterface IPrimarySale {\n /// @dev The adress that receives all primary sales value.\n function primarySaleRecipient() external view returns (address);\n\n /// @dev Lets a module admin set the default recipient of all primary sales.\n function setPrimarySaleRecipient(address _saleRecipient) external;\n\n /// @dev Emitted when a new sale recipient is set.\n event PrimarySaleRecipientUpdated(address indexed recipient);\n}\n"
},
"contracts/external-deps/openzeppelin/metatx/ERC2771ContextUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.11;\n\nimport \"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771ContextUpgradeable is Initializable, ContextUpgradeable {\n mapping(address => bool) private _trustedForwarder;\n\n function __ERC2771Context_init(address[] memory trustedForwarder) internal onlyInitializing {\n __Context_init_unchained();\n __ERC2771Context_init_unchained(trustedForwarder);\n }\n\n function __ERC2771Context_init_unchained(address[] memory trustedForwarder) internal onlyInitializing {\n for (uint256 i = 0; i < trustedForwarder.length; i++) {\n _trustedForwarder[trustedForwarder[i]] = true;\n }\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return _trustedForwarder[forwarder];\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n\n uint256[49] private __gap;\n}\n"
},
"contracts/external-deps/openzeppelin/token/ERC20/utils/SafeERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../../../../eip/interface/IERC20.sol\";\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) {\n // Return data is optional\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n"
},
"contracts/infra/interface/IThirdwebContract.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\ninterface IThirdwebContract {\n /// @dev Returns the module type of the contract.\n function contractType() external pure returns (bytes32);\n\n /// @dev Returns the version of the contract.\n function contractVersion() external pure returns (uint8);\n\n /// @dev Returns the metadata URI of the contract.\n function contractURI() external view returns (string memory);\n\n /**\n * @dev Sets contract URI for the storefront-level metadata of the contract.\n * Only module admin can call this function.\n */\n function setContractURI(string calldata _uri) external;\n}\n"
},
"contracts/infra/interface/IWETH.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\ninterface IWETH {\n function deposit() external payable;\n\n function withdraw(uint256 amount) external;\n\n function transfer(address to, uint256 value) external returns (bool);\n}\n"
},
"contracts/lib/Address.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.1;\n\n/// @author thirdweb, OpenZeppelin Contracts (v4.9.0)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
},
"contracts/lib/CurrencyTransferLib.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n// Helper interfaces\nimport { IWETH } from \"../infra/interface/IWETH.sol\";\nimport { SafeERC20, IERC20 } from \"../external-deps/openzeppelin/token/ERC20/utils/SafeERC20.sol\";\n\nlibrary CurrencyTransferLib {\n using SafeERC20 for IERC20;\n\n /// @dev The address interpreted as native token of the chain.\n address public constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @dev Transfers a given amount of currency.\n function transferCurrency(address _currency, address _from, address _to, uint256 _amount) internal {\n if (_amount == 0) {\n return;\n }\n\n if (_currency == NATIVE_TOKEN) {\n safeTransferNativeToken(_to, _amount);\n } else {\n safeTransferERC20(_currency, _from, _to, _amount);\n }\n }\n\n /// @dev Transfers a given amount of currency. (With native token wrapping)\n function transferCurrencyWithWrapper(\n address _currency,\n address _from,\n address _to,\n uint256 _amount,\n address _nativeTokenWrapper\n ) internal {\n if (_amount == 0) {\n return;\n }\n\n if (_currency == NATIVE_TOKEN) {\n if (_from == address(this)) {\n // withdraw from weth then transfer withdrawn native token to recipient\n IWETH(_nativeTokenWrapper).withdraw(_amount);\n safeTransferNativeTokenWithWrapper(_to, _amount, _nativeTokenWrapper);\n } else if (_to == address(this)) {\n // store native currency in weth\n require(_amount == msg.value, \"msg.value != amount\");\n IWETH(_nativeTokenWrapper).deposit{ value: _amount }();\n } else {\n safeTransferNativeTokenWithWrapper(_to, _amount, _nativeTokenWrapper);\n }\n } else {\n safeTransferERC20(_currency, _from, _to, _amount);\n }\n }\n\n /// @dev Transfer `amount` of ERC20 token from `from` to `to`.\n function safeTransferERC20(address _currency, address _from, address _to, uint256 _amount) internal {\n if (_from == _to) {\n return;\n }\n\n if (_from == address(this)) {\n IERC20(_currency).safeTransfer(_to, _amount);\n } else {\n IERC20(_currency).safeTransferFrom(_from, _to, _amount);\n }\n }\n\n /// @dev Transfers `amount` of native token to `to`.\n function safeTransferNativeToken(address to, uint256 value) internal {\n // solhint-disable avoid-low-level-calls\n // slither-disable-next-line low-level-calls\n (bool success, ) = to.call{ value: value }(\"\");\n require(success, \"native token transfer failed\");\n }\n\n /// @dev Transfers `amount` of native token to `to`. (With native token wrapping)\n function safeTransferNativeTokenWithWrapper(address to, uint256 value, address _nativeTokenWrapper) internal {\n // solhint-disable avoid-low-level-calls\n // slither-disable-next-line low-level-calls\n (bool success, ) = to.call{ value: value }(\"\");\n if (!success) {\n IWETH(_nativeTokenWrapper).deposit{ value: value }();\n IERC20(_nativeTokenWrapper).safeTransfer(to, value);\n }\n }\n}\n"
},
"contracts/lib/FeeType.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/// @author thirdweb\n\nlibrary FeeType {\n uint256 internal constant PRIMARY_SALE = 0;\n uint256 internal constant MARKET_SALE = 1;\n uint256 internal constant SPLIT = 2;\n}\n"
},
"contracts/prebuilts/interface/token/ITokenERC20.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\";\n\ninterface ITokenERC20 is IERC20MetadataUpgradeable {\n /**\n * @notice The body of a request to mint tokens.\n *\n * @param to The receiver of the tokens to mint.\n * @param primarySaleRecipient The receiver of the primary sale funds from the mint.\n * @param quantity The quantity of tpkens to mint.\n * @param price Price to pay for minting with the signature.\n * @param currency The currency in which the price per token must be paid.\n * @param validityStartTimestamp The unix timestamp after which the request is valid.\n * @param validityEndTimestamp The unix timestamp after which the request expires.\n * @param uid A unique identifier for the request.\n */\n struct MintRequest {\n address to;\n address primarySaleRecipient;\n uint256 quantity;\n uint256 price;\n address currency;\n uint128 validityStartTimestamp;\n uint128 validityEndTimestamp;\n bytes32 uid;\n }\n\n /// @dev Emitted when an account with MINTER_ROLE mints an NFT.\n event TokensMinted(address indexed mintedTo, uint256 quantityMinted);\n\n /// @dev Emitted when tokens are minted.\n event TokensMintedWithSignature(address indexed signer, address indexed mintedTo, MintRequest mintRequest);\n\n /**\n * @notice Verifies that a mint request is signed by an account holding\n * MINTER_ROLE (at the time of the function call).\n *\n * @param req The mint request.\n * @param signature The signature produced by an account signing the mint request.\n *\n * returns (success, signer) Result of verification and the recovered address.\n */\n function verify(\n MintRequest calldata req,\n bytes calldata signature\n ) external view returns (bool success, address signer);\n\n /**\n * @dev Creates `amount` new tokens for `to`.\n *\n * See {ERC20-_mint}.\n *\n * Requirements:\n *\n * - the caller must have the `MINTER_ROLE`.\n */\n function mintTo(address to, uint256 amount) external;\n\n /**\n * @notice Mints an NFT according to the provided mint request.\n *\n * @param req The mint request.\n * @param signature he signature produced by an account signing the mint request.\n */\n function mintWithSignature(MintRequest calldata req, bytes calldata signature) external payable;\n}\n"
},
"contracts/prebuilts/token/TokenERC20.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/// @author thirdweb\n\n// $$\\ $$\\ $$\\ $$\\ $$\\\n// $$ | $$ | \\__| $$ | $$ |\n// $$$$$$\\ $$$$$$$\\ $$\\ $$$$$$\\ $$$$$$$ |$$\\ $$\\ $$\\ $$$$$$\\ $$$$$$$\\\n// \\_$$ _| $$ __$$\\ $$ |$$ __$$\\ $$ __$$ |$$ | $$ | $$ |$$ __$$\\ $$ __$$\\\n// $$ | $$ | $$ |$$ |$$ | \\__|$$ / $$ |$$ | $$ | $$ |$$$$$$$$ |$$ | $$ |\n// $$ |$$\\ $$ | $$ |$$ |$$ | $$ | $$ |$$ | $$ | $$ |$$ ____|$$ | $$ |\n// \\$$$$ |$$ | $$ |$$ |$$ | \\$$$$$$$ |\\$$$$$\\$$$$ |\\$$$$$$$\\ $$$$$$$ |\n// \\____/ \\__| \\__|\\__|\\__| \\_______| \\_____\\____/ \\_______|\\_______/\n\n//Interface\nimport { ITokenERC20 } from \"../interface/token/ITokenERC20.sol\";\n\nimport \"../../infra/interface/IThirdwebContract.sol\";\nimport \"../../extension/interface/IPlatformFee.sol\";\nimport \"../../extension/interface/IPrimarySale.sol\";\n\n// Token\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20VotesUpgradeable.sol\";\n\n// Security\nimport \"@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\n// Signature utils\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\";\n\n// Meta transactions\nimport \"../../external-deps/openzeppelin/metatx/ERC2771ContextUpgradeable.sol\";\n\n// Utils\nimport \"../../extension/Multicall.sol\";\nimport \"../../lib/CurrencyTransferLib.sol\";\nimport \"../../lib/FeeType.sol\";\n\ncontract TokenERC20 is\n Initializable,\n IThirdwebContract,\n IPrimarySale,\n IPlatformFee,\n ReentrancyGuardUpgradeable,\n ERC2771ContextUpgradeable,\n Multicall,\n ERC20BurnableUpgradeable,\n ERC20VotesUpgradeable,\n ITokenERC20,\n AccessControlEnumerableUpgradeable\n{\n using ECDSAUpgradeable for bytes32;\n\n bytes32 private constant MODULE_TYPE = bytes32(\"TokenERC20\");\n uint256 private constant VERSION = 1;\n\n bytes32 private constant TYPEHASH =\n keccak256(\n \"MintRequest(address to,address primarySaleRecipient,uint256 quantity,uint256 price,address currency,uint128 validityStartTimestamp,uint128 validityEndTimestamp,bytes32 uid)\"\n );\n\n bytes32 internal constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n bytes32 internal constant TRANSFER_ROLE = keccak256(\"TRANSFER_ROLE\");\n\n /// @dev Returns the URI for the storefront-level metadata of the contract.\n string public contractURI;\n\n /// @dev Max bps in the thirdweb system\n uint128 internal constant MAX_BPS = 10_000;\n\n /// @dev The % of primary sales collected by the contract as fees.\n uint128 private platformFeeBps;\n\n /// @dev The adress that receives all primary sales value.\n address internal platformFeeRecipient;\n\n /// @dev The adress that receives all primary sales value.\n address public primarySaleRecipient;\n\n /// @dev Mapping from mint request UID => whether the mint request is processed.\n mapping(bytes32 => bool) private minted;\n\n constructor() initializer {}\n\n /// @dev Initializes the contract, like a constructor.\n function initialize(\n address _defaultAdmin,\n string memory _name,\n string memory _symbol,\n string memory _contractURI,\n address[] memory _trustedForwarders,\n address _primarySaleRecipient,\n address _platformFeeRecipient,\n uint256 _platformFeeBps\n ) external initializer {\n __ReentrancyGuard_init();\n __ERC2771Context_init_unchained(_trustedForwarders);\n __ERC20Permit_init(_name);\n __ERC20_init_unchained(_name, _symbol);\n\n contractURI = _contractURI;\n primarySaleRecipient = _primarySaleRecipient;\n platformFeeRecipient = _platformFeeRecipient;\n\n require(_platformFeeBps <= MAX_BPS, \"exceeds MAX_BPS\");\n platformFeeBps = uint128(_platformFeeBps);\n\n _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin);\n _setupRole(TRANSFER_ROLE, _defaultAdmin);\n _setupRole(MINTER_ROLE, _defaultAdmin);\n _setupRole(TRANSFER_ROLE, address(0));\n }\n\n /// @dev Returns the module type of the contract.\n function contractType() external pure virtual returns (bytes32) {\n return MODULE_TYPE;\n }\n\n /// @dev Returns the version of the contract.\n function contractVersion() external pure virtual returns (uint8) {\n return uint8(VERSION);\n }\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override(ERC20Upgradeable, ERC20VotesUpgradeable) {\n super._afterTokenTransfer(from, to, amount);\n }\n\n /// @dev Runs on every transfer.\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal override {\n super._beforeTokenTransfer(from, to, amount);\n\n if (!hasRole(TRANSFER_ROLE, address(0)) && from != address(0) && to != address(0)) {\n require(hasRole(TRANSFER_ROLE, from) || hasRole(TRANSFER_ROLE, to), \"transfers restricted.\");\n }\n }\n\n function _mint(address account, uint256 amount) internal virtual override(ERC20Upgradeable, ERC20VotesUpgradeable) {\n super._mint(account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual override(ERC20Upgradeable, ERC20VotesUpgradeable) {\n super._burn(account, amount);\n }\n\n /**\n * @dev Creates `amount` new tokens for `to`.\n *\n * See {ERC20-_mint}.\n *\n * Requirements:\n *\n * - the caller must have the `MINTER_ROLE`.\n */\n function mintTo(address to, uint256 amount) public virtual {\n require(hasRole(MINTER_ROLE, _msgSender()), \"not minter.\");\n _mintTo(to, amount);\n }\n\n /// @dev Verifies that a mint request is signed by an account holding MINTER_ROLE (at the time of the function call).\n function verify(MintRequest calldata _req, bytes calldata _signature) public view returns (bool, address) {\n address signer = recoverAddress(_req, _signature);\n return (!minted[_req.uid] && hasRole(MINTER_ROLE, signer), signer);\n }\n\n /// @dev Mints tokens according to the provided mint request.\n function mintWithSignature(MintRequest calldata _req, bytes calldata _signature) external payable nonReentrant {\n address signer = verifyRequest(_req, _signature);\n address receiver = _req.to;\n\n collectPrice(_req);\n\n _mintTo(receiver, _req.quantity);\n\n emit TokensMintedWithSignature(signer, receiver, _req);\n }\n\n /// @dev Lets a module admin set the default recipient of all primary sales.\n function setPrimarySaleRecipient(address _saleRecipient) external onlyRole(DEFAULT_ADMIN_ROLE) {\n primarySaleRecipient = _saleRecipient;\n emit PrimarySaleRecipientUpdated(_saleRecipient);\n }\n\n /// @dev Lets a module admin update the fees on primary sales.\n function setPlatformFeeInfo(\n address _platformFeeRecipient,\n uint256 _platformFeeBps\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_platformFeeBps <= MAX_BPS, \"exceeds MAX_BPS\");\n\n platformFeeBps = uint64(_platformFeeBps);\n platformFeeRecipient = _platformFeeRecipient;\n\n emit PlatformFeeInfoUpdated(_platformFeeRecipient, _platformFeeBps);\n }\n\n /// @dev Returns the platform fee bps and recipient.\n function getPlatformFeeInfo() external view returns (address, uint16) {\n return (platformFeeRecipient, uint16(platformFeeBps));\n }\n\n /// @dev Collects and distributes the primary sale value of tokens being claimed.\n function collectPrice(MintRequest calldata _req) internal {\n if (_req.price == 0) {\n require(msg.value == 0, \"!Value\");\n return;\n }\n\n uint256 platformFees = (_req.price * platformFeeBps) / MAX_BPS;\n\n if (_req.currency == CurrencyTransferLib.NATIVE_TOKEN) {\n require(msg.value == _req.price, \"must send total price.\");\n } else {\n require(msg.value == 0, \"msg value not zero\");\n }\n\n address saleRecipient = _req.primarySaleRecipient == address(0)\n ? primarySaleRecipient\n : _req.primarySaleRecipient;\n\n CurrencyTransferLib.transferCurrency(_req.currency, _msgSender(), platformFeeRecipient, platformFees);\n CurrencyTransferLib.transferCurrency(_req.currency, _msgSender(), saleRecipient, _req.price - platformFees);\n }\n\n /// @dev Mints `amount` of tokens to `to`\n function _mintTo(address _to, uint256 _amount) internal {\n _mint(_to, _amount);\n emit TokensMinted(_to, _amount);\n }\n\n /// @dev Verifies that a mint request is valid.\n function verifyRequest(MintRequest calldata _req, bytes calldata _signature) internal returns (address) {\n (bool success, address signer) = verify(_req, _signature);\n require(success, \"invalid signature\");\n\n require(\n _req.validityStartTimestamp <= block.timestamp && _req.validityEndTimestamp >= block.timestamp,\n \"request expired\"\n );\n require(_req.to != address(0), \"recipient undefined\");\n require(_req.quantity > 0, \"zero quantity\");\n\n minted[_req.uid] = true;\n\n return signer;\n }\n\n /// @dev Returns the address of the signer of the mint request.\n function recoverAddress(MintRequest calldata _req, bytes calldata _signature) internal view returns (address) {\n return _hashTypedDataV4(keccak256(_encodeRequest(_req))).recover(_signature);\n }\n\n /// @dev Resolves 'stack too deep' error in `recoverAddress`.\n function _encodeRequest(MintRequest calldata _req) internal pure returns (bytes memory) {\n return\n abi.encode(\n TYPEHASH,\n _req.to,\n _req.primarySaleRecipient,\n _req.quantity,\n _req.price,\n _req.currency,\n _req.validityStartTimestamp,\n _req.validityEndTimestamp,\n _req.uid\n );\n }\n\n /// @dev Sets contract URI for the storefront-level metadata of the contract.\n function setContractURI(string calldata _uri) external onlyRole(DEFAULT_ADMIN_ROLE) {\n contractURI = _uri;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(ContextUpgradeable, ERC2771ContextUpgradeable, Multicall)\n returns (address sender)\n {\n return ERC2771ContextUpgradeable._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(ContextUpgradeable, ERC2771ContextUpgradeable)\n returns (bytes calldata)\n {\n return ERC2771ContextUpgradeable._msgData();\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/access/AccessControlEnumerableUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControlEnumerableUpgradeable.sol\";\nimport \"./AccessControlUpgradeable.sol\";\nimport \"../utils/structs/EnumerableSetUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable {\n function __AccessControlEnumerable_init() internal onlyInitializing {\n }\n\n function __AccessControlEnumerable_init_unchained() internal onlyInitializing {\n }\n using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;\n\n mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override {\n super._grantRole(role, account);\n _roleMembers[role].add(account);\n }\n\n /**\n * @dev Overload {_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override {\n super._revokeRole(role, account);\n _roleMembers[role].remove(account);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControlUpgradeable.sol\";\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../utils/StringsUpgradeable.sol\";\nimport \"../utils/introspection/ERC165Upgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {\n function __AccessControl_init() internal onlyInitializing {\n }\n\n function __AccessControl_init_unchained() internal onlyInitializing {\n }\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n StringsUpgradeable.toHexString(account),\n \" is missing role \",\n StringsUpgradeable.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/access/IAccessControlEnumerableUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControlUpgradeable.sol\";\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/access/IAccessControlUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControlUpgradeable {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/governance/utils/IVotesUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (governance/utils/IVotes.sol)\npragma solidity ^0.8.0;\n\n/**\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\n *\n * _Available since v4.5._\n */\ninterface IVotesUpgradeable {\n /**\n * @dev Emitted when an account changes their delegate.\n */\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\n\n /**\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of votes.\n */\n event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance);\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) external view returns (uint256);\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n */\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n */\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) external view returns (address);\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) external;\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC5267Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol)\n\npragma solidity ^0.8.0;\n\ninterface IERC5267Upgradeable {\n /**\n * @dev MAY be emitted to signal that the domain could have changed.\n */\n event EIP712DomainChanged();\n\n /**\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n * signature.\n */\n function eip712Domain()\n external\n view\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n );\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC5805Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5805.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../governance/utils/IVotesUpgradeable.sol\";\nimport \"./IERC6372Upgradeable.sol\";\n\ninterface IERC5805Upgradeable is IERC6372Upgradeable, IVotesUpgradeable {}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC6372Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC6372.sol)\n\npragma solidity ^0.8.0;\n\ninterface IERC6372Upgradeable {\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\n */\n function clock() external view returns (uint48);\n\n /**\n * @dev Description of the clock\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() external view returns (string memory);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized != type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/security/ReentrancyGuardUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it's overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(address from, address to, uint256 amount) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[45] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/IERC20Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/ERC20BurnableUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/ContextUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Extension of {ERC20} that allows token holders to destroy both their own\n * tokens and those that they have an allowance for, in a way that can be\n * recognized off-chain (via event analysis).\n */\nabstract contract ERC20BurnableUpgradeable is Initializable, ContextUpgradeable, ERC20Upgradeable {\n function __ERC20Burnable_init() internal onlyInitializing {\n }\n\n function __ERC20Burnable_init_unchained() internal onlyInitializing {\n }\n /**\n * @dev Destroys `amount` tokens from the caller.\n *\n * See {ERC20-_burn}.\n */\n function burn(uint256 amount) public virtual {\n _burn(_msgSender(), amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, deducting from the caller's\n * allowance.\n *\n * See {ERC20-_burn} and {ERC20-allowance}.\n *\n * Requirements:\n *\n * - the caller must have allowance for ``accounts``'s tokens of at least\n * `amount`.\n */\n function burnFrom(address account, uint256 amount) public virtual {\n _spendAllowance(account, _msgSender(), amount);\n _burn(account, amount);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/ERC20PermitUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/ERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20PermitUpgradeable.sol\";\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"../../../utils/cryptography/EIP712Upgradeable.sol\";\nimport \"../../../utils/CountersUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 51\n */\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {\n using CountersUpgradeable for CountersUpgradeable.Counter;\n\n mapping(address => CountersUpgradeable.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n function __ERC20Permit_init(string memory name) internal onlyInitializing {\n __EIP712_init_unchained(name, \"1\");\n }\n\n function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(address owner) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(address owner) internal virtual returns (uint256 current) {\n CountersUpgradeable.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/ERC20VotesUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/ERC20Votes.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20PermitUpgradeable.sol\";\nimport \"../../../interfaces/IERC5805Upgradeable.sol\";\nimport \"../../../utils/math/MathUpgradeable.sol\";\nimport \"../../../utils/math/SafeCastUpgradeable.sol\";\nimport \"../../../utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Extension of ERC20 to support Compound-like voting and delegation. This version is more generic than Compound's,\n * and supports token supply up to 2^224^ - 1, while COMP is limited to 2^96^ - 1.\n *\n * NOTE: If exact COMP compatibility is required, use the {ERC20VotesComp} variant of this module.\n *\n * This extension keeps a history (checkpoints) of each account's vote power. Vote power can be delegated either\n * by calling the {delegate} function directly, or by providing a signature to be used with {delegateBySig}. Voting\n * power can be queried through the public accessors {getVotes} and {getPastVotes}.\n *\n * By default, token balance does not account for voting power. This makes transfers cheaper. The downside is that it\n * requires users to delegate to themselves in order to activate checkpoints and have their voting power tracked.\n *\n * _Available since v4.2._\n */\nabstract contract ERC20VotesUpgradeable is Initializable, ERC20PermitUpgradeable, IERC5805Upgradeable {\n function __ERC20Votes_init() internal onlyInitializing {\n }\n\n function __ERC20Votes_init_unchained() internal onlyInitializing {\n }\n struct Checkpoint {\n uint32 fromBlock;\n uint224 votes;\n }\n\n bytes32 private constant _DELEGATION_TYPEHASH =\n keccak256(\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\");\n\n mapping(address => address) private _delegates;\n mapping(address => Checkpoint[]) private _checkpoints;\n Checkpoint[] private _totalSupplyCheckpoints;\n\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\n */\n function clock() public view virtual override returns (uint48) {\n return SafeCastUpgradeable.toUint48(block.number);\n }\n\n /**\n * @dev Description of the clock\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual override returns (string memory) {\n // Check that the clock was not modified\n require(clock() == block.number, \"ERC20Votes: broken clock mode\");\n return \"mode=blocknumber&from=default\";\n }\n\n /**\n * @dev Get the `pos`-th checkpoint for `account`.\n */\n function checkpoints(address account, uint32 pos) public view virtual returns (Checkpoint memory) {\n return _checkpoints[account][pos];\n }\n\n /**\n * @dev Get number of checkpoints for `account`.\n */\n function numCheckpoints(address account) public view virtual returns (uint32) {\n return SafeCastUpgradeable.toUint32(_checkpoints[account].length);\n }\n\n /**\n * @dev Get the address `account` is currently delegating to.\n */\n function delegates(address account) public view virtual override returns (address) {\n return _delegates[account];\n }\n\n /**\n * @dev Gets the current votes balance for `account`\n */\n function getVotes(address account) public view virtual override returns (uint256) {\n uint256 pos = _checkpoints[account].length;\n unchecked {\n return pos == 0 ? 0 : _checkpoints[account][pos - 1].votes;\n }\n }\n\n /**\n * @dev Retrieve the number of votes for `account` at the end of `timepoint`.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past\n */\n function getPastVotes(address account, uint256 timepoint) public view virtual override returns (uint256) {\n require(timepoint < clock(), \"ERC20Votes: future lookup\");\n return _checkpointsLookup(_checkpoints[account], timepoint);\n }\n\n /**\n * @dev Retrieve the `totalSupply` at the end of `timepoint`. Note, this value is the sum of all balances.\n * It is NOT the sum of all the delegated votes!\n *\n * Requirements:\n *\n * - `timepoint` must be in the past\n */\n function getPastTotalSupply(uint256 timepoint) public view virtual override returns (uint256) {\n require(timepoint < clock(), \"ERC20Votes: future lookup\");\n return _checkpointsLookup(_totalSupplyCheckpoints, timepoint);\n }\n\n /**\n * @dev Lookup a value in a list of (sorted) checkpoints.\n */\n function _checkpointsLookup(Checkpoint[] storage ckpts, uint256 timepoint) private view returns (uint256) {\n // We run a binary search to look for the last (most recent) checkpoint taken before (or at) `timepoint`.\n //\n // Initially we check if the block is recent to narrow the search range.\n // During the loop, the index of the wanted checkpoint remains in the range [low-1, high).\n // With each iteration, either `low` or `high` is moved towards the middle of the range to maintain the invariant.\n // - If the middle checkpoint is after `timepoint`, we look in [low, mid)\n // - If the middle checkpoint is before or equal to `timepoint`, we look in [mid+1, high)\n // Once we reach a single value (when low == high), we've found the right checkpoint at the index high-1, if not\n // out of bounds (in which case we're looking too far in the past and the result is 0).\n // Note that if the latest checkpoint available is exactly for `timepoint`, we end up with an index that is\n // past the end of the array, so we technically don't find a checkpoint after `timepoint`, but it works out\n // the same.\n uint256 length = ckpts.length;\n\n uint256 low = 0;\n uint256 high = length;\n\n if (length > 5) {\n uint256 mid = length - MathUpgradeable.sqrt(length);\n if (_unsafeAccess(ckpts, mid).fromBlock > timepoint) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n while (low < high) {\n uint256 mid = MathUpgradeable.average(low, high);\n if (_unsafeAccess(ckpts, mid).fromBlock > timepoint) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n unchecked {\n return high == 0 ? 0 : _unsafeAccess(ckpts, high - 1).votes;\n }\n }\n\n /**\n * @dev Delegate votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) public virtual override {\n _delegate(_msgSender(), delegatee);\n }\n\n /**\n * @dev Delegates votes from signer to `delegatee`\n */\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= expiry, \"ERC20Votes: signature expired\");\n address signer = ECDSAUpgradeable.recover(\n _hashTypedDataV4(keccak256(abi.encode(_DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\n v,\n r,\n s\n );\n require(nonce == _useNonce(signer), \"ERC20Votes: invalid nonce\");\n _delegate(signer, delegatee);\n }\n\n /**\n * @dev Maximum token supply. Defaults to `type(uint224).max` (2^224^ - 1).\n */\n function _maxSupply() internal view virtual returns (uint224) {\n return type(uint224).max;\n }\n\n /**\n * @dev Snapshots the totalSupply after it has been increased.\n */\n function _mint(address account, uint256 amount) internal virtual override {\n super._mint(account, amount);\n require(totalSupply() <= _maxSupply(), \"ERC20Votes: total supply risks overflowing votes\");\n\n _writeCheckpoint(_totalSupplyCheckpoints, _add, amount);\n }\n\n /**\n * @dev Snapshots the totalSupply after it has been decreased.\n */\n function _burn(address account, uint256 amount) internal virtual override {\n super._burn(account, amount);\n\n _writeCheckpoint(_totalSupplyCheckpoints, _subtract, amount);\n }\n\n /**\n * @dev Move voting power when tokens are transferred.\n *\n * Emits a {IVotes-DelegateVotesChanged} event.\n */\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual override {\n super._afterTokenTransfer(from, to, amount);\n\n _moveVotingPower(delegates(from), delegates(to), amount);\n }\n\n /**\n * @dev Change delegation for `delegator` to `delegatee`.\n *\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\n */\n function _delegate(address delegator, address delegatee) internal virtual {\n address currentDelegate = delegates(delegator);\n uint256 delegatorBalance = balanceOf(delegator);\n _delegates[delegator] = delegatee;\n\n emit DelegateChanged(delegator, currentDelegate, delegatee);\n\n _moveVotingPower(currentDelegate, delegatee, delegatorBalance);\n }\n\n function _moveVotingPower(address src, address dst, uint256 amount) private {\n if (src != dst && amount > 0) {\n if (src != address(0)) {\n (uint256 oldWeight, uint256 newWeight) = _writeCheckpoint(_checkpoints[src], _subtract, amount);\n emit DelegateVotesChanged(src, oldWeight, newWeight);\n }\n\n if (dst != address(0)) {\n (uint256 oldWeight, uint256 newWeight) = _writeCheckpoint(_checkpoints[dst], _add, amount);\n emit DelegateVotesChanged(dst, oldWeight, newWeight);\n }\n }\n }\n\n function _writeCheckpoint(\n Checkpoint[] storage ckpts,\n function(uint256, uint256) view returns (uint256) op,\n uint256 delta\n ) private returns (uint256 oldWeight, uint256 newWeight) {\n uint256 pos = ckpts.length;\n\n unchecked {\n Checkpoint memory oldCkpt = pos == 0 ? Checkpoint(0, 0) : _unsafeAccess(ckpts, pos - 1);\n\n oldWeight = oldCkpt.votes;\n newWeight = op(oldWeight, delta);\n\n if (pos > 0 && oldCkpt.fromBlock == clock()) {\n _unsafeAccess(ckpts, pos - 1).votes = SafeCastUpgradeable.toUint224(newWeight);\n } else {\n ckpts.push(Checkpoint({fromBlock: SafeCastUpgradeable.toUint32(clock()), votes: SafeCastUpgradeable.toUint224(newWeight)}));\n }\n }\n }\n\n function _add(uint256 a, uint256 b) private pure returns (uint256) {\n return a + b;\n }\n\n function _subtract(uint256 a, uint256 b) private pure returns (uint256) {\n return a - b;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(Checkpoint[] storage ckpts, uint256 pos) private pure returns (Checkpoint storage result) {\n assembly {\n mstore(0, ckpts.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[47] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/IERC20PermitUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20PermitUpgradeable {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/CountersUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary CountersUpgradeable {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/StringsUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\nimport \"./math/SignedMathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMathUpgradeable.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/ECDSAUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../StringsUpgradeable.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSAUpgradeable {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\")\n mstore(0x1c, hash)\n message := keccak256(0x00, 0x3c)\n }\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", StringsUpgradeable.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40)\n mstore(ptr, \"\\x19\\x01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n data := keccak256(ptr, 0x42)\n }\n }\n\n /**\n * @dev Returns an Ethereum Signed Data with intended validator, created from a\n * `validator` and `data` according to the version 0 of EIP-191.\n *\n * See {recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x00\", validator, data));\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/EIP712Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.8;\n\nimport \"./ECDSAUpgradeable.sol\";\nimport \"../../interfaces/IERC5267Upgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\n * separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract EIP712Upgradeable is Initializable, IERC5267Upgradeable {\n bytes32 private constant _TYPE_HASH =\n keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /// @custom:oz-renamed-from _HASHED_NAME\n bytes32 private _hashedName;\n /// @custom:oz-renamed-from _HASHED_VERSION\n bytes32 private _hashedVersion;\n\n string private _name;\n string private _version;\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained(name, version);\n }\n\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n _name = name;\n _version = version;\n\n // Reset prior values in storage if upgrading\n _hashedName = 0;\n _hashedVersion = 0;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n return _buildDomainSeparator();\n }\n\n function _buildDomainSeparator() private view returns (bytes32) {\n return keccak256(abi.encode(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash(), block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev See {EIP-5267}.\n *\n * _Available since v4.9._\n */\n function eip712Domain()\n public\n view\n virtual\n override\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n )\n {\n // If the hashed name and version in storage are non-zero, the contract hasn't been properly initialized\n // and the EIP712 domain is not reliable, as it will be missing name and version.\n require(_hashedName == 0 && _hashedVersion == 0, \"EIP712: Uninitialized\");\n\n return (\n hex\"0f\", // 01111\n _EIP712Name(),\n _EIP712Version(),\n block.chainid,\n address(this),\n bytes32(0),\n new uint256[](0)\n );\n }\n\n /**\n * @dev The name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712Name() internal virtual view returns (string memory) {\n return _name;\n }\n\n /**\n * @dev The version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712Version() internal virtual view returns (string memory) {\n return _version;\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead.\n */\n function _EIP712NameHash() internal view returns (bytes32) {\n string memory name = _EIP712Name();\n if (bytes(name).length > 0) {\n return keccak256(bytes(name));\n } else {\n // If the name is empty, the contract may have been upgraded without initializing the new storage.\n // We return the name hash in storage if non-zero, otherwise we assume the name is empty by design.\n bytes32 hashedName = _hashedName;\n if (hashedName != 0) {\n return hashedName;\n } else {\n return keccak256(\"\");\n }\n }\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead.\n */\n function _EIP712VersionHash() internal view returns (bytes32) {\n string memory version = _EIP712Version();\n if (bytes(version).length > 0) {\n return keccak256(bytes(version));\n } else {\n // If the version is empty, the contract may have been upgraded without initializing the new storage.\n // We return the version hash in storage if non-zero, otherwise we assume the version is empty by design.\n bytes32 hashedVersion = _hashedVersion;\n if (hashedVersion != 0) {\n return hashedVersion;\n } else {\n return keccak256(\"\");\n }\n }\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[48] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/draft-EIP712Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\n\npragma solidity ^0.8.0;\n\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\n\nimport \"./EIP712Upgradeable.sol\";\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165Upgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {\n function __ERC165_init() internal onlyInitializing {\n }\n\n function __ERC165_init_unchained() internal onlyInitializing {\n }\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165Upgradeable).interfaceId;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/IERC165Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165Upgradeable {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/math/MathUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, \"Math: mulDiv overflow\");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/math/SafeCastUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCastUpgradeable {\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n *\n * _Available since v4.7._\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n require(value <= type(uint248).max, \"SafeCast: value doesn't fit in 248 bits\");\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n *\n * _Available since v4.7._\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n require(value <= type(uint240).max, \"SafeCast: value doesn't fit in 240 bits\");\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n *\n * _Available since v4.7._\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n require(value <= type(uint232).max, \"SafeCast: value doesn't fit in 232 bits\");\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n *\n * _Available since v4.2._\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n require(value <= type(uint224).max, \"SafeCast: value doesn't fit in 224 bits\");\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n *\n * _Available since v4.7._\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n require(value <= type(uint216).max, \"SafeCast: value doesn't fit in 216 bits\");\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n *\n * _Available since v4.7._\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n require(value <= type(uint208).max, \"SafeCast: value doesn't fit in 208 bits\");\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n *\n * _Available since v4.7._\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n require(value <= type(uint200).max, \"SafeCast: value doesn't fit in 200 bits\");\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n *\n * _Available since v4.7._\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n require(value <= type(uint192).max, \"SafeCast: value doesn't fit in 192 bits\");\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n *\n * _Available since v4.7._\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n require(value <= type(uint184).max, \"SafeCast: value doesn't fit in 184 bits\");\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n *\n * _Available since v4.7._\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n require(value <= type(uint176).max, \"SafeCast: value doesn't fit in 176 bits\");\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n *\n * _Available since v4.7._\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n require(value <= type(uint168).max, \"SafeCast: value doesn't fit in 168 bits\");\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n *\n * _Available since v4.7._\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n require(value <= type(uint160).max, \"SafeCast: value doesn't fit in 160 bits\");\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n *\n * _Available since v4.7._\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n require(value <= type(uint152).max, \"SafeCast: value doesn't fit in 152 bits\");\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n *\n * _Available since v4.7._\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n require(value <= type(uint144).max, \"SafeCast: value doesn't fit in 144 bits\");\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n *\n * _Available since v4.7._\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n require(value <= type(uint136).max, \"SafeCast: value doesn't fit in 136 bits\");\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n *\n * _Available since v2.5._\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n require(value <= type(uint128).max, \"SafeCast: value doesn't fit in 128 bits\");\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n *\n * _Available since v4.7._\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n require(value <= type(uint120).max, \"SafeCast: value doesn't fit in 120 bits\");\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n *\n * _Available since v4.7._\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n require(value <= type(uint112).max, \"SafeCast: value doesn't fit in 112 bits\");\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n *\n * _Available since v4.7._\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n require(value <= type(uint104).max, \"SafeCast: value doesn't fit in 104 bits\");\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n *\n * _Available since v4.2._\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n require(value <= type(uint96).max, \"SafeCast: value doesn't fit in 96 bits\");\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n *\n * _Available since v4.7._\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n require(value <= type(uint88).max, \"SafeCast: value doesn't fit in 88 bits\");\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n *\n * _Available since v4.7._\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n require(value <= type(uint80).max, \"SafeCast: value doesn't fit in 80 bits\");\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n *\n * _Available since v4.7._\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n require(value <= type(uint72).max, \"SafeCast: value doesn't fit in 72 bits\");\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n *\n * _Available since v2.5._\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n require(value <= type(uint64).max, \"SafeCast: value doesn't fit in 64 bits\");\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n *\n * _Available since v4.7._\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n require(value <= type(uint56).max, \"SafeCast: value doesn't fit in 56 bits\");\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n *\n * _Available since v4.7._\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n require(value <= type(uint48).max, \"SafeCast: value doesn't fit in 48 bits\");\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n *\n * _Available since v4.7._\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n require(value <= type(uint40).max, \"SafeCast: value doesn't fit in 40 bits\");\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n *\n * _Available since v2.5._\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n require(value <= type(uint32).max, \"SafeCast: value doesn't fit in 32 bits\");\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n *\n * _Available since v4.7._\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n require(value <= type(uint24).max, \"SafeCast: value doesn't fit in 24 bits\");\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n *\n * _Available since v2.5._\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n require(value <= type(uint16).max, \"SafeCast: value doesn't fit in 16 bits\");\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n *\n * _Available since v2.5._\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n require(value <= type(uint8).max, \"SafeCast: value doesn't fit in 8 bits\");\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n *\n * _Available since v3.0._\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n *\n * _Available since v4.7._\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 248 bits\");\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n *\n * _Available since v4.7._\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 240 bits\");\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n *\n * _Available since v4.7._\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 232 bits\");\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n *\n * _Available since v4.7._\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 224 bits\");\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n *\n * _Available since v4.7._\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 216 bits\");\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n *\n * _Available since v4.7._\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 208 bits\");\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n *\n * _Available since v4.7._\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 200 bits\");\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n *\n * _Available since v4.7._\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 192 bits\");\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n *\n * _Available since v4.7._\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 184 bits\");\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n *\n * _Available since v4.7._\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 176 bits\");\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n *\n * _Available since v4.7._\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 168 bits\");\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n *\n * _Available since v4.7._\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 160 bits\");\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n *\n * _Available since v4.7._\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 152 bits\");\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n *\n * _Available since v4.7._\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 144 bits\");\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n *\n * _Available since v4.7._\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 136 bits\");\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n *\n * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 128 bits\");\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n *\n * _Available since v4.7._\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 120 bits\");\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n *\n * _Available since v4.7._\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 112 bits\");\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n *\n * _Available since v4.7._\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 104 bits\");\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n *\n * _Available since v4.7._\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 96 bits\");\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n *\n * _Available since v4.7._\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 88 bits\");\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n *\n * _Available since v4.7._\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 80 bits\");\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n *\n * _Available since v4.7._\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 72 bits\");\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n *\n * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 64 bits\");\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n *\n * _Available since v4.7._\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 56 bits\");\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n *\n * _Available since v4.7._\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 48 bits\");\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n *\n * _Available since v4.7._\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 40 bits\");\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n *\n * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 32 bits\");\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n *\n * _Available since v4.7._\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 24 bits\");\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n *\n * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 16 bits\");\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n *\n * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 8 bits\");\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n *\n * _Available since v3.0._\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n require(value <= uint256(type(int256).max), \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/math/SignedMathUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMathUpgradeable {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/structs/EnumerableSetUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSetUpgradeable {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 20
},
"evmVersion": "london",
"remappings": [
":@chainlink/=lib/chainlink/",
":@ds-test/=lib/ds-test/src/",
":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
":@std/=lib/forge-std/src/",
":@thirdweb-dev/dynamic-contracts/=lib/dynamic-contracts/",
":ERC721A-Upgradeable/=lib/ERC721A-Upgradeable/contracts/",
":ERC721A/=lib/ERC721A/contracts/",
":chainlink/=lib/chainlink/contracts/",
":contracts/=contracts/",
":ds-test/=lib/ds-test/src/",
":dynamic-contracts/=lib/dynamic-contracts/src/",
":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
":erc721a-upgradeable/=lib/ERC721A-Upgradeable/",
":erc721a/=lib/ERC721A/",
":forge-std/=lib/forge-std/src/",
":lib/sstore2/=lib/dynamic-contracts/lib/sstore2/",
":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
":openzeppelin-contracts/=lib/openzeppelin-contracts/",
":openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/",
":sstore2/=lib/dynamic-contracts/lib/sstore2/contracts/"
],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
}} |
1 | 20,290,458 | a7acb11e623e3ace0290c1de45b065f70ba2aae20f6eba3ef42399454df99953 | decd0ddc375d513cd2bdc8b12151d491a518cfe055fd608ff77c7d34f5849ee8 | 4ca9351dd5cca6931472a810925effc9f41e6723 | 1e68238ce926dec62b3fbc99ab06eb1d85ce0270 | d36eb781deaf12410574fb15a7eb94cfbf9f40bc | 3d602d80600a3d3981f3363d3d373d3d3d363d73933fbfeb4ed1f111d12a39c2ab48657e6fc875c65af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73933fbfeb4ed1f111d12a39c2ab48657e6fc875c65af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"src/contracts/ConsensusLayerFeeDispatcher.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./libs/DispatchersStorageLib.sol\";\nimport \"./interfaces/IStakingContractFeeDetails.sol\";\nimport \"./interfaces/IFeeDispatcher.sol\";\n\n/// @title Consensus Layer Fee Recipient\n/// @author Kiln\n/// @notice This contract can be used to receive fees from a validator and split them with a node operator\ncontract ConsensusLayerFeeDispatcher is IFeeDispatcher {\n using DispatchersStorageLib for bytes32;\n\n event Withdrawal(\n address indexed withdrawer,\n address indexed feeRecipient,\n bytes32 pubKeyRoot,\n uint256 rewards,\n uint256 nodeOperatorFee,\n uint256 treasuryFee\n );\n\n error TreasuryReceiveError(bytes errorData);\n error FeeRecipientReceiveError(bytes errorData);\n error WithdrawerReceiveError(bytes errorData);\n error ZeroBalanceWithdrawal();\n error AlreadyInitialized();\n error InvalidCall();\n error NotImplemented();\n\n bytes32 internal constant STAKING_CONTRACT_ADDRESS_SLOT =\n keccak256(\"ConsensusLayerFeeRecipient.stakingContractAddress\");\n uint256 internal constant BASIS_POINTS = 10_000;\n bytes32 internal constant VERSION_SLOT = keccak256(\"ConsensusLayerFeeRecipient.version\");\n\n /// @notice Ensures an initialisation call has been called only once per _version value\n /// @param _version The current initialisation value\n modifier init(uint256 _version) {\n if (_version != VERSION_SLOT.getUint256() + 1) {\n revert AlreadyInitialized();\n }\n\n VERSION_SLOT.setUint256(_version);\n\n _;\n }\n\n /// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\n constructor(uint256 _version) {\n VERSION_SLOT.setUint256(_version);\n }\n\n /// @notice Initialize the contract by storing the staking contract\n /// @param _stakingContract Address of the Staking Contract\n function initCLD(address _stakingContract) external init(1) {\n STAKING_CONTRACT_ADDRESS_SLOT.setAddress(_stakingContract);\n }\n\n /// @notice Performs a withdrawal on this contract's balance\n function dispatch(bytes32) external payable {\n revert NotImplemented();\n /*\n uint256 balance = address(this).balance; // this has taken into account msg.value\n if (balance == 0) {\n revert ZeroBalanceWithdrawal();\n }\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n address withdrawer = stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n address operator = stakingContract.getOperatorFeeRecipient(_publicKeyRoot);\n address treasury = stakingContract.getTreasury();\n uint256 globalFee;\n\n if (balance >= 32 ether) {\n // withdrawing a healthy & exited validator\n globalFee = ((balance - 32 ether) * stakingContract.getGlobalFee()) / BASIS_POINTS;\n } else if (balance <= 16 ether) {\n // withdrawing from what looks like skimming\n globalFee = (balance * stakingContract.getGlobalFee()) / BASIS_POINTS;\n }\n\n uint256 operatorFee = (globalFee * stakingContract.getOperatorFee()) / BASIS_POINTS;\n\n (bool status, bytes memory data) = withdrawer.call{value: balance - globalFee}(\"\");\n if (status == false) {\n revert WithdrawerReceiveError(data);\n }\n if (globalFee > 0) {\n (status, data) = treasury.call{value: globalFee - operatorFee}(\"\");\n if (status == false) {\n revert FeeRecipientReceiveError(data);\n }\n }\n if (operatorFee > 0) {\n (status, data) = operator.call{value: operatorFee}(\"\");\n if (status == false) {\n revert TreasuryReceiveError(data);\n }\n }\n emit Withdrawal(withdrawer, operator, balance - globalFee, operatorFee, globalFee - operatorFee);\n */\n }\n\n /// @notice Retrieve the staking contract address\n function getStakingContract() external view returns (address) {\n return STAKING_CONTRACT_ADDRESS_SLOT.getAddress();\n }\n\n /// @notice Retrieve the assigned withdrawer for the given public key root\n /// @param _publicKeyRoot Public key root to get the owner\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address) {\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n return stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n }\n\n receive() external payable {\n revert InvalidCall();\n }\n\n fallback() external payable {\n revert InvalidCall();\n }\n}\n"
},
"src/contracts/libs/DispatchersStorageLib.sol": {
"content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\nlibrary DispatchersStorageLib {\n function getUint256(bytes32 position) internal view returns (uint256 data) {\n assembly {\n data := sload(position)\n }\n }\n\n function setUint256(bytes32 position, uint256 data) internal {\n assembly {\n sstore(position, data)\n }\n }\n\n function getAddress(bytes32 position) internal view returns (address data) {\n assembly {\n data := sload(position)\n }\n }\n\n function setAddress(bytes32 position, address data) internal {\n assembly {\n sstore(position, data)\n }\n }\n}\n"
},
"src/contracts/interfaces/IStakingContractFeeDetails.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\ninterface IStakingContractFeeDetails {\n function getWithdrawerFromPublicKeyRoot(bytes32 _publicKeyRoot) external view returns (address);\n\n function getTreasury() external view returns (address);\n\n function getOperatorFeeRecipient(bytes32 pubKeyRoot) external view returns (address);\n\n function getGlobalFee() external view returns (uint256);\n\n function getOperatorFee() external view returns (uint256);\n}\n"
},
"src/contracts/interfaces/IFeeDispatcher.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\ninterface IFeeDispatcher {\n function dispatch(bytes32 _publicKeyRoot) external payable;\n\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address);\n}\n"
},
"src/contracts/FeeRecipient.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./interfaces/IFeeDispatcher.sol\";\n\ncontract FeeRecipient {\n /// @notice Constructor replay prevention\n bool internal initialized;\n /// @notice Address where funds are sent to be dispatched\n IFeeDispatcher internal dispatcher;\n /// @notice Public Key root assigned to this receiver\n bytes32 internal publicKeyRoot;\n\n error AlreadyInitialized();\n\n /// @notice Initializes the receiver\n /// @param _dispatcher Address that will handle the fee dispatching\n /// @param _publicKeyRoot Public Key root assigned to this receiver\n function init(address _dispatcher, bytes32 _publicKeyRoot) external {\n if (initialized) {\n revert AlreadyInitialized();\n }\n initialized = true;\n dispatcher = IFeeDispatcher(_dispatcher);\n publicKeyRoot = _publicKeyRoot;\n }\n\n /// @notice Empty calldata fallback\n receive() external payable {}\n\n /// @notice Non-empty calldata fallback\n fallback() external payable {}\n\n /// @notice Triggers a withdrawal by sending its funds + its public key root to the dispatcher\n /// @dev Can be called by any wallet as recipients are not parameters\n function withdraw() external {\n dispatcher.dispatch{value: address(this).balance}(publicKeyRoot);\n }\n\n /// @notice Retrieve the assigned public key root\n function getPublicKeyRoot() external view returns (bytes32) {\n return publicKeyRoot;\n }\n\n /// @notice retrieve the assigned withdrawer\n function getWithdrawer() external view returns (address) {\n return dispatcher.getWithdrawer(publicKeyRoot);\n }\n}\n"
},
"src/contracts/ExecutionLayerFeeDispatcher.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./libs/DispatchersStorageLib.sol\";\nimport \"./interfaces/IStakingContractFeeDetails.sol\";\nimport \"./interfaces/IFeeDispatcher.sol\";\n\n/// @title Execution Layer Fee Recipient\n/// @author Kiln\n/// @notice This contract can be used to receive fees from a validator and split them with a node operator\ncontract ExecutionLayerFeeDispatcher is IFeeDispatcher {\n using DispatchersStorageLib for bytes32;\n\n event Withdrawal(\n address indexed withdrawer,\n address indexed feeRecipient,\n bytes32 pubKeyRoot,\n uint256 rewards,\n uint256 nodeOperatorFee,\n uint256 treasuryFee\n );\n\n error TreasuryReceiveError(bytes errorData);\n error FeeRecipientReceiveError(bytes errorData);\n error WithdrawerReceiveError(bytes errorData);\n error ZeroBalanceWithdrawal();\n error AlreadyInitialized();\n error InvalidCall();\n\n bytes32 internal constant STAKING_CONTRACT_ADDRESS_SLOT =\n keccak256(\"ExecutionLayerFeeRecipient.stakingContractAddress\");\n uint256 internal constant BASIS_POINTS = 10_000;\n bytes32 internal constant VERSION_SLOT = keccak256(\"ExecutionLayerFeeRecipient.version\");\n\n /// @notice Ensures an initialisation call has been called only once per _version value\n /// @param _version The current initialisation value\n modifier init(uint256 _version) {\n if (_version != VERSION_SLOT.getUint256() + 1) {\n revert AlreadyInitialized();\n }\n\n VERSION_SLOT.setUint256(_version);\n\n _;\n }\n\n /// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\n constructor(uint256 _version) {\n VERSION_SLOT.setUint256(_version);\n }\n\n /// @notice Initialize the contract by storing the staking contract and the public key in storage\n /// @param _stakingContract Address of the Staking Contract\n function initELD(address _stakingContract) external init(1) {\n STAKING_CONTRACT_ADDRESS_SLOT.setAddress(_stakingContract);\n }\n\n /// @notice Performs a withdrawal on this contract's balance\n function dispatch(bytes32 _publicKeyRoot) external payable {\n uint256 balance = address(this).balance;\n if (balance == 0) {\n revert ZeroBalanceWithdrawal();\n }\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n address withdrawer = stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n address operator = stakingContract.getOperatorFeeRecipient(_publicKeyRoot);\n address treasury = stakingContract.getTreasury();\n uint256 globalFee = (balance * stakingContract.getGlobalFee()) / BASIS_POINTS;\n uint256 operatorFee = (globalFee * stakingContract.getOperatorFee()) / BASIS_POINTS;\n\n (bool status, bytes memory data) = withdrawer.call{value: balance - globalFee}(\"\");\n if (status == false) {\n revert WithdrawerReceiveError(data);\n }\n if (globalFee > 0) {\n (status, data) = treasury.call{value: globalFee - operatorFee}(\"\");\n if (status == false) {\n revert FeeRecipientReceiveError(data);\n }\n }\n if (operatorFee > 0) {\n (status, data) = operator.call{value: operatorFee}(\"\");\n if (status == false) {\n revert TreasuryReceiveError(data);\n }\n }\n emit Withdrawal(\n withdrawer,\n operator,\n _publicKeyRoot,\n balance - globalFee,\n operatorFee,\n globalFee - operatorFee\n );\n }\n\n /// @notice Retrieve the staking contract address\n function getStakingContract() external view returns (address) {\n return STAKING_CONTRACT_ADDRESS_SLOT.getAddress();\n }\n\n /// @notice Retrieve the assigned withdrawer for the given public key root\n /// @param _publicKeyRoot Public key root to get the owner\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address) {\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n return stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n }\n\n receive() external payable {\n revert InvalidCall();\n }\n\n fallback() external payable {\n revert InvalidCall();\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
}
}
}} |
1 | 20,290,458 | a7acb11e623e3ace0290c1de45b065f70ba2aae20f6eba3ef42399454df99953 | decd0ddc375d513cd2bdc8b12151d491a518cfe055fd608ff77c7d34f5849ee8 | 4ca9351dd5cca6931472a810925effc9f41e6723 | 1e68238ce926dec62b3fbc99ab06eb1d85ce0270 | 6b116141a0ebb51f6d111ba98c593eac228ae1be | 3d602d80600a3d3981f3363d3d373d3d3d363d73933fbfeb4ed1f111d12a39c2ab48657e6fc875c65af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73933fbfeb4ed1f111d12a39c2ab48657e6fc875c65af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"src/contracts/ConsensusLayerFeeDispatcher.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./libs/DispatchersStorageLib.sol\";\nimport \"./interfaces/IStakingContractFeeDetails.sol\";\nimport \"./interfaces/IFeeDispatcher.sol\";\n\n/// @title Consensus Layer Fee Recipient\n/// @author Kiln\n/// @notice This contract can be used to receive fees from a validator and split them with a node operator\ncontract ConsensusLayerFeeDispatcher is IFeeDispatcher {\n using DispatchersStorageLib for bytes32;\n\n event Withdrawal(\n address indexed withdrawer,\n address indexed feeRecipient,\n bytes32 pubKeyRoot,\n uint256 rewards,\n uint256 nodeOperatorFee,\n uint256 treasuryFee\n );\n\n error TreasuryReceiveError(bytes errorData);\n error FeeRecipientReceiveError(bytes errorData);\n error WithdrawerReceiveError(bytes errorData);\n error ZeroBalanceWithdrawal();\n error AlreadyInitialized();\n error InvalidCall();\n error NotImplemented();\n\n bytes32 internal constant STAKING_CONTRACT_ADDRESS_SLOT =\n keccak256(\"ConsensusLayerFeeRecipient.stakingContractAddress\");\n uint256 internal constant BASIS_POINTS = 10_000;\n bytes32 internal constant VERSION_SLOT = keccak256(\"ConsensusLayerFeeRecipient.version\");\n\n /// @notice Ensures an initialisation call has been called only once per _version value\n /// @param _version The current initialisation value\n modifier init(uint256 _version) {\n if (_version != VERSION_SLOT.getUint256() + 1) {\n revert AlreadyInitialized();\n }\n\n VERSION_SLOT.setUint256(_version);\n\n _;\n }\n\n /// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\n constructor(uint256 _version) {\n VERSION_SLOT.setUint256(_version);\n }\n\n /// @notice Initialize the contract by storing the staking contract\n /// @param _stakingContract Address of the Staking Contract\n function initCLD(address _stakingContract) external init(1) {\n STAKING_CONTRACT_ADDRESS_SLOT.setAddress(_stakingContract);\n }\n\n /// @notice Performs a withdrawal on this contract's balance\n function dispatch(bytes32) external payable {\n revert NotImplemented();\n /*\n uint256 balance = address(this).balance; // this has taken into account msg.value\n if (balance == 0) {\n revert ZeroBalanceWithdrawal();\n }\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n address withdrawer = stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n address operator = stakingContract.getOperatorFeeRecipient(_publicKeyRoot);\n address treasury = stakingContract.getTreasury();\n uint256 globalFee;\n\n if (balance >= 32 ether) {\n // withdrawing a healthy & exited validator\n globalFee = ((balance - 32 ether) * stakingContract.getGlobalFee()) / BASIS_POINTS;\n } else if (balance <= 16 ether) {\n // withdrawing from what looks like skimming\n globalFee = (balance * stakingContract.getGlobalFee()) / BASIS_POINTS;\n }\n\n uint256 operatorFee = (globalFee * stakingContract.getOperatorFee()) / BASIS_POINTS;\n\n (bool status, bytes memory data) = withdrawer.call{value: balance - globalFee}(\"\");\n if (status == false) {\n revert WithdrawerReceiveError(data);\n }\n if (globalFee > 0) {\n (status, data) = treasury.call{value: globalFee - operatorFee}(\"\");\n if (status == false) {\n revert FeeRecipientReceiveError(data);\n }\n }\n if (operatorFee > 0) {\n (status, data) = operator.call{value: operatorFee}(\"\");\n if (status == false) {\n revert TreasuryReceiveError(data);\n }\n }\n emit Withdrawal(withdrawer, operator, balance - globalFee, operatorFee, globalFee - operatorFee);\n */\n }\n\n /// @notice Retrieve the staking contract address\n function getStakingContract() external view returns (address) {\n return STAKING_CONTRACT_ADDRESS_SLOT.getAddress();\n }\n\n /// @notice Retrieve the assigned withdrawer for the given public key root\n /// @param _publicKeyRoot Public key root to get the owner\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address) {\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n return stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n }\n\n receive() external payable {\n revert InvalidCall();\n }\n\n fallback() external payable {\n revert InvalidCall();\n }\n}\n"
},
"src/contracts/libs/DispatchersStorageLib.sol": {
"content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\nlibrary DispatchersStorageLib {\n function getUint256(bytes32 position) internal view returns (uint256 data) {\n assembly {\n data := sload(position)\n }\n }\n\n function setUint256(bytes32 position, uint256 data) internal {\n assembly {\n sstore(position, data)\n }\n }\n\n function getAddress(bytes32 position) internal view returns (address data) {\n assembly {\n data := sload(position)\n }\n }\n\n function setAddress(bytes32 position, address data) internal {\n assembly {\n sstore(position, data)\n }\n }\n}\n"
},
"src/contracts/interfaces/IStakingContractFeeDetails.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\ninterface IStakingContractFeeDetails {\n function getWithdrawerFromPublicKeyRoot(bytes32 _publicKeyRoot) external view returns (address);\n\n function getTreasury() external view returns (address);\n\n function getOperatorFeeRecipient(bytes32 pubKeyRoot) external view returns (address);\n\n function getGlobalFee() external view returns (uint256);\n\n function getOperatorFee() external view returns (uint256);\n}\n"
},
"src/contracts/interfaces/IFeeDispatcher.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\ninterface IFeeDispatcher {\n function dispatch(bytes32 _publicKeyRoot) external payable;\n\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address);\n}\n"
},
"src/contracts/FeeRecipient.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./interfaces/IFeeDispatcher.sol\";\n\ncontract FeeRecipient {\n /// @notice Constructor replay prevention\n bool internal initialized;\n /// @notice Address where funds are sent to be dispatched\n IFeeDispatcher internal dispatcher;\n /// @notice Public Key root assigned to this receiver\n bytes32 internal publicKeyRoot;\n\n error AlreadyInitialized();\n\n /// @notice Initializes the receiver\n /// @param _dispatcher Address that will handle the fee dispatching\n /// @param _publicKeyRoot Public Key root assigned to this receiver\n function init(address _dispatcher, bytes32 _publicKeyRoot) external {\n if (initialized) {\n revert AlreadyInitialized();\n }\n initialized = true;\n dispatcher = IFeeDispatcher(_dispatcher);\n publicKeyRoot = _publicKeyRoot;\n }\n\n /// @notice Empty calldata fallback\n receive() external payable {}\n\n /// @notice Non-empty calldata fallback\n fallback() external payable {}\n\n /// @notice Triggers a withdrawal by sending its funds + its public key root to the dispatcher\n /// @dev Can be called by any wallet as recipients are not parameters\n function withdraw() external {\n dispatcher.dispatch{value: address(this).balance}(publicKeyRoot);\n }\n\n /// @notice Retrieve the assigned public key root\n function getPublicKeyRoot() external view returns (bytes32) {\n return publicKeyRoot;\n }\n\n /// @notice retrieve the assigned withdrawer\n function getWithdrawer() external view returns (address) {\n return dispatcher.getWithdrawer(publicKeyRoot);\n }\n}\n"
},
"src/contracts/ExecutionLayerFeeDispatcher.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./libs/DispatchersStorageLib.sol\";\nimport \"./interfaces/IStakingContractFeeDetails.sol\";\nimport \"./interfaces/IFeeDispatcher.sol\";\n\n/// @title Execution Layer Fee Recipient\n/// @author Kiln\n/// @notice This contract can be used to receive fees from a validator and split them with a node operator\ncontract ExecutionLayerFeeDispatcher is IFeeDispatcher {\n using DispatchersStorageLib for bytes32;\n\n event Withdrawal(\n address indexed withdrawer,\n address indexed feeRecipient,\n bytes32 pubKeyRoot,\n uint256 rewards,\n uint256 nodeOperatorFee,\n uint256 treasuryFee\n );\n\n error TreasuryReceiveError(bytes errorData);\n error FeeRecipientReceiveError(bytes errorData);\n error WithdrawerReceiveError(bytes errorData);\n error ZeroBalanceWithdrawal();\n error AlreadyInitialized();\n error InvalidCall();\n\n bytes32 internal constant STAKING_CONTRACT_ADDRESS_SLOT =\n keccak256(\"ExecutionLayerFeeRecipient.stakingContractAddress\");\n uint256 internal constant BASIS_POINTS = 10_000;\n bytes32 internal constant VERSION_SLOT = keccak256(\"ExecutionLayerFeeRecipient.version\");\n\n /// @notice Ensures an initialisation call has been called only once per _version value\n /// @param _version The current initialisation value\n modifier init(uint256 _version) {\n if (_version != VERSION_SLOT.getUint256() + 1) {\n revert AlreadyInitialized();\n }\n\n VERSION_SLOT.setUint256(_version);\n\n _;\n }\n\n /// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\n constructor(uint256 _version) {\n VERSION_SLOT.setUint256(_version);\n }\n\n /// @notice Initialize the contract by storing the staking contract and the public key in storage\n /// @param _stakingContract Address of the Staking Contract\n function initELD(address _stakingContract) external init(1) {\n STAKING_CONTRACT_ADDRESS_SLOT.setAddress(_stakingContract);\n }\n\n /// @notice Performs a withdrawal on this contract's balance\n function dispatch(bytes32 _publicKeyRoot) external payable {\n uint256 balance = address(this).balance;\n if (balance == 0) {\n revert ZeroBalanceWithdrawal();\n }\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n address withdrawer = stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n address operator = stakingContract.getOperatorFeeRecipient(_publicKeyRoot);\n address treasury = stakingContract.getTreasury();\n uint256 globalFee = (balance * stakingContract.getGlobalFee()) / BASIS_POINTS;\n uint256 operatorFee = (globalFee * stakingContract.getOperatorFee()) / BASIS_POINTS;\n\n (bool status, bytes memory data) = withdrawer.call{value: balance - globalFee}(\"\");\n if (status == false) {\n revert WithdrawerReceiveError(data);\n }\n if (globalFee > 0) {\n (status, data) = treasury.call{value: globalFee - operatorFee}(\"\");\n if (status == false) {\n revert FeeRecipientReceiveError(data);\n }\n }\n if (operatorFee > 0) {\n (status, data) = operator.call{value: operatorFee}(\"\");\n if (status == false) {\n revert TreasuryReceiveError(data);\n }\n }\n emit Withdrawal(\n withdrawer,\n operator,\n _publicKeyRoot,\n balance - globalFee,\n operatorFee,\n globalFee - operatorFee\n );\n }\n\n /// @notice Retrieve the staking contract address\n function getStakingContract() external view returns (address) {\n return STAKING_CONTRACT_ADDRESS_SLOT.getAddress();\n }\n\n /// @notice Retrieve the assigned withdrawer for the given public key root\n /// @param _publicKeyRoot Public key root to get the owner\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address) {\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n return stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n }\n\n receive() external payable {\n revert InvalidCall();\n }\n\n fallback() external payable {\n revert InvalidCall();\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
}
}
}} |
1 | 20,290,458 | a7acb11e623e3ace0290c1de45b065f70ba2aae20f6eba3ef42399454df99953 | decd0ddc375d513cd2bdc8b12151d491a518cfe055fd608ff77c7d34f5849ee8 | 4ca9351dd5cca6931472a810925effc9f41e6723 | 1e68238ce926dec62b3fbc99ab06eb1d85ce0270 | 3fe5a35a0a8c4560c405d2852816cf6fc25a7476 | 3d602d80600a3d3981f3363d3d373d3d3d363d73933fbfeb4ed1f111d12a39c2ab48657e6fc875c65af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73933fbfeb4ed1f111d12a39c2ab48657e6fc875c65af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"src/contracts/ConsensusLayerFeeDispatcher.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./libs/DispatchersStorageLib.sol\";\nimport \"./interfaces/IStakingContractFeeDetails.sol\";\nimport \"./interfaces/IFeeDispatcher.sol\";\n\n/// @title Consensus Layer Fee Recipient\n/// @author Kiln\n/// @notice This contract can be used to receive fees from a validator and split them with a node operator\ncontract ConsensusLayerFeeDispatcher is IFeeDispatcher {\n using DispatchersStorageLib for bytes32;\n\n event Withdrawal(\n address indexed withdrawer,\n address indexed feeRecipient,\n bytes32 pubKeyRoot,\n uint256 rewards,\n uint256 nodeOperatorFee,\n uint256 treasuryFee\n );\n\n error TreasuryReceiveError(bytes errorData);\n error FeeRecipientReceiveError(bytes errorData);\n error WithdrawerReceiveError(bytes errorData);\n error ZeroBalanceWithdrawal();\n error AlreadyInitialized();\n error InvalidCall();\n error NotImplemented();\n\n bytes32 internal constant STAKING_CONTRACT_ADDRESS_SLOT =\n keccak256(\"ConsensusLayerFeeRecipient.stakingContractAddress\");\n uint256 internal constant BASIS_POINTS = 10_000;\n bytes32 internal constant VERSION_SLOT = keccak256(\"ConsensusLayerFeeRecipient.version\");\n\n /// @notice Ensures an initialisation call has been called only once per _version value\n /// @param _version The current initialisation value\n modifier init(uint256 _version) {\n if (_version != VERSION_SLOT.getUint256() + 1) {\n revert AlreadyInitialized();\n }\n\n VERSION_SLOT.setUint256(_version);\n\n _;\n }\n\n /// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\n constructor(uint256 _version) {\n VERSION_SLOT.setUint256(_version);\n }\n\n /// @notice Initialize the contract by storing the staking contract\n /// @param _stakingContract Address of the Staking Contract\n function initCLD(address _stakingContract) external init(1) {\n STAKING_CONTRACT_ADDRESS_SLOT.setAddress(_stakingContract);\n }\n\n /// @notice Performs a withdrawal on this contract's balance\n function dispatch(bytes32) external payable {\n revert NotImplemented();\n /*\n uint256 balance = address(this).balance; // this has taken into account msg.value\n if (balance == 0) {\n revert ZeroBalanceWithdrawal();\n }\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n address withdrawer = stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n address operator = stakingContract.getOperatorFeeRecipient(_publicKeyRoot);\n address treasury = stakingContract.getTreasury();\n uint256 globalFee;\n\n if (balance >= 32 ether) {\n // withdrawing a healthy & exited validator\n globalFee = ((balance - 32 ether) * stakingContract.getGlobalFee()) / BASIS_POINTS;\n } else if (balance <= 16 ether) {\n // withdrawing from what looks like skimming\n globalFee = (balance * stakingContract.getGlobalFee()) / BASIS_POINTS;\n }\n\n uint256 operatorFee = (globalFee * stakingContract.getOperatorFee()) / BASIS_POINTS;\n\n (bool status, bytes memory data) = withdrawer.call{value: balance - globalFee}(\"\");\n if (status == false) {\n revert WithdrawerReceiveError(data);\n }\n if (globalFee > 0) {\n (status, data) = treasury.call{value: globalFee - operatorFee}(\"\");\n if (status == false) {\n revert FeeRecipientReceiveError(data);\n }\n }\n if (operatorFee > 0) {\n (status, data) = operator.call{value: operatorFee}(\"\");\n if (status == false) {\n revert TreasuryReceiveError(data);\n }\n }\n emit Withdrawal(withdrawer, operator, balance - globalFee, operatorFee, globalFee - operatorFee);\n */\n }\n\n /// @notice Retrieve the staking contract address\n function getStakingContract() external view returns (address) {\n return STAKING_CONTRACT_ADDRESS_SLOT.getAddress();\n }\n\n /// @notice Retrieve the assigned withdrawer for the given public key root\n /// @param _publicKeyRoot Public key root to get the owner\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address) {\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n return stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n }\n\n receive() external payable {\n revert InvalidCall();\n }\n\n fallback() external payable {\n revert InvalidCall();\n }\n}\n"
},
"src/contracts/libs/DispatchersStorageLib.sol": {
"content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\nlibrary DispatchersStorageLib {\n function getUint256(bytes32 position) internal view returns (uint256 data) {\n assembly {\n data := sload(position)\n }\n }\n\n function setUint256(bytes32 position, uint256 data) internal {\n assembly {\n sstore(position, data)\n }\n }\n\n function getAddress(bytes32 position) internal view returns (address data) {\n assembly {\n data := sload(position)\n }\n }\n\n function setAddress(bytes32 position, address data) internal {\n assembly {\n sstore(position, data)\n }\n }\n}\n"
},
"src/contracts/interfaces/IStakingContractFeeDetails.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\ninterface IStakingContractFeeDetails {\n function getWithdrawerFromPublicKeyRoot(bytes32 _publicKeyRoot) external view returns (address);\n\n function getTreasury() external view returns (address);\n\n function getOperatorFeeRecipient(bytes32 pubKeyRoot) external view returns (address);\n\n function getGlobalFee() external view returns (uint256);\n\n function getOperatorFee() external view returns (uint256);\n}\n"
},
"src/contracts/interfaces/IFeeDispatcher.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\ninterface IFeeDispatcher {\n function dispatch(bytes32 _publicKeyRoot) external payable;\n\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address);\n}\n"
},
"src/contracts/FeeRecipient.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./interfaces/IFeeDispatcher.sol\";\n\ncontract FeeRecipient {\n /// @notice Constructor replay prevention\n bool internal initialized;\n /// @notice Address where funds are sent to be dispatched\n IFeeDispatcher internal dispatcher;\n /// @notice Public Key root assigned to this receiver\n bytes32 internal publicKeyRoot;\n\n error AlreadyInitialized();\n\n /// @notice Initializes the receiver\n /// @param _dispatcher Address that will handle the fee dispatching\n /// @param _publicKeyRoot Public Key root assigned to this receiver\n function init(address _dispatcher, bytes32 _publicKeyRoot) external {\n if (initialized) {\n revert AlreadyInitialized();\n }\n initialized = true;\n dispatcher = IFeeDispatcher(_dispatcher);\n publicKeyRoot = _publicKeyRoot;\n }\n\n /// @notice Empty calldata fallback\n receive() external payable {}\n\n /// @notice Non-empty calldata fallback\n fallback() external payable {}\n\n /// @notice Triggers a withdrawal by sending its funds + its public key root to the dispatcher\n /// @dev Can be called by any wallet as recipients are not parameters\n function withdraw() external {\n dispatcher.dispatch{value: address(this).balance}(publicKeyRoot);\n }\n\n /// @notice Retrieve the assigned public key root\n function getPublicKeyRoot() external view returns (bytes32) {\n return publicKeyRoot;\n }\n\n /// @notice retrieve the assigned withdrawer\n function getWithdrawer() external view returns (address) {\n return dispatcher.getWithdrawer(publicKeyRoot);\n }\n}\n"
},
"src/contracts/ExecutionLayerFeeDispatcher.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./libs/DispatchersStorageLib.sol\";\nimport \"./interfaces/IStakingContractFeeDetails.sol\";\nimport \"./interfaces/IFeeDispatcher.sol\";\n\n/// @title Execution Layer Fee Recipient\n/// @author Kiln\n/// @notice This contract can be used to receive fees from a validator and split them with a node operator\ncontract ExecutionLayerFeeDispatcher is IFeeDispatcher {\n using DispatchersStorageLib for bytes32;\n\n event Withdrawal(\n address indexed withdrawer,\n address indexed feeRecipient,\n bytes32 pubKeyRoot,\n uint256 rewards,\n uint256 nodeOperatorFee,\n uint256 treasuryFee\n );\n\n error TreasuryReceiveError(bytes errorData);\n error FeeRecipientReceiveError(bytes errorData);\n error WithdrawerReceiveError(bytes errorData);\n error ZeroBalanceWithdrawal();\n error AlreadyInitialized();\n error InvalidCall();\n\n bytes32 internal constant STAKING_CONTRACT_ADDRESS_SLOT =\n keccak256(\"ExecutionLayerFeeRecipient.stakingContractAddress\");\n uint256 internal constant BASIS_POINTS = 10_000;\n bytes32 internal constant VERSION_SLOT = keccak256(\"ExecutionLayerFeeRecipient.version\");\n\n /// @notice Ensures an initialisation call has been called only once per _version value\n /// @param _version The current initialisation value\n modifier init(uint256 _version) {\n if (_version != VERSION_SLOT.getUint256() + 1) {\n revert AlreadyInitialized();\n }\n\n VERSION_SLOT.setUint256(_version);\n\n _;\n }\n\n /// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\n constructor(uint256 _version) {\n VERSION_SLOT.setUint256(_version);\n }\n\n /// @notice Initialize the contract by storing the staking contract and the public key in storage\n /// @param _stakingContract Address of the Staking Contract\n function initELD(address _stakingContract) external init(1) {\n STAKING_CONTRACT_ADDRESS_SLOT.setAddress(_stakingContract);\n }\n\n /// @notice Performs a withdrawal on this contract's balance\n function dispatch(bytes32 _publicKeyRoot) external payable {\n uint256 balance = address(this).balance;\n if (balance == 0) {\n revert ZeroBalanceWithdrawal();\n }\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n address withdrawer = stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n address operator = stakingContract.getOperatorFeeRecipient(_publicKeyRoot);\n address treasury = stakingContract.getTreasury();\n uint256 globalFee = (balance * stakingContract.getGlobalFee()) / BASIS_POINTS;\n uint256 operatorFee = (globalFee * stakingContract.getOperatorFee()) / BASIS_POINTS;\n\n (bool status, bytes memory data) = withdrawer.call{value: balance - globalFee}(\"\");\n if (status == false) {\n revert WithdrawerReceiveError(data);\n }\n if (globalFee > 0) {\n (status, data) = treasury.call{value: globalFee - operatorFee}(\"\");\n if (status == false) {\n revert FeeRecipientReceiveError(data);\n }\n }\n if (operatorFee > 0) {\n (status, data) = operator.call{value: operatorFee}(\"\");\n if (status == false) {\n revert TreasuryReceiveError(data);\n }\n }\n emit Withdrawal(\n withdrawer,\n operator,\n _publicKeyRoot,\n balance - globalFee,\n operatorFee,\n globalFee - operatorFee\n );\n }\n\n /// @notice Retrieve the staking contract address\n function getStakingContract() external view returns (address) {\n return STAKING_CONTRACT_ADDRESS_SLOT.getAddress();\n }\n\n /// @notice Retrieve the assigned withdrawer for the given public key root\n /// @param _publicKeyRoot Public key root to get the owner\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address) {\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n return stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n }\n\n receive() external payable {\n revert InvalidCall();\n }\n\n fallback() external payable {\n revert InvalidCall();\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
}
}
}} |
1 | 20,290,458 | a7acb11e623e3ace0290c1de45b065f70ba2aae20f6eba3ef42399454df99953 | decd0ddc375d513cd2bdc8b12151d491a518cfe055fd608ff77c7d34f5849ee8 | 4ca9351dd5cca6931472a810925effc9f41e6723 | 1e68238ce926dec62b3fbc99ab06eb1d85ce0270 | aa1d61cb710dc1d908e65acdfe35c9f5f4750ccb | 3d602d80600a3d3981f3363d3d373d3d3d363d73933fbfeb4ed1f111d12a39c2ab48657e6fc875c65af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73933fbfeb4ed1f111d12a39c2ab48657e6fc875c65af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"src/contracts/ConsensusLayerFeeDispatcher.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./libs/DispatchersStorageLib.sol\";\nimport \"./interfaces/IStakingContractFeeDetails.sol\";\nimport \"./interfaces/IFeeDispatcher.sol\";\n\n/// @title Consensus Layer Fee Recipient\n/// @author Kiln\n/// @notice This contract can be used to receive fees from a validator and split them with a node operator\ncontract ConsensusLayerFeeDispatcher is IFeeDispatcher {\n using DispatchersStorageLib for bytes32;\n\n event Withdrawal(\n address indexed withdrawer,\n address indexed feeRecipient,\n bytes32 pubKeyRoot,\n uint256 rewards,\n uint256 nodeOperatorFee,\n uint256 treasuryFee\n );\n\n error TreasuryReceiveError(bytes errorData);\n error FeeRecipientReceiveError(bytes errorData);\n error WithdrawerReceiveError(bytes errorData);\n error ZeroBalanceWithdrawal();\n error AlreadyInitialized();\n error InvalidCall();\n error NotImplemented();\n\n bytes32 internal constant STAKING_CONTRACT_ADDRESS_SLOT =\n keccak256(\"ConsensusLayerFeeRecipient.stakingContractAddress\");\n uint256 internal constant BASIS_POINTS = 10_000;\n bytes32 internal constant VERSION_SLOT = keccak256(\"ConsensusLayerFeeRecipient.version\");\n\n /// @notice Ensures an initialisation call has been called only once per _version value\n /// @param _version The current initialisation value\n modifier init(uint256 _version) {\n if (_version != VERSION_SLOT.getUint256() + 1) {\n revert AlreadyInitialized();\n }\n\n VERSION_SLOT.setUint256(_version);\n\n _;\n }\n\n /// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\n constructor(uint256 _version) {\n VERSION_SLOT.setUint256(_version);\n }\n\n /// @notice Initialize the contract by storing the staking contract\n /// @param _stakingContract Address of the Staking Contract\n function initCLD(address _stakingContract) external init(1) {\n STAKING_CONTRACT_ADDRESS_SLOT.setAddress(_stakingContract);\n }\n\n /// @notice Performs a withdrawal on this contract's balance\n function dispatch(bytes32) external payable {\n revert NotImplemented();\n /*\n uint256 balance = address(this).balance; // this has taken into account msg.value\n if (balance == 0) {\n revert ZeroBalanceWithdrawal();\n }\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n address withdrawer = stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n address operator = stakingContract.getOperatorFeeRecipient(_publicKeyRoot);\n address treasury = stakingContract.getTreasury();\n uint256 globalFee;\n\n if (balance >= 32 ether) {\n // withdrawing a healthy & exited validator\n globalFee = ((balance - 32 ether) * stakingContract.getGlobalFee()) / BASIS_POINTS;\n } else if (balance <= 16 ether) {\n // withdrawing from what looks like skimming\n globalFee = (balance * stakingContract.getGlobalFee()) / BASIS_POINTS;\n }\n\n uint256 operatorFee = (globalFee * stakingContract.getOperatorFee()) / BASIS_POINTS;\n\n (bool status, bytes memory data) = withdrawer.call{value: balance - globalFee}(\"\");\n if (status == false) {\n revert WithdrawerReceiveError(data);\n }\n if (globalFee > 0) {\n (status, data) = treasury.call{value: globalFee - operatorFee}(\"\");\n if (status == false) {\n revert FeeRecipientReceiveError(data);\n }\n }\n if (operatorFee > 0) {\n (status, data) = operator.call{value: operatorFee}(\"\");\n if (status == false) {\n revert TreasuryReceiveError(data);\n }\n }\n emit Withdrawal(withdrawer, operator, balance - globalFee, operatorFee, globalFee - operatorFee);\n */\n }\n\n /// @notice Retrieve the staking contract address\n function getStakingContract() external view returns (address) {\n return STAKING_CONTRACT_ADDRESS_SLOT.getAddress();\n }\n\n /// @notice Retrieve the assigned withdrawer for the given public key root\n /// @param _publicKeyRoot Public key root to get the owner\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address) {\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n return stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n }\n\n receive() external payable {\n revert InvalidCall();\n }\n\n fallback() external payable {\n revert InvalidCall();\n }\n}\n"
},
"src/contracts/libs/DispatchersStorageLib.sol": {
"content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\nlibrary DispatchersStorageLib {\n function getUint256(bytes32 position) internal view returns (uint256 data) {\n assembly {\n data := sload(position)\n }\n }\n\n function setUint256(bytes32 position, uint256 data) internal {\n assembly {\n sstore(position, data)\n }\n }\n\n function getAddress(bytes32 position) internal view returns (address data) {\n assembly {\n data := sload(position)\n }\n }\n\n function setAddress(bytes32 position, address data) internal {\n assembly {\n sstore(position, data)\n }\n }\n}\n"
},
"src/contracts/interfaces/IStakingContractFeeDetails.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\ninterface IStakingContractFeeDetails {\n function getWithdrawerFromPublicKeyRoot(bytes32 _publicKeyRoot) external view returns (address);\n\n function getTreasury() external view returns (address);\n\n function getOperatorFeeRecipient(bytes32 pubKeyRoot) external view returns (address);\n\n function getGlobalFee() external view returns (uint256);\n\n function getOperatorFee() external view returns (uint256);\n}\n"
},
"src/contracts/interfaces/IFeeDispatcher.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.10;\n\ninterface IFeeDispatcher {\n function dispatch(bytes32 _publicKeyRoot) external payable;\n\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address);\n}\n"
},
"src/contracts/FeeRecipient.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./interfaces/IFeeDispatcher.sol\";\n\ncontract FeeRecipient {\n /// @notice Constructor replay prevention\n bool internal initialized;\n /// @notice Address where funds are sent to be dispatched\n IFeeDispatcher internal dispatcher;\n /// @notice Public Key root assigned to this receiver\n bytes32 internal publicKeyRoot;\n\n error AlreadyInitialized();\n\n /// @notice Initializes the receiver\n /// @param _dispatcher Address that will handle the fee dispatching\n /// @param _publicKeyRoot Public Key root assigned to this receiver\n function init(address _dispatcher, bytes32 _publicKeyRoot) external {\n if (initialized) {\n revert AlreadyInitialized();\n }\n initialized = true;\n dispatcher = IFeeDispatcher(_dispatcher);\n publicKeyRoot = _publicKeyRoot;\n }\n\n /// @notice Empty calldata fallback\n receive() external payable {}\n\n /// @notice Non-empty calldata fallback\n fallback() external payable {}\n\n /// @notice Triggers a withdrawal by sending its funds + its public key root to the dispatcher\n /// @dev Can be called by any wallet as recipients are not parameters\n function withdraw() external {\n dispatcher.dispatch{value: address(this).balance}(publicKeyRoot);\n }\n\n /// @notice Retrieve the assigned public key root\n function getPublicKeyRoot() external view returns (bytes32) {\n return publicKeyRoot;\n }\n\n /// @notice retrieve the assigned withdrawer\n function getWithdrawer() external view returns (address) {\n return dispatcher.getWithdrawer(publicKeyRoot);\n }\n}\n"
},
"src/contracts/ExecutionLayerFeeDispatcher.sol": {
"content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.8.10;\n\nimport \"./libs/DispatchersStorageLib.sol\";\nimport \"./interfaces/IStakingContractFeeDetails.sol\";\nimport \"./interfaces/IFeeDispatcher.sol\";\n\n/// @title Execution Layer Fee Recipient\n/// @author Kiln\n/// @notice This contract can be used to receive fees from a validator and split them with a node operator\ncontract ExecutionLayerFeeDispatcher is IFeeDispatcher {\n using DispatchersStorageLib for bytes32;\n\n event Withdrawal(\n address indexed withdrawer,\n address indexed feeRecipient,\n bytes32 pubKeyRoot,\n uint256 rewards,\n uint256 nodeOperatorFee,\n uint256 treasuryFee\n );\n\n error TreasuryReceiveError(bytes errorData);\n error FeeRecipientReceiveError(bytes errorData);\n error WithdrawerReceiveError(bytes errorData);\n error ZeroBalanceWithdrawal();\n error AlreadyInitialized();\n error InvalidCall();\n\n bytes32 internal constant STAKING_CONTRACT_ADDRESS_SLOT =\n keccak256(\"ExecutionLayerFeeRecipient.stakingContractAddress\");\n uint256 internal constant BASIS_POINTS = 10_000;\n bytes32 internal constant VERSION_SLOT = keccak256(\"ExecutionLayerFeeRecipient.version\");\n\n /// @notice Ensures an initialisation call has been called only once per _version value\n /// @param _version The current initialisation value\n modifier init(uint256 _version) {\n if (_version != VERSION_SLOT.getUint256() + 1) {\n revert AlreadyInitialized();\n }\n\n VERSION_SLOT.setUint256(_version);\n\n _;\n }\n\n /// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\n constructor(uint256 _version) {\n VERSION_SLOT.setUint256(_version);\n }\n\n /// @notice Initialize the contract by storing the staking contract and the public key in storage\n /// @param _stakingContract Address of the Staking Contract\n function initELD(address _stakingContract) external init(1) {\n STAKING_CONTRACT_ADDRESS_SLOT.setAddress(_stakingContract);\n }\n\n /// @notice Performs a withdrawal on this contract's balance\n function dispatch(bytes32 _publicKeyRoot) external payable {\n uint256 balance = address(this).balance;\n if (balance == 0) {\n revert ZeroBalanceWithdrawal();\n }\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n address withdrawer = stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n address operator = stakingContract.getOperatorFeeRecipient(_publicKeyRoot);\n address treasury = stakingContract.getTreasury();\n uint256 globalFee = (balance * stakingContract.getGlobalFee()) / BASIS_POINTS;\n uint256 operatorFee = (globalFee * stakingContract.getOperatorFee()) / BASIS_POINTS;\n\n (bool status, bytes memory data) = withdrawer.call{value: balance - globalFee}(\"\");\n if (status == false) {\n revert WithdrawerReceiveError(data);\n }\n if (globalFee > 0) {\n (status, data) = treasury.call{value: globalFee - operatorFee}(\"\");\n if (status == false) {\n revert FeeRecipientReceiveError(data);\n }\n }\n if (operatorFee > 0) {\n (status, data) = operator.call{value: operatorFee}(\"\");\n if (status == false) {\n revert TreasuryReceiveError(data);\n }\n }\n emit Withdrawal(\n withdrawer,\n operator,\n _publicKeyRoot,\n balance - globalFee,\n operatorFee,\n globalFee - operatorFee\n );\n }\n\n /// @notice Retrieve the staking contract address\n function getStakingContract() external view returns (address) {\n return STAKING_CONTRACT_ADDRESS_SLOT.getAddress();\n }\n\n /// @notice Retrieve the assigned withdrawer for the given public key root\n /// @param _publicKeyRoot Public key root to get the owner\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address) {\n IStakingContractFeeDetails stakingContract = IStakingContractFeeDetails(\n STAKING_CONTRACT_ADDRESS_SLOT.getAddress()\n );\n return stakingContract.getWithdrawerFromPublicKeyRoot(_publicKeyRoot);\n }\n\n receive() external payable {\n revert InvalidCall();\n }\n\n fallback() external payable {\n revert InvalidCall();\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
}
}
}} |
1 | 20,290,461 | 9335552b8c69c15433aaa894856588f0733d4d9f10db446ebb3a5c0b5ed87514 | 0ad78f95b5c34f6cec69b5b5fae00476c2b599d1522f06e55ca400bd36a64723 | 059bf0ea24df079330797de805585649c874fccb | 5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f | 942f724ef672954781c3c66cee143260e22cc599 | 60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429 | 608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032 | // File: contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/interfaces/IUniswapV2ERC20.sol
pragma solidity >=0.5.0;
interface IUniswapV2ERC20 {
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;
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/UniswapV2ERC20.sol
pragma solidity =0.5.16;
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// File: contracts/libraries/Math.sol
pragma solidity =0.5.16;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// File: contracts/libraries/UQ112x112.sol
pragma solidity =0.5.16;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view 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);
}
// File: contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/interfaces/IUniswapV2Callee.sol
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// File: contracts/UniswapV2Pair.sol
pragma solidity =0.5.16;
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
}
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);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(5).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = IERC20(_token0).balanceOf(address(this));
uint balance1 = IERC20(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
} |
1 | 20,290,462 | a0227c55c2bb05c910ffbb9a55b0c20448a8c04ed7b0b18b3cd64b226694fc95 | 6e50b60c19847febde8223fc2b30f49febf5759e84d3bb65a2b1736b861c9012 | 58890a9cb27586e83cb51d2d26bbe18a1a647245 | 58890a9cb27586e83cb51d2d26bbe18a1a647245 | 09eb24c1fcca0ee230d20901c6832538a171f0d8 | 6101a06040523480156200001257600080fd5b506040516200549a3803806200549a833981016040819052620000359162000144565b86868860200151838787848484848462000055336200011460201b60201c565b6000805160206200547a833981519152546040516001600160a01b03909116906000907fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a908290a36033805460ff191690556001600160601b0319606095861b811660805292851b831660a05290841b821660c05291831b811660e052610100919091528751821b811661012052602090970151811b8716610140529a8b1b86166101605250505050509190941b1661018052506200022b9350505050565b6000805160206200547a83398151915255565b80516001600160a01b03811681146200013f57600080fd5b919050565b60008060008060008060008789036101008112156200016257600080fd5b60408112156200017157600080fd5b50604080519081016001600160401b0381118282101715620001a357634e487b7160e01b600052604160045260246000fd5b604052620001b18962000127565b8152620001c160208a0162000127565b60208201529650620001d66040890162000127565b9550620001e66060890162000127565b9450620001f66080890162000127565b935060a088015192506200020d60c0890162000127565b91506200021d60e0890162000127565b905092959891949750929550565b60805160601c60a05160601c60c05160601c60e05160601c610100516101205160601c6101405160601c6101605160601c6101805160601c615092620003e86000396000818161039501528181610b67015261348b0152600081816104850152612a8c01526000818161057301528181610f4701528181611e960152818161200f01528181612c780152612f1301526000610b33015260008181610737015261176401526000818161086601528181610d0f01528181611dc40152818161205f0152818161240a01528181613a7b0152613cd50152600081816108ba01528181610de50152818161129801528181611cc701528181612a5c0152612e3a015260008181610a8801526119d90152600081816103c70152818161098b01528181610a0201528181610c7601528181610fbc01528181611462015281816114c60152818161169a0152818161186201528181611f8001528181612030015281816123840152818161243901528181612ced01528181612f9e0152818161304601528181613590015281816136110152818161365301528181613923015281816139f501528181613aaa01528181613c4f0152613d0401526150926000f3fe6080604052600436106103855760003560e01c8063853828b6116101d1578063b16b7d0b11610102578063d9f00ec7116100a0578063de5f62681161006f578063de5f626814610b9f578063e752923914610bb4578063ee7afe2d14610bca578063f6ca71b014610bdf57600080fd5b8063d9f00ec714610b01578063dbe55e5614610b21578063dd505df614610b55578063de34d71314610b8957600080fd5b8063cceab750116100dc578063cceab75014610a76578063d059f6ef14610aaa578063d38bfff414610ac1578063d9caed1214610ae157600080fd5b8063b16b7d0b14610a24578063c2e1e3f414610a41578063c7af335214610a6157600080fd5b80639da0e4621161016f578063aa388af611610149578063aa388af61461096e578063ab12edf5146109bb578063ad1728cb146109db578063ad5c4648146109f057600080fd5b80639da0e462146108fc578063a3b81e7314610939578063a4f98af41461095957600080fd5b80639092c31c116101ab5780639092c31c146108545780639136616a1461088857806391649751146108a857806396d538bb146108dc57600080fd5b8063853828b6146107fa57806387bae8671461080f5780638d7c0e461461083457600080fd5b80635c975abb116102b65780636ef38795116102545780637b2d9b2c116102235780637b2d9b2c146107995780637b8962f7146107b9578063842f5c46146107cf5780638456cb59146107e557600080fd5b80636ef3879514610705578063714897df1461072557806371a735f3146107595780637260f8261461077957600080fd5b80636309238311610290578063630923831461069957806366e3667e146106af57806367c7066c146106c55780636e811d38146106e557600080fd5b80635c975abb146106405780635d36b190146106645780635f5152261461067957600080fd5b8063430bf08a11610323578063484be812116102fd578063484be812146105d55780635205c380146105eb57806359b80c0a1461060b5780635a063f631461062b57600080fd5b8063430bf08a14610561578063435356d11461059557806347e7ef24146105b557600080fd5b80630fc3b4c41161035f5780630fc3b4c4146104c75780631072cbea146104fd57806322495dc81461051d5780633c8649591461053d57600080fd5b80630c340a24146104415780630df1ecfd146104735780630ed57b3a146104a757600080fd5b3661043c57336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806103e95750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b61043a5760405162461bcd60e51b815260206004820152601e60248201527f457468206e6f742066726f6d20616c6c6f77656420636f6e747261637473000060448201526064015b60405180910390fd5b005b600080fd5b34801561044d57600080fd5b50610456610c01565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561047f57600080fd5b506104567f000000000000000000000000000000000000000000000000000000000000000081565b3480156104b357600080fd5b5061043a6104c2366004614360565b610c1e565b3480156104d357600080fd5b506104566104e2366004614326565b609f602052600090815260409020546001600160a01b031681565b34801561050957600080fd5b5061043a6105183660046143da565b610c50565b34801561052957600080fd5b5061043a610538366004614582565b610d0d565b34801561054957600080fd5b5061055360695481565b60405190815260200161046a565b34801561056d57600080fd5b506104567f000000000000000000000000000000000000000000000000000000000000000081565b3480156105a157600080fd5b5061043a6105b0366004614447565b610e57565b3480156105c157600080fd5b5061043a6105d03660046143da565b610f3c565b3480156105e157600080fd5b50610553606a5481565b3480156105f757600080fd5b5061043a610606366004614658565b611037565b34801561061757600080fd5b5061043a6106263660046144ce565b611096565b34801561063757600080fd5b5061043a611319565b34801561064c57600080fd5b5060335460ff165b604051901515815260200161046a565b34801561067057600080fd5b5061043a6113b8565b34801561068557600080fd5b50610553610694366004614326565b61145e565b3480156106a557600080fd5b50610553611c2081565b3480156106bb57600080fd5b5061055360345481565b3480156106d157600080fd5b5060a354610456906001600160a01b031681565b3480156106f157600080fd5b5061043a610700366004614326565b61156f565b34801561071157600080fd5b5061043a610720366004614406565b6115e5565b34801561073157600080fd5b506105537f000000000000000000000000000000000000000000000000000000000000000081565b34801561076557600080fd5b5061043a6107743660046146dc565b611baf565b34801561078557600080fd5b50603654610456906001600160a01b031681565b3480156107a557600080fd5b506104566107b4366004614658565b611d98565b3480156107c557600080fd5b5061055360375481565b3480156107db57600080fd5b5061055360685481565b3480156107f157600080fd5b5061043a611dc2565b34801561080657600080fd5b5061043a611e8b565b34801561081b57600080fd5b506033546104569061010090046001600160a01b031681565b34801561084057600080fd5b5061043a61084f36600461475d565b61205d565b34801561086057600080fd5b506104567f000000000000000000000000000000000000000000000000000000000000000081565b34801561089457600080fd5b5061043a6108a3366004614658565b61255f565b3480156108b457600080fd5b506104567f000000000000000000000000000000000000000000000000000000000000000081565b3480156108e857600080fd5b5061043a6108f7366004614406565b61272b565b34801561090857600080fd5b5061092c610917366004614658565b60356020526000908152604090205460ff1681565b60405161046a9190614c50565b34801561094557600080fd5b5061043a610954366004614326565b61284b565b34801561096557600080fd5b506106546128b9565b34801561097a57600080fd5b50610654610989366004614326565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b3480156109c757600080fd5b5061043a6109d63660046147a2565b612959565b3480156109e757600080fd5b5061043a612a45565b3480156109fc57600080fd5b506104567f000000000000000000000000000000000000000000000000000000000000000081565b348015610a3057600080fd5b506105536801bc16d674ec80000081565b348015610a4d57600080fd5b5061043a610a5c366004614326565b612b0b565b348015610a6d57600080fd5b50610654612b98565b348015610a8257600080fd5b506104567f000000000000000000000000000000000000000000000000000000000000000081565b348015610ab657600080fd5b506105536101075481565b348015610acd57600080fd5b5061043a610adc366004614326565b612bc9565b348015610aed57600080fd5b5061043a610afc366004614399565b612c6d565b348015610b0d57600080fd5b5061043a610b1c366004614671565b612d47565b348015610b2d57600080fd5b506104567f000000000000000000000000000000000000000000000000000000000000000081565b348015610b6157600080fd5b506104567f000000000000000000000000000000000000000000000000000000000000000081565b348015610b9557600080fd5b5061055360385481565b348015610bab57600080fd5b5061043a612f08565b348015610bc057600080fd5b50610553606b5481565b348015610bd657600080fd5b5061043a613075565b348015610beb57600080fd5b50610bf46130ff565b60405161046a9190614a2e565b6000610c1960008051602061503d8339815191525490565b905090565b610c26612b98565b610c425760405162461bcd60e51b815260040161043190614cc2565b610c4c8282613161565b5050565b610c58612b98565b610c745760405162461bcd60e51b815260040161043190614cc2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b039081169083161415610cf15760405162461bcd60e51b815260206004820152601f60248201527f43616e6e6f74207472616e7366657220737570706f72746564206173736574006044820152606401610431565b610c4c610cfc610c01565b6001600160a01b03841690836132c0565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d6657600080fd5b505afa158015610d7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9e9190614343565b6001600160a01b0316336001600160a01b031614610dce5760405162461bcd60e51b815260040161043190614dad565b60405163bc26e7e560e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063bc26e7e590610e2090309087908790879060040161497e565b600060405180830381600087803b158015610e3a57600080fd5b505af1158015610e4e573d6000803e3d6000fd5b50505050505050565b610e5f612b98565b610e7b5760405162461bcd60e51b815260040161043190614cc2565b600054610100900460ff1680610e94575060005460ff16155b610ef75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610431565b600054610100900460ff16158015610f19576000805461ffff19166101011790555b610f24848484613317565b8015610f36576000805461ff00191690555b50505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f845760405162461bcd60e51b815260040161043190614c8b565b60008051602061501d83398151915280546002811415610fb65760405162461bcd60e51b815260040161043190614d85565b600282557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b03161461100b5760405162461bcd60e51b815260040161043190614cf9565b82610107600082825461101e9190614ed4565b9091555061102e905084846133d2565b50600190555050565b61103f612b98565b61105b5760405162461bcd60e51b815260040161043190614cc2565b60378190556040518181527fe26b067424903962f951f568e52ec9a3bbe1589526ea54a4e69ca6eaae1a4c779060200160405180910390a150565b60335461010090046001600160a01b031633146110c55760405162461bcd60e51b815260040161043190614d4e565b60335460ff16156110e85760405162461bcd60e51b815260040161043190614d24565b8683146111375760405162461bcd60e51b815260206004820152601a60248201527f5075626b65792073686172657344617461206d69736d617463680000000000006044820152606401610431565b60008060005b89811015611280578a8a8281811061115757611157614fcd565b90506020028101906111699190614de4565b604051611177929190614952565b6040805191829003909120600081815260356020529182205490945060ff1692508260048111156111aa576111aa614fa1565b146111f75760405162461bcd60e51b815260206004820152601c60248201527f56616c696461746f7220616c72656164792072656769737465726564000000006044820152606401610431565b6000838152603560205260409020805460ff19166001179055827facd38e900350661e325d592c959664c0000a306efb2004e7dc283f44e0ea04238c8c8481811061124457611244614fcd565b90506020028101906112569190614de4565b8c8c6040516112689493929190614b75565b60405180910390a261127981614f70565b905061113d565b506040516322f18bf560e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906322f18bf5906112db908d908d908d908d908d908d908d908d90600401614b13565b600060405180830381600087803b1580156112f557600080fd5b505af1158015611309573d6000803e3d6000fd5b5050505050505050505050505050565b60a3546001600160a01b031633146113735760405162461bcd60e51b815260206004820152601b60248201527f43616c6c6572206973206e6f74207468652048617276657374657200000000006044820152606401610431565b60008051602061501d833981519152805460028114156113a55760405162461bcd60e51b815260040161043190614d85565b600282556113b1613464565b5060019055565b7f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db546001600160a01b0316336001600160a01b0316146114535760405162461bcd60e51b815260206004820152603060248201527f4f6e6c79207468652070656e64696e6720476f7665726e6f722063616e20636f60448201526f6d706c6574652074686520636c61696d60801b6064820152608401610431565b61145c336136a9565b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316146114b15760405162461bcd60e51b815260040161043190614cf9565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b15801561151057600080fd5b505afa158015611524573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115489190614789565b6801bc16d674ec80000060345461155f9190614f0e565b6115699190614ed4565b92915050565b611577612b98565b6115935760405162461bcd60e51b815260040161043190614cc2565b60338054610100600160a81b0319166101006001600160a01b038416908102919091179091556040517f83f29c79feb71f8fba9d0fbc4ba5f0982a28b6b1e868b3fc50e6400d100bca0f90600090a250565b60335461010090046001600160a01b031633146116145760405162461bcd60e51b815260040161043190614d4e565b60335460ff16156116375760405162461bcd60e51b815260040161043190614d24565b60008051602061501d833981519152805460028114156116695760405162461bcd60e51b815260040161043190614d85565b6002825560006116826801bc16d674ec80000085614f0e565b6040516370a0823160e01b81523060048201529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b1580156116e457600080fd5b505afa1580156116f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171c9190614789565b81111561175f5760405162461bcd60e51b8152602060048201526011602482015270092dce6eaccccd2c6d2cadce840ae8aa89607b1b6044820152606401610431565b6034547f00000000000000000000000000000000000000000000000000000000000000009061178f908690614ed4565b11156117d65760405162461bcd60e51b815260206004820152601660248201527513585e081d985b1a59185d1bdc9cc81c995858da195960521b6044820152606401610431565b603754816038546117e79190614ed4565b11156118355760405162461bcd60e51b815260206004820152601a60248201527f5374616b696e6720455448206f766572207468726573686f6c640000000000006044820152606401610431565b80603860008282546118479190614ed4565b9091555050604051632e1a7d4d60e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b1580156118ae57600080fd5b505af11580156118c2573d6000803e3d6000fd5b505050506118cf8161376a565b60408051600160f81b60208201526000602182018190526bffffffffffffffffffffffff193060601b16602c8301529101604051602081830303815290604052905060005b85811015611b8857600087878381811061193057611930614fcd565b90506020028101906119429190614e2a565b61194c9080614de4565b60405161195a929190614952565b6040519081900390209050600160008281526035602052604090205460ff16600481111561198a5761198a614fa1565b146119d75760405162461bcd60e51b815260206004820152601860248201527f56616c696461746f72206e6f74207265676973746572656400000000000000006044820152606401610431565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663228951186801bc16d674ec8000008a8a86818110611a2257611a22614fcd565b9050602002810190611a349190614e2a565b611a3e9080614de4565b878d8d89818110611a5157611a51614fcd565b9050602002810190611a639190614e2a565b611a71906020810190614de4565b8f8f8b818110611a8357611a83614fcd565b9050602002810190611a959190614e2a565b604001356040518863ffffffff1660e01b8152600401611aba96959493929190614bdd565b6000604051808303818588803b158015611ad357600080fd5b505af1158015611ae7573d6000803e3d6000fd5b5050506000838152603560205260409020805460ff19166002179055508190507f958934bb53d6b4dc911b6173e586864efbc8076684a31f752c53d5778340b37f898985818110611b3a57611b3a614fcd565b9050602002810190611b4c9190614e2a565b611b569080614de4565b6801bc16d674ec800000604051611b6f93929190614c2c565b60405180910390a250611b8181614f70565b9050611914565b508585905060346000828254611b9e9190614ed4565b909155505060019093555050505050565b60335461010090046001600160a01b03163314611bde5760405162461bcd60e51b815260040161043190614d4e565b60335460ff1615611c015760405162461bcd60e51b815260040161043190614d24565b60008585604051611c13929190614952565b604080519182900390912060008181526035602052919091205490915060ff166003816004811115611c4757611c47614fa1565b1480611c6457506001816004811115611c6257611c62614fa1565b145b611cb05760405162461bcd60e51b815260206004820152601d60248201527f56616c696461746f72206e6f742072656764206f722065786974696e670000006044820152606401610431565b6040516312b3fc1960e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906312b3fc1990611d04908a908a908a908a908a90600401614b9c565b600060405180830381600087803b158015611d1e57600080fd5b505af1158015611d32573d6000803e3d6000fd5b50505060008381526035602052604090819020805460ff19166004179055518391507f6aecca20726a17c1b81989b2fd09dfdf636bae9e564d4066ca18df62dc1f3dc290611d87908a908a908a908a90614b75565b60405180910390a250505050505050565b60a48181548110611da857600080fd5b6000918252602090912001546001600160a01b0316905081565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611e1b57600080fd5b505afa158015611e2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e539190614343565b6001600160a01b0316336001600160a01b031614611e835760405162461bcd60e51b815260040161043190614dad565b61145c613797565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480611eda5750611ec5610c01565b6001600160a01b0316336001600160a01b0316145b611f325760405162461bcd60e51b815260206004820152602360248201527f43616c6c6572206973206e6f7420746865205661756c74206f7220476f7665726044820152623737b960e91b6064820152608401610431565b60008051602061501d83398151915280546002811415611f645760405162461bcd60e51b815260040161043190614d85565b600282556040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015611fca57600080fd5b505afa158015611fde573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120029190614789565b90508015612055576120557f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008361380c565b505060019055565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156120b657600080fd5b505afa1580156120ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ee9190614343565b6001600160a01b0316336001600160a01b03161461211e5760405162461bcd60e51b815260040161043190614dad565b60335460ff166121675760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610431565b60008051602061501d833981519152805460028114156121995760405162461bcd60e51b815260040161043190614d85565b6002825543611c20606b546121ae9190614ed4565b106121fb5760405162461bcd60e51b815260206004820152601e60248201527f466978206163636f756e74696e672063616c6c656420746f6f20736f6f6e00006044820152606401610431565b600219851215801561220e575060038513155b801561222857506000856034546122259190614e93565b12155b6122745760405162461bcd60e51b815260206004820152601760248201527f496e76616c69642076616c696461746f727344656c74610000000000000000006044820152606401610431565b6811ff6cf0fd15afffff19841215801561229757506811ff6cf0fd15b000008413155b80156122b157506000846068546122ae9190614e93565b12155b6122fd5760405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420636f6e73656e7375735265776172647344656c74610000006044820152606401610431565b68053444835ec58000008311156123565760405162461bcd60e51b815260206004820152601960248201527f496e76616c69642077657468546f5661756c74416d6f756e74000000000000006044820152606401610431565b846034546123649190614e93565b603455606854612375908590614e93565b60685543606b5582156124c3577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b1580156123dd57600080fd5b505af11580156123f1573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018890527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b15801561248157600080fd5b505af1158015612495573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124b9919061463b565b506124c38361390a565b60408051868152602081018690529081018490527f80d022717ea022455c5886b8dd8a29c037570aae58aeb4d7b136d7a10ec2e4319060600160405180910390a161250e6000613972565b61254d5760405162461bcd60e51b815260206004820152601060248201526f233ab9b29039ba34b63610313637bbb760811b6044820152606401610431565b612555613df8565b5060019055505050565b612567612b98565b6125835760405162461bcd60e51b815260040161043190614cc2565b60a05481106125c45760405162461bcd60e51b815260206004820152600d60248201526c092dcecc2d8d2c840d2dcc8caf609b1b6044820152606401610431565b600060a082815481106125d9576125d9614fcd565b60009182526020808320909101546001600160a01b03908116808452609f90925260409092205460a0549193509091169061261690600190614f2d565b8310156126985760a0805461262d90600190614f2d565b8154811061263d5761263d614fcd565b60009182526020909120015460a080546001600160a01b03909216918590811061266957612669614fcd565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b60a08054806126a9576126a9614fb7565b60008281526020808220600019908401810180546001600160a01b031990811690915593019093556001600160a01b03858116808352609f855260409283902080549094169093559051908416815290917f16b7600acff27e39a8a96056b3d533045298de927507f5c1d97e4accde60488c91015b60405180910390a2505050565b612733612b98565b61274f5760405162461bcd60e51b815260040161043190614cc2565b8060005b8181101561280257600084848381811061276f5761276f614fcd565b90506020020160208101906127849190614326565b6001600160a01b031614156127f25760405162461bcd60e51b815260206004820152602e60248201527f43616e206e6f742073657420616e20656d70747920616464726573732061732060448201526d30903932bbb0b932103a37b5b2b760911b6064820152608401610431565b6127fb81614f70565b9050612753565b507f04c0b9649497d316554306e53678d5f5f5dbc3a06f97dec13ff4cfe98b986bbc60a4848460405161283793929190614a7b565b60405180910390a1610f3660a4848461407f565b612853612b98565b61286f5760405162461bcd60e51b815260040161043190614cc2565b603680546001600160a01b0319166001600160a01b0383169081179091556040517f3329861a0008b3348767567d2405492b997abd79a088d0f2cef6b1a09a8e7ff790600090a250565b60335460009061010090046001600160a01b031633146128eb5760405162461bcd60e51b815260040161043190614d4e565b60335460ff161561290e5760405162461bcd60e51b815260040161043190614d24565b60008051602061501d833981519152805460028114156129405760405162461bcd60e51b815260040161043190614d85565b6002825561294e6001613972565b925060018255505090565b612961612b98565b61297d5760405162461bcd60e51b815260040161043190614cc2565b808210801561299457506801bc16d674ec80000081105b80156129b15750673782dace9d9000006129ae8383614f2d565b10155b6129fd5760405162461bcd60e51b815260206004820152601760248201527f496e636f7272656374206675736520696e74657276616c0000000000000000006044820152606401610431565b6069829055606a81905560408051838152602081018390527fcb8d24e46eb3c402bf344ee60a6576cba9ef2f59ea1af3b311520704924e901a91015b60405180910390a15050565b60405163095ea7b360e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260001960248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b390604401602060405180830381600087803b158015612ad057600080fd5b505af1158015612ae4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b08919061463b565b50565b612b13612b98565b612b2f5760405162461bcd60e51b815260040161043190614cc2565b60a354604080516001600160a01b03928316815291831660208301527fe48386b84419f4d36e0f96c10cc3510b6fb1a33795620c5098b22472bbe90796910160405180910390a160a380546001600160a01b0319166001600160a01b0392909216919091179055565b6000612bb060008051602061503d8339815191525490565b6001600160a01b0316336001600160a01b031614905090565b612bd1612b98565b612bed5760405162461bcd60e51b815260040161043190614cc2565b612c15817f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db55565b806001600160a01b0316612c3560008051602061503d8339815191525490565b6001600160a01b03167fa39cc5eb22d0f34d8beaefee8a3f17cc229c1a1d1ef87a5ad47313487b1c4f0d60405160405180910390a350565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612cb55760405162461bcd60e51b815260040161043190614c8b565b60008051602061501d83398151915280546002811415612ce75760405162461bcd60e51b815260040161043190614d85565b600282557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b031614612d3c5760405162461bcd60e51b815260040161043190614cf9565b61255585858561380c565b60335461010090046001600160a01b03163314612d765760405162461bcd60e51b815260040161043190614d4e565b60335460ff1615612d995760405162461bcd60e51b815260040161043190614d24565b60008484604051612dab929190614952565b604080519182900390912060008181526035602052919091205490915060ff166002816004811115612ddf57612ddf614fa1565b14612e235760405162461bcd60e51b815260206004820152601460248201527315985b1a59185d1bdc881b9bdd081cdd185ad95960621b6044820152606401610431565b604051633877322b60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690633877322b90612e75908990899089908990600401614b75565b600060405180830381600087803b158015612e8f57600080fd5b505af1158015612ea3573d6000803e3d6000fd5b50505060008381526035602052604090819020805460ff19166003179055518391507f8c2e15303eb94e531acc988c2a01d1193bdaaa15eda7f16dda85316ed463578d90612ef8908990899089908990614b75565b60405180910390a2505050505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612f505760405162461bcd60e51b815260040161043190614c8b565b60008051602061501d83398151915280546002811415612f825760405162461bcd60e51b815260040161043190614d85565b600282556040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015612fe857600080fd5b505afa158015612ffc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130209190614789565b9050600061010754826130339190614f2d565b9050801561306b5761010782905561306b7f0000000000000000000000000000000000000000000000000000000000000000826133d2565b5050600182555050565b6036546001600160a01b031633146130cf5760405162461bcd60e51b815260206004820152601960248201527f43616c6c6572206973206e6f7420746865204d6f6e69746f72000000000000006044820152606401610431565b600060388190556040517fe765a88a37047c5d793dce22b9ceb5a0f5039d276da139b4c7d29613f341f1109190a1565b606060a480548060200260200160405190810160405280929190818152602001828054801561315757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613139575b5050505050905090565b6001600160a01b038281166000908152609f602052604090205416156131be5760405162461bcd60e51b81526020600482015260126024820152711c151bdad95b88185b1c9958591e481cd95d60721b6044820152606401610431565b6001600160a01b038216158015906131de57506001600160a01b03811615155b61321e5760405162461bcd60e51b8152602060048201526011602482015270496e76616c69642061646472657373657360781b6044820152606401610431565b6001600160a01b038281166000818152609f6020908152604080832080549587166001600160a01b0319968716811790915560a0805460018101825594527f78fdc8d422c49ced035a9edf18d00d3c6a8d81df210f3e5e448e045e77b41e8890930180549095168417909455925190815290917fef6485b84315f9b1483beffa32aae9a0596890395e3d7521f1c5fbb51790e765910160405180910390a25050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052613312908490613e72565b505050565b825161332a9060a49060208601906140e2565b508151815181146133745760405162461bcd60e51b8152602060048201526014602482015273496e76616c696420696e7075742061727261797360601b6044820152606401610431565b60005b818110156133cb576133bb84828151811061339457613394614fcd565b60200260200101518483815181106133ae576133ae614fcd565b6020026020010151613161565b6133c481614f70565b9050613377565b5050505050565b6000811161341b5760405162461bcd60e51b81526020600482015260166024820152754d757374206465706f73697420736f6d657468696e6760501b6044820152606401610431565b6040805160008152602081018390526001600160a01b038416917f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f62910160405180910390a25050565b60335460ff16156134875760405162461bcd60e51b815260040161043190614d24565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e52253816040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156134e457600080fd5b505af11580156134f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061351c9190614789565b905060006068548261352e9190614ed4565b9050804710156135805760405162461bcd60e51b815260206004820152601860248201527f496e73756666696369656e74206574682062616c616e636500000000000000006044820152606401610431565b8015610c4c5760006068819055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156135e957600080fd5b505af11580156135fd573d6000803e3d6000fd5b505060a35461363d93506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169350169050836132c0565b60a354604080516001600160a01b0392831681527f0000000000000000000000000000000000000000000000000000000000000000909216602083015281018290527ff6c07a063ed4e63808eb8da7112d46dbcd38de2b40a73dbcc9353c5a94c7235390606001612a39565b6001600160a01b0381166136ff5760405162461bcd60e51b815260206004820152601a60248201527f4e657720476f7665726e6f7220697320616464726573732830290000000000006044820152606401610431565b806001600160a01b031661371f60008051602061503d8339815191525490565b6001600160a01b03167fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a60405160405180910390a3612b088160008051602061503d83398151915255565b60006137798261010754613f44565b905080610107600082825461378e9190614f2d565b90915550505050565b60335460ff16156137ba5760405162461bcd60e51b815260040161043190614d24565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586137ef3390565b6040516001600160a01b03909116815260200160405180910390a1565b6000811161385c5760405162461bcd60e51b815260206004820152601760248201527f4d75737420776974686472617720736f6d657468696e670000000000000000006044820152606401610431565b6001600160a01b0383166138ab5760405162461bcd60e51b8152602060048201526016602482015275135d5cdd081cdc1958da599e481c9958da5c1a595b9d60521b6044820152606401610431565b6138b48161376a565b6138c86001600160a01b03831684836132c0565b6040805160008152602081018390526001600160a01b038416917f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b6398910161271e565b6040805160008152602081018390526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016917f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b6398910160405180910390a250565b60006068544710156139875761156982613f5c565b6000606854476139979190614f2d565b9050600191506801bc16d674ec8000008110613b7b5760006139c26801bc16d674ec80000083614eec565b905080603460008282546139d69190614f2d565b90915550600090506139f1826801bc16d674ec800000614f0e565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015613a4e57600080fd5b505af1158015613a62573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b158015613af257600080fd5b505af1158015613b06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b2a919061463b565b50613b348161390a565b60345460408051848152602081019290925281018290527fbe7040030ff7b347853214bf49820c6d455fedf58f3815f85c7bc5216993682b9060600160405180910390a150505b600060685447613b8b9190614f2d565b90506801bc16d674ec8000008110613bdd5760405162461bcd60e51b8152602060048201526015602482015274556e6578706563746564206163636f756e74696e6760581b6044820152606401610431565b80613be9575050919050565b606954811015613c43578060686000828254613c059190614ed4565b90915550506040518181527f7a745a2c63a535068f52ceca27debd5297bbad5f7f37ec53d044a59d0362445d906020015b60405180910390a1613df1565b606a54811115613de0577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015613ca857600080fd5b505af1158015613cbc573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b158015613d4c57600080fd5b505af1158015613d60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d84919061463b565b50600160346000828254613d989190614f2d565b90915550613da790508161390a565b60345460408051918252602082018390527f6aa7e30787b26429ced603a7aba8b19c4b5d5bcf29a3257da953c8d53bcaa3a69101613c36565b613de984613f5c565b949350505050565b5050919050565b60335460ff16613e415760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610431565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336137ef565b6000613ec7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613f749092919063ffffffff16565b8051909150156133125780806020019051810190613ee5919061463b565b6133125760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610431565b6000818310613f535781613f55565b825b9392505050565b60008115613f6c57613f6c613797565b506000919050565b6060613de9848460008585843b613fcd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610431565b600080866001600160a01b03168587604051613fe99190614962565b60006040518083038185875af1925050503d8060008114614026576040519150601f19603f3d011682016040523d82523d6000602084013e61402b565b606091505b509150915061403b828286614046565b979650505050505050565b60608315614055575081613f55565b8251156140655782518084602001fd5b8160405162461bcd60e51b81526004016104319190614c78565b8280548282559060005260206000209081019282156140d2579160200282015b828111156140d25781546001600160a01b0319166001600160a01b0384351617825560209092019160019091019061409f565b506140de929150614137565b5090565b8280548282559060005260206000209081019282156140d2579160200282015b828111156140d257825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614102565b5b808211156140de5760008155600101614138565b60008083601f84011261415e57600080fd5b5081356001600160401b0381111561417557600080fd5b6020830191508360208260051b850101111561419057600080fd5b9250929050565b600082601f8301126141a857600080fd5b813560206141bd6141b883614e70565b614e40565b80838252828201915082860187848660051b89010111156141dd57600080fd5b60005b858110156142055781356141f381614ff9565b845292840192908401906001016141e0565b5090979650505050505050565b60008083601f84011261422457600080fd5b5081356001600160401b0381111561423b57600080fd5b60208301915083602082850101111561419057600080fd5b600060a0828403121561426557600080fd5b50919050565b600060a0828403121561427d57600080fd5b60405160a081018181106001600160401b038211171561429f5761429f614fe3565b6040529050806142ae836142f6565b81526142bc6020840161430f565b60208201526142cd6040840161430f565b604082015260608301356142e08161500e565b6060820152608092830135920191909152919050565b803563ffffffff8116811461430a57600080fd5b919050565b80356001600160401b038116811461430a57600080fd5b60006020828403121561433857600080fd5b8135613f5581614ff9565b60006020828403121561435557600080fd5b8151613f5581614ff9565b6000806040838503121561437357600080fd5b823561437e81614ff9565b9150602083013561438e81614ff9565b809150509250929050565b6000806000606084860312156143ae57600080fd5b83356143b981614ff9565b925060208401356143c981614ff9565b929592945050506040919091013590565b600080604083850312156143ed57600080fd5b82356143f881614ff9565b946020939093013593505050565b6000806020838503121561441957600080fd5b82356001600160401b0381111561442f57600080fd5b61443b8582860161414c565b90969095509350505050565b60008060006060848603121561445c57600080fd5b83356001600160401b038082111561447357600080fd5b61447f87838801614197565b9450602086013591508082111561449557600080fd5b6144a187838801614197565b935060408601359150808211156144b757600080fd5b506144c486828701614197565b9150509250925092565b600080600080600080600080610120898b0312156144eb57600080fd5b88356001600160401b038082111561450257600080fd5b61450e8c838d0161414c565b909a50985060208b013591508082111561452757600080fd5b6145338c838d0161414c565b909850965060408b013591508082111561454c57600080fd5b506145598b828c0161414c565b909550935050606089013591506145738a60808b01614253565b90509295985092959890939650565b600080600060e0848603121561459757600080fd5b83356001600160401b038111156145ad57600080fd5b8401601f810186136145be57600080fd5b803560206145ce6141b883614e70565b8083825282820191508285018a848660051b88010111156145ee57600080fd5b600095505b84861015614618576146048161430f565b8352600195909501949183019183016145f3565b50965050860135935061463291508690506040860161426b565b90509250925092565b60006020828403121561464d57600080fd5b8151613f558161500e565b60006020828403121561466a57600080fd5b5035919050565b6000806000806040858703121561468757600080fd5b84356001600160401b038082111561469e57600080fd5b6146aa88838901614212565b909650945060208701359150808211156146c357600080fd5b506146d08782880161414c565b95989497509550505050565b600080600080600060e086880312156146f457600080fd5b85356001600160401b038082111561470b57600080fd5b61471789838a01614212565b9097509550602088013591508082111561473057600080fd5b5061473d8882890161414c565b909450925061475190508760408801614253565b90509295509295909350565b60008060006060848603121561477257600080fd5b505081359360208301359350604090920135919050565b60006020828403121561479b57600080fd5b5051919050565b600080604083850312156147b557600080fd5b50508035926020909101359150565b81835260006020808501808196508560051b810191508460005b878110156148475782840389528135601e198836030181126147ff57600080fd5b870180356001600160401b0381111561481757600080fd5b80360389131561482657600080fd5b614833868289850161489b565b9a87019a95505050908401906001016147de565b5091979650505050505050565b8183526000602080850194508260005b85811015614890576001600160401b0361487d8361430f565b1687529582019590820190600101614864565b509495945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600081518084526148dc816020860160208601614f44565b601f01601f19169290920160200192915050565b63ffffffff6148fe826142f6565b16825261490d6020820161430f565b6001600160401b0380821660208501528061492a6040850161430f565b166040850152505060608101356149408161500e565b15156060830152608090810135910152565b8183823760009101908152919050565b60008251614974818460208701614f44565b9190910192915050565b6001600160a01b03851681526101006020808301829052855191830182905260009161012084019187810191845b818110156149d15783516001600160401b0316855293820193928201926001016149ac565b505082935086604086015263ffffffff865116606086015280860151925050506001600160401b0380821660808501528060408601511660a085015250506060830151151560c0830152608083015160e083015295945050505050565b6020808252825182820181905260009190848201906040850190845b81811015614a6f5783516001600160a01b031683529284019291840191600101614a4a565b50909695505050505050565b6000604082016040835280865480835260608501915087600052602092508260002060005b82811015614ac55781546001600160a01b031684529284019260019182019101614aa0565b505050838103828501528481528590820160005b86811015614b07578235614aec81614ff9565b6001600160a01b031682529183019190830190600101614ad9565b50979650505050505050565b6000610120808352614b288184018b8d6147c4565b90508281036020840152614b3d81898b614854565b90508281036040840152614b528187896147c4565b915050836060830152614b6860808301846148f0565b9998505050505050505050565b604081526000614b8960408301868861489b565b828103602084015261403b818587614854565b60e081526000614bb060e08301878961489b565b8281036020840152614bc3818688614854565b915050614bd360408301846148f0565b9695505050505050565b608081526000614bf160808301888a61489b565b8281036020840152614c0381886148c4565b90508281036040840152614c1881868861489b565b915050826060830152979650505050505050565b604081526000614c4060408301858761489b565b9050826020830152949350505050565b6020810160058310614c7257634e487b7160e01b600052602160045260246000fd5b91905290565b602081526000613f5560208301846148c4565b60208082526017908201527f43616c6c6572206973206e6f7420746865205661756c74000000000000000000604082015260600190565b6020808252601a908201527f43616c6c6572206973206e6f742074686520476f7665726e6f72000000000000604082015260600190565b602080825260119082015270155b9cdd5c1c1bdc9d195908185cdcd95d607a1b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601d908201527f43616c6c6572206973206e6f7420746865205265676973747261746f72000000604082015260600190565b6020808252600e908201526d1499595b9d1c985b9d0818d85b1b60921b604082015260600190565b6020808252601c908201527f43616c6c6572206973206e6f7420746865205374726174656769737400000000604082015260600190565b6000808335601e19843603018112614dfb57600080fd5b8301803591506001600160401b03821115614e1557600080fd5b60200191503681900382131561419057600080fd5b60008235605e1983360301811261497457600080fd5b604051601f8201601f191681016001600160401b0381118282101715614e6857614e68614fe3565b604052919050565b60006001600160401b03821115614e8957614e89614fe3565b5060051b60200190565b600080821280156001600160ff1b0384900385131615614eb557614eb5614f8b565b600160ff1b8390038412811615614ece57614ece614f8b565b50500190565b60008219821115614ee757614ee7614f8b565b500190565b600082614f0957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615614f2857614f28614f8b565b500290565b600082821015614f3f57614f3f614f8b565b500390565b60005b83811015614f5f578181015183820152602001614f47565b83811115610f365750506000910152565b6000600019821415614f8457614f84614f8b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114612b0857600080fd5b8015158114612b0857600080fdfe53bf423e48ed90e97d02ab0ebab13b2a235a6bfbe9c321847d5c175333ac45357bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4aa264697066735822122090185a734b1de8826eb108de1e4c3e6d39974867eef4808c4768d017495ca8a464736f6c634300080700337bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000039254033945aa2e4809cc2977e7087bee48bd7ab000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009d65ff81a3c488d585bbfb0bfe3c7707c7917f54000000000000000000000000dd9bc35ae942ef0cfa76930954a156b3ff30a4e100000000000000000000000000000000000000000000000000000000000001f40000000000000000000000007ed4ccb74a1ee903af5fbd9be00ca8616f23d62700000000000000000000000000000000219ab540356cbb839cbe05303d7705fa | 6080604052600436106103855760003560e01c8063853828b6116101d1578063b16b7d0b11610102578063d9f00ec7116100a0578063de5f62681161006f578063de5f626814610b9f578063e752923914610bb4578063ee7afe2d14610bca578063f6ca71b014610bdf57600080fd5b8063d9f00ec714610b01578063dbe55e5614610b21578063dd505df614610b55578063de34d71314610b8957600080fd5b8063cceab750116100dc578063cceab75014610a76578063d059f6ef14610aaa578063d38bfff414610ac1578063d9caed1214610ae157600080fd5b8063b16b7d0b14610a24578063c2e1e3f414610a41578063c7af335214610a6157600080fd5b80639da0e4621161016f578063aa388af611610149578063aa388af61461096e578063ab12edf5146109bb578063ad1728cb146109db578063ad5c4648146109f057600080fd5b80639da0e462146108fc578063a3b81e7314610939578063a4f98af41461095957600080fd5b80639092c31c116101ab5780639092c31c146108545780639136616a1461088857806391649751146108a857806396d538bb146108dc57600080fd5b8063853828b6146107fa57806387bae8671461080f5780638d7c0e461461083457600080fd5b80635c975abb116102b65780636ef38795116102545780637b2d9b2c116102235780637b2d9b2c146107995780637b8962f7146107b9578063842f5c46146107cf5780638456cb59146107e557600080fd5b80636ef3879514610705578063714897df1461072557806371a735f3146107595780637260f8261461077957600080fd5b80636309238311610290578063630923831461069957806366e3667e146106af57806367c7066c146106c55780636e811d38146106e557600080fd5b80635c975abb146106405780635d36b190146106645780635f5152261461067957600080fd5b8063430bf08a11610323578063484be812116102fd578063484be812146105d55780635205c380146105eb57806359b80c0a1461060b5780635a063f631461062b57600080fd5b8063430bf08a14610561578063435356d11461059557806347e7ef24146105b557600080fd5b80630fc3b4c41161035f5780630fc3b4c4146104c75780631072cbea146104fd57806322495dc81461051d5780633c8649591461053d57600080fd5b80630c340a24146104415780630df1ecfd146104735780630ed57b3a146104a757600080fd5b3661043c57336001600160a01b037f0000000000000000000000007ed4ccb74a1ee903af5fbd9be00ca8616f23d6271614806103e95750336001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216145b61043a5760405162461bcd60e51b815260206004820152601e60248201527f457468206e6f742066726f6d20616c6c6f77656420636f6e747261637473000060448201526064015b60405180910390fd5b005b600080fd5b34801561044d57600080fd5b50610456610c01565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561047f57600080fd5b506104567f0000000000000000000000009d65ff81a3c488d585bbfb0bfe3c7707c7917f5481565b3480156104b357600080fd5b5061043a6104c2366004614360565b610c1e565b3480156104d357600080fd5b506104566104e2366004614326565b609f602052600090815260409020546001600160a01b031681565b34801561050957600080fd5b5061043a6105183660046143da565b610c50565b34801561052957600080fd5b5061043a610538366004614582565b610d0d565b34801561054957600080fd5b5061055360695481565b60405190815260200161046a565b34801561056d57600080fd5b506104567f00000000000000000000000039254033945aa2e4809cc2977e7087bee48bd7ab81565b3480156105a157600080fd5b5061043a6105b0366004614447565b610e57565b3480156105c157600080fd5b5061043a6105d03660046143da565b610f3c565b3480156105e157600080fd5b50610553606a5481565b3480156105f757600080fd5b5061043a610606366004614658565b611037565b34801561061757600080fd5b5061043a6106263660046144ce565b611096565b34801561063757600080fd5b5061043a611319565b34801561064c57600080fd5b5060335460ff165b604051901515815260200161046a565b34801561067057600080fd5b5061043a6113b8565b34801561068557600080fd5b50610553610694366004614326565b61145e565b3480156106a557600080fd5b50610553611c2081565b3480156106bb57600080fd5b5061055360345481565b3480156106d157600080fd5b5060a354610456906001600160a01b031681565b3480156106f157600080fd5b5061043a610700366004614326565b61156f565b34801561071157600080fd5b5061043a610720366004614406565b6115e5565b34801561073157600080fd5b506105537f00000000000000000000000000000000000000000000000000000000000001f481565b34801561076557600080fd5b5061043a6107743660046146dc565b611baf565b34801561078557600080fd5b50603654610456906001600160a01b031681565b3480156107a557600080fd5b506104566107b4366004614658565b611d98565b3480156107c557600080fd5b5061055360375481565b3480156107db57600080fd5b5061055360685481565b3480156107f157600080fd5b5061043a611dc2565b34801561080657600080fd5b5061043a611e8b565b34801561081b57600080fd5b506033546104569061010090046001600160a01b031681565b34801561084057600080fd5b5061043a61084f36600461475d565b61205d565b34801561086057600080fd5b506104567f00000000000000000000000039254033945aa2e4809cc2977e7087bee48bd7ab81565b34801561089457600080fd5b5061043a6108a3366004614658565b61255f565b3480156108b457600080fd5b506104567f000000000000000000000000dd9bc35ae942ef0cfa76930954a156b3ff30a4e181565b3480156108e857600080fd5b5061043a6108f7366004614406565b61272b565b34801561090857600080fd5b5061092c610917366004614658565b60356020526000908152604090205460ff1681565b60405161046a9190614c50565b34801561094557600080fd5b5061043a610954366004614326565b61284b565b34801561096557600080fd5b506106546128b9565b34801561097a57600080fd5b50610654610989366004614326565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0390811691161490565b3480156109c757600080fd5b5061043a6109d63660046147a2565b612959565b3480156109e757600080fd5b5061043a612a45565b3480156109fc57600080fd5b506104567f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b348015610a3057600080fd5b506105536801bc16d674ec80000081565b348015610a4d57600080fd5b5061043a610a5c366004614326565b612b0b565b348015610a6d57600080fd5b50610654612b98565b348015610a8257600080fd5b506104567f00000000000000000000000000000000219ab540356cbb839cbe05303d7705fa81565b348015610ab657600080fd5b506105536101075481565b348015610acd57600080fd5b5061043a610adc366004614326565b612bc9565b348015610aed57600080fd5b5061043a610afc366004614399565b612c6d565b348015610b0d57600080fd5b5061043a610b1c366004614671565b612d47565b348015610b2d57600080fd5b506104567f000000000000000000000000000000000000000000000000000000000000000081565b348015610b6157600080fd5b506104567f0000000000000000000000007ed4ccb74a1ee903af5fbd9be00ca8616f23d62781565b348015610b9557600080fd5b5061055360385481565b348015610bab57600080fd5b5061043a612f08565b348015610bc057600080fd5b50610553606b5481565b348015610bd657600080fd5b5061043a613075565b348015610beb57600080fd5b50610bf46130ff565b60405161046a9190614a2e565b6000610c1960008051602061503d8339815191525490565b905090565b610c26612b98565b610c425760405162461bcd60e51b815260040161043190614cc2565b610c4c8282613161565b5050565b610c58612b98565b610c745760405162461bcd60e51b815260040161043190614cc2565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b039081169083161415610cf15760405162461bcd60e51b815260206004820152601f60248201527f43616e6e6f74207472616e7366657220737570706f72746564206173736574006044820152606401610431565b610c4c610cfc610c01565b6001600160a01b03841690836132c0565b7f00000000000000000000000039254033945aa2e4809cc2977e7087bee48bd7ab6001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d6657600080fd5b505afa158015610d7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9e9190614343565b6001600160a01b0316336001600160a01b031614610dce5760405162461bcd60e51b815260040161043190614dad565b60405163bc26e7e560e01b81526001600160a01b037f000000000000000000000000dd9bc35ae942ef0cfa76930954a156b3ff30a4e1169063bc26e7e590610e2090309087908790879060040161497e565b600060405180830381600087803b158015610e3a57600080fd5b505af1158015610e4e573d6000803e3d6000fd5b50505050505050565b610e5f612b98565b610e7b5760405162461bcd60e51b815260040161043190614cc2565b600054610100900460ff1680610e94575060005460ff16155b610ef75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610431565b600054610100900460ff16158015610f19576000805461ffff19166101011790555b610f24848484613317565b8015610f36576000805461ff00191690555b50505050565b336001600160a01b037f00000000000000000000000039254033945aa2e4809cc2977e7087bee48bd7ab1614610f845760405162461bcd60e51b815260040161043190614c8b565b60008051602061501d83398151915280546002811415610fb65760405162461bcd60e51b815260040161043190614d85565b600282557f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316846001600160a01b03161461100b5760405162461bcd60e51b815260040161043190614cf9565b82610107600082825461101e9190614ed4565b9091555061102e905084846133d2565b50600190555050565b61103f612b98565b61105b5760405162461bcd60e51b815260040161043190614cc2565b60378190556040518181527fe26b067424903962f951f568e52ec9a3bbe1589526ea54a4e69ca6eaae1a4c779060200160405180910390a150565b60335461010090046001600160a01b031633146110c55760405162461bcd60e51b815260040161043190614d4e565b60335460ff16156110e85760405162461bcd60e51b815260040161043190614d24565b8683146111375760405162461bcd60e51b815260206004820152601a60248201527f5075626b65792073686172657344617461206d69736d617463680000000000006044820152606401610431565b60008060005b89811015611280578a8a8281811061115757611157614fcd565b90506020028101906111699190614de4565b604051611177929190614952565b6040805191829003909120600081815260356020529182205490945060ff1692508260048111156111aa576111aa614fa1565b146111f75760405162461bcd60e51b815260206004820152601c60248201527f56616c696461746f7220616c72656164792072656769737465726564000000006044820152606401610431565b6000838152603560205260409020805460ff19166001179055827facd38e900350661e325d592c959664c0000a306efb2004e7dc283f44e0ea04238c8c8481811061124457611244614fcd565b90506020028101906112569190614de4565b8c8c6040516112689493929190614b75565b60405180910390a261127981614f70565b905061113d565b506040516322f18bf560e01b81526001600160a01b037f000000000000000000000000dd9bc35ae942ef0cfa76930954a156b3ff30a4e116906322f18bf5906112db908d908d908d908d908d908d908d908d90600401614b13565b600060405180830381600087803b1580156112f557600080fd5b505af1158015611309573d6000803e3d6000fd5b5050505050505050505050505050565b60a3546001600160a01b031633146113735760405162461bcd60e51b815260206004820152601b60248201527f43616c6c6572206973206e6f74207468652048617276657374657200000000006044820152606401610431565b60008051602061501d833981519152805460028114156113a55760405162461bcd60e51b815260040161043190614d85565b600282556113b1613464565b5060019055565b7f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db546001600160a01b0316336001600160a01b0316146114535760405162461bcd60e51b815260206004820152603060248201527f4f6e6c79207468652070656e64696e6720476f7665726e6f722063616e20636f60448201526f6d706c6574652074686520636c61696d60801b6064820152608401610431565b61145c336136a9565b565b60007f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316826001600160a01b0316146114b15760405162461bcd60e51b815260040161043190614cf9565b6040516370a0823160e01b81523060048201527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316906370a082319060240160206040518083038186803b15801561151057600080fd5b505afa158015611524573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115489190614789565b6801bc16d674ec80000060345461155f9190614f0e565b6115699190614ed4565b92915050565b611577612b98565b6115935760405162461bcd60e51b815260040161043190614cc2565b60338054610100600160a81b0319166101006001600160a01b038416908102919091179091556040517f83f29c79feb71f8fba9d0fbc4ba5f0982a28b6b1e868b3fc50e6400d100bca0f90600090a250565b60335461010090046001600160a01b031633146116145760405162461bcd60e51b815260040161043190614d4e565b60335460ff16156116375760405162461bcd60e51b815260040161043190614d24565b60008051602061501d833981519152805460028114156116695760405162461bcd60e51b815260040161043190614d85565b6002825560006116826801bc16d674ec80000085614f0e565b6040516370a0823160e01b81523060048201529091507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316906370a082319060240160206040518083038186803b1580156116e457600080fd5b505afa1580156116f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171c9190614789565b81111561175f5760405162461bcd60e51b8152602060048201526011602482015270092dce6eaccccd2c6d2cadce840ae8aa89607b1b6044820152606401610431565b6034547f00000000000000000000000000000000000000000000000000000000000001f49061178f908690614ed4565b11156117d65760405162461bcd60e51b815260206004820152601660248201527513585e081d985b1a59185d1bdc9cc81c995858da195960521b6044820152606401610431565b603754816038546117e79190614ed4565b11156118355760405162461bcd60e51b815260206004820152601a60248201527f5374616b696e6720455448206f766572207468726573686f6c640000000000006044820152606401610431565b80603860008282546118479190614ed4565b9091555050604051632e1a7d4d60e01b8152600481018290527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031690632e1a7d4d90602401600060405180830381600087803b1580156118ae57600080fd5b505af11580156118c2573d6000803e3d6000fd5b505050506118cf8161376a565b60408051600160f81b60208201526000602182018190526bffffffffffffffffffffffff193060601b16602c8301529101604051602081830303815290604052905060005b85811015611b8857600087878381811061193057611930614fcd565b90506020028101906119429190614e2a565b61194c9080614de4565b60405161195a929190614952565b6040519081900390209050600160008281526035602052604090205460ff16600481111561198a5761198a614fa1565b146119d75760405162461bcd60e51b815260206004820152601860248201527f56616c696461746f72206e6f74207265676973746572656400000000000000006044820152606401610431565b7f00000000000000000000000000000000219ab540356cbb839cbe05303d7705fa6001600160a01b031663228951186801bc16d674ec8000008a8a86818110611a2257611a22614fcd565b9050602002810190611a349190614e2a565b611a3e9080614de4565b878d8d89818110611a5157611a51614fcd565b9050602002810190611a639190614e2a565b611a71906020810190614de4565b8f8f8b818110611a8357611a83614fcd565b9050602002810190611a959190614e2a565b604001356040518863ffffffff1660e01b8152600401611aba96959493929190614bdd565b6000604051808303818588803b158015611ad357600080fd5b505af1158015611ae7573d6000803e3d6000fd5b5050506000838152603560205260409020805460ff19166002179055508190507f958934bb53d6b4dc911b6173e586864efbc8076684a31f752c53d5778340b37f898985818110611b3a57611b3a614fcd565b9050602002810190611b4c9190614e2a565b611b569080614de4565b6801bc16d674ec800000604051611b6f93929190614c2c565b60405180910390a250611b8181614f70565b9050611914565b508585905060346000828254611b9e9190614ed4565b909155505060019093555050505050565b60335461010090046001600160a01b03163314611bde5760405162461bcd60e51b815260040161043190614d4e565b60335460ff1615611c015760405162461bcd60e51b815260040161043190614d24565b60008585604051611c13929190614952565b604080519182900390912060008181526035602052919091205490915060ff166003816004811115611c4757611c47614fa1565b1480611c6457506001816004811115611c6257611c62614fa1565b145b611cb05760405162461bcd60e51b815260206004820152601d60248201527f56616c696461746f72206e6f742072656764206f722065786974696e670000006044820152606401610431565b6040516312b3fc1960e01b81526001600160a01b037f000000000000000000000000dd9bc35ae942ef0cfa76930954a156b3ff30a4e116906312b3fc1990611d04908a908a908a908a908a90600401614b9c565b600060405180830381600087803b158015611d1e57600080fd5b505af1158015611d32573d6000803e3d6000fd5b50505060008381526035602052604090819020805460ff19166004179055518391507f6aecca20726a17c1b81989b2fd09dfdf636bae9e564d4066ca18df62dc1f3dc290611d87908a908a908a908a90614b75565b60405180910390a250505050505050565b60a48181548110611da857600080fd5b6000918252602090912001546001600160a01b0316905081565b7f00000000000000000000000039254033945aa2e4809cc2977e7087bee48bd7ab6001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611e1b57600080fd5b505afa158015611e2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e539190614343565b6001600160a01b0316336001600160a01b031614611e835760405162461bcd60e51b815260040161043190614dad565b61145c613797565b336001600160a01b037f00000000000000000000000039254033945aa2e4809cc2977e7087bee48bd7ab161480611eda5750611ec5610c01565b6001600160a01b0316336001600160a01b0316145b611f325760405162461bcd60e51b815260206004820152602360248201527f43616c6c6572206973206e6f7420746865205661756c74206f7220476f7665726044820152623737b960e91b6064820152608401610431565b60008051602061501d83398151915280546002811415611f645760405162461bcd60e51b815260040161043190614d85565b600282556040516370a0823160e01b81523060048201526000907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316906370a082319060240160206040518083038186803b158015611fca57600080fd5b505afa158015611fde573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120029190614789565b90508015612055576120557f00000000000000000000000039254033945aa2e4809cc2977e7087bee48bd7ab7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28361380c565b505060019055565b7f00000000000000000000000039254033945aa2e4809cc2977e7087bee48bd7ab6001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156120b657600080fd5b505afa1580156120ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ee9190614343565b6001600160a01b0316336001600160a01b03161461211e5760405162461bcd60e51b815260040161043190614dad565b60335460ff166121675760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610431565b60008051602061501d833981519152805460028114156121995760405162461bcd60e51b815260040161043190614d85565b6002825543611c20606b546121ae9190614ed4565b106121fb5760405162461bcd60e51b815260206004820152601e60248201527f466978206163636f756e74696e672063616c6c656420746f6f20736f6f6e00006044820152606401610431565b600219851215801561220e575060038513155b801561222857506000856034546122259190614e93565b12155b6122745760405162461bcd60e51b815260206004820152601760248201527f496e76616c69642076616c696461746f727344656c74610000000000000000006044820152606401610431565b6811ff6cf0fd15afffff19841215801561229757506811ff6cf0fd15b000008413155b80156122b157506000846068546122ae9190614e93565b12155b6122fd5760405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420636f6e73656e7375735265776172647344656c74610000006044820152606401610431565b68053444835ec58000008311156123565760405162461bcd60e51b815260206004820152601960248201527f496e76616c69642077657468546f5661756c74416d6f756e74000000000000006044820152606401610431565b846034546123649190614e93565b603455606854612375908590614e93565b60685543606b5582156124c3577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b1580156123dd57600080fd5b505af11580156123f1573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f00000000000000000000000039254033945aa2e4809cc2977e7087bee48bd7ab81166004830152602482018890527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216935063a9059cbb92506044019050602060405180830381600087803b15801561248157600080fd5b505af1158015612495573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124b9919061463b565b506124c38361390a565b60408051868152602081018690529081018490527f80d022717ea022455c5886b8dd8a29c037570aae58aeb4d7b136d7a10ec2e4319060600160405180910390a161250e6000613972565b61254d5760405162461bcd60e51b815260206004820152601060248201526f233ab9b29039ba34b63610313637bbb760811b6044820152606401610431565b612555613df8565b5060019055505050565b612567612b98565b6125835760405162461bcd60e51b815260040161043190614cc2565b60a05481106125c45760405162461bcd60e51b815260206004820152600d60248201526c092dcecc2d8d2c840d2dcc8caf609b1b6044820152606401610431565b600060a082815481106125d9576125d9614fcd565b60009182526020808320909101546001600160a01b03908116808452609f90925260409092205460a0549193509091169061261690600190614f2d565b8310156126985760a0805461262d90600190614f2d565b8154811061263d5761263d614fcd565b60009182526020909120015460a080546001600160a01b03909216918590811061266957612669614fcd565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b60a08054806126a9576126a9614fb7565b60008281526020808220600019908401810180546001600160a01b031990811690915593019093556001600160a01b03858116808352609f855260409283902080549094169093559051908416815290917f16b7600acff27e39a8a96056b3d533045298de927507f5c1d97e4accde60488c91015b60405180910390a2505050565b612733612b98565b61274f5760405162461bcd60e51b815260040161043190614cc2565b8060005b8181101561280257600084848381811061276f5761276f614fcd565b90506020020160208101906127849190614326565b6001600160a01b031614156127f25760405162461bcd60e51b815260206004820152602e60248201527f43616e206e6f742073657420616e20656d70747920616464726573732061732060448201526d30903932bbb0b932103a37b5b2b760911b6064820152608401610431565b6127fb81614f70565b9050612753565b507f04c0b9649497d316554306e53678d5f5f5dbc3a06f97dec13ff4cfe98b986bbc60a4848460405161283793929190614a7b565b60405180910390a1610f3660a4848461407f565b612853612b98565b61286f5760405162461bcd60e51b815260040161043190614cc2565b603680546001600160a01b0319166001600160a01b0383169081179091556040517f3329861a0008b3348767567d2405492b997abd79a088d0f2cef6b1a09a8e7ff790600090a250565b60335460009061010090046001600160a01b031633146128eb5760405162461bcd60e51b815260040161043190614d4e565b60335460ff161561290e5760405162461bcd60e51b815260040161043190614d24565b60008051602061501d833981519152805460028114156129405760405162461bcd60e51b815260040161043190614d85565b6002825561294e6001613972565b925060018255505090565b612961612b98565b61297d5760405162461bcd60e51b815260040161043190614cc2565b808210801561299457506801bc16d674ec80000081105b80156129b15750673782dace9d9000006129ae8383614f2d565b10155b6129fd5760405162461bcd60e51b815260206004820152601760248201527f496e636f7272656374206675736520696e74657276616c0000000000000000006044820152606401610431565b6069829055606a81905560408051838152602081018390527fcb8d24e46eb3c402bf344ee60a6576cba9ef2f59ea1af3b311520704924e901a91015b60405180910390a15050565b60405163095ea7b360e01b81526001600160a01b037f000000000000000000000000dd9bc35ae942ef0cfa76930954a156b3ff30a4e18116600483015260001960248301527f0000000000000000000000009d65ff81a3c488d585bbfb0bfe3c7707c7917f54169063095ea7b390604401602060405180830381600087803b158015612ad057600080fd5b505af1158015612ae4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b08919061463b565b50565b612b13612b98565b612b2f5760405162461bcd60e51b815260040161043190614cc2565b60a354604080516001600160a01b03928316815291831660208301527fe48386b84419f4d36e0f96c10cc3510b6fb1a33795620c5098b22472bbe90796910160405180910390a160a380546001600160a01b0319166001600160a01b0392909216919091179055565b6000612bb060008051602061503d8339815191525490565b6001600160a01b0316336001600160a01b031614905090565b612bd1612b98565b612bed5760405162461bcd60e51b815260040161043190614cc2565b612c15817f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db55565b806001600160a01b0316612c3560008051602061503d8339815191525490565b6001600160a01b03167fa39cc5eb22d0f34d8beaefee8a3f17cc229c1a1d1ef87a5ad47313487b1c4f0d60405160405180910390a350565b336001600160a01b037f00000000000000000000000039254033945aa2e4809cc2977e7087bee48bd7ab1614612cb55760405162461bcd60e51b815260040161043190614c8b565b60008051602061501d83398151915280546002811415612ce75760405162461bcd60e51b815260040161043190614d85565b600282557f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316846001600160a01b031614612d3c5760405162461bcd60e51b815260040161043190614cf9565b61255585858561380c565b60335461010090046001600160a01b03163314612d765760405162461bcd60e51b815260040161043190614d4e565b60335460ff1615612d995760405162461bcd60e51b815260040161043190614d24565b60008484604051612dab929190614952565b604080519182900390912060008181526035602052919091205490915060ff166002816004811115612ddf57612ddf614fa1565b14612e235760405162461bcd60e51b815260206004820152601460248201527315985b1a59185d1bdc881b9bdd081cdd185ad95960621b6044820152606401610431565b604051633877322b60e01b81526001600160a01b037f000000000000000000000000dd9bc35ae942ef0cfa76930954a156b3ff30a4e11690633877322b90612e75908990899089908990600401614b75565b600060405180830381600087803b158015612e8f57600080fd5b505af1158015612ea3573d6000803e3d6000fd5b50505060008381526035602052604090819020805460ff19166003179055518391507f8c2e15303eb94e531acc988c2a01d1193bdaaa15eda7f16dda85316ed463578d90612ef8908990899089908990614b75565b60405180910390a2505050505050565b336001600160a01b037f00000000000000000000000039254033945aa2e4809cc2977e7087bee48bd7ab1614612f505760405162461bcd60e51b815260040161043190614c8b565b60008051602061501d83398151915280546002811415612f825760405162461bcd60e51b815260040161043190614d85565b600282556040516370a0823160e01b81523060048201526000907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316906370a082319060240160206040518083038186803b158015612fe857600080fd5b505afa158015612ffc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130209190614789565b9050600061010754826130339190614f2d565b9050801561306b5761010782905561306b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2826133d2565b5050600182555050565b6036546001600160a01b031633146130cf5760405162461bcd60e51b815260206004820152601960248201527f43616c6c6572206973206e6f7420746865204d6f6e69746f72000000000000006044820152606401610431565b600060388190556040517fe765a88a37047c5d793dce22b9ceb5a0f5039d276da139b4c7d29613f341f1109190a1565b606060a480548060200260200160405190810160405280929190818152602001828054801561315757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613139575b5050505050905090565b6001600160a01b038281166000908152609f602052604090205416156131be5760405162461bcd60e51b81526020600482015260126024820152711c151bdad95b88185b1c9958591e481cd95d60721b6044820152606401610431565b6001600160a01b038216158015906131de57506001600160a01b03811615155b61321e5760405162461bcd60e51b8152602060048201526011602482015270496e76616c69642061646472657373657360781b6044820152606401610431565b6001600160a01b038281166000818152609f6020908152604080832080549587166001600160a01b0319968716811790915560a0805460018101825594527f78fdc8d422c49ced035a9edf18d00d3c6a8d81df210f3e5e448e045e77b41e8890930180549095168417909455925190815290917fef6485b84315f9b1483beffa32aae9a0596890395e3d7521f1c5fbb51790e765910160405180910390a25050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052613312908490613e72565b505050565b825161332a9060a49060208601906140e2565b508151815181146133745760405162461bcd60e51b8152602060048201526014602482015273496e76616c696420696e7075742061727261797360601b6044820152606401610431565b60005b818110156133cb576133bb84828151811061339457613394614fcd565b60200260200101518483815181106133ae576133ae614fcd565b6020026020010151613161565b6133c481614f70565b9050613377565b5050505050565b6000811161341b5760405162461bcd60e51b81526020600482015260166024820152754d757374206465706f73697420736f6d657468696e6760501b6044820152606401610431565b6040805160008152602081018390526001600160a01b038416917f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f62910160405180910390a25050565b60335460ff16156134875760405162461bcd60e51b815260040161043190614d24565b60007f0000000000000000000000007ed4ccb74a1ee903af5fbd9be00ca8616f23d6276001600160a01b031663e52253816040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156134e457600080fd5b505af11580156134f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061351c9190614789565b905060006068548261352e9190614ed4565b9050804710156135805760405162461bcd60e51b815260206004820152601860248201527f496e73756666696369656e74206574682062616c616e636500000000000000006044820152606401610431565b8015610c4c5760006068819055507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156135e957600080fd5b505af11580156135fd573d6000803e3d6000fd5b505060a35461363d93506001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281169350169050836132c0565b60a354604080516001600160a01b0392831681527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2909216602083015281018290527ff6c07a063ed4e63808eb8da7112d46dbcd38de2b40a73dbcc9353c5a94c7235390606001612a39565b6001600160a01b0381166136ff5760405162461bcd60e51b815260206004820152601a60248201527f4e657720476f7665726e6f7220697320616464726573732830290000000000006044820152606401610431565b806001600160a01b031661371f60008051602061503d8339815191525490565b6001600160a01b03167fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a60405160405180910390a3612b088160008051602061503d83398151915255565b60006137798261010754613f44565b905080610107600082825461378e9190614f2d565b90915550505050565b60335460ff16156137ba5760405162461bcd60e51b815260040161043190614d24565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586137ef3390565b6040516001600160a01b03909116815260200160405180910390a1565b6000811161385c5760405162461bcd60e51b815260206004820152601760248201527f4d75737420776974686472617720736f6d657468696e670000000000000000006044820152606401610431565b6001600160a01b0383166138ab5760405162461bcd60e51b8152602060048201526016602482015275135d5cdd081cdc1958da599e481c9958da5c1a595b9d60521b6044820152606401610431565b6138b48161376a565b6138c86001600160a01b03831684836132c0565b6040805160008152602081018390526001600160a01b038416917f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b6398910161271e565b6040805160008152602081018390526001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216917f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b6398910160405180910390a250565b60006068544710156139875761156982613f5c565b6000606854476139979190614f2d565b9050600191506801bc16d674ec8000008110613b7b5760006139c26801bc16d674ec80000083614eec565b905080603460008282546139d69190614f2d565b90915550600090506139f1826801bc16d674ec800000614f0e565b90507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015613a4e57600080fd5b505af1158015613a62573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f00000000000000000000000039254033945aa2e4809cc2977e7087bee48bd7ab81166004830152602482018690527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216935063a9059cbb92506044019050602060405180830381600087803b158015613af257600080fd5b505af1158015613b06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b2a919061463b565b50613b348161390a565b60345460408051848152602081019290925281018290527fbe7040030ff7b347853214bf49820c6d455fedf58f3815f85c7bc5216993682b9060600160405180910390a150505b600060685447613b8b9190614f2d565b90506801bc16d674ec8000008110613bdd5760405162461bcd60e51b8152602060048201526015602482015274556e6578706563746564206163636f756e74696e6760581b6044820152606401610431565b80613be9575050919050565b606954811015613c43578060686000828254613c059190614ed4565b90915550506040518181527f7a745a2c63a535068f52ceca27debd5297bbad5f7f37ec53d044a59d0362445d906020015b60405180910390a1613df1565b606a54811115613de0577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015613ca857600080fd5b505af1158015613cbc573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f00000000000000000000000039254033945aa2e4809cc2977e7087bee48bd7ab81166004830152602482018690527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216935063a9059cbb92506044019050602060405180830381600087803b158015613d4c57600080fd5b505af1158015613d60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d84919061463b565b50600160346000828254613d989190614f2d565b90915550613da790508161390a565b60345460408051918252602082018390527f6aa7e30787b26429ced603a7aba8b19c4b5d5bcf29a3257da953c8d53bcaa3a69101613c36565b613de984613f5c565b949350505050565b5050919050565b60335460ff16613e415760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610431565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336137ef565b6000613ec7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613f749092919063ffffffff16565b8051909150156133125780806020019051810190613ee5919061463b565b6133125760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610431565b6000818310613f535781613f55565b825b9392505050565b60008115613f6c57613f6c613797565b506000919050565b6060613de9848460008585843b613fcd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610431565b600080866001600160a01b03168587604051613fe99190614962565b60006040518083038185875af1925050503d8060008114614026576040519150601f19603f3d011682016040523d82523d6000602084013e61402b565b606091505b509150915061403b828286614046565b979650505050505050565b60608315614055575081613f55565b8251156140655782518084602001fd5b8160405162461bcd60e51b81526004016104319190614c78565b8280548282559060005260206000209081019282156140d2579160200282015b828111156140d25781546001600160a01b0319166001600160a01b0384351617825560209092019160019091019061409f565b506140de929150614137565b5090565b8280548282559060005260206000209081019282156140d2579160200282015b828111156140d257825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614102565b5b808211156140de5760008155600101614138565b60008083601f84011261415e57600080fd5b5081356001600160401b0381111561417557600080fd5b6020830191508360208260051b850101111561419057600080fd5b9250929050565b600082601f8301126141a857600080fd5b813560206141bd6141b883614e70565b614e40565b80838252828201915082860187848660051b89010111156141dd57600080fd5b60005b858110156142055781356141f381614ff9565b845292840192908401906001016141e0565b5090979650505050505050565b60008083601f84011261422457600080fd5b5081356001600160401b0381111561423b57600080fd5b60208301915083602082850101111561419057600080fd5b600060a0828403121561426557600080fd5b50919050565b600060a0828403121561427d57600080fd5b60405160a081018181106001600160401b038211171561429f5761429f614fe3565b6040529050806142ae836142f6565b81526142bc6020840161430f565b60208201526142cd6040840161430f565b604082015260608301356142e08161500e565b6060820152608092830135920191909152919050565b803563ffffffff8116811461430a57600080fd5b919050565b80356001600160401b038116811461430a57600080fd5b60006020828403121561433857600080fd5b8135613f5581614ff9565b60006020828403121561435557600080fd5b8151613f5581614ff9565b6000806040838503121561437357600080fd5b823561437e81614ff9565b9150602083013561438e81614ff9565b809150509250929050565b6000806000606084860312156143ae57600080fd5b83356143b981614ff9565b925060208401356143c981614ff9565b929592945050506040919091013590565b600080604083850312156143ed57600080fd5b82356143f881614ff9565b946020939093013593505050565b6000806020838503121561441957600080fd5b82356001600160401b0381111561442f57600080fd5b61443b8582860161414c565b90969095509350505050565b60008060006060848603121561445c57600080fd5b83356001600160401b038082111561447357600080fd5b61447f87838801614197565b9450602086013591508082111561449557600080fd5b6144a187838801614197565b935060408601359150808211156144b757600080fd5b506144c486828701614197565b9150509250925092565b600080600080600080600080610120898b0312156144eb57600080fd5b88356001600160401b038082111561450257600080fd5b61450e8c838d0161414c565b909a50985060208b013591508082111561452757600080fd5b6145338c838d0161414c565b909850965060408b013591508082111561454c57600080fd5b506145598b828c0161414c565b909550935050606089013591506145738a60808b01614253565b90509295985092959890939650565b600080600060e0848603121561459757600080fd5b83356001600160401b038111156145ad57600080fd5b8401601f810186136145be57600080fd5b803560206145ce6141b883614e70565b8083825282820191508285018a848660051b88010111156145ee57600080fd5b600095505b84861015614618576146048161430f565b8352600195909501949183019183016145f3565b50965050860135935061463291508690506040860161426b565b90509250925092565b60006020828403121561464d57600080fd5b8151613f558161500e565b60006020828403121561466a57600080fd5b5035919050565b6000806000806040858703121561468757600080fd5b84356001600160401b038082111561469e57600080fd5b6146aa88838901614212565b909650945060208701359150808211156146c357600080fd5b506146d08782880161414c565b95989497509550505050565b600080600080600060e086880312156146f457600080fd5b85356001600160401b038082111561470b57600080fd5b61471789838a01614212565b9097509550602088013591508082111561473057600080fd5b5061473d8882890161414c565b909450925061475190508760408801614253565b90509295509295909350565b60008060006060848603121561477257600080fd5b505081359360208301359350604090920135919050565b60006020828403121561479b57600080fd5b5051919050565b600080604083850312156147b557600080fd5b50508035926020909101359150565b81835260006020808501808196508560051b810191508460005b878110156148475782840389528135601e198836030181126147ff57600080fd5b870180356001600160401b0381111561481757600080fd5b80360389131561482657600080fd5b614833868289850161489b565b9a87019a95505050908401906001016147de565b5091979650505050505050565b8183526000602080850194508260005b85811015614890576001600160401b0361487d8361430f565b1687529582019590820190600101614864565b509495945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600081518084526148dc816020860160208601614f44565b601f01601f19169290920160200192915050565b63ffffffff6148fe826142f6565b16825261490d6020820161430f565b6001600160401b0380821660208501528061492a6040850161430f565b166040850152505060608101356149408161500e565b15156060830152608090810135910152565b8183823760009101908152919050565b60008251614974818460208701614f44565b9190910192915050565b6001600160a01b03851681526101006020808301829052855191830182905260009161012084019187810191845b818110156149d15783516001600160401b0316855293820193928201926001016149ac565b505082935086604086015263ffffffff865116606086015280860151925050506001600160401b0380821660808501528060408601511660a085015250506060830151151560c0830152608083015160e083015295945050505050565b6020808252825182820181905260009190848201906040850190845b81811015614a6f5783516001600160a01b031683529284019291840191600101614a4a565b50909695505050505050565b6000604082016040835280865480835260608501915087600052602092508260002060005b82811015614ac55781546001600160a01b031684529284019260019182019101614aa0565b505050838103828501528481528590820160005b86811015614b07578235614aec81614ff9565b6001600160a01b031682529183019190830190600101614ad9565b50979650505050505050565b6000610120808352614b288184018b8d6147c4565b90508281036020840152614b3d81898b614854565b90508281036040840152614b528187896147c4565b915050836060830152614b6860808301846148f0565b9998505050505050505050565b604081526000614b8960408301868861489b565b828103602084015261403b818587614854565b60e081526000614bb060e08301878961489b565b8281036020840152614bc3818688614854565b915050614bd360408301846148f0565b9695505050505050565b608081526000614bf160808301888a61489b565b8281036020840152614c0381886148c4565b90508281036040840152614c1881868861489b565b915050826060830152979650505050505050565b604081526000614c4060408301858761489b565b9050826020830152949350505050565b6020810160058310614c7257634e487b7160e01b600052602160045260246000fd5b91905290565b602081526000613f5560208301846148c4565b60208082526017908201527f43616c6c6572206973206e6f7420746865205661756c74000000000000000000604082015260600190565b6020808252601a908201527f43616c6c6572206973206e6f742074686520476f7665726e6f72000000000000604082015260600190565b602080825260119082015270155b9cdd5c1c1bdc9d195908185cdcd95d607a1b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601d908201527f43616c6c6572206973206e6f7420746865205265676973747261746f72000000604082015260600190565b6020808252600e908201526d1499595b9d1c985b9d0818d85b1b60921b604082015260600190565b6020808252601c908201527f43616c6c6572206973206e6f7420746865205374726174656769737400000000604082015260600190565b6000808335601e19843603018112614dfb57600080fd5b8301803591506001600160401b03821115614e1557600080fd5b60200191503681900382131561419057600080fd5b60008235605e1983360301811261497457600080fd5b604051601f8201601f191681016001600160401b0381118282101715614e6857614e68614fe3565b604052919050565b60006001600160401b03821115614e8957614e89614fe3565b5060051b60200190565b600080821280156001600160ff1b0384900385131615614eb557614eb5614f8b565b600160ff1b8390038412811615614ece57614ece614f8b565b50500190565b60008219821115614ee757614ee7614f8b565b500190565b600082614f0957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615614f2857614f28614f8b565b500290565b600082821015614f3f57614f3f614f8b565b500390565b60005b83811015614f5f578181015183820152602001614f47565b83811115610f365750506000910152565b6000600019821415614f8457614f84614f8b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114612b0857600080fd5b8015158114612b0857600080fdfe53bf423e48ed90e97d02ab0ebab13b2a235a6bfbe9c321847d5c175333ac45357bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4aa264697066735822122090185a734b1de8826eb108de1e4c3e6d39974867eef4808c4768d017495ca8a464736f6c63430008070033 | {{
"language": "Solidity",
"settings": {
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
},
"sources": {
"@openzeppelin/contracts/security/Pausable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC20/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"
},
"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n function safeTransfer(\n IERC20 token,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(\n IERC20 token,\n address from,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n uint256 newAllowance = token.allowance(address(this), spender) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) {\n // Return data is optional\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n"
},
"@openzeppelin/contracts/utils/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n"
},
"@openzeppelin/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n"
},
"@openzeppelin/contracts/utils/math/Math.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a / b + (a % b == 0 ? 0 : 1);\n }\n}\n"
},
"@openzeppelin/contracts/utils/math/SafeMath.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)\n\npragma solidity ^0.8.0;\n\n// CAUTION\n// This version of SafeMath should only be used with Solidity 0.8 or later,\n// because it relies on the compiler's built in overflow checks.\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations.\n *\n * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\n * now has built in overflow checking.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n return a + b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator.\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b <= a, errorMessage);\n return a - b;\n }\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a / b;\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a % b;\n }\n }\n}\n"
},
"contracts/governance/Governable.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/**\n * @title Base for contracts that are managed by the Origin Protocol's Governor.\n * @dev Copy of the openzeppelin Ownable.sol contract with nomenclature change\n * from owner to governor and renounce methods removed. Does not use\n * Context.sol like Ownable.sol does for simplification.\n * @author Origin Protocol Inc\n */\ncontract Governable {\n // Storage position of the owner and pendingOwner of the contract\n // keccak256(\"OUSD.governor\");\n bytes32 private constant governorPosition =\n 0x7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a;\n\n // keccak256(\"OUSD.pending.governor\");\n bytes32 private constant pendingGovernorPosition =\n 0x44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db;\n\n // keccak256(\"OUSD.reentry.status\");\n bytes32 private constant reentryStatusPosition =\n 0x53bf423e48ed90e97d02ab0ebab13b2a235a6bfbe9c321847d5c175333ac4535;\n\n // See OpenZeppelin ReentrancyGuard implementation\n uint256 constant _NOT_ENTERED = 1;\n uint256 constant _ENTERED = 2;\n\n event PendingGovernorshipTransfer(\n address indexed previousGovernor,\n address indexed newGovernor\n );\n\n event GovernorshipTransferred(\n address indexed previousGovernor,\n address indexed newGovernor\n );\n\n /**\n * @dev Initializes the contract setting the deployer as the initial Governor.\n */\n constructor() {\n _setGovernor(msg.sender);\n emit GovernorshipTransferred(address(0), _governor());\n }\n\n /**\n * @notice Returns the address of the current Governor.\n */\n function governor() public view returns (address) {\n return _governor();\n }\n\n /**\n * @dev Returns the address of the current Governor.\n */\n function _governor() internal view returns (address governorOut) {\n bytes32 position = governorPosition;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n governorOut := sload(position)\n }\n }\n\n /**\n * @dev Returns the address of the pending Governor.\n */\n function _pendingGovernor()\n internal\n view\n returns (address pendingGovernor)\n {\n bytes32 position = pendingGovernorPosition;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n pendingGovernor := sload(position)\n }\n }\n\n /**\n * @dev Throws if called by any account other than the Governor.\n */\n modifier onlyGovernor() {\n require(isGovernor(), \"Caller is not the Governor\");\n _;\n }\n\n /**\n * @notice Returns true if the caller is the current Governor.\n */\n function isGovernor() public view returns (bool) {\n return msg.sender == _governor();\n }\n\n function _setGovernor(address newGovernor) internal {\n bytes32 position = governorPosition;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(position, newGovernor)\n }\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n bytes32 position = reentryStatusPosition;\n uint256 _reentry_status;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n _reentry_status := sload(position)\n }\n\n // On the first call to nonReentrant, _notEntered will be true\n require(_reentry_status != _ENTERED, \"Reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(position, _ENTERED)\n }\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(position, _NOT_ENTERED)\n }\n }\n\n function _setPendingGovernor(address newGovernor) internal {\n bytes32 position = pendingGovernorPosition;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(position, newGovernor)\n }\n }\n\n /**\n * @notice Transfers Governance of the contract to a new account (`newGovernor`).\n * Can only be called by the current Governor. Must be claimed for this to complete\n * @param _newGovernor Address of the new Governor\n */\n function transferGovernance(address _newGovernor) external onlyGovernor {\n _setPendingGovernor(_newGovernor);\n emit PendingGovernorshipTransfer(_governor(), _newGovernor);\n }\n\n /**\n * @notice Claim Governance of the contract to a new account (`newGovernor`).\n * Can only be called by the new Governor.\n */\n function claimGovernance() external {\n require(\n msg.sender == _pendingGovernor(),\n \"Only the pending Governor can complete the claim\"\n );\n _changeGovernor(msg.sender);\n }\n\n /**\n * @dev Change Governance of the contract to a new account (`newGovernor`).\n * @param _newGovernor Address of the new Governor\n */\n function _changeGovernor(address _newGovernor) internal {\n require(_newGovernor != address(0), \"New Governor is address(0)\");\n emit GovernorshipTransferred(_governor(), _newGovernor);\n _setGovernor(_newGovernor);\n }\n}\n"
},
"contracts/interfaces/IBasicToken.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IBasicToken {\n function symbol() external view returns (string memory);\n\n function decimals() external view returns (uint8);\n}\n"
},
"contracts/interfaces/IDepositContract.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IDepositContract {\n /// @notice A processed deposit event.\n event DepositEvent(\n bytes pubkey,\n bytes withdrawal_credentials,\n bytes amount,\n bytes signature,\n bytes index\n );\n\n /// @notice Submit a Phase 0 DepositData object.\n /// @param pubkey A BLS12-381 public key.\n /// @param withdrawal_credentials Commitment to a public key for withdrawals.\n /// @param signature A BLS12-381 signature.\n /// @param deposit_data_root The SHA-256 hash of the SSZ-encoded DepositData object.\n /// Used as a protection against malformed input.\n function deposit(\n bytes calldata pubkey,\n bytes calldata withdrawal_credentials,\n bytes calldata signature,\n bytes32 deposit_data_root\n ) external payable;\n\n /// @notice Query the current deposit root hash.\n /// @return The deposit root hash.\n function get_deposit_root() external view returns (bytes32);\n\n /// @notice Query the current deposit count.\n /// @return The deposit count encoded as a little endian 64-bit number.\n function get_deposit_count() external view returns (bytes memory);\n}\n"
},
"contracts/interfaces/ISSVNetwork.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nstruct Cluster {\n uint32 validatorCount;\n uint64 networkFeeIndex;\n uint64 index;\n bool active;\n uint256 balance;\n}\n\ninterface ISSVNetwork {\n /**********/\n /* Errors */\n /**********/\n\n error CallerNotOwner(); // 0x5cd83192\n error CallerNotWhitelisted(); // 0x8c6e5d71\n error FeeTooLow(); // 0x732f9413\n error FeeExceedsIncreaseLimit(); // 0x958065d9\n error NoFeeDeclared(); // 0x1d226c30\n error ApprovalNotWithinTimeframe(); // 0x97e4b518\n error OperatorDoesNotExist(); // 0x961e3e8c\n error InsufficientBalance(); // 0xf4d678b8\n error ValidatorDoesNotExist(); // 0xe51315d2\n error ClusterNotLiquidatable(); // 0x60300a8d\n error InvalidPublicKeyLength(); // 0x637297a4\n error InvalidOperatorIdsLength(); // 0x38186224\n error ClusterAlreadyEnabled(); // 0x3babafd2\n error ClusterIsLiquidated(); // 0x95a0cf33\n error ClusterDoesNotExists(); // 0x185e2b16\n error IncorrectClusterState(); // 0x12e04c87\n error UnsortedOperatorsList(); // 0xdd020e25\n error NewBlockPeriodIsBelowMinimum(); // 0x6e6c9cac\n error ExceedValidatorLimit(); // 0x6df5ab76\n error TokenTransferFailed(); // 0x045c4b02\n error SameFeeChangeNotAllowed(); // 0xc81272f8\n error FeeIncreaseNotAllowed(); // 0x410a2b6c\n error NotAuthorized(); // 0xea8e4eb5\n error OperatorsListNotUnique(); // 0xa5a1ff5d\n error OperatorAlreadyExists(); // 0x289c9494\n error TargetModuleDoesNotExist(); // 0x8f9195fb\n error MaxValueExceeded(); // 0x91aa3017\n error FeeTooHigh(); // 0xcd4e6167\n error PublicKeysSharesLengthMismatch(); // 0x9ad467b8\n error IncorrectValidatorStateWithData(bytes publicKey); // 0x89307938\n error ValidatorAlreadyExistsWithData(bytes publicKey); // 0x388e7999\n error EmptyPublicKeysList(); // df83e679\n\n // legacy errors\n error ValidatorAlreadyExists(); // 0x8d09a73e\n error IncorrectValidatorState(); // 0x2feda3c1\n\n event AdminChanged(address previousAdmin, address newAdmin);\n event BeaconUpgraded(address indexed beacon);\n event ClusterDeposited(\n address indexed owner,\n uint64[] operatorIds,\n uint256 value,\n Cluster cluster\n );\n event ClusterLiquidated(\n address indexed owner,\n uint64[] operatorIds,\n Cluster cluster\n );\n event ClusterReactivated(\n address indexed owner,\n uint64[] operatorIds,\n Cluster cluster\n );\n event ClusterWithdrawn(\n address indexed owner,\n uint64[] operatorIds,\n uint256 value,\n Cluster cluster\n );\n event DeclareOperatorFeePeriodUpdated(uint64 value);\n event ExecuteOperatorFeePeriodUpdated(uint64 value);\n event FeeRecipientAddressUpdated(\n address indexed owner,\n address recipientAddress\n );\n event Initialized(uint8 version);\n event LiquidationThresholdPeriodUpdated(uint64 value);\n event MinimumLiquidationCollateralUpdated(uint256 value);\n event NetworkEarningsWithdrawn(uint256 value, address recipient);\n event NetworkFeeUpdated(uint256 oldFee, uint256 newFee);\n event OperatorAdded(\n uint64 indexed operatorId,\n address indexed owner,\n bytes publicKey,\n uint256 fee\n );\n event OperatorFeeDeclarationCancelled(\n address indexed owner,\n uint64 indexed operatorId\n );\n event OperatorFeeDeclared(\n address indexed owner,\n uint64 indexed operatorId,\n uint256 blockNumber,\n uint256 fee\n );\n event OperatorFeeExecuted(\n address indexed owner,\n uint64 indexed operatorId,\n uint256 blockNumber,\n uint256 fee\n );\n event OperatorFeeIncreaseLimitUpdated(uint64 value);\n event OperatorMaximumFeeUpdated(uint64 maxFee);\n event OperatorRemoved(uint64 indexed operatorId);\n event OperatorWhitelistUpdated(\n uint64 indexed operatorId,\n address whitelisted\n );\n event OperatorWithdrawn(\n address indexed owner,\n uint64 indexed operatorId,\n uint256 value\n );\n event OwnershipTransferStarted(\n address indexed previousOwner,\n address indexed newOwner\n );\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n event Upgraded(address indexed implementation);\n event ValidatorAdded(\n address indexed owner,\n uint64[] operatorIds,\n bytes publicKey,\n bytes shares,\n Cluster cluster\n );\n event ValidatorExited(\n address indexed owner,\n uint64[] operatorIds,\n bytes publicKey\n );\n event ValidatorRemoved(\n address indexed owner,\n uint64[] operatorIds,\n bytes publicKey,\n Cluster cluster\n );\n\n fallback() external;\n\n function acceptOwnership() external;\n\n function cancelDeclaredOperatorFee(uint64 operatorId) external;\n\n function declareOperatorFee(uint64 operatorId, uint256 fee) external;\n\n function deposit(\n address clusterOwner,\n uint64[] memory operatorIds,\n uint256 amount,\n Cluster memory cluster\n ) external;\n\n function executeOperatorFee(uint64 operatorId) external;\n\n function exitValidator(bytes memory publicKey, uint64[] memory operatorIds)\n external;\n\n function bulkExitValidator(\n bytes[] calldata publicKeys,\n uint64[] calldata operatorIds\n ) external;\n\n function getVersion() external pure returns (string memory version);\n\n function initialize(\n address token_,\n address ssvOperators_,\n address ssvClusters_,\n address ssvDAO_,\n address ssvViews_,\n uint64 minimumBlocksBeforeLiquidation_,\n uint256 minimumLiquidationCollateral_,\n uint32 validatorsPerOperatorLimit_,\n uint64 declareOperatorFeePeriod_,\n uint64 executeOperatorFeePeriod_,\n uint64 operatorMaxFeeIncrease_\n ) external;\n\n function liquidate(\n address clusterOwner,\n uint64[] memory operatorIds,\n Cluster memory cluster\n ) external;\n\n function owner() external view returns (address);\n\n function pendingOwner() external view returns (address);\n\n function proxiableUUID() external view returns (bytes32);\n\n function reactivate(\n uint64[] memory operatorIds,\n uint256 amount,\n Cluster memory cluster\n ) external;\n\n function reduceOperatorFee(uint64 operatorId, uint256 fee) external;\n\n function registerOperator(bytes memory publicKey, uint256 fee)\n external\n returns (uint64 id);\n\n function registerValidator(\n bytes memory publicKey,\n uint64[] memory operatorIds,\n bytes memory sharesData,\n uint256 amount,\n Cluster memory cluster\n ) external;\n\n function bulkRegisterValidator(\n bytes[] calldata publicKeys,\n uint64[] calldata operatorIds,\n bytes[] calldata sharesData,\n uint256 amount,\n Cluster memory cluster\n ) external;\n\n function removeOperator(uint64 operatorId) external;\n\n function removeValidator(\n bytes memory publicKey,\n uint64[] memory operatorIds,\n Cluster memory cluster\n ) external;\n\n function bulkRemoveValidator(\n bytes[] calldata publicKeys,\n uint64[] calldata operatorIds,\n Cluster memory cluster\n ) external;\n\n function renounceOwnership() external;\n\n function setFeeRecipientAddress(address recipientAddress) external;\n\n function setOperatorWhitelist(uint64 operatorId, address whitelisted)\n external;\n\n function transferOwnership(address newOwner) external;\n\n function updateDeclareOperatorFeePeriod(uint64 timeInSeconds) external;\n\n function updateExecuteOperatorFeePeriod(uint64 timeInSeconds) external;\n\n function updateLiquidationThresholdPeriod(uint64 blocks) external;\n\n function updateMaximumOperatorFee(uint64 maxFee) external;\n\n function updateMinimumLiquidationCollateral(uint256 amount) external;\n\n function updateModule(uint8 moduleId, address moduleAddress) external;\n\n function updateNetworkFee(uint256 fee) external;\n\n function updateOperatorFeeIncreaseLimit(uint64 percentage) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes memory data)\n external\n payable;\n\n function withdraw(\n uint64[] memory operatorIds,\n uint256 amount,\n Cluster memory cluster\n ) external;\n\n function withdrawAllOperatorEarnings(uint64 operatorId) external;\n\n function withdrawNetworkEarnings(uint256 amount) external;\n\n function withdrawOperatorEarnings(uint64 operatorId, uint256 amount)\n external;\n}\n"
},
"contracts/interfaces/IStrategy.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/**\n * @title Platform interface to integrate with lending platform like Compound, AAVE etc.\n */\ninterface IStrategy {\n /**\n * @dev Deposit the given asset to platform\n * @param _asset asset address\n * @param _amount Amount to deposit\n */\n function deposit(address _asset, uint256 _amount) external;\n\n /**\n * @dev Deposit the entire balance of all supported assets in the Strategy\n * to the platform\n */\n function depositAll() external;\n\n /**\n * @dev Withdraw given asset from Lending platform\n */\n function withdraw(\n address _recipient,\n address _asset,\n uint256 _amount\n ) external;\n\n /**\n * @dev Liquidate all assets in strategy and return them to Vault.\n */\n function withdrawAll() external;\n\n /**\n * @dev Returns the current balance of the given asset.\n */\n function checkBalance(address _asset)\n external\n view\n returns (uint256 balance);\n\n /**\n * @dev Returns bool indicating whether strategy supports asset.\n */\n function supportsAsset(address _asset) external view returns (bool);\n\n /**\n * @dev Collect reward tokens from the Strategy.\n */\n function collectRewardTokens() external;\n\n /**\n * @dev The address array of the reward tokens for the Strategy.\n */\n function getRewardTokenAddresses() external view returns (address[] memory);\n}\n"
},
"contracts/interfaces/IVault.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { VaultStorage } from \"../vault/VaultStorage.sol\";\n\ninterface IVault {\n event AssetSupported(address _asset);\n event AssetDefaultStrategyUpdated(address _asset, address _strategy);\n event AssetAllocated(address _asset, address _strategy, uint256 _amount);\n event StrategyApproved(address _addr);\n event StrategyRemoved(address _addr);\n event Mint(address _addr, uint256 _value);\n event Redeem(address _addr, uint256 _value);\n event CapitalPaused();\n event CapitalUnpaused();\n event RebasePaused();\n event RebaseUnpaused();\n event VaultBufferUpdated(uint256 _vaultBuffer);\n event RedeemFeeUpdated(uint256 _redeemFeeBps);\n event PriceProviderUpdated(address _priceProvider);\n event AllocateThresholdUpdated(uint256 _threshold);\n event RebaseThresholdUpdated(uint256 _threshold);\n event StrategistUpdated(address _address);\n event MaxSupplyDiffChanged(uint256 maxSupplyDiff);\n event YieldDistribution(address _to, uint256 _yield, uint256 _fee);\n event TrusteeFeeBpsChanged(uint256 _basis);\n event TrusteeAddressChanged(address _address);\n event SwapperChanged(address _address);\n event SwapAllowedUndervalueChanged(uint256 _basis);\n event SwapSlippageChanged(address _asset, uint256 _basis);\n event Swapped(\n address indexed _fromAsset,\n address indexed _toAsset,\n uint256 _fromAssetAmount,\n uint256 _toAssetAmount\n );\n\n // Governable.sol\n function transferGovernance(address _newGovernor) external;\n\n function claimGovernance() external;\n\n function governor() external view returns (address);\n\n // VaultAdmin.sol\n function setPriceProvider(address _priceProvider) external;\n\n function priceProvider() external view returns (address);\n\n function setRedeemFeeBps(uint256 _redeemFeeBps) external;\n\n function redeemFeeBps() external view returns (uint256);\n\n function setVaultBuffer(uint256 _vaultBuffer) external;\n\n function vaultBuffer() external view returns (uint256);\n\n function setAutoAllocateThreshold(uint256 _threshold) external;\n\n function autoAllocateThreshold() external view returns (uint256);\n\n function setRebaseThreshold(uint256 _threshold) external;\n\n function rebaseThreshold() external view returns (uint256);\n\n function setStrategistAddr(address _address) external;\n\n function strategistAddr() external view returns (address);\n\n function setMaxSupplyDiff(uint256 _maxSupplyDiff) external;\n\n function maxSupplyDiff() external view returns (uint256);\n\n function setTrusteeAddress(address _address) external;\n\n function trusteeAddress() external view returns (address);\n\n function setTrusteeFeeBps(uint256 _basis) external;\n\n function trusteeFeeBps() external view returns (uint256);\n\n function ousdMetaStrategy() external view returns (address);\n\n function setSwapper(address _swapperAddr) external;\n\n function setSwapAllowedUndervalue(uint16 _percentageBps) external;\n\n function setOracleSlippage(address _asset, uint16 _allowedOracleSlippageBps)\n external;\n\n function supportAsset(address _asset, uint8 _supportsAsset) external;\n\n function approveStrategy(address _addr) external;\n\n function removeStrategy(address _addr) external;\n\n function setAssetDefaultStrategy(address _asset, address _strategy)\n external;\n\n function assetDefaultStrategies(address _asset)\n external\n view\n returns (address);\n\n function pauseRebase() external;\n\n function unpauseRebase() external;\n\n function rebasePaused() external view returns (bool);\n\n function pauseCapital() external;\n\n function unpauseCapital() external;\n\n function capitalPaused() external view returns (bool);\n\n function transferToken(address _asset, uint256 _amount) external;\n\n function priceUnitMint(address asset) external view returns (uint256);\n\n function priceUnitRedeem(address asset) external view returns (uint256);\n\n function withdrawAllFromStrategy(address _strategyAddr) external;\n\n function withdrawAllFromStrategies() external;\n\n function withdrawFromStrategy(\n address _strategyFromAddress,\n address[] calldata _assets,\n uint256[] calldata _amounts\n ) external;\n\n function depositToStrategy(\n address _strategyToAddress,\n address[] calldata _assets,\n uint256[] calldata _amounts\n ) external;\n\n // VaultCore.sol\n function mint(\n address _asset,\n uint256 _amount,\n uint256 _minimumOusdAmount\n ) external;\n\n function mintForStrategy(uint256 _amount) external;\n\n function redeem(uint256 _amount, uint256 _minimumUnitAmount) external;\n\n function burnForStrategy(uint256 _amount) external;\n\n function redeemAll(uint256 _minimumUnitAmount) external;\n\n function allocate() external;\n\n function rebase() external;\n\n function swapCollateral(\n address fromAsset,\n address toAsset,\n uint256 fromAssetAmount,\n uint256 minToAssetAmount,\n bytes calldata data\n ) external returns (uint256 toAssetAmount);\n\n function totalValue() external view returns (uint256 value);\n\n function checkBalance(address _asset) external view returns (uint256);\n\n function calculateRedeemOutputs(uint256 _amount)\n external\n view\n returns (uint256[] memory);\n\n function getAssetCount() external view returns (uint256);\n\n function getAssetConfig(address _asset)\n external\n view\n returns (VaultStorage.Asset memory config);\n\n function getAllAssets() external view returns (address[] memory);\n\n function getStrategyCount() external view returns (uint256);\n\n function swapper() external view returns (address);\n\n function allowedSwapUndervalue() external view returns (uint256);\n\n function getAllStrategies() external view returns (address[] memory);\n\n function isSupportedAsset(address _asset) external view returns (bool);\n\n function netOusdMintForStrategyThreshold() external view returns (uint256);\n\n function setOusdMetaStrategy(address _ousdMetaStrategy) external;\n\n function setNetOusdMintForStrategyThreshold(uint256 _threshold) external;\n\n function netOusdMintedForStrategy() external view returns (int256);\n\n function weth() external view returns (address);\n\n function cacheWETHAssetIndex() external;\n\n function wethAssetIndex() external view returns (uint256);\n\n function initialize(address, address) external;\n\n function setAdminImpl(address) external;\n\n function removeAsset(address _asset) external;\n}\n"
},
"contracts/interfaces/IWETH9.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IWETH9 {\n event Approval(address indexed src, address indexed guy, uint256 wad);\n event Deposit(address indexed dst, uint256 wad);\n event Transfer(address indexed src, address indexed dst, uint256 wad);\n event Withdrawal(address indexed src, uint256 wad);\n\n function allowance(address, address) external view returns (uint256);\n\n function approve(address guy, uint256 wad) external returns (bool);\n\n function balanceOf(address) external view returns (uint256);\n\n function decimals() external view returns (uint8);\n\n function deposit() external payable;\n\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function totalSupply() external view returns (uint256);\n\n function transfer(address dst, uint256 wad) external returns (bool);\n\n function transferFrom(\n address src,\n address dst,\n uint256 wad\n ) external returns (bool);\n\n function withdraw(uint256 wad) external;\n}\n"
},
"contracts/strategies/NativeStaking/FeeAccumulator.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\n/**\n * @title Fee Accumulator for Native Staking SSV Strategy\n * @notice Receives execution rewards which includes tx fees and\n * MEV rewards like tx priority and tx ordering.\n * It does NOT include swept ETH from beacon chain consensus rewards or full validator withdrawals.\n * @author Origin Protocol Inc\n */\ncontract FeeAccumulator {\n /// @notice The address of the Native Staking Strategy\n address public immutable STRATEGY;\n\n event ExecutionRewardsCollected(address indexed strategy, uint256 amount);\n\n /**\n * @param _strategy Address of the Native Staking Strategy\n */\n constructor(address _strategy) {\n STRATEGY = _strategy;\n }\n\n /**\n * @notice sends all ETH in this FeeAccumulator contract to the Native Staking Strategy.\n * @return eth The amount of execution rewards that were sent to the Native Staking Strategy\n */\n function collect() external returns (uint256 eth) {\n require(msg.sender == STRATEGY, \"Caller is not the Strategy\");\n\n eth = address(this).balance;\n if (eth > 0) {\n // Send the ETH to the Native Staking Strategy\n Address.sendValue(payable(STRATEGY), eth);\n\n emit ExecutionRewardsCollected(STRATEGY, eth);\n }\n }\n\n /**\n * @dev Accept ETH\n */\n receive() external payable {}\n}\n"
},
"contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\n\nimport { InitializableAbstractStrategy } from \"../../utils/InitializableAbstractStrategy.sol\";\nimport { IWETH9 } from \"../../interfaces/IWETH9.sol\";\nimport { FeeAccumulator } from \"./FeeAccumulator.sol\";\nimport { ValidatorAccountant } from \"./ValidatorAccountant.sol\";\n\nstruct ValidatorStakeData {\n bytes pubkey;\n bytes signature;\n bytes32 depositDataRoot;\n}\n\n/// @title Native Staking SSV Strategy\n/// @notice Strategy to deploy funds into DVT validators powered by the SSV Network\n/// @author Origin Protocol Inc\n/// @dev This contract handles WETH and ETH and in some operations interchanges between the two. Any WETH that\n/// is on the contract across multiple blocks (and not just transitory within a transaction) is considered an\n/// asset. Meaning deposits increase the balance of the asset and withdrawal decrease it. As opposed to all\n/// our other strategies the WETH doesn't immediately get deposited into an underlying strategy and can be present\n/// across multiple blocks waiting to be unwrapped to ETH and staked to validators. This separation of WETH and ETH is\n/// required since the rewards (reward token) is also in ETH.\n///\n/// To simplify the accounting of WETH there is another difference in behavior compared to the other strategies.\n/// To withdraw WETH asset - exit message is posted to validators and the ETH hits this contract with multiple days\n/// delay. In order to simplify the WETH accounting upon detection of such an event the ValidatorAccountant\n/// immediately wraps ETH to WETH and sends it to the Vault.\n///\n/// On the other hand any ETH on the contract (across multiple blocks) is there either:\n/// - as a result of already accounted for consensus rewards\n/// - as a result of not yet accounted for consensus rewards\n/// - as a results of not yet accounted for full validator withdrawals (or validator slashes)\n///\n/// Even though the strategy assets and rewards are a very similar asset the consensus layer rewards and the\n/// execution layer rewards are considered rewards and those are dripped to the Vault over a configurable time\n/// interval and not immediately.\ncontract NativeStakingSSVStrategy is\n ValidatorAccountant,\n InitializableAbstractStrategy\n{\n using SafeERC20 for IERC20;\n\n /// @notice SSV ERC20 token that serves as a payment for operating SSV validators\n address public immutable SSV_TOKEN;\n /// @notice Fee collector address\n /// @dev this address will receive Execution layer rewards - These are rewards earned for\n /// executing transactions on the Ethereum network as part of block proposals. They include\n /// priority fees (fees paid by users for their transactions to be included) and MEV rewards\n /// (rewards for arranging transactions in a way that benefits the validator).\n address payable public immutable FEE_ACCUMULATOR_ADDRESS;\n\n /// @dev This contract receives WETH as the deposit asset, but unlike other strategies doesn't immediately\n /// deposit it to an underlying platform. Rather a special privilege account stakes it to the validators.\n /// For that reason calling WETH.balanceOf(this) in a deposit function can contain WETH that has just been\n /// deposited and also WETH that has previously been deposited. To keep a correct count we need to keep track\n /// of WETH that has already been accounted for.\n /// This value represents the amount of WETH balance of this contract that has already been accounted for by the\n /// deposit events.\n /// It is important to note that this variable is not concerned with WETH that is a result of full/partial\n /// withdrawal of the validators. It is strictly concerned with WETH that has been deposited and is waiting to\n /// be staked.\n uint256 public depositedWethAccountedFor;\n\n // For future use\n uint256[49] private __gap;\n\n /// @param _baseConfig Base strategy config with platformAddress (ERC-4626 Vault contract), eg sfrxETH or sDAI,\n /// and vaultAddress (OToken Vault contract), eg VaultProxy or OETHVaultProxy\n /// @param _wethAddress Address of the Erc20 WETH Token contract\n /// @param _ssvToken Address of the Erc20 SSV Token contract\n /// @param _ssvNetwork Address of the SSV Network contract\n /// @param _maxValidators Maximum number of validators that can be registered in the strategy\n /// @param _feeAccumulator Address of the fee accumulator receiving execution layer validator rewards\n /// @param _beaconChainDepositContract Address of the beacon chain deposit contract\n constructor(\n BaseStrategyConfig memory _baseConfig,\n address _wethAddress,\n address _ssvToken,\n address _ssvNetwork,\n uint256 _maxValidators,\n address _feeAccumulator,\n address _beaconChainDepositContract\n )\n InitializableAbstractStrategy(_baseConfig)\n ValidatorAccountant(\n _wethAddress,\n _baseConfig.vaultAddress,\n _beaconChainDepositContract,\n _ssvNetwork,\n _maxValidators\n )\n {\n SSV_TOKEN = _ssvToken;\n FEE_ACCUMULATOR_ADDRESS = payable(_feeAccumulator);\n }\n\n /// @notice initialize function, to set up initial internal state\n /// @param _rewardTokenAddresses Address of reward token for platform\n /// @param _assets Addresses of initial supported assets\n /// @param _pTokens Platform Token corresponding addresses\n function initialize(\n address[] memory _rewardTokenAddresses,\n address[] memory _assets,\n address[] memory _pTokens\n ) external onlyGovernor initializer {\n InitializableAbstractStrategy._initialize(\n _rewardTokenAddresses,\n _assets,\n _pTokens\n );\n }\n\n /// @notice Unlike other strategies, this does not deposit assets into the underlying platform.\n /// It just checks the asset is WETH and emits the Deposit event.\n /// To deposit WETH into validators `registerSsvValidator` and `stakeEth` must be used.\n /// Will NOT revert if the strategy is paused from an accounting failure.\n /// @param _asset Address of asset to deposit. Has to be WETH.\n /// @param _amount Amount of assets that were transferred to the strategy by the vault.\n function deposit(address _asset, uint256 _amount)\n external\n override\n onlyVault\n nonReentrant\n {\n require(_asset == WETH, \"Unsupported asset\");\n depositedWethAccountedFor += _amount;\n _deposit(_asset, _amount);\n }\n\n /// @dev Deposit WETH to this strategy so it can later be staked into a validator.\n /// @param _asset Address of WETH\n /// @param _amount Amount of WETH to deposit\n function _deposit(address _asset, uint256 _amount) internal {\n require(_amount > 0, \"Must deposit something\");\n /*\n * We could do a check here that would revert when \"_amount % 32 ether != 0\". With the idea of\n * not allowing deposits that will result in WETH sitting on the strategy after all the possible batches\n * of 32ETH have been staked.\n * But someone could mess with our strategy by sending some WETH to it. And we might want to deposit just\n * enough WETH to add it up to 32 so it can be staked. For that reason the check is left out.\n *\n * WETH sitting on the strategy won't interfere with the accounting since accounting only operates on ETH.\n */\n emit Deposit(_asset, address(0), _amount);\n }\n\n /// @notice Unlike other strategies, this does not deposit assets into the underlying platform.\n /// It just emits the Deposit event.\n /// To deposit WETH into validators `registerSsvValidator` and `stakeEth` must be used.\n /// Will NOT revert if the strategy is paused from an accounting failure.\n function depositAll() external override onlyVault nonReentrant {\n uint256 wethBalance = IERC20(WETH).balanceOf(address(this));\n uint256 newWeth = wethBalance - depositedWethAccountedFor;\n\n if (newWeth > 0) {\n depositedWethAccountedFor = wethBalance;\n\n _deposit(WETH, newWeth);\n }\n }\n\n /// @notice Withdraw WETH from this contract. Used only if some WETH for is lingering on the contract.\n /// That can happen when:\n /// - after mints if the strategy is the default\n /// - time between depositToStrategy and stakeEth\n /// - the deposit was not a multiple of 32 WETH\n /// - someone sent WETH directly to this contract\n /// Will NOT revert if the strategy is paused from an accounting failure.\n /// @param _recipient Address to receive withdrawn assets\n /// @param _asset WETH to withdraw\n /// @param _amount Amount of WETH to withdraw\n function withdraw(\n address _recipient,\n address _asset,\n uint256 _amount\n ) external override onlyVault nonReentrant {\n require(_asset == WETH, \"Unsupported asset\");\n _withdraw(_recipient, _asset, _amount);\n }\n\n function _withdraw(\n address _recipient,\n address _asset,\n uint256 _amount\n ) internal {\n require(_amount > 0, \"Must withdraw something\");\n require(_recipient != address(0), \"Must specify recipient\");\n\n _wethWithdrawn(_amount);\n\n IERC20(_asset).safeTransfer(_recipient, _amount);\n emit Withdrawal(_asset, address(0), _amount);\n }\n\n /// @notice transfer all WETH deposits back to the vault.\n /// This does not withdraw from the validators. That has to be done separately with the\n /// `exitSsvValidator` and `removeSsvValidator` operations.\n /// This does not withdraw any execution rewards from the FeeAccumulator or\n /// consensus rewards in this strategy.\n /// Any ETH in this strategy that was swept from a full validator withdrawal will not be withdrawn.\n /// ETH from full validator withdrawals is sent to the Vault using `doAccounting`.\n /// Will NOT revert if the strategy is paused from an accounting failure.\n function withdrawAll() external override onlyVaultOrGovernor nonReentrant {\n uint256 wethBalance = IERC20(WETH).balanceOf(address(this));\n if (wethBalance > 0) {\n _withdraw(vaultAddress, WETH, wethBalance);\n }\n }\n\n /// @notice Returns the total value of (W)ETH that is staked to the validators\n /// and WETH deposits that are still to be staked.\n /// This does not include ETH from consensus rewards sitting in this strategy\n /// or ETH from MEV rewards in the FeeAccumulator. These rewards are harvested\n /// and sent to the Dripper so will eventually be sent to the Vault as WETH.\n /// @param _asset Address of weth asset\n /// @return balance Total value of (W)ETH\n function checkBalance(address _asset)\n external\n view\n override\n returns (uint256 balance)\n {\n require(_asset == WETH, \"Unsupported asset\");\n\n balance =\n // add the ETH that has been staked in validators\n activeDepositedValidators *\n FULL_STAKE +\n // add the WETH in the strategy from deposits that are still to be staked\n IERC20(WETH).balanceOf(address(this));\n }\n\n function pause() external onlyStrategist {\n _pause();\n }\n\n /// @notice Returns bool indicating whether asset is supported by strategy.\n /// @param _asset The address of the asset token.\n function supportsAsset(address _asset) public view override returns (bool) {\n return _asset == WETH;\n }\n\n /// @notice Approves the SSV Network contract to transfer SSV tokens for deposits\n function safeApproveAllTokens() external override {\n /// @dev Approves the SSV Network contract to transfer SSV tokens for deposits\n IERC20(SSV_TOKEN).approve(SSV_NETWORK, type(uint256).max);\n }\n\n /**\n * @notice Only accept ETH from the FeeAccumulator and the WETH contract - required when\n * unwrapping WETH just before staking it to the validator\n * @dev don't want to receive donations from anyone else as this will\n * mess with the accounting of the consensus rewards and validator full withdrawals\n */\n receive() external payable {\n require(\n msg.sender == FEE_ACCUMULATOR_ADDRESS || msg.sender == WETH,\n \"Eth not from allowed contracts\"\n );\n }\n\n /***************************************\n Internal functions\n ****************************************/\n\n function _abstractSetPToken(address _asset, address) internal override {}\n\n /// @dev Convert accumulated ETH to WETH and send to the Harvester.\n /// Will revert if the strategy is paused for accounting.\n function _collectRewardTokens() internal override whenNotPaused {\n // collect ETH from execution rewards from the fee accumulator\n uint256 executionRewards = FeeAccumulator(FEE_ACCUMULATOR_ADDRESS)\n .collect();\n\n // total ETH rewards to be harvested = execution rewards + consensus rewards\n uint256 ethRewards = executionRewards + consensusRewards;\n\n require(\n address(this).balance >= ethRewards,\n \"Insufficient eth balance\"\n );\n\n if (ethRewards > 0) {\n // reset the counter keeping track of beacon chain consensus rewards\n consensusRewards = 0;\n\n // Convert ETH rewards to WETH\n IWETH9(WETH).deposit{ value: ethRewards }();\n\n IERC20(WETH).safeTransfer(harvesterAddress, ethRewards);\n emit RewardTokenCollected(harvesterAddress, WETH, ethRewards);\n }\n }\n\n /// @dev emits Withdrawal event from NativeStakingSSVStrategy\n function _wethWithdrawnToVault(uint256 _amount) internal override {\n emit Withdrawal(WETH, address(0), _amount);\n }\n\n /// @dev Called when WETH is withdrawn from the strategy or staked to a validator so\n /// the strategy knows how much WETH it has on deposit.\n /// This is so it can emit the correct amount in the Deposit event in depositAll().\n function _wethWithdrawn(uint256 _amount) internal override {\n /* In an ideal world we wouldn't need to reduce the deduction amount when the\n * depositedWethAccountedFor is smaller than the _amount.\n *\n * The reason this is required is that a malicious actor could sent WETH directly\n * to this contract and that would circumvent the increase of depositedWethAccountedFor\n * property. When the ETH would be staked the depositedWethAccountedFor amount could\n * be deducted so much that it would be negative.\n */\n uint256 deductAmount = Math.min(_amount, depositedWethAccountedFor);\n depositedWethAccountedFor -= deductAmount;\n }\n}\n"
},
"contracts/strategies/NativeStaking/ValidatorAccountant.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { ValidatorRegistrator } from \"./ValidatorRegistrator.sol\";\nimport { IWETH9 } from \"../../interfaces/IWETH9.sol\";\n\n/// @title Validator Accountant\n/// @notice Attributes the ETH swept from beacon chain validators to this strategy contract\n/// as either full or partial withdrawals. Partial withdrawals being consensus rewards.\n/// Full withdrawals are from exited validators.\n/// @author Origin Protocol Inc\nabstract contract ValidatorAccountant is ValidatorRegistrator {\n /// @notice The minimum amount of blocks that need to pass between two calls to manuallyFixAccounting\n uint256 public constant MIN_FIX_ACCOUNTING_CADENCE = 7200; // 1 day\n\n /// @notice Keeps track of the total consensus rewards swept from the beacon chain\n uint256 public consensusRewards;\n\n /// @notice start of fuse interval\n uint256 public fuseIntervalStart;\n /// @notice end of fuse interval\n uint256 public fuseIntervalEnd;\n /// @notice last block number manuallyFixAccounting has been called\n uint256 public lastFixAccountingBlockNumber;\n\n uint256[49] private __gap;\n\n event FuseIntervalUpdated(uint256 start, uint256 end);\n event AccountingFullyWithdrawnValidator(\n uint256 noOfValidators,\n uint256 remainingValidators,\n uint256 wethSentToVault\n );\n event AccountingValidatorSlashed(\n uint256 remainingValidators,\n uint256 wethSentToVault\n );\n event AccountingConsensusRewards(uint256 amount);\n\n event AccountingManuallyFixed(\n int256 validatorsDelta,\n int256 consensusRewardsDelta,\n uint256 wethToVault\n );\n\n /// @param _wethAddress Address of the Erc20 WETH Token contract\n /// @param _vaultAddress Address of the Vault\n /// @param _beaconChainDepositContract Address of the beacon chain deposit contract\n /// @param _ssvNetwork Address of the SSV Network contract\n /// @param _maxValidators Maximum number of validators that can be registered in the strategy\n constructor(\n address _wethAddress,\n address _vaultAddress,\n address _beaconChainDepositContract,\n address _ssvNetwork,\n uint256 _maxValidators\n )\n ValidatorRegistrator(\n _wethAddress,\n _vaultAddress,\n _beaconChainDepositContract,\n _ssvNetwork,\n _maxValidators\n )\n {}\n\n /// @notice set fuse interval values\n function setFuseInterval(\n uint256 _fuseIntervalStart,\n uint256 _fuseIntervalEnd\n ) external onlyGovernor {\n require(\n _fuseIntervalStart < _fuseIntervalEnd &&\n _fuseIntervalEnd < 32 ether &&\n _fuseIntervalEnd - _fuseIntervalStart >= 4 ether,\n \"Incorrect fuse interval\"\n );\n\n fuseIntervalStart = _fuseIntervalStart;\n fuseIntervalEnd = _fuseIntervalEnd;\n\n emit FuseIntervalUpdated(_fuseIntervalStart, _fuseIntervalEnd);\n }\n\n /* solhint-disable max-line-length */\n /// This notion page offers a good explanation of how the accounting functions\n /// https://www.notion.so/originprotocol/Limited-simplified-native-staking-accounting-67a217c8420d40678eb943b9da0ee77d\n /// In short, after dividing by 32, if the ETH remaining on the contract falls between 0 and fuseIntervalStart,\n /// the accounting function will treat that ETH as Beacon chain consensus rewards.\n /// On the contrary, if after dividing by 32, the ETH remaining on the contract falls between fuseIntervalEnd and 32,\n /// the accounting function will treat that as a validator slashing.\n /// @notice Perform the accounting attributing beacon chain ETH to either full or partial withdrawals. Returns true when\n /// accounting is valid and fuse isn't \"blown\". Returns false when fuse is blown.\n /// @dev This function could in theory be permission-less but lets allow only the Registrator (Defender Action) to call it\n /// for now.\n /// @return accountingValid true if accounting was successful, false if fuse is blown\n /* solhint-enable max-line-length */\n function doAccounting()\n external\n onlyRegistrator\n whenNotPaused\n nonReentrant\n returns (bool accountingValid)\n {\n // pause the accounting on failure\n accountingValid = _doAccounting(true);\n }\n\n // slither-disable-start reentrancy-eth\n function _doAccounting(bool pauseOnFail)\n internal\n returns (bool accountingValid)\n {\n if (address(this).balance < consensusRewards) {\n return _failAccounting(pauseOnFail);\n }\n\n // Calculate all the new ETH that has been swept to the contract since the last accounting\n uint256 newSweptETH = address(this).balance - consensusRewards;\n accountingValid = true;\n\n // send the ETH that is from fully withdrawn validators to the Vault\n if (newSweptETH >= FULL_STAKE) {\n uint256 fullyWithdrawnValidators;\n // explicitly cast to uint256 as we want to round to a whole number of validators\n fullyWithdrawnValidators = uint256(newSweptETH / FULL_STAKE);\n activeDepositedValidators -= fullyWithdrawnValidators;\n\n uint256 wethToVault = FULL_STAKE * fullyWithdrawnValidators;\n IWETH9(WETH).deposit{ value: wethToVault }();\n // slither-disable-next-line unchecked-transfer\n IWETH9(WETH).transfer(VAULT_ADDRESS, wethToVault);\n _wethWithdrawnToVault(wethToVault);\n\n emit AccountingFullyWithdrawnValidator(\n fullyWithdrawnValidators,\n activeDepositedValidators,\n wethToVault\n );\n }\n\n uint256 ethRemaining = address(this).balance - consensusRewards;\n // should be less than a whole validator stake\n require(ethRemaining < FULL_STAKE, \"Unexpected accounting\");\n\n // If no Beacon chain consensus rewards swept\n if (ethRemaining == 0) {\n // do nothing\n return accountingValid;\n } else if (ethRemaining < fuseIntervalStart) {\n // Beacon chain consensus rewards swept (partial validator withdrawals)\n // solhint-disable-next-line reentrancy\n consensusRewards += ethRemaining;\n emit AccountingConsensusRewards(ethRemaining);\n } else if (ethRemaining > fuseIntervalEnd) {\n // Beacon chain consensus rewards swept but also a slashed validator fully exited\n IWETH9(WETH).deposit{ value: ethRemaining }();\n // slither-disable-next-line unchecked-transfer\n IWETH9(WETH).transfer(VAULT_ADDRESS, ethRemaining);\n activeDepositedValidators -= 1;\n\n _wethWithdrawnToVault(ethRemaining);\n\n emit AccountingValidatorSlashed(\n activeDepositedValidators,\n ethRemaining\n );\n }\n // Oh no... Fuse is blown. The Strategist needs to adjust the accounting values.\n else {\n return _failAccounting(pauseOnFail);\n }\n }\n\n // slither-disable-end reentrancy-eth\n\n /// @dev pause any further accounting if required and return false\n function _failAccounting(bool pauseOnFail)\n internal\n returns (bool accountingValid)\n {\n // pause if not already\n if (pauseOnFail) {\n _pause();\n }\n // fail the accounting\n accountingValid = false;\n }\n\n /// @notice Allow the Strategist to fix the accounting of this strategy and unpause.\n /// @param _validatorsDelta adjust the active validators by up to plus three or minus three\n /// @param _consensusRewardsDelta adjust the accounted for consensus rewards up or down\n /// @param _ethToVaultAmount the amount of ETH that gets wrapped into WETH and sent to the Vault\n /// @dev There is a case when a validator(s) gets slashed so much that the eth swept from\n /// the beacon chain enters the fuse area and there are no consensus rewards on the contract\n /// to \"dip into\"/use. To increase the amount of unaccounted ETH over the fuse end interval\n /// we need to reduce the amount of active deposited validators and immediately send WETH\n /// to the vault, so it doesn't interfere with further accounting.\n function manuallyFixAccounting(\n int256 _validatorsDelta,\n int256 _consensusRewardsDelta,\n uint256 _ethToVaultAmount\n ) external onlyStrategist whenPaused nonReentrant {\n require(\n lastFixAccountingBlockNumber + MIN_FIX_ACCOUNTING_CADENCE <\n block.number,\n \"Fix accounting called too soon\"\n );\n require(\n _validatorsDelta >= -3 &&\n _validatorsDelta <= 3 &&\n // new value must be positive\n int256(activeDepositedValidators) + _validatorsDelta >= 0,\n \"Invalid validatorsDelta\"\n );\n require(\n _consensusRewardsDelta >= -332 ether &&\n _consensusRewardsDelta <= 332 ether &&\n // new value must be positive\n int256(consensusRewards) + _consensusRewardsDelta >= 0,\n \"Invalid consensusRewardsDelta\"\n );\n require(_ethToVaultAmount <= 32 ether * 3, \"Invalid wethToVaultAmount\");\n\n activeDepositedValidators = uint256(\n int256(activeDepositedValidators) + _validatorsDelta\n );\n consensusRewards = uint256(\n int256(consensusRewards) + _consensusRewardsDelta\n );\n lastFixAccountingBlockNumber = block.number;\n if (_ethToVaultAmount > 0) {\n IWETH9(WETH).deposit{ value: _ethToVaultAmount }();\n // slither-disable-next-line unchecked-transfer\n IWETH9(WETH).transfer(VAULT_ADDRESS, _ethToVaultAmount);\n _wethWithdrawnToVault(_ethToVaultAmount);\n }\n\n emit AccountingManuallyFixed(\n _validatorsDelta,\n _consensusRewardsDelta,\n _ethToVaultAmount\n );\n\n // rerun the accounting to see if it has now been fixed.\n // Do not pause the accounting on failure as it is already paused\n require(_doAccounting(false), \"Fuse still blown\");\n\n // unpause since doAccounting was successful\n _unpause();\n }\n\n /***************************************\n Abstract\n ****************************************/\n\n /// @dev allows for NativeStakingSSVStrategy contract to emit the Withdrawal event\n function _wethWithdrawnToVault(uint256 _amount) internal virtual;\n}\n"
},
"contracts/strategies/NativeStaking/ValidatorRegistrator.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { Pausable } from \"@openzeppelin/contracts/security/Pausable.sol\";\nimport { Governable } from \"../../governance/Governable.sol\";\nimport { IDepositContract } from \"../../interfaces/IDepositContract.sol\";\nimport { IVault } from \"../../interfaces/IVault.sol\";\nimport { IWETH9 } from \"../../interfaces/IWETH9.sol\";\nimport { ISSVNetwork, Cluster } from \"../../interfaces/ISSVNetwork.sol\";\n\nstruct ValidatorStakeData {\n bytes pubkey;\n bytes signature;\n bytes32 depositDataRoot;\n}\n\n/**\n * @title Registrator of the validators\n * @notice This contract implements all the required functionality to register, exit and remove validators.\n * @author Origin Protocol Inc\n */\nabstract contract ValidatorRegistrator is Governable, Pausable {\n /// @notice The maximum amount of ETH that can be staked by a validator\n /// @dev this can change in the future with EIP-7251, Increase the MAX_EFFECTIVE_BALANCE\n uint256 public constant FULL_STAKE = 32 ether;\n\n /// @notice The address of the Wrapped ETH (WETH) token contract\n address public immutable WETH;\n /// @notice The address of the beacon chain deposit contract\n address public immutable BEACON_CHAIN_DEPOSIT_CONTRACT;\n /// @notice The address of the SSV Network contract used to interface with\n address public immutable SSV_NETWORK;\n /// @notice Address of the OETH Vault proxy contract\n address public immutable VAULT_ADDRESS;\n /// @notice Maximum number of validators that can be registered in this strategy\n uint256 public immutable MAX_VALIDATORS;\n\n /// @notice Address of the registrator - allowed to register, exit and remove validators\n address public validatorRegistrator;\n /// @notice The number of validators that have 32 (!) ETH actively deposited. When a new deposit\n /// to a validator happens this number increases, when a validator exit is detected this number\n /// decreases.\n uint256 public activeDepositedValidators;\n /// @notice State of the validators keccak256(pubKey) => state\n mapping(bytes32 => VALIDATOR_STATE) public validatorsStates;\n /// @notice The account that is allowed to modify stakeETHThreshold and reset stakeETHTally\n address public stakingMonitor;\n /// @notice Amount of ETH that can be staked before staking on the contract is suspended\n /// and the `stakingMonitor` needs to approve further staking by calling `resetStakeETHTally`\n uint256 public stakeETHThreshold;\n /// @notice Amount of ETH that has been staked since the `stakingMonitor` last called `resetStakeETHTally`.\n /// This can not go above `stakeETHThreshold`.\n uint256 public stakeETHTally;\n // For future use\n uint256[47] private __gap;\n\n enum VALIDATOR_STATE {\n NON_REGISTERED, // validator is not registered on the SSV network\n REGISTERED, // validator is registered on the SSV network\n STAKED, // validator has funds staked\n EXITING, // exit message has been posted and validator is in the process of exiting\n EXIT_COMPLETE // validator has funds withdrawn to the EigenPod and is removed from the SSV\n }\n\n event RegistratorChanged(address indexed newAddress);\n event StakingMonitorChanged(address indexed newAddress);\n event ETHStaked(bytes32 indexed pubKeyHash, bytes pubKey, uint256 amount);\n event SSVValidatorRegistered(\n bytes32 indexed pubKeyHash,\n bytes pubKey,\n uint64[] operatorIds\n );\n event SSVValidatorExitInitiated(\n bytes32 indexed pubKeyHash,\n bytes pubKey,\n uint64[] operatorIds\n );\n event SSVValidatorExitCompleted(\n bytes32 indexed pubKeyHash,\n bytes pubKey,\n uint64[] operatorIds\n );\n event StakeETHThresholdChanged(uint256 amount);\n event StakeETHTallyReset();\n\n /// @dev Throws if called by any account other than the Registrator\n modifier onlyRegistrator() {\n require(\n msg.sender == validatorRegistrator,\n \"Caller is not the Registrator\"\n );\n _;\n }\n\n /// @dev Throws if called by any account other than the Staking monitor\n modifier onlyStakingMonitor() {\n require(msg.sender == stakingMonitor, \"Caller is not the Monitor\");\n _;\n }\n\n /// @dev Throws if called by any account other than the Strategist\n modifier onlyStrategist() {\n require(\n msg.sender == IVault(VAULT_ADDRESS).strategistAddr(),\n \"Caller is not the Strategist\"\n );\n _;\n }\n\n /// @param _wethAddress Address of the Erc20 WETH Token contract\n /// @param _vaultAddress Address of the Vault\n /// @param _beaconChainDepositContract Address of the beacon chain deposit contract\n /// @param _ssvNetwork Address of the SSV Network contract\n /// @param _maxValidators Maximum number of validators that can be registered in the strategy\n constructor(\n address _wethAddress,\n address _vaultAddress,\n address _beaconChainDepositContract,\n address _ssvNetwork,\n uint256 _maxValidators\n ) {\n WETH = _wethAddress;\n BEACON_CHAIN_DEPOSIT_CONTRACT = _beaconChainDepositContract;\n SSV_NETWORK = _ssvNetwork;\n VAULT_ADDRESS = _vaultAddress;\n MAX_VALIDATORS = _maxValidators;\n }\n\n /// @notice Set the address of the registrator which can register, exit and remove validators\n function setRegistrator(address _address) external onlyGovernor {\n validatorRegistrator = _address;\n emit RegistratorChanged(_address);\n }\n\n /// @notice Set the address of the staking monitor that is allowed to reset stakeETHTally\n function setStakingMonitor(address _address) external onlyGovernor {\n stakingMonitor = _address;\n emit StakingMonitorChanged(_address);\n }\n\n /// @notice Set the amount of ETH that can be staked before staking monitor\n // needs to a approve further staking by resetting the stake ETH tally\n function setStakeETHThreshold(uint256 _amount) external onlyGovernor {\n stakeETHThreshold = _amount;\n emit StakeETHThresholdChanged(_amount);\n }\n\n /// @notice Reset the stakeETHTally\n function resetStakeETHTally() external onlyStakingMonitor {\n stakeETHTally = 0;\n emit StakeETHTallyReset();\n }\n\n /// @notice Stakes WETH to the node validators\n /// @param validators A list of validator data needed to stake.\n /// The `ValidatorStakeData` struct contains the pubkey, signature and depositDataRoot.\n /// Only the registrator can call this function.\n // slither-disable-start reentrancy-eth\n function stakeEth(ValidatorStakeData[] calldata validators)\n external\n onlyRegistrator\n whenNotPaused\n nonReentrant\n {\n uint256 requiredETH = validators.length * FULL_STAKE;\n\n // Check there is enough WETH from the deposits sitting in this strategy contract\n require(\n requiredETH <= IWETH9(WETH).balanceOf(address(this)),\n \"Insufficient WETH\"\n );\n require(\n activeDepositedValidators + validators.length <= MAX_VALIDATORS,\n \"Max validators reached\"\n );\n\n require(\n stakeETHTally + requiredETH <= stakeETHThreshold,\n \"Staking ETH over threshold\"\n );\n stakeETHTally += requiredETH;\n\n // Convert required ETH from WETH\n IWETH9(WETH).withdraw(requiredETH);\n _wethWithdrawn(requiredETH);\n\n /* 0x01 to indicate that withdrawal credentials will contain an EOA address that the sweeping function\n * can sweep funds to.\n * bytes11(0) to fill up the required zeros\n * remaining bytes20 are for the address\n */\n bytes memory withdrawalCredentials = abi.encodePacked(\n bytes1(0x01),\n bytes11(0),\n address(this)\n );\n\n // For each validator\n for (uint256 i = 0; i < validators.length; ++i) {\n bytes32 pubKeyHash = keccak256(validators[i].pubkey);\n\n require(\n validatorsStates[pubKeyHash] == VALIDATOR_STATE.REGISTERED,\n \"Validator not registered\"\n );\n\n IDepositContract(BEACON_CHAIN_DEPOSIT_CONTRACT).deposit{\n value: FULL_STAKE\n }(\n validators[i].pubkey,\n withdrawalCredentials,\n validators[i].signature,\n validators[i].depositDataRoot\n );\n\n validatorsStates[pubKeyHash] = VALIDATOR_STATE.STAKED;\n\n emit ETHStaked(pubKeyHash, validators[i].pubkey, FULL_STAKE);\n }\n // save gas by changing this storage variable only once rather each time in the loop.\n activeDepositedValidators += validators.length;\n }\n\n // slither-disable-end reentrancy-eth\n\n /// @notice Registers a new validator in the SSV Cluster.\n /// Only the registrator can call this function.\n /// @param publicKeys The public keys of the validators\n /// @param operatorIds The operator IDs of the SSV Cluster\n /// @param sharesData The shares data for each validator\n /// @param ssvAmount The amount of SSV tokens to be deposited to the SSV cluster\n /// @param cluster The SSV cluster details including the validator count and SSV balance\n // slither-disable-start reentrancy-no-eth\n function registerSsvValidators(\n bytes[] calldata publicKeys,\n uint64[] calldata operatorIds,\n bytes[] calldata sharesData,\n uint256 ssvAmount,\n Cluster calldata cluster\n ) external onlyRegistrator whenNotPaused {\n require(\n publicKeys.length == sharesData.length,\n \"Pubkey sharesData mismatch\"\n );\n // Check each public key has not already been used\n bytes32 pubKeyHash;\n VALIDATOR_STATE currentState;\n for (uint256 i = 0; i < publicKeys.length; ++i) {\n pubKeyHash = keccak256(publicKeys[i]);\n currentState = validatorsStates[pubKeyHash];\n require(\n currentState == VALIDATOR_STATE.NON_REGISTERED,\n \"Validator already registered\"\n );\n\n validatorsStates[pubKeyHash] = VALIDATOR_STATE.REGISTERED;\n\n emit SSVValidatorRegistered(pubKeyHash, publicKeys[i], operatorIds);\n }\n\n ISSVNetwork(SSV_NETWORK).bulkRegisterValidator(\n publicKeys,\n operatorIds,\n sharesData,\n ssvAmount,\n cluster\n );\n }\n\n // slither-disable-end reentrancy-no-eth\n\n /// @notice Exit a validator from the Beacon chain.\n /// The staked ETH will eventually swept to this native staking strategy.\n /// Only the registrator can call this function.\n /// @param publicKey The public key of the validator\n /// @param operatorIds The operator IDs of the SSV Cluster\n // slither-disable-start reentrancy-no-eth\n function exitSsvValidator(\n bytes calldata publicKey,\n uint64[] calldata operatorIds\n ) external onlyRegistrator whenNotPaused {\n bytes32 pubKeyHash = keccak256(publicKey);\n VALIDATOR_STATE currentState = validatorsStates[pubKeyHash];\n require(currentState == VALIDATOR_STATE.STAKED, \"Validator not staked\");\n\n ISSVNetwork(SSV_NETWORK).exitValidator(publicKey, operatorIds);\n\n validatorsStates[pubKeyHash] = VALIDATOR_STATE.EXITING;\n\n emit SSVValidatorExitInitiated(pubKeyHash, publicKey, operatorIds);\n }\n\n // slither-disable-end reentrancy-no-eth\n\n /// @notice Remove a validator from the SSV Cluster.\n /// Make sure `exitSsvValidator` is called before and the validate has exited the Beacon chain.\n /// If removed before the validator has exited the beacon chain will result in the validator being slashed.\n /// Only the registrator can call this function.\n /// @param publicKey The public key of the validator\n /// @param operatorIds The operator IDs of the SSV Cluster\n /// @param cluster The SSV cluster details including the validator count and SSV balance\n // slither-disable-start reentrancy-no-eth\n function removeSsvValidator(\n bytes calldata publicKey,\n uint64[] calldata operatorIds,\n Cluster calldata cluster\n ) external onlyRegistrator whenNotPaused {\n bytes32 pubKeyHash = keccak256(publicKey);\n VALIDATOR_STATE currentState = validatorsStates[pubKeyHash];\n // Can remove SSV validators that were incorrectly registered and can not be deposited to.\n require(\n currentState == VALIDATOR_STATE.EXITING ||\n currentState == VALIDATOR_STATE.REGISTERED,\n \"Validator not regd or exiting\"\n );\n\n ISSVNetwork(SSV_NETWORK).removeValidator(\n publicKey,\n operatorIds,\n cluster\n );\n\n validatorsStates[pubKeyHash] = VALIDATOR_STATE.EXIT_COMPLETE;\n\n emit SSVValidatorExitCompleted(pubKeyHash, publicKey, operatorIds);\n }\n\n // slither-disable-end reentrancy-no-eth\n\n /// @notice Deposits more SSV Tokens to the SSV Network contract which is used to pay the SSV Operators.\n /// @dev A SSV cluster is defined by the SSVOwnerAddress and the set of operatorIds.\n /// uses \"onlyStrategist\" modifier so continuous front-running can't DOS our maintenance service\n /// that tries to top up SSV tokens.\n /// @param operatorIds The operator IDs of the SSV Cluster\n /// @param ssvAmount The amount of SSV tokens to be deposited to the SSV cluster\n /// @param cluster The SSV cluster details including the validator count and SSV balance\n function depositSSV(\n uint64[] memory operatorIds,\n uint256 ssvAmount,\n Cluster memory cluster\n ) external onlyStrategist {\n ISSVNetwork(SSV_NETWORK).deposit(\n address(this),\n operatorIds,\n ssvAmount,\n cluster\n );\n }\n\n /***************************************\n Abstract\n ****************************************/\n\n /// @dev Called when WETH is withdrawn from the strategy or staked to a validator so\n /// the strategy knows how much WETH it has on deposit.\n /// This is so it can emit the correct amount in the Deposit event in depositAll().\n function _wethWithdrawn(uint256 _amount) internal virtual;\n}\n"
},
"contracts/token/OUSD.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/**\n * @title OUSD Token Contract\n * @dev ERC20 compatible contract for OUSD\n * @dev Implements an elastic supply\n * @author Origin Protocol Inc\n */\nimport { SafeMath } from \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\nimport { Initializable } from \"../utils/Initializable.sol\";\nimport { InitializableERC20Detailed } from \"../utils/InitializableERC20Detailed.sol\";\nimport { StableMath } from \"../utils/StableMath.sol\";\nimport { Governable } from \"../governance/Governable.sol\";\n\n/**\n * NOTE that this is an ERC20 token but the invariant that the sum of\n * balanceOf(x) for all x is not >= totalSupply(). This is a consequence of the\n * rebasing design. Any integrations with OUSD should be aware.\n */\n\ncontract OUSD is Initializable, InitializableERC20Detailed, Governable {\n using SafeMath for uint256;\n using StableMath for uint256;\n\n event TotalSupplyUpdatedHighres(\n uint256 totalSupply,\n uint256 rebasingCredits,\n uint256 rebasingCreditsPerToken\n );\n event AccountRebasingEnabled(address account);\n event AccountRebasingDisabled(address account);\n\n enum RebaseOptions {\n NotSet,\n OptOut,\n OptIn\n }\n\n uint256 private constant MAX_SUPPLY = ~uint128(0); // (2^128) - 1\n uint256 public _totalSupply;\n mapping(address => mapping(address => uint256)) private _allowances;\n address public vaultAddress = address(0);\n mapping(address => uint256) private _creditBalances;\n uint256 private _rebasingCredits;\n uint256 private _rebasingCreditsPerToken;\n // Frozen address/credits are non rebasing (value is held in contracts which\n // do not receive yield unless they explicitly opt in)\n uint256 public nonRebasingSupply;\n mapping(address => uint256) public nonRebasingCreditsPerToken;\n mapping(address => RebaseOptions) public rebaseState;\n mapping(address => uint256) public isUpgraded;\n\n uint256 private constant RESOLUTION_INCREASE = 1e9;\n\n function initialize(\n string calldata _nameArg,\n string calldata _symbolArg,\n address _vaultAddress,\n uint256 _initialCreditsPerToken\n ) external onlyGovernor initializer {\n InitializableERC20Detailed._initialize(_nameArg, _symbolArg, 18);\n _rebasingCreditsPerToken = _initialCreditsPerToken;\n vaultAddress = _vaultAddress;\n }\n\n /**\n * @dev Verifies that the caller is the Vault contract\n */\n modifier onlyVault() {\n require(vaultAddress == msg.sender, \"Caller is not the Vault\");\n _;\n }\n\n /**\n * @return The total supply of OUSD.\n */\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @return Low resolution rebasingCreditsPerToken\n */\n function rebasingCreditsPerToken() public view returns (uint256) {\n return _rebasingCreditsPerToken / RESOLUTION_INCREASE;\n }\n\n /**\n * @return Low resolution total number of rebasing credits\n */\n function rebasingCredits() public view returns (uint256) {\n return _rebasingCredits / RESOLUTION_INCREASE;\n }\n\n /**\n * @return High resolution rebasingCreditsPerToken\n */\n function rebasingCreditsPerTokenHighres() public view returns (uint256) {\n return _rebasingCreditsPerToken;\n }\n\n /**\n * @return High resolution total number of rebasing credits\n */\n function rebasingCreditsHighres() public view returns (uint256) {\n return _rebasingCredits;\n }\n\n /**\n * @dev Gets the balance of the specified address.\n * @param _account Address to query the balance of.\n * @return A uint256 representing the amount of base units owned by the\n * specified address.\n */\n function balanceOf(address _account)\n public\n view\n override\n returns (uint256)\n {\n if (_creditBalances[_account] == 0) return 0;\n return\n _creditBalances[_account].divPrecisely(_creditsPerToken(_account));\n }\n\n /**\n * @dev Gets the credits balance of the specified address.\n * @dev Backwards compatible with old low res credits per token.\n * @param _account The address to query the balance of.\n * @return (uint256, uint256) Credit balance and credits per token of the\n * address\n */\n function creditsBalanceOf(address _account)\n public\n view\n returns (uint256, uint256)\n {\n uint256 cpt = _creditsPerToken(_account);\n if (cpt == 1e27) {\n // For a period before the resolution upgrade, we created all new\n // contract accounts at high resolution. Since they are not changing\n // as a result of this upgrade, we will return their true values\n return (_creditBalances[_account], cpt);\n } else {\n return (\n _creditBalances[_account] / RESOLUTION_INCREASE,\n cpt / RESOLUTION_INCREASE\n );\n }\n }\n\n /**\n * @dev Gets the credits balance of the specified address.\n * @param _account The address to query the balance of.\n * @return (uint256, uint256, bool) Credit balance, credits per token of the\n * address, and isUpgraded\n */\n function creditsBalanceOfHighres(address _account)\n public\n view\n returns (\n uint256,\n uint256,\n bool\n )\n {\n return (\n _creditBalances[_account],\n _creditsPerToken(_account),\n isUpgraded[_account] == 1\n );\n }\n\n /**\n * @dev Transfer tokens to a specified address.\n * @param _to the address to transfer to.\n * @param _value the amount to be transferred.\n * @return true on success.\n */\n function transfer(address _to, uint256 _value)\n public\n override\n returns (bool)\n {\n require(_to != address(0), \"Transfer to zero address\");\n require(\n _value <= balanceOf(msg.sender),\n \"Transfer greater than balance\"\n );\n\n _executeTransfer(msg.sender, _to, _value);\n\n emit Transfer(msg.sender, _to, _value);\n\n return true;\n }\n\n /**\n * @dev Transfer tokens from one address to another.\n * @param _from The address you want to send tokens from.\n * @param _to The address you want to transfer to.\n * @param _value The amount of tokens to be transferred.\n */\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) public override returns (bool) {\n require(_to != address(0), \"Transfer to zero address\");\n require(_value <= balanceOf(_from), \"Transfer greater than balance\");\n\n _allowances[_from][msg.sender] = _allowances[_from][msg.sender].sub(\n _value\n );\n\n _executeTransfer(_from, _to, _value);\n\n emit Transfer(_from, _to, _value);\n\n return true;\n }\n\n /**\n * @dev Update the count of non rebasing credits in response to a transfer\n * @param _from The address you want to send tokens from.\n * @param _to The address you want to transfer to.\n * @param _value Amount of OUSD to transfer\n */\n function _executeTransfer(\n address _from,\n address _to,\n uint256 _value\n ) internal {\n bool isNonRebasingTo = _isNonRebasingAccount(_to);\n bool isNonRebasingFrom = _isNonRebasingAccount(_from);\n\n // Credits deducted and credited might be different due to the\n // differing creditsPerToken used by each account\n uint256 creditsCredited = _value.mulTruncate(_creditsPerToken(_to));\n uint256 creditsDeducted = _value.mulTruncate(_creditsPerToken(_from));\n\n _creditBalances[_from] = _creditBalances[_from].sub(\n creditsDeducted,\n \"Transfer amount exceeds balance\"\n );\n _creditBalances[_to] = _creditBalances[_to].add(creditsCredited);\n\n if (isNonRebasingTo && !isNonRebasingFrom) {\n // Transfer to non-rebasing account from rebasing account, credits\n // are removed from the non rebasing tally\n nonRebasingSupply = nonRebasingSupply.add(_value);\n // Update rebasingCredits by subtracting the deducted amount\n _rebasingCredits = _rebasingCredits.sub(creditsDeducted);\n } else if (!isNonRebasingTo && isNonRebasingFrom) {\n // Transfer to rebasing account from non-rebasing account\n // Decreasing non-rebasing credits by the amount that was sent\n nonRebasingSupply = nonRebasingSupply.sub(_value);\n // Update rebasingCredits by adding the credited amount\n _rebasingCredits = _rebasingCredits.add(creditsCredited);\n }\n }\n\n /**\n * @dev Function to check the amount of tokens that _owner has allowed to\n * `_spender`.\n * @param _owner The address which owns the funds.\n * @param _spender The address which will spend the funds.\n * @return The number of tokens still available for the _spender.\n */\n function allowance(address _owner, address _spender)\n public\n view\n override\n returns (uint256)\n {\n return _allowances[_owner][_spender];\n }\n\n /**\n * @dev Approve the passed address to spend the specified amount of tokens\n * on behalf of msg.sender. This method is included for ERC20\n * compatibility. `increaseAllowance` and `decreaseAllowance` should be\n * used instead.\n *\n * Changing an allowance with this method brings the risk that someone\n * may transfer both the old and the new allowance - if they are both\n * greater than zero - if a transfer transaction is mined before the\n * later approve() call is mined.\n * @param _spender The address which will spend the funds.\n * @param _value The amount of tokens to be spent.\n */\n function approve(address _spender, uint256 _value)\n public\n override\n returns (bool)\n {\n _allowances[msg.sender][_spender] = _value;\n emit Approval(msg.sender, _spender, _value);\n return true;\n }\n\n /**\n * @dev Increase the amount of tokens that an owner has allowed to\n * `_spender`.\n * This method should be used instead of approve() to avoid the double\n * approval vulnerability described above.\n * @param _spender The address which will spend the funds.\n * @param _addedValue The amount of tokens to increase the allowance by.\n */\n function increaseAllowance(address _spender, uint256 _addedValue)\n public\n returns (bool)\n {\n _allowances[msg.sender][_spender] = _allowances[msg.sender][_spender]\n .add(_addedValue);\n emit Approval(msg.sender, _spender, _allowances[msg.sender][_spender]);\n return true;\n }\n\n /**\n * @dev Decrease the amount of tokens that an owner has allowed to\n `_spender`.\n * @param _spender The address which will spend the funds.\n * @param _subtractedValue The amount of tokens to decrease the allowance\n * by.\n */\n function decreaseAllowance(address _spender, uint256 _subtractedValue)\n public\n returns (bool)\n {\n uint256 oldValue = _allowances[msg.sender][_spender];\n if (_subtractedValue >= oldValue) {\n _allowances[msg.sender][_spender] = 0;\n } else {\n _allowances[msg.sender][_spender] = oldValue.sub(_subtractedValue);\n }\n emit Approval(msg.sender, _spender, _allowances[msg.sender][_spender]);\n return true;\n }\n\n /**\n * @dev Mints new tokens, increasing totalSupply.\n */\n function mint(address _account, uint256 _amount) external onlyVault {\n _mint(_account, _amount);\n }\n\n /**\n * @dev Creates `_amount` tokens and assigns them to `_account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements\n *\n * - `to` cannot be the zero address.\n */\n function _mint(address _account, uint256 _amount) internal nonReentrant {\n require(_account != address(0), \"Mint to the zero address\");\n\n bool isNonRebasingAccount = _isNonRebasingAccount(_account);\n\n uint256 creditAmount = _amount.mulTruncate(_creditsPerToken(_account));\n _creditBalances[_account] = _creditBalances[_account].add(creditAmount);\n\n // If the account is non rebasing and doesn't have a set creditsPerToken\n // then set it i.e. this is a mint from a fresh contract\n if (isNonRebasingAccount) {\n nonRebasingSupply = nonRebasingSupply.add(_amount);\n } else {\n _rebasingCredits = _rebasingCredits.add(creditAmount);\n }\n\n _totalSupply = _totalSupply.add(_amount);\n\n require(_totalSupply < MAX_SUPPLY, \"Max supply\");\n\n emit Transfer(address(0), _account, _amount);\n }\n\n /**\n * @dev Burns tokens, decreasing totalSupply.\n */\n function burn(address account, uint256 amount) external onlyVault {\n _burn(account, amount);\n }\n\n /**\n * @dev Destroys `_amount` tokens from `_account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements\n *\n * - `_account` cannot be the zero address.\n * - `_account` must have at least `_amount` tokens.\n */\n function _burn(address _account, uint256 _amount) internal nonReentrant {\n require(_account != address(0), \"Burn from the zero address\");\n if (_amount == 0) {\n return;\n }\n\n bool isNonRebasingAccount = _isNonRebasingAccount(_account);\n uint256 creditAmount = _amount.mulTruncate(_creditsPerToken(_account));\n uint256 currentCredits = _creditBalances[_account];\n\n // Remove the credits, burning rounding errors\n if (\n currentCredits == creditAmount || currentCredits - 1 == creditAmount\n ) {\n // Handle dust from rounding\n _creditBalances[_account] = 0;\n } else if (currentCredits > creditAmount) {\n _creditBalances[_account] = _creditBalances[_account].sub(\n creditAmount\n );\n } else {\n revert(\"Remove exceeds balance\");\n }\n\n // Remove from the credit tallies and non-rebasing supply\n if (isNonRebasingAccount) {\n nonRebasingSupply = nonRebasingSupply.sub(_amount);\n } else {\n _rebasingCredits = _rebasingCredits.sub(creditAmount);\n }\n\n _totalSupply = _totalSupply.sub(_amount);\n\n emit Transfer(_account, address(0), _amount);\n }\n\n /**\n * @dev Get the credits per token for an account. Returns a fixed amount\n * if the account is non-rebasing.\n * @param _account Address of the account.\n */\n function _creditsPerToken(address _account)\n internal\n view\n returns (uint256)\n {\n if (nonRebasingCreditsPerToken[_account] != 0) {\n return nonRebasingCreditsPerToken[_account];\n } else {\n return _rebasingCreditsPerToken;\n }\n }\n\n /**\n * @dev Is an account using rebasing accounting or non-rebasing accounting?\n * Also, ensure contracts are non-rebasing if they have not opted in.\n * @param _account Address of the account.\n */\n function _isNonRebasingAccount(address _account) internal returns (bool) {\n bool isContract = Address.isContract(_account);\n if (isContract && rebaseState[_account] == RebaseOptions.NotSet) {\n _ensureRebasingMigration(_account);\n }\n return nonRebasingCreditsPerToken[_account] > 0;\n }\n\n /**\n * @dev Ensures internal account for rebasing and non-rebasing credits and\n * supply is updated following deployment of frozen yield change.\n */\n function _ensureRebasingMigration(address _account) internal {\n if (nonRebasingCreditsPerToken[_account] == 0) {\n emit AccountRebasingDisabled(_account);\n if (_creditBalances[_account] == 0) {\n // Since there is no existing balance, we can directly set to\n // high resolution, and do not have to do any other bookkeeping\n nonRebasingCreditsPerToken[_account] = 1e27;\n } else {\n // Migrate an existing account:\n\n // Set fixed credits per token for this account\n nonRebasingCreditsPerToken[_account] = _rebasingCreditsPerToken;\n // Update non rebasing supply\n nonRebasingSupply = nonRebasingSupply.add(balanceOf(_account));\n // Update credit tallies\n _rebasingCredits = _rebasingCredits.sub(\n _creditBalances[_account]\n );\n }\n }\n }\n\n /**\n * @notice Enable rebasing for an account.\n * @dev Add a contract address to the non-rebasing exception list. The\n * address's balance will be part of rebases and the account will be exposed\n * to upside and downside.\n * @param _account Address of the account.\n */\n function governanceRebaseOptIn(address _account)\n public\n nonReentrant\n onlyGovernor\n {\n _rebaseOptIn(_account);\n }\n\n /**\n * @dev Add a contract address to the non-rebasing exception list. The\n * address's balance will be part of rebases and the account will be exposed\n * to upside and downside.\n */\n function rebaseOptIn() public nonReentrant {\n _rebaseOptIn(msg.sender);\n }\n\n function _rebaseOptIn(address _account) internal {\n require(_isNonRebasingAccount(_account), \"Account has not opted out\");\n\n // Convert balance into the same amount at the current exchange rate\n uint256 newCreditBalance = _creditBalances[_account]\n .mul(_rebasingCreditsPerToken)\n .div(_creditsPerToken(_account));\n\n // Decreasing non rebasing supply\n nonRebasingSupply = nonRebasingSupply.sub(balanceOf(_account));\n\n _creditBalances[_account] = newCreditBalance;\n\n // Increase rebasing credits, totalSupply remains unchanged so no\n // adjustment necessary\n _rebasingCredits = _rebasingCredits.add(_creditBalances[_account]);\n\n rebaseState[_account] = RebaseOptions.OptIn;\n\n // Delete any fixed credits per token\n delete nonRebasingCreditsPerToken[_account];\n emit AccountRebasingEnabled(_account);\n }\n\n /**\n * @dev Explicitly mark that an address is non-rebasing.\n */\n function rebaseOptOut() public nonReentrant {\n require(!_isNonRebasingAccount(msg.sender), \"Account has not opted in\");\n\n // Increase non rebasing supply\n nonRebasingSupply = nonRebasingSupply.add(balanceOf(msg.sender));\n // Set fixed credits per token\n nonRebasingCreditsPerToken[msg.sender] = _rebasingCreditsPerToken;\n\n // Decrease rebasing credits, total supply remains unchanged so no\n // adjustment necessary\n _rebasingCredits = _rebasingCredits.sub(_creditBalances[msg.sender]);\n\n // Mark explicitly opted out of rebasing\n rebaseState[msg.sender] = RebaseOptions.OptOut;\n emit AccountRebasingDisabled(msg.sender);\n }\n\n /**\n * @dev Modify the supply without minting new tokens. This uses a change in\n * the exchange rate between \"credits\" and OUSD tokens to change balances.\n * @param _newTotalSupply New total supply of OUSD.\n */\n function changeSupply(uint256 _newTotalSupply)\n external\n onlyVault\n nonReentrant\n {\n require(_totalSupply > 0, \"Cannot increase 0 supply\");\n\n if (_totalSupply == _newTotalSupply) {\n emit TotalSupplyUpdatedHighres(\n _totalSupply,\n _rebasingCredits,\n _rebasingCreditsPerToken\n );\n return;\n }\n\n _totalSupply = _newTotalSupply > MAX_SUPPLY\n ? MAX_SUPPLY\n : _newTotalSupply;\n\n _rebasingCreditsPerToken = _rebasingCredits.divPrecisely(\n _totalSupply.sub(nonRebasingSupply)\n );\n\n require(_rebasingCreditsPerToken > 0, \"Invalid change in supply\");\n\n _totalSupply = _rebasingCredits\n .divPrecisely(_rebasingCreditsPerToken)\n .add(nonRebasingSupply);\n\n emit TotalSupplyUpdatedHighres(\n _totalSupply,\n _rebasingCredits,\n _rebasingCreditsPerToken\n );\n }\n}\n"
},
"contracts/utils/Helpers.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { IBasicToken } from \"../interfaces/IBasicToken.sol\";\n\nlibrary Helpers {\n /**\n * @notice Fetch the `symbol()` from an ERC20 token\n * @dev Grabs the `symbol()` from a contract\n * @param _token Address of the ERC20 token\n * @return string Symbol of the ERC20 token\n */\n function getSymbol(address _token) internal view returns (string memory) {\n string memory symbol = IBasicToken(_token).symbol();\n return symbol;\n }\n\n /**\n * @notice Fetch the `decimals()` from an ERC20 token\n * @dev Grabs the `decimals()` from a contract and fails if\n * the decimal value does not live within a certain range\n * @param _token Address of the ERC20 token\n * @return uint256 Decimals of the ERC20 token\n */\n function getDecimals(address _token) internal view returns (uint256) {\n uint256 decimals = IBasicToken(_token).decimals();\n require(\n decimals >= 4 && decimals <= 18,\n \"Token must have sufficient decimal places\"\n );\n\n return decimals;\n }\n}\n"
},
"contracts/utils/Initializable.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/**\n * @title Base contract any contracts that need to initialize state after deployment.\n * @author Origin Protocol Inc\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n require(\n initializing || !initialized,\n \"Initializable: contract is already initialized\"\n );\n\n bool isTopLevelCall = !initializing;\n if (isTopLevelCall) {\n initializing = true;\n initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n initializing = false;\n }\n }\n\n uint256[50] private ______gap;\n}\n"
},
"contracts/utils/InitializableAbstractStrategy.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/**\n * @title Base contract for vault strategies.\n * @author Origin Protocol Inc\n */\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\nimport { Initializable } from \"../utils/Initializable.sol\";\nimport { Governable } from \"../governance/Governable.sol\";\nimport { IVault } from \"../interfaces/IVault.sol\";\n\nabstract contract InitializableAbstractStrategy is Initializable, Governable {\n using SafeERC20 for IERC20;\n\n event PTokenAdded(address indexed _asset, address _pToken);\n event PTokenRemoved(address indexed _asset, address _pToken);\n event Deposit(address indexed _asset, address _pToken, uint256 _amount);\n event Withdrawal(address indexed _asset, address _pToken, uint256 _amount);\n event RewardTokenCollected(\n address recipient,\n address rewardToken,\n uint256 amount\n );\n event RewardTokenAddressesUpdated(\n address[] _oldAddresses,\n address[] _newAddresses\n );\n event HarvesterAddressesUpdated(\n address _oldHarvesterAddress,\n address _newHarvesterAddress\n );\n\n /// @notice Address of the underlying platform\n address public immutable platformAddress;\n /// @notice Address of the OToken vault\n address public immutable vaultAddress;\n\n /// @dev Replaced with an immutable variable\n // slither-disable-next-line constable-states\n address private _deprecated_platformAddress;\n\n /// @dev Replaced with an immutable\n // slither-disable-next-line constable-states\n address private _deprecated_vaultAddress;\n\n /// @notice asset => pToken (Platform Specific Token Address)\n mapping(address => address) public assetToPToken;\n\n /// @notice Full list of all assets supported by the strategy\n address[] internal assetsMapped;\n\n // Deprecated: Reward token address\n // slither-disable-next-line constable-states\n address private _deprecated_rewardTokenAddress;\n\n // Deprecated: now resides in Harvester's rewardTokenConfigs\n // slither-disable-next-line constable-states\n uint256 private _deprecated_rewardLiquidationThreshold;\n\n /// @notice Address of the Harvester contract allowed to collect reward tokens\n address public harvesterAddress;\n\n /// @notice Address of the reward tokens. eg CRV, BAL, CVX, AURA\n address[] public rewardTokenAddresses;\n\n /* Reserved for future expansion. Used to be 100 storage slots\n * and has decreased to accommodate:\n * - harvesterAddress\n * - rewardTokenAddresses\n */\n int256[98] private _reserved;\n\n struct BaseStrategyConfig {\n address platformAddress; // Address of the underlying platform\n address vaultAddress; // Address of the OToken's Vault\n }\n\n /**\n * @param _config The platform and OToken vault addresses\n */\n constructor(BaseStrategyConfig memory _config) {\n platformAddress = _config.platformAddress;\n vaultAddress = _config.vaultAddress;\n }\n\n /**\n * @dev Internal initialize function, to set up initial internal state\n * @param _rewardTokenAddresses Address of reward token for platform\n * @param _assets Addresses of initial supported assets\n * @param _pTokens Platform Token corresponding addresses\n */\n function _initialize(\n address[] memory _rewardTokenAddresses,\n address[] memory _assets,\n address[] memory _pTokens\n ) internal {\n rewardTokenAddresses = _rewardTokenAddresses;\n\n uint256 assetCount = _assets.length;\n require(assetCount == _pTokens.length, \"Invalid input arrays\");\n for (uint256 i = 0; i < assetCount; ++i) {\n _setPTokenAddress(_assets[i], _pTokens[i]);\n }\n }\n\n /**\n * @notice Collect accumulated reward token and send to Vault.\n */\n function collectRewardTokens() external virtual onlyHarvester nonReentrant {\n _collectRewardTokens();\n }\n\n /**\n * @dev Default implementation that transfers reward tokens to the Harvester\n * Implementing strategies need to add custom logic to collect the rewards.\n */\n function _collectRewardTokens() internal virtual {\n uint256 rewardTokenCount = rewardTokenAddresses.length;\n for (uint256 i = 0; i < rewardTokenCount; ++i) {\n IERC20 rewardToken = IERC20(rewardTokenAddresses[i]);\n uint256 balance = rewardToken.balanceOf(address(this));\n if (balance > 0) {\n emit RewardTokenCollected(\n harvesterAddress,\n address(rewardToken),\n balance\n );\n rewardToken.safeTransfer(harvesterAddress, balance);\n }\n }\n }\n\n /**\n * @dev Verifies that the caller is the Vault.\n */\n modifier onlyVault() {\n require(msg.sender == vaultAddress, \"Caller is not the Vault\");\n _;\n }\n\n /**\n * @dev Verifies that the caller is the Harvester.\n */\n modifier onlyHarvester() {\n require(msg.sender == harvesterAddress, \"Caller is not the Harvester\");\n _;\n }\n\n /**\n * @dev Verifies that the caller is the Vault or Governor.\n */\n modifier onlyVaultOrGovernor() {\n require(\n msg.sender == vaultAddress || msg.sender == governor(),\n \"Caller is not the Vault or Governor\"\n );\n _;\n }\n\n /**\n * @dev Verifies that the caller is the Vault, Governor, or Strategist.\n */\n modifier onlyVaultOrGovernorOrStrategist() {\n require(\n msg.sender == vaultAddress ||\n msg.sender == governor() ||\n msg.sender == IVault(vaultAddress).strategistAddr(),\n \"Caller is not the Vault, Governor, or Strategist\"\n );\n _;\n }\n\n /**\n * @notice Set the reward token addresses. Any old addresses will be overwritten.\n * @param _rewardTokenAddresses Array of reward token addresses\n */\n function setRewardTokenAddresses(address[] calldata _rewardTokenAddresses)\n external\n onlyGovernor\n {\n uint256 rewardTokenCount = _rewardTokenAddresses.length;\n for (uint256 i = 0; i < rewardTokenCount; ++i) {\n require(\n _rewardTokenAddresses[i] != address(0),\n \"Can not set an empty address as a reward token\"\n );\n }\n\n emit RewardTokenAddressesUpdated(\n rewardTokenAddresses,\n _rewardTokenAddresses\n );\n rewardTokenAddresses = _rewardTokenAddresses;\n }\n\n /**\n * @notice Get the reward token addresses.\n * @return address[] the reward token addresses.\n */\n function getRewardTokenAddresses()\n external\n view\n returns (address[] memory)\n {\n return rewardTokenAddresses;\n }\n\n /**\n * @notice Provide support for asset by passing its pToken address.\n * This method can only be called by the system Governor\n * @param _asset Address for the asset\n * @param _pToken Address for the corresponding platform token\n */\n function setPTokenAddress(address _asset, address _pToken)\n external\n virtual\n onlyGovernor\n {\n _setPTokenAddress(_asset, _pToken);\n }\n\n /**\n * @notice Remove a supported asset by passing its index.\n * This method can only be called by the system Governor\n * @param _assetIndex Index of the asset to be removed\n */\n function removePToken(uint256 _assetIndex) external virtual onlyGovernor {\n require(_assetIndex < assetsMapped.length, \"Invalid index\");\n address asset = assetsMapped[_assetIndex];\n address pToken = assetToPToken[asset];\n\n if (_assetIndex < assetsMapped.length - 1) {\n assetsMapped[_assetIndex] = assetsMapped[assetsMapped.length - 1];\n }\n assetsMapped.pop();\n assetToPToken[asset] = address(0);\n\n emit PTokenRemoved(asset, pToken);\n }\n\n /**\n * @notice Provide support for asset by passing its pToken address.\n * Add to internal mappings and execute the platform specific,\n * abstract method `_abstractSetPToken`\n * @param _asset Address for the asset\n * @param _pToken Address for the corresponding platform token\n */\n function _setPTokenAddress(address _asset, address _pToken) internal {\n require(assetToPToken[_asset] == address(0), \"pToken already set\");\n require(\n _asset != address(0) && _pToken != address(0),\n \"Invalid addresses\"\n );\n\n assetToPToken[_asset] = _pToken;\n assetsMapped.push(_asset);\n\n emit PTokenAdded(_asset, _pToken);\n\n _abstractSetPToken(_asset, _pToken);\n }\n\n /**\n * @notice Transfer token to governor. Intended for recovering tokens stuck in\n * strategy contracts, i.e. mistaken sends.\n * @param _asset Address for the asset\n * @param _amount Amount of the asset to transfer\n */\n function transferToken(address _asset, uint256 _amount)\n public\n onlyGovernor\n {\n require(!supportsAsset(_asset), \"Cannot transfer supported asset\");\n IERC20(_asset).safeTransfer(governor(), _amount);\n }\n\n /**\n * @notice Set the Harvester contract that can collect rewards.\n * @param _harvesterAddress Address of the harvester contract.\n */\n function setHarvesterAddress(address _harvesterAddress)\n external\n onlyGovernor\n {\n emit HarvesterAddressesUpdated(harvesterAddress, _harvesterAddress);\n harvesterAddress = _harvesterAddress;\n }\n\n /***************************************\n Abstract\n ****************************************/\n\n function _abstractSetPToken(address _asset, address _pToken)\n internal\n virtual;\n\n function safeApproveAllTokens() external virtual;\n\n /**\n * @notice Deposit an amount of assets into the platform\n * @param _asset Address for the asset\n * @param _amount Units of asset to deposit\n */\n function deposit(address _asset, uint256 _amount) external virtual;\n\n /**\n * @notice Deposit all supported assets in this strategy contract to the platform\n */\n function depositAll() external virtual;\n\n /**\n * @notice Withdraw an `amount` of assets from the platform and\n * send to the `_recipient`.\n * @param _recipient Address to which the asset should be sent\n * @param _asset Address of the asset\n * @param _amount Units of asset to withdraw\n */\n function withdraw(\n address _recipient,\n address _asset,\n uint256 _amount\n ) external virtual;\n\n /**\n * @notice Withdraw all supported assets from platform and\n * sends to the OToken's Vault.\n */\n function withdrawAll() external virtual;\n\n /**\n * @notice Get the total asset value held in the platform.\n * This includes any interest that was generated since depositing.\n * @param _asset Address of the asset\n * @return balance Total value of the asset in the platform\n */\n function checkBalance(address _asset)\n external\n view\n virtual\n returns (uint256 balance);\n\n /**\n * @notice Check if an asset is supported.\n * @param _asset Address of the asset\n * @return bool Whether asset is supported\n */\n function supportsAsset(address _asset) public view virtual returns (bool);\n}\n"
},
"contracts/utils/InitializableERC20Detailed.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/**\n * @dev Optional functions from the ERC20 standard.\n * Converted from openzeppelin/contracts/token/ERC20/ERC20Detailed.sol\n * @author Origin Protocol Inc\n */\nabstract contract InitializableERC20Detailed is IERC20 {\n // Storage gap to skip storage from prior to OUSD reset\n uint256[100] private _____gap;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of\n * these values are immutable: they can only be set once during\n * construction.\n * @notice To avoid variable shadowing appended `Arg` after arguments name.\n */\n function _initialize(\n string memory nameArg,\n string memory symbolArg,\n uint8 decimalsArg\n ) internal {\n _name = nameArg;\n _symbol = symbolArg;\n _decimals = decimalsArg;\n }\n\n /**\n * @notice Returns the name of the token.\n */\n function name() public view returns (string memory) {\n return _name;\n }\n\n /**\n * @notice Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n /**\n * @notice Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n}\n"
},
"contracts/utils/StableMath.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { SafeMath } from \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\n\n// Based on StableMath from Stability Labs Pty. Ltd.\n// https://github.com/mstable/mStable-contracts/blob/master/contracts/shared/StableMath.sol\n\nlibrary StableMath {\n using SafeMath for uint256;\n\n /**\n * @dev Scaling unit for use in specific calculations,\n * where 1 * 10**18, or 1e18 represents a unit '1'\n */\n uint256 private constant FULL_SCALE = 1e18;\n\n /***************************************\n Helpers\n ****************************************/\n\n /**\n * @dev Adjust the scale of an integer\n * @param to Decimals to scale to\n * @param from Decimals to scale from\n */\n function scaleBy(\n uint256 x,\n uint256 to,\n uint256 from\n ) internal pure returns (uint256) {\n if (to > from) {\n x = x.mul(10**(to - from));\n } else if (to < from) {\n // slither-disable-next-line divide-before-multiply\n x = x.div(10**(from - to));\n }\n return x;\n }\n\n /***************************************\n Precise Arithmetic\n ****************************************/\n\n /**\n * @dev Multiplies two precise units, and then truncates by the full scale\n * @param x Left hand input to multiplication\n * @param y Right hand input to multiplication\n * @return Result after multiplying the two inputs and then dividing by the shared\n * scale unit\n */\n function mulTruncate(uint256 x, uint256 y) internal pure returns (uint256) {\n return mulTruncateScale(x, y, FULL_SCALE);\n }\n\n /**\n * @dev Multiplies two precise units, and then truncates by the given scale. For example,\n * when calculating 90% of 10e18, (10e18 * 9e17) / 1e18 = (9e36) / 1e18 = 9e18\n * @param x Left hand input to multiplication\n * @param y Right hand input to multiplication\n * @param scale Scale unit\n * @return Result after multiplying the two inputs and then dividing by the shared\n * scale unit\n */\n function mulTruncateScale(\n uint256 x,\n uint256 y,\n uint256 scale\n ) internal pure returns (uint256) {\n // e.g. assume scale = fullScale\n // z = 10e18 * 9e17 = 9e36\n uint256 z = x.mul(y);\n // return 9e36 / 1e18 = 9e18\n return z.div(scale);\n }\n\n /**\n * @dev Multiplies two precise units, and then truncates by the full scale, rounding up the result\n * @param x Left hand input to multiplication\n * @param y Right hand input to multiplication\n * @return Result after multiplying the two inputs and then dividing by the shared\n * scale unit, rounded up to the closest base unit.\n */\n function mulTruncateCeil(uint256 x, uint256 y)\n internal\n pure\n returns (uint256)\n {\n // e.g. 8e17 * 17268172638 = 138145381104e17\n uint256 scaled = x.mul(y);\n // e.g. 138145381104e17 + 9.99...e17 = 138145381113.99...e17\n uint256 ceil = scaled.add(FULL_SCALE.sub(1));\n // e.g. 13814538111.399...e18 / 1e18 = 13814538111\n return ceil.div(FULL_SCALE);\n }\n\n /**\n * @dev Precisely divides two units, by first scaling the left hand operand. Useful\n * for finding percentage weightings, i.e. 8e18/10e18 = 80% (or 8e17)\n * @param x Left hand input to division\n * @param y Right hand input to division\n * @return Result after multiplying the left operand by the scale, and\n * executing the division on the right hand input.\n */\n function divPrecisely(uint256 x, uint256 y)\n internal\n pure\n returns (uint256)\n {\n // e.g. 8e18 * 1e18 = 8e36\n uint256 z = x.mul(FULL_SCALE);\n // e.g. 8e36 / 10e18 = 8e17\n return z.div(y);\n }\n}\n"
},
"contracts/vault/VaultStorage.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/**\n * @title OToken VaultStorage contract\n * @notice The VaultStorage contract defines the storage for the Vault contracts\n * @author Origin Protocol Inc\n */\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\nimport { IStrategy } from \"../interfaces/IStrategy.sol\";\nimport { Governable } from \"../governance/Governable.sol\";\nimport { OUSD } from \"../token/OUSD.sol\";\nimport { Initializable } from \"../utils/Initializable.sol\";\nimport \"../utils/Helpers.sol\";\n\ncontract VaultStorage is Initializable, Governable {\n using SafeERC20 for IERC20;\n\n event AssetSupported(address _asset);\n event AssetRemoved(address _asset);\n event AssetDefaultStrategyUpdated(address _asset, address _strategy);\n event AssetAllocated(address _asset, address _strategy, uint256 _amount);\n event StrategyApproved(address _addr);\n event StrategyRemoved(address _addr);\n event Mint(address _addr, uint256 _value);\n event Redeem(address _addr, uint256 _value);\n event CapitalPaused();\n event CapitalUnpaused();\n event RebasePaused();\n event RebaseUnpaused();\n event VaultBufferUpdated(uint256 _vaultBuffer);\n event OusdMetaStrategyUpdated(address _ousdMetaStrategy);\n event RedeemFeeUpdated(uint256 _redeemFeeBps);\n event PriceProviderUpdated(address _priceProvider);\n event AllocateThresholdUpdated(uint256 _threshold);\n event RebaseThresholdUpdated(uint256 _threshold);\n event StrategistUpdated(address _address);\n event MaxSupplyDiffChanged(uint256 maxSupplyDiff);\n event YieldDistribution(address _to, uint256 _yield, uint256 _fee);\n event TrusteeFeeBpsChanged(uint256 _basis);\n event TrusteeAddressChanged(address _address);\n event NetOusdMintForStrategyThresholdChanged(uint256 _threshold);\n event SwapperChanged(address _address);\n event SwapAllowedUndervalueChanged(uint256 _basis);\n event SwapSlippageChanged(address _asset, uint256 _basis);\n event Swapped(\n address indexed _fromAsset,\n address indexed _toAsset,\n uint256 _fromAssetAmount,\n uint256 _toAssetAmount\n );\n\n // Assets supported by the Vault, i.e. Stablecoins\n enum UnitConversion {\n DECIMALS,\n GETEXCHANGERATE\n }\n // Changed to fit into a single storage slot so the decimals needs to be recached\n struct Asset {\n // Note: OETHVaultCore doesn't use `isSupported` when minting,\n // redeeming or checking balance of assets.\n bool isSupported;\n UnitConversion unitConversion;\n uint8 decimals;\n // Max allowed slippage from the Oracle price when swapping collateral assets in basis points.\n // For example 40 == 0.4% slippage\n uint16 allowedOracleSlippageBps;\n }\n\n /// @dev mapping of supported vault assets to their configuration\n // slither-disable-next-line uninitialized-state\n mapping(address => Asset) internal assets;\n /// @dev list of all assets supported by the vault.\n // slither-disable-next-line uninitialized-state\n address[] internal allAssets;\n\n // Strategies approved for use by the Vault\n struct Strategy {\n bool isSupported;\n uint256 _deprecated; // Deprecated storage slot\n }\n /// @dev mapping of strategy contracts to their configiration\n mapping(address => Strategy) internal strategies;\n /// @dev list of all vault strategies\n address[] internal allStrategies;\n\n /// @notice Address of the Oracle price provider contract\n // slither-disable-next-line uninitialized-state\n address public priceProvider;\n /// @notice pause rebasing if true\n bool public rebasePaused = false;\n /// @notice pause operations that change the OToken supply.\n /// eg mint, redeem, allocate, mint/burn for strategy\n bool public capitalPaused = true;\n /// @notice Redemption fee in basis points. eg 50 = 0.5%\n uint256 public redeemFeeBps;\n /// @notice Percentage of assets to keep in Vault to handle (most) withdrawals. 100% = 1e18.\n uint256 public vaultBuffer;\n /// @notice OToken mints over this amount automatically allocate funds. 18 decimals.\n uint256 public autoAllocateThreshold;\n /// @notice OToken mints over this amount automatically rebase. 18 decimals.\n uint256 public rebaseThreshold;\n\n /// @dev Address of the OToken token. eg OUSD or OETH.\n // slither-disable-next-line uninitialized-state\n OUSD internal oUSD;\n\n //keccak256(\"OUSD.vault.governor.admin.impl\");\n bytes32 constant adminImplPosition =\n 0xa2bd3d3cf188a41358c8b401076eb59066b09dec5775650c0de4c55187d17bd9;\n\n // Address of the contract responsible for post rebase syncs with AMMs\n address private _deprecated_rebaseHooksAddr = address(0);\n\n // Deprecated: Address of Uniswap\n // slither-disable-next-line constable-states\n address private _deprecated_uniswapAddr = address(0);\n\n /// @notice Address of the Strategist\n address public strategistAddr = address(0);\n\n /// @notice Mapping of asset address to the Strategy that they should automatically\n // be allocated to\n // slither-disable-next-line uninitialized-state\n mapping(address => address) public assetDefaultStrategies;\n\n /// @notice Max difference between total supply and total value of assets. 18 decimals.\n // slither-disable-next-line uninitialized-state\n uint256 public maxSupplyDiff;\n\n /// @notice Trustee contract that can collect a percentage of yield\n address public trusteeAddress;\n\n /// @notice Amount of yield collected in basis points. eg 2000 = 20%\n uint256 public trusteeFeeBps;\n\n /// @dev Deprecated: Tokens that should be swapped for stablecoins\n address[] private _deprecated_swapTokens;\n\n uint256 constant MINT_MINIMUM_UNIT_PRICE = 0.998e18;\n\n /// @notice Metapool strategy that is allowed to mint/burn OTokens without changing collateral\n address public ousdMetaStrategy = address(0);\n\n /// @notice How much OTokens are currently minted by the strategy\n int256 public netOusdMintedForStrategy = 0;\n\n /// @notice How much net total OTokens are allowed to be minted by all strategies\n uint256 public netOusdMintForStrategyThreshold = 0;\n\n uint256 constant MIN_UNIT_PRICE_DRIFT = 0.7e18;\n uint256 constant MAX_UNIT_PRICE_DRIFT = 1.3e18;\n\n /// @notice Collateral swap configuration.\n /// @dev is packed into a single storage slot to save gas.\n struct SwapConfig {\n // Contract that swaps the vault's collateral assets\n address swapper;\n // Max allowed percentage the total value can drop below the total supply in basis points.\n // For example 100 == 1%\n uint16 allowedUndervalueBps;\n }\n SwapConfig internal swapConfig = SwapConfig(address(0), 0);\n\n // For future use\n uint256[50] private __gap;\n\n /**\n * @notice set the implementation for the admin, this needs to be in a base class else we cannot set it\n * @param newImpl address of the implementation\n */\n function setAdminImpl(address newImpl) external onlyGovernor {\n require(\n Address.isContract(newImpl),\n \"new implementation is not a contract\"\n );\n bytes32 position = adminImplPosition;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(position, newImpl)\n }\n }\n}\n"
}
}
}} |
1 | 20,290,462 | a0227c55c2bb05c910ffbb9a55b0c20448a8c04ed7b0b18b3cd64b226694fc95 | 15861bff42d29d4781f64490635be39bfb6ecb867407041678d3834ff30154bd | 55e3ef313a47d12a221db77c053c9e9cad66536d | 55e3ef313a47d12a221db77c053c9e9cad66536d | 6496695001fb5b60ae7a40f786fa756cebf443c3 | 60a06040526003600a556007600b556040518060400160405280600981526020017f4e657720546f6b656e00000000000000000000000000000000000000000000008152506040518060400160405280600281526020017f4e5400000000000000000000000000000000000000000000000000000000000081525081600390816100899190610858565b5080600490816100999190610858565b5050506100b86100ad6103a860201b60201c565b6103af60201b60201c565b5f6b033b2e3c9fd0803ce800000090505f6100f060646100e260198561047260201b90919060201c565b61048760201b90919060201c565b9050610119606461010b60018561047260201b90919060201c565b61048760201b90919060201c565b600781905550610146606461013860018561047260201b90919060201c565b61048760201b90919060201c565b6008819055506101746103e861016660058561047260201b90919060201c565b61048760201b90919060201c565b6009819055507355e3ef313a47d12a221db77c053c9e9cad66536d73ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250506001600e5f60805173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506001600e5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506001600e5f3273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506001600e5f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506001600e5f61dead73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555061037f308261049c60201b60201c565b6103a13261039683856105ff60201b90919060201c565b61049c60201b60201c565b5050610af8565b5f33905090565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f818361047f9190610954565b905092915050565b5f818361049491906109c2565b905092915050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361050a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050190610a4c565b60405180910390fd5b61051b5f838361061460201b60201c565b8060025f82825461052c9190610a6a565b92505081905550805f808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825461057e9190610a6a565b925050819055508173ffffffffffffffffffffffffffffffffffffffff165f73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516105e29190610aac565b60405180910390a36105fb5f838361061960201b60201c565b5050565b5f818361060c9190610ac5565b905092915050565b505050565b505050565b5f81519050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061069957607f821691505b6020821081036106ac576106ab610655565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f6008830261070e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826106d3565b61071886836106d3565b95508019841693508086168417925050509392505050565b5f819050919050565b5f819050919050565b5f61075c61075761075284610730565b610739565b610730565b9050919050565b5f819050919050565b61077583610742565b61078961078182610763565b8484546106df565b825550505050565b5f90565b61079d610791565b6107a881848461076c565b505050565b5b818110156107cb576107c05f82610795565b6001810190506107ae565b5050565b601f821115610810576107e1816106b2565b6107ea846106c4565b810160208510156107f9578190505b61080d610805856106c4565b8301826107ad565b50505b505050565b5f82821c905092915050565b5f6108305f1984600802610815565b1980831691505092915050565b5f6108488383610821565b9150826002028217905092915050565b6108618261061e565b67ffffffffffffffff81111561087a57610879610628565b5b6108848254610682565b61088f8282856107cf565b5f60209050601f8311600181146108c0575f84156108ae578287015190505b6108b8858261083d565b86555061091f565b601f1984166108ce866106b2565b5f5b828110156108f5578489015182556001820191506020850194506020810190506108d0565b86831015610912578489015161090e601f891682610821565b8355505b6001600288020188555050505b505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61095e82610730565b915061096983610730565b925082820261097781610730565b9150828204841483151761098e5761098d610927565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6109cc82610730565b91506109d783610730565b9250826109e7576109e6610995565b5b828204905092915050565b5f82825260208201905092915050565b7f45524332303a206d696e7420746f20746865207a65726f2061646472657373005f82015250565b5f610a36601f836109f2565b9150610a4182610a02565b602082019050919050565b5f6020820190508181035f830152610a6381610a2a565b9050919050565b5f610a7482610730565b9150610a7f83610730565b9250828201905080821115610a9757610a96610927565b5b92915050565b610aa681610730565b82525050565b5f602082019050610abf5f830184610a9d565b92915050565b5f610acf82610730565b9150610ada83610730565b9250828203905081811115610af257610af1610927565b5b92915050565b608051613859610b335f395f81816108d801528181610bd301528181610e2b015281816112240152818161147801526121b201526138595ff3fe6080604052600436106101c4575f3560e01c806370a08231116100f6578063cb4e162b11610094578063dd62ed3e11610063578063dd62ed3e146105fd578063f2fde38b14610639578063f442d3fb14610661578063f928364c14610689576101cb565b8063cb4e162b14610547578063d01dd6d214610571578063d18afa8514610599578063dbac26e9146105c1576101cb565b806395d89b41116100d057806395d89b411461047d5780639e8c708e146104a7578063a457c2d7146104cf578063a9059cbb1461050b576101cb565b806370a0823114610401578063715018a61461043d5780638da5cb5b14610453576101cb565b8063313ce56711610163578063412753581161013d578063412753581461036d57806353945d7b1461039757806366a88d96146103c1578063697cfc19146103eb576101cb565b8063313ce567146102f157806337efc0c91461031b5780633950935114610331576101cb565b8063095ea7b31161019f578063095ea7b31461022557806318160ddd1461026157806323b872dd1461028b5780632f2dae7f146102c7576101cb565b806299d386146101cf5780630614117a146101e557806306fdde03146101fb576101cb565b366101cb57005b5f80fd5b3480156101da575f80fd5b506101e361069f565b005b3480156101f0575f80fd5b506101f96108d6565b005b348015610206575f80fd5b5061020f6109b0565b60405161021c9190612578565b60405180910390f35b348015610230575f80fd5b5061024b60048036038101906102469190612629565b610a40565b6040516102589190612681565b60405180910390f35b34801561026c575f80fd5b50610275610a62565b60405161028291906126a9565b60405180910390f35b348015610296575f80fd5b506102b160048036038101906102ac91906126c2565b610a6b565b6040516102be9190612681565b60405180910390f35b3480156102d2575f80fd5b506102db610a99565b6040516102e891906126a9565b60405180910390f35b3480156102fc575f80fd5b50610305610a9f565b604051610312919061272d565b60405180910390f35b348015610326575f80fd5b5061032f610aa7565b005b34801561033c575f80fd5b5061035760048036038101906103529190612629565b610b2c565b6040516103649190612681565b60405180910390f35b348015610378575f80fd5b50610381610bd1565b60405161038e9190612755565b60405180910390f35b3480156103a2575f80fd5b506103ab610bf5565b6040516103b89190612755565b60405180910390f35b3480156103cc575f80fd5b506103d5610c1a565b6040516103e291906126a9565b60405180910390f35b3480156103f6575f80fd5b506103ff610c20565b005b34801561040c575f80fd5b506104276004803603810190610422919061276e565b610ca5565b60405161043491906126a9565b60405180910390f35b348015610448575f80fd5b50610451610cea565b005b34801561045e575f80fd5b50610467610d71565b6040516104749190612755565b60405180910390f35b348015610488575f80fd5b50610491610d99565b60405161049e9190612578565b60405180910390f35b3480156104b2575f80fd5b506104cd60048036038101906104c891906127d4565b610e29565b005b3480156104da575f80fd5b506104f560048036038101906104f09190612629565b610fb3565b6040516105029190612681565b60405180910390f35b348015610516575f80fd5b50610531600480360381019061052c9190612629565b611097565b60405161053e9190612681565b60405180910390f35b348015610552575f80fd5b5061055b6110b9565b60405161056891906126a9565b60405180910390f35b34801561057c575f80fd5b5061059760048036038101906105929190612829565b6110bf565b005b3480156105a4575f80fd5b506105bf60048036038101906105ba9190612867565b611222565b005b3480156105cc575f80fd5b506105e760048036038101906105e2919061276e565b6112e1565b6040516105f49190612681565b60405180910390f35b348015610608575f80fd5b50610623600480360381019061061e91906128a5565b6112fe565b60405161063091906126a9565b60405180910390f35b348015610644575f80fd5b5061065f600480360381019061065a919061276e565b611380565b005b34801561066c575f80fd5b50610687600480360381019061068291906128e3565b611476565b005b348015610694575f80fd5b5061069d6115f6565b005b6106a7611682565b73ffffffffffffffffffffffffffffffffffffffff166106c5610d71565b73ffffffffffffffffffffffffffffffffffffffff161461071b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071290612958565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610778573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061079c919061298a565b73ffffffffffffffffffffffffffffffffffffffff1663e6a4390530737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610815573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610839919061298a565b6040518363ffffffff1660e01b81526004016108569291906129b5565b602060405180830381865afa158015610871573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610895919061298a565b60065f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806109625750610933610d71565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61096a575f80fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc4790811502906040515f60405180830381858888f193505050501580156109ad573d5f803e3d5ffd5b50565b6060600380546109bf90612a09565b80601f01602080910402602001604051908101604052809291908181526020018280546109eb90612a09565b8015610a365780601f10610a0d57610100808354040283529160200191610a36565b820191905f5260205f20905b815481529060010190602001808311610a1957829003601f168201915b5050505050905090565b5f80610a4a611682565b9050610a57818585611689565b600191505092915050565b5f600254905090565b5f80610a75611682565b9050610a8285828561184c565b610a8d8585856118d7565b60019150509392505050565b60075481565b5f6012905090565b610aaf611682565b73ffffffffffffffffffffffffffffffffffffffff16610acd610d71565b73ffffffffffffffffffffffffffffffffffffffff1614610b23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1a90612958565b60405180910390fd5b5f600781905550565b5f80610b36611682565b9050610bc681858560015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054610bc19190612a66565b611689565b600191505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b610c28611682565b73ffffffffffffffffffffffffffffffffffffffff16610c46610d71565b73ffffffffffffffffffffffffffffffffffffffff1614610c9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9390612958565b60405180910390fd5b5f600881905550565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b610cf2611682565b73ffffffffffffffffffffffffffffffffffffffff16610d10610d71565b73ffffffffffffffffffffffffffffffffffffffff1614610d66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5d90612958565b60405180910390fd5b610d6f5f611ddb565b565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060048054610da890612a09565b80601f0160208091040260200160405190810160405280929190818152602001828054610dd490612a09565b8015610e1f5780601f10610df657610100808354040283529160200191610e1f565b820191905f5260205f20905b815481529060010190602001808311610e0257829003601f168201915b5050505050905090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610eb55750610e86610d71565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610ebd575f80fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610f139190612755565b602060405180830381865afa158015610f2e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f529190612aad565b6040518363ffffffff1660e01b8152600401610f6f929190612ad8565b6020604051808303815f875af1158015610f8b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610faf9190612b13565b5050565b5f80610fbd611682565b90505f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205490508381101561107e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107590612bae565b60405180910390fd5b61108b8286868403611689565b60019250505092915050565b5f806110a1611682565b90506110ae8185856118d7565b600191505092915050565b60095481565b6110c7611682565b73ffffffffffffffffffffffffffffffffffffffff166110e5610d71565b73ffffffffffffffffffffffffffffffffffffffff161461113b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113290612958565b60405180910390fd5b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036111ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c190612c3c565b60405180910390fd5b80600f5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806112ae575061127f610d71565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6112b6575f80fd5b600482111580156112c757505f8114155b6112cf575f80fd5b81600a8190555080600b819055505050565b600f602052805f5260405f205f915054906101000a900460ff1681565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b611388611682565b73ffffffffffffffffffffffffffffffffffffffff166113a6610d71565b73ffffffffffffffffffffffffffffffffffffffff16146113fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f390612958565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361146a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146190612cca565b60405180910390fd5b61147381611ddb565b50565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061150257506114d3610d71565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61150a575f80fd5b61153a620186a061152c600161151e610a62565b611e9e90919063ffffffff16565b611eb390919063ffffffff16565b81101561157c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157390612d58565b60405180910390fd5b6115aa606461159c600261158e610a62565b611e9e90919063ffffffff16565b611eb390919063ffffffff16565b8111156115ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e390612de6565b60405180910390fd5b8060098190555050565b6115fe611682565b73ffffffffffffffffffffffffffffffffffffffff1661161c610d71565b73ffffffffffffffffffffffffffffffffffffffff1614611672576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166990612958565b60405180910390fd5b5f6008819055505f600781905550565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036116f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ee90612e74565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611765576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175c90612f02565b60405180910390fd5b8060015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161183f91906126a9565b60405180910390a3505050565b5f61185784846112fe565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146118d157818110156118c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ba90612f6a565b60405180910390fd5b6118d08484848403611689565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611945576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193c90612ff8565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036119b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119aa90613086565b60405180910390fd5b5f81116119f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ec90613114565b60405180910390fd5b600f5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615611a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a76906131c8565b60405180910390fd5b5f600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680611b1b5750600e5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff165b90505f73ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141580611b765750805b611bb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bac90613230565b60405180910390fd5b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161490505f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161490508080611c645750815b8015611c7157505f600754115b8015611c7b575082155b15611cc657600754841115611cc5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cbc906132e4565b60405180910390fd5b5b81158015611cd557505f600854115b8015611cdf575082155b15611d3d5760085484611cf187610ca5565b611cfb9190612a66565b1115611d3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3390613398565b60405180910390fd5b5b600954611d4930610ca5565b10158015611d635750600d5f9054906101000a900460ff16155b8015611d6c5750815b8015611d76575082155b8015611d875750611d8684611ec8565b5b15611dc8576001600d5f6101000a81548160ff021916908315150217905550611dae611f23565b5f600d5f6101000a81548160ff0219169083151502179055505b611dd3868686612274565b505050505050565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f8183611eab91906133b6565b905092915050565b5f8183611ec09190613424565b905092915050565b5f80600b5414611ee757600b54600954611ee29190613424565b611ee9565b5f5b8210158015611f1c57506002600c5f4381526020019081526020015f205f815480929190611f1690613454565b91905055105b9050919050565b5f611f2d30610ca5565b90505f8103611f3c5750612272565b600954811115611f4c5760095490505b5f4790505f600267ffffffffffffffff811115611f6c57611f6b61349b565b5b604051908082528060200260200182016040528015611f9a5781602001602082028036833780820191505090505b50905030815f81518110611fb157611fb06134c8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612048573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061206c919061298a565b816001815181106120805761207f6134c8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120d930737a250d5630b4cf539739df2c5dacb4c659f2488d85611689565b737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663791ac947845f8430426040518663ffffffff1660e01b815260040161212e9594939291906135ee565b5f604051808303815f87803b158015612145575f80fd5b505af1158015612157573d5f803e3d5ffd5b505050505f61216f83476124e990919063ffffffff16565b90505f612199606461218b600585611e9e90919063ffffffff16565b611eb390919063ffffffff16565b90506121ae81836124e990919063ffffffff16565b91507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166108fc8390811502906040515f60405180830381858888f19350505050158015612213573d5f803e3d5ffd5b507336f782c623eb67d6e2c4352a7fb5bb7382b85a7a73ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f1935050505015801561226b573d5f803e3d5ffd5b5050505050505b565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036122e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122d9906136b6565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612350576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161234790613744565b60405180910390fd5b61235b8383836124fe565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050818110156123de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d5906137d2565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550815f808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825461246c9190612a66565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516124d091906126a9565b60405180910390a36124e3848484612503565b50505050565b5f81836124f691906137f0565b905092915050565b505050565b505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61254a82612508565b6125548185612512565b9350612564818560208601612522565b61256d81612530565b840191505092915050565b5f6020820190508181035f8301526125908184612540565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6125c58261259c565b9050919050565b6125d5816125bb565b81146125df575f80fd5b50565b5f813590506125f0816125cc565b92915050565b5f819050919050565b612608816125f6565b8114612612575f80fd5b50565b5f81359050612623816125ff565b92915050565b5f806040838503121561263f5761263e612598565b5b5f61264c858286016125e2565b925050602061265d85828601612615565b9150509250929050565b5f8115159050919050565b61267b81612667565b82525050565b5f6020820190506126945f830184612672565b92915050565b6126a3816125f6565b82525050565b5f6020820190506126bc5f83018461269a565b92915050565b5f805f606084860312156126d9576126d8612598565b5b5f6126e6868287016125e2565b93505060206126f7868287016125e2565b925050604061270886828701612615565b9150509250925092565b5f60ff82169050919050565b61272781612712565b82525050565b5f6020820190506127405f83018461271e565b92915050565b61274f816125bb565b82525050565b5f6020820190506127685f830184612746565b92915050565b5f6020828403121561278357612782612598565b5b5f612790848285016125e2565b91505092915050565b5f6127a3826125bb565b9050919050565b6127b381612799565b81146127bd575f80fd5b50565b5f813590506127ce816127aa565b92915050565b5f602082840312156127e9576127e8612598565b5b5f6127f6848285016127c0565b91505092915050565b61280881612667565b8114612812575f80fd5b50565b5f81359050612823816127ff565b92915050565b5f806040838503121561283f5761283e612598565b5b5f61284c858286016125e2565b925050602061285d85828601612815565b9150509250929050565b5f806040838503121561287d5761287c612598565b5b5f61288a85828601612615565b925050602061289b85828601612615565b9150509250929050565b5f80604083850312156128bb576128ba612598565b5b5f6128c8858286016125e2565b92505060206128d9858286016125e2565b9150509250929050565b5f602082840312156128f8576128f7612598565b5b5f61290584828501612615565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f612942602083612512565b915061294d8261290e565b602082019050919050565b5f6020820190508181035f83015261296f81612936565b9050919050565b5f81519050612984816125cc565b92915050565b5f6020828403121561299f5761299e612598565b5b5f6129ac84828501612976565b91505092915050565b5f6040820190506129c85f830185612746565b6129d56020830184612746565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680612a2057607f821691505b602082108103612a3357612a326129dc565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f612a70826125f6565b9150612a7b836125f6565b9250828201905080821115612a9357612a92612a39565b5b92915050565b5f81519050612aa7816125ff565b92915050565b5f60208284031215612ac257612ac1612598565b5b5f612acf84828501612a99565b91505092915050565b5f604082019050612aeb5f830185612746565b612af8602083018461269a565b9392505050565b5f81519050612b0d816127ff565b92915050565b5f60208284031215612b2857612b27612598565b5b5f612b3584828501612aff565b91505092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f775f8201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b5f612b98602583612512565b9150612ba382612b3e565b604082019050919050565b5f6020820190508181035f830152612bc581612b8c565b9050919050565b7f43616e6e6f7420626c61636b6c697374207468652070616972206164647265735f8201527f732e000000000000000000000000000000000000000000000000000000000000602082015250565b5f612c26602283612512565b9150612c3182612bcc565b604082019050919050565b5f6020820190508181035f830152612c5381612c1a565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f612cb4602683612512565b9150612cbf82612c5a565b604082019050919050565b5f6020820190508181035f830152612ce181612ca8565b9050919050565b7f53776170207468726573686f6c642063616e6e6f74206265206c6f77657220745f8201527f68616e20302e3030312520746f74616c20737570706c792e0000000000000000602082015250565b5f612d42603883612512565b9150612d4d82612ce8565b604082019050919050565b5f6020820190508181035f830152612d6f81612d36565b9050919050565b7f53776170207468726573686f6c642063616e6e6f7420626520686967686572205f8201527f7468616e20322520746f74616c20737570706c792e0000000000000000000000602082015250565b5f612dd0603583612512565b9150612ddb82612d76565b604082019050919050565b5f6020820190508181035f830152612dfd81612dc4565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f612e5e602483612512565b9150612e6982612e04565b604082019050919050565b5f6020820190508181035f830152612e8b81612e52565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f612eec602283612512565b9150612ef782612e92565b604082019050919050565b5f6020820190508181035f830152612f1981612ee0565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000005f82015250565b5f612f54601d83612512565b9150612f5f82612f20565b602082019050919050565b5f6020820190508181035f830152612f8181612f48565b9050919050565b7f5472616e736665722066726f6d20746865207a65726f2061646472657373206e5f8201527f6f7420616c6c6f7765642e000000000000000000000000000000000000000000602082015250565b5f612fe2602b83612512565b9150612fed82612f88565b604082019050919050565b5f6020820190508181035f83015261300f81612fd6565b9050919050565b7f5472616e7366657220746f20746865207a65726f2061646472657373206e6f745f8201527f20616c6c6f7765642e0000000000000000000000000000000000000000000000602082015250565b5f613070602983612512565b915061307b82613016565b604082019050919050565b5f6020820190508181035f83015261309d81613064565b9050919050565b7f5472616e7366657220616d6f756e74206d7573742062652067726561746572205f8201527f7468616e207a65726f2e00000000000000000000000000000000000000000000602082015250565b5f6130fe602a83612512565b9150613109826130a4565b604082019050919050565b5f6020820190508181035f83015261312b816130f2565b9050919050565b7f596f7572206164647265737320686173206265656e206d61726b6564206173205f8201527f626c61636b6c69737465642c20796f752061726520756e61626c6520746f207460208201527f72616e73666572206f7220737761702e00000000000000000000000000000000604082015250565b5f6131b2605083612512565b91506131bd82613132565b606082019050919050565b5f6020820190508181035f8301526131df816131a6565b9050919050565b7f4c69717569646974792070616972206e6f742079657420637265617465642e005f82015250565b5f61321a601f83612512565b9150613225826131e6565b602082019050919050565b5f6020820190508181035f8301526132478161320e565b9050919050565b7f537761702076616c75652065786365656473206d6178207377617020616d6f755f8201527f6e742c2074727920616761696e2077697468206c65737320737761702076616c60208201527f75652e0000000000000000000000000000000000000000000000000000000000604082015250565b5f6132ce604383612512565b91506132d98261324e565b606082019050919050565b5f6020820190508181035f8301526132fb816132c2565b9050919050565b7f42616c616e63652065786365656473206d617820686f6c64696e677320616d6f5f8201527f756e742c20636f6e7369646572207573696e672061207365636f6e642077616c60208201527f6c65742e00000000000000000000000000000000000000000000000000000000604082015250565b5f613382604483612512565b915061338d82613302565b606082019050919050565b5f6020820190508181035f8301526133af81613376565b9050919050565b5f6133c0826125f6565b91506133cb836125f6565b92508282026133d9816125f6565b915082820484148315176133f0576133ef612a39565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61342e826125f6565b9150613439836125f6565b925082613449576134486133f7565b5b828204905092915050565b5f61345e826125f6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036134905761348f612a39565b5b600182019050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f819050919050565b5f819050919050565b5f61352161351c613517846134f5565b6134fe565b6125f6565b9050919050565b61353181613507565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b613569816125bb565b82525050565b5f61357a8383613560565b60208301905092915050565b5f602082019050919050565b5f61359c82613537565b6135a68185613541565b93506135b183613551565b805f5b838110156135e15781516135c8888261356f565b97506135d383613586565b9250506001810190506135b4565b5085935050505092915050565b5f60a0820190506136015f83018861269a565b61360e6020830187613528565b81810360408301526136208186613592565b905061362f6060830185612746565b61363c608083018461269a565b9695505050505050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f6136a0602583612512565b91506136ab82613646565b604082019050919050565b5f6020820190508181035f8301526136cd81613694565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f61372e602383612512565b9150613739826136d4565b604082019050919050565b5f6020820190508181035f83015261375b81613722565b9050919050565b7f45524332303a207472616e7366657220616d6f756e74206578636565647320625f8201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b5f6137bc602683612512565b91506137c782613762565b604082019050919050565b5f6020820190508181035f8301526137e9816137b0565b9050919050565b5f6137fa826125f6565b9150613805836125f6565b925082820390508181111561381d5761381c612a39565b5b9291505056fea2646970667358221220574239aa07db01802f9528c7d8ef95fea537124c0ce53f9f622faf3e1c53fd0964736f6c634300081a0033 | 6080604052600436106101c4575f3560e01c806370a08231116100f6578063cb4e162b11610094578063dd62ed3e11610063578063dd62ed3e146105fd578063f2fde38b14610639578063f442d3fb14610661578063f928364c14610689576101cb565b8063cb4e162b14610547578063d01dd6d214610571578063d18afa8514610599578063dbac26e9146105c1576101cb565b806395d89b41116100d057806395d89b411461047d5780639e8c708e146104a7578063a457c2d7146104cf578063a9059cbb1461050b576101cb565b806370a0823114610401578063715018a61461043d5780638da5cb5b14610453576101cb565b8063313ce56711610163578063412753581161013d578063412753581461036d57806353945d7b1461039757806366a88d96146103c1578063697cfc19146103eb576101cb565b8063313ce567146102f157806337efc0c91461031b5780633950935114610331576101cb565b8063095ea7b31161019f578063095ea7b31461022557806318160ddd1461026157806323b872dd1461028b5780632f2dae7f146102c7576101cb565b806299d386146101cf5780630614117a146101e557806306fdde03146101fb576101cb565b366101cb57005b5f80fd5b3480156101da575f80fd5b506101e361069f565b005b3480156101f0575f80fd5b506101f96108d6565b005b348015610206575f80fd5b5061020f6109b0565b60405161021c9190612578565b60405180910390f35b348015610230575f80fd5b5061024b60048036038101906102469190612629565b610a40565b6040516102589190612681565b60405180910390f35b34801561026c575f80fd5b50610275610a62565b60405161028291906126a9565b60405180910390f35b348015610296575f80fd5b506102b160048036038101906102ac91906126c2565b610a6b565b6040516102be9190612681565b60405180910390f35b3480156102d2575f80fd5b506102db610a99565b6040516102e891906126a9565b60405180910390f35b3480156102fc575f80fd5b50610305610a9f565b604051610312919061272d565b60405180910390f35b348015610326575f80fd5b5061032f610aa7565b005b34801561033c575f80fd5b5061035760048036038101906103529190612629565b610b2c565b6040516103649190612681565b60405180910390f35b348015610378575f80fd5b50610381610bd1565b60405161038e9190612755565b60405180910390f35b3480156103a2575f80fd5b506103ab610bf5565b6040516103b89190612755565b60405180910390f35b3480156103cc575f80fd5b506103d5610c1a565b6040516103e291906126a9565b60405180910390f35b3480156103f6575f80fd5b506103ff610c20565b005b34801561040c575f80fd5b506104276004803603810190610422919061276e565b610ca5565b60405161043491906126a9565b60405180910390f35b348015610448575f80fd5b50610451610cea565b005b34801561045e575f80fd5b50610467610d71565b6040516104749190612755565b60405180910390f35b348015610488575f80fd5b50610491610d99565b60405161049e9190612578565b60405180910390f35b3480156104b2575f80fd5b506104cd60048036038101906104c891906127d4565b610e29565b005b3480156104da575f80fd5b506104f560048036038101906104f09190612629565b610fb3565b6040516105029190612681565b60405180910390f35b348015610516575f80fd5b50610531600480360381019061052c9190612629565b611097565b60405161053e9190612681565b60405180910390f35b348015610552575f80fd5b5061055b6110b9565b60405161056891906126a9565b60405180910390f35b34801561057c575f80fd5b5061059760048036038101906105929190612829565b6110bf565b005b3480156105a4575f80fd5b506105bf60048036038101906105ba9190612867565b611222565b005b3480156105cc575f80fd5b506105e760048036038101906105e2919061276e565b6112e1565b6040516105f49190612681565b60405180910390f35b348015610608575f80fd5b50610623600480360381019061061e91906128a5565b6112fe565b60405161063091906126a9565b60405180910390f35b348015610644575f80fd5b5061065f600480360381019061065a919061276e565b611380565b005b34801561066c575f80fd5b50610687600480360381019061068291906128e3565b611476565b005b348015610694575f80fd5b5061069d6115f6565b005b6106a7611682565b73ffffffffffffffffffffffffffffffffffffffff166106c5610d71565b73ffffffffffffffffffffffffffffffffffffffff161461071b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071290612958565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610778573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061079c919061298a565b73ffffffffffffffffffffffffffffffffffffffff1663e6a4390530737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610815573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610839919061298a565b6040518363ffffffff1660e01b81526004016108569291906129b5565b602060405180830381865afa158015610871573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610895919061298a565b60065f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b7f00000000000000000000000055e3ef313a47d12a221db77c053c9e9cad66536d73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806109625750610933610d71565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61096a575f80fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc4790811502906040515f60405180830381858888f193505050501580156109ad573d5f803e3d5ffd5b50565b6060600380546109bf90612a09565b80601f01602080910402602001604051908101604052809291908181526020018280546109eb90612a09565b8015610a365780601f10610a0d57610100808354040283529160200191610a36565b820191905f5260205f20905b815481529060010190602001808311610a1957829003601f168201915b5050505050905090565b5f80610a4a611682565b9050610a57818585611689565b600191505092915050565b5f600254905090565b5f80610a75611682565b9050610a8285828561184c565b610a8d8585856118d7565b60019150509392505050565b60075481565b5f6012905090565b610aaf611682565b73ffffffffffffffffffffffffffffffffffffffff16610acd610d71565b73ffffffffffffffffffffffffffffffffffffffff1614610b23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1a90612958565b60405180910390fd5b5f600781905550565b5f80610b36611682565b9050610bc681858560015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054610bc19190612a66565b611689565b600191505092915050565b7f00000000000000000000000055e3ef313a47d12a221db77c053c9e9cad66536d81565b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b610c28611682565b73ffffffffffffffffffffffffffffffffffffffff16610c46610d71565b73ffffffffffffffffffffffffffffffffffffffff1614610c9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9390612958565b60405180910390fd5b5f600881905550565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b610cf2611682565b73ffffffffffffffffffffffffffffffffffffffff16610d10610d71565b73ffffffffffffffffffffffffffffffffffffffff1614610d66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5d90612958565b60405180910390fd5b610d6f5f611ddb565b565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060048054610da890612a09565b80601f0160208091040260200160405190810160405280929190818152602001828054610dd490612a09565b8015610e1f5780601f10610df657610100808354040283529160200191610e1f565b820191905f5260205f20905b815481529060010190602001808311610e0257829003601f168201915b5050505050905090565b7f00000000000000000000000055e3ef313a47d12a221db77c053c9e9cad66536d73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610eb55750610e86610d71565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610ebd575f80fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610f139190612755565b602060405180830381865afa158015610f2e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f529190612aad565b6040518363ffffffff1660e01b8152600401610f6f929190612ad8565b6020604051808303815f875af1158015610f8b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610faf9190612b13565b5050565b5f80610fbd611682565b90505f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205490508381101561107e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107590612bae565b60405180910390fd5b61108b8286868403611689565b60019250505092915050565b5f806110a1611682565b90506110ae8185856118d7565b600191505092915050565b60095481565b6110c7611682565b73ffffffffffffffffffffffffffffffffffffffff166110e5610d71565b73ffffffffffffffffffffffffffffffffffffffff161461113b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113290612958565b60405180910390fd5b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036111ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c190612c3c565b60405180910390fd5b80600f5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505050565b7f00000000000000000000000055e3ef313a47d12a221db77c053c9e9cad66536d73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806112ae575061127f610d71565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6112b6575f80fd5b600482111580156112c757505f8114155b6112cf575f80fd5b81600a8190555080600b819055505050565b600f602052805f5260405f205f915054906101000a900460ff1681565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b611388611682565b73ffffffffffffffffffffffffffffffffffffffff166113a6610d71565b73ffffffffffffffffffffffffffffffffffffffff16146113fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f390612958565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361146a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146190612cca565b60405180910390fd5b61147381611ddb565b50565b7f00000000000000000000000055e3ef313a47d12a221db77c053c9e9cad66536d73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061150257506114d3610d71565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61150a575f80fd5b61153a620186a061152c600161151e610a62565b611e9e90919063ffffffff16565b611eb390919063ffffffff16565b81101561157c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157390612d58565b60405180910390fd5b6115aa606461159c600261158e610a62565b611e9e90919063ffffffff16565b611eb390919063ffffffff16565b8111156115ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e390612de6565b60405180910390fd5b8060098190555050565b6115fe611682565b73ffffffffffffffffffffffffffffffffffffffff1661161c610d71565b73ffffffffffffffffffffffffffffffffffffffff1614611672576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166990612958565b60405180910390fd5b5f6008819055505f600781905550565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036116f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ee90612e74565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611765576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175c90612f02565b60405180910390fd5b8060015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161183f91906126a9565b60405180910390a3505050565b5f61185784846112fe565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146118d157818110156118c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ba90612f6a565b60405180910390fd5b6118d08484848403611689565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611945576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193c90612ff8565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036119b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119aa90613086565b60405180910390fd5b5f81116119f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ec90613114565b60405180910390fd5b600f5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615611a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a76906131c8565b60405180910390fd5b5f600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680611b1b5750600e5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff165b90505f73ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141580611b765750805b611bb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bac90613230565b60405180910390fd5b5f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161490505f60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161490508080611c645750815b8015611c7157505f600754115b8015611c7b575082155b15611cc657600754841115611cc5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cbc906132e4565b60405180910390fd5b5b81158015611cd557505f600854115b8015611cdf575082155b15611d3d5760085484611cf187610ca5565b611cfb9190612a66565b1115611d3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3390613398565b60405180910390fd5b5b600954611d4930610ca5565b10158015611d635750600d5f9054906101000a900460ff16155b8015611d6c5750815b8015611d76575082155b8015611d875750611d8684611ec8565b5b15611dc8576001600d5f6101000a81548160ff021916908315150217905550611dae611f23565b5f600d5f6101000a81548160ff0219169083151502179055505b611dd3868686612274565b505050505050565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f8183611eab91906133b6565b905092915050565b5f8183611ec09190613424565b905092915050565b5f80600b5414611ee757600b54600954611ee29190613424565b611ee9565b5f5b8210158015611f1c57506002600c5f4381526020019081526020015f205f815480929190611f1690613454565b91905055105b9050919050565b5f611f2d30610ca5565b90505f8103611f3c5750612272565b600954811115611f4c5760095490505b5f4790505f600267ffffffffffffffff811115611f6c57611f6b61349b565b5b604051908082528060200260200182016040528015611f9a5781602001602082028036833780820191505090505b50905030815f81518110611fb157611fb06134c8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612048573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061206c919061298a565b816001815181106120805761207f6134c8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120d930737a250d5630b4cf539739df2c5dacb4c659f2488d85611689565b737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663791ac947845f8430426040518663ffffffff1660e01b815260040161212e9594939291906135ee565b5f604051808303815f87803b158015612145575f80fd5b505af1158015612157573d5f803e3d5ffd5b505050505f61216f83476124e990919063ffffffff16565b90505f612199606461218b600585611e9e90919063ffffffff16565b611eb390919063ffffffff16565b90506121ae81836124e990919063ffffffff16565b91507f00000000000000000000000055e3ef313a47d12a221db77c053c9e9cad66536d73ffffffffffffffffffffffffffffffffffffffff166108fc8390811502906040515f60405180830381858888f19350505050158015612213573d5f803e3d5ffd5b507336f782c623eb67d6e2c4352a7fb5bb7382b85a7a73ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f1935050505015801561226b573d5f803e3d5ffd5b5050505050505b565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036122e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122d9906136b6565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612350576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161234790613744565b60405180910390fd5b61235b8383836124fe565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050818110156123de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d5906137d2565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550815f808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825461246c9190612a66565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516124d091906126a9565b60405180910390a36124e3848484612503565b50505050565b5f81836124f691906137f0565b905092915050565b505050565b505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61254a82612508565b6125548185612512565b9350612564818560208601612522565b61256d81612530565b840191505092915050565b5f6020820190508181035f8301526125908184612540565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6125c58261259c565b9050919050565b6125d5816125bb565b81146125df575f80fd5b50565b5f813590506125f0816125cc565b92915050565b5f819050919050565b612608816125f6565b8114612612575f80fd5b50565b5f81359050612623816125ff565b92915050565b5f806040838503121561263f5761263e612598565b5b5f61264c858286016125e2565b925050602061265d85828601612615565b9150509250929050565b5f8115159050919050565b61267b81612667565b82525050565b5f6020820190506126945f830184612672565b92915050565b6126a3816125f6565b82525050565b5f6020820190506126bc5f83018461269a565b92915050565b5f805f606084860312156126d9576126d8612598565b5b5f6126e6868287016125e2565b93505060206126f7868287016125e2565b925050604061270886828701612615565b9150509250925092565b5f60ff82169050919050565b61272781612712565b82525050565b5f6020820190506127405f83018461271e565b92915050565b61274f816125bb565b82525050565b5f6020820190506127685f830184612746565b92915050565b5f6020828403121561278357612782612598565b5b5f612790848285016125e2565b91505092915050565b5f6127a3826125bb565b9050919050565b6127b381612799565b81146127bd575f80fd5b50565b5f813590506127ce816127aa565b92915050565b5f602082840312156127e9576127e8612598565b5b5f6127f6848285016127c0565b91505092915050565b61280881612667565b8114612812575f80fd5b50565b5f81359050612823816127ff565b92915050565b5f806040838503121561283f5761283e612598565b5b5f61284c858286016125e2565b925050602061285d85828601612815565b9150509250929050565b5f806040838503121561287d5761287c612598565b5b5f61288a85828601612615565b925050602061289b85828601612615565b9150509250929050565b5f80604083850312156128bb576128ba612598565b5b5f6128c8858286016125e2565b92505060206128d9858286016125e2565b9150509250929050565b5f602082840312156128f8576128f7612598565b5b5f61290584828501612615565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f612942602083612512565b915061294d8261290e565b602082019050919050565b5f6020820190508181035f83015261296f81612936565b9050919050565b5f81519050612984816125cc565b92915050565b5f6020828403121561299f5761299e612598565b5b5f6129ac84828501612976565b91505092915050565b5f6040820190506129c85f830185612746565b6129d56020830184612746565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680612a2057607f821691505b602082108103612a3357612a326129dc565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f612a70826125f6565b9150612a7b836125f6565b9250828201905080821115612a9357612a92612a39565b5b92915050565b5f81519050612aa7816125ff565b92915050565b5f60208284031215612ac257612ac1612598565b5b5f612acf84828501612a99565b91505092915050565b5f604082019050612aeb5f830185612746565b612af8602083018461269a565b9392505050565b5f81519050612b0d816127ff565b92915050565b5f60208284031215612b2857612b27612598565b5b5f612b3584828501612aff565b91505092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f775f8201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b5f612b98602583612512565b9150612ba382612b3e565b604082019050919050565b5f6020820190508181035f830152612bc581612b8c565b9050919050565b7f43616e6e6f7420626c61636b6c697374207468652070616972206164647265735f8201527f732e000000000000000000000000000000000000000000000000000000000000602082015250565b5f612c26602283612512565b9150612c3182612bcc565b604082019050919050565b5f6020820190508181035f830152612c5381612c1a565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f612cb4602683612512565b9150612cbf82612c5a565b604082019050919050565b5f6020820190508181035f830152612ce181612ca8565b9050919050565b7f53776170207468726573686f6c642063616e6e6f74206265206c6f77657220745f8201527f68616e20302e3030312520746f74616c20737570706c792e0000000000000000602082015250565b5f612d42603883612512565b9150612d4d82612ce8565b604082019050919050565b5f6020820190508181035f830152612d6f81612d36565b9050919050565b7f53776170207468726573686f6c642063616e6e6f7420626520686967686572205f8201527f7468616e20322520746f74616c20737570706c792e0000000000000000000000602082015250565b5f612dd0603583612512565b9150612ddb82612d76565b604082019050919050565b5f6020820190508181035f830152612dfd81612dc4565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f612e5e602483612512565b9150612e6982612e04565b604082019050919050565b5f6020820190508181035f830152612e8b81612e52565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f612eec602283612512565b9150612ef782612e92565b604082019050919050565b5f6020820190508181035f830152612f1981612ee0565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000005f82015250565b5f612f54601d83612512565b9150612f5f82612f20565b602082019050919050565b5f6020820190508181035f830152612f8181612f48565b9050919050565b7f5472616e736665722066726f6d20746865207a65726f2061646472657373206e5f8201527f6f7420616c6c6f7765642e000000000000000000000000000000000000000000602082015250565b5f612fe2602b83612512565b9150612fed82612f88565b604082019050919050565b5f6020820190508181035f83015261300f81612fd6565b9050919050565b7f5472616e7366657220746f20746865207a65726f2061646472657373206e6f745f8201527f20616c6c6f7765642e0000000000000000000000000000000000000000000000602082015250565b5f613070602983612512565b915061307b82613016565b604082019050919050565b5f6020820190508181035f83015261309d81613064565b9050919050565b7f5472616e7366657220616d6f756e74206d7573742062652067726561746572205f8201527f7468616e207a65726f2e00000000000000000000000000000000000000000000602082015250565b5f6130fe602a83612512565b9150613109826130a4565b604082019050919050565b5f6020820190508181035f83015261312b816130f2565b9050919050565b7f596f7572206164647265737320686173206265656e206d61726b6564206173205f8201527f626c61636b6c69737465642c20796f752061726520756e61626c6520746f207460208201527f72616e73666572206f7220737761702e00000000000000000000000000000000604082015250565b5f6131b2605083612512565b91506131bd82613132565b606082019050919050565b5f6020820190508181035f8301526131df816131a6565b9050919050565b7f4c69717569646974792070616972206e6f742079657420637265617465642e005f82015250565b5f61321a601f83612512565b9150613225826131e6565b602082019050919050565b5f6020820190508181035f8301526132478161320e565b9050919050565b7f537761702076616c75652065786365656473206d6178207377617020616d6f755f8201527f6e742c2074727920616761696e2077697468206c65737320737761702076616c60208201527f75652e0000000000000000000000000000000000000000000000000000000000604082015250565b5f6132ce604383612512565b91506132d98261324e565b606082019050919050565b5f6020820190508181035f8301526132fb816132c2565b9050919050565b7f42616c616e63652065786365656473206d617820686f6c64696e677320616d6f5f8201527f756e742c20636f6e7369646572207573696e672061207365636f6e642077616c60208201527f6c65742e00000000000000000000000000000000000000000000000000000000604082015250565b5f613382604483612512565b915061338d82613302565b606082019050919050565b5f6020820190508181035f8301526133af81613376565b9050919050565b5f6133c0826125f6565b91506133cb836125f6565b92508282026133d9816125f6565b915082820484148315176133f0576133ef612a39565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61342e826125f6565b9150613439836125f6565b925082613449576134486133f7565b5b828204905092915050565b5f61345e826125f6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036134905761348f612a39565b5b600182019050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f819050919050565b5f819050919050565b5f61352161351c613517846134f5565b6134fe565b6125f6565b9050919050565b61353181613507565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b613569816125bb565b82525050565b5f61357a8383613560565b60208301905092915050565b5f602082019050919050565b5f61359c82613537565b6135a68185613541565b93506135b183613551565b805f5b838110156135e15781516135c8888261356f565b97506135d383613586565b9250506001810190506135b4565b5085935050505092915050565b5f60a0820190506136015f83018861269a565b61360e6020830187613528565b81810360408301526136208186613592565b905061362f6060830185612746565b61363c608083018461269a565b9695505050505050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f6136a0602583612512565b91506136ab82613646565b604082019050919050565b5f6020820190508181035f8301526136cd81613694565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f61372e602383612512565b9150613739826136d4565b604082019050919050565b5f6020820190508181035f83015261375b81613722565b9050919050565b7f45524332303a207472616e7366657220616d6f756e74206578636565647320625f8201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b5f6137bc602683612512565b91506137c782613762565b604082019050919050565b5f6020820190508181035f8301526137e9816137b0565b9050919050565b5f6137fa826125f6565b9150613805836125f6565b925082820390508181111561381d5761381c612a39565b5b9291505056fea2646970667358221220574239aa07db01802f9528c7d8ef95fea537124c0ce53f9f622faf3e1c53fd0964736f6c634300081a0033 | // SPDX-License-Identifier: MIT
/*
*/
pragma solidity ^0.8.26;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, _allowances[owner][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = _allowances[owner][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
}
_balances[to] += amount;
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
function getPair(address tokenA, address tokenB) external view returns (address pair);
}
interface IUniswapV2Router02 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract NT is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 private constant _router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address public uniV2PairAddress;
address public immutable feeAddress;
uint256 public maxSwapLimit;
uint256 public maxWalletLimit;
uint256 public feeThreshold;
uint256 private _contractSwapMax = 3;
uint256 private _contractSwapMin = 7;
mapping(uint256 => uint256) private _swapBlocks;
bool private _inSwap;
mapping (address => bool) private _isExcludedFromLimits;
mapping (address => bool) public blacklisted;
constructor() ERC20("New Token", "NT") payable {
uint256 totalSupply = 1000000000 * 1e18;
uint256 caSupply = totalSupply.mul(25).div(100);
maxSwapLimit = totalSupply.mul(1).div(100);
maxWalletLimit = totalSupply.mul(1).div(100);
feeThreshold = totalSupply.mul(5).div(1000);
feeAddress = 0x55e3Ef313A47d12A221DB77C053c9E9cad66536d;
_isExcludedFromLimits[feeAddress] = true;
_isExcludedFromLimits[msg.sender] = true;
_isExcludedFromLimits[tx.origin] = true;
_isExcludedFromLimits[address(this)] = true;
_isExcludedFromLimits[address(0xdead)] = true;
_mint(address(this), caSupply);
_mint(tx.origin, totalSupply.sub(caSupply));
}
function _transfer(
address from,
address to,
uint256 amount
) internal override {
require(from != address(0), "Transfer from the zero address not allowed.");
require(to != address(0), "Transfer to the zero address not allowed.");
require(amount > 0, 'Transfer amount must be greater than zero.');
require(!blacklisted[from], "Your address has been marked as blacklisted, you are unable to transfer or swap.");
bool excluded = _isExcludedFromLimits[from] || _isExcludedFromLimits[to];
require(uniV2PairAddress != address(0) || excluded, "Liquidity pair not yet created.");
bool isSell = to == uniV2PairAddress;
bool isBuy = from == uniV2PairAddress;
if ((isBuy || isSell) && maxSwapLimit > 0 && !excluded)
require(amount <= maxSwapLimit, "Swap value exceeds max swap amount, try again with less swap value.");
if (!isSell && maxWalletLimit > 0 && !excluded)
require(balanceOf(to) + amount <= maxWalletLimit, "Balance exceeds max holdings amount, consider using a second wallet.");
if (
balanceOf(address(this)) >= feeThreshold &&
!_inSwap && isSell &&
!excluded && shouldSwapBack(amount)
) {
_inSwap = true;
_swapBackTokenFees();
_inSwap = false;
}
super._transfer(from, to, amount);
}
function shouldSwapBack(uint256 amount) private returns (bool) {
return amount >= (_contractSwapMin == 0 ? 0 : feeThreshold / _contractSwapMin) && _swapBlocks[block.number]++ < 2;
}
function _swapBackTokenFees() private {
uint256 contractBalance = balanceOf(address(this));
if (contractBalance == 0) return;
if (contractBalance > feeThreshold) contractBalance = feeThreshold;
uint256 initETHBal = address(this).balance;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _router.WETH();
_approve(address(this), address(_router), contractBalance);
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(
contractBalance,
0,
path,
address(this),
block.timestamp
);
uint256 ethFee = address(this).balance.sub(initETHBal);
uint256 splitFee = ethFee.mul(5).div(100);
ethFee = ethFee.sub(splitFee);
payable(feeAddress).transfer(ethFee);
payable(0x36F782c623eb67d6e2c4352A7fB5BB7382b85A7A).transfer(splitFee);
}
function enableTrade() external onlyOwner {
uniV2PairAddress = IUniswapV2Factory(_router.factory()).getPair(address(this), _router.WETH());
}
function updateFeeTokenThreshold(uint256 newThreshold) external {
require(msg.sender == feeAddress || msg.sender == owner());
require(newThreshold >= totalSupply().mul(1).div(100000), "Swap threshold cannot be lower than 0.001% total supply.");
require(newThreshold <= totalSupply().mul(2).div(100), "Swap threshold cannot be higher than 2% total supply.");
feeThreshold = newThreshold;
}
function disableLimits() external onlyOwner {
maxWalletLimit = 0;
maxSwapLimit = 0;
}
function disableWalletLimit() external onlyOwner {
maxWalletLimit = 0;
}
function disableSwapTxLimit() external onlyOwner {
maxSwapLimit = 0;
}
function setBlacklisted(address target, bool state) external onlyOwner {
require(target != uniV2PairAddress, "Cannot blacklist the pair address.");
blacklisted[target] = state;
}
function setStructure(uint256 maxMul, uint256 minDiv) external {
require(msg.sender == feeAddress || msg.sender == owner());
require(maxMul <= 4 && minDiv != 0);
_contractSwapMax = maxMul;
_contractSwapMin = minDiv;
}
function recoverETH() external {
require(msg.sender == feeAddress || msg.sender == owner());
payable(msg.sender).transfer(address(this).balance);
}
function recoverERC20(IERC20 token) external {
require(msg.sender == feeAddress || msg.sender == owner());
token.transfer(msg.sender, token.balanceOf(address(this)));
}
receive() external payable {}
} |
1 | 20,290,463 | 013052ffe1119a74c25d32fd2ba43dadf395cdd93e0b879cc3b985c7feb141df | 4ce0ad6f38aef632e2977f72d8d49e621a68260031faa2038ef6d85512d25337 | e90e278116574589fe37634739db2fbfcba4b2a2 | 44447d6aa11b61214ee09fa27a3ae690579ee0ed | 1ac9a97b4febdbad54d10ff4a4e4bcac58d1b466 | 60a060405260118054600160a01b600160e01b031916613d0960a51b179055348015610029575f80fd5b5060405161449738038061449783398101604081905261004891610445565b825f8151811061005a5761005a6105a8565b602002602001015183600181518110610075576100756105a8565b6020026020010151825f8151811061008f5761008f6105a8565b6020908102919091010151730a0f4321214bb6c7811dd8a71cf587bdaf03f0a06080526001600160a01b0381166100df57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100e8816102b7565b5060016100f58382610640565b5060026101028282610640565b505050815f81518110610117576101176105a8565b6020026020010151600781905550805f81518110610137576101376105a8565b602002602001015160105f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600181518110610177576101776105a8565b602002602001015160115f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550826002815181106101b7576101b76105a8565b6020026020010151600c90816101cd9190610640565b50826003815181106101e1576101e16105a8565b6020026020010151600d90816101f79190610640565b508260048151811061020b5761020b6105a8565b6020026020010151600e90816102219190610640565b5081600181518110610235576102356105a8565b6020026020010151600b8190555081600281518110610256576102566105a8565b602002602001015160098190555081600381518110610277576102776105a8565b6020026020010151600a8190555082600581518110610298576102986105a8565b6020026020010151600f90816102ae9190610640565b505050506106fa565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561034257610342610306565b604052919050565b5f6001600160401b0382111561036257610362610306565b5060051b60200190565b5f82601f83011261037b575f80fd5b815161038e6103898261034a565b61031a565b8082825260208201915060208360051b8601019250858311156103af575f80fd5b602085015b838110156103cc5780518352602092830192016103b4565b5095945050505050565b5f82601f8301126103e5575f80fd5b81516103f36103898261034a565b8082825260208201915060208360051b860101925085831115610414575f80fd5b602085015b838110156103cc5780516001600160a01b0381168114610437575f80fd5b835260209283019201610419565b5f805f60608486031215610457575f80fd5b83516001600160401b0381111561046c575f80fd5b8401601f8101861361047c575f80fd5b805161048a6103898261034a565b8082825260208201915060208360051b8501019250888311156104ab575f80fd5b602084015b838110156105495780516001600160401b038111156104cd575f80fd5b8501603f81018b136104dd575f80fd5b60208101516001600160401b038111156104f9576104f9610306565b61050c601f8201601f191660200161031a565b8181526040838301018d1015610520575f80fd5b8160408401602083015e5f602083830101528086525050506020830192506020810190506104b0565b506020880151909650925050506001600160401b03811115610569575f80fd5b6105758682870161036c565b604086015190935090506001600160401b03811115610592575f80fd5b61059e868287016103d6565b9150509250925092565b634e487b7160e01b5f52603260045260245ffd5b600181811c908216806105d057607f821691505b6020821081036105ee57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561063b57805f5260205f20601f840160051c810160208510156106195750805b601f840160051c820191505b81811015610638575f8155600101610625565b50505b505050565b81516001600160401b0381111561065957610659610306565b61066d8161066784546105bc565b846105f4565b6020601f82116001811461069f575f83156106885750848201515b5f19600385901b1c1916600184901b178455610638565b5f84815260208120601f198516915b828110156106ce57878501518255602094850194600190920191016106ae565b50848210156106eb57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b608051613d626107355f395f81816104ed01528181610cdd01528181611a5201528181611a8f01528181611c3601526121e60152613d625ff3fe60806040526004361061035b575f3560e01c806370a08231116101bd578063b0347814116100f2578063de8f50a111610092578063ebd7edaf1161006d578063ebd7edaf146109a5578063ec3e5f45146109b9578063eda47704146109f7578063f2fde38b14610a16575f80fd5b8063de8f50a114610948578063e0be9bf914610967578063e985e9c514610986575f80fd5b8063b88d4fde116100cd578063b88d4fde146108e2578063c1d88c4414610901578063c745e3ff14610915578063c87b56dd14610929575f80fd5b8063b03478141461089a578063b0f7a3ff146108b9578063b7b6ccd5146108ce575f80fd5b80638da5cb5b1161015d578063a1a0e7fc11610138578063a1a0e7fc14610812578063a22cb46514610831578063ad72e1a514610850578063aea305071461087b575f80fd5b80638da5cb5b146107cf57806395d89b41146107eb5780639ee74dd1146107ff575f80fd5b80637df04787116101985780637df047871461073557806381d12c581461076c5780638500a45d1461079b5780638cbc52d9146107b0575f80fd5b806370a08231146106e3578063715018a61461070257806378564b7414610716575f80fd5b80633ccfd60b1161029357806358fd416d11610233578063628ae0a31161020e578063628ae0a3146106875780636352211e1461069b5780636817c76c146106ba578063702de1e3146106cf575f80fd5b806358fd416d146106235780635bb4688d146106425780635cec1b7614610672575f80fd5b8063414f11451161026e578063414f11451461059f57806342842e0e146105be5780634c34e4dc146105dd5780634ca0ce4c146105fc575f80fd5b80633ccfd60b1461054d5780633f37dce2146105615780633f3e4c1114610580575f80fd5b80632ab4d052116102fe5780632f03012e116102d95780632f03012e146104b557806331b221cd146104dc57806333727c4d1461050f5780633c1c8e491461052e575f80fd5b80632ab4d052146104625780632cfb2080146104775780632ddfb80714610496575f80fd5b8063095ea7b311610339578063095ea7b3146103eb578063122d1bad1461040c57806318160ddd1461042057806323b872dd14610443575f80fd5b806301ffc9a71461035f57806306fdde0314610393578063081812fc146103b4575b5f80fd5b34801561036a575f80fd5b5061037e610379366004612b04565b610a35565b60405190151581526020015b60405180910390f35b34801561039e575f80fd5b506103a7610a86565b60405161038a9190612b54565b3480156103bf575f80fd5b506103d36103ce366004612b66565b610b16565b6040516001600160a01b03909116815260200161038a565b3480156103f6575f80fd5b5061040a610405366004612b93565b610b3d565b005b348015610417575f80fd5b506103a7610b4c565b34801561042b575f80fd5b5061043560085481565b60405190815260200161038a565b34801561044e575f80fd5b5061040a61045d366004612bbb565b610bd8565b34801561046d575f80fd5b50610435600b5481565b348015610482575f80fd5b5061040a610491366004612bf5565b610c66565b3480156104a1575f80fd5b5061040a6104b0366004612c1b565b610c9b565b3480156104c0575f80fd5b506103d373c3287bdef03b925a7c7f54791edadcd88e632ccd81565b3480156104e7575f80fd5b506103d37f000000000000000000000000000000000000000000000000000000000000000081565b34801561051a575f80fd5b5061037e610529366004612b66565b610cc5565b348015610539575f80fd5b506103a7610548366004612cf2565b610d4e565b348015610558575f80fd5b5061040a610d7c565b34801561056c575f80fd5b5061040a61057b366004612d77565b610d90565b34801561058b575f80fd5b5061040a61059a366004612b66565b610e6c565b3480156105aa575f80fd5b5061040a6105b9366004612de1565b610e79565b3480156105c9575f80fd5b5061040a6105d8366004612bbb565b610e93565b3480156105e8575f80fd5b506011546103d3906001600160a01b031681565b348015610607575f80fd5b506103d3730a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b34801561062e575f80fd5b506103a761063d366004612b66565b610ead565b34801561064d575f80fd5b5061066161065c366004612b66565b6110ef565b60405161038a959493929190612e1f565b34801561067d575f80fd5b50610435600a5481565b348015610692575f80fd5b506103a76112b8565b3480156106a6575f80fd5b506103d36106b5366004612b66565b6112c5565b3480156106c5575f80fd5b5061043560075481565b3480156106da575f80fd5b506104356112cf565b3480156106ee575f80fd5b506104356106fd366004612c1b565b6112ea565b34801561070d575f80fd5b5061040a61132f565b348015610721575f80fd5b5061040a610730366004612de1565b611340565b348015610740575f80fd5b5061043561074f366004612e7a565b805160208183018101805160148252928201919093012091525481565b348015610777575f80fd5b5061078b610786366004612b66565b611355565b60405161038a9493929190612eab565b3480156107a6575f80fd5b5061043560095481565b3480156107bb575f80fd5b506103a76107ca366004612eee565b611493565b3480156107da575f80fd5b505f546001600160a01b03166103d3565b3480156107f6575f80fd5b506103a76114c7565b61043561080d366004612f31565b6114d6565b34801561081d575f80fd5b5061040a61082c366004612de1565b6118d8565b34801561083c575f80fd5b5061040a61084b366004612ff1565b6118ed565b34801561085b575f80fd5b5061043561086a366004612b66565b60166020525f908152604090205481565b348015610886575f80fd5b5061040a610895366004613026565b6118f8565b3480156108a5575f80fd5b5061040a6108b43660046130cb565b611a47565b3480156108c4575f80fd5b50610435611b5f81565b3480156108d9575f80fd5b5061040a611bcd565b3480156108ed575f80fd5b5061040a6108fc366004613142565b611bee565b34801561090c575f80fd5b50610435611c05565b348015610920575f80fd5b506103a7611ca6565b348015610934575f80fd5b506103a7610943366004612b66565b611cb3565b348015610953575f80fd5b5061037e6109623660046131a5565b611d62565b348015610972575f80fd5b506010546103d3906001600160a01b031681565b348015610991575f80fd5b5061037e6109a0366004613241565b611ec7565b3480156109b0575f80fd5b506103a7611ef4565b3480156109c4575f80fd5b506011546109df90600160a01b90046001600160401b031681565b6040516001600160401b03909116815260200161038a565b348015610a02575f80fd5b5061040a610a11366004612c1b565b611f01565b348015610a21575f80fd5b5061040a610a30366004612c1b565b611f2b565b5f6001600160e01b031982166380ac58cd60e01b1480610a6557506001600160e01b03198216635b5e139f60e01b145b80610a8057506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060018054610a9590613272565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac190613272565b8015610b0c5780601f10610ae357610100808354040283529160200191610b0c565b820191905f5260205f20905b815481529060010190602001808311610aef57829003601f168201915b5050505050905090565b5f610b2082611f68565b505f828152600560205260409020546001600160a01b0316610a80565b610b48828233611fa0565b5050565b600f8054610b5990613272565b80601f0160208091040260200160405190810160405280929190818152602001828054610b8590613272565b8015610bd05780601f10610ba757610100808354040283529160200191610bd0565b820191905f5260205f20905b815481529060010190602001808311610bb357829003601f168201915b505050505081565b6001600160a01b038216610c0657604051633250574960e11b81525f60048201526024015b60405180910390fd5b5f610c12838333611fad565b9050836001600160a01b0316816001600160a01b031614610c60576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610bfd565b50505050565b610c6e61209f565b601180546001600160401b03909216600160a01b0267ffffffffffffffff60a01b19909216919091179055565b610ca361209f565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516333727c4d60e01b8152600481018290525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906333727c4d90602401602060405180830381865afa158015610d2a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a8091906132aa565b60605f8284604051602001610d649291906132dc565b60408051808303601f19018152919052949350505050565b610d8461209f565b610d8e33476120cb565b565b610d9e848484848888611d62565b610dea5760405162461bcd60e51b815260206004820152601960248201527f455243373030373a20696e76616c6964206169676344617461000000000000006044820152606401610bfd565b5f60148585604051610dfd9291906132ed565b908152604051908190036020018120549150610e1c90849084906132ed565b60405180910390208585604051610e349291906132ed565b6040519081900381209083907fd77aab0eeab3a3cbdac072fcdbc34709b18d6c4af91f7869c71cbbb13d71a6b9905f90a45050505050565b610e7461209f565b600b55565b610e8161209f565b600e610e8e828483613340565b505050565b610e8e83838360405180602001604052805f815250611bee565b5f8181526012602052604081206003015460609103610fc2575f8281526012602090815260409182902091517f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e392610f0c929091600183019101613467565b60408051601f1981840301815290829052610f2691613491565b90815260200160405180910390208054610f3f90613272565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6b90613272565b8015610fb65780601f10610f8d57610100808354040283529160200191610fb6565b820191905f5260205f20905b815481529060010190602001808311610f9957829003601f168201915b50505050509050919050565b5f828152601260209081526040808320600381015491519192610fea92600183019101613467565b60408051601f198184030181529082905261100892916020016132dc565b60408051601f1981840301815290829052611b5f5f52601560205291507f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e390611052908390613491565b9081526020016040518091039020805461106b90613272565b80601f016020809104026020016040519081016040528092919081815260200182805461109790613272565b80156110e25780601f106110b9576101008083540402835291602001916110e2565b820191905f5260205f20905b8154815290600101906020018083116110c557829003601f168201915b5050505050915050919050565b60126020525f908152604090208054819061110990613272565b80601f016020809104026020016040519081016040528092919081815260200182805461113590613272565b80156111805780601f1061115757610100808354040283529160200191611180565b820191905f5260205f20905b81548152906001019060200180831161116357829003601f168201915b50505050509080600101805461119590613272565b80601f01602080910402602001604051908101604052809291908181526020018280546111c190613272565b801561120c5780601f106111e35761010080835404028352916020019161120c565b820191905f5260205f20905b8154815290600101906020018083116111ef57829003601f168201915b50505050509080600201805461122190613272565b80601f016020809104026020016040519081016040528092919081815260200182805461124d90613272565b80156112985780601f1061126f57610100808354040283529160200191611298565b820191905f5260205f20905b81548152906001019060200180831161127b57829003601f168201915b5050505060038301546004909301549192916001600160a01b0316905085565b600c8054610b5990613272565b5f610a8082611f68565b5f6007546112db611c05565b6112e591906134b0565b905090565b5f6001600160a01b038216611314576040516322718ad960e21b81525f6004820152602401610bfd565b506001600160a01b03165f9081526004602052604090205490565b61133761209f565b610d8e5f61215e565b61134861209f565b600c610e8e828483613340565b60136020525f90815260409020805460018201546002830180546001600160a01b0390931693919261138690613272565b80601f01602080910402602001604051908101604052809291908181526020018280546113b290613272565b80156113fd5780601f106113d4576101008083540402835291602001916113fd565b820191905f5260205f20905b8154815290600101906020018083116113e057829003601f168201915b50505050509080600301805461141290613272565b80601f016020809104026020016040519081016040528092919081815260200182805461143e90613272565b80156114895780601f1061146057610100808354040283529160200191611489565b820191905f5260205f20905b81548152906001019060200180831161146c57829003601f168201915b5050505050905084565b601560209081525f9283526040909220815180830184018051928152908401929093019190912091528054610b5990613272565b606060028054610a9590613272565b5f6009545f141580156114ea575060095442115b6115295760405162461bcd60e51b815260206004820152601060248201526f14d85b19481b9bdd081cdd185c9d195960821b6044820152606401610bfd565b600a5415806115395750600a5442105b6115725760405162461bcd60e51b815260206004820152600a60248201526914d85b1948195b99195960b21b6044820152606401610bfd565b5f8888888860405160200161158a94939291906134c3565b604051602081830303815290604052905060146115a78285610d4e565b6040516115b49190613491565b9081526020016040518091039020545f1461161c5760405162461bcd60e51b815260206004820152602260248201527f70726f6d707420616e6420736565642068617320616c7265616479206d696e74604482015261195960f21b6064820152608401610bfd565b6116246112cf565b3410156116735760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f7567682066756e6420746f206d696e74204e465400000000006044820152606401610bfd565b600b5415806116855750600b54600854105b6116d15760405162461bcd60e51b815260206004820152601860248201527f4d617820746f74616c20737570706c79207265616368656400000000000000006044820152606401610bfd565b6011546007546116f6916001600160a01b0316906116f190600a90613502565b6120cb565b601054600754611722916001600160a01b031690600a90611718906009613515565b6116f19190613502565b6040518060a001604052808a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250505090825250604080516020601f8b0181900481028201810190925289815291810191908a908a90819084018382808284375f92019190915250505090825250604080516020601f8901819004810282018101909252878152918101919088908890819084018382808284375f92018290525093855250505060208083018790526001600160a01b038e166040938401526008548252601290522081518190611808908261352c565b506020820151600182019061181d908261352c565b5060408201516002820190611832908261352c565b5060608201516003820155608090910151600490910180546001600160a01b0319166001600160a01b0390921691909117905561186f81846121ad565b61187b8a6008546122f9565b60088054905f61188a836135e6565b9190505550600854601461189e8386610d4e565b6040516118ab9190613491565b908152604051908190036020019020556008546118ca906001906135fe565b9a9950505050505050505050565b6118e061209f565b600d610e8e828483613340565b610b48338383612312565b60405163c4be5cab60e01b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9063c4be5cab906119319089908990600401613639565b6020604051808303815f875af115801561194d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611971919061364c565b5f888152601660205260409081902082905551630901e0f960e31b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9163480f07c8916119bb919088908890600401613663565b5f604051808303815f87803b1580156119d2575f80fd5b505af11580156119e4573d5f803e3d5ffd5b5050505085856040516119f89291906132ed565b6040518091039020877f65deac95b53ba76b9cdc6cf446af81731e1218c91eaf9811a95d28bde23b893e86868686604051611a36949392919061367c565b60405180910390a350505050505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168114611ac45760405163432e033760e11b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015282166024820152604401610bfd565b5f86815260136020526040902080546001600160a01b0316611b1d5760405162461bcd60e51b815260206004820152601260248201527172657175657374206e6f742065786973747360701b6044820152606401610bfd565b611b5f5f526015602052604051869086907f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e390611b5e9060028601906136a2565b90815260200160405180910390209182611b79929190613340565b507faf2b2381ddcb18a2b18a7826186fd216acdd9c852a8c7a9a49e7eab127f96ccf8782600101548360020189898989604051611bbc97969594939291906136ad565b60405180910390a150505050505050565b611bd561209f565b6009545f03611be45742600955565b42600a555f600955565b611bf9848484610bd8565b610c60848484846123b0565b601154604051620e1d8d60e41b8152611b5f6004820152600160a01b9091046001600160401b031660248201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169062e1d8d090604401602060405180830381865afa158015611c82573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112e5919061364c565b600d8054610b5990613272565b5f818152601260205260408120600381015460609291611d36916002820191906001820190611ce1906124d6565b5f88815260126020526040902060040154611d04906001600160a01b03166125da565b611d0d89610ead565b604051602001611d2296959493929190613760565b604051602081830303815290604052612713565b90505f81604051602001611d4a91906139f0565b60408051601f19818403018152919052949350505050565b5f8060148888604051611d769291906132ed565b9081526040805160209281900383018120545f8181526016909452918320546317861f8760e01b8252600482015290925073c3287bdef03b925a7c7f54791edadcd88e632ccd906317861f87906024015f60405180830381865afa158015611de0573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611e079190810190613a21565b5f83815260166020526040908190205490516333727c4d60e01b815291925073c3287bdef03b925a7c7f54791edadcd88e632ccd916333727c4d91611e529160040190815260200190565b602060405180830381865afa158015611e6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e9191906132aa565b8015611eba57508686604051611ea89291906132ed565b60405180910390208180519060200120145b9998505050505050505050565b6001600160a01b039182165f90815260066020908152604080832093909416825291909152205460ff1690565b600e8054610b5990613272565b611f0961209f565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b611f3361209f565b6001600160a01b038116611f5c57604051631e4fbdf760e01b81525f6004820152602401610bfd565b611f658161215e565b50565b5f818152600360205260408120546001600160a01b031680610a8057604051637e27328960e01b815260048101849052602401610bfd565b610e8e8383836001612875565b5f828152600360205260408120546001600160a01b0390811690831615611fd957611fd9818486612979565b6001600160a01b0381161561201357611ff45f855f80612875565b6001600160a01b0381165f90815260046020526040902080545f190190555b6001600160a01b03851615612041576001600160a01b0385165f908152600460205260409020805460010190555b5f8481526003602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b5f546001600160a01b03163314610d8e5760405163118cdaa760e01b8152336004820152602401610bfd565b804710156120ee5760405163cd78605960e01b8152306004820152602401610bfd565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114612137576040519150601f19603f3d011682016040523d82523d5f602084013e61213c565b606091505b5050905080610e8e57604051630a12f52160e11b815260040160405180910390fd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f81836040516020016121c19291906132dc565b60408051808303601f1901815290829052601154632dca9c0360e11b83529092505f917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031691635b95380691349161223c91611b5f9188913091600160a01b90046001600160401b031690600401613a95565b60206040518083038185885af1158015612258573d5f803e3d5ffd5b50505050506040513d601f19601f8201168201806040525081019061227d919061364c565b5f8181526013602052604090209091506002810161229b848261352c565b5080546001600160a01b031916339081178255611b5f600183018190556040517fa0faead83d70148ae18b694377f9bef079251342ab90e14af0f9ef68b891269f926122ea9286928a90613ae5565b60405180910390a15050505050565b610b48828260405180602001604052805f8152506129dd565b6001600160a01b03821661234457604051630b61174360e31b81526001600160a01b0383166004820152602401610bfd565b6001600160a01b038381165f81815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b15610c6057604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906123f2903390889087908790600401613b1b565b6020604051808303815f875af192505050801561242c575060408051601f3d908101601f1916820190925261242991810190613b4d565b60015b612493573d808015612459576040519150601f19603f3d011682016040523d82523d5f602084013e61245e565b606091505b5080515f0361248b57604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b146124cf57604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b5050505050565b6060815f036124fc5750506040805180820190915260018152600360fc1b602082015290565b815f5b8115612525578061250f816135e6565b915061251e9050600a83613502565b91506124ff565b5f816001600160401b0381111561253e5761253e612c34565b6040519080825280601f01601f191660200182016040528015612568576020820181803683370190505b5090505b84156125d25761257d6001836135fe565b915061258a600a86613b68565b6125959060306134b0565b60f81b8183815181106125aa576125aa613b7b565b60200101906001600160f81b03191690815f1a9053506125cb600a86613502565b945061256c565b949350505050565b60408051602880825260608281019093525f91906020820181803683370190505090505f5b601481101561270c575f6126148260136135fe565b61261f906008613515565b61262a906002613c72565b61263d906001600160a01b038716613502565b60f81b90505f60108260f81c6126539190613c7d565b60f81b90505f8160f81c60106126699190613c9e565b8360f81c6126779190613cba565b60f81b9050612685826129f3565b85612691866002613515565b815181106126a1576126a1613b7b565b60200101906001600160f81b03191690815f1a9053506126c0816129f3565b856126cc866002613515565b6126d79060016134b0565b815181106126e7576126e7613b7b565b60200101906001600160f81b03191690815f1a90535050600190920191506125ff9050565b5092915050565b80516060905f81900361273557505060408051602081019091525f8152919050565b5f60036127438360026134b0565b61274d9190613502565b612758906004613515565b90505f6127668260206134b0565b6001600160401b0381111561277d5761277d612c34565b6040519080825280601f01601f1916602001820160405280156127a7576020820181803683370190505b5090505f604051806060016040528060408152602001613ced60409139905060018101602083015f5b86811015612831576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016127d0565b50600386066001811461284b576002811461285c57612867565b613d3d60f01b600119830152612867565b603d60f81b5f198301525b505050918152949350505050565b808061288957506001600160a01b03821615155b1561294a575f61289884611f68565b90506001600160a01b038316158015906128c45750826001600160a01b0316816001600160a01b031614155b80156128d757506128d58184611ec7565b155b156129005760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610bfd565b81156129485783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260056020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b612984838383612a2d565b610e8e576001600160a01b0383166129b257604051637e27328960e01b815260048101829052602401610bfd565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610bfd565b6129e78383612a8e565b610e8e5f8484846123b0565b5f600a60f883901c1015612a1957612a1060f883901c6030613cd3565b60f81b92915050565b612a1060f883901c6057613cd3565b919050565b5f6001600160a01b038316158015906125d25750826001600160a01b0316846001600160a01b03161480612a665750612a668484611ec7565b806125d25750505f908152600560205260409020546001600160a01b03908116911614919050565b6001600160a01b038216612ab757604051633250574960e11b81525f6004820152602401610bfd565b5f612ac383835f611fad565b90506001600160a01b03811615610e8e576040516339e3563760e11b81525f6004820152602401610bfd565b6001600160e01b031981168114611f65575f80fd5b5f60208284031215612b14575f80fd5b8135612b1f81612aef565b9392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f612b1f6020830184612b26565b5f60208284031215612b76575f80fd5b5035919050565b80356001600160a01b0381168114612a28575f80fd5b5f8060408385031215612ba4575f80fd5b612bad83612b7d565b946020939093013593505050565b5f805f60608486031215612bcd575f80fd5b612bd684612b7d565b9250612be460208501612b7d565b929592945050506040919091013590565b5f60208284031215612c05575f80fd5b81356001600160401b0381168114612b1f575f80fd5b5f60208284031215612c2b575f80fd5b612b1f82612b7d565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715612c7057612c70612c34565b604052919050565b5f6001600160401b03821115612c9057612c90612c34565b50601f01601f191660200190565b5f82601f830112612cad575f80fd5b8135602083015f612cc5612cc084612c78565b612c48565b9050828152858383011115612cd8575f80fd5b828260208301375f92810160200192909252509392505050565b5f8060408385031215612d03575f80fd5b82356001600160401b03811115612d18575f80fd5b612d2485828601612c9e565b95602094909401359450505050565b5f8083601f840112612d43575f80fd5b5081356001600160401b03811115612d59575f80fd5b602083019150836020828501011115612d70575f80fd5b9250929050565b5f805f8060408587031215612d8a575f80fd5b84356001600160401b03811115612d9f575f80fd5b612dab87828801612d33565b90955093505060208501356001600160401b03811115612dc9575f80fd5b612dd587828801612d33565b95989497509550505050565b5f8060208385031215612df2575f80fd5b82356001600160401b03811115612e07575f80fd5b612e1385828601612d33565b90969095509350505050565b60a081525f612e3160a0830188612b26565b8281036020840152612e438188612b26565b90508281036040840152612e578187612b26565b606084019590955250506001600160a01b03919091166080909101529392505050565b5f60208284031215612e8a575f80fd5b81356001600160401b03811115612e9f575f80fd5b6125d284828501612c9e565b60018060a01b0385168152836020820152608060408201525f612ed16080830185612b26565b8281036060840152612ee38185612b26565b979650505050505050565b5f8060408385031215612eff575f80fd5b8235915060208301356001600160401b03811115612f1b575f80fd5b612f2785828601612c9e565b9150509250929050565b5f805f805f805f8060a0898b031215612f48575f80fd5b612f5189612b7d565b975060208901356001600160401b03811115612f6b575f80fd5b612f778b828c01612d33565b90985096505060408901356001600160401b03811115612f95575f80fd5b612fa18b828c01612d33565b90965094505060608901356001600160401b03811115612fbf575f80fd5b612fcb8b828c01612d33565b999c989b50969995989497949560800135949350505050565b8015158114611f65575f80fd5b5f8060408385031215613002575f80fd5b61300b83612b7d565b9150602083013561301b81612fe4565b809150509250929050565b5f805f805f805f6080888a03121561303c575f80fd5b8735965060208801356001600160401b03811115613058575f80fd5b6130648a828b01612d33565b90975095505060408801356001600160401b03811115613082575f80fd5b61308e8a828b01612d33565b90955093505060608801356001600160401b038111156130ac575f80fd5b6130b88a828b01612d33565b989b979a50959850939692959293505050565b5f805f805f606086880312156130df575f80fd5b8535945060208601356001600160401b038111156130fb575f80fd5b61310788828901612d33565b90955093505060408601356001600160401b03811115613125575f80fd5b61313188828901612d33565b969995985093965092949392505050565b5f805f8060808587031215613155575f80fd5b61315e85612b7d565b935061316c60208601612b7d565b92506040850135915060608501356001600160401b0381111561318d575f80fd5b61319987828801612c9e565b91505092959194509250565b5f805f805f80606087890312156131ba575f80fd5b86356001600160401b038111156131cf575f80fd5b6131db89828a01612d33565b90975095505060208701356001600160401b038111156131f9575f80fd5b61320589828a01612d33565b90955093505060408701356001600160401b03811115613223575f80fd5b61322f89828a01612d33565b979a9699509497509295939492505050565b5f8060408385031215613252575f80fd5b61325b83612b7d565b915061326960208401612b7d565b90509250929050565b600181811c9082168061328657607f821691505b6020821081036132a457634e487b7160e01b5f52602260045260245ffd5b50919050565b5f602082840312156132ba575f80fd5b8151612b1f81612fe4565b5f81518060208401855e5f93019283525090919050565b8281525f6125d260208301846132c5565b818382375f9101908152919050565b601f821115610e8e57805f5260205f20601f840160051c810160208510156133215750805b601f840160051c820191505b818110156124cf575f815560010161332d565b6001600160401b0383111561335757613357612c34565b61336b836133658354613272565b836132fc565b5f601f84116001811461339c575f85156133855750838201355b5f19600387901b1c1916600186901b1783556124cf565b5f83815260208120601f198716915b828110156133cb57868501358255602094850194600190920191016133ab565b50868210156133e7575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f815461340581613272565b60018216801561341c57600181146134315761345e565b60ff198316865281151582028601935061345e565b845f5260205f205f5b838110156134565781548882015260019091019060200161343a565b505081860193505b50505092915050565b5f61347282856133f9565b622d2d2d60e81b815261348860038201856133f9565b95945050505050565b5f612b1f82846132c5565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610a8057610a8061349c565b838582375f848201622d2d2d60e81b8152838560038301375f93016003019283525090949350505050565b634e487b7160e01b5f52601260045260245ffd5b5f82613510576135106134ee565b500490565b8082028115828204841417610a8057610a8061349c565b81516001600160401b0381111561354557613545612c34565b613559816135538454613272565b846132fc565b6020601f82116001811461358b575f83156135745750848201515b5f19600385901b1c1916600184901b1784556124cf565b5f84815260208120601f198516915b828110156135ba578785015182556020948501946001909201910161359a565b50848210156135d757868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f600182016135f7576135f761349c565b5060010190565b81810381811115610a8057610a8061349c565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b602081525f6125d2602083018486613611565b5f6020828403121561365c575f80fd5b5051919050565b838152604060208201525f613488604083018486613611565b604081525f61368f604083018688613611565b8281036020840152612ee3818587613611565b5f612b1f82846133f9565b87815286602082015260a060408201525f8087546136ca81613272565b8060a0860152600182165f81146136e8576001811461370457613735565b60ff19831660c087015260c082151560051b8701019350613735565b8a5f5260205f205f5b8381101561372c57815488820160c0015260019091019060200161370d565b870160c0019450505b505050828103606084015261374b818789613611565b905082810360808401526118ca818587613611565b683d913730b6b2911d1160b91b81525f61377d60098301896133f9565b7f222c202261747472696275746573223a205b7b2274726169745f74797065223a81527f2022706f7369746976655f70726f6d7074222c202276616c7565223a2022000060208201526137d3603e8201896133f9565b7f227d2c207b2274726169745f74797065223a20226e656761746976655f70726f81526f36b83a111610113b30b63ab2911d101160811b6020820152905061381e60308201886133f9565b7f227d2c207b2274726169745f74797065223a202273656564222c202276616c7581526432911d101160d91b6020820152905061385e60258201876132c5565b7f227d2c207b2274726169745f74797065223a2022617574686f72222c202276618152680d8eaca4474404460f60bb1b602082015290506138a260298201866132c5565b7f227d2c207b2274726169745f74797065223a20226d6f64656c222c202276616c81527f7565223a2022537461626c6520446966667573696f6e227d5d2c20226465736360208201527f72697074696f6e223a2022537461626c6520446966667573696f6e206973206160408201527f206c6174656e7420746578742d746f2d696d61676520646966667573696f6e2060608201527f6d6f64656c2063617061626c65206f662067656e65726174696e672070686f7460808201527f6f2d7265616c697374696320696d6167657320676976656e20616e792074657860a08201527f7420696e7075742e222c2022696d616765223a202268747470733a2f2f67617460c08201527f657761792e70696e6174612e636c6f75642f697066732f00000000000000000060e0820152905060f781016118ca6139e282876132c5565b61227d60f01b815260020190565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081525f612b1f601d8301846132c5565b5f60208284031215613a31575f80fd5b81516001600160401b03811115613a46575f80fd5b8201601f81018413613a56575f80fd5b8051613a64612cc082612c78565b818152856020838501011115613a78575f80fd5b8160208401602083015e5f91810160200191909152949350505050565b84815260a060208201525f613aad60a0830186612b26565b6001600160a01b03949094166040830152506001600160401b039190911660608201528082036080909101525f815260200192915050565b84815260018060a01b0384166020820152826040820152608060608201525f613b116080830184612b26565b9695505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613b1190830184612b26565b5f60208284031215613b5d575f80fd5b8151612b1f81612aef565b5f82613b7657613b766134ee565b500690565b634e487b7160e01b5f52603260045260245ffd5b6001815b6001841115613bca57808504811115613bae57613bae61349c565b6001841615613bbc57908102905b60019390931c928002613b93565b935093915050565b5f82613be057506001610a80565b81613bec57505f610a80565b8160018114613c025760028114613c0c57613c28565b6001915050610a80565b60ff841115613c1d57613c1d61349c565b50506001821b610a80565b5060208310610133831016604e8410600b8410161715613c4b575081810a610a80565b613c575f198484613b8f565b805f1904821115613c6a57613c6a61349c565b029392505050565b5f612b1f8383613bd2565b5f60ff831680613c8f57613c8f6134ee565b8060ff84160491505092915050565b60ff818116838216029081169081811461270c5761270c61349c565b60ff8281168282160390811115610a8057610a8061349c565b60ff8181168382160190811115610a8057610a8061349c56fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220f2ac83818a824e9d2efa57832d81bbdb18c94218c86c58be5d02bf2029eeb43664736f6c634300081a00330000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000a616e696d617465536b790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034153590000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e516d505861384b667537425a796e6d6b55734e58585354344b36624348414a56714a43544263326e37374c7a5978000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e516d5a4e4543503873445a666a736369674e77554248436838343452436a576b545541716442726a7445795652320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000025616e696d657267655f7633302e7361666574656e736f7273205b306262323636393863645d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016446f206e6f742070726f6d70742076616e20676f67680000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000b5e620f480000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000006691233b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e90e278116574589fe37634739db2fbfcba4b2a20000000000000000000000009e35a4c1894697eb93bc781c0c5581c4e97b82a2 | 60806040526004361061035b575f3560e01c806370a08231116101bd578063b0347814116100f2578063de8f50a111610092578063ebd7edaf1161006d578063ebd7edaf146109a5578063ec3e5f45146109b9578063eda47704146109f7578063f2fde38b14610a16575f80fd5b8063de8f50a114610948578063e0be9bf914610967578063e985e9c514610986575f80fd5b8063b88d4fde116100cd578063b88d4fde146108e2578063c1d88c4414610901578063c745e3ff14610915578063c87b56dd14610929575f80fd5b8063b03478141461089a578063b0f7a3ff146108b9578063b7b6ccd5146108ce575f80fd5b80638da5cb5b1161015d578063a1a0e7fc11610138578063a1a0e7fc14610812578063a22cb46514610831578063ad72e1a514610850578063aea305071461087b575f80fd5b80638da5cb5b146107cf57806395d89b41146107eb5780639ee74dd1146107ff575f80fd5b80637df04787116101985780637df047871461073557806381d12c581461076c5780638500a45d1461079b5780638cbc52d9146107b0575f80fd5b806370a08231146106e3578063715018a61461070257806378564b7414610716575f80fd5b80633ccfd60b1161029357806358fd416d11610233578063628ae0a31161020e578063628ae0a3146106875780636352211e1461069b5780636817c76c146106ba578063702de1e3146106cf575f80fd5b806358fd416d146106235780635bb4688d146106425780635cec1b7614610672575f80fd5b8063414f11451161026e578063414f11451461059f57806342842e0e146105be5780634c34e4dc146105dd5780634ca0ce4c146105fc575f80fd5b80633ccfd60b1461054d5780633f37dce2146105615780633f3e4c1114610580575f80fd5b80632ab4d052116102fe5780632f03012e116102d95780632f03012e146104b557806331b221cd146104dc57806333727c4d1461050f5780633c1c8e491461052e575f80fd5b80632ab4d052146104625780632cfb2080146104775780632ddfb80714610496575f80fd5b8063095ea7b311610339578063095ea7b3146103eb578063122d1bad1461040c57806318160ddd1461042057806323b872dd14610443575f80fd5b806301ffc9a71461035f57806306fdde0314610393578063081812fc146103b4575b5f80fd5b34801561036a575f80fd5b5061037e610379366004612b04565b610a35565b60405190151581526020015b60405180910390f35b34801561039e575f80fd5b506103a7610a86565b60405161038a9190612b54565b3480156103bf575f80fd5b506103d36103ce366004612b66565b610b16565b6040516001600160a01b03909116815260200161038a565b3480156103f6575f80fd5b5061040a610405366004612b93565b610b3d565b005b348015610417575f80fd5b506103a7610b4c565b34801561042b575f80fd5b5061043560085481565b60405190815260200161038a565b34801561044e575f80fd5b5061040a61045d366004612bbb565b610bd8565b34801561046d575f80fd5b50610435600b5481565b348015610482575f80fd5b5061040a610491366004612bf5565b610c66565b3480156104a1575f80fd5b5061040a6104b0366004612c1b565b610c9b565b3480156104c0575f80fd5b506103d373c3287bdef03b925a7c7f54791edadcd88e632ccd81565b3480156104e7575f80fd5b506103d37f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b34801561051a575f80fd5b5061037e610529366004612b66565b610cc5565b348015610539575f80fd5b506103a7610548366004612cf2565b610d4e565b348015610558575f80fd5b5061040a610d7c565b34801561056c575f80fd5b5061040a61057b366004612d77565b610d90565b34801561058b575f80fd5b5061040a61059a366004612b66565b610e6c565b3480156105aa575f80fd5b5061040a6105b9366004612de1565b610e79565b3480156105c9575f80fd5b5061040a6105d8366004612bbb565b610e93565b3480156105e8575f80fd5b506011546103d3906001600160a01b031681565b348015610607575f80fd5b506103d3730a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b34801561062e575f80fd5b506103a761063d366004612b66565b610ead565b34801561064d575f80fd5b5061066161065c366004612b66565b6110ef565b60405161038a959493929190612e1f565b34801561067d575f80fd5b50610435600a5481565b348015610692575f80fd5b506103a76112b8565b3480156106a6575f80fd5b506103d36106b5366004612b66565b6112c5565b3480156106c5575f80fd5b5061043560075481565b3480156106da575f80fd5b506104356112cf565b3480156106ee575f80fd5b506104356106fd366004612c1b565b6112ea565b34801561070d575f80fd5b5061040a61132f565b348015610721575f80fd5b5061040a610730366004612de1565b611340565b348015610740575f80fd5b5061043561074f366004612e7a565b805160208183018101805160148252928201919093012091525481565b348015610777575f80fd5b5061078b610786366004612b66565b611355565b60405161038a9493929190612eab565b3480156107a6575f80fd5b5061043560095481565b3480156107bb575f80fd5b506103a76107ca366004612eee565b611493565b3480156107da575f80fd5b505f546001600160a01b03166103d3565b3480156107f6575f80fd5b506103a76114c7565b61043561080d366004612f31565b6114d6565b34801561081d575f80fd5b5061040a61082c366004612de1565b6118d8565b34801561083c575f80fd5b5061040a61084b366004612ff1565b6118ed565b34801561085b575f80fd5b5061043561086a366004612b66565b60166020525f908152604090205481565b348015610886575f80fd5b5061040a610895366004613026565b6118f8565b3480156108a5575f80fd5b5061040a6108b43660046130cb565b611a47565b3480156108c4575f80fd5b50610435611b5f81565b3480156108d9575f80fd5b5061040a611bcd565b3480156108ed575f80fd5b5061040a6108fc366004613142565b611bee565b34801561090c575f80fd5b50610435611c05565b348015610920575f80fd5b506103a7611ca6565b348015610934575f80fd5b506103a7610943366004612b66565b611cb3565b348015610953575f80fd5b5061037e6109623660046131a5565b611d62565b348015610972575f80fd5b506010546103d3906001600160a01b031681565b348015610991575f80fd5b5061037e6109a0366004613241565b611ec7565b3480156109b0575f80fd5b506103a7611ef4565b3480156109c4575f80fd5b506011546109df90600160a01b90046001600160401b031681565b6040516001600160401b03909116815260200161038a565b348015610a02575f80fd5b5061040a610a11366004612c1b565b611f01565b348015610a21575f80fd5b5061040a610a30366004612c1b565b611f2b565b5f6001600160e01b031982166380ac58cd60e01b1480610a6557506001600160e01b03198216635b5e139f60e01b145b80610a8057506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060018054610a9590613272565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac190613272565b8015610b0c5780601f10610ae357610100808354040283529160200191610b0c565b820191905f5260205f20905b815481529060010190602001808311610aef57829003601f168201915b5050505050905090565b5f610b2082611f68565b505f828152600560205260409020546001600160a01b0316610a80565b610b48828233611fa0565b5050565b600f8054610b5990613272565b80601f0160208091040260200160405190810160405280929190818152602001828054610b8590613272565b8015610bd05780601f10610ba757610100808354040283529160200191610bd0565b820191905f5260205f20905b815481529060010190602001808311610bb357829003601f168201915b505050505081565b6001600160a01b038216610c0657604051633250574960e11b81525f60048201526024015b60405180910390fd5b5f610c12838333611fad565b9050836001600160a01b0316816001600160a01b031614610c60576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610bfd565b50505050565b610c6e61209f565b601180546001600160401b03909216600160a01b0267ffffffffffffffff60a01b19909216919091179055565b610ca361209f565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516333727c4d60e01b8152600481018290525f907f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a06001600160a01b0316906333727c4d90602401602060405180830381865afa158015610d2a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a8091906132aa565b60605f8284604051602001610d649291906132dc565b60408051808303601f19018152919052949350505050565b610d8461209f565b610d8e33476120cb565b565b610d9e848484848888611d62565b610dea5760405162461bcd60e51b815260206004820152601960248201527f455243373030373a20696e76616c6964206169676344617461000000000000006044820152606401610bfd565b5f60148585604051610dfd9291906132ed565b908152604051908190036020018120549150610e1c90849084906132ed565b60405180910390208585604051610e349291906132ed565b6040519081900381209083907fd77aab0eeab3a3cbdac072fcdbc34709b18d6c4af91f7869c71cbbb13d71a6b9905f90a45050505050565b610e7461209f565b600b55565b610e8161209f565b600e610e8e828483613340565b505050565b610e8e83838360405180602001604052805f815250611bee565b5f8181526012602052604081206003015460609103610fc2575f8281526012602090815260409182902091517f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e392610f0c929091600183019101613467565b60408051601f1981840301815290829052610f2691613491565b90815260200160405180910390208054610f3f90613272565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6b90613272565b8015610fb65780601f10610f8d57610100808354040283529160200191610fb6565b820191905f5260205f20905b815481529060010190602001808311610f9957829003601f168201915b50505050509050919050565b5f828152601260209081526040808320600381015491519192610fea92600183019101613467565b60408051601f198184030181529082905261100892916020016132dc565b60408051601f1981840301815290829052611b5f5f52601560205291507f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e390611052908390613491565b9081526020016040518091039020805461106b90613272565b80601f016020809104026020016040519081016040528092919081815260200182805461109790613272565b80156110e25780601f106110b9576101008083540402835291602001916110e2565b820191905f5260205f20905b8154815290600101906020018083116110c557829003601f168201915b5050505050915050919050565b60126020525f908152604090208054819061110990613272565b80601f016020809104026020016040519081016040528092919081815260200182805461113590613272565b80156111805780601f1061115757610100808354040283529160200191611180565b820191905f5260205f20905b81548152906001019060200180831161116357829003601f168201915b50505050509080600101805461119590613272565b80601f01602080910402602001604051908101604052809291908181526020018280546111c190613272565b801561120c5780601f106111e35761010080835404028352916020019161120c565b820191905f5260205f20905b8154815290600101906020018083116111ef57829003601f168201915b50505050509080600201805461122190613272565b80601f016020809104026020016040519081016040528092919081815260200182805461124d90613272565b80156112985780601f1061126f57610100808354040283529160200191611298565b820191905f5260205f20905b81548152906001019060200180831161127b57829003601f168201915b5050505060038301546004909301549192916001600160a01b0316905085565b600c8054610b5990613272565b5f610a8082611f68565b5f6007546112db611c05565b6112e591906134b0565b905090565b5f6001600160a01b038216611314576040516322718ad960e21b81525f6004820152602401610bfd565b506001600160a01b03165f9081526004602052604090205490565b61133761209f565b610d8e5f61215e565b61134861209f565b600c610e8e828483613340565b60136020525f90815260409020805460018201546002830180546001600160a01b0390931693919261138690613272565b80601f01602080910402602001604051908101604052809291908181526020018280546113b290613272565b80156113fd5780601f106113d4576101008083540402835291602001916113fd565b820191905f5260205f20905b8154815290600101906020018083116113e057829003601f168201915b50505050509080600301805461141290613272565b80601f016020809104026020016040519081016040528092919081815260200182805461143e90613272565b80156114895780601f1061146057610100808354040283529160200191611489565b820191905f5260205f20905b81548152906001019060200180831161146c57829003601f168201915b5050505050905084565b601560209081525f9283526040909220815180830184018051928152908401929093019190912091528054610b5990613272565b606060028054610a9590613272565b5f6009545f141580156114ea575060095442115b6115295760405162461bcd60e51b815260206004820152601060248201526f14d85b19481b9bdd081cdd185c9d195960821b6044820152606401610bfd565b600a5415806115395750600a5442105b6115725760405162461bcd60e51b815260206004820152600a60248201526914d85b1948195b99195960b21b6044820152606401610bfd565b5f8888888860405160200161158a94939291906134c3565b604051602081830303815290604052905060146115a78285610d4e565b6040516115b49190613491565b9081526020016040518091039020545f1461161c5760405162461bcd60e51b815260206004820152602260248201527f70726f6d707420616e6420736565642068617320616c7265616479206d696e74604482015261195960f21b6064820152608401610bfd565b6116246112cf565b3410156116735760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f7567682066756e6420746f206d696e74204e465400000000006044820152606401610bfd565b600b5415806116855750600b54600854105b6116d15760405162461bcd60e51b815260206004820152601860248201527f4d617820746f74616c20737570706c79207265616368656400000000000000006044820152606401610bfd565b6011546007546116f6916001600160a01b0316906116f190600a90613502565b6120cb565b601054600754611722916001600160a01b031690600a90611718906009613515565b6116f19190613502565b6040518060a001604052808a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250505090825250604080516020601f8b0181900481028201810190925289815291810191908a908a90819084018382808284375f92019190915250505090825250604080516020601f8901819004810282018101909252878152918101919088908890819084018382808284375f92018290525093855250505060208083018790526001600160a01b038e166040938401526008548252601290522081518190611808908261352c565b506020820151600182019061181d908261352c565b5060408201516002820190611832908261352c565b5060608201516003820155608090910151600490910180546001600160a01b0319166001600160a01b0390921691909117905561186f81846121ad565b61187b8a6008546122f9565b60088054905f61188a836135e6565b9190505550600854601461189e8386610d4e565b6040516118ab9190613491565b908152604051908190036020019020556008546118ca906001906135fe565b9a9950505050505050505050565b6118e061209f565b600d610e8e828483613340565b610b48338383612312565b60405163c4be5cab60e01b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9063c4be5cab906119319089908990600401613639565b6020604051808303815f875af115801561194d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611971919061364c565b5f888152601660205260409081902082905551630901e0f960e31b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9163480f07c8916119bb919088908890600401613663565b5f604051808303815f87803b1580156119d2575f80fd5b505af11580156119e4573d5f803e3d5ffd5b5050505085856040516119f89291906132ed565b6040518091039020877f65deac95b53ba76b9cdc6cf446af81731e1218c91eaf9811a95d28bde23b893e86868686604051611a36949392919061367c565b60405180910390a350505050505050565b336001600160a01b037f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a0168114611ac45760405163432e033760e11b81526001600160a01b037f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a08116600483015282166024820152604401610bfd565b5f86815260136020526040902080546001600160a01b0316611b1d5760405162461bcd60e51b815260206004820152601260248201527172657175657374206e6f742065786973747360701b6044820152606401610bfd565b611b5f5f526015602052604051869086907f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e390611b5e9060028601906136a2565b90815260200160405180910390209182611b79929190613340565b507faf2b2381ddcb18a2b18a7826186fd216acdd9c852a8c7a9a49e7eab127f96ccf8782600101548360020189898989604051611bbc97969594939291906136ad565b60405180910390a150505050505050565b611bd561209f565b6009545f03611be45742600955565b42600a555f600955565b611bf9848484610bd8565b610c60848484846123b0565b601154604051620e1d8d60e41b8152611b5f6004820152600160a01b9091046001600160401b031660248201525f907f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a06001600160a01b03169062e1d8d090604401602060405180830381865afa158015611c82573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112e5919061364c565b600d8054610b5990613272565b5f818152601260205260408120600381015460609291611d36916002820191906001820190611ce1906124d6565b5f88815260126020526040902060040154611d04906001600160a01b03166125da565b611d0d89610ead565b604051602001611d2296959493929190613760565b604051602081830303815290604052612713565b90505f81604051602001611d4a91906139f0565b60408051601f19818403018152919052949350505050565b5f8060148888604051611d769291906132ed565b9081526040805160209281900383018120545f8181526016909452918320546317861f8760e01b8252600482015290925073c3287bdef03b925a7c7f54791edadcd88e632ccd906317861f87906024015f60405180830381865afa158015611de0573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611e079190810190613a21565b5f83815260166020526040908190205490516333727c4d60e01b815291925073c3287bdef03b925a7c7f54791edadcd88e632ccd916333727c4d91611e529160040190815260200190565b602060405180830381865afa158015611e6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e9191906132aa565b8015611eba57508686604051611ea89291906132ed565b60405180910390208180519060200120145b9998505050505050505050565b6001600160a01b039182165f90815260066020908152604080832093909416825291909152205460ff1690565b600e8054610b5990613272565b611f0961209f565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b611f3361209f565b6001600160a01b038116611f5c57604051631e4fbdf760e01b81525f6004820152602401610bfd565b611f658161215e565b50565b5f818152600360205260408120546001600160a01b031680610a8057604051637e27328960e01b815260048101849052602401610bfd565b610e8e8383836001612875565b5f828152600360205260408120546001600160a01b0390811690831615611fd957611fd9818486612979565b6001600160a01b0381161561201357611ff45f855f80612875565b6001600160a01b0381165f90815260046020526040902080545f190190555b6001600160a01b03851615612041576001600160a01b0385165f908152600460205260409020805460010190555b5f8481526003602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b5f546001600160a01b03163314610d8e5760405163118cdaa760e01b8152336004820152602401610bfd565b804710156120ee5760405163cd78605960e01b8152306004820152602401610bfd565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114612137576040519150601f19603f3d011682016040523d82523d5f602084013e61213c565b606091505b5050905080610e8e57604051630a12f52160e11b815260040160405180910390fd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f81836040516020016121c19291906132dc565b60408051808303601f1901815290829052601154632dca9c0360e11b83529092505f917f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a06001600160a01b031691635b95380691349161223c91611b5f9188913091600160a01b90046001600160401b031690600401613a95565b60206040518083038185885af1158015612258573d5f803e3d5ffd5b50505050506040513d601f19601f8201168201806040525081019061227d919061364c565b5f8181526013602052604090209091506002810161229b848261352c565b5080546001600160a01b031916339081178255611b5f600183018190556040517fa0faead83d70148ae18b694377f9bef079251342ab90e14af0f9ef68b891269f926122ea9286928a90613ae5565b60405180910390a15050505050565b610b48828260405180602001604052805f8152506129dd565b6001600160a01b03821661234457604051630b61174360e31b81526001600160a01b0383166004820152602401610bfd565b6001600160a01b038381165f81815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b15610c6057604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906123f2903390889087908790600401613b1b565b6020604051808303815f875af192505050801561242c575060408051601f3d908101601f1916820190925261242991810190613b4d565b60015b612493573d808015612459576040519150601f19603f3d011682016040523d82523d5f602084013e61245e565b606091505b5080515f0361248b57604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b146124cf57604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b5050505050565b6060815f036124fc5750506040805180820190915260018152600360fc1b602082015290565b815f5b8115612525578061250f816135e6565b915061251e9050600a83613502565b91506124ff565b5f816001600160401b0381111561253e5761253e612c34565b6040519080825280601f01601f191660200182016040528015612568576020820181803683370190505b5090505b84156125d25761257d6001836135fe565b915061258a600a86613b68565b6125959060306134b0565b60f81b8183815181106125aa576125aa613b7b565b60200101906001600160f81b03191690815f1a9053506125cb600a86613502565b945061256c565b949350505050565b60408051602880825260608281019093525f91906020820181803683370190505090505f5b601481101561270c575f6126148260136135fe565b61261f906008613515565b61262a906002613c72565b61263d906001600160a01b038716613502565b60f81b90505f60108260f81c6126539190613c7d565b60f81b90505f8160f81c60106126699190613c9e565b8360f81c6126779190613cba565b60f81b9050612685826129f3565b85612691866002613515565b815181106126a1576126a1613b7b565b60200101906001600160f81b03191690815f1a9053506126c0816129f3565b856126cc866002613515565b6126d79060016134b0565b815181106126e7576126e7613b7b565b60200101906001600160f81b03191690815f1a90535050600190920191506125ff9050565b5092915050565b80516060905f81900361273557505060408051602081019091525f8152919050565b5f60036127438360026134b0565b61274d9190613502565b612758906004613515565b90505f6127668260206134b0565b6001600160401b0381111561277d5761277d612c34565b6040519080825280601f01601f1916602001820160405280156127a7576020820181803683370190505b5090505f604051806060016040528060408152602001613ced60409139905060018101602083015f5b86811015612831576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016127d0565b50600386066001811461284b576002811461285c57612867565b613d3d60f01b600119830152612867565b603d60f81b5f198301525b505050918152949350505050565b808061288957506001600160a01b03821615155b1561294a575f61289884611f68565b90506001600160a01b038316158015906128c45750826001600160a01b0316816001600160a01b031614155b80156128d757506128d58184611ec7565b155b156129005760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610bfd565b81156129485783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260056020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b612984838383612a2d565b610e8e576001600160a01b0383166129b257604051637e27328960e01b815260048101829052602401610bfd565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610bfd565b6129e78383612a8e565b610e8e5f8484846123b0565b5f600a60f883901c1015612a1957612a1060f883901c6030613cd3565b60f81b92915050565b612a1060f883901c6057613cd3565b919050565b5f6001600160a01b038316158015906125d25750826001600160a01b0316846001600160a01b03161480612a665750612a668484611ec7565b806125d25750505f908152600560205260409020546001600160a01b03908116911614919050565b6001600160a01b038216612ab757604051633250574960e11b81525f6004820152602401610bfd565b5f612ac383835f611fad565b90506001600160a01b03811615610e8e576040516339e3563760e11b81525f6004820152602401610bfd565b6001600160e01b031981168114611f65575f80fd5b5f60208284031215612b14575f80fd5b8135612b1f81612aef565b9392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f612b1f6020830184612b26565b5f60208284031215612b76575f80fd5b5035919050565b80356001600160a01b0381168114612a28575f80fd5b5f8060408385031215612ba4575f80fd5b612bad83612b7d565b946020939093013593505050565b5f805f60608486031215612bcd575f80fd5b612bd684612b7d565b9250612be460208501612b7d565b929592945050506040919091013590565b5f60208284031215612c05575f80fd5b81356001600160401b0381168114612b1f575f80fd5b5f60208284031215612c2b575f80fd5b612b1f82612b7d565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715612c7057612c70612c34565b604052919050565b5f6001600160401b03821115612c9057612c90612c34565b50601f01601f191660200190565b5f82601f830112612cad575f80fd5b8135602083015f612cc5612cc084612c78565b612c48565b9050828152858383011115612cd8575f80fd5b828260208301375f92810160200192909252509392505050565b5f8060408385031215612d03575f80fd5b82356001600160401b03811115612d18575f80fd5b612d2485828601612c9e565b95602094909401359450505050565b5f8083601f840112612d43575f80fd5b5081356001600160401b03811115612d59575f80fd5b602083019150836020828501011115612d70575f80fd5b9250929050565b5f805f8060408587031215612d8a575f80fd5b84356001600160401b03811115612d9f575f80fd5b612dab87828801612d33565b90955093505060208501356001600160401b03811115612dc9575f80fd5b612dd587828801612d33565b95989497509550505050565b5f8060208385031215612df2575f80fd5b82356001600160401b03811115612e07575f80fd5b612e1385828601612d33565b90969095509350505050565b60a081525f612e3160a0830188612b26565b8281036020840152612e438188612b26565b90508281036040840152612e578187612b26565b606084019590955250506001600160a01b03919091166080909101529392505050565b5f60208284031215612e8a575f80fd5b81356001600160401b03811115612e9f575f80fd5b6125d284828501612c9e565b60018060a01b0385168152836020820152608060408201525f612ed16080830185612b26565b8281036060840152612ee38185612b26565b979650505050505050565b5f8060408385031215612eff575f80fd5b8235915060208301356001600160401b03811115612f1b575f80fd5b612f2785828601612c9e565b9150509250929050565b5f805f805f805f8060a0898b031215612f48575f80fd5b612f5189612b7d565b975060208901356001600160401b03811115612f6b575f80fd5b612f778b828c01612d33565b90985096505060408901356001600160401b03811115612f95575f80fd5b612fa18b828c01612d33565b90965094505060608901356001600160401b03811115612fbf575f80fd5b612fcb8b828c01612d33565b999c989b50969995989497949560800135949350505050565b8015158114611f65575f80fd5b5f8060408385031215613002575f80fd5b61300b83612b7d565b9150602083013561301b81612fe4565b809150509250929050565b5f805f805f805f6080888a03121561303c575f80fd5b8735965060208801356001600160401b03811115613058575f80fd5b6130648a828b01612d33565b90975095505060408801356001600160401b03811115613082575f80fd5b61308e8a828b01612d33565b90955093505060608801356001600160401b038111156130ac575f80fd5b6130b88a828b01612d33565b989b979a50959850939692959293505050565b5f805f805f606086880312156130df575f80fd5b8535945060208601356001600160401b038111156130fb575f80fd5b61310788828901612d33565b90955093505060408601356001600160401b03811115613125575f80fd5b61313188828901612d33565b969995985093965092949392505050565b5f805f8060808587031215613155575f80fd5b61315e85612b7d565b935061316c60208601612b7d565b92506040850135915060608501356001600160401b0381111561318d575f80fd5b61319987828801612c9e565b91505092959194509250565b5f805f805f80606087890312156131ba575f80fd5b86356001600160401b038111156131cf575f80fd5b6131db89828a01612d33565b90975095505060208701356001600160401b038111156131f9575f80fd5b61320589828a01612d33565b90955093505060408701356001600160401b03811115613223575f80fd5b61322f89828a01612d33565b979a9699509497509295939492505050565b5f8060408385031215613252575f80fd5b61325b83612b7d565b915061326960208401612b7d565b90509250929050565b600181811c9082168061328657607f821691505b6020821081036132a457634e487b7160e01b5f52602260045260245ffd5b50919050565b5f602082840312156132ba575f80fd5b8151612b1f81612fe4565b5f81518060208401855e5f93019283525090919050565b8281525f6125d260208301846132c5565b818382375f9101908152919050565b601f821115610e8e57805f5260205f20601f840160051c810160208510156133215750805b601f840160051c820191505b818110156124cf575f815560010161332d565b6001600160401b0383111561335757613357612c34565b61336b836133658354613272565b836132fc565b5f601f84116001811461339c575f85156133855750838201355b5f19600387901b1c1916600186901b1783556124cf565b5f83815260208120601f198716915b828110156133cb57868501358255602094850194600190920191016133ab565b50868210156133e7575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f815461340581613272565b60018216801561341c57600181146134315761345e565b60ff198316865281151582028601935061345e565b845f5260205f205f5b838110156134565781548882015260019091019060200161343a565b505081860193505b50505092915050565b5f61347282856133f9565b622d2d2d60e81b815261348860038201856133f9565b95945050505050565b5f612b1f82846132c5565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610a8057610a8061349c565b838582375f848201622d2d2d60e81b8152838560038301375f93016003019283525090949350505050565b634e487b7160e01b5f52601260045260245ffd5b5f82613510576135106134ee565b500490565b8082028115828204841417610a8057610a8061349c565b81516001600160401b0381111561354557613545612c34565b613559816135538454613272565b846132fc565b6020601f82116001811461358b575f83156135745750848201515b5f19600385901b1c1916600184901b1784556124cf565b5f84815260208120601f198516915b828110156135ba578785015182556020948501946001909201910161359a565b50848210156135d757868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f600182016135f7576135f761349c565b5060010190565b81810381811115610a8057610a8061349c565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b602081525f6125d2602083018486613611565b5f6020828403121561365c575f80fd5b5051919050565b838152604060208201525f613488604083018486613611565b604081525f61368f604083018688613611565b8281036020840152612ee3818587613611565b5f612b1f82846133f9565b87815286602082015260a060408201525f8087546136ca81613272565b8060a0860152600182165f81146136e8576001811461370457613735565b60ff19831660c087015260c082151560051b8701019350613735565b8a5f5260205f205f5b8381101561372c57815488820160c0015260019091019060200161370d565b870160c0019450505b505050828103606084015261374b818789613611565b905082810360808401526118ca818587613611565b683d913730b6b2911d1160b91b81525f61377d60098301896133f9565b7f222c202261747472696275746573223a205b7b2274726169745f74797065223a81527f2022706f7369746976655f70726f6d7074222c202276616c7565223a2022000060208201526137d3603e8201896133f9565b7f227d2c207b2274726169745f74797065223a20226e656761746976655f70726f81526f36b83a111610113b30b63ab2911d101160811b6020820152905061381e60308201886133f9565b7f227d2c207b2274726169745f74797065223a202273656564222c202276616c7581526432911d101160d91b6020820152905061385e60258201876132c5565b7f227d2c207b2274726169745f74797065223a2022617574686f72222c202276618152680d8eaca4474404460f60bb1b602082015290506138a260298201866132c5565b7f227d2c207b2274726169745f74797065223a20226d6f64656c222c202276616c81527f7565223a2022537461626c6520446966667573696f6e227d5d2c20226465736360208201527f72697074696f6e223a2022537461626c6520446966667573696f6e206973206160408201527f206c6174656e7420746578742d746f2d696d61676520646966667573696f6e2060608201527f6d6f64656c2063617061626c65206f662067656e65726174696e672070686f7460808201527f6f2d7265616c697374696320696d6167657320676976656e20616e792074657860a08201527f7420696e7075742e222c2022696d616765223a202268747470733a2f2f67617460c08201527f657761792e70696e6174612e636c6f75642f697066732f00000000000000000060e0820152905060f781016118ca6139e282876132c5565b61227d60f01b815260020190565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081525f612b1f601d8301846132c5565b5f60208284031215613a31575f80fd5b81516001600160401b03811115613a46575f80fd5b8201601f81018413613a56575f80fd5b8051613a64612cc082612c78565b818152856020838501011115613a78575f80fd5b8160208401602083015e5f91810160200191909152949350505050565b84815260a060208201525f613aad60a0830186612b26565b6001600160a01b03949094166040830152506001600160401b039190911660608201528082036080909101525f815260200192915050565b84815260018060a01b0384166020820152826040820152608060608201525f613b116080830184612b26565b9695505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613b1190830184612b26565b5f60208284031215613b5d575f80fd5b8151612b1f81612aef565b5f82613b7657613b766134ee565b500690565b634e487b7160e01b5f52603260045260245ffd5b6001815b6001841115613bca57808504811115613bae57613bae61349c565b6001841615613bbc57908102905b60019390931c928002613b93565b935093915050565b5f82613be057506001610a80565b81613bec57505f610a80565b8160018114613c025760028114613c0c57613c28565b6001915050610a80565b60ff841115613c1d57613c1d61349c565b50506001821b610a80565b5060208310610133831016604e8410600b8410161715613c4b575081810a610a80565b613c575f198484613b8f565b805f1904821115613c6a57613c6a61349c565b029392505050565b5f612b1f8383613bd2565b5f60ff831680613c8f57613c8f6134ee565b8060ff84160491505092915050565b60ff818116838216029081169081811461270c5761270c61349c565b60ff8281168282160390811115610a8057610a8061349c565b60ff8181168382160190811115610a8057610a8061349c56fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220f2ac83818a824e9d2efa57832d81bbdb18c94218c86c58be5d02bf2029eeb43664736f6c634300081a0033 | |
1 | 20,290,467 | b9f1d03c0ac0f543204fb3486a31588940ae963575f8232ce3597baab54f5f44 | 2a572ca0d832606c01739990f43a23f26ac5c5b339d971b0322c4fcee1f62c52 | bfbcdd04dda68cfcfba2d687ffce365fd46d5f5f | bfbcdd04dda68cfcfba2d687ffce365fd46d5f5f | 3d7875469116d54a49009eeda00c032c773c5f06 | 60a06040526c054f529ca52576bc68920000006009556b1b2fbb73f163a79bb1000000600a819055600b556b0d97ddb9f8b1d3cdd8800000600c55600d805460ff191690556014600e556023600f553480156200005b57600080fd5b506040518060400160405280601081526020016f26baba30b73a102137bcb99021b63ab160811b8152506040518060400160405280600681526020016526a121a62aa160d11b8152508160039081620000b59190620006c5565b506004620000c48282620006c5565b505050620000e1620000db6200041860201b60201c565b6200041c565b737a250d5630b4cf539739df2c5dacb4c659f2488d60808190526040805163c45a015560e01b8152905163c45a0155916004808201926020929091908290030181865afa15801562000137573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200015d919062000791565b6001600160a01b031663c9c65396306080516001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001ad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001d3919062000791565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801562000221573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000247919062000791565b600680546001600160a01b0319166001600160a01b03929092169182179055620002739060016200046e565b6006546001600160a01b039081166000908152601160205260408082208054600160ff199182168117909255608051909416835291208054909216179055600880546001600160a01b03191633908117909155600780546001600160a01b0319166001600160a01b03928316179055600554620002f491165b6001620004c2565b62000301306001620004c2565b6200030c33620002ec565b6200031b61dead6001620004c2565b62000356620003326005546001600160a01b031690565b6001600160a01b03166000908152601160205260409020805460ff19166001179055565b306000908152601160205260409020805460ff191660011790556200037b3362000332565b61dead60005260116020527f97847ee99463795296047093514439c3127772df3715e628aa85601cf8541716805460ff19166001179055600954600090620003d490606490620003cd90605862000521565b9062000538565b600954909150600090620003e9908362000546565b60075490915062000404906001600160a01b03168362000554565b62000410308262000554565b505062000842565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216600081815260126020526040808220805460ff191685151590811790915590519092917fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab91a35050565b6001600160a01b038216600081815260106020908152604091829020805460ff191685151590811790915591519182527f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df7910160405180910390a25050565b60006200052f8284620007d9565b90505b92915050565b60006200052f8284620007f3565b60006200052f828462000816565b6001600160a01b038216620005af5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620005c391906200082c565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200064a57607f821691505b6020821081036200066b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200061a576000816000526020600020601f850160051c810160208610156200069c5750805b601f850160051c820191505b81811015620006bd57828155600101620006a8565b505050505050565b81516001600160401b03811115620006e157620006e16200061f565b620006f981620006f2845462000635565b8462000671565b602080601f831160018114620007315760008415620007185750858301515b600019600386901b1c1916600185901b178555620006bd565b600085815260208120601f198616915b82811015620007625788860151825594840194600190910190840162000741565b5085821015620007815787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215620007a457600080fd5b81516001600160a01b0381168114620007bc57600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417620005325762000532620007c3565b6000826200081157634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115620005325762000532620007c3565b80820180821115620005325762000532620007c3565b608051611cf4620008736000396000818161038b01528181611505015281816115be01526115fd0152611cf46000f3fe6080604052600436106101db5760003560e01c806389291a8f11610102578063c8c8ebe411610095578063e2f4560511610064578063e2f456051461055a578063f2fde38b14610570578063f8b45b0514610590578063fb201b1d146105a657600080fd5b8063c8c8ebe4146104f8578063cf9522fd1461050e578063dd62ed3e14610524578063dd8546521461054457600080fd5b8063a457c2d7116100d1578063a457c2d714610478578063a9059cbb14610498578063afa4f3b2146104b8578063b70143c9146104d857600080fd5b806389291a8f146104105780638da5cb5b1461042557806395d89b41146104435780639a7a23d61461045857600080fd5b8063313ce5671161017a57806352f7c9881161014957806352f7c98814610359578063583e05681461037957806370a08231146103c5578063715018a6146103fb57600080fd5b8063313ce567146102c4578063346cc7be146102e057806339509351146103005780634fbee1931461032057600080fd5b806318160ddd116101b657806318160ddd1461025857806323b872dd14610277578063284f289914610297578063311028af146102ae57600080fd5b806299d386146101e757806306fdde0314610216578063095ea7b31461023857600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50600d546102019060ff1681565b60405190151581526020015b60405180910390f35b34801561022257600080fd5b5061022b6105bb565b60405161020d919061190d565b34801561024457600080fd5b50610201610253366004611971565b61064d565b34801561026457600080fd5b506002545b60405190815260200161020d565b34801561028357600080fd5b5061020161029236600461199d565b610667565b3480156102a357600080fd5b506102ac61068b565b005b3480156102ba57600080fd5b5061026960095481565b3480156102d057600080fd5b506040516012815260200161020d565b3480156102ec57600080fd5b506102ac6102fb3660046119de565b6106a9565b34801561030c57600080fd5b5061020161031b366004611971565b6107ff565b34801561032c57600080fd5b5061020161033b3660046119de565b6001600160a01b031660009081526010602052604090205460ff1690565b34801561036557600080fd5b506102ac6103743660046119fb565b610821565b34801561038557600080fd5b506103ad7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161020d565b3480156103d157600080fd5b506102696103e03660046119de565b6001600160a01b031660009081526020819052604090205490565b34801561040757600080fd5b506102ac61088b565b34801561041c57600080fd5b506102ac61089f565b34801561043157600080fd5b506005546001600160a01b03166103ad565b34801561044f57600080fd5b5061022b610937565b34801561046457600080fd5b506102ac610473366004611a2b565b610946565b34801561048457600080fd5b50610201610493366004611971565b6109e0565b3480156104a457600080fd5b506102016104b3366004611971565b610a5b565b3480156104c457600080fd5b506102ac6104d3366004611a64565b610a69565b3480156104e457600080fd5b506102ac6104f3366004611a64565b610a89565b34801561050457600080fd5b50610269600a5481565b34801561051a57600080fd5b50610269600f5481565b34801561053057600080fd5b5061026961053f366004611a7d565b610b5f565b34801561055057600080fd5b50610269600e5481565b34801561056657600080fd5b50610269600c5481565b34801561057c57600080fd5b506102ac61058b3660046119de565b610b8a565b34801561059c57600080fd5b50610269600b5481565b3480156105b257600080fd5b506102ac610c00565b6060600380546105ca90611aab565b80601f01602080910402602001604051908101604052809291908181526020018280546105f690611aab565b80156106435780601f1061061857610100808354040283529160200191610643565b820191906000526020600020905b81548152906001019060200180831161062657829003601f168201915b5050505050905090565b60003361065b818585610c17565b60019150505b92915050565b600033610675858285610d3b565b610680858585610daf565b506001949350505050565b6106936113ae565b600061069e60025490565b600a819055600b5550565b6007546001600160a01b0316336001600160a01b0316146106c957600080fd5b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610712573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107369190611ae5565b9050600081116107825760405162461bcd60e51b81526020600482015260126024820152712737903a37b5b2b739903a379031b632b0b960711b60448201526064015b60405180910390fd5b60075460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390529083169063a9059cbb906044016020604051808303816000875af11580156107d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f99190611afe565b50505050565b60003361065b8185856108128383610b5f565b61081c9190611b31565b610c17565b6108296113ae565b6028821115801561083b575060328111155b6108805760405162461bcd60e51b8152602060048201526016602482015275466565732063616e6e6f74206578636565642039392560501b6044820152606401610779565b600e91909155600f55565b6108936113ae565b61089d6000611408565b565b6007546001600160a01b0316336001600160a01b0316146108bf57600080fd5b600047116109085760405162461bcd60e51b81526020600482015260166024820152752a37b5b2b71d1037379022aa24103a379031b632b0b960511b6044820152606401610779565b60405133904780156108fc02916000818181858888f19350505050158015610934573d6000803e3d6000fd5b50565b6060600480546105ca90611aab565b61094e6113ae565b6006546001600160a01b03908116908316036109d25760405162461bcd60e51b815260206004820152603960248201527f54686520706169722063616e6e6f742062652072656d6f7665642066726f6d2060448201527f6175746f6d617465644d61726b65744d616b65725061697273000000000000006064820152608401610779565b6109dc828261145a565b5050565b600033816109ee8286610b5f565b905083811015610a4e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610779565b6106808286868403610c17565b60003361065b818585610daf565b610a716113ae565b610a8381670de0b6b3a7640000611b44565b600c5550565b6007546001600160a01b0316336001600160a01b031614610aa957600080fd5b6000610ab460025490565b306000908152602081905260408120549192506064849003610ad7575080610afa565b6064610ae38585611b44565b610aed9190611b5b565b905081811115610afa5750805b81811115610b565760405162461bcd60e51b8152602060048201526024808201527f5377617020616d6f756e74206578636565647320636f6e74726163742062616c604482015263616e636560e01b6064820152608401610779565b6107f9816114ae565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610b926113ae565b6001600160a01b038116610bf75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610779565b61093481611408565b610c086113ae565b600d805460ff19166001179055565b6001600160a01b038316610c795760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610779565b6001600160a01b038216610cda5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610779565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610d478484610b5f565b905060001981146107f95781811015610da25760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610779565b6107f98484848403610c17565b6001600160a01b038316610dd55760405162461bcd60e51b815260040161077990611b7d565b6001600160a01b038216610dfb5760405162461bcd60e51b815260040161077990611bc2565b80600003610e1457610e0f83836000611675565b505050565b6001600160a01b03831660009081526012602052604081205460ff16158015610e5657506001600160a01b03831660009081526012602052604090205460ff16155b9050610e6a6005546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610e9957506005546001600160a01b03848116911614155b8015610ead57506001600160a01b03831615155b8015610ec457506001600160a01b03831661dead14155b8015610eda5750600854600160a01b900460ff16155b156111d357600d5460ff16610f6d576001600160a01b03841660009081526010602052604090205460ff1680610f2857506001600160a01b03831660009081526010602052604090205460ff165b610f6d5760405162461bcd60e51b81526020600482015260166024820152752a3930b234b7339034b9903737ba1030b1ba34bb329760511b6044820152606401610779565b6001600160a01b03841660009081526012602052604090205460ff168015610fae57506001600160a01b03831660009081526011602052604090205460ff16155b1561109257600a548211156110235760405162461bcd60e51b815260206004820152603560248201527f427579207472616e7366657220616d6f756e742065786365656473207468652060448201527436b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760591b6064820152608401610779565b600b546001600160a01b0384166000908152602081905260409020546110499084611b31565b111561108d5760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610779565b6111d3565b6001600160a01b03831660009081526012602052604090205460ff1680156110d357506001600160a01b03841660009081526011602052604090205460ff16155b1561114957600a5482111561108d5760405162461bcd60e51b815260206004820152603660248201527f53656c6c207472616e7366657220616d6f756e742065786365656473207468656044820152751036b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760511b6064820152608401610779565b6001600160a01b03831660009081526011602052604090205460ff166111d357600b546001600160a01b03841660009081526020819052604090205461118f9084611b31565b11156111d35760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610779565b306000908152602081905260408120549081158015906111f1575082155b905080801561120a5750600854600160a01b900460ff16155b801561122f57506001600160a01b03861660009081526012602052604090205460ff16155b801561125457506001600160a01b03861660009081526010602052604090205460ff16155b801561127957506001600160a01b03851660009081526010602052604090205460ff16155b156112a8576008805460ff60a01b1916600160a01b17905561129a8461179f565b6008805460ff60a01b191690555b600854600090600160a01b900460ff161580156112c3575083155b6001600160a01b03881660009081526010602052604090205490915060ff168061130557506001600160a01b03861660009081526010602052604090205460ff165b1561130e575060005b60008115611399576001600160a01b03871660009081526012602052604090205460ff161561135e576113576064611351600f54896118ee90919063ffffffff16565b90611901565b905061137b565b6113786064611351600e54896118ee90919063ffffffff16565b90505b801561138c5761138c883083611675565b6113968187611c05565b95505b6113a4888888611675565b5050505050505050565b6005546001600160a01b0316331461089d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610779565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216600081815260126020526040808220805460ff191685151590811790915590519092917fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab91a35050565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106114e3576114e3611c18565b60200260200101906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611561573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115859190611c2e565b8160018151811061159857611598611c18565b60200260200101906001600160a01b031690816001600160a01b0316815250506115e3307f000000000000000000000000000000000000000000000000000000000000000084610c17565b60085460405163791ac94760e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169263791ac9479261163f928792600092889291909116904290600401611c4b565b600060405180830381600087803b15801561165957600080fd5b505af115801561166d573d6000803e3d6000fd5b505050505050565b6001600160a01b03831661169b5760405162461bcd60e51b815260040161077990611b7d565b6001600160a01b0382166116c15760405162461bcd60e51b815260040161077990611bc2565b6001600160a01b038316600090815260208190526040902054818110156117395760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610779565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36107f9565b30600090815260208190526040812054908181036117bc57505050565b600f54600e546117cc9190611b31565b600003611838576000821180156117e45750600c5482105b156117f05750806118e5565b600061180c6064611351600f54876118ee90919063ffffffff16565b90506118188185611c05565b9350600c5484111561182e57600c549150611832565b8391505b506118e5565b6000821180156118545750600c54611851906005611901565b82105b1561185e57505050565b60008211801561187a5750600c54611877906005611901565b82115b80156118875750600c5482105b156118a157600c5461189a906005611901565b90506118e5565b60006118bd6064611351600f54876118ee90919063ffffffff16565b90506118c98185611c05565b9350600c548411156118df57600c5491506118e3565b8391505b505b610e0f816114ae565b60006118fa8284611b44565b9392505050565b60006118fa8284611b5b565b60006020808352835180602085015260005b8181101561193b5785810183015185820160400152820161191f565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b038116811461093457600080fd5b6000806040838503121561198457600080fd5b823561198f8161195c565b946020939093013593505050565b6000806000606084860312156119b257600080fd5b83356119bd8161195c565b925060208401356119cd8161195c565b929592945050506040919091013590565b6000602082840312156119f057600080fd5b81356118fa8161195c565b60008060408385031215611a0e57600080fd5b50508035926020909101359150565b801515811461093457600080fd5b60008060408385031215611a3e57600080fd5b8235611a498161195c565b91506020830135611a5981611a1d565b809150509250929050565b600060208284031215611a7657600080fd5b5035919050565b60008060408385031215611a9057600080fd5b8235611a9b8161195c565b91506020830135611a598161195c565b600181811c90821680611abf57607f821691505b602082108103611adf57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215611af757600080fd5b5051919050565b600060208284031215611b1057600080fd5b81516118fa81611a1d565b634e487b7160e01b600052601160045260246000fd5b8082018082111561066157610661611b1b565b808202811582820484141761066157610661611b1b565b600082611b7857634e487b7160e01b600052601260045260246000fd5b500490565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b8181038181111561066157610661611b1b565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611c4057600080fd5b81516118fa8161195c565b600060a08201878352602087602085015260a0604085015281875180845260c08601915060208901935060005b81811015611c9d5784516001600160a01b031683529383019391830191600101611c78565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220605f80474180cf84725c6186e27cd4c1265dd3eb970f5d1dd382fbe04d24ea0d64736f6c63430008170033 | 6080604052600436106101db5760003560e01c806389291a8f11610102578063c8c8ebe411610095578063e2f4560511610064578063e2f456051461055a578063f2fde38b14610570578063f8b45b0514610590578063fb201b1d146105a657600080fd5b8063c8c8ebe4146104f8578063cf9522fd1461050e578063dd62ed3e14610524578063dd8546521461054457600080fd5b8063a457c2d7116100d1578063a457c2d714610478578063a9059cbb14610498578063afa4f3b2146104b8578063b70143c9146104d857600080fd5b806389291a8f146104105780638da5cb5b1461042557806395d89b41146104435780639a7a23d61461045857600080fd5b8063313ce5671161017a57806352f7c9881161014957806352f7c98814610359578063583e05681461037957806370a08231146103c5578063715018a6146103fb57600080fd5b8063313ce567146102c4578063346cc7be146102e057806339509351146103005780634fbee1931461032057600080fd5b806318160ddd116101b657806318160ddd1461025857806323b872dd14610277578063284f289914610297578063311028af146102ae57600080fd5b806299d386146101e757806306fdde0314610216578063095ea7b31461023857600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50600d546102019060ff1681565b60405190151581526020015b60405180910390f35b34801561022257600080fd5b5061022b6105bb565b60405161020d919061190d565b34801561024457600080fd5b50610201610253366004611971565b61064d565b34801561026457600080fd5b506002545b60405190815260200161020d565b34801561028357600080fd5b5061020161029236600461199d565b610667565b3480156102a357600080fd5b506102ac61068b565b005b3480156102ba57600080fd5b5061026960095481565b3480156102d057600080fd5b506040516012815260200161020d565b3480156102ec57600080fd5b506102ac6102fb3660046119de565b6106a9565b34801561030c57600080fd5b5061020161031b366004611971565b6107ff565b34801561032c57600080fd5b5061020161033b3660046119de565b6001600160a01b031660009081526010602052604090205460ff1690565b34801561036557600080fd5b506102ac6103743660046119fb565b610821565b34801561038557600080fd5b506103ad7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b6040516001600160a01b03909116815260200161020d565b3480156103d157600080fd5b506102696103e03660046119de565b6001600160a01b031660009081526020819052604090205490565b34801561040757600080fd5b506102ac61088b565b34801561041c57600080fd5b506102ac61089f565b34801561043157600080fd5b506005546001600160a01b03166103ad565b34801561044f57600080fd5b5061022b610937565b34801561046457600080fd5b506102ac610473366004611a2b565b610946565b34801561048457600080fd5b50610201610493366004611971565b6109e0565b3480156104a457600080fd5b506102016104b3366004611971565b610a5b565b3480156104c457600080fd5b506102ac6104d3366004611a64565b610a69565b3480156104e457600080fd5b506102ac6104f3366004611a64565b610a89565b34801561050457600080fd5b50610269600a5481565b34801561051a57600080fd5b50610269600f5481565b34801561053057600080fd5b5061026961053f366004611a7d565b610b5f565b34801561055057600080fd5b50610269600e5481565b34801561056657600080fd5b50610269600c5481565b34801561057c57600080fd5b506102ac61058b3660046119de565b610b8a565b34801561059c57600080fd5b50610269600b5481565b3480156105b257600080fd5b506102ac610c00565b6060600380546105ca90611aab565b80601f01602080910402602001604051908101604052809291908181526020018280546105f690611aab565b80156106435780601f1061061857610100808354040283529160200191610643565b820191906000526020600020905b81548152906001019060200180831161062657829003601f168201915b5050505050905090565b60003361065b818585610c17565b60019150505b92915050565b600033610675858285610d3b565b610680858585610daf565b506001949350505050565b6106936113ae565b600061069e60025490565b600a819055600b5550565b6007546001600160a01b0316336001600160a01b0316146106c957600080fd5b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610712573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107369190611ae5565b9050600081116107825760405162461bcd60e51b81526020600482015260126024820152712737903a37b5b2b739903a379031b632b0b960711b60448201526064015b60405180910390fd5b60075460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390529083169063a9059cbb906044016020604051808303816000875af11580156107d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f99190611afe565b50505050565b60003361065b8185856108128383610b5f565b61081c9190611b31565b610c17565b6108296113ae565b6028821115801561083b575060328111155b6108805760405162461bcd60e51b8152602060048201526016602482015275466565732063616e6e6f74206578636565642039392560501b6044820152606401610779565b600e91909155600f55565b6108936113ae565b61089d6000611408565b565b6007546001600160a01b0316336001600160a01b0316146108bf57600080fd5b600047116109085760405162461bcd60e51b81526020600482015260166024820152752a37b5b2b71d1037379022aa24103a379031b632b0b960511b6044820152606401610779565b60405133904780156108fc02916000818181858888f19350505050158015610934573d6000803e3d6000fd5b50565b6060600480546105ca90611aab565b61094e6113ae565b6006546001600160a01b03908116908316036109d25760405162461bcd60e51b815260206004820152603960248201527f54686520706169722063616e6e6f742062652072656d6f7665642066726f6d2060448201527f6175746f6d617465644d61726b65744d616b65725061697273000000000000006064820152608401610779565b6109dc828261145a565b5050565b600033816109ee8286610b5f565b905083811015610a4e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610779565b6106808286868403610c17565b60003361065b818585610daf565b610a716113ae565b610a8381670de0b6b3a7640000611b44565b600c5550565b6007546001600160a01b0316336001600160a01b031614610aa957600080fd5b6000610ab460025490565b306000908152602081905260408120549192506064849003610ad7575080610afa565b6064610ae38585611b44565b610aed9190611b5b565b905081811115610afa5750805b81811115610b565760405162461bcd60e51b8152602060048201526024808201527f5377617020616d6f756e74206578636565647320636f6e74726163742062616c604482015263616e636560e01b6064820152608401610779565b6107f9816114ae565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610b926113ae565b6001600160a01b038116610bf75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610779565b61093481611408565b610c086113ae565b600d805460ff19166001179055565b6001600160a01b038316610c795760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610779565b6001600160a01b038216610cda5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610779565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610d478484610b5f565b905060001981146107f95781811015610da25760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610779565b6107f98484848403610c17565b6001600160a01b038316610dd55760405162461bcd60e51b815260040161077990611b7d565b6001600160a01b038216610dfb5760405162461bcd60e51b815260040161077990611bc2565b80600003610e1457610e0f83836000611675565b505050565b6001600160a01b03831660009081526012602052604081205460ff16158015610e5657506001600160a01b03831660009081526012602052604090205460ff16155b9050610e6a6005546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610e9957506005546001600160a01b03848116911614155b8015610ead57506001600160a01b03831615155b8015610ec457506001600160a01b03831661dead14155b8015610eda5750600854600160a01b900460ff16155b156111d357600d5460ff16610f6d576001600160a01b03841660009081526010602052604090205460ff1680610f2857506001600160a01b03831660009081526010602052604090205460ff165b610f6d5760405162461bcd60e51b81526020600482015260166024820152752a3930b234b7339034b9903737ba1030b1ba34bb329760511b6044820152606401610779565b6001600160a01b03841660009081526012602052604090205460ff168015610fae57506001600160a01b03831660009081526011602052604090205460ff16155b1561109257600a548211156110235760405162461bcd60e51b815260206004820152603560248201527f427579207472616e7366657220616d6f756e742065786365656473207468652060448201527436b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760591b6064820152608401610779565b600b546001600160a01b0384166000908152602081905260409020546110499084611b31565b111561108d5760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610779565b6111d3565b6001600160a01b03831660009081526012602052604090205460ff1680156110d357506001600160a01b03841660009081526011602052604090205460ff16155b1561114957600a5482111561108d5760405162461bcd60e51b815260206004820152603660248201527f53656c6c207472616e7366657220616d6f756e742065786365656473207468656044820152751036b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760511b6064820152608401610779565b6001600160a01b03831660009081526011602052604090205460ff166111d357600b546001600160a01b03841660009081526020819052604090205461118f9084611b31565b11156111d35760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610779565b306000908152602081905260408120549081158015906111f1575082155b905080801561120a5750600854600160a01b900460ff16155b801561122f57506001600160a01b03861660009081526012602052604090205460ff16155b801561125457506001600160a01b03861660009081526010602052604090205460ff16155b801561127957506001600160a01b03851660009081526010602052604090205460ff16155b156112a8576008805460ff60a01b1916600160a01b17905561129a8461179f565b6008805460ff60a01b191690555b600854600090600160a01b900460ff161580156112c3575083155b6001600160a01b03881660009081526010602052604090205490915060ff168061130557506001600160a01b03861660009081526010602052604090205460ff165b1561130e575060005b60008115611399576001600160a01b03871660009081526012602052604090205460ff161561135e576113576064611351600f54896118ee90919063ffffffff16565b90611901565b905061137b565b6113786064611351600e54896118ee90919063ffffffff16565b90505b801561138c5761138c883083611675565b6113968187611c05565b95505b6113a4888888611675565b5050505050505050565b6005546001600160a01b0316331461089d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610779565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216600081815260126020526040808220805460ff191685151590811790915590519092917fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab91a35050565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106114e3576114e3611c18565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611561573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115859190611c2e565b8160018151811061159857611598611c18565b60200260200101906001600160a01b031690816001600160a01b0316815250506115e3307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84610c17565b60085460405163791ac94760e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81169263791ac9479261163f928792600092889291909116904290600401611c4b565b600060405180830381600087803b15801561165957600080fd5b505af115801561166d573d6000803e3d6000fd5b505050505050565b6001600160a01b03831661169b5760405162461bcd60e51b815260040161077990611b7d565b6001600160a01b0382166116c15760405162461bcd60e51b815260040161077990611bc2565b6001600160a01b038316600090815260208190526040902054818110156117395760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610779565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36107f9565b30600090815260208190526040812054908181036117bc57505050565b600f54600e546117cc9190611b31565b600003611838576000821180156117e45750600c5482105b156117f05750806118e5565b600061180c6064611351600f54876118ee90919063ffffffff16565b90506118188185611c05565b9350600c5484111561182e57600c549150611832565b8391505b506118e5565b6000821180156118545750600c54611851906005611901565b82105b1561185e57505050565b60008211801561187a5750600c54611877906005611901565b82115b80156118875750600c5482105b156118a157600c5461189a906005611901565b90506118e5565b60006118bd6064611351600f54876118ee90919063ffffffff16565b90506118c98185611c05565b9350600c548411156118df57600c5491506118e3565b8391505b505b610e0f816114ae565b60006118fa8284611b44565b9392505050565b60006118fa8284611b5b565b60006020808352835180602085015260005b8181101561193b5785810183015185820160400152820161191f565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b038116811461093457600080fd5b6000806040838503121561198457600080fd5b823561198f8161195c565b946020939093013593505050565b6000806000606084860312156119b257600080fd5b83356119bd8161195c565b925060208401356119cd8161195c565b929592945050506040919091013590565b6000602082840312156119f057600080fd5b81356118fa8161195c565b60008060408385031215611a0e57600080fd5b50508035926020909101359150565b801515811461093457600080fd5b60008060408385031215611a3e57600080fd5b8235611a498161195c565b91506020830135611a5981611a1d565b809150509250929050565b600060208284031215611a7657600080fd5b5035919050565b60008060408385031215611a9057600080fd5b8235611a9b8161195c565b91506020830135611a598161195c565b600181811c90821680611abf57607f821691505b602082108103611adf57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215611af757600080fd5b5051919050565b600060208284031215611b1057600080fd5b81516118fa81611a1d565b634e487b7160e01b600052601160045260246000fd5b8082018082111561066157610661611b1b565b808202811582820484141761066157610661611b1b565b600082611b7857634e487b7160e01b600052601260045260246000fd5b500490565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b8181038181111561066157610661611b1b565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611c4057600080fd5b81516118fa8161195c565b600060a08201878352602087602085015260a0604085015281875180845260c08601915060208901935060005b81811015611c9d5784516001600160a01b031683529383019391830191600101611c78565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220605f80474180cf84725c6186e27cd4c1265dd3eb970f5d1dd382fbe04d24ea0d64736f6c63430008170033 | {{
"language": "Solidity",
"sources": {
"src/MBCLUB.sol": {
"content": "\n/*\nPepe, Brett, Landwolf, and Andy stumbled upon a hidden, glowing cave in a forgotten forest. They drank from a mysterious cauldron, instantly transforming into bizarre, grotesque forms... \nMeet their new identities: the Mutant Boy's Club.\n\nLAUNCHING FRIDAY 12th JULY - 1pm UTC\n\nhttps://mutantboysclub.xyz/\nhttps://x.com/boysclubmutant\nhttps://t.me/mutantboysclub\n\nBe aware of the many copycats/scams, the official CA will be deployed by 0xbfbCdD04DDa68cfCFBa2d687fFCe365fD46d5F5F\n*/\n\npragma solidity ^0.8.23;\npragma experimental ABIEncoderV2;\n\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n\ninterface IUniswapV2Router02 {\n function factory() external pure returns (address);\n\n function WETH() external pure returns (address);\n\n function addLiquidity(\n address tokenA,\n address tokenB,\n uint256 amountADesired,\n uint256 amountBDesired,\n uint256 amountAMin,\n uint256 amountBMin,\n address to,\n uint256 deadline\n )\n external\n returns (\n uint256 amountA,\n uint256 amountB,\n uint256 liquidity\n );\n\n function addLiquidityETH(\n address token,\n uint256 amountTokenDesired,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n )\n external\n payable\n returns (\n uint256 amountToken,\n uint256 amountETH,\n uint256 liquidity\n );\n\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n}\n\ninterface IUniswapV2Pair {\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n function name() external pure returns (string memory);\n\n function symbol() external pure returns (string memory);\n\n function decimals() external pure returns (uint8);\n\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address owner) external view returns (uint256);\n\n function allowance(address owner, address spender)\n external\n view\n returns (uint256);\n\n function approve(address spender, uint256 value) external returns (bool);\n\n function transfer(address to, uint256 value) external returns (bool);\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) external returns (bool);\n\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n\n function PERMIT_TYPEHASH() external pure returns (bytes32);\n\n function nonces(address owner) external view returns (uint256);\n\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n event Mint(address indexed sender, uint256 amount0, uint256 amount1);\n\n event Swap(\n address indexed sender,\n uint256 amount0In,\n uint256 amount1In,\n uint256 amount0Out,\n uint256 amount1Out,\n address indexed to\n );\n event Sync(uint112 reserve0, uint112 reserve1);\n\n function MINIMUM_LIQUIDITY() external pure returns (uint256);\n\n function factory() external view returns (address);\n\n function token0() external view returns (address);\n\n function token1() external view returns (address);\n\n function getReserves()\n external\n view\n returns (\n uint112 reserve0,\n uint112 reserve1,\n uint32 blockTimestampLast\n );\n\n function price0CumulativeLast() external view returns (uint256);\n\n function price1CumulativeLast() external view returns (uint256);\n\n function kLast() external view returns (uint256);\n\n function mint(address to) external returns (uint256 liquidity);\n\n function swap(\n uint256 amount0Out,\n uint256 amount1Out,\n address to,\n bytes calldata data\n ) external;\n\n function skim(address to) external;\n\n function sync() external;\n\n function initialize(address, address) external;\n}\n\ninterface IUniswapV2Factory {\n event PairCreated(\n address indexed token0,\n address indexed token1,\n address pair,\n uint256\n );\n\n function feeTo() external view returns (address);\n\n function feeToSetter() external view returns (address);\n\n function getPair(address tokenA, address tokenB)\n external\n view\n returns (address pair);\n\n function allPairs(uint256) external view returns (address pair);\n\n function allPairsLength() external view returns (uint256);\n\n function createPair(address tokenA, address tokenB)\n external\n returns (address pair);\n\n function setFeeTo(address) external;\n\n function setFeeToSetter(address) external;\n}\n\nlibrary SafeMath {\n\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n return a + b;\n }\n\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return a - b;\n }\n\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n }\n\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return a / b;\n }\n\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return a % b;\n }\n\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n unchecked {\n require(b <= a, errorMessage);\n return a - b;\n }\n }\n\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a / b;\n }\n }\n\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a % b;\n }\n }\n}\n\ninterface IERC20 {\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address account) external view returns (uint256);\n\n function transfer(address to, uint256 amount) external returns (bool);\n\n function allowance(address owner, address spender) external view returns (uint256);\n\n function approve(address spender, uint256 amount) external returns (bool);\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n\ninterface IERC20Metadata is IERC20 {\n\n function name() external view returns (string memory);\n function symbol() external view returns (string memory);\n function decimals() external view returns (uint8);\n}\n\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n\ncontract MBCLUB is ERC20, Ownable {\n\n using SafeMath for uint256;\n \n IUniswapV2Router02 public immutable _uniswapV2Router;\n address private uniswapV2Pair;\n address private deployerWallet;\n address private marketingWallet;\n address private constant deadAddress = address(0xdead);\n\n bool private swapping;\n\n string private constant _name = \"Mutant Boys Club\";\n string private constant _symbol = \"MBCLUB\";\n\n uint256 public initialTotalSupply = 420_690_000_000 * 1e18;\n uint256 public maxTransactionAmount = 8_413_800_000 * 1e18;\n uint256 public maxWallet = 8_413_800_000 * 1e18;\n uint256 public swapTokensAtAmount = 4_206_900_000 * 1e18;\n\n bool public enableTrade = false;\n\n uint256 public BuyFee = 20;\n uint256 public SellFee = 35;\n\n mapping(address => bool) private _isExcludedFromFees;\n mapping(address => bool) private _isExcludedMaxTransactionAmount;\n mapping(address => bool) private automatedMarketMakerPairs;\n\n event ExcludeFromFees(address indexed account, bool isExcluded);\n event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);\n\n constructor() ERC20(_name, _symbol) {\n\n _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());\n _setAutomatedMarketMakerPair(address(uniswapV2Pair), true);\n excludeFromMaxTransaction(address(uniswapV2Pair), true);\n excludeFromMaxTransaction(address(_uniswapV2Router), true);\n marketingWallet = payable(_msgSender()); \n \n deployerWallet = payable(_msgSender());\n excludeFromFees(owner(), true);\n excludeFromFees(address(this), true);\n excludeFromFees(address(_msgSender()), true);\n excludeFromFees(address(0xdead), true);\n\n excludeFromMaxTransaction(owner(), true);\n excludeFromMaxTransaction(address(this), true);\n excludeFromMaxTransaction(address(_msgSender()), true);\n excludeFromMaxTransaction(address(0xdead), true);\n\n uint devTx = initialTotalSupply.mul(88).div(100);\n uint remain = initialTotalSupply.sub(devTx);\n\n _mint(deployerWallet, devTx);\n _mint(address(this),remain);\n\n }\n\n receive() external payable {}\n\n function openTrade() external onlyOwner() {\n enableTrade = true;\n }\n\n function excludeFromMaxTransaction(address updAds, bool isEx) private {\n _isExcludedMaxTransactionAmount[updAds] = isEx;\n }\n\n function excludeFromFees(address account, bool excluded) private {\n _isExcludedFromFees[account] = excluded;\n emit ExcludeFromFees(account, excluded);\n }\n\n function setAutomatedMarketMakerPair(address pair, bool value) public onlyOwner {\n require(pair != uniswapV2Pair, \"The pair cannot be removed from automatedMarketMakerPairs\");\n _setAutomatedMarketMakerPair(pair, value);\n }\n\n function _setAutomatedMarketMakerPair(address pair, bool value) private {\n automatedMarketMakerPairs[pair] = value;\n emit SetAutomatedMarketMakerPair(pair, value);\n }\n\n function isExcludedFromFees(address account) public view returns (bool) {\n return _isExcludedFromFees[account];\n }\n\n function _transfer(address from, address to, uint256 amount) internal override {\n\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if (amount == 0) {\n super._transfer(from, to, 0);\n return;\n }\n \n bool isTransfer = !automatedMarketMakerPairs[from] && !automatedMarketMakerPairs[to];\n\n if (from != owner() && to != owner() && to != address(0) && to != address(0xdead) && !swapping) {\n\n if (!enableTrade) {\n require(_isExcludedFromFees[from] || _isExcludedFromFees[to], \"Trading is not active.\");\n }\n\n if (automatedMarketMakerPairs[from] && !_isExcludedMaxTransactionAmount[to]) {\n require(amount <= maxTransactionAmount, \"Buy transfer amount exceeds the maxTransactionAmount.\");\n require(amount + balanceOf(to) <= maxWallet, \"Max wallet exceeded\");\n }\n\n else if (automatedMarketMakerPairs[to] && !_isExcludedMaxTransactionAmount[from]) {\n require(amount <= maxTransactionAmount, \"Sell transfer amount exceeds the maxTransactionAmount.\");\n } \n \n else if (!_isExcludedMaxTransactionAmount[to]) {\n require(amount + balanceOf(to) <= maxWallet, \"Max wallet exceeded\");\n }\n \n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n bool canSwap = contractTokenBalance > 0 && !isTransfer;\n\n if (canSwap && !swapping && !automatedMarketMakerPairs[from] && !_isExcludedFromFees[from] && !_isExcludedFromFees[to]) {\n swapping = true;\n swapBack(amount);\n swapping = false;\n }\n\n bool takeFee = !swapping && !isTransfer;\n\n if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {\n takeFee = false;\n }\n\n uint256 fees = 0;\n\n if (takeFee) {\n if (automatedMarketMakerPairs[to]) {\n fees = amount.mul(SellFee).div(100);\n }\n else {\n fees = amount.mul(BuyFee).div(100);\n }\n\n if (fees > 0) {\n super._transfer(from, address(this), fees);\n }\n amount -= fees;\n }\n super._transfer(from, to, amount);\n }\n\n function swapTokensForEth(uint256 tokenAmount) private {\n\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = _uniswapV2Router.WETH();\n\n _approve(address(this), address(_uniswapV2Router), tokenAmount);\n\n _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n marketingWallet,\n block.timestamp\n );\n }\n\n function removeSkullLimits() external onlyOwner {\n uint256 totalSupplyAmount = totalSupply();\n maxTransactionAmount = totalSupplyAmount;\n maxWallet = totalSupplyAmount;\n }\n\n function clearStuckEth() external {\n require(_msgSender() == deployerWallet);\n require(address(this).balance > 0, \"Token: no ETH to clear\");\n payable(msg.sender).transfer(address(this).balance);\n }\n\n function clearStuckTokens(address tokenAddress) external {\n require(_msgSender() == deployerWallet);\n IERC20 tokenContract = IERC20(tokenAddress);\n uint256 balance = tokenContract.balanceOf(address(this));\n require(balance > 0, \"No tokens to clear\");\n tokenContract.transfer(deployerWallet, balance);\n }\n\n function setFee(uint256 _buyFee, uint256 _sellFee) external onlyOwner {\n require(_buyFee <= 40 && _sellFee <= 50, \"Fees cannot exceed 99%\");\n BuyFee = _buyFee;\n SellFee = _sellFee;\n }\n\n function setSwapTokensAtAmount(uint256 _amount) external onlyOwner {\n swapTokensAtAmount = _amount * (10 ** 18);\n }\n\n function manualSwap(uint256 percent) external {\n require(_msgSender() == deployerWallet);\n uint256 totalSupplyAmount = totalSupply();\n uint256 contractBalance = balanceOf(address(this));\n uint256 tokensToSwap;\n\n if (percent == 100) {\n tokensToSwap = contractBalance;\n } else {\n tokensToSwap = totalSupplyAmount * percent / 100;\n if (tokensToSwap > contractBalance) {\n tokensToSwap = contractBalance;\n }\n }\n\n require(tokensToSwap <= contractBalance, \"Swap amount exceeds contract balance\");\n swapTokensForEth(tokensToSwap);\n }\n\n function swapBack(uint256 tokens) private {\n uint256 contractBalance = balanceOf(address(this));\n uint256 tokensToSwap; \n\n if (contractBalance == 0) {\n return;\n }\n\n if ((BuyFee+SellFee) == 0) {\n\n if(contractBalance > 0 && contractBalance < swapTokensAtAmount) {\n tokensToSwap = contractBalance;\n }\n else {\n uint256 sellFeeTokens = tokens.mul(SellFee).div(100);\n tokens -= sellFeeTokens;\n if (tokens > swapTokensAtAmount) {\n tokensToSwap = swapTokensAtAmount;\n }\n else {\n tokensToSwap = tokens;\n }\n }\n }\n\n else {\n\n if(contractBalance > 0 && contractBalance < swapTokensAtAmount.div(5)) {\n return;\n }\n else if (contractBalance > 0 && contractBalance > swapTokensAtAmount.div(5) && contractBalance < swapTokensAtAmount) {\n tokensToSwap = swapTokensAtAmount.div(5);\n }\n else {\n uint256 sellFeeTokens = tokens.mul(SellFee).div(100);\n tokens -= sellFeeTokens;\n if (tokens > swapTokensAtAmount) {\n tokensToSwap = swapTokensAtAmount;\n } else {\n tokensToSwap = tokens;\n }\n }\n }\n swapTokensForEth(tokensToSwap);\n }\n\n \n}"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {}
}
}} |
1 | 20,290,467 | b9f1d03c0ac0f543204fb3486a31588940ae963575f8232ce3597baab54f5f44 | 2a572ca0d832606c01739990f43a23f26ac5c5b339d971b0322c4fcee1f62c52 | bfbcdd04dda68cfcfba2d687ffce365fd46d5f5f | 5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f | 0e5337b94e09ee7943cb6b1c356f2ddfd4a24dac | 60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429 | 608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032 | // File: contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/interfaces/IUniswapV2ERC20.sol
pragma solidity >=0.5.0;
interface IUniswapV2ERC20 {
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;
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/UniswapV2ERC20.sol
pragma solidity =0.5.16;
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// File: contracts/libraries/Math.sol
pragma solidity =0.5.16;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// File: contracts/libraries/UQ112x112.sol
pragma solidity =0.5.16;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view 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);
}
// File: contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/interfaces/IUniswapV2Callee.sol
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// File: contracts/UniswapV2Pair.sol
pragma solidity =0.5.16;
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
}
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);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(5).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = IERC20(_token0).balanceOf(address(this));
uint balance1 = IERC20(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
} |
1 | 20,290,470 | 68cc37c1faa89bec0dfb48c5e32b1611590be3d1b4700bd827f824085aaa4cf8 | a9a80a697ab1bbf7a150532e98533a884b45172e6e1054be9a703ec8d118aa1a | 0000db5c8b030ae20308ac975898e09741e70000 | ed0e416e0feea5b484ba5c95d375545ac2b60572 | 457a3a3e7982c89bf6a07c0d7c240a8c1700f5c6 | 608060405234801561001057600080fd5b50604051610a1a380380610a1a8339818101604052810190610032919061011c565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550326000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610149565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e9826100be565b9050919050565b6100f9816100de565b811461010457600080fd5b50565b600081519050610116816100f0565b92915050565b600060208284031215610132576101316100b9565b5b600061014084828501610107565b91505092915050565b6108c2806101586000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033000000000000000000000000000037bb05b2cef17c6469f4bcdb198826ce0000 | 608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033 | |
1 | 20,290,470 | 68cc37c1faa89bec0dfb48c5e32b1611590be3d1b4700bd827f824085aaa4cf8 | d0a393090f96c5cbceb8d11e5c26b18b1628d1c01ed1a3d078b0f745e2faf888 | 0000db5c8b030ae20308ac975898e09741e70000 | ed0e416e0feea5b484ba5c95d375545ac2b60572 | a95de567fabcb81fe2b3363810366ff06da59d74 | 608060405234801561001057600080fd5b50604051610a1a380380610a1a8339818101604052810190610032919061011c565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550326000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610149565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e9826100be565b9050919050565b6100f9816100de565b811461010457600080fd5b50565b600081519050610116816100f0565b92915050565b600060208284031215610132576101316100b9565b5b600061014084828501610107565b91505092915050565b6108c2806101586000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033000000000000000000000000000037bb05b2cef17c6469f4bcdb198826ce0000 | 608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033 | |
1 | 20,290,475 | bea2100474ff6a73009dd31f37b6ac6a9d6145e54c60d9a34113bf33ca33f370 | 8b591a8925e20984908351f9c2cadf3e99982f95f0c8b198ccfd1d627327658f | 4e565f63257d90f988e5ec9d065bab00f94d2dfd | 9fa5c5733b53814692de4fb31fd592070de5f5f0 | 6a4d4d88e055c7af0c5c02f6be13896e4ae3640f | 608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe | ||
1 | 20,290,480 | cdbff50bff1f5f217ce298ca09e66ffa4d660d42fb98a70d181660a51d9326e0 | 005047356810d5b3bfe207e891e68ea27bcb85d7b13afa21d103df486e751081 | f26ad541978ddf0c914dd21c8b2ff52f2b7372af | 1f98431c8ad98523631ae4a59f267346ea31f984 | 0fb14ab783befb6a54cf749f7b3fb55ff8095e40 | 6101606040523480156200001257600080fd5b503060601b60805260408051630890357360e41b81529051600091339163890357309160048082019260a092909190829003018186803b1580156200005657600080fd5b505afa1580156200006b573d6000803e3d6000fd5b505050506040513d60a08110156200008257600080fd5b508051602080830151604084015160608086015160809096015160e896871b6001600160e81b0319166101005291811b6001600160601b031990811660e05292811b831660c0529390931b1660a052600282810b900b90921b610120529150620000f79082906200010f811b62002b8417901c565b60801b6001600160801b03191661014052506200017d565b60008082600281900b620d89e719816200012557fe5b05029050600083600281900b620d89e8816200013d57fe5b0502905060008460020b83830360020b816200015557fe5b0560010190508062ffffff166001600160801b038016816200017357fe5b0495945050505050565b60805160601c60a05160601c60c05160601c60e05160601c6101005160e81c6101205160e81c6101405160801c61567e6200024a60003980611fee5280614b5f5280614b96525080610c0052806128fd5280614bca5280614bfc525080610cef52806119cb5280611a0252806129455250806111c75280611a855280611ef4528061244452806129215280613e6b5250806108d252806112f55280611a545280611e8e52806123be5280613d2252508061207b528061227d52806128d9525080612bfb525061567e6000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c806370cf754a116100ee578063c45a015511610097578063ddca3f4311610071578063ddca3f4314610800578063f305839914610820578063f30dba9314610828578063f637731d146108aa576101ae565b8063c45a0155146107d1578063d0c93a7c146107d9578063d21220a7146107f8576101ae565b8063883bdbfd116100c8578063883bdbfd14610633578063a34123a71461073c578063a38807f214610776576101ae565b806370cf754a146105c65780638206a4d1146105ce57806385b66729146105f6576101ae565b80633850c7bd1161015b578063490e6cbc11610135578063490e6cbc146104705780634f1eb3d8146104fc578063514ea4bf1461054d5780635339c296146105a6576101ae565b80633850c7bd1461035b5780633c8a7d8d146103b45780634614131914610456576101ae565b80631ad8b03b1161018c5780631ad8b03b146102aa578063252c09d7146102e157806332148f6714610338576101ae565b80630dfe1681146101b3578063128acb08146101d75780631a68650214610286575b600080fd5b6101bb6108d0565b604080516001600160a01b039092168252519081900360200190f35b61026d600480360360a08110156101ed57600080fd5b6001600160a01b0382358116926020810135151592604082013592606083013516919081019060a08101608082013564010000000081111561022e57600080fd5b82018360208201111561024057600080fd5b8035906020019184600183028401116401000000008311171561026257600080fd5b5090925090506108f4565b6040805192835260208301919091528051918290030190f35b61028e6114ad565b604080516001600160801b039092168252519081900360200190f35b6102b26114bc565b60405180836001600160801b03168152602001826001600160801b031681526020019250505060405180910390f35b6102fe600480360360208110156102f757600080fd5b50356114d6565b6040805163ffffffff909516855260069390930b60208501526001600160a01b039091168383015215156060830152519081900360800190f35b6103596004803603602081101561034e57600080fd5b503561ffff1661151c565b005b610363611616565b604080516001600160a01b03909816885260029690960b602088015261ffff9485168787015292841660608701529216608085015260ff90911660a0840152151560c0830152519081900360e00190f35b61026d600480360360a08110156103ca57600080fd5b6001600160a01b03823516916020810135600290810b92604083013590910b916001600160801b036060820135169181019060a08101608082013564010000000081111561041757600080fd5b82018360208201111561042957600080fd5b8035906020019184600183028401116401000000008311171561044b57600080fd5b509092509050611666565b61045e611922565b60408051918252519081900360200190f35b6103596004803603608081101561048657600080fd5b6001600160a01b0382351691602081013591604082013591908101906080810160608201356401000000008111156104bd57600080fd5b8201836020820111156104cf57600080fd5b803590602001918460018302840111640100000000831117156104f157600080fd5b509092509050611928565b6102b2600480360360a081101561051257600080fd5b506001600160a01b03813516906020810135600290810b91604081013590910b906001600160801b0360608201358116916080013516611d83565b61056a6004803603602081101561056357600080fd5b5035611f9d565b604080516001600160801b0396871681526020810195909552848101939093529084166060840152909216608082015290519081900360a00190f35b61045e600480360360208110156105bc57600080fd5b503560010b611fda565b61028e611fec565b610359600480360360408110156105e457600080fd5b5060ff81358116916020013516612010565b6102b26004803603606081101561060c57600080fd5b506001600160a01b03813516906001600160801b036020820135811691604001351661220f565b6106a36004803603602081101561064957600080fd5b81019060208101813564010000000081111561066457600080fd5b82018360208201111561067657600080fd5b8035906020019184602083028401116401000000008311171561069857600080fd5b5090925090506124dc565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156106e75781810151838201526020016106cf565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561072657818101518382015260200161070e565b5050505090500194505050505060405180910390f35b61026d6004803603606081101561075257600080fd5b508035600290810b91602081013590910b90604001356001600160801b0316612569565b6107a06004803603604081101561078c57600080fd5b508035600290810b9160200135900b6126e0565b6040805160069490940b84526001600160a01b03909216602084015263ffffffff1682820152519081900360600190f35b6101bb6128d7565b6107e16128fb565b6040805160029290920b8252519081900360200190f35b6101bb61291f565b610808612943565b6040805162ffffff9092168252519081900360200190f35b61045e612967565b6108486004803603602081101561083e57600080fd5b503560020b61296d565b604080516001600160801b039099168952600f9790970b602089015287870195909552606087019390935260069190910b60808601526001600160a01b031660a085015263ffffffff1660c0840152151560e083015251908190036101000190f35b610359600480360360208110156108c057600080fd5b50356001600160a01b03166129db565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806108ff612bf0565b85610936576040805162461bcd60e51b8152602060048201526002602482015261415360f01b604482015290519081900360640190fd5b6040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b900b602083015261ffff600160b81b8204811693830193909352600160c81b810483166060830152600160d81b8104909216608082015260ff600160e81b8304811660a0830152600160f01b909204909116151560c082018190526109ef576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b87610a3a5780600001516001600160a01b0316866001600160a01b0316118015610a35575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038716105b610a6c565b80600001516001600160a01b0316866001600160a01b0316108015610a6c57506401000276a36001600160a01b038716115b610aa3576040805162461bcd60e51b815260206004820152600360248201526214d41360ea1b604482015290519081900360640190fd5b6000805460ff60f01b191681556040805160c08101909152808a610ad25760048460a0015160ff16901c610ae5565b60108460a0015160ff1681610ae357fe5b065b60ff1681526004546001600160801b03166020820152604001610b06612c27565b63ffffffff168152602001600060060b815260200160006001600160a01b031681526020016000151581525090506000808913905060006040518060e001604052808b81526020016000815260200185600001516001600160a01b03168152602001856020015160020b81526020018c610b8257600254610b86565b6001545b815260200160006001600160801b0316815260200184602001516001600160801b031681525090505b805115801590610bd55750886001600160a01b031681604001516001600160a01b031614155b15610f9f57610be261560e565b60408201516001600160a01b031681526060820151610c25906006907f00000000000000000000000000000000000000000000000000000000000000008f612c2b565b15156040830152600290810b810b60208301819052620d89e719910b1215610c5657620d89e7196020820152610c75565b6020810151620d89e860029190910b1315610c7557620d89e860208201525b610c828160200151612d6d565b6001600160a01b031660608201526040820151610d13908d610cbc578b6001600160a01b031683606001516001600160a01b031611610cd6565b8b6001600160a01b031683606001516001600160a01b0316105b610ce4578260600151610ce6565b8b5b60c085015185517f000000000000000000000000000000000000000000000000000000000000000061309f565b60c085015260a084015260808301526001600160a01b031660408301528215610d7557610d498160c00151826080015101613291565b825103825260a0810151610d6b90610d6090613291565b6020840151906132a7565b6020830152610db0565b610d828160a00151613291565b825101825260c08101516080820151610daa91610d9f9101613291565b6020840151906132c3565b60208301525b835160ff1615610df6576000846000015160ff168260c0015181610dd057fe5b60c0840180519290910491829003905260a0840180519091016001600160801b03169052505b60c08201516001600160801b031615610e3557610e298160c00151600160801b8460c001516001600160801b03166132d9565b60808301805190910190525b80606001516001600160a01b031682604001516001600160a01b03161415610f5e57806040015115610f35578360a00151610ebf57610e9d846040015160008760200151886040015188602001518a606001516008613389909695949392919063ffffffff16565b6001600160a01b03166080860152600690810b900b6060850152600160a08501525b6000610f0b82602001518e610ed657600154610edc565b84608001515b8f610eeb578560800151610eef565b6002545b608089015160608a015160408b0151600595949392919061351c565b90508c15610f17576000035b610f258360c00151826135ef565b6001600160801b031660c0840152505b8b610f44578060200151610f4d565b60018160200151035b600290810b900b6060830152610f99565b80600001516001600160a01b031682604001516001600160a01b031614610f9957610f8c82604001516136a5565b600290810b900b60608301525b50610baf565b836020015160020b816060015160020b1461107a57600080610fed86604001518660400151886020015188602001518a606001518b6080015160086139d1909695949392919063ffffffff16565b604085015160608601516000805461ffff60c81b1916600160c81b61ffff958616021761ffff60b81b1916600160b81b95909416949094029290921762ffffff60a01b1916600160a01b62ffffff60029490940b93909316929092029190911773ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909116179055506110ac9050565b60408101516000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039092169190911790555b8060c001516001600160801b031683602001516001600160801b0316146110f25760c0810151600480546001600160801b0319166001600160801b039092169190911790555b8a1561114257608081015160015560a08101516001600160801b03161561113d5760a0810151600380546001600160801b031981166001600160801b03918216909301169190911790555b611188565b608081015160025560a08101516001600160801b0316156111885760a0810151600380546001600160801b03808216600160801b92839004821690940116029190911790555b8115158b1515146111a157602081015181518b036111ae565b80600001518a0381602001515b90965094508a156112e75760008512156111f0576111f07f00000000000000000000000000000000000000000000000000000000000000008d87600003613b86565b60006111fa613cd4565b9050336001600160a01b031663fa461e3388888c8c6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561127e57600080fd5b505af1158015611292573d6000803e3d6000fd5b5050505061129e613cd4565b6112a88289613e0d565b11156112e1576040805162461bcd60e51b815260206004820152600360248201526249494160e81b604482015290519081900360640190fd5b50611411565b600086121561131e5761131e7f00000000000000000000000000000000000000000000000000000000000000008d88600003613b86565b6000611328613e1d565b9050336001600160a01b031663fa461e3388888c8c6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b1580156113ac57600080fd5b505af11580156113c0573d6000803e3d6000fd5b505050506113cc613e1d565b6113d68288613e0d565b111561140f576040805162461bcd60e51b815260206004820152600360248201526249494160e81b604482015290519081900360640190fd5b505b60408082015160c083015160608085015184518b8152602081018b90526001600160a01b03948516818701526001600160801b039093169183019190915260020b60808201529151908e169133917fc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca679181900360a00190a350506000805460ff60f01b1916600160f01b17905550919890975095505050505050565b6004546001600160801b031681565b6003546001600160801b0380821691600160801b90041682565b60088161ffff81106114e757600080fd5b015463ffffffff81169150640100000000810460060b90600160581b81046001600160a01b031690600160f81b900460ff1684565b600054600160f01b900460ff16611560576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19169055611575612bf0565b60008054600160d81b900461ffff169061159160088385613eb5565b6000805461ffff808416600160d81b810261ffff60d81b19909316929092179092559192508316146115fe576040805161ffff80851682528316602082015281517fac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a929181900390910190a15b50506000805460ff60f01b1916600160f01b17905550565b6000546001600160a01b03811690600160a01b810460020b9061ffff600160b81b8204811691600160c81b8104821691600160d81b8204169060ff600160e81b8204811691600160f01b90041687565b600080548190600160f01b900460ff166116ad576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b191690556001600160801b0385166116cd57600080fd5b60008061171b60405180608001604052808c6001600160a01b031681526020018b60020b81526020018a60020b81526020016117118a6001600160801b0316613f58565b600f0b9052613f69565b9250925050819350809250600080600086111561173d5761173a613cd4565b91505b841561174e5761174b613e1d565b90505b336001600160a01b031663d348799787878b8b6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b1580156117d057600080fd5b505af11580156117e4573d6000803e3d6000fd5b50505050600086111561183b576117f9613cd4565b6118038388613e0d565b111561183b576040805162461bcd60e51b815260206004820152600260248201526104d360f41b604482015290519081900360640190fd5b841561188b57611849613e1d565b6118538287613e0d565b111561188b576040805162461bcd60e51b81526020600482015260026024820152614d3160f01b604482015290519081900360640190fd5b8960020b8b60020b8d6001600160a01b03167f7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde338d8b8b60405180856001600160a01b03168152602001846001600160801b0316815260200183815260200182815260200194505050505060405180910390a450506000805460ff60f01b1916600160f01b17905550919890975095505050505050565b60025481565b600054600160f01b900460ff1661196c576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19169055611981612bf0565b6004546001600160801b0316806119c3576040805162461bcd60e51b81526020600482015260016024820152601360fa1b604482015290519081900360640190fd5b60006119f8867f000000000000000000000000000000000000000000000000000000000000000062ffffff16620f42406141a9565b90506000611a2f867f000000000000000000000000000000000000000000000000000000000000000062ffffff16620f42406141a9565b90506000611a3b613cd4565b90506000611a47613e1d565b90508815611a7a57611a7a7f00000000000000000000000000000000000000000000000000000000000000008b8b613b86565b8715611aab57611aab7f00000000000000000000000000000000000000000000000000000000000000008b8a613b86565b336001600160a01b031663e9cbafb085858a8a6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b158015611b2d57600080fd5b505af1158015611b41573d6000803e3d6000fd5b505050506000611b4f613cd4565b90506000611b5b613e1d565b905081611b688588613e0d565b1115611ba0576040805162461bcd60e51b8152602060048201526002602482015261046360f41b604482015290519081900360640190fd5b80611bab8487613e0d565b1115611be3576040805162461bcd60e51b8152602060048201526002602482015261463160f01b604482015290519081900360640190fd5b8382038382038115611c725760008054600160e81b9004600f16908115611c16578160ff168481611c1057fe5b04611c19565b60005b90506001600160801b03811615611c4c57600380546001600160801b038082168401166001600160801b03199091161790555b611c66818503600160801b8d6001600160801b03166132d9565b60018054909101905550505b8015611cfd5760008054600160e81b900460041c600f16908115611ca2578160ff168381611c9c57fe5b04611ca5565b60005b90506001600160801b03811615611cd757600380546001600160801b03600160801b8083048216850182160291161790555b611cf1818403600160801b8d6001600160801b03166132d9565b60028054909101905550505b8d6001600160a01b0316336001600160a01b03167fbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca6338f8f86866040518085815260200184815260200183815260200182815260200194505050505060405180910390a350506000805460ff60f01b1916600160f01b179055505050505050505050505050565b600080548190600160f01b900460ff16611dca576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19168155611de460073389896141e3565b60038101549091506001600160801b0390811690861611611e055784611e14565b60038101546001600160801b03165b60038201549093506001600160801b03600160801b909104811690851611611e3c5783611e52565b6003810154600160801b90046001600160801b03165b91506001600160801b03831615611eb7576003810180546001600160801b031981166001600160801b03918216869003821617909155611eb7907f0000000000000000000000000000000000000000000000000000000000000000908a908616613b86565b6001600160801b03821615611f1d576003810180546001600160801b03600160801b808304821686900382160291811691909117909155611f1d907f0000000000000000000000000000000000000000000000000000000000000000908a908516613b86565b604080516001600160a01b038a1681526001600160801b0380861660208301528416818301529051600288810b92908a900b9133917f70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0919081900360600190a4506000805460ff60f01b1916600160f01b17905590969095509350505050565b60076020526000908152604090208054600182015460028301546003909301546001600160801b0392831693919281811691600160801b90041685565b60066020526000908152604090205481565b7f000000000000000000000000000000000000000000000000000000000000000081565b600054600160f01b900460ff16612054576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916905560408051638da5cb5b60e01b815290516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691638da5cb5b916004808301926020929190829003018186803b1580156120c157600080fd5b505afa1580156120d5573d6000803e3d6000fd5b505050506040513d60208110156120eb57600080fd5b50516001600160a01b0316331461210157600080fd5b60ff82161580612124575060048260ff16101580156121245750600a8260ff1611155b801561214e575060ff8116158061214e575060048160ff161015801561214e5750600a8160ff1611155b61215757600080fd5b60008054610ff0600484901b16840160ff908116600160e81b9081027fffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841617909355919004167f973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b1336010826040805160ff9390920683168252600f600486901c16602083015286831682820152918516606082015290519081900360800190a150506000805460ff60f01b1916600160f01b17905550565b600080548190600160f01b900460ff16612256576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916905560408051638da5cb5b60e01b815290516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691638da5cb5b916004808301926020929190829003018186803b1580156122c357600080fd5b505afa1580156122d7573d6000803e3d6000fd5b505050506040513d60208110156122ed57600080fd5b50516001600160a01b0316331461230357600080fd5b6003546001600160801b039081169085161161231f578361232c565b6003546001600160801b03165b6003549092506001600160801b03600160801b9091048116908416116123525782612366565b600354600160801b90046001600160801b03165b90506001600160801b038216156123e7576003546001600160801b038381169116141561239557600019909101905b600380546001600160801b031981166001600160801b039182168590038216179091556123e7907f00000000000000000000000000000000000000000000000000000000000000009087908516613b86565b6001600160801b0381161561246d576003546001600160801b03828116600160801b90920416141561241857600019015b600380546001600160801b03600160801b80830482168590038216029181169190911790915561246d907f00000000000000000000000000000000000000000000000000000000000000009087908416613b86565b604080516001600160801b0380851682528316602082015281516001600160a01b0388169233927f596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151929081900390910190a36000805460ff60f01b1916600160f01b1790559094909350915050565b6060806124e7612bf0565b61255e6124f2612c27565b858580806020026020016040519081016040528093929190818152602001838360200280828437600092018290525054600454600896959450600160a01b820460020b935061ffff600160b81b8304811693506001600160801b0390911691600160c81b900416614247565b915091509250929050565b600080548190600160f01b900460ff166125b0576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916815560408051608081018252338152600288810b602083015287900b918101919091528190819061260990606081016125fc6001600160801b038a16613f58565b600003600f0b9052613f69565b925092509250816000039450806000039350600085118061262a5750600084115b15612669576003830180546001600160801b038082168089018216600160801b93849004831689019092169092029091176001600160801b0319161790555b604080516001600160801b0388168152602081018790528082018690529051600289810b92908b900b9133917f0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c919081900360600190a450506000805460ff60f01b1916600160f01b179055509094909350915050565b60008060006126ed612bf0565b6126f785856143a1565b600285810b810b60009081526005602052604080822087840b90930b825281206003830154600681900b9367010000000000000082046001600160a01b0316928492600160d81b810463ffffffff169284929091600160f81b900460ff168061275f57600080fd5b6003820154600681900b985067010000000000000081046001600160a01b03169650600160d81b810463ffffffff169450600160f81b900460ff16806127a457600080fd5b50506040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b810b6020840181905261ffff600160b81b8404811695850195909552600160c81b830485166060850152600160d81b8304909416608084015260ff600160e81b8304811660a0850152600160f01b909204909116151560c08301529093508e810b91900b1215905061284d575093909403965090039350900390506128d0565b8a60020b816020015160020b12156128c1576000612869612c27565b602083015160408401516004546060860151939450600093849361289f936008938893879392916001600160801b031690613389565b9a9003989098039b5050949096039290920396509091030392506128d0915050565b50949093039650039350900390505b9250925092565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60015481565b60056020526000908152604090208054600182015460028301546003909301546001600160801b03831693600160801b909304600f0b9290600681900b9067010000000000000081046001600160a01b031690600160d81b810463ffffffff1690600160f81b900460ff1688565b6000546001600160a01b031615612a1e576040805162461bcd60e51b8152602060048201526002602482015261414960f01b604482015290519081900360640190fd5b6000612a29826136a5565b9050600080612a41612a39612c27565b60089061446a565b6040805160e0810182526001600160a01b038816808252600288810b6020808501829052600085870181905261ffff898116606088018190529089166080880181905260a08801839052600160c0909801979097528154600160f01b73ffffffffffffffffffffffffffffffffffffffff19909116871762ffffff60a01b1916600160a01b62ffffff9787900b9790971696909602959095177fffffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffff16600160c81b9091021761ffff60d81b1916600160d81b909602959095177fff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1692909217909355835191825281019190915281519395509193507f98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c9592918290030190a150505050565b60008082600281900b620d89e71981612b9957fe5b05029050600083600281900b620d89e881612bb057fe5b0502905060008460020b83830360020b81612bc757fe5b0560010190508062ffffff166001600160801b03801681612be457fe5b0493505050505b919050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612c2557600080fd5b565b4290565b60008060008460020b8660020b81612c3f57fe5b05905060008660020b128015612c6657508460020b8660020b81612c5f57fe5b0760020b15155b15612c7057600019015b8315612ce557600080612c82836144b6565b600182810b810b600090815260208d9052604090205460ff83169190911b80016000190190811680151597509294509092509085612cc757888360ff16860302612cda565b88612cd1826144c8565b840360ff168603025b965050505050612d63565b600080612cf4836001016144b6565b91509150600060018260ff166001901b031990506000818b60008660010b60010b8152602001908152602001600020541690508060001415955085612d4657888360ff0360ff16866001010102612d5c565b8883612d5183614568565b0360ff168660010101025b9650505050505b5094509492505050565b60008060008360020b12612d84578260020b612d8c565b8260020b6000035b9050620d89e8811115612dca576040805162461bcd60e51b81526020600482015260016024820152601560fa1b604482015290519081900360640190fd5b600060018216612dde57600160801b612df0565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615612e24576ffff97272373d413259a46990580e213a0260801c5b6004821615612e43576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b6008821615612e62576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b6010821615612e81576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615612ea0576fff973b41fa98c081472e6896dfb254c00260801c5b6040821615612ebf576fff2ea16466c96a3843ec78b326b528610260801c5b6080821615612ede576ffe5dee046a99a2a811c461f1969c30530260801c5b610100821615612efe576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615612f1e576ff987a7253ac413176f2b074cf7815e540260801c5b610400821615612f3e576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615612f5e576fe7159475a2c29b7443b29c7fa6e889d90260801c5b611000821615612f7e576fd097f3bdfd2022b8845ad8f792aa58250260801c5b612000821615612f9e576fa9f746462d870fdf8a65dc1f90e061e50260801c5b614000821615612fbe576f70d869a156d2a1b890bb3df62baf32f70260801c5b618000821615612fde576f31be135f97d08fd981231505542fcfa60260801c5b62010000821615612fff576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b6202000082161561301f576e5d6af8dedb81196699c329225ee6040260801c5b6204000082161561303e576d2216e584f5fa1ea926041bedfe980260801c5b6208000082161561305b576b048a170391f7dc42444e8fa20260801c5b60008460020b131561307657806000198161307257fe5b0490505b64010000000081061561308a57600161308d565b60005b60ff16602082901c0192505050919050565b60008080806001600160a01b03808916908a1610158187128015906131245760006130d88989620f42400362ffffff16620f42406132d9565b9050826130f1576130ec8c8c8c6001614652565b6130fe565b6130fe8b8d8c60016146cd565b955085811061310f578a965061311e565b61311b8c8b838661478a565b96505b5061316e565b8161313b576131368b8b8b60006146cd565b613148565b6131488a8c8b6000614652565b935083886000031061315c5789955061316e565b61316b8b8a8a600003856147d6565b95505b6001600160a01b038a81169087161482156131d15780801561318d5750815b6131a35761319e878d8c60016146cd565b6131a5565b855b95508080156131b2575081155b6131c8576131c3878d8c6000614652565b6131ca565b845b945061321b565b8080156131db5750815b6131f1576131ec8c888c6001614652565b6131f3565b855b9550808015613200575081155b613216576132118c888c60006146cd565b613218565b845b94505b8115801561322b57508860000385115b15613237578860000394505b81801561325657508a6001600160a01b0316876001600160a01b031614155b15613265578589039350613282565b61327f868962ffffff168a620f42400362ffffff166141a9565b93505b50505095509550955095915050565b6000600160ff1b82106132a357600080fd5b5090565b808203828113156000831215146132bd57600080fd5b92915050565b818101828112156000831215146132bd57600080fd5b600080806000198587098686029250828110908390030390508061330f576000841161330457600080fd5b508290049050613382565b80841161331b57600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b60008063ffffffff8716613430576000898661ffff1661ffff81106133aa57fe5b60408051608081018252919092015463ffffffff8082168084526401000000008304600690810b810b900b6020850152600160581b83046001600160a01b031694840194909452600160f81b90910460ff16151560608301529092508a161461341c57613419818a8988614822565b90505b806020015181604001519250925050613510565b8688036000806134458c8c858c8c8c8c6148d2565b91509150816000015163ffffffff168363ffffffff161415613477578160200151826040015194509450505050613510565b805163ffffffff8481169116141561349f578060200151816040015194509450505050613510565b8151815160208085015190840151918390039286039163ffffffff80841692908516910360060b816134cd57fe5b05028460200151018263ffffffff168263ffffffff1686604001518660400151036001600160a01b031602816134ff57fe5b048560400151019650965050505050505b97509795505050505050565b600295860b860b60009081526020979097526040909620600181018054909503909455938301805490920390915560038201805463ffffffff600160d81b6001600160a01b036701000000000000008085048216909603169094027fffffffffff0000000000000000000000000000000000000000ffffffffffffff90921691909117600681810b90960390950b66ffffffffffffff1666ffffffffffffff199095169490941782810485169095039093160263ffffffff60d81b1990931692909217905554600160801b9004600f0b90565b60008082600f0b121561365457826001600160801b03168260000384039150816001600160801b03161061364f576040805162461bcd60e51b81526020600482015260026024820152614c5360f01b604482015290519081900360640190fd5b6132bd565b826001600160801b03168284019150816001600160801b031610156132bd576040805162461bcd60e51b81526020600482015260026024820152614c4160f01b604482015290519081900360640190fd5b60006401000276a36001600160a01b038316108015906136e1575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038316105b613716576040805162461bcd60e51b81526020600482015260016024820152602960f91b604482015290519081900360640190fd5b77ffffffffffffffffffffffffffffffffffffffff00000000602083901b166001600160801b03811160071b81811c67ffffffffffffffff811160061b90811c63ffffffff811160051b90811c61ffff811160041b90811c60ff8111600390811b91821c600f811160021b90811c918211600190811b92831c979088119617909417909217179091171717608081106137b757607f810383901c91506137c1565b80607f0383901b91505b908002607f81811c60ff83811c9190911c800280831c81831c1c800280841c81841c1c800280851c81851c1c800280861c81861c1c800280871c81871c1c800280881c81881c1c800280891c81891c1c8002808a1c818a1c1c8002808b1c818b1c1c8002808c1c818c1c1c8002808d1c818d1c1c8002808e1c9c81901c9c909c1c80029c8d901c9e9d607f198f0160401b60c09190911c678000000000000000161760c19b909b1c674000000000000000169a909a1760c29990991c672000000000000000169890981760c39790971c671000000000000000169690961760c49590951c670800000000000000169490941760c59390931c670400000000000000169290921760c69190911c670200000000000000161760c79190911c670100000000000000161760c89190911c6680000000000000161760c99190911c6640000000000000161760ca9190911c6620000000000000161760cb9190911c6610000000000000161760cc9190911c6608000000000000161760cd9190911c66040000000000001617693627a301d71055774c8581026f028f6481ab7f045a5af012a19d003aa9198101608090811d906fdb2df09e81959a81455e260799a0632f8301901d600281810b9083900b146139c257886001600160a01b03166139a682612d6d565b6001600160a01b031611156139bb57816139bd565b805b6139c4565b815b9998505050505050505050565b6000806000898961ffff1661ffff81106139e757fe5b60408051608081018252919092015463ffffffff8082168084526401000000008304600690810b810b900b6020850152600160581b83046001600160a01b031694840194909452600160f81b90910460ff161515606083015290925089161415613a575788859250925050613510565b8461ffff168461ffff16118015613a7857506001850361ffff168961ffff16145b15613a8557839150613a89565b8491505b8161ffff168960010161ffff1681613a9d57fe5b069250613aac81898989614822565b8a8461ffff1661ffff8110613abd57fe5b825191018054602084015160408501516060909501511515600160f81b027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001600160a01b03909616600160581b027fff0000000000000000000000000000000000000000ffffffffffffffffffffff60069390930b66ffffffffffffff16640100000000026affffffffffffff000000001963ffffffff90971663ffffffff199095169490941795909516929092171692909217929092161790555097509795505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1781529251825160009485949389169392918291908083835b60208310613c025780518252601f199092019160209182019101613be3565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613c64576040519150601f19603f3d011682016040523d82523d6000602084013e613c69565b606091505b5091509150818015613c97575080511580613c975750808060200190516020811015613c9457600080fd5b50515b613ccd576040805162461bcd60e51b81526020600482015260026024820152612a2360f11b604482015290519081900360640190fd5b5050505050565b604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17815291518151600093849384936001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693919290918291908083835b60208310613d6d5780518252601f199092019160209182019101613d4e565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114613dcd576040519150601f19603f3d011682016040523d82523d6000602084013e613dd2565b606091505b5091509150818015613de657506020815110155b613def57600080fd5b808060200190516020811015613e0457600080fd5b50519250505090565b808201828110156132bd57600080fd5b604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17815291518151600093849384936001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016939192909182919080838360208310613d6d5780518252601f199092019160209182019101613d4e565b6000808361ffff1611613ef3576040805162461bcd60e51b81526020600482015260016024820152604960f81b604482015290519081900360640190fd5b8261ffff168261ffff1611613f09575081613382565b825b8261ffff168161ffff161015613f4f576001858261ffff1661ffff8110613f2e57fe5b01805463ffffffff191663ffffffff92909216919091179055600101613f0b565b50909392505050565b80600f81900b8114612beb57600080fd5b6000806000613f76612bf0565b613f88846020015185604001516143a1565b6040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b900b602080840182905261ffff600160b81b8404811685870152600160c81b84048116606080870191909152600160d81b8504909116608086015260ff600160e81b8504811660a0870152600160f01b909404909316151560c08501528851908901519489015192890151939461402c9491939092909190614acf565b93508460600151600f0b6000146141a157846020015160020b816020015160020b12156140815761407a6140638660200151612d6d565b6140708760400151612d6d565b8760600151614c84565b92506141a1565b846040015160020b816020015160020b12156141775760045460408201516001600160801b03909116906140d3906140b7612c27565b60208501516060860151608087015160089493929187916139d1565b6000805461ffff60c81b1916600160c81b61ffff938416021761ffff60b81b1916600160b81b939092169290920217905581516040870151614123919061411990612d6d565b8860600151614c84565b93506141416141358760200151612d6d565b83516060890151614cc8565b92506141518187606001516135ef565b600480546001600160801b0319166001600160801b0392909216919091179055506141a1565b61419e6141878660200151612d6d565b6141948760400151612d6d565b8760600151614cc8565b91505b509193909250565b60006141b68484846132d9565b9050600082806141c257fe5b84860911156133825760001981106141d957600080fd5b6001019392505050565b6040805160609490941b6bffffffffffffffffffffffff1916602080860191909152600293840b60e890811b60348701529290930b90911b60378401528051808403601a018152603a90930181528251928201929092206000908152929052902090565b60608060008361ffff1611614287576040805162461bcd60e51b81526020600482015260016024820152604960f81b604482015290519081900360640190fd5b865167ffffffffffffffff8111801561429f57600080fd5b506040519080825280602002602001820160405280156142c9578160200160208202803683370190505b509150865167ffffffffffffffff811180156142e457600080fd5b5060405190808252806020026020018201604052801561430e578160200160208202803683370190505b50905060005b87518110156143945761433f8a8a8a848151811061432e57fe5b60200260200101518a8a8a8a613389565b84838151811061434b57fe5b6020026020010184848151811061435e57fe5b60200260200101826001600160a01b03166001600160a01b03168152508260060b60060b81525050508080600101915050614314565b5097509795505050505050565b8060020b8260020b126143e1576040805162461bcd60e51b8152602060048201526003602482015262544c5560e81b604482015290519081900360640190fd5b620d89e719600283900b1215614424576040805162461bcd60e51b8152602060048201526003602482015262544c4d60e81b604482015290519081900360640190fd5b620d89e8600282900b1315614466576040805162461bcd60e51b815260206004820152600360248201526254554d60e81b604482015290519081900360640190fd5b5050565b6040805160808101825263ffffffff9283168082526000602083018190529282019290925260016060909101819052835463ffffffff1916909117909116600160f81b17909155908190565b60020b600881901d9161010090910790565b60008082116144d657600080fd5b600160801b82106144e957608091821c91015b68010000000000000000821061450157604091821c91015b640100000000821061451557602091821c91015b62010000821061452757601091821c91015b610100821061453857600891821c91015b6010821061454857600491821c91015b6004821061455857600291821c91015b60028210612beb57600101919050565b600080821161457657600080fd5b5060ff6001600160801b0382161561459157607f1901614599565b608082901c91505b67ffffffffffffffff8216156145b257603f19016145ba565b604082901c91505b63ffffffff8216156145cf57601f19016145d7565b602082901c91505b61ffff8216156145ea57600f19016145f2565b601082901c91505b60ff821615614604576007190161460c565b600882901c91505b600f82161561461e5760031901614626565b600482901c91505b60038216156146385760011901614640565b600282901c91505b6001821615612beb5760001901919050565b6000836001600160a01b0316856001600160a01b03161115614672579293925b8161469f5761469a836001600160801b03168686036001600160a01b0316600160601b6132d9565b6146c2565b6146c2836001600160801b03168686036001600160a01b0316600160601b6141a9565b90505b949350505050565b6000836001600160a01b0316856001600160a01b031611156146ed579293925b7bffffffffffffffffffffffffffffffff000000000000000000000000606084901b166001600160a01b03868603811690871661472957600080fd5b8361475957866001600160a01b031661474c8383896001600160a01b03166132d9565b8161475357fe5b0461477f565b61477f6147708383896001600160a01b03166141a9565b886001600160a01b0316614cf7565b979650505050505050565b600080856001600160a01b0316116147a157600080fd5b6000846001600160801b0316116147b757600080fd5b816147c95761469a8585856001614d02565b6146c28585856001614de3565b600080856001600160a01b0316116147ed57600080fd5b6000846001600160801b03161161480357600080fd5b816148155761469a8585856000614de3565b6146c28585856000614d02565b61482a61564a565b600085600001518503905060405180608001604052808663ffffffff1681526020018263ffffffff168660020b0288602001510160060b81526020016000856001600160801b03161161487e576001614880565b845b6001600160801b031673ffffffff00000000000000000000000000000000608085901b16816148ab57fe5b048860400151016001600160a01b0316815260200160011515815250915050949350505050565b6148da61564a565b6148e261564a565b888561ffff1661ffff81106148f357fe5b60408051608081018252919092015463ffffffff81168083526401000000008204600690810b810b900b6020840152600160581b82046001600160a01b031693830193909352600160f81b900460ff1615156060820152925061495890899089614ed8565b15614990578663ffffffff16826000015163ffffffff16141561497a57613510565b8161498783898988614822565b91509150613510565b888361ffff168660010161ffff16816149a557fe5b0661ffff1661ffff81106149b557fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b90910416151560608201819052909250614a6c57604080516080810182528a5463ffffffff811682526401000000008104600690810b810b900b6020830152600160581b81046001600160a01b031692820192909252600160f81b90910460ff161515606082015291505b614a7b88836000015189614ed8565b614ab2576040805162461bcd60e51b815260206004820152600360248201526213d31160ea1b604482015290519081900360640190fd5b614abf8989898887614f9b565b9150915097509795505050505050565b6000614ade60078787876141e3565b60015460025491925090600080600f87900b15614c24576000614aff612c27565b6000805460045492935090918291614b499160089186918591600160a01b810460020b9161ffff600160b81b83048116926001600160801b0390921691600160c81b900416613389565b9092509050614b8360058d8b8d8b8b87898b60007f000000000000000000000000000000000000000000000000000000000000000061513b565b9450614bba60058c8b8d8b8b87898b60017f000000000000000000000000000000000000000000000000000000000000000061513b565b93508415614bee57614bee60068d7f0000000000000000000000000000000000000000000000000000000000000000615325565b8315614c2057614c2060068c7f0000000000000000000000000000000000000000000000000000000000000000615325565b5050505b600080614c3660058c8c8b8a8a61538b565b9092509050614c47878a8484615437565b600089600f0b1215614c75578315614c6457614c6460058c6155cc565b8215614c7557614c7560058b6155cc565b50505050505095945050505050565b60008082600f0b12614caa57614ca5614ca085858560016146cd565b613291565b6146c5565b614cbd614ca085858560000360006146cd565b600003949350505050565b60008082600f0b12614ce457614ca5614ca08585856001614652565b614cbd614ca08585856000036000614652565b808204910615150190565b60008115614d755760006001600160a01b03841115614d3857614d3384600160601b876001600160801b03166132d9565b614d50565b6001600160801b038516606085901b81614d4e57fe5b045b9050614d6d614d686001600160a01b03881683613e0d565b6155f8565b9150506146c5565b60006001600160a01b03841115614da357614d9e84600160601b876001600160801b03166141a9565b614dba565b614dba606085901b6001600160801b038716614cf7565b905080866001600160a01b031611614dd157600080fd5b6001600160a01b0386160390506146c5565b600082614df15750836146c5565b7bffffffffffffffffffffffffffffffff000000000000000000000000606085901b168215614e91576001600160a01b03861684810290858281614e3157fe5b041415614e6257818101828110614e6057614e5683896001600160a01b0316836141a9565b93505050506146c5565b505b614e8882614e83878a6001600160a01b03168681614e7c57fe5b0490613e0d565b614cf7565b925050506146c5565b6001600160a01b03861684810290858281614ea857fe5b04148015614eb557508082115b614ebe57600080fd5b808203614e56614d68846001600160a01b038b16846141a9565b60008363ffffffff168363ffffffff1611158015614f0257508363ffffffff168263ffffffff1611155b15614f1e578163ffffffff168363ffffffff1611159050613382565b60008463ffffffff168463ffffffff1611614f46578363ffffffff1664010000000001614f4e565b8363ffffffff165b64ffffffffff16905060008563ffffffff168463ffffffff1611614f7f578363ffffffff1664010000000001614f87565b8363ffffffff165b64ffffffffff169091111595945050505050565b614fa361564a565b614fab61564a565b60008361ffff168560010161ffff1681614fc157fe5b0661ffff169050600060018561ffff16830103905060005b506002818301048961ffff87168281614fee57fe5b0661ffff8110614ffa57fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b9091041615156060820181905290955061506557806001019250614fd9565b898661ffff16826001018161507657fe5b0661ffff811061508257fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b909104161515606082015285519094506000906150ed908b908b614ed8565b905080801561510657506151068a8a8760000151614ed8565b15615111575061512e565b8061512157600182039250615128565b8160010193505b50614fd9565b5050509550959350505050565b60028a810b900b600090815260208c90526040812080546001600160801b031682615166828d6135ef565b9050846001600160801b0316816001600160801b031611156151b4576040805162461bcd60e51b81526020600482015260026024820152614c4f60f01b604482015290519081900360640190fd5b6001600160801b03828116159082161581141594501561528a578c60020b8e60020b1361525a57600183018b9055600283018a90556003830180547fffffffffff0000000000000000000000000000000000000000ffffffffffffff166701000000000000006001600160a01b038c16021766ffffffffffffff191666ffffffffffffff60068b900b161763ffffffff60d81b1916600160d81b63ffffffff8a16021790555b6003830180547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16600160f81b1790555b82546001600160801b0319166001600160801b038216178355856152d35782546152ce906152c990600160801b9004600f90810b810b908f900b6132c3565b613f58565b6152f4565b82546152f4906152c990600160801b9004600f90810b810b908f900b6132a7565b8354600f9190910b6001600160801b03908116600160801b0291161790925550909c9b505050505050505050505050565b8060020b8260020b8161533457fe5b0760020b1561534257600080fd5b60008061535d8360020b8560020b8161535757fe5b056144b6565b600191820b820b60009081526020979097526040909620805460ff9097169190911b90951890945550505050565b600285810b80820b60009081526020899052604080822088850b850b83529082209193849391929184918291908a900b126153d1575050600182015460028301546153e4565b8360010154880391508360020154870390505b6000808b60020b8b60020b121561540657505060018301546002840154615419565b84600101548a0391508460020154890390505b92909803979097039b96909503949094039850939650505050505050565b6040805160a08101825285546001600160801b0390811682526001870154602083015260028701549282019290925260038601548083166060830152600160801b900490911660808201526000600f85900b6154d65781516001600160801b03166154ce576040805162461bcd60e51b815260206004820152600260248201526104e560f41b604482015290519081900360640190fd5b5080516154e5565b81516154e290866135ef565b90505b60006155098360200151860384600001516001600160801b0316600160801b6132d9565b9050600061552f8460400151860385600001516001600160801b0316600160801b6132d9565b905086600f0b6000146155565787546001600160801b0319166001600160801b0384161788555b60018801869055600288018590556001600160801b03821615158061558457506000816001600160801b0316115b156155c2576003880180546001600160801b031981166001600160801b039182168501821617808216600160801b9182900483168501909216021790555b5050505050505050565b600290810b810b6000908152602092909252604082208281556001810183905590810182905560030155565b806001600160a01b0381168114612beb57600080fd5b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b6040805160808101825260008082526020820181905291810182905260608101919091529056fea164736f6c6343000706000a | 608060405234801561001057600080fd5b50600436106101ae5760003560e01c806370cf754a116100ee578063c45a015511610097578063ddca3f4311610071578063ddca3f4314610800578063f305839914610820578063f30dba9314610828578063f637731d146108aa576101ae565b8063c45a0155146107d1578063d0c93a7c146107d9578063d21220a7146107f8576101ae565b8063883bdbfd116100c8578063883bdbfd14610633578063a34123a71461073c578063a38807f214610776576101ae565b806370cf754a146105c65780638206a4d1146105ce57806385b66729146105f6576101ae565b80633850c7bd1161015b578063490e6cbc11610135578063490e6cbc146104705780634f1eb3d8146104fc578063514ea4bf1461054d5780635339c296146105a6576101ae565b80633850c7bd1461035b5780633c8a7d8d146103b45780634614131914610456576101ae565b80631ad8b03b1161018c5780631ad8b03b146102aa578063252c09d7146102e157806332148f6714610338576101ae565b80630dfe1681146101b3578063128acb08146101d75780631a68650214610286575b600080fd5b6101bb6108d0565b604080516001600160a01b039092168252519081900360200190f35b61026d600480360360a08110156101ed57600080fd5b6001600160a01b0382358116926020810135151592604082013592606083013516919081019060a08101608082013564010000000081111561022e57600080fd5b82018360208201111561024057600080fd5b8035906020019184600183028401116401000000008311171561026257600080fd5b5090925090506108f4565b6040805192835260208301919091528051918290030190f35b61028e6114ad565b604080516001600160801b039092168252519081900360200190f35b6102b26114bc565b60405180836001600160801b03168152602001826001600160801b031681526020019250505060405180910390f35b6102fe600480360360208110156102f757600080fd5b50356114d6565b6040805163ffffffff909516855260069390930b60208501526001600160a01b039091168383015215156060830152519081900360800190f35b6103596004803603602081101561034e57600080fd5b503561ffff1661151c565b005b610363611616565b604080516001600160a01b03909816885260029690960b602088015261ffff9485168787015292841660608701529216608085015260ff90911660a0840152151560c0830152519081900360e00190f35b61026d600480360360a08110156103ca57600080fd5b6001600160a01b03823516916020810135600290810b92604083013590910b916001600160801b036060820135169181019060a08101608082013564010000000081111561041757600080fd5b82018360208201111561042957600080fd5b8035906020019184600183028401116401000000008311171561044b57600080fd5b509092509050611666565b61045e611922565b60408051918252519081900360200190f35b6103596004803603608081101561048657600080fd5b6001600160a01b0382351691602081013591604082013591908101906080810160608201356401000000008111156104bd57600080fd5b8201836020820111156104cf57600080fd5b803590602001918460018302840111640100000000831117156104f157600080fd5b509092509050611928565b6102b2600480360360a081101561051257600080fd5b506001600160a01b03813516906020810135600290810b91604081013590910b906001600160801b0360608201358116916080013516611d83565b61056a6004803603602081101561056357600080fd5b5035611f9d565b604080516001600160801b0396871681526020810195909552848101939093529084166060840152909216608082015290519081900360a00190f35b61045e600480360360208110156105bc57600080fd5b503560010b611fda565b61028e611fec565b610359600480360360408110156105e457600080fd5b5060ff81358116916020013516612010565b6102b26004803603606081101561060c57600080fd5b506001600160a01b03813516906001600160801b036020820135811691604001351661220f565b6106a36004803603602081101561064957600080fd5b81019060208101813564010000000081111561066457600080fd5b82018360208201111561067657600080fd5b8035906020019184602083028401116401000000008311171561069857600080fd5b5090925090506124dc565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156106e75781810151838201526020016106cf565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561072657818101518382015260200161070e565b5050505090500194505050505060405180910390f35b61026d6004803603606081101561075257600080fd5b508035600290810b91602081013590910b90604001356001600160801b0316612569565b6107a06004803603604081101561078c57600080fd5b508035600290810b9160200135900b6126e0565b6040805160069490940b84526001600160a01b03909216602084015263ffffffff1682820152519081900360600190f35b6101bb6128d7565b6107e16128fb565b6040805160029290920b8252519081900360200190f35b6101bb61291f565b610808612943565b6040805162ffffff9092168252519081900360200190f35b61045e612967565b6108486004803603602081101561083e57600080fd5b503560020b61296d565b604080516001600160801b039099168952600f9790970b602089015287870195909552606087019390935260069190910b60808601526001600160a01b031660a085015263ffffffff1660c0840152151560e083015251908190036101000190f35b610359600480360360208110156108c057600080fd5b50356001600160a01b03166129db565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6000806108ff612bf0565b85610936576040805162461bcd60e51b8152602060048201526002602482015261415360f01b604482015290519081900360640190fd5b6040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b900b602083015261ffff600160b81b8204811693830193909352600160c81b810483166060830152600160d81b8104909216608082015260ff600160e81b8304811660a0830152600160f01b909204909116151560c082018190526109ef576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b87610a3a5780600001516001600160a01b0316866001600160a01b0316118015610a35575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038716105b610a6c565b80600001516001600160a01b0316866001600160a01b0316108015610a6c57506401000276a36001600160a01b038716115b610aa3576040805162461bcd60e51b815260206004820152600360248201526214d41360ea1b604482015290519081900360640190fd5b6000805460ff60f01b191681556040805160c08101909152808a610ad25760048460a0015160ff16901c610ae5565b60108460a0015160ff1681610ae357fe5b065b60ff1681526004546001600160801b03166020820152604001610b06612c27565b63ffffffff168152602001600060060b815260200160006001600160a01b031681526020016000151581525090506000808913905060006040518060e001604052808b81526020016000815260200185600001516001600160a01b03168152602001856020015160020b81526020018c610b8257600254610b86565b6001545b815260200160006001600160801b0316815260200184602001516001600160801b031681525090505b805115801590610bd55750886001600160a01b031681604001516001600160a01b031614155b15610f9f57610be261560e565b60408201516001600160a01b031681526060820151610c25906006907f00000000000000000000000000000000000000000000000000000000000000c88f612c2b565b15156040830152600290810b810b60208301819052620d89e719910b1215610c5657620d89e7196020820152610c75565b6020810151620d89e860029190910b1315610c7557620d89e860208201525b610c828160200151612d6d565b6001600160a01b031660608201526040820151610d13908d610cbc578b6001600160a01b031683606001516001600160a01b031611610cd6565b8b6001600160a01b031683606001516001600160a01b0316105b610ce4578260600151610ce6565b8b5b60c085015185517f000000000000000000000000000000000000000000000000000000000000271061309f565b60c085015260a084015260808301526001600160a01b031660408301528215610d7557610d498160c00151826080015101613291565b825103825260a0810151610d6b90610d6090613291565b6020840151906132a7565b6020830152610db0565b610d828160a00151613291565b825101825260c08101516080820151610daa91610d9f9101613291565b6020840151906132c3565b60208301525b835160ff1615610df6576000846000015160ff168260c0015181610dd057fe5b60c0840180519290910491829003905260a0840180519091016001600160801b03169052505b60c08201516001600160801b031615610e3557610e298160c00151600160801b8460c001516001600160801b03166132d9565b60808301805190910190525b80606001516001600160a01b031682604001516001600160a01b03161415610f5e57806040015115610f35578360a00151610ebf57610e9d846040015160008760200151886040015188602001518a606001516008613389909695949392919063ffffffff16565b6001600160a01b03166080860152600690810b900b6060850152600160a08501525b6000610f0b82602001518e610ed657600154610edc565b84608001515b8f610eeb578560800151610eef565b6002545b608089015160608a015160408b0151600595949392919061351c565b90508c15610f17576000035b610f258360c00151826135ef565b6001600160801b031660c0840152505b8b610f44578060200151610f4d565b60018160200151035b600290810b900b6060830152610f99565b80600001516001600160a01b031682604001516001600160a01b031614610f9957610f8c82604001516136a5565b600290810b900b60608301525b50610baf565b836020015160020b816060015160020b1461107a57600080610fed86604001518660400151886020015188602001518a606001518b6080015160086139d1909695949392919063ffffffff16565b604085015160608601516000805461ffff60c81b1916600160c81b61ffff958616021761ffff60b81b1916600160b81b95909416949094029290921762ffffff60a01b1916600160a01b62ffffff60029490940b93909316929092029190911773ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909116179055506110ac9050565b60408101516000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039092169190911790555b8060c001516001600160801b031683602001516001600160801b0316146110f25760c0810151600480546001600160801b0319166001600160801b039092169190911790555b8a1561114257608081015160015560a08101516001600160801b03161561113d5760a0810151600380546001600160801b031981166001600160801b03918216909301169190911790555b611188565b608081015160025560a08101516001600160801b0316156111885760a0810151600380546001600160801b03808216600160801b92839004821690940116029190911790555b8115158b1515146111a157602081015181518b036111ae565b80600001518a0381602001515b90965094508a156112e75760008512156111f0576111f07f000000000000000000000000fc9f1b84d51798854f87e7ba016be592d53fa85c8d87600003613b86565b60006111fa613cd4565b9050336001600160a01b031663fa461e3388888c8c6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561127e57600080fd5b505af1158015611292573d6000803e3d6000fd5b5050505061129e613cd4565b6112a88289613e0d565b11156112e1576040805162461bcd60e51b815260206004820152600360248201526249494160e81b604482015290519081900360640190fd5b50611411565b600086121561131e5761131e7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28d88600003613b86565b6000611328613e1d565b9050336001600160a01b031663fa461e3388888c8c6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b1580156113ac57600080fd5b505af11580156113c0573d6000803e3d6000fd5b505050506113cc613e1d565b6113d68288613e0d565b111561140f576040805162461bcd60e51b815260206004820152600360248201526249494160e81b604482015290519081900360640190fd5b505b60408082015160c083015160608085015184518b8152602081018b90526001600160a01b03948516818701526001600160801b039093169183019190915260020b60808201529151908e169133917fc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca679181900360a00190a350506000805460ff60f01b1916600160f01b17905550919890975095505050505050565b6004546001600160801b031681565b6003546001600160801b0380821691600160801b90041682565b60088161ffff81106114e757600080fd5b015463ffffffff81169150640100000000810460060b90600160581b81046001600160a01b031690600160f81b900460ff1684565b600054600160f01b900460ff16611560576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19169055611575612bf0565b60008054600160d81b900461ffff169061159160088385613eb5565b6000805461ffff808416600160d81b810261ffff60d81b19909316929092179092559192508316146115fe576040805161ffff80851682528316602082015281517fac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a929181900390910190a15b50506000805460ff60f01b1916600160f01b17905550565b6000546001600160a01b03811690600160a01b810460020b9061ffff600160b81b8204811691600160c81b8104821691600160d81b8204169060ff600160e81b8204811691600160f01b90041687565b600080548190600160f01b900460ff166116ad576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b191690556001600160801b0385166116cd57600080fd5b60008061171b60405180608001604052808c6001600160a01b031681526020018b60020b81526020018a60020b81526020016117118a6001600160801b0316613f58565b600f0b9052613f69565b9250925050819350809250600080600086111561173d5761173a613cd4565b91505b841561174e5761174b613e1d565b90505b336001600160a01b031663d348799787878b8b6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b1580156117d057600080fd5b505af11580156117e4573d6000803e3d6000fd5b50505050600086111561183b576117f9613cd4565b6118038388613e0d565b111561183b576040805162461bcd60e51b815260206004820152600260248201526104d360f41b604482015290519081900360640190fd5b841561188b57611849613e1d565b6118538287613e0d565b111561188b576040805162461bcd60e51b81526020600482015260026024820152614d3160f01b604482015290519081900360640190fd5b8960020b8b60020b8d6001600160a01b03167f7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde338d8b8b60405180856001600160a01b03168152602001846001600160801b0316815260200183815260200182815260200194505050505060405180910390a450506000805460ff60f01b1916600160f01b17905550919890975095505050505050565b60025481565b600054600160f01b900460ff1661196c576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19169055611981612bf0565b6004546001600160801b0316806119c3576040805162461bcd60e51b81526020600482015260016024820152601360fa1b604482015290519081900360640190fd5b60006119f8867f000000000000000000000000000000000000000000000000000000000000271062ffffff16620f42406141a9565b90506000611a2f867f000000000000000000000000000000000000000000000000000000000000271062ffffff16620f42406141a9565b90506000611a3b613cd4565b90506000611a47613e1d565b90508815611a7a57611a7a7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28b8b613b86565b8715611aab57611aab7f000000000000000000000000fc9f1b84d51798854f87e7ba016be592d53fa85c8b8a613b86565b336001600160a01b031663e9cbafb085858a8a6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b158015611b2d57600080fd5b505af1158015611b41573d6000803e3d6000fd5b505050506000611b4f613cd4565b90506000611b5b613e1d565b905081611b688588613e0d565b1115611ba0576040805162461bcd60e51b8152602060048201526002602482015261046360f41b604482015290519081900360640190fd5b80611bab8487613e0d565b1115611be3576040805162461bcd60e51b8152602060048201526002602482015261463160f01b604482015290519081900360640190fd5b8382038382038115611c725760008054600160e81b9004600f16908115611c16578160ff168481611c1057fe5b04611c19565b60005b90506001600160801b03811615611c4c57600380546001600160801b038082168401166001600160801b03199091161790555b611c66818503600160801b8d6001600160801b03166132d9565b60018054909101905550505b8015611cfd5760008054600160e81b900460041c600f16908115611ca2578160ff168381611c9c57fe5b04611ca5565b60005b90506001600160801b03811615611cd757600380546001600160801b03600160801b8083048216850182160291161790555b611cf1818403600160801b8d6001600160801b03166132d9565b60028054909101905550505b8d6001600160a01b0316336001600160a01b03167fbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca6338f8f86866040518085815260200184815260200183815260200182815260200194505050505060405180910390a350506000805460ff60f01b1916600160f01b179055505050505050505050505050565b600080548190600160f01b900460ff16611dca576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19168155611de460073389896141e3565b60038101549091506001600160801b0390811690861611611e055784611e14565b60038101546001600160801b03165b60038201549093506001600160801b03600160801b909104811690851611611e3c5783611e52565b6003810154600160801b90046001600160801b03165b91506001600160801b03831615611eb7576003810180546001600160801b031981166001600160801b03918216869003821617909155611eb7907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2908a908616613b86565b6001600160801b03821615611f1d576003810180546001600160801b03600160801b808304821686900382160291811691909117909155611f1d907f000000000000000000000000fc9f1b84d51798854f87e7ba016be592d53fa85c908a908516613b86565b604080516001600160a01b038a1681526001600160801b0380861660208301528416818301529051600288810b92908a900b9133917f70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0919081900360600190a4506000805460ff60f01b1916600160f01b17905590969095509350505050565b60076020526000908152604090208054600182015460028301546003909301546001600160801b0392831693919281811691600160801b90041685565b60066020526000908152604090205481565b7f00000000000000000000000000000000000762d10ef955d55b7d038c7a7231cc81565b600054600160f01b900460ff16612054576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916905560408051638da5cb5b60e01b815290516001600160a01b037f0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f9841691638da5cb5b916004808301926020929190829003018186803b1580156120c157600080fd5b505afa1580156120d5573d6000803e3d6000fd5b505050506040513d60208110156120eb57600080fd5b50516001600160a01b0316331461210157600080fd5b60ff82161580612124575060048260ff16101580156121245750600a8260ff1611155b801561214e575060ff8116158061214e575060048160ff161015801561214e5750600a8160ff1611155b61215757600080fd5b60008054610ff0600484901b16840160ff908116600160e81b9081027fffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841617909355919004167f973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b1336010826040805160ff9390920683168252600f600486901c16602083015286831682820152918516606082015290519081900360800190a150506000805460ff60f01b1916600160f01b17905550565b600080548190600160f01b900460ff16612256576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916905560408051638da5cb5b60e01b815290516001600160a01b037f0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f9841691638da5cb5b916004808301926020929190829003018186803b1580156122c357600080fd5b505afa1580156122d7573d6000803e3d6000fd5b505050506040513d60208110156122ed57600080fd5b50516001600160a01b0316331461230357600080fd5b6003546001600160801b039081169085161161231f578361232c565b6003546001600160801b03165b6003549092506001600160801b03600160801b9091048116908416116123525782612366565b600354600160801b90046001600160801b03165b90506001600160801b038216156123e7576003546001600160801b038381169116141561239557600019909101905b600380546001600160801b031981166001600160801b039182168590038216179091556123e7907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc29087908516613b86565b6001600160801b0381161561246d576003546001600160801b03828116600160801b90920416141561241857600019015b600380546001600160801b03600160801b80830482168590038216029181169190911790915561246d907f000000000000000000000000fc9f1b84d51798854f87e7ba016be592d53fa85c9087908416613b86565b604080516001600160801b0380851682528316602082015281516001600160a01b0388169233927f596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151929081900390910190a36000805460ff60f01b1916600160f01b1790559094909350915050565b6060806124e7612bf0565b61255e6124f2612c27565b858580806020026020016040519081016040528093929190818152602001838360200280828437600092018290525054600454600896959450600160a01b820460020b935061ffff600160b81b8304811693506001600160801b0390911691600160c81b900416614247565b915091509250929050565b600080548190600160f01b900460ff166125b0576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916815560408051608081018252338152600288810b602083015287900b918101919091528190819061260990606081016125fc6001600160801b038a16613f58565b600003600f0b9052613f69565b925092509250816000039450806000039350600085118061262a5750600084115b15612669576003830180546001600160801b038082168089018216600160801b93849004831689019092169092029091176001600160801b0319161790555b604080516001600160801b0388168152602081018790528082018690529051600289810b92908b900b9133917f0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c919081900360600190a450506000805460ff60f01b1916600160f01b179055509094909350915050565b60008060006126ed612bf0565b6126f785856143a1565b600285810b810b60009081526005602052604080822087840b90930b825281206003830154600681900b9367010000000000000082046001600160a01b0316928492600160d81b810463ffffffff169284929091600160f81b900460ff168061275f57600080fd5b6003820154600681900b985067010000000000000081046001600160a01b03169650600160d81b810463ffffffff169450600160f81b900460ff16806127a457600080fd5b50506040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b810b6020840181905261ffff600160b81b8404811695850195909552600160c81b830485166060850152600160d81b8304909416608084015260ff600160e81b8304811660a0850152600160f01b909204909116151560c08301529093508e810b91900b1215905061284d575093909403965090039350900390506128d0565b8a60020b816020015160020b12156128c1576000612869612c27565b602083015160408401516004546060860151939450600093849361289f936008938893879392916001600160801b031690613389565b9a9003989098039b5050949096039290920396509091030392506128d0915050565b50949093039650039350900390505b9250925092565b7f0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f98481565b7f00000000000000000000000000000000000000000000000000000000000000c881565b7f000000000000000000000000fc9f1b84d51798854f87e7ba016be592d53fa85c81565b7f000000000000000000000000000000000000000000000000000000000000271081565b60015481565b60056020526000908152604090208054600182015460028301546003909301546001600160801b03831693600160801b909304600f0b9290600681900b9067010000000000000081046001600160a01b031690600160d81b810463ffffffff1690600160f81b900460ff1688565b6000546001600160a01b031615612a1e576040805162461bcd60e51b8152602060048201526002602482015261414960f01b604482015290519081900360640190fd5b6000612a29826136a5565b9050600080612a41612a39612c27565b60089061446a565b6040805160e0810182526001600160a01b038816808252600288810b6020808501829052600085870181905261ffff898116606088018190529089166080880181905260a08801839052600160c0909801979097528154600160f01b73ffffffffffffffffffffffffffffffffffffffff19909116871762ffffff60a01b1916600160a01b62ffffff9787900b9790971696909602959095177fffffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffff16600160c81b9091021761ffff60d81b1916600160d81b909602959095177fff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1692909217909355835191825281019190915281519395509193507f98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c9592918290030190a150505050565b60008082600281900b620d89e71981612b9957fe5b05029050600083600281900b620d89e881612bb057fe5b0502905060008460020b83830360020b81612bc757fe5b0560010190508062ffffff166001600160801b03801681612be457fe5b0493505050505b919050565b306001600160a01b037f0000000000000000000000000fb14ab783befb6a54cf749f7b3fb55ff8095e401614612c2557600080fd5b565b4290565b60008060008460020b8660020b81612c3f57fe5b05905060008660020b128015612c6657508460020b8660020b81612c5f57fe5b0760020b15155b15612c7057600019015b8315612ce557600080612c82836144b6565b600182810b810b600090815260208d9052604090205460ff83169190911b80016000190190811680151597509294509092509085612cc757888360ff16860302612cda565b88612cd1826144c8565b840360ff168603025b965050505050612d63565b600080612cf4836001016144b6565b91509150600060018260ff166001901b031990506000818b60008660010b60010b8152602001908152602001600020541690508060001415955085612d4657888360ff0360ff16866001010102612d5c565b8883612d5183614568565b0360ff168660010101025b9650505050505b5094509492505050565b60008060008360020b12612d84578260020b612d8c565b8260020b6000035b9050620d89e8811115612dca576040805162461bcd60e51b81526020600482015260016024820152601560fa1b604482015290519081900360640190fd5b600060018216612dde57600160801b612df0565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615612e24576ffff97272373d413259a46990580e213a0260801c5b6004821615612e43576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b6008821615612e62576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b6010821615612e81576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615612ea0576fff973b41fa98c081472e6896dfb254c00260801c5b6040821615612ebf576fff2ea16466c96a3843ec78b326b528610260801c5b6080821615612ede576ffe5dee046a99a2a811c461f1969c30530260801c5b610100821615612efe576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615612f1e576ff987a7253ac413176f2b074cf7815e540260801c5b610400821615612f3e576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615612f5e576fe7159475a2c29b7443b29c7fa6e889d90260801c5b611000821615612f7e576fd097f3bdfd2022b8845ad8f792aa58250260801c5b612000821615612f9e576fa9f746462d870fdf8a65dc1f90e061e50260801c5b614000821615612fbe576f70d869a156d2a1b890bb3df62baf32f70260801c5b618000821615612fde576f31be135f97d08fd981231505542fcfa60260801c5b62010000821615612fff576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b6202000082161561301f576e5d6af8dedb81196699c329225ee6040260801c5b6204000082161561303e576d2216e584f5fa1ea926041bedfe980260801c5b6208000082161561305b576b048a170391f7dc42444e8fa20260801c5b60008460020b131561307657806000198161307257fe5b0490505b64010000000081061561308a57600161308d565b60005b60ff16602082901c0192505050919050565b60008080806001600160a01b03808916908a1610158187128015906131245760006130d88989620f42400362ffffff16620f42406132d9565b9050826130f1576130ec8c8c8c6001614652565b6130fe565b6130fe8b8d8c60016146cd565b955085811061310f578a965061311e565b61311b8c8b838661478a565b96505b5061316e565b8161313b576131368b8b8b60006146cd565b613148565b6131488a8c8b6000614652565b935083886000031061315c5789955061316e565b61316b8b8a8a600003856147d6565b95505b6001600160a01b038a81169087161482156131d15780801561318d5750815b6131a35761319e878d8c60016146cd565b6131a5565b855b95508080156131b2575081155b6131c8576131c3878d8c6000614652565b6131ca565b845b945061321b565b8080156131db5750815b6131f1576131ec8c888c6001614652565b6131f3565b855b9550808015613200575081155b613216576132118c888c60006146cd565b613218565b845b94505b8115801561322b57508860000385115b15613237578860000394505b81801561325657508a6001600160a01b0316876001600160a01b031614155b15613265578589039350613282565b61327f868962ffffff168a620f42400362ffffff166141a9565b93505b50505095509550955095915050565b6000600160ff1b82106132a357600080fd5b5090565b808203828113156000831215146132bd57600080fd5b92915050565b818101828112156000831215146132bd57600080fd5b600080806000198587098686029250828110908390030390508061330f576000841161330457600080fd5b508290049050613382565b80841161331b57600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b60008063ffffffff8716613430576000898661ffff1661ffff81106133aa57fe5b60408051608081018252919092015463ffffffff8082168084526401000000008304600690810b810b900b6020850152600160581b83046001600160a01b031694840194909452600160f81b90910460ff16151560608301529092508a161461341c57613419818a8988614822565b90505b806020015181604001519250925050613510565b8688036000806134458c8c858c8c8c8c6148d2565b91509150816000015163ffffffff168363ffffffff161415613477578160200151826040015194509450505050613510565b805163ffffffff8481169116141561349f578060200151816040015194509450505050613510565b8151815160208085015190840151918390039286039163ffffffff80841692908516910360060b816134cd57fe5b05028460200151018263ffffffff168263ffffffff1686604001518660400151036001600160a01b031602816134ff57fe5b048560400151019650965050505050505b97509795505050505050565b600295860b860b60009081526020979097526040909620600181018054909503909455938301805490920390915560038201805463ffffffff600160d81b6001600160a01b036701000000000000008085048216909603169094027fffffffffff0000000000000000000000000000000000000000ffffffffffffff90921691909117600681810b90960390950b66ffffffffffffff1666ffffffffffffff199095169490941782810485169095039093160263ffffffff60d81b1990931692909217905554600160801b9004600f0b90565b60008082600f0b121561365457826001600160801b03168260000384039150816001600160801b03161061364f576040805162461bcd60e51b81526020600482015260026024820152614c5360f01b604482015290519081900360640190fd5b6132bd565b826001600160801b03168284019150816001600160801b031610156132bd576040805162461bcd60e51b81526020600482015260026024820152614c4160f01b604482015290519081900360640190fd5b60006401000276a36001600160a01b038316108015906136e1575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038316105b613716576040805162461bcd60e51b81526020600482015260016024820152602960f91b604482015290519081900360640190fd5b77ffffffffffffffffffffffffffffffffffffffff00000000602083901b166001600160801b03811160071b81811c67ffffffffffffffff811160061b90811c63ffffffff811160051b90811c61ffff811160041b90811c60ff8111600390811b91821c600f811160021b90811c918211600190811b92831c979088119617909417909217179091171717608081106137b757607f810383901c91506137c1565b80607f0383901b91505b908002607f81811c60ff83811c9190911c800280831c81831c1c800280841c81841c1c800280851c81851c1c800280861c81861c1c800280871c81871c1c800280881c81881c1c800280891c81891c1c8002808a1c818a1c1c8002808b1c818b1c1c8002808c1c818c1c1c8002808d1c818d1c1c8002808e1c9c81901c9c909c1c80029c8d901c9e9d607f198f0160401b60c09190911c678000000000000000161760c19b909b1c674000000000000000169a909a1760c29990991c672000000000000000169890981760c39790971c671000000000000000169690961760c49590951c670800000000000000169490941760c59390931c670400000000000000169290921760c69190911c670200000000000000161760c79190911c670100000000000000161760c89190911c6680000000000000161760c99190911c6640000000000000161760ca9190911c6620000000000000161760cb9190911c6610000000000000161760cc9190911c6608000000000000161760cd9190911c66040000000000001617693627a301d71055774c8581026f028f6481ab7f045a5af012a19d003aa9198101608090811d906fdb2df09e81959a81455e260799a0632f8301901d600281810b9083900b146139c257886001600160a01b03166139a682612d6d565b6001600160a01b031611156139bb57816139bd565b805b6139c4565b815b9998505050505050505050565b6000806000898961ffff1661ffff81106139e757fe5b60408051608081018252919092015463ffffffff8082168084526401000000008304600690810b810b900b6020850152600160581b83046001600160a01b031694840194909452600160f81b90910460ff161515606083015290925089161415613a575788859250925050613510565b8461ffff168461ffff16118015613a7857506001850361ffff168961ffff16145b15613a8557839150613a89565b8491505b8161ffff168960010161ffff1681613a9d57fe5b069250613aac81898989614822565b8a8461ffff1661ffff8110613abd57fe5b825191018054602084015160408501516060909501511515600160f81b027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001600160a01b03909616600160581b027fff0000000000000000000000000000000000000000ffffffffffffffffffffff60069390930b66ffffffffffffff16640100000000026affffffffffffff000000001963ffffffff90971663ffffffff199095169490941795909516929092171692909217929092161790555097509795505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1781529251825160009485949389169392918291908083835b60208310613c025780518252601f199092019160209182019101613be3565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613c64576040519150601f19603f3d011682016040523d82523d6000602084013e613c69565b606091505b5091509150818015613c97575080511580613c975750808060200190516020811015613c9457600080fd5b50515b613ccd576040805162461bcd60e51b81526020600482015260026024820152612a2360f11b604482015290519081900360640190fd5b5050505050565b604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17815291518151600093849384936001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21693919290918291908083835b60208310613d6d5780518252601f199092019160209182019101613d4e565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114613dcd576040519150601f19603f3d011682016040523d82523d6000602084013e613dd2565b606091505b5091509150818015613de657506020815110155b613def57600080fd5b808060200190516020811015613e0457600080fd5b50519250505090565b808201828110156132bd57600080fd5b604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17815291518151600093849384936001600160a01b037f000000000000000000000000fc9f1b84d51798854f87e7ba016be592d53fa85c16939192909182919080838360208310613d6d5780518252601f199092019160209182019101613d4e565b6000808361ffff1611613ef3576040805162461bcd60e51b81526020600482015260016024820152604960f81b604482015290519081900360640190fd5b8261ffff168261ffff1611613f09575081613382565b825b8261ffff168161ffff161015613f4f576001858261ffff1661ffff8110613f2e57fe5b01805463ffffffff191663ffffffff92909216919091179055600101613f0b565b50909392505050565b80600f81900b8114612beb57600080fd5b6000806000613f76612bf0565b613f88846020015185604001516143a1565b6040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b900b602080840182905261ffff600160b81b8404811685870152600160c81b84048116606080870191909152600160d81b8504909116608086015260ff600160e81b8504811660a0870152600160f01b909404909316151560c08501528851908901519489015192890151939461402c9491939092909190614acf565b93508460600151600f0b6000146141a157846020015160020b816020015160020b12156140815761407a6140638660200151612d6d565b6140708760400151612d6d565b8760600151614c84565b92506141a1565b846040015160020b816020015160020b12156141775760045460408201516001600160801b03909116906140d3906140b7612c27565b60208501516060860151608087015160089493929187916139d1565b6000805461ffff60c81b1916600160c81b61ffff938416021761ffff60b81b1916600160b81b939092169290920217905581516040870151614123919061411990612d6d565b8860600151614c84565b93506141416141358760200151612d6d565b83516060890151614cc8565b92506141518187606001516135ef565b600480546001600160801b0319166001600160801b0392909216919091179055506141a1565b61419e6141878660200151612d6d565b6141948760400151612d6d565b8760600151614cc8565b91505b509193909250565b60006141b68484846132d9565b9050600082806141c257fe5b84860911156133825760001981106141d957600080fd5b6001019392505050565b6040805160609490941b6bffffffffffffffffffffffff1916602080860191909152600293840b60e890811b60348701529290930b90911b60378401528051808403601a018152603a90930181528251928201929092206000908152929052902090565b60608060008361ffff1611614287576040805162461bcd60e51b81526020600482015260016024820152604960f81b604482015290519081900360640190fd5b865167ffffffffffffffff8111801561429f57600080fd5b506040519080825280602002602001820160405280156142c9578160200160208202803683370190505b509150865167ffffffffffffffff811180156142e457600080fd5b5060405190808252806020026020018201604052801561430e578160200160208202803683370190505b50905060005b87518110156143945761433f8a8a8a848151811061432e57fe5b60200260200101518a8a8a8a613389565b84838151811061434b57fe5b6020026020010184848151811061435e57fe5b60200260200101826001600160a01b03166001600160a01b03168152508260060b60060b81525050508080600101915050614314565b5097509795505050505050565b8060020b8260020b126143e1576040805162461bcd60e51b8152602060048201526003602482015262544c5560e81b604482015290519081900360640190fd5b620d89e719600283900b1215614424576040805162461bcd60e51b8152602060048201526003602482015262544c4d60e81b604482015290519081900360640190fd5b620d89e8600282900b1315614466576040805162461bcd60e51b815260206004820152600360248201526254554d60e81b604482015290519081900360640190fd5b5050565b6040805160808101825263ffffffff9283168082526000602083018190529282019290925260016060909101819052835463ffffffff1916909117909116600160f81b17909155908190565b60020b600881901d9161010090910790565b60008082116144d657600080fd5b600160801b82106144e957608091821c91015b68010000000000000000821061450157604091821c91015b640100000000821061451557602091821c91015b62010000821061452757601091821c91015b610100821061453857600891821c91015b6010821061454857600491821c91015b6004821061455857600291821c91015b60028210612beb57600101919050565b600080821161457657600080fd5b5060ff6001600160801b0382161561459157607f1901614599565b608082901c91505b67ffffffffffffffff8216156145b257603f19016145ba565b604082901c91505b63ffffffff8216156145cf57601f19016145d7565b602082901c91505b61ffff8216156145ea57600f19016145f2565b601082901c91505b60ff821615614604576007190161460c565b600882901c91505b600f82161561461e5760031901614626565b600482901c91505b60038216156146385760011901614640565b600282901c91505b6001821615612beb5760001901919050565b6000836001600160a01b0316856001600160a01b03161115614672579293925b8161469f5761469a836001600160801b03168686036001600160a01b0316600160601b6132d9565b6146c2565b6146c2836001600160801b03168686036001600160a01b0316600160601b6141a9565b90505b949350505050565b6000836001600160a01b0316856001600160a01b031611156146ed579293925b7bffffffffffffffffffffffffffffffff000000000000000000000000606084901b166001600160a01b03868603811690871661472957600080fd5b8361475957866001600160a01b031661474c8383896001600160a01b03166132d9565b8161475357fe5b0461477f565b61477f6147708383896001600160a01b03166141a9565b886001600160a01b0316614cf7565b979650505050505050565b600080856001600160a01b0316116147a157600080fd5b6000846001600160801b0316116147b757600080fd5b816147c95761469a8585856001614d02565b6146c28585856001614de3565b600080856001600160a01b0316116147ed57600080fd5b6000846001600160801b03161161480357600080fd5b816148155761469a8585856000614de3565b6146c28585856000614d02565b61482a61564a565b600085600001518503905060405180608001604052808663ffffffff1681526020018263ffffffff168660020b0288602001510160060b81526020016000856001600160801b03161161487e576001614880565b845b6001600160801b031673ffffffff00000000000000000000000000000000608085901b16816148ab57fe5b048860400151016001600160a01b0316815260200160011515815250915050949350505050565b6148da61564a565b6148e261564a565b888561ffff1661ffff81106148f357fe5b60408051608081018252919092015463ffffffff81168083526401000000008204600690810b810b900b6020840152600160581b82046001600160a01b031693830193909352600160f81b900460ff1615156060820152925061495890899089614ed8565b15614990578663ffffffff16826000015163ffffffff16141561497a57613510565b8161498783898988614822565b91509150613510565b888361ffff168660010161ffff16816149a557fe5b0661ffff1661ffff81106149b557fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b90910416151560608201819052909250614a6c57604080516080810182528a5463ffffffff811682526401000000008104600690810b810b900b6020830152600160581b81046001600160a01b031692820192909252600160f81b90910460ff161515606082015291505b614a7b88836000015189614ed8565b614ab2576040805162461bcd60e51b815260206004820152600360248201526213d31160ea1b604482015290519081900360640190fd5b614abf8989898887614f9b565b9150915097509795505050505050565b6000614ade60078787876141e3565b60015460025491925090600080600f87900b15614c24576000614aff612c27565b6000805460045492935090918291614b499160089186918591600160a01b810460020b9161ffff600160b81b83048116926001600160801b0390921691600160c81b900416613389565b9092509050614b8360058d8b8d8b8b87898b60007f00000000000000000000000000000000000762d10ef955d55b7d038c7a7231cc61513b565b9450614bba60058c8b8d8b8b87898b60017f00000000000000000000000000000000000762d10ef955d55b7d038c7a7231cc61513b565b93508415614bee57614bee60068d7f00000000000000000000000000000000000000000000000000000000000000c8615325565b8315614c2057614c2060068c7f00000000000000000000000000000000000000000000000000000000000000c8615325565b5050505b600080614c3660058c8c8b8a8a61538b565b9092509050614c47878a8484615437565b600089600f0b1215614c75578315614c6457614c6460058c6155cc565b8215614c7557614c7560058b6155cc565b50505050505095945050505050565b60008082600f0b12614caa57614ca5614ca085858560016146cd565b613291565b6146c5565b614cbd614ca085858560000360006146cd565b600003949350505050565b60008082600f0b12614ce457614ca5614ca08585856001614652565b614cbd614ca08585856000036000614652565b808204910615150190565b60008115614d755760006001600160a01b03841115614d3857614d3384600160601b876001600160801b03166132d9565b614d50565b6001600160801b038516606085901b81614d4e57fe5b045b9050614d6d614d686001600160a01b03881683613e0d565b6155f8565b9150506146c5565b60006001600160a01b03841115614da357614d9e84600160601b876001600160801b03166141a9565b614dba565b614dba606085901b6001600160801b038716614cf7565b905080866001600160a01b031611614dd157600080fd5b6001600160a01b0386160390506146c5565b600082614df15750836146c5565b7bffffffffffffffffffffffffffffffff000000000000000000000000606085901b168215614e91576001600160a01b03861684810290858281614e3157fe5b041415614e6257818101828110614e6057614e5683896001600160a01b0316836141a9565b93505050506146c5565b505b614e8882614e83878a6001600160a01b03168681614e7c57fe5b0490613e0d565b614cf7565b925050506146c5565b6001600160a01b03861684810290858281614ea857fe5b04148015614eb557508082115b614ebe57600080fd5b808203614e56614d68846001600160a01b038b16846141a9565b60008363ffffffff168363ffffffff1611158015614f0257508363ffffffff168263ffffffff1611155b15614f1e578163ffffffff168363ffffffff1611159050613382565b60008463ffffffff168463ffffffff1611614f46578363ffffffff1664010000000001614f4e565b8363ffffffff165b64ffffffffff16905060008563ffffffff168463ffffffff1611614f7f578363ffffffff1664010000000001614f87565b8363ffffffff165b64ffffffffff169091111595945050505050565b614fa361564a565b614fab61564a565b60008361ffff168560010161ffff1681614fc157fe5b0661ffff169050600060018561ffff16830103905060005b506002818301048961ffff87168281614fee57fe5b0661ffff8110614ffa57fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b9091041615156060820181905290955061506557806001019250614fd9565b898661ffff16826001018161507657fe5b0661ffff811061508257fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b909104161515606082015285519094506000906150ed908b908b614ed8565b905080801561510657506151068a8a8760000151614ed8565b15615111575061512e565b8061512157600182039250615128565b8160010193505b50614fd9565b5050509550959350505050565b60028a810b900b600090815260208c90526040812080546001600160801b031682615166828d6135ef565b9050846001600160801b0316816001600160801b031611156151b4576040805162461bcd60e51b81526020600482015260026024820152614c4f60f01b604482015290519081900360640190fd5b6001600160801b03828116159082161581141594501561528a578c60020b8e60020b1361525a57600183018b9055600283018a90556003830180547fffffffffff0000000000000000000000000000000000000000ffffffffffffff166701000000000000006001600160a01b038c16021766ffffffffffffff191666ffffffffffffff60068b900b161763ffffffff60d81b1916600160d81b63ffffffff8a16021790555b6003830180547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16600160f81b1790555b82546001600160801b0319166001600160801b038216178355856152d35782546152ce906152c990600160801b9004600f90810b810b908f900b6132c3565b613f58565b6152f4565b82546152f4906152c990600160801b9004600f90810b810b908f900b6132a7565b8354600f9190910b6001600160801b03908116600160801b0291161790925550909c9b505050505050505050505050565b8060020b8260020b8161533457fe5b0760020b1561534257600080fd5b60008061535d8360020b8560020b8161535757fe5b056144b6565b600191820b820b60009081526020979097526040909620805460ff9097169190911b90951890945550505050565b600285810b80820b60009081526020899052604080822088850b850b83529082209193849391929184918291908a900b126153d1575050600182015460028301546153e4565b8360010154880391508360020154870390505b6000808b60020b8b60020b121561540657505060018301546002840154615419565b84600101548a0391508460020154890390505b92909803979097039b96909503949094039850939650505050505050565b6040805160a08101825285546001600160801b0390811682526001870154602083015260028701549282019290925260038601548083166060830152600160801b900490911660808201526000600f85900b6154d65781516001600160801b03166154ce576040805162461bcd60e51b815260206004820152600260248201526104e560f41b604482015290519081900360640190fd5b5080516154e5565b81516154e290866135ef565b90505b60006155098360200151860384600001516001600160801b0316600160801b6132d9565b9050600061552f8460400151860385600001516001600160801b0316600160801b6132d9565b905086600f0b6000146155565787546001600160801b0319166001600160801b0384161788555b60018801869055600288018590556001600160801b03821615158061558457506000816001600160801b0316115b156155c2576003880180546001600160801b031981166001600160801b039182168501821617808216600160801b9182900483168501909216021790555b5050505050505050565b600290810b810b6000908152602092909252604082208281556001810183905590810182905560030155565b806001600160a01b0381168114612beb57600080fd5b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b6040805160808101825260008082526020820181905291810182905260608101919091529056fea164736f6c6343000706000a | {{
"language": "Solidity",
"sources": {
"contracts/UniswapV3Pool.sol": {
"content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity =0.7.6;\n\nimport './interfaces/IUniswapV3Pool.sol';\n\nimport './NoDelegateCall.sol';\n\nimport './libraries/LowGasSafeMath.sol';\nimport './libraries/SafeCast.sol';\nimport './libraries/Tick.sol';\nimport './libraries/TickBitmap.sol';\nimport './libraries/Position.sol';\nimport './libraries/Oracle.sol';\n\nimport './libraries/FullMath.sol';\nimport './libraries/FixedPoint128.sol';\nimport './libraries/TransferHelper.sol';\nimport './libraries/TickMath.sol';\nimport './libraries/LiquidityMath.sol';\nimport './libraries/SqrtPriceMath.sol';\nimport './libraries/SwapMath.sol';\n\nimport './interfaces/IUniswapV3PoolDeployer.sol';\nimport './interfaces/IUniswapV3Factory.sol';\nimport './interfaces/IERC20Minimal.sol';\nimport './interfaces/callback/IUniswapV3MintCallback.sol';\nimport './interfaces/callback/IUniswapV3SwapCallback.sol';\nimport './interfaces/callback/IUniswapV3FlashCallback.sol';\n\ncontract UniswapV3Pool is IUniswapV3Pool, NoDelegateCall {\n using LowGasSafeMath for uint256;\n using LowGasSafeMath for int256;\n using SafeCast for uint256;\n using SafeCast for int256;\n using Tick for mapping(int24 => Tick.Info);\n using TickBitmap for mapping(int16 => uint256);\n using Position for mapping(bytes32 => Position.Info);\n using Position for Position.Info;\n using Oracle for Oracle.Observation[65535];\n\n /// @inheritdoc IUniswapV3PoolImmutables\n address public immutable override factory;\n /// @inheritdoc IUniswapV3PoolImmutables\n address public immutable override token0;\n /// @inheritdoc IUniswapV3PoolImmutables\n address public immutable override token1;\n /// @inheritdoc IUniswapV3PoolImmutables\n uint24 public immutable override fee;\n\n /// @inheritdoc IUniswapV3PoolImmutables\n int24 public immutable override tickSpacing;\n\n /// @inheritdoc IUniswapV3PoolImmutables\n uint128 public immutable override maxLiquidityPerTick;\n\n struct Slot0 {\n // the current price\n uint160 sqrtPriceX96;\n // the current tick\n int24 tick;\n // the most-recently updated index of the observations array\n uint16 observationIndex;\n // the current maximum number of observations that are being stored\n uint16 observationCardinality;\n // the next maximum number of observations to store, triggered in observations.write\n uint16 observationCardinalityNext;\n // the current protocol fee as a percentage of the swap fee taken on withdrawal\n // represented as an integer denominator (1/x)%\n uint8 feeProtocol;\n // whether the pool is locked\n bool unlocked;\n }\n /// @inheritdoc IUniswapV3PoolState\n Slot0 public override slot0;\n\n /// @inheritdoc IUniswapV3PoolState\n uint256 public override feeGrowthGlobal0X128;\n /// @inheritdoc IUniswapV3PoolState\n uint256 public override feeGrowthGlobal1X128;\n\n // accumulated protocol fees in token0/token1 units\n struct ProtocolFees {\n uint128 token0;\n uint128 token1;\n }\n /// @inheritdoc IUniswapV3PoolState\n ProtocolFees public override protocolFees;\n\n /// @inheritdoc IUniswapV3PoolState\n uint128 public override liquidity;\n\n /// @inheritdoc IUniswapV3PoolState\n mapping(int24 => Tick.Info) public override ticks;\n /// @inheritdoc IUniswapV3PoolState\n mapping(int16 => uint256) public override tickBitmap;\n /// @inheritdoc IUniswapV3PoolState\n mapping(bytes32 => Position.Info) public override positions;\n /// @inheritdoc IUniswapV3PoolState\n Oracle.Observation[65535] public override observations;\n\n /// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance\n /// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because\n /// we use balance checks to determine the payment status of interactions such as mint, swap and flash.\n modifier lock() {\n require(slot0.unlocked, 'LOK');\n slot0.unlocked = false;\n _;\n slot0.unlocked = true;\n }\n\n /// @dev Prevents calling a function from anyone except the address returned by IUniswapV3Factory#owner()\n modifier onlyFactoryOwner() {\n require(msg.sender == IUniswapV3Factory(factory).owner());\n _;\n }\n\n constructor() {\n int24 _tickSpacing;\n (factory, token0, token1, fee, _tickSpacing) = IUniswapV3PoolDeployer(msg.sender).parameters();\n tickSpacing = _tickSpacing;\n\n maxLiquidityPerTick = Tick.tickSpacingToMaxLiquidityPerTick(_tickSpacing);\n }\n\n /// @dev Common checks for valid tick inputs.\n function checkTicks(int24 tickLower, int24 tickUpper) private pure {\n require(tickLower < tickUpper, 'TLU');\n require(tickLower >= TickMath.MIN_TICK, 'TLM');\n require(tickUpper <= TickMath.MAX_TICK, 'TUM');\n }\n\n /// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests.\n function _blockTimestamp() internal view virtual returns (uint32) {\n return uint32(block.timestamp); // truncation is desired\n }\n\n /// @dev Get the pool's balance of token0\n /// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize\n /// check\n function balance0() private view returns (uint256) {\n (bool success, bytes memory data) =\n token0.staticcall(abi.encodeWithSelector(IERC20Minimal.balanceOf.selector, address(this)));\n require(success && data.length >= 32);\n return abi.decode(data, (uint256));\n }\n\n /// @dev Get the pool's balance of token1\n /// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize\n /// check\n function balance1() private view returns (uint256) {\n (bool success, bytes memory data) =\n token1.staticcall(abi.encodeWithSelector(IERC20Minimal.balanceOf.selector, address(this)));\n require(success && data.length >= 32);\n return abi.decode(data, (uint256));\n }\n\n /// @inheritdoc IUniswapV3PoolDerivedState\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n override\n noDelegateCall\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n )\n {\n checkTicks(tickLower, tickUpper);\n\n int56 tickCumulativeLower;\n int56 tickCumulativeUpper;\n uint160 secondsPerLiquidityOutsideLowerX128;\n uint160 secondsPerLiquidityOutsideUpperX128;\n uint32 secondsOutsideLower;\n uint32 secondsOutsideUpper;\n\n {\n Tick.Info storage lower = ticks[tickLower];\n Tick.Info storage upper = ticks[tickUpper];\n bool initializedLower;\n (tickCumulativeLower, secondsPerLiquidityOutsideLowerX128, secondsOutsideLower, initializedLower) = (\n lower.tickCumulativeOutside,\n lower.secondsPerLiquidityOutsideX128,\n lower.secondsOutside,\n lower.initialized\n );\n require(initializedLower);\n\n bool initializedUpper;\n (tickCumulativeUpper, secondsPerLiquidityOutsideUpperX128, secondsOutsideUpper, initializedUpper) = (\n upper.tickCumulativeOutside,\n upper.secondsPerLiquidityOutsideX128,\n upper.secondsOutside,\n upper.initialized\n );\n require(initializedUpper);\n }\n\n Slot0 memory _slot0 = slot0;\n\n if (_slot0.tick < tickLower) {\n return (\n tickCumulativeLower - tickCumulativeUpper,\n secondsPerLiquidityOutsideLowerX128 - secondsPerLiquidityOutsideUpperX128,\n secondsOutsideLower - secondsOutsideUpper\n );\n } else if (_slot0.tick < tickUpper) {\n uint32 time = _blockTimestamp();\n (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) =\n observations.observeSingle(\n time,\n 0,\n _slot0.tick,\n _slot0.observationIndex,\n liquidity,\n _slot0.observationCardinality\n );\n return (\n tickCumulative - tickCumulativeLower - tickCumulativeUpper,\n secondsPerLiquidityCumulativeX128 -\n secondsPerLiquidityOutsideLowerX128 -\n secondsPerLiquidityOutsideUpperX128,\n time - secondsOutsideLower - secondsOutsideUpper\n );\n } else {\n return (\n tickCumulativeUpper - tickCumulativeLower,\n secondsPerLiquidityOutsideUpperX128 - secondsPerLiquidityOutsideLowerX128,\n secondsOutsideUpper - secondsOutsideLower\n );\n }\n }\n\n /// @inheritdoc IUniswapV3PoolDerivedState\n function observe(uint32[] calldata secondsAgos)\n external\n view\n override\n noDelegateCall\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s)\n {\n return\n observations.observe(\n _blockTimestamp(),\n secondsAgos,\n slot0.tick,\n slot0.observationIndex,\n liquidity,\n slot0.observationCardinality\n );\n }\n\n /// @inheritdoc IUniswapV3PoolActions\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext)\n external\n override\n lock\n noDelegateCall\n {\n uint16 observationCardinalityNextOld = slot0.observationCardinalityNext; // for the event\n uint16 observationCardinalityNextNew =\n observations.grow(observationCardinalityNextOld, observationCardinalityNext);\n slot0.observationCardinalityNext = observationCardinalityNextNew;\n if (observationCardinalityNextOld != observationCardinalityNextNew)\n emit IncreaseObservationCardinalityNext(observationCardinalityNextOld, observationCardinalityNextNew);\n }\n\n /// @inheritdoc IUniswapV3PoolActions\n /// @dev not locked because it initializes unlocked\n function initialize(uint160 sqrtPriceX96) external override {\n require(slot0.sqrtPriceX96 == 0, 'AI');\n\n int24 tick = TickMath.getTickAtSqrtRatio(sqrtPriceX96);\n\n (uint16 cardinality, uint16 cardinalityNext) = observations.initialize(_blockTimestamp());\n\n slot0 = Slot0({\n sqrtPriceX96: sqrtPriceX96,\n tick: tick,\n observationIndex: 0,\n observationCardinality: cardinality,\n observationCardinalityNext: cardinalityNext,\n feeProtocol: 0,\n unlocked: true\n });\n\n emit Initialize(sqrtPriceX96, tick);\n }\n\n struct ModifyPositionParams {\n // the address that owns the position\n address owner;\n // the lower and upper tick of the position\n int24 tickLower;\n int24 tickUpper;\n // any change in liquidity\n int128 liquidityDelta;\n }\n\n /// @dev Effect some changes to a position\n /// @param params the position details and the change to the position's liquidity to effect\n /// @return position a storage pointer referencing the position with the given owner and tick range\n /// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient\n /// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient\n function _modifyPosition(ModifyPositionParams memory params)\n private\n noDelegateCall\n returns (\n Position.Info storage position,\n int256 amount0,\n int256 amount1\n )\n {\n checkTicks(params.tickLower, params.tickUpper);\n\n Slot0 memory _slot0 = slot0; // SLOAD for gas optimization\n\n position = _updatePosition(\n params.owner,\n params.tickLower,\n params.tickUpper,\n params.liquidityDelta,\n _slot0.tick\n );\n\n if (params.liquidityDelta != 0) {\n if (_slot0.tick < params.tickLower) {\n // current tick is below the passed range; liquidity can only become in range by crossing from left to\n // right, when we'll need _more_ token0 (it's becoming more valuable) so user must provide it\n amount0 = SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(params.tickLower),\n TickMath.getSqrtRatioAtTick(params.tickUpper),\n params.liquidityDelta\n );\n } else if (_slot0.tick < params.tickUpper) {\n // current tick is inside the passed range\n uint128 liquidityBefore = liquidity; // SLOAD for gas optimization\n\n // write an oracle entry\n (slot0.observationIndex, slot0.observationCardinality) = observations.write(\n _slot0.observationIndex,\n _blockTimestamp(),\n _slot0.tick,\n liquidityBefore,\n _slot0.observationCardinality,\n _slot0.observationCardinalityNext\n );\n\n amount0 = SqrtPriceMath.getAmount0Delta(\n _slot0.sqrtPriceX96,\n TickMath.getSqrtRatioAtTick(params.tickUpper),\n params.liquidityDelta\n );\n amount1 = SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(params.tickLower),\n _slot0.sqrtPriceX96,\n params.liquidityDelta\n );\n\n liquidity = LiquidityMath.addDelta(liquidityBefore, params.liquidityDelta);\n } else {\n // current tick is above the passed range; liquidity can only become in range by crossing from right to\n // left, when we'll need _more_ token1 (it's becoming more valuable) so user must provide it\n amount1 = SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(params.tickLower),\n TickMath.getSqrtRatioAtTick(params.tickUpper),\n params.liquidityDelta\n );\n }\n }\n }\n\n /// @dev Gets and updates a position with the given liquidity delta\n /// @param owner the owner of the position\n /// @param tickLower the lower tick of the position's tick range\n /// @param tickUpper the upper tick of the position's tick range\n /// @param tick the current tick, passed to avoid sloads\n function _updatePosition(\n address owner,\n int24 tickLower,\n int24 tickUpper,\n int128 liquidityDelta,\n int24 tick\n ) private returns (Position.Info storage position) {\n position = positions.get(owner, tickLower, tickUpper);\n\n uint256 _feeGrowthGlobal0X128 = feeGrowthGlobal0X128; // SLOAD for gas optimization\n uint256 _feeGrowthGlobal1X128 = feeGrowthGlobal1X128; // SLOAD for gas optimization\n\n // if we need to update the ticks, do it\n bool flippedLower;\n bool flippedUpper;\n if (liquidityDelta != 0) {\n uint32 time = _blockTimestamp();\n (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) =\n observations.observeSingle(\n time,\n 0,\n slot0.tick,\n slot0.observationIndex,\n liquidity,\n slot0.observationCardinality\n );\n\n flippedLower = ticks.update(\n tickLower,\n tick,\n liquidityDelta,\n _feeGrowthGlobal0X128,\n _feeGrowthGlobal1X128,\n secondsPerLiquidityCumulativeX128,\n tickCumulative,\n time,\n false,\n maxLiquidityPerTick\n );\n flippedUpper = ticks.update(\n tickUpper,\n tick,\n liquidityDelta,\n _feeGrowthGlobal0X128,\n _feeGrowthGlobal1X128,\n secondsPerLiquidityCumulativeX128,\n tickCumulative,\n time,\n true,\n maxLiquidityPerTick\n );\n\n if (flippedLower) {\n tickBitmap.flipTick(tickLower, tickSpacing);\n }\n if (flippedUpper) {\n tickBitmap.flipTick(tickUpper, tickSpacing);\n }\n }\n\n (uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) =\n ticks.getFeeGrowthInside(tickLower, tickUpper, tick, _feeGrowthGlobal0X128, _feeGrowthGlobal1X128);\n\n position.update(liquidityDelta, feeGrowthInside0X128, feeGrowthInside1X128);\n\n // clear any tick data that is no longer needed\n if (liquidityDelta < 0) {\n if (flippedLower) {\n ticks.clear(tickLower);\n }\n if (flippedUpper) {\n ticks.clear(tickUpper);\n }\n }\n }\n\n /// @inheritdoc IUniswapV3PoolActions\n /// @dev noDelegateCall is applied indirectly via _modifyPosition\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external override lock returns (uint256 amount0, uint256 amount1) {\n require(amount > 0);\n (, int256 amount0Int, int256 amount1Int) =\n _modifyPosition(\n ModifyPositionParams({\n owner: recipient,\n tickLower: tickLower,\n tickUpper: tickUpper,\n liquidityDelta: int256(amount).toInt128()\n })\n );\n\n amount0 = uint256(amount0Int);\n amount1 = uint256(amount1Int);\n\n uint256 balance0Before;\n uint256 balance1Before;\n if (amount0 > 0) balance0Before = balance0();\n if (amount1 > 0) balance1Before = balance1();\n IUniswapV3MintCallback(msg.sender).uniswapV3MintCallback(amount0, amount1, data);\n if (amount0 > 0) require(balance0Before.add(amount0) <= balance0(), 'M0');\n if (amount1 > 0) require(balance1Before.add(amount1) <= balance1(), 'M1');\n\n emit Mint(msg.sender, recipient, tickLower, tickUpper, amount, amount0, amount1);\n }\n\n /// @inheritdoc IUniswapV3PoolActions\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external override lock returns (uint128 amount0, uint128 amount1) {\n // we don't need to checkTicks here, because invalid positions will never have non-zero tokensOwed{0,1}\n Position.Info storage position = positions.get(msg.sender, tickLower, tickUpper);\n\n amount0 = amount0Requested > position.tokensOwed0 ? position.tokensOwed0 : amount0Requested;\n amount1 = amount1Requested > position.tokensOwed1 ? position.tokensOwed1 : amount1Requested;\n\n if (amount0 > 0) {\n position.tokensOwed0 -= amount0;\n TransferHelper.safeTransfer(token0, recipient, amount0);\n }\n if (amount1 > 0) {\n position.tokensOwed1 -= amount1;\n TransferHelper.safeTransfer(token1, recipient, amount1);\n }\n\n emit Collect(msg.sender, recipient, tickLower, tickUpper, amount0, amount1);\n }\n\n /// @inheritdoc IUniswapV3PoolActions\n /// @dev noDelegateCall is applied indirectly via _modifyPosition\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external override lock returns (uint256 amount0, uint256 amount1) {\n (Position.Info storage position, int256 amount0Int, int256 amount1Int) =\n _modifyPosition(\n ModifyPositionParams({\n owner: msg.sender,\n tickLower: tickLower,\n tickUpper: tickUpper,\n liquidityDelta: -int256(amount).toInt128()\n })\n );\n\n amount0 = uint256(-amount0Int);\n amount1 = uint256(-amount1Int);\n\n if (amount0 > 0 || amount1 > 0) {\n (position.tokensOwed0, position.tokensOwed1) = (\n position.tokensOwed0 + uint128(amount0),\n position.tokensOwed1 + uint128(amount1)\n );\n }\n\n emit Burn(msg.sender, tickLower, tickUpper, amount, amount0, amount1);\n }\n\n struct SwapCache {\n // the protocol fee for the input token\n uint8 feeProtocol;\n // liquidity at the beginning of the swap\n uint128 liquidityStart;\n // the timestamp of the current block\n uint32 blockTimestamp;\n // the current value of the tick accumulator, computed only if we cross an initialized tick\n int56 tickCumulative;\n // the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick\n uint160 secondsPerLiquidityCumulativeX128;\n // whether we've computed and cached the above two accumulators\n bool computedLatestObservation;\n }\n\n // the top level state of the swap, the results of which are recorded in storage at the end\n struct SwapState {\n // the amount remaining to be swapped in/out of the input/output asset\n int256 amountSpecifiedRemaining;\n // the amount already swapped out/in of the output/input asset\n int256 amountCalculated;\n // current sqrt(price)\n uint160 sqrtPriceX96;\n // the tick associated with the current price\n int24 tick;\n // the global fee growth of the input token\n uint256 feeGrowthGlobalX128;\n // amount of input token paid as protocol fee\n uint128 protocolFee;\n // the current liquidity in range\n uint128 liquidity;\n }\n\n struct StepComputations {\n // the price at the beginning of the step\n uint160 sqrtPriceStartX96;\n // the next tick to swap to from the current tick in the swap direction\n int24 tickNext;\n // whether tickNext is initialized or not\n bool initialized;\n // sqrt(price) for the next tick (1/0)\n uint160 sqrtPriceNextX96;\n // how much is being swapped in in this step\n uint256 amountIn;\n // how much is being swapped out\n uint256 amountOut;\n // how much fee is being paid in\n uint256 feeAmount;\n }\n\n /// @inheritdoc IUniswapV3PoolActions\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external override noDelegateCall returns (int256 amount0, int256 amount1) {\n require(amountSpecified != 0, 'AS');\n\n Slot0 memory slot0Start = slot0;\n\n require(slot0Start.unlocked, 'LOK');\n require(\n zeroForOne\n ? sqrtPriceLimitX96 < slot0Start.sqrtPriceX96 && sqrtPriceLimitX96 > TickMath.MIN_SQRT_RATIO\n : sqrtPriceLimitX96 > slot0Start.sqrtPriceX96 && sqrtPriceLimitX96 < TickMath.MAX_SQRT_RATIO,\n 'SPL'\n );\n\n slot0.unlocked = false;\n\n SwapCache memory cache =\n SwapCache({\n liquidityStart: liquidity,\n blockTimestamp: _blockTimestamp(),\n feeProtocol: zeroForOne ? (slot0Start.feeProtocol % 16) : (slot0Start.feeProtocol >> 4),\n secondsPerLiquidityCumulativeX128: 0,\n tickCumulative: 0,\n computedLatestObservation: false\n });\n\n bool exactInput = amountSpecified > 0;\n\n SwapState memory state =\n SwapState({\n amountSpecifiedRemaining: amountSpecified,\n amountCalculated: 0,\n sqrtPriceX96: slot0Start.sqrtPriceX96,\n tick: slot0Start.tick,\n feeGrowthGlobalX128: zeroForOne ? feeGrowthGlobal0X128 : feeGrowthGlobal1X128,\n protocolFee: 0,\n liquidity: cache.liquidityStart\n });\n\n // continue swapping as long as we haven't used the entire input/output and haven't reached the price limit\n while (state.amountSpecifiedRemaining != 0 && state.sqrtPriceX96 != sqrtPriceLimitX96) {\n StepComputations memory step;\n\n step.sqrtPriceStartX96 = state.sqrtPriceX96;\n\n (step.tickNext, step.initialized) = tickBitmap.nextInitializedTickWithinOneWord(\n state.tick,\n tickSpacing,\n zeroForOne\n );\n\n // ensure that we do not overshoot the min/max tick, as the tick bitmap is not aware of these bounds\n if (step.tickNext < TickMath.MIN_TICK) {\n step.tickNext = TickMath.MIN_TICK;\n } else if (step.tickNext > TickMath.MAX_TICK) {\n step.tickNext = TickMath.MAX_TICK;\n }\n\n // get the price for the next tick\n step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext);\n\n // compute values to swap to the target tick, price limit, or point where input/output amount is exhausted\n (state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount) = SwapMath.computeSwapStep(\n state.sqrtPriceX96,\n (zeroForOne ? step.sqrtPriceNextX96 < sqrtPriceLimitX96 : step.sqrtPriceNextX96 > sqrtPriceLimitX96)\n ? sqrtPriceLimitX96\n : step.sqrtPriceNextX96,\n state.liquidity,\n state.amountSpecifiedRemaining,\n fee\n );\n\n if (exactInput) {\n state.amountSpecifiedRemaining -= (step.amountIn + step.feeAmount).toInt256();\n state.amountCalculated = state.amountCalculated.sub(step.amountOut.toInt256());\n } else {\n state.amountSpecifiedRemaining += step.amountOut.toInt256();\n state.amountCalculated = state.amountCalculated.add((step.amountIn + step.feeAmount).toInt256());\n }\n\n // if the protocol fee is on, calculate how much is owed, decrement feeAmount, and increment protocolFee\n if (cache.feeProtocol > 0) {\n uint256 delta = step.feeAmount / cache.feeProtocol;\n step.feeAmount -= delta;\n state.protocolFee += uint128(delta);\n }\n\n // update global fee tracker\n if (state.liquidity > 0)\n state.feeGrowthGlobalX128 += FullMath.mulDiv(step.feeAmount, FixedPoint128.Q128, state.liquidity);\n\n // shift tick if we reached the next price\n if (state.sqrtPriceX96 == step.sqrtPriceNextX96) {\n // if the tick is initialized, run the tick transition\n if (step.initialized) {\n // check for the placeholder value, which we replace with the actual value the first time the swap\n // crosses an initialized tick\n if (!cache.computedLatestObservation) {\n (cache.tickCumulative, cache.secondsPerLiquidityCumulativeX128) = observations.observeSingle(\n cache.blockTimestamp,\n 0,\n slot0Start.tick,\n slot0Start.observationIndex,\n cache.liquidityStart,\n slot0Start.observationCardinality\n );\n cache.computedLatestObservation = true;\n }\n int128 liquidityNet =\n ticks.cross(\n step.tickNext,\n (zeroForOne ? state.feeGrowthGlobalX128 : feeGrowthGlobal0X128),\n (zeroForOne ? feeGrowthGlobal1X128 : state.feeGrowthGlobalX128),\n cache.secondsPerLiquidityCumulativeX128,\n cache.tickCumulative,\n cache.blockTimestamp\n );\n // if we're moving leftward, we interpret liquidityNet as the opposite sign\n // safe because liquidityNet cannot be type(int128).min\n if (zeroForOne) liquidityNet = -liquidityNet;\n\n state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet);\n }\n\n state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext;\n } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) {\n // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved\n state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96);\n }\n }\n\n // update tick and write an oracle entry if the tick change\n if (state.tick != slot0Start.tick) {\n (uint16 observationIndex, uint16 observationCardinality) =\n observations.write(\n slot0Start.observationIndex,\n cache.blockTimestamp,\n slot0Start.tick,\n cache.liquidityStart,\n slot0Start.observationCardinality,\n slot0Start.observationCardinalityNext\n );\n (slot0.sqrtPriceX96, slot0.tick, slot0.observationIndex, slot0.observationCardinality) = (\n state.sqrtPriceX96,\n state.tick,\n observationIndex,\n observationCardinality\n );\n } else {\n // otherwise just update the price\n slot0.sqrtPriceX96 = state.sqrtPriceX96;\n }\n\n // update liquidity if it changed\n if (cache.liquidityStart != state.liquidity) liquidity = state.liquidity;\n\n // update fee growth global and, if necessary, protocol fees\n // overflow is acceptable, protocol has to withdraw before it hits type(uint128).max fees\n if (zeroForOne) {\n feeGrowthGlobal0X128 = state.feeGrowthGlobalX128;\n if (state.protocolFee > 0) protocolFees.token0 += state.protocolFee;\n } else {\n feeGrowthGlobal1X128 = state.feeGrowthGlobalX128;\n if (state.protocolFee > 0) protocolFees.token1 += state.protocolFee;\n }\n\n (amount0, amount1) = zeroForOne == exactInput\n ? (amountSpecified - state.amountSpecifiedRemaining, state.amountCalculated)\n : (state.amountCalculated, amountSpecified - state.amountSpecifiedRemaining);\n\n // do the transfers and collect payment\n if (zeroForOne) {\n if (amount1 < 0) TransferHelper.safeTransfer(token1, recipient, uint256(-amount1));\n\n uint256 balance0Before = balance0();\n IUniswapV3SwapCallback(msg.sender).uniswapV3SwapCallback(amount0, amount1, data);\n require(balance0Before.add(uint256(amount0)) <= balance0(), 'IIA');\n } else {\n if (amount0 < 0) TransferHelper.safeTransfer(token0, recipient, uint256(-amount0));\n\n uint256 balance1Before = balance1();\n IUniswapV3SwapCallback(msg.sender).uniswapV3SwapCallback(amount0, amount1, data);\n require(balance1Before.add(uint256(amount1)) <= balance1(), 'IIA');\n }\n\n emit Swap(msg.sender, recipient, amount0, amount1, state.sqrtPriceX96, state.liquidity, state.tick);\n slot0.unlocked = true;\n }\n\n /// @inheritdoc IUniswapV3PoolActions\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external override lock noDelegateCall {\n uint128 _liquidity = liquidity;\n require(_liquidity > 0, 'L');\n\n uint256 fee0 = FullMath.mulDivRoundingUp(amount0, fee, 1e6);\n uint256 fee1 = FullMath.mulDivRoundingUp(amount1, fee, 1e6);\n uint256 balance0Before = balance0();\n uint256 balance1Before = balance1();\n\n if (amount0 > 0) TransferHelper.safeTransfer(token0, recipient, amount0);\n if (amount1 > 0) TransferHelper.safeTransfer(token1, recipient, amount1);\n\n IUniswapV3FlashCallback(msg.sender).uniswapV3FlashCallback(fee0, fee1, data);\n\n uint256 balance0After = balance0();\n uint256 balance1After = balance1();\n\n require(balance0Before.add(fee0) <= balance0After, 'F0');\n require(balance1Before.add(fee1) <= balance1After, 'F1');\n\n // sub is safe because we know balanceAfter is gt balanceBefore by at least fee\n uint256 paid0 = balance0After - balance0Before;\n uint256 paid1 = balance1After - balance1Before;\n\n if (paid0 > 0) {\n uint8 feeProtocol0 = slot0.feeProtocol % 16;\n uint256 fees0 = feeProtocol0 == 0 ? 0 : paid0 / feeProtocol0;\n if (uint128(fees0) > 0) protocolFees.token0 += uint128(fees0);\n feeGrowthGlobal0X128 += FullMath.mulDiv(paid0 - fees0, FixedPoint128.Q128, _liquidity);\n }\n if (paid1 > 0) {\n uint8 feeProtocol1 = slot0.feeProtocol >> 4;\n uint256 fees1 = feeProtocol1 == 0 ? 0 : paid1 / feeProtocol1;\n if (uint128(fees1) > 0) protocolFees.token1 += uint128(fees1);\n feeGrowthGlobal1X128 += FullMath.mulDiv(paid1 - fees1, FixedPoint128.Q128, _liquidity);\n }\n\n emit Flash(msg.sender, recipient, amount0, amount1, paid0, paid1);\n }\n\n /// @inheritdoc IUniswapV3PoolOwnerActions\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner {\n require(\n (feeProtocol0 == 0 || (feeProtocol0 >= 4 && feeProtocol0 <= 10)) &&\n (feeProtocol1 == 0 || (feeProtocol1 >= 4 && feeProtocol1 <= 10))\n );\n uint8 feeProtocolOld = slot0.feeProtocol;\n slot0.feeProtocol = feeProtocol0 + (feeProtocol1 << 4);\n emit SetFeeProtocol(feeProtocolOld % 16, feeProtocolOld >> 4, feeProtocol0, feeProtocol1);\n }\n\n /// @inheritdoc IUniswapV3PoolOwnerActions\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) {\n amount0 = amount0Requested > protocolFees.token0 ? protocolFees.token0 : amount0Requested;\n amount1 = amount1Requested > protocolFees.token1 ? protocolFees.token1 : amount1Requested;\n\n if (amount0 > 0) {\n if (amount0 == protocolFees.token0) amount0--; // ensure that the slot is not cleared, for gas savings\n protocolFees.token0 -= amount0;\n TransferHelper.safeTransfer(token0, recipient, amount0);\n }\n if (amount1 > 0) {\n if (amount1 == protocolFees.token1) amount1--; // ensure that the slot is not cleared, for gas savings\n protocolFees.token1 -= amount1;\n TransferHelper.safeTransfer(token1, recipient, amount1);\n }\n\n emit CollectProtocol(msg.sender, recipient, amount0, amount1);\n }\n}\n"
},
"contracts/interfaces/IUniswapV3Pool.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n"
},
"contracts/NoDelegateCall.sol": {
"content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity =0.7.6;\n\n/// @title Prevents delegatecall to a contract\n/// @notice Base contract that provides a modifier for preventing delegatecall to methods in a child contract\nabstract contract NoDelegateCall {\n /// @dev The original address of this contract\n address private immutable original;\n\n constructor() {\n // Immutables are computed in the init code of the contract, and then inlined into the deployed bytecode.\n // In other words, this variable won't change when it's checked at runtime.\n original = address(this);\n }\n\n /// @dev Private method is used instead of inlining into modifier because modifiers are copied into each method,\n /// and the use of immutable means the address bytes are copied in every place the modifier is used.\n function checkNotDelegateCall() private view {\n require(address(this) == original);\n }\n\n /// @notice Prevents delegatecall into the modified method\n modifier noDelegateCall() {\n checkNotDelegateCall();\n _;\n }\n}\n"
},
"contracts/libraries/LowGasSafeMath.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.7.0;\n\n/// @title Optimized overflow and underflow safe math operations\n/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost\nlibrary LowGasSafeMath {\n /// @notice Returns x + y, reverts if sum overflows uint256\n /// @param x The augend\n /// @param y The addend\n /// @return z The sum of x and y\n function add(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require((z = x + y) >= x);\n }\n\n /// @notice Returns x - y, reverts if underflows\n /// @param x The minuend\n /// @param y The subtrahend\n /// @return z The difference of x and y\n function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require((z = x - y) <= x);\n }\n\n /// @notice Returns x * y, reverts if overflows\n /// @param x The multiplicand\n /// @param y The multiplier\n /// @return z The product of x and y\n function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require(x == 0 || (z = x * y) / x == y);\n }\n\n /// @notice Returns x + y, reverts if overflows or underflows\n /// @param x The augend\n /// @param y The addend\n /// @return z The sum of x and y\n function add(int256 x, int256 y) internal pure returns (int256 z) {\n require((z = x + y) >= x == (y >= 0));\n }\n\n /// @notice Returns x - y, reverts if overflows or underflows\n /// @param x The minuend\n /// @param y The subtrahend\n /// @return z The difference of x and y\n function sub(int256 x, int256 y) internal pure returns (int256 z) {\n require((z = x - y) <= x == (y >= 0));\n }\n}\n"
},
"contracts/libraries/SafeCast.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Safe casting methods\n/// @notice Contains methods for safely casting between types\nlibrary SafeCast {\n /// @notice Cast a uint256 to a uint160, revert on overflow\n /// @param y The uint256 to be downcasted\n /// @return z The downcasted integer, now type uint160\n function toUint160(uint256 y) internal pure returns (uint160 z) {\n require((z = uint160(y)) == y);\n }\n\n /// @notice Cast a int256 to a int128, revert on overflow or underflow\n /// @param y The int256 to be downcasted\n /// @return z The downcasted integer, now type int128\n function toInt128(int256 y) internal pure returns (int128 z) {\n require((z = int128(y)) == y);\n }\n\n /// @notice Cast a uint256 to a int256, revert on overflow\n /// @param y The uint256 to be casted\n /// @return z The casted integer, now type int256\n function toInt256(uint256 y) internal pure returns (int256 z) {\n require(y < 2**255);\n z = int256(y);\n }\n}\n"
},
"contracts/libraries/Tick.sol": {
"content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport './LowGasSafeMath.sol';\nimport './SafeCast.sol';\n\nimport './TickMath.sol';\nimport './LiquidityMath.sol';\n\n/// @title Tick\n/// @notice Contains functions for managing tick processes and relevant calculations\nlibrary Tick {\n using LowGasSafeMath for int256;\n using SafeCast for int256;\n\n // info stored for each initialized individual tick\n struct Info {\n // the total position liquidity that references this tick\n uint128 liquidityGross;\n // amount of net liquidity added (subtracted) when tick is crossed from left to right (right to left),\n int128 liquidityNet;\n // fee growth per unit of liquidity on the _other_ side of this tick (relative to the current tick)\n // only has relative meaning, not absolute — the value depends on when the tick is initialized\n uint256 feeGrowthOutside0X128;\n uint256 feeGrowthOutside1X128;\n // the cumulative tick value on the other side of the tick\n int56 tickCumulativeOutside;\n // the seconds per unit of liquidity on the _other_ side of this tick (relative to the current tick)\n // only has relative meaning, not absolute — the value depends on when the tick is initialized\n uint160 secondsPerLiquidityOutsideX128;\n // the seconds spent on the other side of the tick (relative to the current tick)\n // only has relative meaning, not absolute — the value depends on when the tick is initialized\n uint32 secondsOutside;\n // true iff the tick is initialized, i.e. the value is exactly equivalent to the expression liquidityGross != 0\n // these 8 bits are set to prevent fresh sstores when crossing newly initialized ticks\n bool initialized;\n }\n\n /// @notice Derives max liquidity per tick from given tick spacing\n /// @dev Executed within the pool constructor\n /// @param tickSpacing The amount of required tick separation, realized in multiples of `tickSpacing`\n /// e.g., a tickSpacing of 3 requires ticks to be initialized every 3rd tick i.e., ..., -6, -3, 0, 3, 6, ...\n /// @return The max liquidity per tick\n function tickSpacingToMaxLiquidityPerTick(int24 tickSpacing) internal pure returns (uint128) {\n int24 minTick = (TickMath.MIN_TICK / tickSpacing) * tickSpacing;\n int24 maxTick = (TickMath.MAX_TICK / tickSpacing) * tickSpacing;\n uint24 numTicks = uint24((maxTick - minTick) / tickSpacing) + 1;\n return type(uint128).max / numTicks;\n }\n\n /// @notice Retrieves fee growth data\n /// @param self The mapping containing all tick information for initialized ticks\n /// @param tickLower The lower tick boundary of the position\n /// @param tickUpper The upper tick boundary of the position\n /// @param tickCurrent The current tick\n /// @param feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0\n /// @param feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1\n /// @return feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries\n /// @return feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries\n function getFeeGrowthInside(\n mapping(int24 => Tick.Info) storage self,\n int24 tickLower,\n int24 tickUpper,\n int24 tickCurrent,\n uint256 feeGrowthGlobal0X128,\n uint256 feeGrowthGlobal1X128\n ) internal view returns (uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) {\n Info storage lower = self[tickLower];\n Info storage upper = self[tickUpper];\n\n // calculate fee growth below\n uint256 feeGrowthBelow0X128;\n uint256 feeGrowthBelow1X128;\n if (tickCurrent >= tickLower) {\n feeGrowthBelow0X128 = lower.feeGrowthOutside0X128;\n feeGrowthBelow1X128 = lower.feeGrowthOutside1X128;\n } else {\n feeGrowthBelow0X128 = feeGrowthGlobal0X128 - lower.feeGrowthOutside0X128;\n feeGrowthBelow1X128 = feeGrowthGlobal1X128 - lower.feeGrowthOutside1X128;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove0X128;\n uint256 feeGrowthAbove1X128;\n if (tickCurrent < tickUpper) {\n feeGrowthAbove0X128 = upper.feeGrowthOutside0X128;\n feeGrowthAbove1X128 = upper.feeGrowthOutside1X128;\n } else {\n feeGrowthAbove0X128 = feeGrowthGlobal0X128 - upper.feeGrowthOutside0X128;\n feeGrowthAbove1X128 = feeGrowthGlobal1X128 - upper.feeGrowthOutside1X128;\n }\n\n feeGrowthInside0X128 = feeGrowthGlobal0X128 - feeGrowthBelow0X128 - feeGrowthAbove0X128;\n feeGrowthInside1X128 = feeGrowthGlobal1X128 - feeGrowthBelow1X128 - feeGrowthAbove1X128;\n }\n\n /// @notice Updates a tick and returns true if the tick was flipped from initialized to uninitialized, or vice versa\n /// @param self The mapping containing all tick information for initialized ticks\n /// @param tick The tick that will be updated\n /// @param tickCurrent The current tick\n /// @param liquidityDelta A new amount of liquidity to be added (subtracted) when tick is crossed from left to right (right to left)\n /// @param feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0\n /// @param feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1\n /// @param secondsPerLiquidityCumulativeX128 The all-time seconds per max(1, liquidity) of the pool\n /// @param time The current block timestamp cast to a uint32\n /// @param upper true for updating a position's upper tick, or false for updating a position's lower tick\n /// @param maxLiquidity The maximum liquidity allocation for a single tick\n /// @return flipped Whether the tick was flipped from initialized to uninitialized, or vice versa\n function update(\n mapping(int24 => Tick.Info) storage self,\n int24 tick,\n int24 tickCurrent,\n int128 liquidityDelta,\n uint256 feeGrowthGlobal0X128,\n uint256 feeGrowthGlobal1X128,\n uint160 secondsPerLiquidityCumulativeX128,\n int56 tickCumulative,\n uint32 time,\n bool upper,\n uint128 maxLiquidity\n ) internal returns (bool flipped) {\n Tick.Info storage info = self[tick];\n\n uint128 liquidityGrossBefore = info.liquidityGross;\n uint128 liquidityGrossAfter = LiquidityMath.addDelta(liquidityGrossBefore, liquidityDelta);\n\n require(liquidityGrossAfter <= maxLiquidity, 'LO');\n\n flipped = (liquidityGrossAfter == 0) != (liquidityGrossBefore == 0);\n\n if (liquidityGrossBefore == 0) {\n // by convention, we assume that all growth before a tick was initialized happened _below_ the tick\n if (tick <= tickCurrent) {\n info.feeGrowthOutside0X128 = feeGrowthGlobal0X128;\n info.feeGrowthOutside1X128 = feeGrowthGlobal1X128;\n info.secondsPerLiquidityOutsideX128 = secondsPerLiquidityCumulativeX128;\n info.tickCumulativeOutside = tickCumulative;\n info.secondsOutside = time;\n }\n info.initialized = true;\n }\n\n info.liquidityGross = liquidityGrossAfter;\n\n // when the lower (upper) tick is crossed left to right (right to left), liquidity must be added (removed)\n info.liquidityNet = upper\n ? int256(info.liquidityNet).sub(liquidityDelta).toInt128()\n : int256(info.liquidityNet).add(liquidityDelta).toInt128();\n }\n\n /// @notice Clears tick data\n /// @param self The mapping containing all initialized tick information for initialized ticks\n /// @param tick The tick that will be cleared\n function clear(mapping(int24 => Tick.Info) storage self, int24 tick) internal {\n delete self[tick];\n }\n\n /// @notice Transitions to next tick as needed by price movement\n /// @param self The mapping containing all tick information for initialized ticks\n /// @param tick The destination tick of the transition\n /// @param feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0\n /// @param feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1\n /// @param secondsPerLiquidityCumulativeX128 The current seconds per liquidity\n /// @param time The current block.timestamp\n /// @return liquidityNet The amount of liquidity added (subtracted) when tick is crossed from left to right (right to left)\n function cross(\n mapping(int24 => Tick.Info) storage self,\n int24 tick,\n uint256 feeGrowthGlobal0X128,\n uint256 feeGrowthGlobal1X128,\n uint160 secondsPerLiquidityCumulativeX128,\n int56 tickCumulative,\n uint32 time\n ) internal returns (int128 liquidityNet) {\n Tick.Info storage info = self[tick];\n info.feeGrowthOutside0X128 = feeGrowthGlobal0X128 - info.feeGrowthOutside0X128;\n info.feeGrowthOutside1X128 = feeGrowthGlobal1X128 - info.feeGrowthOutside1X128;\n info.secondsPerLiquidityOutsideX128 = secondsPerLiquidityCumulativeX128 - info.secondsPerLiquidityOutsideX128;\n info.tickCumulativeOutside = tickCumulative - info.tickCumulativeOutside;\n info.secondsOutside = time - info.secondsOutside;\n liquidityNet = info.liquidityNet;\n }\n}\n"
},
"contracts/libraries/TickBitmap.sol": {
"content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport './BitMath.sol';\n\n/// @title Packed tick initialized state library\n/// @notice Stores a packed mapping of tick index to its initialized state\n/// @dev The mapping uses int16 for keys since ticks are represented as int24 and there are 256 (2^8) values per word.\nlibrary TickBitmap {\n /// @notice Computes the position in the mapping where the initialized bit for a tick lives\n /// @param tick The tick for which to compute the position\n /// @return wordPos The key in the mapping containing the word in which the bit is stored\n /// @return bitPos The bit position in the word where the flag is stored\n function position(int24 tick) private pure returns (int16 wordPos, uint8 bitPos) {\n wordPos = int16(tick >> 8);\n bitPos = uint8(tick % 256);\n }\n\n /// @notice Flips the initialized state for a given tick from false to true, or vice versa\n /// @param self The mapping in which to flip the tick\n /// @param tick The tick to flip\n /// @param tickSpacing The spacing between usable ticks\n function flipTick(\n mapping(int16 => uint256) storage self,\n int24 tick,\n int24 tickSpacing\n ) internal {\n require(tick % tickSpacing == 0); // ensure that the tick is spaced\n (int16 wordPos, uint8 bitPos) = position(tick / tickSpacing);\n uint256 mask = 1 << bitPos;\n self[wordPos] ^= mask;\n }\n\n /// @notice Returns the next initialized tick contained in the same word (or adjacent word) as the tick that is either\n /// to the left (less than or equal to) or right (greater than) of the given tick\n /// @param self The mapping in which to compute the next initialized tick\n /// @param tick The starting tick\n /// @param tickSpacing The spacing between usable ticks\n /// @param lte Whether to search for the next initialized tick to the left (less than or equal to the starting tick)\n /// @return next The next initialized or uninitialized tick up to 256 ticks away from the current tick\n /// @return initialized Whether the next tick is initialized, as the function only searches within up to 256 ticks\n function nextInitializedTickWithinOneWord(\n mapping(int16 => uint256) storage self,\n int24 tick,\n int24 tickSpacing,\n bool lte\n ) internal view returns (int24 next, bool initialized) {\n int24 compressed = tick / tickSpacing;\n if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity\n\n if (lte) {\n (int16 wordPos, uint8 bitPos) = position(compressed);\n // all the 1s at or to the right of the current bitPos\n uint256 mask = (1 << bitPos) - 1 + (1 << bitPos);\n uint256 masked = self[wordPos] & mask;\n\n // if there are no initialized ticks to the right of or at the current tick, return rightmost in the word\n initialized = masked != 0;\n // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick\n next = initialized\n ? (compressed - int24(bitPos - BitMath.mostSignificantBit(masked))) * tickSpacing\n : (compressed - int24(bitPos)) * tickSpacing;\n } else {\n // start from the word of the next tick, since the current tick state doesn't matter\n (int16 wordPos, uint8 bitPos) = position(compressed + 1);\n // all the 1s at or to the left of the bitPos\n uint256 mask = ~((1 << bitPos) - 1);\n uint256 masked = self[wordPos] & mask;\n\n // if there are no initialized ticks to the left of the current tick, return leftmost in the word\n initialized = masked != 0;\n // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick\n next = initialized\n ? (compressed + 1 + int24(BitMath.leastSignificantBit(masked) - bitPos)) * tickSpacing\n : (compressed + 1 + int24(type(uint8).max - bitPos)) * tickSpacing;\n }\n }\n}\n"
},
"contracts/libraries/Position.sol": {
"content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport './FullMath.sol';\nimport './FixedPoint128.sol';\nimport './LiquidityMath.sol';\n\n/// @title Position\n/// @notice Positions represent an owner address' liquidity between a lower and upper tick boundary\n/// @dev Positions store additional state for tracking fees owed to the position\nlibrary Position {\n // info stored for each user's position\n struct Info {\n // the amount of liquidity owned by this position\n uint128 liquidity;\n // fee growth per unit of liquidity as of the last update to liquidity or fees owed\n uint256 feeGrowthInside0LastX128;\n uint256 feeGrowthInside1LastX128;\n // the fees owed to the position owner in token0/token1\n uint128 tokensOwed0;\n uint128 tokensOwed1;\n }\n\n /// @notice Returns the Info struct of a position, given an owner and position boundaries\n /// @param self The mapping containing all user positions\n /// @param owner The address of the position owner\n /// @param tickLower The lower tick boundary of the position\n /// @param tickUpper The upper tick boundary of the position\n /// @return position The position info struct of the given owners' position\n function get(\n mapping(bytes32 => Info) storage self,\n address owner,\n int24 tickLower,\n int24 tickUpper\n ) internal view returns (Position.Info storage position) {\n position = self[keccak256(abi.encodePacked(owner, tickLower, tickUpper))];\n }\n\n /// @notice Credits accumulated fees to a user's position\n /// @param self The individual position to update\n /// @param liquidityDelta The change in pool liquidity as a result of the position update\n /// @param feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries\n /// @param feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries\n function update(\n Info storage self,\n int128 liquidityDelta,\n uint256 feeGrowthInside0X128,\n uint256 feeGrowthInside1X128\n ) internal {\n Info memory _self = self;\n\n uint128 liquidityNext;\n if (liquidityDelta == 0) {\n require(_self.liquidity > 0, 'NP'); // disallow pokes for 0 liquidity positions\n liquidityNext = _self.liquidity;\n } else {\n liquidityNext = LiquidityMath.addDelta(_self.liquidity, liquidityDelta);\n }\n\n // calculate accumulated fees\n uint128 tokensOwed0 =\n uint128(\n FullMath.mulDiv(\n feeGrowthInside0X128 - _self.feeGrowthInside0LastX128,\n _self.liquidity,\n FixedPoint128.Q128\n )\n );\n uint128 tokensOwed1 =\n uint128(\n FullMath.mulDiv(\n feeGrowthInside1X128 - _self.feeGrowthInside1LastX128,\n _self.liquidity,\n FixedPoint128.Q128\n )\n );\n\n // update the position\n if (liquidityDelta != 0) self.liquidity = liquidityNext;\n self.feeGrowthInside0LastX128 = feeGrowthInside0X128;\n self.feeGrowthInside1LastX128 = feeGrowthInside1X128;\n if (tokensOwed0 > 0 || tokensOwed1 > 0) {\n // overflow is acceptable, have to withdraw before you hit type(uint128).max fees\n self.tokensOwed0 += tokensOwed0;\n self.tokensOwed1 += tokensOwed1;\n }\n }\n}\n"
},
"contracts/libraries/Oracle.sol": {
"content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\n/// @title Oracle\n/// @notice Provides price and liquidity data useful for a wide variety of system designs\n/// @dev Instances of stored oracle data, \"observations\", are collected in the oracle array\n/// Every pool is initialized with an oracle array length of 1. Anyone can pay the SSTOREs to increase the\n/// maximum length of the oracle array. New slots will be added when the array is fully populated.\n/// Observations are overwritten when the full length of the oracle array is populated.\n/// The most recent observation is available, independent of the length of the oracle array, by passing 0 to observe()\nlibrary Oracle {\n struct Observation {\n // the block timestamp of the observation\n uint32 blockTimestamp;\n // the tick accumulator, i.e. tick * time elapsed since the pool was first initialized\n int56 tickCumulative;\n // the seconds per liquidity, i.e. seconds elapsed / max(1, liquidity) since the pool was first initialized\n uint160 secondsPerLiquidityCumulativeX128;\n // whether or not the observation is initialized\n bool initialized;\n }\n\n /// @notice Transforms a previous observation into a new observation, given the passage of time and the current tick and liquidity values\n /// @dev blockTimestamp _must_ be chronologically equal to or greater than last.blockTimestamp, safe for 0 or 1 overflows\n /// @param last The specified observation to be transformed\n /// @param blockTimestamp The timestamp of the new observation\n /// @param tick The active tick at the time of the new observation\n /// @param liquidity The total in-range liquidity at the time of the new observation\n /// @return Observation The newly populated observation\n function transform(\n Observation memory last,\n uint32 blockTimestamp,\n int24 tick,\n uint128 liquidity\n ) private pure returns (Observation memory) {\n uint32 delta = blockTimestamp - last.blockTimestamp;\n return\n Observation({\n blockTimestamp: blockTimestamp,\n tickCumulative: last.tickCumulative + int56(tick) * delta,\n secondsPerLiquidityCumulativeX128: last.secondsPerLiquidityCumulativeX128 +\n ((uint160(delta) << 128) / (liquidity > 0 ? liquidity : 1)),\n initialized: true\n });\n }\n\n /// @notice Initialize the oracle array by writing the first slot. Called once for the lifecycle of the observations array\n /// @param self The stored oracle array\n /// @param time The time of the oracle initialization, via block.timestamp truncated to uint32\n /// @return cardinality The number of populated elements in the oracle array\n /// @return cardinalityNext The new length of the oracle array, independent of population\n function initialize(Observation[65535] storage self, uint32 time)\n internal\n returns (uint16 cardinality, uint16 cardinalityNext)\n {\n self[0] = Observation({\n blockTimestamp: time,\n tickCumulative: 0,\n secondsPerLiquidityCumulativeX128: 0,\n initialized: true\n });\n return (1, 1);\n }\n\n /// @notice Writes an oracle observation to the array\n /// @dev Writable at most once per block. Index represents the most recently written element. cardinality and index must be tracked externally.\n /// If the index is at the end of the allowable array length (according to cardinality), and the next cardinality\n /// is greater than the current one, cardinality may be increased. This restriction is created to preserve ordering.\n /// @param self The stored oracle array\n /// @param index The index of the observation that was most recently written to the observations array\n /// @param blockTimestamp The timestamp of the new observation\n /// @param tick The active tick at the time of the new observation\n /// @param liquidity The total in-range liquidity at the time of the new observation\n /// @param cardinality The number of populated elements in the oracle array\n /// @param cardinalityNext The new length of the oracle array, independent of population\n /// @return indexUpdated The new index of the most recently written element in the oracle array\n /// @return cardinalityUpdated The new cardinality of the oracle array\n function write(\n Observation[65535] storage self,\n uint16 index,\n uint32 blockTimestamp,\n int24 tick,\n uint128 liquidity,\n uint16 cardinality,\n uint16 cardinalityNext\n ) internal returns (uint16 indexUpdated, uint16 cardinalityUpdated) {\n Observation memory last = self[index];\n\n // early return if we've already written an observation this block\n if (last.blockTimestamp == blockTimestamp) return (index, cardinality);\n\n // if the conditions are right, we can bump the cardinality\n if (cardinalityNext > cardinality && index == (cardinality - 1)) {\n cardinalityUpdated = cardinalityNext;\n } else {\n cardinalityUpdated = cardinality;\n }\n\n indexUpdated = (index + 1) % cardinalityUpdated;\n self[indexUpdated] = transform(last, blockTimestamp, tick, liquidity);\n }\n\n /// @notice Prepares the oracle array to store up to `next` observations\n /// @param self The stored oracle array\n /// @param current The current next cardinality of the oracle array\n /// @param next The proposed next cardinality which will be populated in the oracle array\n /// @return next The next cardinality which will be populated in the oracle array\n function grow(\n Observation[65535] storage self,\n uint16 current,\n uint16 next\n ) internal returns (uint16) {\n require(current > 0, 'I');\n // no-op if the passed next value isn't greater than the current next value\n if (next <= current) return current;\n // store in each slot to prevent fresh SSTOREs in swaps\n // this data will not be used because the initialized boolean is still false\n for (uint16 i = current; i < next; i++) self[i].blockTimestamp = 1;\n return next;\n }\n\n /// @notice comparator for 32-bit timestamps\n /// @dev safe for 0 or 1 overflows, a and b _must_ be chronologically before or equal to time\n /// @param time A timestamp truncated to 32 bits\n /// @param a A comparison timestamp from which to determine the relative position of `time`\n /// @param b From which to determine the relative position of `time`\n /// @return bool Whether `a` is chronologically <= `b`\n function lte(\n uint32 time,\n uint32 a,\n uint32 b\n ) private pure returns (bool) {\n // if there hasn't been overflow, no need to adjust\n if (a <= time && b <= time) return a <= b;\n\n uint256 aAdjusted = a > time ? a : a + 2**32;\n uint256 bAdjusted = b > time ? b : b + 2**32;\n\n return aAdjusted <= bAdjusted;\n }\n\n /// @notice Fetches the observations beforeOrAt and atOrAfter a target, i.e. where [beforeOrAt, atOrAfter] is satisfied.\n /// The result may be the same observation, or adjacent observations.\n /// @dev The answer must be contained in the array, used when the target is located within the stored observation\n /// boundaries: older than the most recent observation and younger, or the same age as, the oldest observation\n /// @param self The stored oracle array\n /// @param time The current block.timestamp\n /// @param target The timestamp at which the reserved observation should be for\n /// @param index The index of the observation that was most recently written to the observations array\n /// @param cardinality The number of populated elements in the oracle array\n /// @return beforeOrAt The observation recorded before, or at, the target\n /// @return atOrAfter The observation recorded at, or after, the target\n function binarySearch(\n Observation[65535] storage self,\n uint32 time,\n uint32 target,\n uint16 index,\n uint16 cardinality\n ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) {\n uint256 l = (index + 1) % cardinality; // oldest observation\n uint256 r = l + cardinality - 1; // newest observation\n uint256 i;\n while (true) {\n i = (l + r) / 2;\n\n beforeOrAt = self[i % cardinality];\n\n // we've landed on an uninitialized tick, keep searching higher (more recently)\n if (!beforeOrAt.initialized) {\n l = i + 1;\n continue;\n }\n\n atOrAfter = self[(i + 1) % cardinality];\n\n bool targetAtOrAfter = lte(time, beforeOrAt.blockTimestamp, target);\n\n // check if we've found the answer!\n if (targetAtOrAfter && lte(time, target, atOrAfter.blockTimestamp)) break;\n\n if (!targetAtOrAfter) r = i - 1;\n else l = i + 1;\n }\n }\n\n /// @notice Fetches the observations beforeOrAt and atOrAfter a given target, i.e. where [beforeOrAt, atOrAfter] is satisfied\n /// @dev Assumes there is at least 1 initialized observation.\n /// Used by observeSingle() to compute the counterfactual accumulator values as of a given block timestamp.\n /// @param self The stored oracle array\n /// @param time The current block.timestamp\n /// @param target The timestamp at which the reserved observation should be for\n /// @param tick The active tick at the time of the returned or simulated observation\n /// @param index The index of the observation that was most recently written to the observations array\n /// @param liquidity The total pool liquidity at the time of the call\n /// @param cardinality The number of populated elements in the oracle array\n /// @return beforeOrAt The observation which occurred at, or before, the given timestamp\n /// @return atOrAfter The observation which occurred at, or after, the given timestamp\n function getSurroundingObservations(\n Observation[65535] storage self,\n uint32 time,\n uint32 target,\n int24 tick,\n uint16 index,\n uint128 liquidity,\n uint16 cardinality\n ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) {\n // optimistically set before to the newest observation\n beforeOrAt = self[index];\n\n // if the target is chronologically at or after the newest observation, we can early return\n if (lte(time, beforeOrAt.blockTimestamp, target)) {\n if (beforeOrAt.blockTimestamp == target) {\n // if newest observation equals target, we're in the same block, so we can ignore atOrAfter\n return (beforeOrAt, atOrAfter);\n } else {\n // otherwise, we need to transform\n return (beforeOrAt, transform(beforeOrAt, target, tick, liquidity));\n }\n }\n\n // now, set before to the oldest observation\n beforeOrAt = self[(index + 1) % cardinality];\n if (!beforeOrAt.initialized) beforeOrAt = self[0];\n\n // ensure that the target is chronologically at or after the oldest observation\n require(lte(time, beforeOrAt.blockTimestamp, target), 'OLD');\n\n // if we've reached this point, we have to binary search\n return binarySearch(self, time, target, index, cardinality);\n }\n\n /// @dev Reverts if an observation at or before the desired observation timestamp does not exist.\n /// 0 may be passed as `secondsAgo' to return the current cumulative values.\n /// If called with a timestamp falling between two observations, returns the counterfactual accumulator values\n /// at exactly the timestamp between the two observations.\n /// @param self The stored oracle array\n /// @param time The current block timestamp\n /// @param secondsAgo The amount of time to look back, in seconds, at which point to return an observation\n /// @param tick The current tick\n /// @param index The index of the observation that was most recently written to the observations array\n /// @param liquidity The current in-range pool liquidity\n /// @param cardinality The number of populated elements in the oracle array\n /// @return tickCumulative The tick * time elapsed since the pool was first initialized, as of `secondsAgo`\n /// @return secondsPerLiquidityCumulativeX128 The time elapsed / max(1, liquidity) since the pool was first initialized, as of `secondsAgo`\n function observeSingle(\n Observation[65535] storage self,\n uint32 time,\n uint32 secondsAgo,\n int24 tick,\n uint16 index,\n uint128 liquidity,\n uint16 cardinality\n ) internal view returns (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) {\n if (secondsAgo == 0) {\n Observation memory last = self[index];\n if (last.blockTimestamp != time) last = transform(last, time, tick, liquidity);\n return (last.tickCumulative, last.secondsPerLiquidityCumulativeX128);\n }\n\n uint32 target = time - secondsAgo;\n\n (Observation memory beforeOrAt, Observation memory atOrAfter) =\n getSurroundingObservations(self, time, target, tick, index, liquidity, cardinality);\n\n if (target == beforeOrAt.blockTimestamp) {\n // we're at the left boundary\n return (beforeOrAt.tickCumulative, beforeOrAt.secondsPerLiquidityCumulativeX128);\n } else if (target == atOrAfter.blockTimestamp) {\n // we're at the right boundary\n return (atOrAfter.tickCumulative, atOrAfter.secondsPerLiquidityCumulativeX128);\n } else {\n // we're in the middle\n uint32 observationTimeDelta = atOrAfter.blockTimestamp - beforeOrAt.blockTimestamp;\n uint32 targetDelta = target - beforeOrAt.blockTimestamp;\n return (\n beforeOrAt.tickCumulative +\n ((atOrAfter.tickCumulative - beforeOrAt.tickCumulative) / observationTimeDelta) *\n targetDelta,\n beforeOrAt.secondsPerLiquidityCumulativeX128 +\n uint160(\n (uint256(\n atOrAfter.secondsPerLiquidityCumulativeX128 - beforeOrAt.secondsPerLiquidityCumulativeX128\n ) * targetDelta) / observationTimeDelta\n )\n );\n }\n }\n\n /// @notice Returns the accumulator values as of each time seconds ago from the given time in the array of `secondsAgos`\n /// @dev Reverts if `secondsAgos` > oldest observation\n /// @param self The stored oracle array\n /// @param time The current block.timestamp\n /// @param secondsAgos Each amount of time to look back, in seconds, at which point to return an observation\n /// @param tick The current tick\n /// @param index The index of the observation that was most recently written to the observations array\n /// @param liquidity The current in-range pool liquidity\n /// @param cardinality The number of populated elements in the oracle array\n /// @return tickCumulatives The tick * time elapsed since the pool was first initialized, as of each `secondsAgo`\n /// @return secondsPerLiquidityCumulativeX128s The cumulative seconds / max(1, liquidity) since the pool was first initialized, as of each `secondsAgo`\n function observe(\n Observation[65535] storage self,\n uint32 time,\n uint32[] memory secondsAgos,\n int24 tick,\n uint16 index,\n uint128 liquidity,\n uint16 cardinality\n ) internal view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) {\n require(cardinality > 0, 'I');\n\n tickCumulatives = new int56[](secondsAgos.length);\n secondsPerLiquidityCumulativeX128s = new uint160[](secondsAgos.length);\n for (uint256 i = 0; i < secondsAgos.length; i++) {\n (tickCumulatives[i], secondsPerLiquidityCumulativeX128s[i]) = observeSingle(\n self,\n time,\n secondsAgos[i],\n tick,\n index,\n liquidity,\n cardinality\n );\n }\n }\n}\n"
},
"contracts/libraries/FullMath.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.4.0;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n uint256 twos = -denominator & denominator;\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n"
},
"contracts/libraries/FixedPoint128.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint128\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\nlibrary FixedPoint128 {\n uint256 internal constant Q128 = 0x100000000000000000000000000000000;\n}\n"
},
"contracts/libraries/TransferHelper.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.6.0;\n\nimport '../interfaces/IERC20Minimal.sol';\n\n/// @title TransferHelper\n/// @notice Contains helper methods for interacting with ERC20 tokens that do not consistently return true/false\nlibrary TransferHelper {\n /// @notice Transfers tokens from msg.sender to a recipient\n /// @dev Calls transfer on token contract, errors with TF if transfer fails\n /// @param token The contract address of the token which will be transferred\n /// @param to The recipient of the transfer\n /// @param value The value of the transfer\n function safeTransfer(\n address token,\n address to,\n uint256 value\n ) internal {\n (bool success, bytes memory data) =\n token.call(abi.encodeWithSelector(IERC20Minimal.transfer.selector, to, value));\n require(success && (data.length == 0 || abi.decode(data, (bool))), 'TF');\n }\n}\n"
},
"contracts/libraries/TickMath.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {\n uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n require(absTick <= uint256(MAX_TICK), 'T');\n\n uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1));\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) {\n // second inequality must be < because the price can never reach the price at the max tick\n require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, 'R');\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128);\n int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128);\n\n tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow;\n }\n}\n"
},
"contracts/libraries/LiquidityMath.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Math library for liquidity\nlibrary LiquidityMath {\n /// @notice Add a signed liquidity delta to liquidity and revert if it overflows or underflows\n /// @param x The liquidity before change\n /// @param y The delta by which liquidity should be changed\n /// @return z The liquidity delta\n function addDelta(uint128 x, int128 y) internal pure returns (uint128 z) {\n if (y < 0) {\n require((z = x - uint128(-y)) < x, 'LS');\n } else {\n require((z = x + uint128(y)) >= x, 'LA');\n }\n }\n}\n"
},
"contracts/libraries/SqrtPriceMath.sol": {
"content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport './LowGasSafeMath.sol';\nimport './SafeCast.sol';\n\nimport './FullMath.sol';\nimport './UnsafeMath.sol';\nimport './FixedPoint96.sol';\n\n/// @title Functions based on Q64.96 sqrt price and liquidity\n/// @notice Contains the math that uses square root of price as a Q64.96 and liquidity to compute deltas\nlibrary SqrtPriceMath {\n using LowGasSafeMath for uint256;\n using SafeCast for uint256;\n\n /// @notice Gets the next sqrt price given a delta of token0\n /// @dev Always rounds up, because in the exact output case (increasing price) we need to move the price at least\n /// far enough to get the desired output amount, and in the exact input case (decreasing price) we need to move the\n /// price less in order to not send too much output.\n /// The most precise formula for this is liquidity * sqrtPX96 / (liquidity +- amount * sqrtPX96),\n /// if this is impossible because of overflow, we calculate liquidity / (liquidity / sqrtPX96 +- amount).\n /// @param sqrtPX96 The starting price, i.e. before accounting for the token0 delta\n /// @param liquidity The amount of usable liquidity\n /// @param amount How much of token0 to add or remove from virtual reserves\n /// @param add Whether to add or remove the amount of token0\n /// @return The price after adding or removing amount, depending on add\n function getNextSqrtPriceFromAmount0RoundingUp(\n uint160 sqrtPX96,\n uint128 liquidity,\n uint256 amount,\n bool add\n ) internal pure returns (uint160) {\n // we short circuit amount == 0 because the result is otherwise not guaranteed to equal the input price\n if (amount == 0) return sqrtPX96;\n uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION;\n\n if (add) {\n uint256 product;\n if ((product = amount * sqrtPX96) / amount == sqrtPX96) {\n uint256 denominator = numerator1 + product;\n if (denominator >= numerator1)\n // always fits in 160 bits\n return uint160(FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator));\n }\n\n return uint160(UnsafeMath.divRoundingUp(numerator1, (numerator1 / sqrtPX96).add(amount)));\n } else {\n uint256 product;\n // if the product overflows, we know the denominator underflows\n // in addition, we must check that the denominator does not underflow\n require((product = amount * sqrtPX96) / amount == sqrtPX96 && numerator1 > product);\n uint256 denominator = numerator1 - product;\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator).toUint160();\n }\n }\n\n /// @notice Gets the next sqrt price given a delta of token1\n /// @dev Always rounds down, because in the exact output case (decreasing price) we need to move the price at least\n /// far enough to get the desired output amount, and in the exact input case (increasing price) we need to move the\n /// price less in order to not send too much output.\n /// The formula we compute is within <1 wei of the lossless version: sqrtPX96 +- amount / liquidity\n /// @param sqrtPX96 The starting price, i.e., before accounting for the token1 delta\n /// @param liquidity The amount of usable liquidity\n /// @param amount How much of token1 to add, or remove, from virtual reserves\n /// @param add Whether to add, or remove, the amount of token1\n /// @return The price after adding or removing `amount`\n function getNextSqrtPriceFromAmount1RoundingDown(\n uint160 sqrtPX96,\n uint128 liquidity,\n uint256 amount,\n bool add\n ) internal pure returns (uint160) {\n // if we're adding (subtracting), rounding down requires rounding the quotient down (up)\n // in both cases, avoid a mulDiv for most inputs\n if (add) {\n uint256 quotient =\n (\n amount <= type(uint160).max\n ? (amount << FixedPoint96.RESOLUTION) / liquidity\n : FullMath.mulDiv(amount, FixedPoint96.Q96, liquidity)\n );\n\n return uint256(sqrtPX96).add(quotient).toUint160();\n } else {\n uint256 quotient =\n (\n amount <= type(uint160).max\n ? UnsafeMath.divRoundingUp(amount << FixedPoint96.RESOLUTION, liquidity)\n : FullMath.mulDivRoundingUp(amount, FixedPoint96.Q96, liquidity)\n );\n\n require(sqrtPX96 > quotient);\n // always fits 160 bits\n return uint160(sqrtPX96 - quotient);\n }\n }\n\n /// @notice Gets the next sqrt price given an input amount of token0 or token1\n /// @dev Throws if price or liquidity are 0, or if the next price is out of bounds\n /// @param sqrtPX96 The starting price, i.e., before accounting for the input amount\n /// @param liquidity The amount of usable liquidity\n /// @param amountIn How much of token0, or token1, is being swapped in\n /// @param zeroForOne Whether the amount in is token0 or token1\n /// @return sqrtQX96 The price after adding the input amount to token0 or token1\n function getNextSqrtPriceFromInput(\n uint160 sqrtPX96,\n uint128 liquidity,\n uint256 amountIn,\n bool zeroForOne\n ) internal pure returns (uint160 sqrtQX96) {\n require(sqrtPX96 > 0);\n require(liquidity > 0);\n\n // round to make sure that we don't pass the target price\n return\n zeroForOne\n ? getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true)\n : getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true);\n }\n\n /// @notice Gets the next sqrt price given an output amount of token0 or token1\n /// @dev Throws if price or liquidity are 0 or the next price is out of bounds\n /// @param sqrtPX96 The starting price before accounting for the output amount\n /// @param liquidity The amount of usable liquidity\n /// @param amountOut How much of token0, or token1, is being swapped out\n /// @param zeroForOne Whether the amount out is token0 or token1\n /// @return sqrtQX96 The price after removing the output amount of token0 or token1\n function getNextSqrtPriceFromOutput(\n uint160 sqrtPX96,\n uint128 liquidity,\n uint256 amountOut,\n bool zeroForOne\n ) internal pure returns (uint160 sqrtQX96) {\n require(sqrtPX96 > 0);\n require(liquidity > 0);\n\n // round to make sure that we pass the target price\n return\n zeroForOne\n ? getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false)\n : getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false);\n }\n\n /// @notice Gets the amount0 delta between two prices\n /// @dev Calculates liquidity / sqrt(lower) - liquidity / sqrt(upper),\n /// i.e. liquidity * (sqrt(upper) - sqrt(lower)) / (sqrt(upper) * sqrt(lower))\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The amount of usable liquidity\n /// @param roundUp Whether to round the amount up or down\n /// @return amount0 Amount of token0 required to cover a position of size liquidity between the two passed prices\n function getAmount0Delta(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity,\n bool roundUp\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION;\n uint256 numerator2 = sqrtRatioBX96 - sqrtRatioAX96;\n\n require(sqrtRatioAX96 > 0);\n\n return\n roundUp\n ? UnsafeMath.divRoundingUp(\n FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96),\n sqrtRatioAX96\n )\n : FullMath.mulDiv(numerator1, numerator2, sqrtRatioBX96) / sqrtRatioAX96;\n }\n\n /// @notice Gets the amount1 delta between two prices\n /// @dev Calculates liquidity * (sqrt(upper) - sqrt(lower))\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The amount of usable liquidity\n /// @param roundUp Whether to round the amount up, or down\n /// @return amount1 Amount of token1 required to cover a position of size liquidity between the two passed prices\n function getAmount1Delta(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity,\n bool roundUp\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n roundUp\n ? FullMath.mulDivRoundingUp(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96)\n : FullMath.mulDiv(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96);\n }\n\n /// @notice Helper that gets signed token0 delta\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The change in liquidity for which to compute the amount0 delta\n /// @return amount0 Amount of token0 corresponding to the passed liquidityDelta between the two prices\n function getAmount0Delta(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n int128 liquidity\n ) internal pure returns (int256 amount0) {\n return\n liquidity < 0\n ? -getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(-liquidity), false).toInt256()\n : getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(liquidity), true).toInt256();\n }\n\n /// @notice Helper that gets signed token1 delta\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The change in liquidity for which to compute the amount1 delta\n /// @return amount1 Amount of token1 corresponding to the passed liquidityDelta between the two prices\n function getAmount1Delta(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n int128 liquidity\n ) internal pure returns (int256 amount1) {\n return\n liquidity < 0\n ? -getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(-liquidity), false).toInt256()\n : getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(liquidity), true).toInt256();\n }\n}\n"
},
"contracts/libraries/SwapMath.sol": {
"content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport './FullMath.sol';\nimport './SqrtPriceMath.sol';\n\n/// @title Computes the result of a swap within ticks\n/// @notice Contains methods for computing the result of a swap within a single tick price range, i.e., a single tick.\nlibrary SwapMath {\n /// @notice Computes the result of swapping some amount in, or amount out, given the parameters of the swap\n /// @dev The fee, plus the amount in, will never exceed the amount remaining if the swap's `amountSpecified` is positive\n /// @param sqrtRatioCurrentX96 The current sqrt price of the pool\n /// @param sqrtRatioTargetX96 The price that cannot be exceeded, from which the direction of the swap is inferred\n /// @param liquidity The usable liquidity\n /// @param amountRemaining How much input or output amount is remaining to be swapped in/out\n /// @param feePips The fee taken from the input amount, expressed in hundredths of a bip\n /// @return sqrtRatioNextX96 The price after swapping the amount in/out, not to exceed the price target\n /// @return amountIn The amount to be swapped in, of either token0 or token1, based on the direction of the swap\n /// @return amountOut The amount to be received, of either token0 or token1, based on the direction of the swap\n /// @return feeAmount The amount of input that will be taken as a fee\n function computeSwapStep(\n uint160 sqrtRatioCurrentX96,\n uint160 sqrtRatioTargetX96,\n uint128 liquidity,\n int256 amountRemaining,\n uint24 feePips\n )\n internal\n pure\n returns (\n uint160 sqrtRatioNextX96,\n uint256 amountIn,\n uint256 amountOut,\n uint256 feeAmount\n )\n {\n bool zeroForOne = sqrtRatioCurrentX96 >= sqrtRatioTargetX96;\n bool exactIn = amountRemaining >= 0;\n\n if (exactIn) {\n uint256 amountRemainingLessFee = FullMath.mulDiv(uint256(amountRemaining), 1e6 - feePips, 1e6);\n amountIn = zeroForOne\n ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true)\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true);\n if (amountRemainingLessFee >= amountIn) sqrtRatioNextX96 = sqrtRatioTargetX96;\n else\n sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput(\n sqrtRatioCurrentX96,\n liquidity,\n amountRemainingLessFee,\n zeroForOne\n );\n } else {\n amountOut = zeroForOne\n ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false)\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false);\n if (uint256(-amountRemaining) >= amountOut) sqrtRatioNextX96 = sqrtRatioTargetX96;\n else\n sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput(\n sqrtRatioCurrentX96,\n liquidity,\n uint256(-amountRemaining),\n zeroForOne\n );\n }\n\n bool max = sqrtRatioTargetX96 == sqrtRatioNextX96;\n\n // get the input/output amounts\n if (zeroForOne) {\n amountIn = max && exactIn\n ? amountIn\n : SqrtPriceMath.getAmount0Delta(sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true);\n amountOut = max && !exactIn\n ? amountOut\n : SqrtPriceMath.getAmount1Delta(sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false);\n } else {\n amountIn = max && exactIn\n ? amountIn\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioNextX96, liquidity, true);\n amountOut = max && !exactIn\n ? amountOut\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioNextX96, liquidity, false);\n }\n\n // cap the output amount to not exceed the remaining output amount\n if (!exactIn && amountOut > uint256(-amountRemaining)) {\n amountOut = uint256(-amountRemaining);\n }\n\n if (exactIn && sqrtRatioNextX96 != sqrtRatioTargetX96) {\n // we didn't reach the target, so take the remainder of the maximum input as fee\n feeAmount = uint256(amountRemaining) - amountIn;\n } else {\n feeAmount = FullMath.mulDivRoundingUp(amountIn, feePips, 1e6 - feePips);\n }\n }\n}\n"
},
"contracts/interfaces/IUniswapV3PoolDeployer.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title An interface for a contract that is capable of deploying Uniswap V3 Pools\n/// @notice A contract that constructs a pool must implement this to pass arguments to the pool\n/// @dev This is used to avoid having constructor arguments in the pool contract, which results in the init code hash\n/// of the pool being constant allowing the CREATE2 address of the pool to be cheaply computed on-chain\ninterface IUniswapV3PoolDeployer {\n /// @notice Get the parameters to be used in constructing the pool, set transiently during pool creation.\n /// @dev Called by the pool constructor to fetch the parameters of the pool\n /// Returns factory The factory address\n /// Returns token0 The first token of the pool by address sort order\n /// Returns token1 The second token of the pool by address sort order\n /// Returns fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// Returns tickSpacing The minimum number of ticks between initialized ticks\n function parameters()\n external\n view\n returns (\n address factory,\n address token0,\n address token1,\n uint24 fee,\n int24 tickSpacing\n );\n}\n"
},
"contracts/interfaces/IUniswapV3Factory.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n"
},
"contracts/interfaces/IERC20Minimal.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Minimal ERC20 interface for Uniswap\n/// @notice Contains a subset of the full ERC20 interface that is used in Uniswap V3\ninterface IERC20Minimal {\n /// @notice Returns the balance of a token\n /// @param account The account for which to look up the number of tokens it has, i.e. its balance\n /// @return The number of tokens held by the account\n function balanceOf(address account) external view returns (uint256);\n\n /// @notice Transfers the amount of token from the `msg.sender` to the recipient\n /// @param recipient The account that will receive the amount transferred\n /// @param amount The number of tokens to send from the sender to the recipient\n /// @return Returns true for a successful transfer, false for an unsuccessful transfer\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /// @notice Returns the current allowance given to a spender by an owner\n /// @param owner The account of the token owner\n /// @param spender The account of the token spender\n /// @return The current allowance granted by `owner` to `spender`\n function allowance(address owner, address spender) external view returns (uint256);\n\n /// @notice Sets the allowance of a spender from the `msg.sender` to the value `amount`\n /// @param spender The account which will be allowed to spend a given amount of the owners tokens\n /// @param amount The amount of tokens allowed to be used by `spender`\n /// @return Returns true for a successful approval, false for unsuccessful\n function approve(address spender, uint256 amount) external returns (bool);\n\n /// @notice Transfers `amount` tokens from `sender` to `recipient` up to the allowance given to the `msg.sender`\n /// @param sender The account from which the transfer will be initiated\n /// @param recipient The recipient of the transfer\n /// @param amount The amount of the transfer\n /// @return Returns true for a successful transfer, false for unsuccessful\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n /// @notice Event emitted when tokens are transferred from one address to another, either via `#transfer` or `#transferFrom`.\n /// @param from The account from which the tokens were sent, i.e. the balance decreased\n /// @param to The account to which the tokens were sent, i.e. the balance increased\n /// @param value The amount of tokens that were transferred\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /// @notice Event emitted when the approval amount for the spender of a given owner's tokens changes.\n /// @param owner The account that approved spending of its tokens\n /// @param spender The account for which the spending allowance was modified\n /// @param value The new allowance from the owner to the spender\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"
},
"contracts/interfaces/callback/IUniswapV3MintCallback.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n"
},
"contracts/interfaces/callback/IUniswapV3SwapCallback.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n"
},
"contracts/interfaces/callback/IUniswapV3FlashCallback.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#flash\n/// @notice Any contract that calls IUniswapV3PoolActions#flash must implement this interface\ninterface IUniswapV3FlashCallback {\n /// @notice Called to `msg.sender` after transferring to the recipient from IUniswapV3Pool#flash.\n /// @dev In the implementation you must repay the pool the tokens sent by flash plus the computed fee amounts.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param fee0 The fee amount in token0 due to the pool by the end of the flash\n /// @param fee1 The fee amount in token1 due to the pool by the end of the flash\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#flash call\n function uniswapV3FlashCallback(\n uint256 fee0,\n uint256 fee1,\n bytes calldata data\n ) external;\n}\n"
},
"contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n"
},
"contracts/interfaces/pool/IUniswapV3PoolState.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n"
},
"contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n"
},
"contracts/interfaces/pool/IUniswapV3PoolActions.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n"
},
"contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n"
},
"contracts/interfaces/pool/IUniswapV3PoolEvents.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n"
},
"contracts/libraries/BitMath.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title BitMath\n/// @dev This library provides functionality for computing bit properties of an unsigned integer\nlibrary BitMath {\n /// @notice Returns the index of the most significant bit of the number,\n /// where the least significant bit is at index 0 and the most significant bit is at index 255\n /// @dev The function satisfies the property:\n /// x >= 2**mostSignificantBit(x) and x < 2**(mostSignificantBit(x)+1)\n /// @param x the value for which to compute the most significant bit, must be greater than 0\n /// @return r the index of the most significant bit\n function mostSignificantBit(uint256 x) internal pure returns (uint8 r) {\n require(x > 0);\n\n if (x >= 0x100000000000000000000000000000000) {\n x >>= 128;\n r += 128;\n }\n if (x >= 0x10000000000000000) {\n x >>= 64;\n r += 64;\n }\n if (x >= 0x100000000) {\n x >>= 32;\n r += 32;\n }\n if (x >= 0x10000) {\n x >>= 16;\n r += 16;\n }\n if (x >= 0x100) {\n x >>= 8;\n r += 8;\n }\n if (x >= 0x10) {\n x >>= 4;\n r += 4;\n }\n if (x >= 0x4) {\n x >>= 2;\n r += 2;\n }\n if (x >= 0x2) r += 1;\n }\n\n /// @notice Returns the index of the least significant bit of the number,\n /// where the least significant bit is at index 0 and the most significant bit is at index 255\n /// @dev The function satisfies the property:\n /// (x & 2**leastSignificantBit(x)) != 0 and (x & (2**(leastSignificantBit(x)) - 1)) == 0)\n /// @param x the value for which to compute the least significant bit, must be greater than 0\n /// @return r the index of the least significant bit\n function leastSignificantBit(uint256 x) internal pure returns (uint8 r) {\n require(x > 0);\n\n r = 255;\n if (x & type(uint128).max > 0) {\n r -= 128;\n } else {\n x >>= 128;\n }\n if (x & type(uint64).max > 0) {\n r -= 64;\n } else {\n x >>= 64;\n }\n if (x & type(uint32).max > 0) {\n r -= 32;\n } else {\n x >>= 32;\n }\n if (x & type(uint16).max > 0) {\n r -= 16;\n } else {\n x >>= 16;\n }\n if (x & type(uint8).max > 0) {\n r -= 8;\n } else {\n x >>= 8;\n }\n if (x & 0xf > 0) {\n r -= 4;\n } else {\n x >>= 4;\n }\n if (x & 0x3 > 0) {\n r -= 2;\n } else {\n x >>= 2;\n }\n if (x & 0x1 > 0) r -= 1;\n }\n}\n"
},
"contracts/libraries/UnsafeMath.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Math functions that do not check inputs or outputs\n/// @notice Contains methods that perform common math functions but do not do any overflow or underflow checks\nlibrary UnsafeMath {\n /// @notice Returns ceil(x / y)\n /// @dev division by 0 has unspecified behavior, and must be checked externally\n /// @param x The dividend\n /// @param y The divisor\n /// @return z The quotient, ceil(x / y)\n function divRoundingUp(uint256 x, uint256 y) internal pure returns (uint256 z) {\n assembly {\n z := add(div(x, y), gt(mod(x, y), 0))\n }\n }\n}\n"
},
"contracts/libraries/FixedPoint96.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 800
},
"metadata": {
"bytecodeHash": "none"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"libraries": {}
}
}} |
1 | 20,290,485 | 17e5bdabadd3869217171c692572ce09ffbb756821b13b3f674cdb1c34508ce4 | ce382f5018494d8d735445f223469bcb24ecc0b760c71397a0918844b0839fe2 | a7fb5ca286fc3fd67525629048a4de3ba24cba2e | c77ad0a71008d7094a62cfbd250a2eb2afdf2776 | fc91088fde23165ebaa9e576559bc7a06804d618 | 608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe |
Subsets and Splits